JBoss Tools SVN: r2595 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-23 08:42:46 -0400 (Mon, 23 Jul 2007)
New Revision: 2595
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizardPage.java
Log:
Obsolete *.pex extension usage removed
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizardPage.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizardPage.java 2007-07-23 12:13:31 UTC (rev 2594)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizardPage.java 2007-07-23 12:42:46 UTC (rev 2595)
@@ -13,7 +13,6 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
-import java.io.FileFilter;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -47,7 +46,6 @@
import org.jboss.tools.jst.web.messages.xpl.WebUIMessages;
public class ImportWebProjectWizardPage extends WizardPage {
- private FileFilter projectFilter;
private ImportWebDirProjectContext context;
private XAttributeSupport support;
private IModelPropertyEditorAdapter projectNameAdapter;
@@ -84,11 +82,6 @@
if(getWebXmlFile(context.getInitialLocation()) != null)
webXmlLocationAdapter.setValue("" + context.getInitialLocation()); //$NON-NLS-1$
}
- projectFilter = new FileFilter() {
- public boolean accept(File pathName) {
- return pathName.getName().endsWith(".pex"); //$NON-NLS-1$
- }
- };
}
public void dispose() {
@@ -191,25 +184,9 @@
projectNameAdapter.addValueChangeListener(updateDataListener);
}
- private File getPexFile() {
- File directory = new File(getWebXmlLocationValue()).getParentFile();
- if (directory == null || directory.isFile())
- return null;
-
- File[] files = directory.listFiles(projectFilter);
- if (files != null && files.length > 0) {
- File result = null;
- for (int i = 0; i < files.length && result == null; i++)
- if ("workspace.pex".equals(files[i].getName())) result = files[i]; //$NON-NLS-1$
- if (result == null) result = files[0];
- return result;
- } else
- return null;
- }
-
private void updateProjectNameValue(boolean onProjectNameEdit, boolean onProjectLocationEdit) {
if(context.isInitialized()) return;
- File projectFile = getPexFile();
+ File projectFile = null;
projectNameEditor.getFieldEditor((Composite)getControl()).setEnabled(projectFile == null, (Composite)getControl());
if (onProjectNameEdit) {
17 years, 5 months
JBoss Tools SVN: r2594 - in trunk/documentation/GettingStartedGuide/docs/userguide/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: afedosik
Date: 2007-07-23 08:13:31 -0400 (Mon, 23 Jul 2007)
New Revision: 2594
Added:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AddBusinessProcess.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/CURDAppWalkthrough.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GenCURDDatabaseApp.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GetStartSeamGen.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/ManageJBossAS.xml
Removed:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AjaxCRUDApplicationWithSeamAndRichFaces.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/BusinessProcessAndRulesApplication.xml
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/master.xml
Log:
http://jira.jboss.com/jira/browse/EXIN-398 New structure for GSG guide
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/master.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/master.xml 2007-07-23 11:53:37 UTC (rev 2593)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/master.xml 2007-07-23 12:13:31 UTC (rev 2594)
@@ -3,8 +3,12 @@
"../../resources/support/docbook-dtd/docbookx.dtd"
[<!ENTITY GettingStartedWithRHDS SYSTEM "modules/GettingStartedWithRHDS.xml">
-<!ENTITY AjaxCRUDApplicationWithSeamAndRichFaces SYSTEM "modules/AjaxCRUDApplicationWithSeamAndRichFaces.xml">
-<!--<!ENTITY BusinessProcessAndRulesApplication SYSTEM "modules/BusinessProcessAndRulesApplication.xml">-->
+<!ENTITY ManageJBossAS SYSTEM "modules/ManageJBossAS.xml">
+<!ENTITY GetStartSeamGen SYSTEM "modules/GetStartSeamGen.xml">
+<!ENTITY GenCURDDatabaseApp SYSTEM "modules/GenCURDDatabaseApp.xml">
+<!ENTITY CURDAppWalkthrough SYSTEM "modules/CURDAppWalkthrough.xml">
+<!ENTITY AddBusinessProcess SYSTEM "modules/AddBusinessProcess.xml">
+
]>
<book>
@@ -24,11 +28,10 @@
&GettingStartedWithRHDS;
-&AjaxCRUDApplicationWithSeamAndRichFaces;
-<!--&BusinessProcessAndRulesApplication;-->
- <!--
- &GettingStartedGuideforJavaServerFaces;
- -->
-
-
+&ManageJBossAS;
+&GetStartSeamGen;
+&GenCURDDatabaseApp;
+&CURDAppWalkthrough;
+&AddBusinessProcess;
+
</book>
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AddBusinessProcess.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AddBusinessProcess.xml (rev 0)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AddBusinessProcess.xml 2007-07-23 12:13:31 UTC (rev 2594)
@@ -0,0 +1,480 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="AddBusinessProcess" xreflabel="AddBusinessProcess">
+ <?dbhtml filename="AddBusinessProcess.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>Business process</keyword>
+ <keyword>Seam</keyword>
+ <keyword>JBoss Rules</keyword>
+ <keyword>CURD-application</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Business process and rules application</title>
+ <para>Rules and business processes are important components in many enterprise applications.
+ They help business analysts to get involved in the design and implementation of the software
+ project. Rules and business processes are also essential to complex internal states of large,
+ multi-user systems. The JBoss Rules engine (formerly known as Drools) and jBPM business
+ process engine are two production-ready open source products supported by Red Hat. It is
+ very easy to incorporate rules and business processes into a Seam web application using the
+ Red Hat Developer Studio. In this section, we further re-factor the CRUD application we
+ already have and add support for an "order management" process. The user scenario is to
+ simulate the following process and rules:</para>
+ <itemizedlist>
+ <listitem>The site administrator logs in and sees a list of outstanding orders</listitem>
+ <listitem>She goes through the inventory (by hand or using another computer system) and
+ determines the availability of the products in each order. She enters that information to
+ each order.</listitem>
+ <listitem>She starts a process for each order, which determines whether to ship the order
+ or refund the order based on a business rule applied to the availability status. For
+ instance, an "in stock" status triggers a "ship" action while the "back order" status
+ triggers a "refund" action.</listitem>
+ <listitem>When the business process reaches the "ship" or "refund" state, it will take
+ appropriate actions (e.g., to submit shipping orders to Fedex or to contact the credit
+ card company for refund). In this simple case, we will just print out a message on the
+ console to prove that we can execute any code in those stages.</listitem>
+ </itemizedlist>
+ <para>While this process sounds simple, it is the basis for very complex business
+ processes. In this section of the tutorial, we will show you how this is done via the
+ following steps:</para>
+ <itemizedlist>
+ <listitem>Add a rule definition to the application</listitem>
+ <listitem>Add a business process that uses that rule to the application</listitem>
+ <listitem>Start the business process from a web action</listitem>
+ </itemizedlist>
+<section id="ImportConfigurationFilesAndJavaCode">
+<?dbhtml filename="ImportConfigurationFilesAndJavaCode.html"?>
+<title>Import configuration files and Java code</title>
+<para>Before we start, we need to import some configuration and Java files for the demo project.
+Those files are very simple and we will review them as we go along with the tutorial. We import
+them here to reduce potential typos and other errors in the tutorial.</para>
+<orderedlist>
+<listitem>Choose the <emphasis>File > Import ...</emphasis> menu and then select <emphasis>General > Existing</emphasis> project into workspace and
+click on the Next button.</listitem>
+</orderedlist>
+<figure>
+<title>Importing Project</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/ProjectImporting.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<orderedlist continuation="continues">
+<listitem>To make this demo a little more manageable we have already created some demo code
+that is available in the rules-bpm directory of your tutorial distribution code. It is
+ located in the root directory of the distribution. Select the rules-bpm directory and check
+ the "Copy projects into the workspace" directory check box.</listitem>
+</orderedlist>
+<para>You will have a different directory on your machine than the screen shot shown below.</para>
+<figure>
+<title>Selecting Directory To Import</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/ImportDirectory.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<orderedlist continuation="continues">
+<listitem>After this step you will see a new project called "rules-bpm". If you expand that
+directory, you will see numerous files as shown below. We will look at these files in this
+ section of the demo. We will first start by copying these files into our EclipseCon project.</listitem>
+</orderedlist>
+
+<figure>
+<title>Project Structure</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/ProjectStructure.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<orderedlist continuation="continues">
+<listitem>Right click on the rules-bpm/build.xml file, and select <emphasis>Run AS ... > Ant</emphasis> Build.</listitem>
+</orderedlist>
+
+<figure>
+<title>AntBuild</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/AntBuild.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<orderedlist continuation="continues">
+<listitem>Right click on the EclipseCon project and select Refresh from the menu to pick up
+ the changes made to the demo application. The rules-bpm/build.xml script copies a bunch of files
+ into your existing EclipseCon project. We will look at them soon.</listitem>
+</orderedlist>
+</section>
+<section id="CreateARuledefinition">
+<?dbhtml filename="CreateARuledefinition.html"?>
+<title>Create a rule definition</title>
+<para>In this section, we create a business rule that can be used in junction with the business
+ process. When the rule is executed, it checks the status of the currently selected order. If the
+ order status is "in stock", meaning that a person has check off line and verified the
+ availability of the product ordered, the system changes the order status to "ship", meaning
+ that someone will now ship the product as the next step in the process. If the order status
+ is "back order", the rule changes the order status to "refund" automatically to trigger the
+ business process of refunding.</para>
+ <orderedlist>
+ <listitem>Select the<emphasis> EclipseCon/resources </emphasis>directory. That is where we are going to put the
+ rules definition file.</listitem>
+ <listitem>Select the following menu actions: <emphasis>File > New > Other ... > JBoss Rules > New
+ Rules Resource</emphasis> to bring up the JBoss Rules wizard.</listitem>
+ </orderedlist>
+ <figure>
+<title>New Rules File</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/NewRulesFile.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<orderedlist continuation="continues">
+<listitem>Fill out the above window with the following values.</listitem>
+</orderedlist>
+<table>
+ <title>Rule Table</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Field Name</entry>
+ <entry>Field Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>File Name</entry>
+ <entry>process-order.drl</entry>
+ </row>
+ <row>
+ <entry>Type of Rule Resource</entry>
+ <entry>New DRL (rule package)</entry>
+ </row>
+ <row>
+ <entry>Rule Package Name</entry>
+ <entry>process.order</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <orderedlist continuation="continues">
+<listitem>Replace the content of the process-order.drl file with the follow rule.</listitem>
+</orderedlist>
+<programlisting role="JAVA"><![CDATA[package process.order
+ import com.mydomain.EclipseCon.Orders;
+
+rule "Ship order rule"
+ when
+ order : Orders(status == "in stock")
+ then
+ order.setStatus("ship");
+end
+
+rule "Refund order rule"
+ when
+ order : Orders(status == "back order")
+ then
+ order.setStatus("refund");
+end
+]]></programlisting>
+<para>Notice that the IDE automatically highlights the syntax and provides auto-completion help.
+ You may wonder how Seam knows to load the process-order.drl file for the application.</para>
+ <para>If you look in the <emphasis>resources/WEB-INF/components.xml</emphasis> file we copied from the imported
+ rules-bpm project. It has an element pointing to the process-order.drl file.</para>
+ <programlisting role="XML"><![CDATA[<drools:rule-base name="securityRules">
+ <drools:rule-files>
+ <value>/security.drl</value>
+ </drools:rule-files>
+ </drools:rule-base>
+]]></programlisting>
+</section>
+<section id="CreateABusinessProcessDefinition">
+<?dbhtml filename="CreateABusinessProcessDefinition.html"?>
+<title>Create a business process definition</title>
+<para>Next, let's create a business process that manages the order process. The business process
+ essentially specifies a sequence of actions that has to happen before an order is shipped or
+ refunded. Since the business analyst typically designs this process, it is very high level and
+ can be drawn up in a GUI designer.</para>
+ <orderedlist>
+ <listitem>Select the<emphasis> EclipseCon/resources </emphasis>folder and select menu actions <emphasis>File > New > File</emphasis>.
+ Add a new file called process-order.jpdl.xml as shown below:</listitem>
+ </orderedlist>
+ <figure>
+<title>Creating New File Resource</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/CreatingNewFileResource.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+
+<orderedlist continuation="continues">
+<listitem>Add the following content to the process-order.jpdl.xml file. It is an empty jBPM
+process definition, and allows us to use the jBPM visual designer to further edit it.</listitem>
+</orderedlist>
+<programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<process-definition
+ xmlns="" name="process-order">
+</process-definition>
+]]></programlisting>
+<orderedlist continuation="continues">
+<listitem>Right click on the process-order.jpdl.xml file and select <emphasis>Open with ... > jBPM
+Graphical Process Designer</emphasis>.</listitem>
+</orderedlist>
+<figure>
+<title>Opening Graphical Process Designer</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/GraphicalProcessDesigner.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<orderedlist continuation="continues">
+<listitem>In the designer, drag and drop nodes and transition lines until you have a process
+ shown in the following image. This is a high level process and aimed at business level non
+ technical users.</listitem>
+</orderedlist>
+<para>To draw a node, click on the type of the node in the palette. You should be able to see
+that based on the icon on the node as shown below. Draw a rectangle on the canvas and the
+ appropriate node will be rendered.</para>
+ <para>To draw a transition click on the transition icon in the palette, choose the source node
+ and then the destination node. This will draw a transition from the source to the destination.</para>
+ <para>To change the name on the node or transition, select the object and change the name in
+ the properties view or simply double click on the node or the transition line to change it.</para>
+ <figure>
+<title>Diagram View</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/DiagramView.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<orderedlist continuation="continues">
+<listitem>Save this file. You can click on the Source tab to view the generated XML file for
+ the process.</listitem>
+</orderedlist>
+</section>
+<section id="AssociateProcessNodesWithJavaCode">
+<?dbhtml filename="AssociateProcessNodesWithJavaCode.html"?>
+<title>Associate process nodes with Java code</title>
+<para>With the business process in the designer, we can now associate each node with Java code.
+ The Java code is executed when the node is reached in the process, and the Java code determines
+ the outcome of each node – hence the next node in the process.</para>
+ <para>Let's go through the exercise for the "Check Inventory" node first.</para>
+ <orderedlist>
+ <listitem>Right click on the "Check Inventory" node in the designer and select <emphasis>Add
+ Actions > Node Enter </emphasis>from the menu as shown below.</listitem>
+ </orderedlist>
+ <figure>
+<title>Node Entering</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/NodeEntering.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<orderedlist continuation="continues">
+<listitem>In the Outline view tab, open the tree view of process-order > Check Inventory >
+node enter, and you will see action1. The Outline view may be hidden or on the left side of the
+ IDE.</listitem>
+</orderedlist>
+<figure>
+<title>Outline View</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/OutlineView.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<orderedlist continuation="continues">
+<listitem>Double click on action1 to bring up the wizard. Select Handler on the left and enter
+ com.mydomain.EclipseCon.process. CheckInventoryAction as the class and bean as the type as shown
+ below. You can can also search for the class by clicking on the <emphasis>Browse...</emphasis> button.</listitem>
+</orderedlist>
+<figure>
+<title>Action Handler</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/ActionHandler.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>Explanation: Now, you must wonder where this
+com.mydomain.EclipseCon.process.CheckInventoryAction class come from It comes from the
+eclipsecon-rules-bpm project we imported. The Java class has a single method that is executed
+when the "Check Inventory" node is reached in the process. The method just fires the rule we
+previously defined in process-order.drl. After the rule is executed, it updates the
+"inventoryStatus" component. Here is the method:</para>
+<programlisting role="JAVA"><![CDATA[public void execute(ExecutionContext ctx) throws Exception {
+
+ //get a handle to the rules engine
+ Component c = (Component) Contexts.getApplicationContext().get(
+ "orderWorkingMemory.component");
+ WorkingMemory wm = (WorkingMemory) ((ManagedWorkingMemory) c
+ .newInstance()).getWorkingMemory();
+
+ //get the ordersHome variable that was set in OrderProcessor.
+ OrdersHome order = (OrdersHome) ctx.getVariable("ordersHome");
+
+ //Assert Orders to working memory and fire rules
+ wm.assertObject(order.getInstance());
+ wm.fireAllRules();
+
+
+ //persist the updated Orders object
+ order.persist();
+
+ //set inventory status so decision node knows what to do
+ ctx.setVariable("inventoryStatus", order.getInstance().getStatus());
+ System.out.println("CHECK INVENTORY - STATUS: "
+ + order.getInstance().getStatus());
+}
+]]></programlisting>
+<para>The "inventoryStatus" component is then used in the "Inventory Decision" node to determine
+which node to go to next. To do that, open the process-order.jpdl.xml file in the text editor and
+ change the node from this</para>
+ <programlisting role="XML"><![CDATA[<decision name="Inventory Decision">
+ <transition name="ship" to="Ship Order"></transition>
+ <transition name="refund" to="Refund Order"></transition>
+ </decision>
+]]></programlisting>
+<para>to this:</para>
+<programlisting role="XML"><![CDATA[<decision name="Inventory Decision" expression="#{inventoryStatus}">
+ <transition name="ship" to="Ship Order"></transition>
+ <transition name="refund" to="Refund Order"></transition>
+ </decision>
+]]></programlisting>
+<para>Now, let's repeat the exercise to assign handler Java classes to the "Ship Order" and "Refund Order" nodes. </para>
+<itemizedlist>
+<listitem>Associate "Ship Order" node with the com.mydomain.EclipseCon.process.ShipOrderAction
+bean</listitem>
+<listitem>Associate "Refund Order" node with the com.mydomain.EclipseCon.process.SendRefundAction bean</listitem>
+</itemizedlist>
+<para>As we described earlier, in a real world system, those two nodes would invoke Java code
+ that perform real shipping and refunding tasks. But here we just print out a message as a proof
+ of concept. You can look into their Java classes if you have time.</para>
+</section>
+<section id="StartTheProcessFromAWebAction">
+<?dbhtml filename="StartTheProcessFromAWebAction.html"?>
+<title>Start the process from a web action</title>
+<para>Finally, we need a "hook" to start the entire business process. We will add a new Process
+ Order button to the Orders.xhtml file.</para>
+ <para>You can add the new button right next to the existing "Add orderdetails" button.
+ Copy/paste the following button code in the actionButtons region:</para>
+ <programlisting role="JSP"><![CDATA[<s:button id="buttonId" value="Process Order"
+ action="#{orderProcessor.startProcess}"
+ view="/Orders.xhtml"/>
+]]></programlisting>
+<para>Explanation: When you click on the Process Order button, Seam invokes
+the #{orderProcessor.startProcess} method, which in turn, starts the business process. The Java
+code for the #{orderProcessor} component is in the com.mydomain.EclipseCon.process.OrderProcessor
+class. Like other Java source files in the process package, the OrderProcessor.java is already
+copied to the EclipseCon project when you run the build.xml script from the imported rules-bpm
+ project. Here is the content of the OrderProcessor.java file. The startProcess() method, which
+ is invoked from the Process Order button, starts the process-order process we just created.</para>
+<programlisting role="JAVA"><![CDATA[@Name("orderProcessor")
+public class OrderProcessor {
+
+ //Set the Orders object as a jBPM context variable
+ @In(create = true)
+ @Out(scope = ScopeType.BUSINESS_PROCESS)
+ OrdersHome ordersHome;
+
+ //Execute the jBPM process
+ @CreateProcess(definition = "process-order")
+ public String startProcess() {
+ return "success";
+ }
+}
+]]></programlisting>
+</section>
+<section id="TryItOut">
+<?dbhtml filename="TryItOut.html"?>
+<title>Try it out</title>
+<para>Now save the project and restart the server to make sure that it is properly re-deployed.
+Navigate to the OrdersList page and enter "In Process" to the status field to search for
+un-processed orders.</para>
+<para>Select one order and edit the order and change the "status" field to "in stock" and
+click "Done". Please enter the case exactly as indicated here:</para>
+<figure>
+<title>Order Edit Page</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/OrderEditPage.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>Click the "Process Order" button.</para>
+<figure>
+<title>Order Details</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/OrderDetails.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>The business process should lead to the ShipOrderAction bean, which will print out the
+ "SHIP ORDER" message in the console view tab at the bottom of the IDE screen.</para>
+ <figure>
+<title>Console View</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/ConsoleView.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>Select one order and change the "status" field to "back order" and click "Done". Please
+enter the case exactly as indicated here:</para>
+<figure>
+<title>Changing Status Field</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/ChangingStatusField.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>Click the "Process Order" button.</para>
+<figure>
+<title>Invoking Process Order</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/InvokingProcessOrder.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>The business process should invoke the SendRefundAction bean, which will print out the
+"SEND REFUND" message in the console view tab at the bottom of the IDE screen.</para>
+<figure>
+<title>Console Panel</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/ConsolePanel.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>This example shows a simple example of the powerful jBPM and JBoss Rules runtimes
+integrated in a Seam application. We have also see how easy it is build these kinds of
+applications using the Red Hat Developer Studio.</para>
+</section>
+<section id="TroubleshootingOnLinux">
+<?dbhtml filename="TroubleshootingOnLinux.html"?>
+<title>Troubleshooting on Linux</title>
+<para>Linux users may need to do the following to get the Eclipse distribution to work correctly
+on their machines.</para>
+<orderedlist>
+<listitem>On Red Hat based Linux distributions install the xpLib.i386 package</listitem>
+<listitem>ln -s libstdc++.so.5.0.7 libstdc++.so.5</listitem>
+<listitem>Open the RHDS perspective. If you see the Help view open, close it and restart RHDS</listitem>
+<listitem>If none of these work, do the following
+<itemizedlist>
+<listitem>Clear the Eclipse log file, <workspace>\.metadata\.log</listitem>
+<listitem>Start Eclipse with the -debug option:
+<para>eclipse -debug</para></listitem>
+<listitem>Post the Eclipse log file (<workspace>\.metadata\.log) on the forums.</listitem>
+</itemizedlist>
+</listitem>
+</orderedlist>
+</section>
+ </chapter>
\ No newline at end of file
Deleted: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AjaxCRUDApplicationWithSeamAndRichFaces.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AjaxCRUDApplicationWithSeamAndRichFaces.xml 2007-07-23 11:53:37 UTC (rev 2593)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AjaxCRUDApplicationWithSeamAndRichFaces.xml 2007-07-23 12:13:31 UTC (rev 2594)
@@ -1,700 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="AjaxCRUDApplicationWithSeamAndRichFaces" xreflabel="AjaxCRUDApplicationWithSeamAndRichFaces">
- <?dbhtml filename="AjaxCRUDApplicationWithSeamAndRichFaces.html"?>
- <chapterinfo>
- <keywordset>
- <keyword>Red Hat Developer Studio</keyword>
- <keyword>Seam</keyword>
- <keyword>JBoss</keyword>
- <keyword>CRUD-application</keyword>
- </keywordset>
- </chapterinfo>
-
- <title>Ajax CRUD-application with Seam and Rich Faces</title>
-<para>In this chapter we will see how easy it is to build Seam applications and integrate
-them with Ajax4jsf and Rich Faces. We will bootstrap the application using Seam Gen which is
- a CRUD application generator. Seam Gen can be used from either the command line or via an
- Eclipse Plugin. Unlike most application generators, Seam Gen can also be used to
- incrementally add more functionality to an existing Seam application.</para>
- <para>Seam is an incredibly flexible development framework that can be completely
- integrated with a Java EE server or in a simple POJO environment like Tomcat. Seam is
- also extremely portable, and has been tested on several popular containers like JBoss,
- Tomcat, Weblogic, WebSphere. Seam uses JSF as its view layer and can use either JSP or
- Facelets as the presentation layer.</para>
- <para>Seam Gen generates all the required layers of an application. It uses JPA as the
- persistence layer, POJO's (Plain Old Java Objects) as the business logic layer and
- Facelets as the presentation layer.</para>
- <para>We will perform the following steps in this chapter of the tutorial:</para>
- <itemizedlist>
- <listitem>Creating a Seam Project using Seam Gen</listitem>
- <listitem>Generating a Seam application using Seam Gen</listitem>
- <listitem>Running the Seam application</listitem>
- <listitem>Customizing the generated Seam application</listitem>
- <listitem>Adding AJAX features to automatically generated JSF Seam UI components</listitem>
- <listitem>Replacing standard JSF UI components with AJAX enabled rich UI components
- provided by the Red Hat Developer Studio</listitem>
- <listitem>Using AJAX components to do live validation on web pages</listitem>
- <listitem>Adding Rich Faces components to a Seam application</listitem>
- </itemizedlist>
-<section id="CreatingASeamProjectUsingSeamGen">
-<?dbhtml filename="CreatingASeamProjectUsingSeamGen.html"?>
-<title>Creating a Seam Project using Seam Gen</title>
-<itemizedlist>
-<listitem>Stop your JBoss AS Server by clicking on the stop button as shown below. We are
- doing this so that the generated application can be deployed properly when the server
- starts.</listitem>
- </itemizedlist>
- <figure>
-<title>Stopping JBoss AS Server</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/StoppingServer.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist continuation="continues">
-<listitem>To create a Seam project, select <emphasis>Seam Gen > Setup/Configuration > Setup </emphasis>to
-launch the Seam Gen setup window as shown below. Note: </listitem>
-</itemizedlist>
-<note>
- <title>Note:</title>
- <para>If this is the first time you run
-Seam Gen a file dialog will be shown. In this you need to select <seam>/seam-gen/build.xml
- so the plugin knows which seam-gen to use.</para>
- </note>
-<para></para>
-
- <figure>
-<title>Seam Gen Setup Window</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/SeamGenSetup.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>Fill the items in the dialog as shown below and select the <emphasis>OK</emphasis> button.</para>
-<table>
- <title>Filling Project Items</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Field Name</entry>
- <entry>Field Value</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>Project</entry>
- <entry>EclipseCon</entry>
- </row>
- <row>
- <entry>Seam project workspace</entry>
- <entry><your project directory></entry>
- </row>
- <row>
- <entry>JBoss AS Home directory</entry>
- <entry><JBoss AS Home Dir></entry>
- </row>
- <row>
- <entry>Driver Location</entry>
- <entry><seam>/<seam-gen>/lib/hsqldb.jar</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <para>The plug-in will initialize the Seam Gen ant tasks that simplify all key Seam
- operations. We will invoke several of these ant tasks via the Seam Eclipse Plugin
- throughout this tutorial.</para>
- <para>The plug-in will also prompt you to create a project. Select "Yes" to create a
- Project. This step will create not only an Eclipse project but also all the required
- artifacts to get you started.</para>
- <para>The plug-in will also prompt you create a database connection. Select
- "Yes" to create a WTP Database connection that connects to the default HSQL DB
- instance that we have set up. If you are using any other database then set up the
- appropriate database settings in the Seam Gen setup window.</para>
- <para>At the end of this step you will see an Eclipse project called "EclipseCon"
- as shown below. This project has all the necessary elements required to deploy
- a Seam application.</para>
- <figure>
-<title>EclipseCon Project Structure</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/EclipseConProjectStructure.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist continuation="continues">
-<listitem>Start the application server. Open your favorite browser and point to the
-following URL http://localhost:8080/EclipseCon. You should see the following page:</listitem>
-</itemizedlist>
-<figure>
-<title>Created Project</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/CreatedProject.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>Congratulations! You have written your first Seam application.</para>
-<itemizedlist continuation="continues">
-<listitem>Let us take a look at the database connection that was created by the Eclipse
- Plugin and browse the database provided. The database connection view should now have a
- connection to our sample database as shown below.</listitem>
- </itemizedlist>
- <figure>
-<title>Connections View</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/ConnectionsView.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>Right click on the connection > Reconnect. Just specify "sa" as the user id. The password
- field should be blank.</para>
- <para>You should now be able to browse the database and see the meta-data and query data using SQL.
- Your meta-data should look like the following:</para>
- <figure>
-<title>Meta-data View</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/Metadata.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-</section>
-<section id="GeneratingACRUDApplicationUsingSeamGen">
-<?dbhtml filename="GeneratingACRUDApplicationUsingSeamGen.html"?>
-<title>Generating a CRUD application using Seam Gen</title>
-<itemizedlist>
-<listitem>The next step in our exercise is to generate a full blown application using Seam Gen.
-This application will generate CRUD pages and Search pages for all the entities in the database.
-Click on Seam Gen > Generate Entities. Seam Gen will connect to the database we defined in the
- setup part of the application and generate all the required components.</listitem>
- <listitem>Since Seam Gen is generating files on the file system that Eclipse does not know
- about, right click on the project name on your project and choose the Refresh item. This will let
- Eclipse know that there are new files and get them updated in the Eclipse project and deployed
- in the JBoss instance.</listitem>
- <listitem>Restart you application server, just in case those files have not been properly
- synchronized with the application server.</listitem>
- <listitem>Point your favorite browser to the following URL http://localhost:8080/EclipseCon.
- You will see the following page:</listitem>
- </itemizedlist>
- <figure>
-<title>EclipseCon Project</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/CreatedProject12.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist continuation="continues">
-<listitem>Let us now look at one of the entities and see what has been generated. Click on the
- "Offices List" to see a search page that allows you to filter the list and the list of all the
- offices in the database.</listitem>
- <listitem>Type in USA in the country field and click on Search to get a list of offices in the
- USA as shown below.</listitem>
- </itemizedlist>
- <figure>
-<title>Search Panel</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/SearchPanel.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-
-<itemizedlist continuation="continues">
-<listitem>Let us now check out the editing capability of the generated Seam application. Select
- the first office code and click on the Edit button. You will be prompted for a userID and
- password. Use "seamuser" for both user and password. You should at this point see the edit page
- as shown below. Notice that the NOT NULL columns in the database table are automatically marked
- with the red * to indicate that they are required.</listitem>
- </itemizedlist>
- <figure>
-<title>Generated Edit Page</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/GeneratedEditPage.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist continuation="continues">
-<listitem>Change a few things and save changes. This should update the record in the database.
- There you have it. A simple and easy way to bootstrap your applications.</listitem>
- <listitem>Let us look at how validations are done in Seam. Go back to and edit another office
- record and this time leave the city blank and click on the Save button. You will see the default
- Seam validations get triggered. In this case the "value required" validation is fired as shown
- below.</listitem>
- </itemizedlist>
-<figure>
-<title>Error Reporting</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/ValidationInEditPage.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-</section>
-<section id="CustomizingTheGeneratedApplication">
-<?dbhtml filename="CustomizingTheGeneratedApplication.html"?>
-<title>Customizing the generated application</title>
-<itemizedlist>
-<listitem>Let us look at a couple of simple things we can change in the generated application
- to show you that the generated application can be customized. Let us start by changing the edit
- page that we just saw. We will clean up the labels using the Facelet designer as shown below.
- Open the view directory in your project and double click on the OfficeEdit.xhtml file.</listitem>
-</itemizedlist>
-<figure>
-<title>Facelet Designer</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/FaceletDesigner.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>Unlike other WYSIWYG editors which developers tend to hate, the visual designers in Red Hat
- Developer Studio are designed for developers to rapidly find their way in a source file, while
- still allowing them to visually look at a document.</para>
-
-<itemizedlist continuation="continues">
-<listitem>To change a label text, click on a label in the designer. This will position the
- cursor at the correct location in the source view. Type the new label there. The designer does
- not force the developer to use the WYSIWIG environment. Change all the labels for the edit page.</listitem>
- </itemizedlist>
- <para>Once you save the page, the IDE automatically rebuilds the application and re-deploys it.
- So, just reload your browser and you should see an updated web page like the following. If for
- some reason the re-deployment did not work, stop and restart the server normally resolves the issue.</para>
- <figure>
-<title>Edit Page</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/EditPage.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-</section>
-<section id="UsingHibernateToolsToInteractWithTheJPAEntities">
-<?dbhtml filename="UsingHibernateToolsToInteractWithTheJPAEntities.html"?>
-<title>Using Hibernate tools to interact with the JPA Entities</title>
-<para>As part of generating the application, Seam Gen also generates JPA entities that are used
- to interact with the database. Let us quickly take a look at Hibernate tools and see how we can
- interact with the database using HQL and the Hibernate Criteria API.</para>
- <itemizedlist>
- <listitem>Open the Hibernate Configurations View. You should be able to open the console like
- the other views we have seen so far in the tutorial. Your view should resemble the following:</listitem>
- </itemizedlist>
- <figure>
-<title>Hibernate Configurations View</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/HibernateConfigurationsView.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist continuation="continues">
-<listitem>Before we run the HQL, let us open up the "Hibernate Query Result" and the "Hibernate
- Dynamic SQL Preview" views. You should be able to do that in a manner similar to other views we
- have opened in this tutorial. Alternatively you can open the Hibernate Console Perspective where
- these views are opened up by default.</listitem>
- <listitem>Click on the "HQL" icon in the "Hibernate Configurations" view. This will open up
- the HQL Designer view as shown below. Also, select "EclipseCon" from the drop down menu next to
- the green "run" button.</listitem>
- </itemizedlist>
- <figure>
-<title>HQL Designer View</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/HQLDesignerView.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist continuation="continues">
-<listitem>Type in a simple query as shown above "from Offices o" and click on the green "run"
- button. You should see the result of the HQL query in the "Hibernate Query Result" window as
- shown below.</listitem>
- </itemizedlist>
- <figure>
-<title>Hibernate Query Result Window</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/HibernateQueryResultWindow.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist continuation="continues">
-<listitem>Click on any of the objects in the result and you should be able see the contents of
- the objects in the Property view as shown below. If you don't have the view open in your
- perspective, you can open this view like all other views in this tutorial.</listitem>
- </itemizedlist>
- <figure>
-<title>Property View</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/PropertyView.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>Select the "Hibernate Dynamic SQL Preview" view to the generated SQL. This is a great tool
-to see the SQL being generated by Hibernate for your HQL. Not only is this a great debugging tool,
- it is also a great way to optimize your HQL queries.</para>
- <figure>
-<title>Hibernate Dynamic SQL Preview</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/HibernateDynamicSQLPreview.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist continuation="continues">
-<listitem>Let us try a slightly more complex query. Type in the following query in the query
-window and see how the query result changes and the SQL Preview changes.</listitem>
- </itemizedlist>
- <programlisting role="JAVA"><![CDATA[select city, state, postalcode
- from Offices o
- where country = 'USA'
-]]></programlisting>
-<itemizedlist continuation="continues">
-<listitem>Let us try the Hibernate criteria APIs next. To use Hibernate Criteria APIs click on
-the "CRI" button in the Hibernate Configurations View. This will open the Criteria API designer
-view. Type in this simple criteria query as shown below and click on the green run button to see
- the results. Also, select "EclipseCon" from the drop down menu next to the green "run" button.</listitem>
- </itemizedlist>
- <programlisting role="JAVA"><![CDATA[session.createCriteria(Offices.class)
-]]></programlisting>
-<para>The results will be very similar to the HQL query except that the criteria query does not
-generate the SQL in the "Hibernate Dynamic SQL Preview" view.</para>
-<itemizedlist continuation="continues">
-<listitem>Let us try something a little more complex. Let us filter all offices in the USA as
-shown below. The results of this query should be very similar to the results of the HQL.</listitem>
- </itemizedlist>
- <programlisting role="JAVA"><![CDATA[session.createCriteria(Offices.class)
- .add(Restrictions.eq("country", "USA")) ;
-]]></programlisting>
-<itemizedlist continuation="continues">
-<listitem>Finally let us visually see the entity model of the generated JPA objects. Before we
- do that, open the "Hibernate Entity Model" view and select the "Configurations" option in the
- "Hibernate Configurations" view. The plug-in will show all the entities in a visual format.
- You can either manually align your objects or click on the "Layout" button on the right of the
- "Hibernate Entity Model" view to generate a default layout.</listitem>
- </itemizedlist>
- <figure>
-<title>Hibernate Entities</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/HibernateEntities.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-
-</section>
-<section id="AddingAJAXAndRichUIFeaturesToASeamApplication">
-<?dbhtml filename="AddingAJAXAndRichUIFeaturesToASeamApplication.html"?>
-<title>Adding AJAX and rich UI features to a Seam application</title>
-<para>A key feature of JBoss Seam and the Red Hat Developer Studio is that they make AJAX and rich
- UI web applications a breeze to develop. In this section of the tutorial, we will show you how
- to:</para>
- <itemizedlist>
- <listitem>Add AJAX features to automatically generated JSF Seam UI components</listitem>
- <listitem>Replace standard JSF UI components with AJAX enabled rich UI components provided by the
- Red Hat Developer Studio</listitem>
- <listitem>Use AJAX components to do live validation on web pages</listitem>
- </itemizedlist>
- <section id="AddingAJAXFeaturesToGeneratedUIComponents">
-<?dbhtml filename="AddingAJAXFeaturesToGeneratedUIComponents.html"?>
-<title>Adding AJAX features to generated UI components</title>
-<para>Let us now try to add some AJAX features to the generated Seam application. Click on the
- Payments List link on the top of the page. You will see a search page as shown below.</para>
- <figure>
-<title>Search Page</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/SearchPage.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>You can search for any "checknumber" by typing in the number or by paging through the list
- of payments. But what if you only knew a few of the digits/alphabets in the "checknumber"? It
- would be very useful to filter the list based on that. AJAX provides very useful techniques to
- build these types of applications and Ajax4jsf provides the building blocks to simplify these
- techniques.</para>
- <para>Double Click on the PaymentsList.xhtml to open the visual facelet designer. You will
- notice that in the beginning of the source, Seam Gen has already add the tag library references
- to Ajax4jsf and RichFaces as shown below.</para>
- <programlisting role="JAVA"><![CDATA[<ui:composition xmlns="http://www.w3.org/1999/xhtml"
- xmlns:s="http://jboss.com/products/seam/taglib"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
- xmlns:rich="http://richfaces.ajax4jsf.org/rich"
- template="layout/template.xhtml">
-]]></programlisting>
-<para>Next, locate the check number input field. We need to add AJAX to this field. Basically,
-as we type we want to update the table. Adding AJAX functionality usually requires two things:</para>
-<itemizedlist>
-<listitem>Letting the framework know on which event to send an AJAX request to the server.</listitem>
-<listitem>Specifying what component(s) to update with the output from the server.</listitem>
-</itemizedlist>
-<para>Ajax4jsf provides a simple JSF component <emphasis role="bold"><property><aj4:support></property></emphasis> that simplifies this process. Let us
-take our example and add AJAX to it.</para>
-<itemizedlist>
-<listitem>Click on the checknumber field in the visual designer, it will position you at the
-correct location in the source. You will notice that the inputText tag does not have a closing
-tag. Let us add a closing tag to the input text field as shown below.</listitem>
-</itemizedlist>
-<programlisting role="JSP"><![CDATA[<h:inputText id="checknumber"
- value="#{paymentsList.payments.checknumber}">
- <a4j:support event="onkeyup" reRender="paymentsList"/>
- </h:inputText>
-]]></programlisting>
-<itemizedlist continuation="continues">
-<listitem>Now let us add the AJAX support tag to let Ajax4jsf know that when the user presses a
- key we want to go to the server to get a list of payments that match the characters entered in
- the checknumber text box. Add the tag that is highlighted below to the inputText tag.</listitem>
-</itemizedlist>
-<programlisting role="JSP"><![CDATA[<h:inputText id="checknumber"
- value="#{paymentsList.payments.checknumber}">
- <a4j:support event="onkeyup" reRender="paymentsList"/>
- </h:inputText>
-]]></programlisting>
-<para>This tag is pretty self explanatory, it posts the server when a key is pressed and then
- takes the response from the server and re-renders the section of the page that has an id of
- "paymentsList".</para>
- <itemizedlist continuation="continues">
-<listitem>If you follow along in the page, you will see that the section that displays the
-results is in a div tag that has an id of "paymentsList"</listitem>
-</itemizedlist>
-<programlisting role="JSP"><![CDATA[<div class="results" id="paymentsList">
- <h3>search results</h3>
- <h:outputText value="No payments exists"
- rendered="#{empty paymentsList.resultList}"/>
- ...
- </div>
-]]></programlisting>
-<itemizedlist continuation="continues">
-<listitem>Save the changes and refresh your browser. You will see that as you type characters
-in the checknumber field, all payments that begin with those characters will be displayed in the
-table automatically.</listitem>
-</itemizedlist>
-<figure>
-<title>Data Fields</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/DataFields.png"/>
- </imageobject>
-</mediaobject>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/Buttons.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>But there is still one more problem in this page, you will see that the "Next" and
- "Previous" buttons will be displayed even for search results that are small as shown above.</para>
- <itemizedlist continuation="continues">
-<listitem>The tag that we added in the previous step only updates the table. Let us add an AJAX
-region around the page buttons at the bottom of the table. This will allow Ajax4jsf to update
-those buttons independently.</listitem>
-</itemizedlist>
-<programlisting role="JSP"><![CDATA[<a4j:outputPanel ajaxRendered="true">
- <div class="tableControl">
- ...
- </div>
- </a4j:outputPanel>
-]]></programlisting>
-<para>Add an <emphasis role="bold"><property><a4j:outputPanel></property></emphasis> tag around the page buttons as shown above and run the page again.
- If the result list is small, you will see that the page buttons are no longer visible as shown
- below.</para>
- <figure>
-<title>Datatable With No Page Buttons</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/NoButtons.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist continuation="continues">
-<listitem>Let add one more thing to complete this part of the sample. When we type a character in
- the "checknumber" field, there is no visual feedback to the user that there is a request being
- made to the server.</listitem>
- </itemizedlist>
- <para>Ajax4jsf has a pre-built tag <emphasis role="bold"><property><a4j:status></property></emphasis> that allows you to either render a text or an
- image in response to an AJAX event. Add the following code, right after the end of the
- <emphasis role="bold"><property><h:inputText></property></emphasis> tag.</para>
- <programlisting role="JSP"><![CDATA[<a4j:status>
- <f:facet name="start">
- <h:graphicImage value="/img/ajax-loader.gif" style="border: 1px solid #E0E0E0"/>
- </f:facet>
- </a4j:status>
-]]></programlisting>
-<para>Save changes to the page and refresh the browser. You will see the image when the AJAX
-request is active. The image will disappear as soon as the response is received.</para>
-<itemizedlist continuation="continues">
-<listitem>Finally, let us place the image beside the "checknumber" text box. Place a
-<emphasis role="bold"><property><h:panelGroup></property></emphasis> around the <emphasis role="bold"><property><h:inputText></property></emphasis> and <emphasis role="bold"><property><a4j:status></property></emphasis> tags as shown below.
-Save changes and refresh the browser. You should see the image right next to the text box.</listitem>
- </itemizedlist>
- <programlisting role="JSP"><![CDATA[<h:panelGroup>
- <h:inputText id="checknumber"
- value="#{paymentsList.payments.checknumber}">
- <a4j:support event="onkeyup"
- reRender="paymentsList"/>
- </h:inputText>
- <a4j:status>
- <f:facet name="start">
- <h:graphicImage value="/img/ajax-loader.gif"
- style="border: 1px solid #E0E0E0"/>
- </f:facet>
- </a4j:status>
- </h:panelGroup>
-]]></programlisting>
-<para>Although this example was a bit long, it shows how easy it is to add AJAX capabilities to
-an existing Seam application.</para>
-</section>
-<section id="AddingRichfacesComponentsToaSeamApplication">
-<?dbhtml filename="AddingRichfacesComponentsToaSeamApplication.html"?>
-<title>Adding RichFaces components to a Seam application</title>
-<para>Now that we have seen how AJAX can bring interactivity to an application, let us add rich
-controls that will improve the user experience. RichFaces provides numerous rich controls that
-can be added to an application. In this section we will add spinner and slider controls that
-allow users to change numerical values without using the keyboard.</para>
-<para>Double Click on the OrderdetailsEdit.xhtml to open the visual facelet designer. You will
- notice that in the beginning of the source, Seam Gen has already included the tag library
- references to Ajax4jsf and RichFaces as shown below.</para>
- <programlisting role="JSP"><![CDATA[<ui:composition xmlns="http://www.w3.org/1999/xhtml"
- xmlns:s="http://jboss.com/products/seam/taglib"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
- xmlns:rich="http://richfaces.ajax4jsf.org/rich"
- template="layout/template.xhtml">
-]]></programlisting>
-<para>In this page, we are going to replace the "quantityordered" text box with the spinner
- control.</para>
- <itemizedlist>
- <listitem>In the visual view of the page, click on the "quantityordered" text box, this will
- select the appropriate markup in the source view. Delete the selected markup.</listitem>
- </itemizedlist>
- <figure>
-<title>Deleting Selected Markup</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/DeletingSelectedMarkup.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>We will replace the <emphasis role="bold"><property><h:inputText></property></emphasis> tag with a pre-built <emphasis role="bold"><property><rich:inputNumberSpinner></property></emphasis> tag.
- The spinner control tag is very simple to use and like all other JSF controls, it has a value
- attribute that can be bound to any JSF Managed Bean or Seam component. The designer allows you
- to visually find all the beans available as shown below. Right
- click on the <emphasis role="bold"><property><rich:inputNumberSpinner></property></emphasis> input field and select "<emphasis role="bold"><property><rich:inputNumberSpinner></property></emphasis> Attributes".</para>
- <figure>
-<title>Replacing Tags</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/ReplacingTags.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>The minValue and maxValue are self explanatory, they represent the minimum and maximum
- values for the spinner. Place the following tag in your page.</para>
- <programlisting role="JSP"><![CDATA[<rich:inputNumberSpinner
- value="#{orderdetailsHome.definedInstance.quantityordered}"
- inputStyle="width:30px; height:20px"
- minValue="0"
- maxValue="100"
- required="true"/>
-]]></programlisting>
-
-<itemizedlist continuation="continues">
-<listitem>Save changes and refresh the browser page. Your output page should look like this:</listitem>
-</itemizedlist>
-<figure>
-<title>Output Page</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/OutputPage.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist continuation="continues">
-<listitem>Although this is not the best situation to use a slider, let us take a quick look at
-another RichFaces control <emphasis role="bold"><property><rich:inputNumberSlider></property></emphasis>. The slider control is similar to the the
-spinner control; it is bound to the same object. Replace the spinner with the following markup.
-Save the page and refresh your browser window.</listitem>
-</itemizedlist>
-<programlisting role="JSP"><![CDATA[<rich:inputNumberSlider
- value="#{orderdetailsHome.definedInstance.quantityordered}"
- styleClass="slider"
- width="200"/>
-]]></programlisting>
-<figure>
-<title>InputNumberSlider Settings</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/InputNumberSliderSettings.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist continuation="continues">
-<listitem>Seam Gen also generates a date picker control for all date fields in an edit page.
- Click on "Order List" and edit one of the orders to see an example of the date picker control
- that is bundled with Seam.</listitem>
-</itemizedlist>
-
-<figure>
-<title>Order List</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/OrderedList.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-
-</section>
-<section id="ValidatingTheAJAXWay(LiveValidations)">
-<?dbhtml filename="ValidatingTheAJAXWay(LiveValidations).html"?>
-<title>Validating the AJAX way (Live Validations)</title>
-<para>Seam Gen also generates field validation code that leverages AJAX techniques, by providing
- immediate feedback to users who use these applications. To see an example of this, go back to
- the Office Edit page and leave the city blank and tab out of the field. Seam will immediately
- validate the field and tell you that the value is required.</para>
- <figure>
-<title>Office Edit Page</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/OfficeEditPage.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>To provide this functionality for every required field in the page Seam generates the
- following markup:</para>
-<programlisting role="JSP"><![CDATA[<s:decorate id="cityDecoration">
-<h:inputText id="city"
- required="true"
- size="50"
- maxlength="50"
- value="#{officesHome.instance.city}">
- <a:support event="onblur" reRender="cityDecoration"/>
- </h:inputText>
- </s:decorate>
-]]></programlisting>
-<para>Seam uses Ajax4jsf to make a server side call to validate the field.</para>
-</section>
-</section>
-
-<section id="OtherRelevantResourcesOnTheTopic2">
-<?dbhtml filename="OtherRelevantResourcesOnTheTopic2.html"?>
-<title>Other relevant resources on the topic</title>
-<para>Seam on JBoss: <ulink url="http://www.jboss.com/products/seam">Seam Framework</ulink></para>
-
-<para>Ten Good Reasons to use Seam: <ulink url="http://www.jboss.com/products/seam/whyseam">Why Seam</ulink></para>
-<para>Getting Started: <ulink url="http://labs.jboss.com/jbossseam/gettingstarted">Getting Started with JBoss Seam</ulink></para>
-<para>Wiki: <ulink url="http://www.jboss.com/wiki/Wiki.jsp?page=JBossSeam">JBoss Wiki</ulink></para>
-<para>FAQ: <ulink url="http://labs.jboss.com/jbossseam/faq/index.html">JBoss Seam FAQ</ulink></para>
-<para>Downloads: <ulink url="http://labs.jboss.com/jbossseam/download">JBoss Seam Downloads</ulink></para>
-<para>Jira: <ulink url="http://jira.jboss.org/jira/browse/JBSEAM">Jira issue tracker</ulink></para>
-<para>Rules Framework: <ulink url="http://www.jboss.com/products/rules">JBoss Rules</ulink></para>
-</section>
-</chapter>
Deleted: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/BusinessProcessAndRulesApplication.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/BusinessProcessAndRulesApplication.xml 2007-07-23 11:53:37 UTC (rev 2593)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/BusinessProcessAndRulesApplication.xml 2007-07-23 12:13:31 UTC (rev 2594)
@@ -1,480 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="BusinessProcessAndRulesApplication" xreflabel="BusinessProcessAndRulesApplication">
- <?dbhtml filename="BusinessProcessAndRulesApplication.html"?>
- <chapterinfo>
- <keywordset>
- <keyword>Business process</keyword>
- <keyword>Seam</keyword>
- <keyword>JBoss Rules</keyword>
- <keyword>CURD-application</keyword>
- </keywordset>
- </chapterinfo>
-
- <title>Business process and rules application</title>
- <para>Rules and business processes are important components in many enterprise applications.
- They help business analysts to get involved in the design and implementation of the software
- project. Rules and business processes are also essential to complex internal states of large,
- multi-user systems. The JBoss Rules engine (formerly known as Drools) and jBPM business
- process engine are two production-ready open source products supported by Red Hat. It is
- very easy to incorporate rules and business processes into a Seam web application using the
- Red Hat Developer Studio. In this section, we further re-factor the CRUD application we
- already have and add support for an "order management" process. The user scenario is to
- simulate the following process and rules:</para>
- <itemizedlist>
- <listitem>The site administrator logs in and sees a list of outstanding orders</listitem>
- <listitem>She goes through the inventory (by hand or using another computer system) and
- determines the availability of the products in each order. She enters that information to
- each order.</listitem>
- <listitem>She starts a process for each order, which determines whether to ship the order
- or refund the order based on a business rule applied to the availability status. For
- instance, an "in stock" status triggers a "ship" action while the "back order" status
- triggers a "refund" action.</listitem>
- <listitem>When the business process reaches the "ship" or "refund" state, it will take
- appropriate actions (e.g., to submit shipping orders to Fedex or to contact the credit
- card company for refund). In this simple case, we will just print out a message on the
- console to prove that we can execute any code in those stages.</listitem>
- </itemizedlist>
- <para>While this process sounds simple, it is the basis for very complex business
- processes. In this section of the tutorial, we will show you how this is done via the
- following steps:</para>
- <itemizedlist>
- <listitem>Add a rule definition to the application</listitem>
- <listitem>Add a business process that uses that rule to the application</listitem>
- <listitem>Start the business process from a web action</listitem>
- </itemizedlist>
-<section id="ImportConfigurationFilesAndJavaCode">
-<?dbhtml filename="ImportConfigurationFilesAndJavaCode.html"?>
-<title>Import configuration files and Java code</title>
-<para>Before we start, we need to import some configuration and Java files for the demo project.
-Those files are very simple and we will review them as we go along with the tutorial. We import
-them here to reduce potential typos and other errors in the tutorial.</para>
-<orderedlist>
-<listitem>Choose the <emphasis>File > Import ...</emphasis> menu and then select <emphasis>General > Existing</emphasis> project into workspace and
-click on the Next button.</listitem>
-</orderedlist>
-<figure>
-<title>Importing Project</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/ProjectImporting.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<orderedlist continuation="continues">
-<listitem>To make this demo a little more manageable we have already created some demo code
-that is available in the rules-bpm directory of your tutorial distribution code. It is
- located in the root directory of the distribution. Select the rules-bpm directory and check
- the "Copy projects into the workspace" directory check box.</listitem>
-</orderedlist>
-<para>You will have a different directory on your machine than the screen shot shown below.</para>
-<figure>
-<title>Selecting Directory To Import</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/ImportDirectory.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<orderedlist continuation="continues">
-<listitem>After this step you will see a new project called "rules-bpm". If you expand that
-directory, you will see numerous files as shown below. We will look at these files in this
- section of the demo. We will first start by copying these files into our EclipseCon project.</listitem>
-</orderedlist>
-
-<figure>
-<title>Project Structure</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/ProjectStructure.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<orderedlist continuation="continues">
-<listitem>Right click on the rules-bpm/build.xml file, and select <emphasis>Run AS ... > Ant</emphasis> Build.</listitem>
-</orderedlist>
-
-<figure>
-<title>AntBuild</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/AntBuild.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<orderedlist continuation="continues">
-<listitem>Right click on the EclipseCon project and select Refresh from the menu to pick up
- the changes made to the demo application. The rules-bpm/build.xml script copies a bunch of files
- into your existing EclipseCon project. We will look at them soon.</listitem>
-</orderedlist>
-</section>
-<section id="CreateARuledefinition">
-<?dbhtml filename="CreateARuledefinition.html"?>
-<title>Create a rule definition</title>
-<para>In this section, we create a business rule that can be used in junction with the business
- process. When the rule is executed, it checks the status of the currently selected order. If the
- order status is "in stock", meaning that a person has check off line and verified the
- availability of the product ordered, the system changes the order status to "ship", meaning
- that someone will now ship the product as the next step in the process. If the order status
- is "back order", the rule changes the order status to "refund" automatically to trigger the
- business process of refunding.</para>
- <orderedlist>
- <listitem>Select the<emphasis> EclipseCon/resources </emphasis>directory. That is where we are going to put the
- rules definition file.</listitem>
- <listitem>Select the following menu actions: <emphasis>File > New > Other ... > JBoss Rules > New
- Rules Resource</emphasis> to bring up the JBoss Rules wizard.</listitem>
- </orderedlist>
- <figure>
-<title>New Rules File</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/NewRulesFile.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<orderedlist continuation="continues">
-<listitem>Fill out the above window with the following values.</listitem>
-</orderedlist>
-<table>
- <title>Rule Table</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Field Name</entry>
- <entry>Field Value</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>File Name</entry>
- <entry>process-order.drl</entry>
- </row>
- <row>
- <entry>Type of Rule Resource</entry>
- <entry>New DRL (rule package)</entry>
- </row>
- <row>
- <entry>Rule Package Name</entry>
- <entry>process.order</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <orderedlist continuation="continues">
-<listitem>Replace the content of the process-order.drl file with the follow rule.</listitem>
-</orderedlist>
-<programlisting role="JAVA"><![CDATA[package process.order
- import com.mydomain.EclipseCon.Orders;
-
-rule "Ship order rule"
- when
- order : Orders(status == "in stock")
- then
- order.setStatus("ship");
-end
-
-rule "Refund order rule"
- when
- order : Orders(status == "back order")
- then
- order.setStatus("refund");
-end
-]]></programlisting>
-<para>Notice that the IDE automatically highlights the syntax and provides auto-completion help.
- You may wonder how Seam knows to load the process-order.drl file for the application.</para>
- <para>If you look in the <emphasis>resources/WEB-INF/components.xml</emphasis> file we copied from the imported
- rules-bpm project. It has an element pointing to the process-order.drl file.</para>
- <programlisting role="XML"><![CDATA[<drools:rule-base name="securityRules">
- <drools:rule-files>
- <value>/security.drl</value>
- </drools:rule-files>
- </drools:rule-base>
-]]></programlisting>
-</section>
-<section id="CreateABusinessProcessDefinition">
-<?dbhtml filename="CreateABusinessProcessDefinition.html"?>
-<title>Create a business process definition</title>
-<para>Next, let's create a business process that manages the order process. The business process
- essentially specifies a sequence of actions that has to happen before an order is shipped or
- refunded. Since the business analyst typically designs this process, it is very high level and
- can be drawn up in a GUI designer.</para>
- <orderedlist>
- <listitem>Select the<emphasis> EclipseCon/resources </emphasis>folder and select menu actions <emphasis>File > New > File</emphasis>.
- Add a new file called process-order.jpdl.xml as shown below:</listitem>
- </orderedlist>
- <figure>
-<title>Creating New File Resource</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/CreatingNewFileResource.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-
-<orderedlist continuation="continues">
-<listitem>Add the following content to the process-order.jpdl.xml file. It is an empty jBPM
-process definition, and allows us to use the jBPM visual designer to further edit it.</listitem>
-</orderedlist>
-<programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<process-definition
- xmlns="" name="process-order">
-</process-definition>
-]]></programlisting>
-<orderedlist continuation="continues">
-<listitem>Right click on the process-order.jpdl.xml file and select <emphasis>Open with ... > jBPM
-Graphical Process Designer</emphasis>.</listitem>
-</orderedlist>
-<figure>
-<title>Opening Graphical Process Designer</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/GraphicalProcessDesigner.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<orderedlist continuation="continues">
-<listitem>In the designer, drag and drop nodes and transition lines until you have a process
- shown in the following image. This is a high level process and aimed at business level non
- technical users.</listitem>
-</orderedlist>
-<para>To draw a node, click on the type of the node in the palette. You should be able to see
-that based on the icon on the node as shown below. Draw a rectangle on the canvas and the
- appropriate node will be rendered.</para>
- <para>To draw a transition click on the transition icon in the palette, choose the source node
- and then the destination node. This will draw a transition from the source to the destination.</para>
- <para>To change the name on the node or transition, select the object and change the name in
- the properties view or simply double click on the node or the transition line to change it.</para>
- <figure>
-<title>Diagram View</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/DiagramView.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<orderedlist continuation="continues">
-<listitem>Save this file. You can click on the Source tab to view the generated XML file for
- the process.</listitem>
-</orderedlist>
-</section>
-<section id="AssociateProcessNodesWithJavaCode">
-<?dbhtml filename="AssociateProcessNodesWithJavaCode.html"?>
-<title>Associate process nodes with Java code</title>
-<para>With the business process in the designer, we can now associate each node with Java code.
- The Java code is executed when the node is reached in the process, and the Java code determines
- the outcome of each node – hence the next node in the process.</para>
- <para>Let's go through the exercise for the "Check Inventory" node first.</para>
- <orderedlist>
- <listitem>Right click on the "Check Inventory" node in the designer and select <emphasis>Add
- Actions > Node Enter </emphasis>from the menu as shown below.</listitem>
- </orderedlist>
- <figure>
-<title>Node Entering</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/NodeEntering.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<orderedlist continuation="continues">
-<listitem>In the Outline view tab, open the tree view of process-order > Check Inventory >
-node enter, and you will see action1. The Outline view may be hidden or on the left side of the
- IDE.</listitem>
-</orderedlist>
-<figure>
-<title>Outline View</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/OutlineView.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<orderedlist continuation="continues">
-<listitem>Double click on action1 to bring up the wizard. Select Handler on the left and enter
- com.mydomain.EclipseCon.process. CheckInventoryAction as the class and bean as the type as shown
- below. You can can also search for the class by clicking on the <emphasis>Browse...</emphasis> button.</listitem>
-</orderedlist>
-<figure>
-<title>Action Handler</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/ActionHandler.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>Explanation: Now, you must wonder where this
-com.mydomain.EclipseCon.process.CheckInventoryAction class come from It comes from the
-eclipsecon-rules-bpm project we imported. The Java class has a single method that is executed
-when the "Check Inventory" node is reached in the process. The method just fires the rule we
-previously defined in process-order.drl. After the rule is executed, it updates the
-"inventoryStatus" component. Here is the method:</para>
-<programlisting role="JAVA"><![CDATA[public void execute(ExecutionContext ctx) throws Exception {
-
- //get a handle to the rules engine
- Component c = (Component) Contexts.getApplicationContext().get(
- "orderWorkingMemory.component");
- WorkingMemory wm = (WorkingMemory) ((ManagedWorkingMemory) c
- .newInstance()).getWorkingMemory();
-
- //get the ordersHome variable that was set in OrderProcessor.
- OrdersHome order = (OrdersHome) ctx.getVariable("ordersHome");
-
- //Assert Orders to working memory and fire rules
- wm.assertObject(order.getInstance());
- wm.fireAllRules();
-
-
- //persist the updated Orders object
- order.persist();
-
- //set inventory status so decision node knows what to do
- ctx.setVariable("inventoryStatus", order.getInstance().getStatus());
- System.out.println("CHECK INVENTORY - STATUS: "
- + order.getInstance().getStatus());
-}
-]]></programlisting>
-<para>The "inventoryStatus" component is then used in the "Inventory Decision" node to determine
-which node to go to next. To do that, open the process-order.jpdl.xml file in the text editor and
- change the node from this</para>
- <programlisting role="XML"><![CDATA[<decision name="Inventory Decision">
- <transition name="ship" to="Ship Order"></transition>
- <transition name="refund" to="Refund Order"></transition>
- </decision>
-]]></programlisting>
-<para>to this:</para>
-<programlisting role="XML"><![CDATA[<decision name="Inventory Decision" expression="#{inventoryStatus}">
- <transition name="ship" to="Ship Order"></transition>
- <transition name="refund" to="Refund Order"></transition>
- </decision>
-]]></programlisting>
-<para>Now, let's repeat the exercise to assign handler Java classes to the "Ship Order" and "Refund Order" nodes. </para>
-<itemizedlist>
-<listitem>Associate "Ship Order" node with the com.mydomain.EclipseCon.process.ShipOrderAction
-bean</listitem>
-<listitem>Associate "Refund Order" node with the com.mydomain.EclipseCon.process.SendRefundAction bean</listitem>
-</itemizedlist>
-<para>As we described earlier, in a real world system, those two nodes would invoke Java code
- that perform real shipping and refunding tasks. But here we just print out a message as a proof
- of concept. You can look into their Java classes if you have time.</para>
-</section>
-<section id="StartTheProcessFromAWebAction">
-<?dbhtml filename="StartTheProcessFromAWebAction.html"?>
-<title>Start the process from a web action</title>
-<para>Finally, we need a "hook" to start the entire business process. We will add a new Process
- Order button to the Orders.xhtml file.</para>
- <para>You can add the new button right next to the existing "Add orderdetails" button.
- Copy/paste the following button code in the actionButtons region:</para>
- <programlisting role="JSP"><![CDATA[<s:button id="buttonId" value="Process Order"
- action="#{orderProcessor.startProcess}"
- view="/Orders.xhtml"/>
-]]></programlisting>
-<para>Explanation: When you click on the Process Order button, Seam invokes
-the #{orderProcessor.startProcess} method, which in turn, starts the business process. The Java
-code for the #{orderProcessor} component is in the com.mydomain.EclipseCon.process.OrderProcessor
-class. Like other Java source files in the process package, the OrderProcessor.java is already
-copied to the EclipseCon project when you run the build.xml script from the imported rules-bpm
- project. Here is the content of the OrderProcessor.java file. The startProcess() method, which
- is invoked from the Process Order button, starts the process-order process we just created.</para>
-<programlisting role="JAVA"><![CDATA[@Name("orderProcessor")
-public class OrderProcessor {
-
- //Set the Orders object as a jBPM context variable
- @In(create = true)
- @Out(scope = ScopeType.BUSINESS_PROCESS)
- OrdersHome ordersHome;
-
- //Execute the jBPM process
- @CreateProcess(definition = "process-order")
- public String startProcess() {
- return "success";
- }
-}
-]]></programlisting>
-</section>
-<section id="TryItOut">
-<?dbhtml filename="TryItOut.html"?>
-<title>Try it out</title>
-<para>Now save the project and restart the server to make sure that it is properly re-deployed.
-Navigate to the OrdersList page and enter "In Process" to the status field to search for
-un-processed orders.</para>
-<para>Select one order and edit the order and change the "status" field to "in stock" and
-click "Done". Please enter the case exactly as indicated here:</para>
-<figure>
-<title>Order Edit Page</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/OrderEditPage.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>Click the "Process Order" button.</para>
-<figure>
-<title>Order Details</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/OrderDetails.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>The business process should lead to the ShipOrderAction bean, which will print out the
- "SHIP ORDER" message in the console view tab at the bottom of the IDE screen.</para>
- <figure>
-<title>Console View</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/ConsoleView.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>Select one order and change the "status" field to "back order" and click "Done". Please
-enter the case exactly as indicated here:</para>
-<figure>
-<title>Changing Status Field</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/ChangingStatusField.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>Click the "Process Order" button.</para>
-<figure>
-<title>Invoking Process Order</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/InvokingProcessOrder.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>The business process should invoke the SendRefundAction bean, which will print out the
-"SEND REFUND" message in the console view tab at the bottom of the IDE screen.</para>
-<figure>
-<title>Console Panel</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/ConsolePanel.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>This example shows a simple example of the powerful jBPM and JBoss Rules runtimes
-integrated in a Seam application. We have also see how easy it is build these kinds of
-applications using the Red Hat Developer Studio.</para>
-</section>
-<section id="TroubleshootingOnLinux">
-<?dbhtml filename="TroubleshootingOnLinux.html"?>
-<title>Troubleshooting on Linux</title>
-<para>Linux users may need to do the following to get the Eclipse distribution to work correctly
-on their machines.</para>
-<orderedlist>
-<listitem>On Red Hat based Linux distributions install the xpLib.i386 package</listitem>
-<listitem>ln -s libstdc++.so.5.0.7 libstdc++.so.5</listitem>
-<listitem>Open the RHDS perspective. If you see the Help view open, close it and restart RHDS</listitem>
-<listitem>If none of these work, do the following
-<itemizedlist>
-<listitem>Clear the Eclipse log file, <workspace>\.metadata\.log</listitem>
-<listitem>Start Eclipse with the -debug option:
-<para>eclipse -debug</para></listitem>
-<listitem>Post the Eclipse log file (<workspace>\.metadata\.log) on the forums.</listitem>
-</itemizedlist>
-</listitem>
-</orderedlist>
-</section>
- </chapter>
\ No newline at end of file
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/CURDAppWalkthrough.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/CURDAppWalkthrough.xml (rev 0)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/CURDAppWalkthrough.xml 2007-07-23 12:13:31 UTC (rev 2594)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="CURDAppWalkthrough" xreflabel="CURDAppWalkthrough">
+ <?dbhtml filename="CURDAppWalkthrough.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>Red Hat Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>Java</keyword>
+ <keyword>CURD</keyword>
+ <keyword>JBoss AS</keyword>
+ </keywordset>
+ </chapterinfo>
+ <title>The CURD Application Walkthrough</title>
+
+</chapter>
+
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GenCURDDatabaseApp.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GenCURDDatabaseApp.xml (rev 0)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GenCURDDatabaseApp.xml 2007-07-23 12:13:31 UTC (rev 2594)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="GenCURDDatabaseApp" xreflabel="GenCURDDatabaseApp">
+ <?dbhtml filename="GenCURDDatabaseApp.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>Red Hat Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>Java</keyword>
+ <keyword>CURD</keyword>
+ <keyword>Database Application</keyword>
+ </keywordset>
+ </chapterinfo>
+ <title>Generate a CURD Database Application</title>
+
+</chapter>
+
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GetStartSeamGen.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GetStartSeamGen.xml (rev 0)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GetStartSeamGen.xml 2007-07-23 12:13:31 UTC (rev 2594)
@@ -0,0 +1,700 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="GetStartSeamGen" xreflabel="GetStartSeamGen">
+ <?dbhtml filename="GetStartSeamGen.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>Red Hat Developer Studio</keyword>
+ <keyword>Seam</keyword>
+ <keyword>JBoss</keyword>
+ <keyword>CRUD-application</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Ajax CRUD-application with Seam and Rich Faces</title>
+<para>In this chapter we will see how easy it is to build Seam applications and integrate
+them with Ajax4jsf and Rich Faces. We will bootstrap the application using Seam Gen which is
+ a CRUD application generator. Seam Gen can be used from either the command line or via an
+ Eclipse Plugin. Unlike most application generators, Seam Gen can also be used to
+ incrementally add more functionality to an existing Seam application.</para>
+ <para>Seam is an incredibly flexible development framework that can be completely
+ integrated with a Java EE server or in a simple POJO environment like Tomcat. Seam is
+ also extremely portable, and has been tested on several popular containers like JBoss,
+ Tomcat, Weblogic, WebSphere. Seam uses JSF as its view layer and can use either JSP or
+ Facelets as the presentation layer.</para>
+ <para>Seam Gen generates all the required layers of an application. It uses JPA as the
+ persistence layer, POJO's (Plain Old Java Objects) as the business logic layer and
+ Facelets as the presentation layer.</para>
+ <para>We will perform the following steps in this chapter of the tutorial:</para>
+ <itemizedlist>
+ <listitem>Creating a Seam Project using Seam Gen</listitem>
+ <listitem>Generating a Seam application using Seam Gen</listitem>
+ <listitem>Running the Seam application</listitem>
+ <listitem>Customizing the generated Seam application</listitem>
+ <listitem>Adding AJAX features to automatically generated JSF Seam UI components</listitem>
+ <listitem>Replacing standard JSF UI components with AJAX enabled rich UI components
+ provided by the Red Hat Developer Studio</listitem>
+ <listitem>Using AJAX components to do live validation on web pages</listitem>
+ <listitem>Adding Rich Faces components to a Seam application</listitem>
+ </itemizedlist>
+<section id="CreatingASeamProjectUsingSeamGen">
+<?dbhtml filename="CreatingASeamProjectUsingSeamGen.html"?>
+<title>Creating a Seam Project using Seam Gen</title>
+<itemizedlist>
+<listitem>Stop your JBoss AS Server by clicking on the stop button as shown below. We are
+ doing this so that the generated application can be deployed properly when the server
+ starts.</listitem>
+ </itemizedlist>
+ <figure>
+<title>Stopping JBoss AS Server</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/StoppingServer.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist continuation="continues">
+<listitem>To create a Seam project, select <emphasis>Seam Gen > Setup/Configuration > Setup </emphasis>to
+launch the Seam Gen setup window as shown below. Note: </listitem>
+</itemizedlist>
+<note>
+ <title>Note:</title>
+ <para>If this is the first time you run
+Seam Gen a file dialog will be shown. In this you need to select <seam>/seam-gen/build.xml
+ so the plugin knows which seam-gen to use.</para>
+ </note>
+<para></para>
+
+ <figure>
+<title>Seam Gen Setup Window</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/SeamGenSetup.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>Fill the items in the dialog as shown below and select the <emphasis>OK</emphasis> button.</para>
+<table>
+ <title>Filling Project Items</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Field Name</entry>
+ <entry>Field Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Project</entry>
+ <entry>EclipseCon</entry>
+ </row>
+ <row>
+ <entry>Seam project workspace</entry>
+ <entry><your project directory></entry>
+ </row>
+ <row>
+ <entry>JBoss AS Home directory</entry>
+ <entry><JBoss AS Home Dir></entry>
+ </row>
+ <row>
+ <entry>Driver Location</entry>
+ <entry><seam>/<seam-gen>/lib/hsqldb.jar</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>The plug-in will initialize the Seam Gen ant tasks that simplify all key Seam
+ operations. We will invoke several of these ant tasks via the Seam Eclipse Plugin
+ throughout this tutorial.</para>
+ <para>The plug-in will also prompt you to create a project. Select "Yes" to create a
+ Project. This step will create not only an Eclipse project but also all the required
+ artifacts to get you started.</para>
+ <para>The plug-in will also prompt you create a database connection. Select
+ "Yes" to create a WTP Database connection that connects to the default HSQL DB
+ instance that we have set up. If you are using any other database then set up the
+ appropriate database settings in the Seam Gen setup window.</para>
+ <para>At the end of this step you will see an Eclipse project called "EclipseCon"
+ as shown below. This project has all the necessary elements required to deploy
+ a Seam application.</para>
+ <figure>
+<title>EclipseCon Project Structure</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/EclipseConProjectStructure.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist continuation="continues">
+<listitem>Start the application server. Open your favorite browser and point to the
+following URL http://localhost:8080/EclipseCon. You should see the following page:</listitem>
+</itemizedlist>
+<figure>
+<title>Created Project</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/CreatedProject.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>Congratulations! You have written your first Seam application.</para>
+<itemizedlist continuation="continues">
+<listitem>Let us take a look at the database connection that was created by the Eclipse
+ Plugin and browse the database provided. The database connection view should now have a
+ connection to our sample database as shown below.</listitem>
+ </itemizedlist>
+ <figure>
+<title>Connections View</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/ConnectionsView.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>Right click on the connection > Reconnect. Just specify "sa" as the user id. The password
+ field should be blank.</para>
+ <para>You should now be able to browse the database and see the meta-data and query data using SQL.
+ Your meta-data should look like the following:</para>
+ <figure>
+<title>Meta-data View</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Metadata.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+</section>
+<section id="GeneratingACRUDApplicationUsingSeamGen">
+<?dbhtml filename="GeneratingACRUDApplicationUsingSeamGen.html"?>
+<title>Generating a CRUD application using Seam Gen</title>
+<itemizedlist>
+<listitem>The next step in our exercise is to generate a full blown application using Seam Gen.
+This application will generate CRUD pages and Search pages for all the entities in the database.
+Click on Seam Gen > Generate Entities. Seam Gen will connect to the database we defined in the
+ setup part of the application and generate all the required components.</listitem>
+ <listitem>Since Seam Gen is generating files on the file system that Eclipse does not know
+ about, right click on the project name on your project and choose the Refresh item. This will let
+ Eclipse know that there are new files and get them updated in the Eclipse project and deployed
+ in the JBoss instance.</listitem>
+ <listitem>Restart you application server, just in case those files have not been properly
+ synchronized with the application server.</listitem>
+ <listitem>Point your favorite browser to the following URL http://localhost:8080/EclipseCon.
+ You will see the following page:</listitem>
+ </itemizedlist>
+ <figure>
+<title>EclipseCon Project</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/CreatedProject12.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist continuation="continues">
+<listitem>Let us now look at one of the entities and see what has been generated. Click on the
+ "Offices List" to see a search page that allows you to filter the list and the list of all the
+ offices in the database.</listitem>
+ <listitem>Type in USA in the country field and click on Search to get a list of offices in the
+ USA as shown below.</listitem>
+ </itemizedlist>
+ <figure>
+<title>Search Panel</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/SearchPanel.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+
+<itemizedlist continuation="continues">
+<listitem>Let us now check out the editing capability of the generated Seam application. Select
+ the first office code and click on the Edit button. You will be prompted for a userID and
+ password. Use "seamuser" for both user and password. You should at this point see the edit page
+ as shown below. Notice that the NOT NULL columns in the database table are automatically marked
+ with the red * to indicate that they are required.</listitem>
+ </itemizedlist>
+ <figure>
+<title>Generated Edit Page</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/GeneratedEditPage.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist continuation="continues">
+<listitem>Change a few things and save changes. This should update the record in the database.
+ There you have it. A simple and easy way to bootstrap your applications.</listitem>
+ <listitem>Let us look at how validations are done in Seam. Go back to and edit another office
+ record and this time leave the city blank and click on the Save button. You will see the default
+ Seam validations get triggered. In this case the "value required" validation is fired as shown
+ below.</listitem>
+ </itemizedlist>
+<figure>
+<title>Error Reporting</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/ValidationInEditPage.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+</section>
+<section id="CustomizingTheGeneratedApplication">
+<?dbhtml filename="CustomizingTheGeneratedApplication.html"?>
+<title>Customizing the generated application</title>
+<itemizedlist>
+<listitem>Let us look at a couple of simple things we can change in the generated application
+ to show you that the generated application can be customized. Let us start by changing the edit
+ page that we just saw. We will clean up the labels using the Facelet designer as shown below.
+ Open the view directory in your project and double click on the OfficeEdit.xhtml file.</listitem>
+</itemizedlist>
+<figure>
+<title>Facelet Designer</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/FaceletDesigner.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>Unlike other WYSIWYG editors which developers tend to hate, the visual designers in Red Hat
+ Developer Studio are designed for developers to rapidly find their way in a source file, while
+ still allowing them to visually look at a document.</para>
+
+<itemizedlist continuation="continues">
+<listitem>To change a label text, click on a label in the designer. This will position the
+ cursor at the correct location in the source view. Type the new label there. The designer does
+ not force the developer to use the WYSIWIG environment. Change all the labels for the edit page.</listitem>
+ </itemizedlist>
+ <para>Once you save the page, the IDE automatically rebuilds the application and re-deploys it.
+ So, just reload your browser and you should see an updated web page like the following. If for
+ some reason the re-deployment did not work, stop and restart the server normally resolves the issue.</para>
+ <figure>
+<title>Edit Page</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/EditPage.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+</section>
+<section id="UsingHibernateToolsToInteractWithTheJPAEntities">
+<?dbhtml filename="UsingHibernateToolsToInteractWithTheJPAEntities.html"?>
+<title>Using Hibernate tools to interact with the JPA Entities</title>
+<para>As part of generating the application, Seam Gen also generates JPA entities that are used
+ to interact with the database. Let us quickly take a look at Hibernate tools and see how we can
+ interact with the database using HQL and the Hibernate Criteria API.</para>
+ <itemizedlist>
+ <listitem>Open the Hibernate Configurations View. You should be able to open the console like
+ the other views we have seen so far in the tutorial. Your view should resemble the following:</listitem>
+ </itemizedlist>
+ <figure>
+<title>Hibernate Configurations View</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/HibernateConfigurationsView.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist continuation="continues">
+<listitem>Before we run the HQL, let us open up the "Hibernate Query Result" and the "Hibernate
+ Dynamic SQL Preview" views. You should be able to do that in a manner similar to other views we
+ have opened in this tutorial. Alternatively you can open the Hibernate Console Perspective where
+ these views are opened up by default.</listitem>
+ <listitem>Click on the "HQL" icon in the "Hibernate Configurations" view. This will open up
+ the HQL Designer view as shown below. Also, select "EclipseCon" from the drop down menu next to
+ the green "run" button.</listitem>
+ </itemizedlist>
+ <figure>
+<title>HQL Designer View</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/HQLDesignerView.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist continuation="continues">
+<listitem>Type in a simple query as shown above "from Offices o" and click on the green "run"
+ button. You should see the result of the HQL query in the "Hibernate Query Result" window as
+ shown below.</listitem>
+ </itemizedlist>
+ <figure>
+<title>Hibernate Query Result Window</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/HibernateQueryResultWindow.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist continuation="continues">
+<listitem>Click on any of the objects in the result and you should be able see the contents of
+ the objects in the Property view as shown below. If you don't have the view open in your
+ perspective, you can open this view like all other views in this tutorial.</listitem>
+ </itemizedlist>
+ <figure>
+<title>Property View</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/PropertyView.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>Select the "Hibernate Dynamic SQL Preview" view to the generated SQL. This is a great tool
+to see the SQL being generated by Hibernate for your HQL. Not only is this a great debugging tool,
+ it is also a great way to optimize your HQL queries.</para>
+ <figure>
+<title>Hibernate Dynamic SQL Preview</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/HibernateDynamicSQLPreview.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist continuation="continues">
+<listitem>Let us try a slightly more complex query. Type in the following query in the query
+window and see how the query result changes and the SQL Preview changes.</listitem>
+ </itemizedlist>
+ <programlisting role="JAVA"><![CDATA[select city, state, postalcode
+ from Offices o
+ where country = 'USA'
+]]></programlisting>
+<itemizedlist continuation="continues">
+<listitem>Let us try the Hibernate criteria APIs next. To use Hibernate Criteria APIs click on
+the "CRI" button in the Hibernate Configurations View. This will open the Criteria API designer
+view. Type in this simple criteria query as shown below and click on the green run button to see
+ the results. Also, select "EclipseCon" from the drop down menu next to the green "run" button.</listitem>
+ </itemizedlist>
+ <programlisting role="JAVA"><![CDATA[session.createCriteria(Offices.class)
+]]></programlisting>
+<para>The results will be very similar to the HQL query except that the criteria query does not
+generate the SQL in the "Hibernate Dynamic SQL Preview" view.</para>
+<itemizedlist continuation="continues">
+<listitem>Let us try something a little more complex. Let us filter all offices in the USA as
+shown below. The results of this query should be very similar to the results of the HQL.</listitem>
+ </itemizedlist>
+ <programlisting role="JAVA"><![CDATA[session.createCriteria(Offices.class)
+ .add(Restrictions.eq("country", "USA")) ;
+]]></programlisting>
+<itemizedlist continuation="continues">
+<listitem>Finally let us visually see the entity model of the generated JPA objects. Before we
+ do that, open the "Hibernate Entity Model" view and select the "Configurations" option in the
+ "Hibernate Configurations" view. The plug-in will show all the entities in a visual format.
+ You can either manually align your objects or click on the "Layout" button on the right of the
+ "Hibernate Entity Model" view to generate a default layout.</listitem>
+ </itemizedlist>
+ <figure>
+<title>Hibernate Entities</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/HibernateEntities.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+
+</section>
+<section id="AddingAJAXAndRichUIFeaturesToASeamApplication">
+<?dbhtml filename="AddingAJAXAndRichUIFeaturesToASeamApplication.html"?>
+<title>Adding AJAX and rich UI features to a Seam application</title>
+<para>A key feature of JBoss Seam and the Red Hat Developer Studio is that they make AJAX and rich
+ UI web applications a breeze to develop. In this section of the tutorial, we will show you how
+ to:</para>
+ <itemizedlist>
+ <listitem>Add AJAX features to automatically generated JSF Seam UI components</listitem>
+ <listitem>Replace standard JSF UI components with AJAX enabled rich UI components provided by the
+ Red Hat Developer Studio</listitem>
+ <listitem>Use AJAX components to do live validation on web pages</listitem>
+ </itemizedlist>
+ <section id="AddingAJAXFeaturesToGeneratedUIComponents">
+<?dbhtml filename="AddingAJAXFeaturesToGeneratedUIComponents.html"?>
+<title>Adding AJAX features to generated UI components</title>
+<para>Let us now try to add some AJAX features to the generated Seam application. Click on the
+ Payments List link on the top of the page. You will see a search page as shown below.</para>
+ <figure>
+<title>Search Page</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/SearchPage.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>You can search for any "checknumber" by typing in the number or by paging through the list
+ of payments. But what if you only knew a few of the digits/alphabets in the "checknumber"? It
+ would be very useful to filter the list based on that. AJAX provides very useful techniques to
+ build these types of applications and Ajax4jsf provides the building blocks to simplify these
+ techniques.</para>
+ <para>Double Click on the PaymentsList.xhtml to open the visual facelet designer. You will
+ notice that in the beginning of the source, Seam Gen has already add the tag library references
+ to Ajax4jsf and RichFaces as shown below.</para>
+ <programlisting role="JAVA"><![CDATA[<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+ xmlns:rich="http://richfaces.ajax4jsf.org/rich"
+ template="layout/template.xhtml">
+]]></programlisting>
+<para>Next, locate the check number input field. We need to add AJAX to this field. Basically,
+as we type we want to update the table. Adding AJAX functionality usually requires two things:</para>
+<itemizedlist>
+<listitem>Letting the framework know on which event to send an AJAX request to the server.</listitem>
+<listitem>Specifying what component(s) to update with the output from the server.</listitem>
+</itemizedlist>
+<para>Ajax4jsf provides a simple JSF component <emphasis role="bold"><property><aj4:support></property></emphasis> that simplifies this process. Let us
+take our example and add AJAX to it.</para>
+<itemizedlist>
+<listitem>Click on the checknumber field in the visual designer, it will position you at the
+correct location in the source. You will notice that the inputText tag does not have a closing
+tag. Let us add a closing tag to the input text field as shown below.</listitem>
+</itemizedlist>
+<programlisting role="JSP"><![CDATA[<h:inputText id="checknumber"
+ value="#{paymentsList.payments.checknumber}">
+ <a4j:support event="onkeyup" reRender="paymentsList"/>
+ </h:inputText>
+]]></programlisting>
+<itemizedlist continuation="continues">
+<listitem>Now let us add the AJAX support tag to let Ajax4jsf know that when the user presses a
+ key we want to go to the server to get a list of payments that match the characters entered in
+ the checknumber text box. Add the tag that is highlighted below to the inputText tag.</listitem>
+</itemizedlist>
+<programlisting role="JSP"><![CDATA[<h:inputText id="checknumber"
+ value="#{paymentsList.payments.checknumber}">
+ <a4j:support event="onkeyup" reRender="paymentsList"/>
+ </h:inputText>
+]]></programlisting>
+<para>This tag is pretty self explanatory, it posts the server when a key is pressed and then
+ takes the response from the server and re-renders the section of the page that has an id of
+ "paymentsList".</para>
+ <itemizedlist continuation="continues">
+<listitem>If you follow along in the page, you will see that the section that displays the
+results is in a div tag that has an id of "paymentsList"</listitem>
+</itemizedlist>
+<programlisting role="JSP"><![CDATA[<div class="results" id="paymentsList">
+ <h3>search results</h3>
+ <h:outputText value="No payments exists"
+ rendered="#{empty paymentsList.resultList}"/>
+ ...
+ </div>
+]]></programlisting>
+<itemizedlist continuation="continues">
+<listitem>Save the changes and refresh your browser. You will see that as you type characters
+in the checknumber field, all payments that begin with those characters will be displayed in the
+table automatically.</listitem>
+</itemizedlist>
+<figure>
+<title>Data Fields</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/DataFields.png"/>
+ </imageobject>
+</mediaobject>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Buttons.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>But there is still one more problem in this page, you will see that the "Next" and
+ "Previous" buttons will be displayed even for search results that are small as shown above.</para>
+ <itemizedlist continuation="continues">
+<listitem>The tag that we added in the previous step only updates the table. Let us add an AJAX
+region around the page buttons at the bottom of the table. This will allow Ajax4jsf to update
+those buttons independently.</listitem>
+</itemizedlist>
+<programlisting role="JSP"><![CDATA[<a4j:outputPanel ajaxRendered="true">
+ <div class="tableControl">
+ ...
+ </div>
+ </a4j:outputPanel>
+]]></programlisting>
+<para>Add an <emphasis role="bold"><property><a4j:outputPanel></property></emphasis> tag around the page buttons as shown above and run the page again.
+ If the result list is small, you will see that the page buttons are no longer visible as shown
+ below.</para>
+ <figure>
+<title>Datatable With No Page Buttons</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/NoButtons.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist continuation="continues">
+<listitem>Let add one more thing to complete this part of the sample. When we type a character in
+ the "checknumber" field, there is no visual feedback to the user that there is a request being
+ made to the server.</listitem>
+ </itemizedlist>
+ <para>Ajax4jsf has a pre-built tag <emphasis role="bold"><property><a4j:status></property></emphasis> that allows you to either render a text or an
+ image in response to an AJAX event. Add the following code, right after the end of the
+ <emphasis role="bold"><property><h:inputText></property></emphasis> tag.</para>
+ <programlisting role="JSP"><![CDATA[<a4j:status>
+ <f:facet name="start">
+ <h:graphicImage value="/img/ajax-loader.gif" style="border: 1px solid #E0E0E0"/>
+ </f:facet>
+ </a4j:status>
+]]></programlisting>
+<para>Save changes to the page and refresh the browser. You will see the image when the AJAX
+request is active. The image will disappear as soon as the response is received.</para>
+<itemizedlist continuation="continues">
+<listitem>Finally, let us place the image beside the "checknumber" text box. Place a
+<emphasis role="bold"><property><h:panelGroup></property></emphasis> around the <emphasis role="bold"><property><h:inputText></property></emphasis> and <emphasis role="bold"><property><a4j:status></property></emphasis> tags as shown below.
+Save changes and refresh the browser. You should see the image right next to the text box.</listitem>
+ </itemizedlist>
+ <programlisting role="JSP"><![CDATA[<h:panelGroup>
+ <h:inputText id="checknumber"
+ value="#{paymentsList.payments.checknumber}">
+ <a4j:support event="onkeyup"
+ reRender="paymentsList"/>
+ </h:inputText>
+ <a4j:status>
+ <f:facet name="start">
+ <h:graphicImage value="/img/ajax-loader.gif"
+ style="border: 1px solid #E0E0E0"/>
+ </f:facet>
+ </a4j:status>
+ </h:panelGroup>
+]]></programlisting>
+<para>Although this example was a bit long, it shows how easy it is to add AJAX capabilities to
+an existing Seam application.</para>
+</section>
+<section id="AddingRichfacesComponentsToaSeamApplication">
+<?dbhtml filename="AddingRichfacesComponentsToaSeamApplication.html"?>
+<title>Adding RichFaces components to a Seam application</title>
+<para>Now that we have seen how AJAX can bring interactivity to an application, let us add rich
+controls that will improve the user experience. RichFaces provides numerous rich controls that
+can be added to an application. In this section we will add spinner and slider controls that
+allow users to change numerical values without using the keyboard.</para>
+<para>Double Click on the OrderdetailsEdit.xhtml to open the visual facelet designer. You will
+ notice that in the beginning of the source, Seam Gen has already included the tag library
+ references to Ajax4jsf and RichFaces as shown below.</para>
+ <programlisting role="JSP"><![CDATA[<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+ xmlns:rich="http://richfaces.ajax4jsf.org/rich"
+ template="layout/template.xhtml">
+]]></programlisting>
+<para>In this page, we are going to replace the "quantityordered" text box with the spinner
+ control.</para>
+ <itemizedlist>
+ <listitem>In the visual view of the page, click on the "quantityordered" text box, this will
+ select the appropriate markup in the source view. Delete the selected markup.</listitem>
+ </itemizedlist>
+ <figure>
+<title>Deleting Selected Markup</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/DeletingSelectedMarkup.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>We will replace the <emphasis role="bold"><property><h:inputText></property></emphasis> tag with a pre-built <emphasis role="bold"><property><rich:inputNumberSpinner></property></emphasis> tag.
+ The spinner control tag is very simple to use and like all other JSF controls, it has a value
+ attribute that can be bound to any JSF Managed Bean or Seam component. The designer allows you
+ to visually find all the beans available as shown below. Right
+ click on the <emphasis role="bold"><property><rich:inputNumberSpinner></property></emphasis> input field and select "<emphasis role="bold"><property><rich:inputNumberSpinner></property></emphasis> Attributes".</para>
+ <figure>
+<title>Replacing Tags</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/ReplacingTags.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>The minValue and maxValue are self explanatory, they represent the minimum and maximum
+ values for the spinner. Place the following tag in your page.</para>
+ <programlisting role="JSP"><![CDATA[<rich:inputNumberSpinner
+ value="#{orderdetailsHome.definedInstance.quantityordered}"
+ inputStyle="width:30px; height:20px"
+ minValue="0"
+ maxValue="100"
+ required="true"/>
+]]></programlisting>
+
+<itemizedlist continuation="continues">
+<listitem>Save changes and refresh the browser page. Your output page should look like this:</listitem>
+</itemizedlist>
+<figure>
+<title>Output Page</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/OutputPage.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist continuation="continues">
+<listitem>Although this is not the best situation to use a slider, let us take a quick look at
+another RichFaces control <emphasis role="bold"><property><rich:inputNumberSlider></property></emphasis>. The slider control is similar to the the
+spinner control; it is bound to the same object. Replace the spinner with the following markup.
+Save the page and refresh your browser window.</listitem>
+</itemizedlist>
+<programlisting role="JSP"><![CDATA[<rich:inputNumberSlider
+ value="#{orderdetailsHome.definedInstance.quantityordered}"
+ styleClass="slider"
+ width="200"/>
+]]></programlisting>
+<figure>
+<title>InputNumberSlider Settings</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/InputNumberSliderSettings.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist continuation="continues">
+<listitem>Seam Gen also generates a date picker control for all date fields in an edit page.
+ Click on "Order List" and edit one of the orders to see an example of the date picker control
+ that is bundled with Seam.</listitem>
+</itemizedlist>
+
+<figure>
+<title>Order List</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/OrderedList.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+
+</section>
+<section id="ValidatingTheAJAXWay(LiveValidations)">
+<?dbhtml filename="ValidatingTheAJAXWay(LiveValidations).html"?>
+<title>Validating the AJAX way (Live Validations)</title>
+<para>Seam Gen also generates field validation code that leverages AJAX techniques, by providing
+ immediate feedback to users who use these applications. To see an example of this, go back to
+ the Office Edit page and leave the city blank and tab out of the field. Seam will immediately
+ validate the field and tell you that the value is required.</para>
+ <figure>
+<title>Office Edit Page</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/OfficeEditPage.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>To provide this functionality for every required field in the page Seam generates the
+ following markup:</para>
+<programlisting role="JSP"><![CDATA[<s:decorate id="cityDecoration">
+<h:inputText id="city"
+ required="true"
+ size="50"
+ maxlength="50"
+ value="#{officesHome.instance.city}">
+ <a:support event="onblur" reRender="cityDecoration"/>
+ </h:inputText>
+ </s:decorate>
+]]></programlisting>
+<para>Seam uses Ajax4jsf to make a server side call to validate the field.</para>
+</section>
+</section>
+
+<section id="OtherRelevantResourcesOnTheTopic2">
+<?dbhtml filename="OtherRelevantResourcesOnTheTopic2.html"?>
+<title>Other relevant resources on the topic</title>
+<para>Seam on JBoss: <ulink url="http://www.jboss.com/products/seam">Seam Framework</ulink></para>
+
+<para>Ten Good Reasons to use Seam: <ulink url="http://www.jboss.com/products/seam/whyseam">Why Seam</ulink></para>
+<para>Getting Started: <ulink url="http://labs.jboss.com/jbossseam/gettingstarted">Getting Started with JBoss Seam</ulink></para>
+<para>Wiki: <ulink url="http://www.jboss.com/wiki/Wiki.jsp?page=JBossSeam">JBoss Wiki</ulink></para>
+<para>FAQ: <ulink url="http://labs.jboss.com/jbossseam/faq/index.html">JBoss Seam FAQ</ulink></para>
+<para>Downloads: <ulink url="http://labs.jboss.com/jbossseam/download">JBoss Seam Downloads</ulink></para>
+<para>Jira: <ulink url="http://jira.jboss.org/jira/browse/JBSEAM">Jira issue tracker</ulink></para>
+<para>Rules Framework: <ulink url="http://www.jboss.com/products/rules">JBoss Rules</ulink></para>
+</section>
+</chapter>
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/ManageJBossAS.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/ManageJBossAS.xml (rev 0)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/ManageJBossAS.xml 2007-07-23 12:13:31 UTC (rev 2594)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="ManageJBossAS" xreflabel="ManageJBossAS">
+ <?dbhtml filename="ManageJBossAS.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>Red Hat Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>Java</keyword>
+ <keyword>JBoss</keyword>
+ <keyword>JBoss AS</keyword>
+ </keywordset>
+ </chapterinfo>
+ <title>Manage JBoss AS from Red Hat Developer Studio</title>
+
+</chapter>
+
17 years, 5 months
JBoss Tools SVN: r2593 - in trunk/common/plugins/org.jboss.tools.common.model: resources/meta and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-23 07:53:37 -0400 (Mon, 23 Jul 2007)
New Revision: 2593
Removed:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/CloseProjectHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/NewProjectHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenProjectHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ReopenProjectHandler.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model/plugin.xml
trunk/common/plugins/org.jboss.tools.common.model/resources/meta/base.meta
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java
Log:
Obsolete *.pex extension usage removed
Modified: trunk/common/plugins/org.jboss.tools.common.model/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/plugin.xml 2007-07-23 11:36:03 UTC (rev 2592)
+++ trunk/common/plugins/org.jboss.tools.common.model/plugin.xml 2007-07-23 11:53:37 UTC (rev 2593)
@@ -99,8 +99,6 @@
class="org.jboss.tools.common.meta.action.impl.handlers.ChildrenCopyHandler"/>
<xclass id="org.jboss.tools.common.meta.action.impl.handlers.ChildrenDeleteHandler"
class="org.jboss.tools.common.meta.action.impl.handlers.ChildrenDeleteHandler"/>
- <xclass id="org.jboss.tools.common.meta.action.impl.handlers.CloseProjectHandler"
- class="org.jboss.tools.common.meta.action.impl.handlers.CloseProjectHandler"/>
<xclass id="org.jboss.tools.common.meta.action.impl.handlers.CopyHandler"
class="org.jboss.tools.common.meta.action.impl.handlers.CopyHandler"/>
<xclass id="org.jboss.tools.common.meta.action.impl.handlers.CreateIconHandler"
@@ -119,10 +117,6 @@
class="org.jboss.tools.common.meta.action.impl.handlers.DefaultSpecialHandler"/>
<xclass id="org.jboss.tools.common.meta.action.impl.handlers.MoveHandler"
class="org.jboss.tools.common.meta.action.impl.handlers.MoveHandler"/>
- <xclass id="org.jboss.tools.common.meta.action.impl.handlers.NewProjectHandler"
- class="org.jboss.tools.common.meta.action.impl.handlers.NewProjectHandler"/>
- <xclass id="org.jboss.tools.common.meta.action.impl.handlers.OpenProjectHandler"
- class="org.jboss.tools.common.meta.action.impl.handlers.OpenProjectHandler"/>
<xclass id="org.jboss.tools.common.meta.action.impl.handlers.OpenWithChoiceHandler"
class="org.jboss.tools.common.meta.action.impl.handlers.OpenWithChoiceHandler"/>
<xclass id="org.jboss.tools.common.meta.action.impl.handlers.OpenWithExternalHandler"
@@ -131,8 +125,6 @@
class="org.jboss.tools.common.meta.action.impl.handlers.PasteHandler"/>
<xclass id="org.jboss.tools.common.meta.action.impl.handlers.PropertiesHandler"
class="org.jboss.tools.common.meta.action.impl.handlers.PropertiesHandler"/>
- <xclass id="org.jboss.tools.common.meta.action.impl.handlers.ReopenProjectHandler"
- class="org.jboss.tools.common.meta.action.impl.handlers.ReopenProjectHandler"/>
<xclass id="org.jboss.tools.common.meta.action.impl.handlers.ReplaceWithNewHandler"
class="org.jboss.tools.common.meta.action.impl.handlers.ReplaceWithNewHandler"/>
<xclass id="org.jboss.tools.common.meta.action.impl.handlers.SaveAllHandler"
Modified: trunk/common/plugins/org.jboss.tools.common.model/resources/meta/base.meta
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/resources/meta/base.meta 2007-07-23 11:36:03 UTC (rev 2592)
+++ trunk/common/plugins/org.jboss.tools.common.model/resources/meta/base.meta 2007-07-23 11:53:37 UTC (rev 2593)
@@ -612,13 +612,6 @@
</XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
- <XActionItem BaseActionName="ReopenWorkspace"
- HandlerClassName="org.jboss.tools.common.meta.action.impl.handlers.ReopenProjectHandler"
- ICON="action.newpackage" SAVE_REQUIRED="yes"
- displayName="Reopen Workspace" kind="action" name="Reopen"/>
- <XActionItem
- HandlerClassName="org.jboss.tools.common.meta.action.impl.handlers.CloseProjectHandler"
- ICON="action.delete" displayName="Close Project" kind="action" name="Close"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -652,30 +645,6 @@
</XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
- <XActionItem BaseActionName="NewWorkspace"
- HandlerClassName="org.jboss.tools.common.meta.action.impl.handlers.NewProjectHandler"
- ICON="main.projects.new" SAVE_REQUIRED="yes"
- WizardClassName="%Default%" displayName="New Workspace..."
- kind="action" name="NewWorkspace">
- <EntityData EntityName="RootNewUtil">
- <AttributeData AttributeName="name"/>
- <AttributeData AttributeName="folder"/>
- <AttributeData AttributeName="allocate new folder"/>
- </EntityData>
- </XActionItem>
- <XActionItem BaseActionName="OpenWorkspace"
- HandlerClassName="org.jboss.tools.common.meta.action.impl.handlers.OpenProjectHandler"
- ICON="main.projects.item" SAVE_REQUIRED="yes"
- WizardClassName="%OneParameter%" displayName="Open Workspace..."
- kind="action" name="OpenWorkspace">
- <EntityData EntityName="RootOpenUtil">
- <AttributeData AttributeName="redhat project"/>
- </EntityData>
- </XActionItem>
- <XActionItem BaseActionName="ReopenWorkspace"
- HandlerClassName="org.jboss.tools.common.meta.action.impl.handlers.ReopenProjectHandler"
- ICON="main.projects.reopen" SAVE_REQUIRED="yes"
- displayName="Reopen Workspace..." kind="action" name="ReopenWorkspace"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
Deleted: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/CloseProjectHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/CloseProjectHandler.java 2007-07-23 11:36:03 UTC (rev 2592)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/CloseProjectHandler.java 2007-07-23 11:53:37 UTC (rev 2593)
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.meta.action.impl.handlers;
-
-import java.util.*;
-import org.jboss.tools.common.meta.action.impl.*;
-import org.jboss.tools.common.model.*;
-
-public class CloseProjectHandler extends AbstractHandler {
-// private ReopenProjectHandler rph = new ReopenProjectHandler();
-
- public CloseProjectHandler() {}
-
- public boolean isEnabled(XModelObject object) {
- return (object != null && object.isActive());
- }
-
- public void executeHandler(XModelObject object, Properties p) throws Exception {
- XModel m = object.getModel();
- if(!NewProjectHandler.save(m, action)) return;
- removeWorkspace(object);
- m.getProperties().remove(XModelConstants.WORKSPACE);
- m.getProperties().remove("global.ECOM_DATA");
- m.load();
- }
-
- private void removeWorkspace(XModelObject object) {
- object.getParent().set("OPEN", "no");
- object.setModified(true);
- object.removeFromParent();
- object.getModel().save();
- }
-
-}
Deleted: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/NewProjectHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/NewProjectHandler.java 2007-07-23 11:36:03 UTC (rev 2592)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/NewProjectHandler.java 2007-07-23 11:53:37 UTC (rev 2593)
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.meta.action.impl.handlers;
-
-import java.io.*;
-import java.util.*;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.impl.*;
-import org.jboss.tools.common.meta.action.*;
-import org.jboss.tools.common.model.util.*;
-
-public class NewProjectHandler extends DefaultCreateHandler {
-
- public NewProjectHandler() {}
-
- public void executeHandler(XModelObject object, Properties prop) throws Exception {
- if(!isEnabled(object)) return;
- Properties p = extractProperties(data[0]);
- String dir = Paths.expand(p.getProperty("folder"), object.getModel().getProperties());
- String name = p.getProperty("name");
- XModel m = object.getModel();
- if(!save(m, action)) return;
- File f = (!"no".equals(p.getProperty("allocate new folder")))
- ? createInNewFolder(m, dir, name)
- : createNamedProject(m, dir, name);
- setGlobalJavaHome();
- m.load();
- notify(m, f);
- }
-
- private File createInNewFolder(XModel m, String dir, String name) {
- File d = new File(dir);
- d = new File(d, name);
- if(d.isDirectory())
- throw new RuntimeException("Cannot write new project over an old one.\nRemove directory " + d.getAbsolutePath() + " first.");
- File f = new File(d, "workspace.pex");
- doCreateProject(m, f, null);
- return f;
- }
-
- private File createNamedProject(XModel m, String dir, String name) {
- File d = new File(dir);
- File f = new File(d, name + "-" + "workspace.pex");
- doCreateProject(m, f, name);
- return f;
- }
-
- private void doCreateProject(XModel m, File f, String name) {
- try {
- if(f.exists()) throw new Exception();
- f.getParentFile().mkdirs();
- f.createNewFile();
- } catch (Exception e) {
- throw new RuntimeException(getMessageById("INVALID_TEMPLATE_LOCATION"));
- }
- XModelConstants.setWorkspace(m, f.getParent().replace('\\', '/'));
- XModelConstants.setWorkspaceName(m, name);
- }
-
- public static boolean save(XModel model, XAction action) {
- if(!model.getRoot().isModified()) return true;
- String h = action.getDisplayName();
- if(h.endsWith("...")) h = h.substring(0, h.length() - 3);
- int i = model.getService().showDialog(h,
- getMessageById("SAVE_REQUEST"),
- new String[]{"Yes", "No", "Cancel"}, null, 0);
- if(i == 2 || i < 0) return false;
- if(i == 0) model.save();
- return true;
- }
-
- public static void notify(XModel model, File f) {
- OpenedProjectsImpl p = (OpenedProjectsImpl)model.getRoot().getChildByPath("Workspaces");
- p.last(f.getAbsolutePath());
- model.getRoot("Options").setModified(true);
- model.saveOptions();
- model.save();
- }
-
- private void setGlobalJavaHome() {
- if(System.getProperty("global.JAVA_HOME") != null) return;
- String s = System.getProperty("java.home");
- if(s.endsWith("jre")) s = s.substring(0, s.length() - 4);
- System.setProperty("global.JAVA_HOME", s);
- }
-
-}
-
Deleted: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenProjectHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenProjectHandler.java 2007-07-23 11:36:03 UTC (rev 2592)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenProjectHandler.java 2007-07-23 11:53:37 UTC (rev 2593)
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.meta.action.impl.handlers;
-
-import java.io.*;
-import java.util.*;
-import org.jboss.tools.common.meta.action.*;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.util.Paths;
-import org.jboss.tools.common.model.impl.*;
-
-public class OpenProjectHandler extends DefaultCreateHandler {
-
- public OpenProjectHandler() {}
-
- public void executeHandler(XModelObject object, Properties prop) throws Exception {
- if(!isEnabled(object)) return;
- XEntityData[] es = (XEntityData[])data;
- Properties p = extractProperties(es[0]);
- String project = p.getProperty("redhat project");
- project = Paths.expand(project, object.getModel().getProperties()).replace('\\', '/');
- if(project.lastIndexOf(':') < 2) {
- File f = new File(project);
- if(!f.exists() || !f.isFile() || !project.endsWith(".pex"))
- throw new RuntimeException(getMessageById("INVALID_TEMPLATE_LOCATION"));
- }
- XModel m = object.getModel();
- if(!NewProjectHandler.save(m, action)) return;
-
- int q = project.lastIndexOf('/');
- String ws = project.substring(0, q);
- XModelConstants.setWorkspace(m, ws);
-/*
- String n = project.substring(q + 1);
- q = n.lastIndexOf('-');
- String wsn = (q < 0) ? null : n.substring(0, q);
- XModelConstants.setWorkspaceName(m, wsn);
-*/
- XModelConstants.setWorkspaceName(m, getProjectNameFromPex(project.substring(q + 1)));
- m.load();
- notify(m, project);
- }
-
- public static String getProjectNameFromPex(String pexFileName)
- {
- int q = pexFileName.lastIndexOf('-');
- return (q < 0) ? null : pexFileName.substring(0, q);
- }
-
- public static void notify(XModel model, String last) {
- OpenedProjectsImpl p = (OpenedProjectsImpl)model.getRoot().getChildByPath("Workspaces");
- p.last(last);
- model.getRoot("Options").setModified(true);
- model.saveOptions();
- model.save();
- }
-
- public XEntityData[] getEntityData(XModelObject object) {
- super.getEntityData(object);
- XAttributeData a = data[0].getAttributeData()[0];
- String s = XModelConstants.getWorkspace(object.getModel());
- if(s == null || s.length() == 0) return data;
- File f = new File(s);
- s = f.getParent().replace('\\', '/');
- a.setValue(s);
- return data;
- }
-
-}
-
Deleted: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ReopenProjectHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ReopenProjectHandler.java 2007-07-23 11:36:03 UTC (rev 2592)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/ReopenProjectHandler.java 2007-07-23 11:53:37 UTC (rev 2593)
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.meta.action.impl.handlers;
-
-import java.util.*;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.meta.action.*;
-import org.jboss.tools.common.meta.action.impl.AbstractHandler;
-
-public class ReopenProjectHandler extends AbstractHandler {
-
- private static OpenProjectHandler oph = new OpenProjectHandler();
-
- public ReopenProjectHandler() {}
-
- public void executeHandler(XModelObject object, Properties p) throws Exception {
- if(!isEnabled(object)) return;
- String s = object.getAttributeValue("name");
- XModelObject ps = object.getModel().getRoot().getChildren("Workspaces")[0];
- if(ps == object) throw new RuntimeException("Handler is implemented in XStudio.");
- XAction a = (XAction)ps.getModelEntity().getActionList().getItem("OpenWorkspace");
- Object d = a.getEntityData(object);
- HUtil.find(d, 0, "redhat project").setValue(s);
- oph.setAction(action);
- oph.setData((XEntityData[])d);
- oph.executeHandler(object, p);
- }
-
- public boolean isEnabled(XModelObject object) {
- return (object != null);
- }
-}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java 2007-07-23 11:36:03 UTC (rev 2592)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java 2007-07-23 11:53:37 UTC (rev 2593)
@@ -94,9 +94,6 @@
private void removeFiles(String location, String workspace) {
File f = new File(location + "/" + IModelNature.PROJECT_FILE);
if(f.exists()) f.delete();
- File dir = new File(workspace);
- File[] fs = dir.listFiles();
- if(fs != null) for (int i = 0; i < fs.length; i++)
}
public boolean getSignificantFlag(XModelObject object) {
17 years, 5 months
JBoss Tools SVN: r2592 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-23 07:36:03 -0400 (Mon, 23 Jul 2007)
New Revision: 2592
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java
Log:
Obsolete *.pex extension usage removed
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java 2007-07-23 11:25:53 UTC (rev 2591)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java 2007-07-23 11:36:03 UTC (rev 2592)
@@ -97,7 +97,6 @@
File dir = new File(workspace);
File[] fs = dir.listFiles();
if(fs != null) for (int i = 0; i < fs.length; i++)
- if(fs[i].isFile() && fs[i].getName().endsWith(".pex")) fs[i].delete();
}
public boolean getSignificantFlag(XModelObject object) {
17 years, 5 months
JBoss Tools SVN: r2591 - in trunk: aop/plugins/org.jboss.ide.eclipse.jdt.aop.ui and 18 other directories.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-07-23 07:25:53 -0400 (Mon, 23 Jul 2007)
New Revision: 2591
Modified:
trunk/aop/plugins/org.jboss.ide.eclipse.jdt.aop.core/
trunk/aop/plugins/org.jboss.ide.eclipse.jdt.aop.ui/
trunk/common/tests/org.jboss.tools.common.kb.test/
trunk/common/tests/org.jboss.tools.common.model.test/
trunk/common/tests/org.jboss.tools.common.test/
trunk/common/tests/org.jboss.tools.common.verification.test/
trunk/core/tests/org.jboss.ide.eclipse.packages.test/
trunk/core/tests/org.jboss.ide.eclipse.xdoclet.test/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/
trunk/jsf/tests/org.jboss.tools.jsf.test/
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/
trunk/jsf/tests/org.jboss.tools.jsf.verification.test/
trunk/jst/tests/org.jboss.tools.jst.web.test/
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/
trunk/seam/tests/org.jboss.tools.seam.core.test/
trunk/seam/tests/org.jboss.tools.seam.ui.test/
trunk/tests/tests/org.jboss.tools.test/
trunk/vpe/tests/org.jboss.tools.vpe.mozilla.test/
trunk/vpe/tests/org.jboss.tools.vpe.test/
Log:
more svn:ignore bin
Property changes on: trunk/aop/plugins/org.jboss.ide.eclipse.jdt.aop.core
___________________________________________________________________
Name: svn:ignore
- generated
+ bin
Property changes on: trunk/aop/plugins/org.jboss.ide.eclipse.jdt.aop.ui
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/common/tests/org.jboss.tools.common.kb.test
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/common/tests/org.jboss.tools.common.model.test
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/common/tests/org.jboss.tools.common.test
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/common/tests/org.jboss.tools.common.verification.test
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/core/tests/org.jboss.ide.eclipse.packages.test
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/core/tests/org.jboss.ide.eclipse.xdoclet.test
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.verification.test
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.test
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.ui.test
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/seam/tests/org.jboss.tools.seam.core.test
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/seam/tests/org.jboss.tools.seam.ui.test
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/tests/tests/org.jboss.tools.test
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.mozilla.test
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.test
___________________________________________________________________
Name: svn:ignore
+ bin
17 years, 5 months
JBoss Tools SVN: r2590 - in trunk/seam/plugins: org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-07-23 07:13:29 -0400 (Mon, 23 Jul 2007)
New Revision: 2590
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
Log:
http://jira.jboss.com/jira/browse/EXIN-327 EL Validation
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2007-07-23 08:31:22 UTC (rev 2589)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2007-07-23 11:13:29 UTC (rev 2590)
@@ -111,7 +111,7 @@
}
}
}
-
+
// Here we have a list of vars for some part of expression
// OK. we'll proceed with members of these vars
if (areEqualExpressions(resolvedExpressionPart, tokens)) {
@@ -121,6 +121,8 @@
String prefixString = prefix.toString();
if(prefixString.length()<varName.length()) {
res.add(varName.substring(prefixString.length()));
+ } else if(returnEqualedVariablesOnly) {
+ res.add(varName);
}
}
return res;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2007-07-23 08:31:22 UTC (rev 2589)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2007-07-23 11:13:29 UTC (rev 2590)
@@ -12,7 +12,6 @@
package org.jboss.tools.seam.internal.core.el;
import java.lang.reflect.Modifier;
-
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@@ -33,6 +32,7 @@
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamXmlFactory;
import org.jboss.tools.seam.core.ScopeType;
+import org.jboss.tools.seam.core.SeamCorePlugin;
/**
* Utility class used to resolve Seam project variables and to get the methods/properties and their presentation strings from type
@@ -163,6 +163,7 @@
}
}
} catch (JavaModelException e) {
+ SeamCorePlugin.getDefault().logError(e);
}
}
return methods;
@@ -186,7 +187,11 @@
"get".equals(m.getElementName()) || "set".equals(m.getElementName())) {
StringBuffer name = new StringBuffer(m.getElementName());
-
+
+ // Add method as 'foo'
+ methods.add(name.toString());
+
+ // Add method as 'foo(param1,param2)'
name.append('(');
String[] mParams = null;
mParams = m.getParameterNames();
@@ -195,11 +200,12 @@
name.append(mParams[j]);
}
name.append(')');
-
+
methods.add(name.toString());
}
}
} catch (JavaModelException e) {
+ SeamCorePlugin.getDefault().logError(e);
}
}
return methods;
@@ -225,6 +231,7 @@
}
}
} catch (JavaModelException e) {
+ SeamCorePlugin.getDefault().logError(e);
}
try {
@@ -236,6 +243,7 @@
}
}
} catch (JavaModelException e) {
+ SeamCorePlugin.getDefault().logError(e);
}
}
return properties;
@@ -257,15 +265,16 @@
if (Modifier.isPublic(m.getFlags()) &&
(m.getElementName().startsWith("get") && !"get".equals(m.getElementName())) ||
(m.getElementName().startsWith("set") && !"set".equals(m.getElementName()))) {
-
+
StringBuffer name = new StringBuffer(m.getElementName());
name.delete(0, 3);
name.setCharAt(0, Character.toLowerCase(name.charAt(0)));
-
+
properties.add(name.toString());
}
}
} catch (JavaModelException e) {
+ SeamCorePlugin.getDefault().logError(e);
}
try {
@@ -277,8 +286,9 @@
}
}
} catch (JavaModelException e) {
+ SeamCorePlugin.getDefault().logError(e);
}
}
return properties;
}
-}
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2007-07-23 08:31:22 UTC (rev 2589)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2007-07-23 11:13:29 UTC (rev 2590)
@@ -252,7 +252,7 @@
if (result == null || result.size() == 0)
return NO_PROPOSALS;
- return (ICompletionProposal[]) result.toArray(new ICompletionProposal[uniqueSuggestions.size()]);
+ return (ICompletionProposal[]) result.toArray(new ICompletionProposal[result.size()]);
} catch (BadLocationException x) {
return NO_PROPOSALS;
} catch (StringIndexOutOfBoundsException e) {
17 years, 5 months
JBoss Tools SVN: r2589 - trunk/vpe/plugins/org.jboss.tools.vpe.mozilla/src/org/jboss/tools/vpe/mozilla/browser.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2007-07-23 04:31:22 -0400 (Mon, 23 Jul 2007)
New Revision: 2589
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.mozilla/src/org/jboss/tools/vpe/mozilla/browser/MozillaBrowser.java
Log:
some code was adjusted, focus for widget which contained mozilla browser is setted when mozilla browser is selected
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.mozilla/src/org/jboss/tools/vpe/mozilla/browser/MozillaBrowser.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.mozilla/src/org/jboss/tools/vpe/mozilla/browser/MozillaBrowser.java 2007-07-23 08:27:44 UTC (rev 2588)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.mozilla/src/org/jboss/tools/vpe/mozilla/browser/MozillaBrowser.java 2007-07-23 08:31:22 UTC (rev 2589)
@@ -2213,6 +2213,9 @@
if (rc != XPCOM.NS_OK) error(rc);
baseWindow.Release();
+ //set focus current widget
+ super.setFocus();
+
return XPCOM.NS_OK;
}
17 years, 5 months
JBoss Tools SVN: r2588 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2007-07-23 04:27:44 -0400 (Mon, 23 Jul 2007)
New Revision: 2588
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
Log:
bug fixing JBIDE 528, CTRL+M was resolved,
[ http://jira.jboss.com/jira/browse/JBIDE-528?page=all ]
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2007-07-22 07:10:11 UTC (rev 2587)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2007-07-23 08:27:44 UTC (rev 2588)
@@ -10,9 +10,9 @@
******************************************************************************/
package org.jboss.tools.vpe.editor;
+import java.util.Iterator;
import java.util.List;
import java.util.Properties;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -22,6 +22,9 @@
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.bindings.Binding;
+import org.eclipse.jface.bindings.keys.KeySequence;
+import org.eclipse.jface.bindings.keys.KeyStroke;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.viewers.ISelection;
@@ -51,7 +54,10 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.internal.keys.WorkbenchKeyboard;
+import org.eclipse.ui.keys.IBindingService;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent;
import org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener;
@@ -147,6 +153,9 @@
import org.w3c.dom.Text;
public class VpeController implements INodeAdapter, IModelLifecycleListener, INodeSelectionListener, ITextSelectionListener, SelectionListener, EditorDomEventListener, VpeTemplateListener, XModelTreeListener, ResourceReferenceListListener, ISelectionChangedListener, IVisualController {
+ //id of command which is maximazed/minimazed editor
+ private static final String MAXIMAZE_PART_ID="org.eclipse.ui.window.maximizePart";
+
StructuredTextEditor sourceEditor;
private MozillaEditor visualEditor;
MozillaBrowser browser;
@@ -786,7 +795,7 @@
selectionBuilder.setClickContentAreaSelection();
}
}
- switcher.stopActiveEditor();
+ switcher.stopActiveEditor();
}
public void mouseDblClick(nsIDOMMouseEvent mouseEvent) {
@@ -846,12 +855,17 @@
if (VpeDebug.printVisualKeyEvent) {
System.out.println("<<< keyPress type: " + keyEvent.getType() + " Ctrl: " + keyEvent.isCtrlKey() + " Shift: " + keyEvent.isShiftKey() + " CharCode: " + keyEvent.getCharCode() + " KeyCode: " + keyEvent.getKeyCode()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
}
+
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+ switcher.stopActiveEditor();
return;
}
+
visualEditor.hideResizer();
+ //TODO with this behaviour isn't works 'CTRL+M'
switcher.stopActiveEditor();
+
try {
if (visualKeyHandler.keyPressHandler(keyEvent)) {
switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL);
@@ -882,21 +896,47 @@
keyboardEvent.stateMask = (aAltKey[0] ? SWT.ALT : 0) | (aCtrlKey[0] ? SWT.CTRL : 0) | (aShiftKey[0] ? SWT.SHIFT : 0) | (aMetaKey[0] ? SWT.MOD1 : 0);
keyboardEvent.x=0;
keyboardEvent.y=0;
- keyboardEvent.type=1;
+ keyboardEvent.type=SWT.KeyDown;
if(keyEvent.getKeyCode()==0) {
- keyboardEvent.keyCode=keyEvent.getCharCode();
+ keyboardEvent.keyCode=keyEvent.getCharCode();
} else{
- keyboardEvent.keyCode=keyEvent.getKeyCode();
+ keyboardEvent.keyCode=keyEvent.getKeyCode();
}
+ //for maximaze/minimaze command(CTRL+M), we shouldn't call event listeners
+ List possibleKeyStrokes = WorkbenchKeyboard.generatePossibleKeyStrokes(keyboardEvent);
+ IWorkbench iWorkbench = VpePlugin.getDefault().getWorkbench();
+ if(iWorkbench.hasService(IBindingService.class)){
+ IBindingService iBindingService = (IBindingService) iWorkbench.getService(IBindingService.class);
+
+ KeySequence sequenceBeforeKeyStroke = KeySequence.getInstance();
+ for (Iterator iterator = possibleKeyStrokes.iterator(); iterator
+ .hasNext();){
+ KeySequence sequenceAfterKeyStroke = KeySequence.getInstance(
+ sequenceBeforeKeyStroke, (KeyStroke) iterator.next());
+ if(iBindingService.isPerfectMatch(sequenceAfterKeyStroke)){
+ final Binding binding = iBindingService.getPerfectMatch(sequenceAfterKeyStroke);
+
+ if((binding!=null)
+ && (binding.getParameterizedCommand()!=null)
+ && (binding.getParameterizedCommand().getCommand()!=null)
+ && (binding.getParameterizedCommand().getCommand().getId()!=null)
+ &&binding.getParameterizedCommand().getCommand().getId().equals(VpeController.MAXIMAZE_PART_ID)){
+ keyboardEvent.type = SWT.NONE;
+ }
+ }
+ }
+ }
browser.notifyListeners(keyboardEvent.type, keyboardEvent);
+
}
} catch (Exception e) {
VpePlugin.getPluginLog().logError(e);
visualRefresh();
}
+
}
public void elementResized(Element element, int resizerConstrains, int top, int left, int width, int height) {
17 years, 5 months
JBoss Tools SVN: r2587 - in trunk: jsf/plugins/org.jboss.tools.jsf.ui/images/xstudio/wizards and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-07-22 03:10:11 -0400 (Sun, 22 Jul 2007)
New Revision: 2587
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/images/xstudio/editors/jsp.gif
trunk/jsf/plugins/org.jboss.tools.jsf.ui/images/xstudio/wizards/new_jsp_file.gif
trunk/jst/plugins/org.jboss.tools.jst.jsp/images/xstudio/editors/jsp.gif
Log:
http://jira.jboss.org/jira/browse/EXIN-239
finishing icons update
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/images/xstudio/editors/jsp.gif
===================================================================
(Binary files differ)
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/images/xstudio/wizards/new_jsp_file.gif
===================================================================
(Binary files differ)
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/xstudio/editors/jsp.gif
===================================================================
(Binary files differ)
17 years, 5 months
JBoss Tools SVN: r2586 - in trunk: common/plugins/org.jboss.tools.common.model.ui/images/xstudio/editors and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-07-22 03:06:48 -0400 (Sun, 22 Jul 2007)
New Revision: 2586
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/images/xstudio/actions/tomcat/tomcat_webxml.gif
trunk/common/plugins/org.jboss.tools.common.model.ui/images/xstudio/editors/xml.gif
trunk/common/plugins/org.jboss.tools.common.model.ui/images/xstudio/editors/xml_file.gif
trunk/common/plugins/org.jboss.tools.common.model.ui/images/xstudio/wizards/new_html_file.gif
trunk/common/plugins/org.jboss.tools.common.model.ui/images/xstudio/wizards/new_xml_file.gif
trunk/jsf/plugins/org.jboss.tools.jsf.ui/images/xstudio/wizards/new_html_file.gif
trunk/jst/plugins/org.jboss.tools.jst.jsp/images/xstudio/editors/html_file.gif
trunk/shale/plugins/org.jboss.tools.shale.ui/images/xstudio/editors/xml_file.gif
Log:
http://jira.jboss.org/jira/browse/EXIN-239
finishing icons update
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/images/xstudio/actions/tomcat/tomcat_webxml.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/images/xstudio/editors/xml.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/images/xstudio/editors/xml_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/images/xstudio/wizards/new_html_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/images/xstudio/wizards/new_xml_file.gif
===================================================================
(Binary files differ)
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/images/xstudio/wizards/new_html_file.gif
===================================================================
(Binary files differ)
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/xstudio/editors/html_file.gif
===================================================================
(Binary files differ)
Modified: trunk/shale/plugins/org.jboss.tools.shale.ui/images/xstudio/editors/xml_file.gif
===================================================================
(Binary files differ)
17 years, 5 months