JBoss Tools SVN: r4664 - in trunk/documentation/GettingStartedGuide/docs/userguide/en: images and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: afedosik
Date: 2007-11-02 11:40:32 -0400 (Fri, 02 Nov 2007)
New Revision: 4664
Removed:
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/AddBusinessProcess/
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/DevelopSimpleJSP/
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/RADdevelopment/
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/testNG/
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/DevelopAsimpleJSPWebApplication.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GenCURDDatabaseApp.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/RADdevelopmentOfSimpleJSFapplication.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/testNG.xml
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/master.xml
Log:
http://jira.jboss.com/jira/browse/RHDS-270 Split all Seam chapters into a "Seam Dev Tools Reference Guide".
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/master.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/master.xml 2007-11-02 15:35:57 UTC (rev 4663)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/master.xml 2007-11-02 15:40:32 UTC (rev 4664)
@@ -5,12 +5,7 @@
[<!ENTITY GettingStartedWithRHDS SYSTEM "modules/GettingStartedWithRHDS.xml">
<!ENTITY ManageJBossAS SYSTEM "modules/ManageJBossAS.xml">
<!ENTITY GetStartSeamGen SYSTEM "modules/GetStartSeamGen.xml">
-<!ENTITY DevelopAsimpleJSPWebApplication SYSTEM "modules/DevelopAsimpleJSPWebApplication.xml">
-<!ENTITY RADdevelopmentOfSimpleJSFapplication SYSTEM "modules/RADdevelopmentOfSimpleJSFapplication.xml">
-<!ENTITY GenCURDDatabaseApp SYSTEM "modules/GenCURDDatabaseApp.xml">
-<!ENTITY CURDAppWalkthrough SYSTEM "modules/CURDAppWalkthrough.xml">
-<!ENTITY AddBusinessProcess SYSTEM "modules/AddBusinessProcess.xml">
-<!ENTITY testNG SYSTEM "modules/testNG.xml">
+
]>
<book>
@@ -33,12 +28,7 @@
&GettingStartedWithRHDS;
&ManageJBossAS;
&GetStartSeamGen;
-&DevelopAsimpleJSPWebApplication;
-&RADdevelopmentOfSimpleJSFapplication;
-&GenCURDDatabaseApp;
-&CURDAppWalkthrough;
-&testNG;
-<!-- TODO: drools used in this section is not available for eclipse .3.3 &AddBusinessProcess; -->
+
</book>
Deleted: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AddBusinessProcess.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AddBusinessProcess.xml 2007-11-02 15:35:57 UTC (rev 4663)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AddBusinessProcess.xml 2007-11-02 15:40:32 UTC (rev 4664)
@@ -1,461 +0,0 @@
-<?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.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/AddBusinessProcess/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/AddBusinessProcess/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/AddBusinessProcess/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/AddBusinessProcess/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/AddBusinessProcess/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><property>resources/WEB-INF/components.xml</property></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/AddBusinessProcess/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/AddBusinessProcess/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/AddBusinessProcess/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/AddBusinessProcess/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/AddBusinessProcess/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/AddBusinessProcess/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="XML"><![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/AddBusinessProcess/OrderEditPage.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>Click the "Process Order" button.</para>
-<figure>
-<title>Order Details</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/AddBusinessProcess/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/AddBusinessProcess/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/AddBusinessProcess/AddBusinessProcess/ChangingStatusField.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>Click the "Process Order" button.</para>
-<figure>
-<title>Invoking Process Order</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/AddBusinessProcess/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/AddBusinessProcess/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>
- </chapter>
Deleted: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/CURDAppWalkthrough.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/CURDAppWalkthrough.xml 2007-11-02 15:35:57 UTC (rev 4663)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/CURDAppWalkthrough.xml 2007-11-02 15:40:32 UTC (rev 4664)
@@ -1,16 +0,0 @@
-<?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>
-
Deleted: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/DevelopAsimpleJSPWebApplication.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/DevelopAsimpleJSPWebApplication.xml 2007-11-02 15:35:57 UTC (rev 4663)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/DevelopAsimpleJSPWebApplication.xml 2007-11-02 15:40:32 UTC (rev 4664)
@@ -1,272 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="DevelopingASimpleWebApplication" xreflabel="DevelopingASimpleWebApplication">
- <?dbhtml filename="DevelopingASimpleWebApplication.html"?>
- <chapterinfo>
- <keywordset>
- <keyword>Red Hat Developer Studio</keyword>
- <keyword>JSP</keyword>
- <keyword>JBoss</keyword>
- </keywordset>
- </chapterinfo>
- <title>Developing a simple JSP web application</title>
- <para>In this chapter you'll find out how to create a simple JSP application using the Red Hat Developer Studio. The application will show a classic "Hello World!" on the page.</para>
- <para>We'll assume that you have already launched Red Hat Developer Studio and
-also that the Web Development perspective is the current perspective. (If not, make it active by selecting <emphasis><property>Window > Open Perspective > Web Development</property></emphasis> from the menu bar or by selecting <emphasis><property>Window > Open Perspective > Other...</property></emphasis> from the menu bar and then selecting Web Development from
-the Select Perspective dialog box.)</para>
- <section id="SettingUpTheProject">
- <?dbhtml filename="SettingUpTheProject.html"?>
- <title>Setting Up the Project</title>
- <para>At first a new project for the application will be created.</para>
- <itemizedlist>
- <listitem><para>Go to the menu bar and select <emphasis><property>File > New > Project...</property></emphasis></para></listitem>
- <listitem><para>Select <emphasis><property>Web > Dynamic Web Project</property></emphasis> in the New Project dialog box</para></listitem>
- <listitem><para>Click <emphasis><property>Next</property></emphasis> </para></listitem>
- <listitem><para>Enter "jspHello" as a project name</para></listitem>
- <listitem><para>Leave everything else as is, and click <emphasis><property>Finish</property></emphasis></para></listitem>
- </itemizedlist>
- <figure>
- <title>Create New Web Project</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/DevelopSimpleJSP/newproject1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>A jspHello node should appear in the upper-left Package Explorer view.</para>
- <figure>
- <title>New Web Project</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/DevelopSimpleJSP/newproject2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
-
- <section id="CreatingJSPPage">
- <?dbhtml filename="CreatingJSPPage.html"?>
- <title>Creating JSP Page</title>
- <para>In our simple application we need to create only one JSP page which displays a "Hello World!" message.</para>
- <itemizedlist continuation="continues">
-<listitem><para>Right click <emphasis><property>WebContent > New > JSP</property></emphasis>.</para></listitem>
-<listitem><para>Type "hello.jsp" for a file name and click the <emphasis><property>Next</property></emphasis> button.</para></listitem>
-</itemizedlist>
-<para>In the next window you can choose a template for your jsp page and see its preview.</para>
-<itemizedlist continuation="continues">
-<listitem><para>Select <emphasis><property>New JSP File (xhtml)</property></emphasis> template and click <emphasis><property>Finish</property></emphasis> button.</para></listitem>
-</itemizedlist>
-<figure>
- <title>Create JSP Page</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/DevelopSimpleJSP/newproject3.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Our hello.jsp page will now appear in Project Explorer.</para>
- <section id="EditingJSPPage">
- <?dbhtml filename="EditingJSPPage.html"?>
- <title>Editing a JSP Page</title>
- <para>Let's now make a little change so that a jsp page displays "Hello World!" message.</para>
- <itemizedlist continuation="continues">
-<listitem><para>Insert this line inside the <emphasis role="bold"><property><body></property></emphasis><emphasis role="bold"><property></body></property></emphasis> tag:
-</para></listitem>
-</itemizedlist>
-<programlisting role="XML"><![CDATA[<% out.println("Hello World!"); %>]]>
-</programlisting>
-
-<para>Notice that content assist functionality is always available when you are typing:</para>
-<figure>
- <title>Content Assist in JSP Page</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/DevelopSimpleJSP/newproject4.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>After changes made your hello.jsp page should look like this:</para>
- <figure>
- <title>Hello.jsp Page</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/DevelopSimpleJSP/newproject5.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
-
- <section id="WebXML">
- <?dbhtml filename="WebXML.html"?>
- <title>web.xml file</title>
- <para>When you are creating web project the wizard creates the web.xml for you automatically. The web.xml file editor provided by Red Hat Developer Studio is available in two modes: design and source.</para>
- <figure>
- <title>Web.xml in Design Mode</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/DevelopSimpleJSP/webxmldesign.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <figure>
- <title>Web.xml in Source Mode</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/DevelopSimpleJSP/webxmlsource.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Both modes are fully synchronized. Let's add mapping to our hello.jsp page in web.xml file.</para>
- <itemizedlist>
- <listitem><para>Switch to <property>source</property> mode.</para></listitem>
- <listitem><para>Add the next code into <emphasis role="bold"><property><welcome-file-list></property></emphasis>:</para></listitem>
- </itemizedlist>
- <programlisting role="XML"><![CDATA[<welcome-file>hello.jsp</welcome-file>
-]]></programlisting>
-<para>If you come back to design mode you will see that the changes made are automatically reflected in that mode.</para>
-<para>Actually you don't really need any config right now. You can clear the web.xml file, save it and you'll still be able to launch your application.</para>
- </section>
-
- <section id="DeployTheProject">
- <?dbhtml filename="DeployTheProject.html"?>
- <title>Deploying the project</title>
- <para>While creating any web project you could experience a pain writing ant scripts and managing the
-packaging even if a developer is writing the most trivial web applications. With Red Hat Developer Studio you are saved from such a pain. All you need is to start JBoss server and launch your application in your favorite browser.</para>
- <para>You can also create a war archive with RHDS's Archive Tools and export it to any web server.</para>
- <section id="WarConfig">
- <?dbhtml filename="WarConfig.html"?>
- <title>WAR Config</title>
- <para>Project archives managing is available through <property>Project archives</property> view.</para>
- <itemizedlist>
- <listitem><para>Select <emphasis><property>Window > Show view > Other > JBoss Tools > Project archives</property></emphasis> from menu bar</para></listitem>
- <listitem><para>Select a project in Package Explorer you want to be archived</para></listitem>
- </itemizedlist>
- <para>In Project Archives you will see available archive types for the project:</para>
- <figure>
- <title>Project Archives</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/DevelopSimpleJSP/simplejspwebapplication.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <itemizedlist>
- <listitem><para>Click, for example, <emphasis><property>WAR</property></emphasis> option to create war archive</para></listitem>
- </itemizedlist>
- <para>In the dialog New WAR you can see automatically selected default values</para>
- <figure>
- <title>New WAR Archive</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/DevelopSimpleJSP/simplejspwebapplication2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <itemizedlist>
- <listitem><para>Click <emphasis><property>Next</property></emphasis> to see a stub archive configuration for your project:
- <figure>
- <title>Stub Archive Configuration</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/DevelopSimpleJSP/simplejspwebapplication3.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </para></listitem>
- <listitem><para>Click <emphasis><property>Finish</property></emphasis>. The <emphasis>.war</emphasis> file will appear in Package Explorer and in Project archives view as structure tree:
- <figure>
- <title>Archive is Created</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/DevelopSimpleJSP/simplejspwebapplication4.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <figure>
- <title>Archive in Project Archives View</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/DevelopSimpleJSP/simplejspwebapplication5.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </para></listitem>
- </itemizedlist>
- <para>Via Project archives view you could now edit your archive, add new folders, publish to server, and so on:</para>
- <figure>
- <title>Configure Archive</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/DevelopSimpleJSP/simplejspwebapplication6.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
-
- <section id="AutoRedeploy">
- <?dbhtml filename="AutoRedeploy.html"?>
- <title>Auto redeploy</title>
- <para>When you are creating a web application and register it on JBoss server it is automatically deployed into <emphasis>/deploy</emphasis> directory of the server. RHDS comes with the feature of auto-redeploy. It means that you don't need to restart JBoss. Any changes made in the application in exploded format will trigger a redeployment on the server.</para>
- </section>
- </section>
-
- <section id="Previewtab">
- <?dbhtml filename="Previewtab.html"?>
- <title>JSP Page Preview</title>
- <para>RHDS comes with JSP design-time preview features. When designing JSP pages you can easily preview how they will look during runtime. You can even attach your stylesheet to the preview.</para>
- <itemizedlist>
- <listitem><para>Make a little change to hello.jsp page, e.g. put this code snippet:</para></listitem>
- </itemizedlist>
- <programlisting role="XML"><![CDATA[<%= new java.util.Date() %>
-]]></programlisting>
- <itemizedlist>
- <listitem><para>Click <emphasis><property>Save</property></emphasis> button.</para></listitem>
- <listitem><para>Switch to Preview page by clicking Preview tab at the bottom of the page. You will see how the page will look at runtime.</para></listitem>
- </itemizedlist>
- <figure>
- <title>Preview Page</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/DevelopSimpleJSP/default.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="LaunchingTheProject">
- <?dbhtml filename="LaunchingTheProject.html"?>
- <title>Launch JSP Project</title>
- <para>Let's now launch our project on server. We'll use JBoss server that is shipped with Red Hat Developer Studio.</para>
- <itemizedlist continuation="continues">
-<listitem><para>Start JBoss server from JBoss Server view by clicking the Start icon.</para></listitem>
-</itemizedlist>
-<figure>
- <title>Starting Server</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/DevelopSimpleJSP/startingfromicon.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <itemizedlist continuation="continues">
-<listitem><para>Click the Run icon or right click your project folder and select <emphasis><property>Run on Server</property></emphasis>. If you haven't made any changes in web.xml file or cleared it out you can launch the application by right clicking the hello.jsp page and selecting <emphasis><property>Run on the Server</property></emphasis>.</para></listitem>
-</itemizedlist>
-<figure>
- <title>Run Project</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/DevelopSimpleJSP/newproject19.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>You should see the next page in a browser :</para>
- <figure>
- <title>Running Project</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/DevelopSimpleJSP/newprojectjsp20.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- </section>
-
-</chapter>
\ No newline at end of file
Deleted: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GenCURDDatabaseApp.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GenCURDDatabaseApp.xml 2007-11-02 15:35:57 UTC (rev 4663)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GenCURDDatabaseApp.xml 2007-11-02 15:40:32 UTC (rev 4664)
@@ -1,16 +0,0 @@
-<?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>
-
Deleted: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/RADdevelopmentOfSimpleJSFapplication.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/RADdevelopmentOfSimpleJSFapplication.xml 2007-11-02 15:35:57 UTC (rev 4663)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/RADdevelopmentOfSimpleJSFapplication.xml 2007-11-02 15:40:32 UTC (rev 4664)
@@ -1,633 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="RADdevelopmentOfSimpleJSFapplication" xreflabel="RADdevelopmentOfSimpleJSFapplication">
- <?dbhtml filename="RADdevelopmentOfSimpleJSFapplication.html"?>
- <chapterinfo>
- <keywordset>
- <keyword>Red Hat Developer Studio</keyword>
- <keyword>JSF</keyword>
- <keyword>JBoss</keyword>
- <keyword>RAD</keyword>
- </keywordset>
- </chapterinfo>
- <title>RAD development of a simple JSF application</title>
- <para>In this chapter you will see how to create a simple JSF application being based on <property>"RAD"</property> philosophy. We will create the familiar Guess Number application. The scenario is the following. You are asked to guess a number between 0 and 100. If the guess is correct, a success page is displayed with a link to play again. If the guess is incorrect, a message is printed notifying the user that a smaller or a larger number should be entered and the game continues.</para>
- <para>We'll show you how to create such an application from scratch, along the way demonstrating powerful features of Red Hat Developer Studio such as project templating, Visual Page Editor, code completion and others. You will design the
-JSF application and then run the application from inside Red Hat Developer Studio using the bundled JBoss server.</para>
-
-<section id="SettingUpTheProject12">
-<?dbhtml filename="SettingUpTheProject12.html"?>
-<title>Setting up the project</title>
-<para>We will create a JSF 1.2 project using an integrated RHDS's new project wizard and predefined templates.</para>
-<itemizedlist>
- <listitem><para>In Web Projects View (if it is not open select <emphasis><property>Window > Show View > Others > JBoss Tools Web > Web Projects View</property></emphasis>) click <emphasis><property>Create New JSF Project</property></emphasis> button.
-<figure>
-<title>Create New JSF Project</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad1.png"/>
- </imageobject>
-</mediaobject>
-</figure></para></listitem>
-
-<listitem><para>Put <property>GuessNumber</property> as a project name, in JSF Environment drop down list choose <property>JSF 1.2.</property></para></listitem>
-<listitem><para>Leave everything else as it is and click <emphasis><property>Finish</property></emphasis></para></listitem>
-</itemizedlist>
-<para>Our project will appear in Project Explorer and Web Projects Views. As you can see Red Had Developer Studio has created for us the whole skeleton for the project with all needed libraries, faces-config.xml and web.xml files.</para>
-<figure>
-<title>New JSF Project</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad2.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-
-</section>
-<section id="CreatingJSPPages">
-<?dbhtml filename="CreatingJSPPages.html"?>
-<title>Creating JSP Pages</title>
-<para>The application has two pages. The first page is inputnumber.jsp. It prompts you to enter a number. If the guess is incorrect, the same page will be redisplayed with a message indicating whether a smaller or a larger number should be tried. The second page is success.jsp. This page will be shown after you guess the number correctly. From this page you also have the option to play the game again.</para>
-
-<para>On the first page inputnumber.jsp you will enter a number.</para>
-<itemizedlist>
- <listitem><para>Open <emphasis><property>faces-config.xml</property></emphasis> file</para></listitem>
-<listitem><para>Right click anywhere on the diagram mode</para></listitem>
-<listitem><para>From the context menu select <emphasis><property>New View</property></emphasis></para></listitem>
-</itemizedlist>
-<figure>
-<title>Create New View</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad3.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist>
-
- <listitem><para>Type <emphasis><property>pages/inputnumber</property></emphasis> as the value for <emphasis><property>From-view-id</property></emphasis></para></listitem>
- <listitem><para>Leave everything else as is and click <emphasis><property>Finish</property></emphasis></para></listitem>
- <listitem><para>In the same way create another jsf view. Type <emphasis><property>pages/success</property></emphasis> as the value for <emphasis><property>From-view-id</property></emphasis></para></listitem>
-<listitem><para>Select <emphasis><property>File > Save</property></emphasis></para></listitem>
-</itemizedlist>
-<para>On the diagram you will see two created views.</para>
-<figure>
-<title>New Views</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad4.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-</section>
-
-<section id="CreatingTransition">
-<?dbhtml filename="CreatingTransition.html"?>
-<title>Creating Transition between two views</title>
-<para>We should now create connection between jsp pages.</para>
-<itemizedlist>
- <listitem><para>In the diagram, select the <emphasis><property>Create New Connection</property></emphasis> icon third from the top along the upper left side of the diagram to get an arrow cursor with a two-pronged plug at the arrow's bottom
-<figure>
-<title>Create Connection</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad5.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-</para></listitem>
-<listitem><para>Click on the <emphasis><property>pages/inputnumber</property></emphasis> page icon and then click on the <emphasis><property>pages/success</property></emphasis> page icon</para></listitem>
-</itemizedlist>
-<para>A transition should appear between the two icons of views.</para>
-<figure>
-<title>Created Connection</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad6.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist>
-<listitem><para>Select <emphasis><property>File > Save</property></emphasis> from the menu bar</para></listitem>
-</itemizedlist>
-</section>
-<section id="CreatingResourceFile">
-<?dbhtml filename="CreatingResourceFile.html"?>
-<title>Creating Resource File</title>
-<para>Red Hat Developer Studio allows to create quickly a resource file. Using this feature you can collect text messages in one central place. A resource file is just a file with a <emphasis>.properties</emphasis> extension. The messages stored in resource file can be displayed to you on a Web page during application execution. </para>
-<para>With resource file first, you don't hard code anything into the JSP pages. And second, it makes it easier to translate your application to other languages. All you have to do is to translate all your messages to the other language and save them in a new properties file with a name that ends with the appropriate ISO-639 language code.</para>
-<para>It is a good idea to keep your resources inside the <emphasis><property>JavaSource</property></emphasis> folder, where you keep your .java files. Every time you build the project, all <emphasis>.properties</emphasis> files will then be copied to the <emphasis>classes</emphasis> folder by default.</para>
-<itemizedlist>
-<listitem><para>Right click <emphasis><property>JavaSource</property></emphasis> folder and select <emphasis><property>New > Folder</property></emphasis></para></listitem>
- <listitem><para>Type <emphasis><property>game</property></emphasis> for Folder name and click <emphasis><property>Finish</property></emphasis></para></listitem>
-</itemizedlist>
-<para>We will store in this folder our resource file and java bean.</para>
-<itemizedlist>
- <listitem><para>Right click on <emphasis><property>game folder</property></emphasis> and select <emphasis><property>New > Properties File</property></emphasis></para></listitem>
-<listitem><para>Type <emphasis><property>messages</property></emphasis> as the value for "name" attribute and click <emphasis><property>Finish</property></emphasis></para></listitem>
-</itemizedlist>
-<para>Red Hat Developer Studio will automatically open <property>messages.properties</property> file for editing.</para>
-<figure>
-<title>Messages.properties File</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad62.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist>
-<listitem><para>Click <emphasis><property>Add</property></emphasis> button</para></listitem>
-<listitem><para>Type <emphasis role="italic"><property>how_to_play</property></emphasis> for "name" and <emphasis role="italic"><property>Please pick a number between 0 and 100.</property></emphasis> for value</para></listitem>
-<listitem><para>Click <emphasis><property>Finish</property></emphasis></para></listitem>
-<listitem><para>In such a way add the next properties:</para></listitem>
-</itemizedlist>
-<programlisting role="JAVA"><![CDATA[makeguess_button=Make Guess
-trayagain_button=Play Again?
-success_text=How cool.. You have guessed the number, {0} is correct!
-tryagain_smaller=Oops..incorrect guess. Please try a smaller number.
-tryagain_bigger=Oops..incorrect guess. Please try a bigger number.
-]]></programlisting>
-<itemizedlist>
-<listitem><para>Click <emphasis><property>File > Save</property></emphasis> from the menu bar</para></listitem>
-</itemizedlist>
-<para>Your .properties file should now look like follows:</para>
-<figure>
-<title>Properties are Added</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad63.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-</section>
-
-<section id="CreatingJavaBean">
-<?dbhtml filename="CreatingJavaBean.html"?>
-<title>Creating Java Bean</title>
-<para>Now we create a Java bean that will hold business logic of our application.</para>
-<itemizedlist>
-<listitem><para>Right click <emphasis><property>game folder</property></emphasis></para></listitem>
-<listitem><para>Select <emphasis><property>New > Class</property></emphasis></para></listitem>
-<listitem><para>Type <emphasis><property>NumberBean</property></emphasis> for bean name</para></listitem>
-</itemizedlist>
-<para>A java bean is created.</para>
-<itemizedlist>
-<listitem><para>Declare the variable of your entered number:</para></listitem>
-</itemizedlist>
-<programlisting role="JAVA"><![CDATA[Integer userNumber;
-]]></programlisting>
-<para>Red Hat Studio allows to quickly generate getters and setters for java bean.</para>
-<itemizedlist>
- <listitem><para>Right click <emphasis><property>NumberBean.java</property></emphasis> in Package Explorer</para></listitem>
-<listitem><para>Select <emphasis><property>Source > Generate Getters and Setters...</property></emphasis></para></listitem>
-<listitem><para>Check <emphasis><property>userNumber</property></emphasis> box and click <emphasis><property>OK</property></emphasis>
-<figure>
-<title>Generate Getters and Setters</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad64.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-</para></listitem>
-<listitem><para>Add the declaration of the second variable</para></listitem>
-</itemizedlist>
-<programlisting role="JAVA"><![CDATA[int randomNumber;
-]]></programlisting>
-<itemizedlist>
-<listitem><para>.. other bean methods:</para></listitem>
-</itemizedlist>
-<programlisting role="JAVA"><![CDATA[public NumberBean ()
-{
- randomNumber = (int)(Math.random()*100);
- System.out.println ( "Random number: "+randomNumber);
- }
- public String playagain ()
- {
- FacesContext context = FacesContext.getCurrentInstance();
- HttpSession session = (HttpSession) context.getExternalContext().getSession(false);
- session.invalidate();
- return "playagain";
- }
- public String checkGuess ()
- {
-
- // if guessed, return 'success' for navigation
- if ( userNumber.intValue() == randomNumber )
- {
- return "success";
- }
-else
- {
- FacesContext context = FacesContext.getCurrentInstance();
- ResourceBundle bundle = ResourceBundle.getBundle("game.messages", context.getViewRoot().getLocale());
- String msg = "";
- // if number bigger, get appropriate message
- if ( userNumber.intValue() > randomNumber )
- msg = bundle.getString("tryagain_smaller");
- else // if number smaller, get appropriate message
- msg = bundle.getString("tryagain_bigger");
- // add message to be displayed on the page via <h:messages> tag
- context.addMessage (null, new FacesMessage(msg));
- // return 'tryagain' for navigation
- return "tryagain";
- }
- }
-]]></programlisting>
-<itemizedlist>
-<listitem><para>And the import declarations:</para></listitem>
-</itemizedlist>
-<programlisting role="JAVA"><![CDATA[import javax.faces.context.FacesContext;
-import javax.servlet.http.HttpSession;
-import javax.faces.application.FacesMessage;
-import java.util.Locale;
-import java.util.ResourceBundle;
-]]></programlisting>
-<para>The whole java bean should look as follows:</para>
-<programlisting role="JAVA"><![CDATA[import javax.faces.context.FacesContext;
-import javax.servlet.http.HttpSession;
-import javax.faces.application.FacesMessage;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-public class NumberBean
-{
- Integer userNumber;
- int randomNumber; // random number generated by application
-public Integer getUserNumber ()
- {
- return userNumber;
- }
- public void setUserNumber (Integer value)
- {
- this.userNumber = value;
- }
-
- // constructor, generates random number
- public NumberBean ()
- {
- randomNumber = (int)(Math.random()*100);
- System.out.println (
- "Random number: " + randomNumber);
- }
-
- public String playagain ()
- {
- FacesContext context = FacesContext.getCurrentInstance();
- HttpSession session = (HttpSession) context.getExternalContext().getSession(false);
- session.invalidate();
- return "playagain";
- }
-
- // check if user guessed the number
- public String checkGuess ()
- {
- // if guessed, return 'success' for navigation
- if ( userNumber.intValue() == randomNumber )
- {
- return "success";
- }
- // incorrect guess
- else
- {
- // get a reference to properties file to retrieve messages
- FacesContext context = FacesContext.getCurrentInstance();
- ResourceBundle bundle = ResourceBundle.getBundle("game.messages", context.getViewRoot().getLocale());
- String msg = "";
- // if number is bigger, get appropriate message
- if ( userNumber.intValue() > randomNumber )
- msg = bundle.getString("tryagain_smaller");
- else // if number smaller, get appropriate message
- msg = bundle.getString("tryagain_bigger");
-
- // add message to be displayed on the page via <h:messages> tag
- context.addMessage (null, new FacesMessage(msg));
- // return 'tryagain' for navigation
- return "tryagain";
- }
- }
-}
-]]></programlisting>
-</section>
-
-<section id="EditingFacesConfig">
-<?dbhtml filename="EditingFacesConfig.html"?>
-<title>Editing faces-config.xml File</title>
-<para>This file holds two navigation rules and defines the backing bean used.</para>
-<itemizedlist>
-<listitem><para>Open faces-config.xml file in a source mode</para></listitem>
-<listitem><para>Add here one more navigation rule and a managed bean declarations that the content of the file looks like this:</para></listitem>
-</itemizedlist>
-<programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee
-xmlns:xi="http://www.w3.org/2001/XInclude"
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2_.xsd">
-
- <navigation-rule>
- <from-view-id>*</from-view-id>
- <navigation-case>
- <from-outcome>playagain</from-outcome>
- <to-view-id>/pages/inputnumber.jsp</to-view-id>
- </navigation-case>
- </navigation-rule>
-
- <navigation-rule>
- <from-view-id>/pages/inputnumber.jsp</from-view-id>
- <navigation-case>
- <from-outcome>success</from-outcome>
- <to-view-id>/pages/success.jsp</to-view-id>
- </navigation-case>
- </navigation-rule>
-
- <managed-bean>
- <managed-bean-name>NumberBean</managed-bean-name>
- <managed-bean-class>game.NumberBean</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
-
-</faces-config>
-]]></programlisting>
-<para>The first navigation rule states that from any page (<property>*</property> stands for any page) an outcome of playagain will take you to <emphasis>/pages/inputnumber.jsp</emphasis>. Outcome values are returned from backing bean methods in this example. The second navigation rule states that if you are at the page <emphasis>/pages/inputnumber.jsp</emphasis>, and the outcome is success, then navigate to the <emphasis>/pages/success.jsp</emphasis> page.
-</para>
-</section>
-<section id="EditingTheJSPViewFiles2">
-<?dbhtml filename="EditingTheJSPViewFiles2.html"?>
-<title>Editing the JSP View Files</title>
-<para>Now we will finish editing the JSP files for our two "views" using Visual Page
-Editor.</para>
-<section id="EditingInputjsp">
-<?dbhtml filename="EditingInputjsp.html"?>
-<title>Editing inputname.jsp page</title>
-<para>On this page we will have an output text component displaying a message, a text field for user's number entering and a button for input submission.</para>
-<itemizedlist>
-<listitem><para>Open inputnumber.jsp by double-clicking on the <emphasis><property>/pages/inputnamber.
-jsp</property></emphasis> icon</para></listitem>
-</itemizedlist>
-<para>The Visual Page Editor will open in a screen split between source code along the top and
-a WYSIWIG view along the bottom. You can see that some JSF code will be already generated as we choose a template when creating the page.</para>
-<para>At the beginning it's necessary to create a <emphasis role="bold"><property><h:form></property></emphasis> component where all others components are put.</para>
-<itemizedlist>
-<listitem><para>Place the mouse cursor inside <emphasis role="bold"><property><f:view></property></emphasis><emphasis role="bold"><property></f:view></property></emphasis></para></listitem>
-<listitem><para>Go to JBoss Tools Palette and expand JSF HTML folder by selecting it</para></listitem>
-<listitem><para>Click on <emphasis role="bold"><property><h:form></property></emphasis> tag
-<figure>
-<title>Insert h:form</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad7.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-</para></listitem>
-<listitem><para>In the dialog Insert Tag select <emphasis><property>id</property></emphasis> and click on this line below the value header. A blinking cursor will appear in a input text field inviting to enter a value of id
-<figure>
-<title>Define Id of Form</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad8.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-</para></listitem>
-<listitem><para>Type <emphasis><property>inputNumbers</property></emphasis> and click <emphasis><property>Finish</property></emphasis></para></listitem>
-</itemizedlist>
-<para>In source view you can see the declaration of a form.</para>
-<figure>
-<title>Created Form</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad9.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>First let's declare the properties file in inputnumber.jsp page using the loadBundle JSF tag.</para>
-<itemizedlist>
-<listitem><para>Put this declaration on the top of a page, right after the first two lines:</para></listitem>
-</itemizedlist>
-<programlisting role="XML"><![CDATA[<f:loadBundle basename="game.messages" var="msg"/>
-]]></programlisting>
-<para>As always Red Hat Studio provides code assist:</para>
-<figure>
-<title>Code Assist</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad10.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist>
-<listitem><para>Switch to Visual tab, so it could be possible to work with the editor completely in its WYSIWYG mode</para></listitem>
-<listitem><para>Click on <emphasis><property>outputText</property></emphasis>, drag the cursor over to the editor, and drop it inside the blue box in the editor</para></listitem>
-
-<listitem><para>Select <emphasis><property>value</property></emphasis> and click on this line below "value" header</para></listitem>
-<listitem><para>Click <property>...</property> button next to the value field</para></listitem>
-</itemizedlist>
-<para>RHDS will nicely propose you to choose within available values:</para>
-<figure>
-<title>Choose Value</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad11.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist>
-<listitem><para>Expand <emphasis><property>Resource Bundles > msg</property></emphasis></para></listitem>
- <listitem><para>Select <emphasis><property>how_to_play</property></emphasis> value and click <emphasis><property>Ok</property></emphasis>. Then click <emphasis><property>Finish</property></emphasis>
-<figure>
-<title>Selecting Value</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad12.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-</para></listitem>
-</itemizedlist>
-<para>The text will appear on the page:</para>
-<figure>
-<title>Created OutputText Component</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad13.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist>
-<listitem><para>Switch to Source mode and insert <emphasis role="bold"><property><br/></property></emphasis> tag after <emphasis role="bold"><property><h:outputText></property></emphasis> component to make a new line.</para></listitem>
-<listitem><para>Click <emphasis><property>Save</property></emphasis> button.</para></listitem>
-<listitem><para>On the Palette click on <emphasis><property>inputText</property></emphasis>, drag the cursor over to the editor, and drop it inside the editor after the text.</para></listitem>
-<listitem><para>Switch to a Source mode and insert <emphasis role="bold"><property><br/></property></emphasis> tag after <emphasis role="bold"><property><h:outputText></property></emphasis> component to make a new line</para></listitem>
-<listitem><para>Click <emphasis><property>Save</property></emphasis> button</para></listitem>
-<listitem><para>On the Palette click on <emphasis><property>inputText</property></emphasis>, drag the cursor over to the editor, and drop it inside the editor after the text</para></listitem>
-<listitem><para>Select <emphasis><property>value</property></emphasis> and click on this line below "value" header</para></listitem>
-<listitem><para>Click <property>...</property> button next to the value field</para></listitem>
-<listitem><para>Expand <emphasis><property>Managed Beans > NumberBean</property></emphasis></para></listitem>
- <listitem><para>Select <emphasis><property>userNumber</property></emphasis> value and click <emphasis><property>Ok</property></emphasis></para></listitem>
-<listitem><para>Switch <emphasis><property>Advanced</property></emphasis> tab</para></listitem>
-<listitem><para>Select <emphasis><property>id</property></emphasis> and click on this line below "value" header</para></listitem>
- <listitem><para>Type <emphasis><property>userNumber</property></emphasis> in text field</para></listitem>
-<listitem><para>Select <emphasis><property>required</property></emphasis> and click on this line below "value" header</para></listitem>
-<listitem><para>Click <property>...</property> button next to the value field</para></listitem>
-<listitem><para>Expand <emphasis><property>Enumeration</property></emphasis> and select <emphasis><property>true</property></emphasis> as a value</para></listitem>
-</itemizedlist>
-<figure>
-<title>Add "required" Attribute</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad14.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<itemizedlist>
-<listitem><para>Click <emphasis><property>Ok</property></emphasis>, then click <emphasis><property>Finish</property></emphasis></para></listitem>
-<listitem><para>Go to Source mode</para></listitem>
-<listitem><para>Add the validation attribute to <emphasis role="bold"><property><f:validateLongRange></property></emphasis> for user input validation</para></listitem></itemizedlist>
-<programlisting role="XML"><![CDATA[<h:inputText id="userNumber" value="#{NumberBean.userNumber}" required="true">
- <f:validateLongRange minimum="0" maximum="100"/>
-</h:inputText>
-]]></programlisting>
-<itemizedlist>
-<listitem><para>Click <emphasis><property>Save</property></emphasis> button</para></listitem>
- <listitem><para>Again select <emphasis><property>Visual</property></emphasis> mode</para></listitem>
-<listitem><para>On the Palette, click on <emphasis><property>commandButton</property></emphasis>, drag the cursor over to the editor, and drop it inside the editor after the inputText component.</para></listitem>
-<listitem><para>In the editing dialog select <emphasis><property>value</property></emphasis> and click on this line below "value" header</para></listitem>
-<listitem><para>Click <property>...</property> button next to the value field</para></listitem>
-<listitem><para>Expand <emphasis><property>Resource Bundles > msg</property></emphasis> and select <emphasis><property>makeguess_button</property></emphasis> as a value</para></listitem>
- <listitem><para>Click <emphasis><property>Ok</property></emphasis></para></listitem>
-<listitem><para>Select <emphasis><property>action</property></emphasis> and click on this line below "value" header</para></listitem>
- <listitem><para>Type <emphasis><property>NumberBean.checkGuess</property></emphasis> in text field</para></listitem>
-<listitem><para>Click <emphasis><property>Finish</property></emphasis></para></listitem>
-<listitem><para>In Source mode add <emphasis role="bold"><property><br/></property></emphasis> tags between <emphasis role="bold"><property><outputText></property></emphasis>, <emphasis role="bold"><property><inputText></property></emphasis> and <emphasis role="bold"><property><commandButton></property></emphasis> components to place them on different lines</para></listitem>
-</itemizedlist>
-<para>inputnumber.jsp page should look like this:</para>
-<programlisting role="XML"><![CDATA[<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
-<f:loadBundle basename="game.messages" var="msg"/>
-
-<html>
- <f:view>
- <h:form id="inputNumbers">
- <h:outputText value="#{msg.how_to_play}"/>
- <br/>
- <h:messages style="color: blue"/>
- <br/>
- <h:inputText id="userNumber" value="#{NumberBean.userNumber}" required="true">
- <f:validateLongRange minimum="0" maximum="100"/>
- </h:inputText>
- <br/><br/>
- <h:commandButton value="#{msg.makeguess_button}" action="#{NumberBean.checkGuess}"/>
- </h:form>
- </f:view>
-</html>
-]]></programlisting>
-</section>
-<section id="EditingSuccessJsp">
-<?dbhtml filename="EditingSuccessJsp.html"?>
-<title>Editing success.jsp page</title>
-<para>In the same way like inputnumber.jsp, edit success.jsp page. Its whole source should be the next:</para>
-<programlisting role="XML"><![CDATA[<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
-<f:loadBundle basename="game.messages" var="msg"/>
-
-<html>
- <f:view>
- <h:form id="result">
- <h:outputFormat value="#{msg.success_text}">
- <f:param value="#{NumberBean.userNumber}"/>
- </h:outputFormat>
- <br/><br/>
- <h:commandButton value="#{msg.trayagain_button}" action="#{NumberBean.playagain}"/>
- </h:form>
- </f:view>
-</html>
-]]></programlisting>
-<para>Again you can use code assist provided by RHDS when editing jsp page:</para>
-<figure>
-<title>Code Assist for <f:param></title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad15.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<para>This page, success.jsp, is shown if you correctly guessed the number. The <emphasis role="bold"><property><h:outputFormat></property></emphasis> tag will get the value of success_text from the properties file. The {0} in success_text will be substituted for by the value of the value attribute within the <emphasis role="bold"><property><f:param></property></emphasis> tag during runtime.</para>
-<para>At the end, you have a button which allows you to replay the game. The action value references a backing bean method. In this case, the method only terminates the current session so that when you are shown the first page, the input text box is clear and a new random number is generated.</para>
-<itemizedlist>
-<listitem><para>Switch to Preview mode to see how this page will look in a browser:</para></listitem>
-</itemizedlist>
-<figure>
-<title>Success.jsp in Preview Mode</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/newrad16.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-</section>
-</section>
- <section id="CreatingIndexjsp">
-<?dbhtml filename="CreatingIndexjsp.html"?>
-<title>Creating index.jsp page</title>
-<para>The index.jsp page is the entry point of our application. It's just forwarding to inputnumber.jsp page.</para>
-<itemizedlist>
-<listitem><para>Right click <emphasis><property>WebContent > New > JSP File</property></emphasis></para></listitem>
- <listitem><para>Type <emphasis><property>index</property></emphasis> for name field and choose <emphasis><property>JSPRedirect</property></emphasis> as a template</para></listitem>
-<listitem><para>Click <emphasis><property>Finish</property></emphasis></para></listitem>
-<listitem><para>The source for this page should be like the following:</para></listitem>
-</itemizedlist>
-<programlisting role="XML"><![CDATA[<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
- <body>
- <jsp:forward page="/pages/inputnumber.jsf" />
- </body>
-</html>
-
-]]></programlisting>
-<para>Note the <emphasis>.jsf</emphasis> extension of a page. It means that we trigger the JSF controller servlet to handle the page according the servlet mapping in the faces-config.xml file.</para>
-</section>
-<section id="RunningTheApplication33">
-<?dbhtml filename="RunningTheApplication33.html"?>
-<title>Running the Application</title>
-<para>Everything is ready to run the application.</para>
-<itemizedlist>
- <listitem><para>Start up JBoss server by clicking on the <emphasis><property>Start</property></emphasis> icon in JBoss Server view. (If JBoss is already running, stop it by clicking on the red icon and then start it again. After the messages in the Console tabbed view stop scrolling, JBoss is available</para></listitem>
- <listitem><para>Click on the <emphasis><property>Red Hat</property></emphasis> run icon in the toolbar</para></listitem>
-<listitem><para>Play with the application by entering correct as well as incorrect values</para></listitem>
-</itemizedlist>
-<figure>
-<title>You are Asked to Enter a Number Between 0 and 100</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/guessnumber.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-<figure>
-<title>Your Input is Validated and an Error Message is Displayed if Invalid Input was Entered</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/guessnumber2.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-
-<figure>
-<title>After You Enter a Guess, the Application Tells You Whether a Smaller or a Larger Number Should be Tried</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/guessnumber3.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-
-<figure>
-<title>Your Guess is Correct</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/RADdevelopment/guessnumber4.png"/>
- </imageobject>
-</mediaobject>
-</figure>
-</section>
-</chapter>
Deleted: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/testNG.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/testNG.xml 2007-11-02 15:35:57 UTC (rev 4663)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/testNG.xml 2007-11-02 15:40:32 UTC (rev 4664)
@@ -1,221 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="testNG" xreflabel="testNG">
- <?dbhtml filename="testNG.html"?>
- <chapterinfo>
- <keywordset>
- <keyword>Red Hat Developer Studio</keyword>
- <keyword>RHDS</keyword>
- <keyword>testNG</keyword>
- </keywordset>
- </chapterinfo>
- <title>Using TestNG project</title>
- <section>
- <title>What is TestNG?</title>
- <para><property>TestNG</property> ("Testing, the Next Generation") is a Java unit testing framework that aims to overcome many limitations of JUnit.
- TestNG introduces some new functionalities that make it more powerful and easier to use, such as:</para>
- <itemizedlist>
- <listitem><para>JDK 5 Annotations (JDK 1.4 is also supported with JavaDoc annotations).</para></listitem>
- <listitem><para>Flexible test configuration.</para></listitem>
- <listitem><para>Support for data-driven testing (with @DataProvider).</para></listitem>
- <listitem><para>Support for parameters.</para></listitem>
- <listitem><para>Allows distribution of tests on slave machines.</para></listitem>
- <listitem><para>Powerful execution model (no more TestSuite).</para></listitem>
- <listitem><para>Supported by a variety of tools and plug-ins (Eclipse, IDEA, Maven, etc...).</para></listitem>
- <listitem><para>Embeds BeanShell for further flexibility.</para></listitem>
- <listitem><para>Default JDK functions for runtime and logging (no dependencies).</para></listitem>
- <listitem><para>Dependent methods for application server testing.</para></listitem>
- </itemizedlist>
-
- <para>More information can be found on home page: <ulink url="http://testng.org">www.testng.org</ulink></para>
- </section>
- <section id="OtherRelevantResourcesOnTheTopic5">
- <?dbhtml filename="OtherRelevantResourcesOnTheTopic5.html"?>
- <title>Other relevant resources on the topic</title>
- <para><ulink url="http://www.artima.com/lejava/articles/testng.html">Next-Generation Testing with TestNG (An Interview with Cédric Beust)</ulink></para>
- <para><ulink url="http://www.javaworld.com/javaworld/jw-04-2005/jw-0404-testng.html">TestNG: The next generation of unit testing</ulink></para>
- <para><ulink url="http://dev2dev.bea.com/pub/a/2006/09/testng-categorization.html">Test Categorization Techniques with TestNG</ulink></para>
- <para><ulink url="http://www-128.ibm.com/developerworks/java/library/j-testng/">TestNG makes Java unit testing a breeze</ulink></para>
- <para><ulink url="http://www-128.ibm.com/developerworks/java/library/j-cq08296/index.html">In pursuit of code quality: JUnit 4 vs. TestNG</ulink></para>
- </section>
- <section>
- <title>How to use the generated Seam-test project to run Seam tests in Red Hat Developer Studio</title>
-
- <itemizedlist>
- <listitem><para>Create a new Seam Web Project using New Project wizard or main menu <emphasis><property>File > New > Seam Web Project</property>.</emphasis></para></listitem>
- </itemizedlist>
-
- <figure>
- <title>Seam Web Project Creation</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/testNG/testNG1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <itemizedlist>
- <listitem><para>Name your project and follow the next wizard steps keeping default settings.</para></listitem>
- </itemizedlist>
-
- <figure>
- <title>New Seam Project Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/testNG/testNG2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <itemizedlist>
- <listitem><para>Check <emphasis><property>Server Supplied JSF Implementation</property>.</emphasis></para></listitem>
- </itemizedlist>
-
- <figure>
- <title>Adding JSF Capabilities</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/testNG/testNG3.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <itemizedlist>
- <listitem><para>Select <emphasis><property>EAR</property></emphasis> next to <emphasis><property>Deploy as:</property></emphasis> field.</para></listitem>
- </itemizedlist>
-
- <figure>
- <title>Select Deployment Type</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/testNG/testNG4.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <itemizedlist>
- <listitem><para>After project is created you will have the generated Seam-test project that is setup to run TestNG directly against the proper libraries and server runtime libraries.</para></listitem>
- </itemizedlist>
-
- <figure>
- <title>Seam-test Project</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/testNG/testNG5.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <itemizedlist>
- <listitem><para>Add Seam Action to your project via <emphasis><property>File > New > Seam Action</property>.</emphasis></para></listitem>
- </itemizedlist>
-
- <figure>
- <title>Seam Action Creation</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/testNG/testNG6.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <itemizedlist>
- <listitem><para>Fill out the wizard fields. New Seam Action wizard will create resources and place them in the apropriate folders dependent on EAR project structure.</para></listitem>
- </itemizedlist>
-
- <figure>
- <title>New Seam Action Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/testNG/testNG7.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <itemizedlist>
- <listitem><para>When Action is created you will see <property>actionPage.xhtml</property> in Package Explorer view. <property>ActionBean.java</property> will be automatically opened in Java Editor.</para></listitem>
- </itemizedlist>
-
- <figure>
- <title>Created Action</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/testNG/testNG8.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
-
- <itemizedlist>
- <listitem><para>Select <property>ActionLocalTest.xml</property> in Seam-test project and run the test via right click <emphasis><property>Run As > TestNG Suite</property>.</emphasis></para></listitem>
- </itemizedlist>
-
- <figure>
- <title>Running TestNG</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/testNG/testNG10.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>The test process will start and its ouput will be written in Console View.</para>
-
- <figure>
- <title>Test is Finished</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/testNG/testNG10a.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
-
- <itemizedlist>
- <listitem><para>After running TestNG you will have the test results in <emphasis><property>test-output</property></emphasis> folder in Seam-test project (press F5 to refresh the Package Explorer view). Open <property>index.html</property> file with Web Browser.</para></listitem>
- </itemizedlist>
-
- <figure>
- <title>Opening Test Results in Web Browser</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/testNG/testNG11.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>You can see the test results in Web Browser.</para>
-
- <figure>
- <title>Test Results</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/testNG/testNG12.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>After clicking on <emphasis><property>ActionLocal Tests</property></emphasis> link you will see the Results for ActionLocal Tests.</para>
-
- <figure>
- <title>Test Information</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/testNG/testNG13.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Select a result on the left-hand pane and its details will be displayed on the right-hand one.</para>
-
- <figure>
- <title>ActionLocal Test Details</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/testNG/testNG14.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
-
- </section>
- </chapter>
17 years, 2 months
JBoss Tools SVN: r4663 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2007-11-02 11:35:57 -0400 (Fri, 02 Nov 2007)
New Revision: 4663
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/TypeInfoCollector.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1203 EL autocompletion prompts static members
The static fields are excluded from valid proposals
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/TypeInfoCollector.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/TypeInfoCollector.java 2007-11-02 15:15:17 UTC (rev 4662)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/TypeInfoCollector.java 2007-11-02 15:35:57 UTC (rev 4663)
@@ -541,7 +541,8 @@
properties.add(info);
}
for (FieldInfo info : fFields) {
- if (info.isPublic())
+ if (info.isPublic()
+ && !info.isStatic() && !info.isJavaLangObject())
properties.add(info);
}
17 years, 2 months
JBoss Tools SVN: r4662 - in trunk/seam/plugins/org.jboss.tools.seam.core: src/org/jboss/tools/seam/internal/core/project/facet and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-11-02 11:15:17 -0400 (Fri, 02 Nov 2007)
New Revision: 4662
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java
Log:
JBIDE-1230
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2007-11-02 14:18:44 UTC (rev 4661)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2007-11-02 15:15:17 UTC (rev 4662)
@@ -38,6 +38,7 @@
org.eclipse.wst.server.core,
org.eclipse.core.filesystem,
org.eclipse.jst.j2ee.ejb,
+ org.eclipse.jst.jsf.ui,
org.jboss.tools.jst.web
Provide-Package: org.jboss.tools.seam.core,
org.jboss.tools.seam.internal.core,
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java 2007-11-02 14:18:44 UTC (rev 4661)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java 2007-11-02 15:15:17 UTC (rev 4662)
@@ -21,7 +21,9 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jst.j2ee.internal.web.archive.operations.WebFacetProjectCreationDataModelProvider;
+import org.eclipse.jst.jsf.ui.internal.JSFUiPlugin;
import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
@@ -73,6 +75,17 @@
Collection requiredFacets = (Collection)getProperty(REQUIRED_FACETS_COLLECTION);
requiredFacets.add(ProjectFacetsManager.getProjectFacet(seamFacet.getStringProperty(IFacetDataModelProperties.FACET_ID)));
setProperty(REQUIRED_FACETS_COLLECTION, requiredFacets);
+
+ IDialogSettings s = JSFUiPlugin.getDefault().getDialogSettings();
+ IDialogSettings r = s.getSection(JSFUiPlugin.PLUGIN_ID + ".jsfFacetInstall");
+ if(r == null) {
+ r = s.addNewSection(JSFUiPlugin.PLUGIN_ID + ".jsfFacetInstall");
+ }
+ IDialogSettings u = r.getSection("urlMappings");
+ if(u == null) {
+ u = r.addNewSection("urlMappings");
+ }
+ u.put("pattern", new String[]{"*.seam"});
}
public boolean propertySet(String propertyName, Object propertyValue) {
17 years, 2 months
JBoss Tools SVN: r4661 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2007-11-02 10:18:44 -0400 (Fri, 02 Nov 2007)
New Revision: 4661
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/TypeInfoCollector.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1203 EL autocompletion prompts static members
The static methods are excluded from valid proposals
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-11-02 14:18:35 UTC (rev 4660)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2007-11-02 14:18:44 UTC (rev 4661)
@@ -146,7 +146,7 @@
for (ISeamContextVariable var : resolvedVariables) {
String varName = var.getName();
String prefixString = prefix.toString();
- if(prefixString.length()<varName.length()) {
+ if(prefixString.length()<=varName.length()) {
res.add(varName.substring(prefixString.length()));
} else if(returnEqualedVariablesOnly) {
res.add(varName);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/TypeInfoCollector.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/TypeInfoCollector.java 2007-11-02 14:18:35 UTC (rev 4660)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/TypeInfoCollector.java 2007-11-02 14:18:44 UTC (rev 4661)
@@ -72,8 +72,12 @@
}
public boolean isPublic() {
- return Modifier.isPublic(fModifiers) && !isJavaLangObject();
+ return Modifier.isPublic(fModifiers);
}
+
+ public boolean isStatic() {
+ return Modifier.isStatic(fModifiers);
+ }
public boolean isJavaLangObject() {
return "java.lang.Object".equals(getDeclaringTypeQualifiedName());
@@ -482,6 +486,7 @@
List<MemberInfo> methods = new ArrayList<MemberInfo>();
for (MethodInfo info : fMethods) {
if (info.isPublic() && !info.isConstructor()
+ && !info.isStatic() && !info.isJavaLangObject()
&& !info.isGetter() && !info.isSetter())
methods.add(info);
}
@@ -496,7 +501,6 @@
*/
public Set<String> getMethodPresentations() {
Set<String> methods = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
-// IMethod[] mthds = type.getMethods();
List<MemberInfo> mthds = getMethods();
for (MemberInfo info : mthds) {
if (!(info instanceof MethodInfo))
@@ -532,6 +536,7 @@
List<MemberInfo> properties = new ArrayList<MemberInfo>();
for (MethodInfo info : fMethods) {
if (info.isPublic() && !info.isConstructor()
+ && !info.isStatic() && !info.isJavaLangObject()
&& (info.isGetter() || info.isSetter()))
properties.add(info);
}
17 years, 2 months
JBoss Tools SVN: r4660 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2007-11-02 10:18:35 -0400 (Fri, 02 Nov 2007)
New Revision: 4660
Modified:
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/JBIDE-1203 EL autocompletion prompts static members
The static methods are excluded from valid proposals
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-11-02 13:57:32 UTC (rev 4659)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2007-11-02 14:18:35 UTC (rev 4660)
@@ -275,7 +275,7 @@
List<ICompletionProposal> result= new ArrayList<ICompletionProposal>();
for (String string : uniqueSuggestions) {
- if (string.length() > 0) {
+ if (string.length() >= 0) {
string = proposalPrefix + string + proposalSufix;
result.add(new Proposal(string, prefix, offset, offset + string.length() - proposalSufix.length()));
}
17 years, 2 months
JBoss Tools SVN: r4659 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2007-11-02 09:57:32 -0400 (Fri, 02 Nov 2007)
New Revision: 4659
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1249 Fix dropDownMenu template
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java 2007-11-02 12:55:41 UTC (rev 4658)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java 2007-11-02 13:57:32 UTC (rev 4659)
@@ -22,6 +22,7 @@
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
import org.mozilla.interfaces.nsIDOMNodeList;
+import org.mozilla.xpcom.XPCOMException;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -233,4 +234,51 @@
} else
visualElement.removeAttribute(attrName);
}
+
+ /**
+ * Is invoked after construction of all child nodes of the current visual
+ * node.
+ *
+ * @param pageContext
+ * Contains the information on edited page.
+ * @param sourceNode
+ * The current node of the source tree.
+ * @param visualDocument
+ * The document of the visual tree.
+ * @param data
+ * Object <code>VpeCreationData</code>, built by a method
+ * <code>create</code>
+ */
+
+ @Override
+ public void validate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument, VpeCreationData data) {
+ super.validate(pageContext, sourceNode, visualDocument, data);
+ correctLabelStyles(data.getNode());
+ }
+
+ /**
+ * Correct font for label
+ *
+ * @param node
+ */
+ private void correctLabelStyles(nsIDOMNode node) {
+
+ try {
+ nsIDOMElement element = (nsIDOMElement) node
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ if (node.getNodeName().equalsIgnoreCase(
+ HtmlComponentUtil.HTML_TAG_SPAN)) {
+ String styleClass = element.getAttribute(HtmlComponentUtil.HTML_CLASS_ATTR);
+ styleClass = (styleClass==null?"":styleClass) + " dr-label-text-decor dr-menu-label";
+ element.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, styleClass);
+ }
+ nsIDOMNodeList list = node.getChildNodes();
+ for (int i = 0; i < list.getLength(); i++) {
+ correctLabelStyles(list.item(i));
+ }
+ } catch (XPCOMException e) {
+ return;
+ }
+ }
}
\ No newline at end of file
17 years, 2 months
JBoss Tools SVN: r4658 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2007-11-02 08:55:41 -0400 (Fri, 02 Nov 2007)
New Revision: 4658
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineTemplate.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-1200
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineTemplate.java 2007-11-02 12:02:02 UTC (rev 4657)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineTemplate.java 2007-11-02 12:55:41 UTC (rev 4658)
@@ -10,12 +10,16 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.facelets.template;
+import java.util.Map;
+
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.template.VpeTemplate;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -36,7 +40,8 @@
return createStub((Element)sourceNode, visualDocument);
}
- public Node getNodeForUptate(VpePageContext pageContext, Node sourceNode, Node visualNode, Object data) {
+ @Override
+ public Node getNodeForUptate(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Object data) {
return sourceNode.getParentNode();
}
17 years, 2 months
JBoss Tools SVN: r4657 - in trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui: widget/field and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-11-02 08:02:02 -0400 (Fri, 02 Nov 2007)
New Revision: 4657
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/RadioFieldEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/RadioField.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java
Log:
JBIDE-1220 Added choice for vertical/horizontal layout in RadioField.
Vertical layout is used in Generate Entities Wizard.
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/RadioFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/RadioFieldEditor.java 2007-11-02 11:49:02 UTC (rev 4656)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/RadioFieldEditor.java 2007-11-02 12:02:02 UTC (rev 4657)
@@ -47,7 +47,7 @@
public Control getComboControl(Composite composite) {
if(radioField == null) {
- radioField = new RadioField(composite,labels, values,getValue());
+ radioField = new RadioField(composite,labels, values,getValue(), false);
radioField.addPropertyChangeListener(this);
} else if(composite!=null) {
Assert.isTrue(radioField.getControl().getParent()==composite);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/RadioField.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/RadioField.java 2007-11-02 11:49:02 UTC (rev 4656)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/RadioField.java 2007-11-02 12:02:02 UTC (rev 4657)
@@ -31,10 +31,12 @@
private Button[] radios;
private Object value;
- public RadioField(Composite parent, List<String> labels, List<Object> values, Object defaultValue) {
+ public RadioField(Composite parent, List<String> labels, List<Object> values, Object defaultValue, boolean verticalLayout) {
topComposite = new Composite(parent, SWT.NONE);
- topComposite.setLayout(new GridLayout(values.size(), false));
-// topComposite.setLayoutData(new GridData(SWT.BEGINNING));
+ topComposite.setLayout(new GridLayout(verticalLayout ? 1 : values.size(), false));
+ if(verticalLayout) {
+ topComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ }
radios = new Button[values.size()];
if(defaultValue==null && values.size()>0) {
@@ -44,7 +46,7 @@
radios[i] = new Button(topComposite, SWT.RADIO);
radios[i].setText(labels.get(i));
radios[i].addSelectionListener(this);
- radios[i].setLayoutData(new GridData(GridData.BEGINNING));
+ radios[i].setLayoutData(new GridData(verticalLayout ? GridData.FILL_HORIZONTAL : GridData.BEGINNING));
Object value = values.get(i);
radios[i].setData(value);
if(value != null && value.equals(defaultValue)) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java 2007-11-02 11:49:02 UTC (rev 4656)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java 2007-11-02 12:02:02 UTC (rev 4657)
@@ -102,7 +102,7 @@
ArrayList<String> labels = new ArrayList<String>();
labels.add(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_REVERSE_ENGINEER_LABEL);
labels.add(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_EXISTING_ENTITIES_LABEL);
- radios = new RadioField(radioComposite, labels, values, null);
+ radios = new RadioField(radioComposite, labels, values, null, true);
radios.addPropertyChangeListener(this);
setControl(top);
17 years, 2 months
JBoss Tools SVN: r4656 - in trunk/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-11-02 07:49:02 -0400 (Fri, 02 Nov 2007)
New Revision: 4656
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/EventLogModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/NullPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublisherEventLogger.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/SimpleTreeItem.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java
Log:
Event Log changes regarding publishing. No JIRA associated, sadly.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/EventLogModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/EventLogModel.java 2007-11-02 11:13:03 UTC (rev 4655)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/EventLogModel.java 2007-11-02 11:49:02 UTC (rev 4656)
@@ -203,11 +203,6 @@
if( isLoggingEnabled() )
super.addChild(item);
}
-
- public void addChild(int loc, SimpleTreeItem item) {
- if( isLoggingEnabled() )
- super.addChild(loc, item);
- }
public void addChildren(SimpleTreeItem[] kids) {
if( isLoggingEnabled() )
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-11-02 11:13:03 UTC (rev 4655)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-11-02 11:49:02 UTC (rev 4656)
@@ -31,16 +31,17 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.internal.DeletedModule;
+import org.eclipse.wst.server.core.model.IModuleFile;
import org.eclipse.wst.server.core.model.IModuleFolder;
import org.eclipse.wst.server.core.model.IModuleResource;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.eclipse.wst.server.core.model.ModuleDelegate;
-import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.eclipse.wst.server.core.util.ProjectModule;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
@@ -91,11 +92,8 @@
return modulePath;
}
- public IStatus publishModule(int kind, int deltaKind,
- int modulePublishState, IModule[] module, IProgressMonitor monitor)
+ public IStatus publishModule(IModule[] module, int publishType, IProgressMonitor monitor)
throws CoreException {
- String modulePath = getModulePath(module);
-
IStatus status = null;
boolean deleted = false;
for( int i = 0; i < module.length; i++ ) {
@@ -103,24 +101,25 @@
deleted = true;
}
- if (ServerBehaviourDelegate.REMOVED == deltaKind) {
+ if (publishType == REMOVE_PUBLISH ) {
status = unpublish(server, module, monitor);
- } else if (kind == IServer.PUBLISH_FULL || modulePublishState == IServer.PUBLISH_STATE_FULL || kind == IServer.PUBLISH_CLEAN ) {
- if( deleted )
+ } else {
+ if( deleted ) {
publishState = IServer.PUBLISH_STATE_UNKNOWN;
- else
- status = fullPublish(module, module[module.length-1], monitor);
- } else if (kind == IServer.PUBLISH_INCREMENTAL || modulePublishState == IServer.PUBLISH_STATE_INCREMENTAL || kind == IServer.PUBLISH_AUTO) {
- if( deleted )
- publishState = IServer.PUBLISH_STATE_UNKNOWN;
- else
- status = incrementalPublish(module, module[module.length-1], monitor);
- }
+ } else {
+ if (publishType == FULL_PUBLISH ) {
+ status = fullPublish(module, module[module.length-1], monitor);
+ } else if (publishType == INCREMENTAL_PUBLISH) {
+ status = incrementalPublish(module, module[module.length-1], monitor);
+ }
+ }
+ }
return status;
}
protected IStatus fullPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException {
+ eventRoot.setProperty(PublisherEventLogger.CHANGED_FILE_COUNT, countMembers(module));
IPath deployPath = getDeployPath(moduleTree);
ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
IModuleResource[] members = md.members();
@@ -135,7 +134,6 @@
for( int i = 0; i < length; i++ ) {
new PublisherEventLogger.PublishUtilStatusWrapper(eventRoot, results[i]);
}
- if( length != 0 ) EventLogModel.markChanged(eventRoot);
// adjust timestamps
FileFilter filter = new FileFilter() {
@@ -150,6 +148,7 @@
}
protected IStatus incrementalPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException {
+ eventRoot.setProperty(PublisherEventLogger.CHANGED_FILE_COUNT, countChanges(delta));
IStatus[] results = new IStatus[] {};
if( !deployPackaged(moduleTree))
results = new PublishUtil(server.getServer()).publishDelta(delta, getDeployPath(moduleTree), monitor);
@@ -160,13 +159,13 @@
for( int i = 0; i < length; i++ ) {
new PublisherEventLogger.PublishUtilStatusWrapper(eventRoot, results[i]);
}
- if( length != 0 ) EventLogModel.markChanged(eventRoot);
-
+
return null;
}
protected IStatus unpublish(IDeployableServer jbServer, IModule[] module,
IProgressMonitor monitor) throws CoreException {
+ eventRoot.setProperty(PublisherEventLogger.CHANGED_FILE_COUNT, countMembers(module[module.length-1]));
boolean error = localSafeDelete(getDeployPath(module), eventRoot);
if( error ) {
publishState = IServer.PUBLISH_STATE_FULL;
@@ -287,4 +286,35 @@
}
}
}
+
+ protected int countChanges(IModuleResourceDelta[] deltas) {
+ IModuleResource res;
+ int count = 0;
+ for( int i = 0; i < deltas.length; i++ ) {
+ res = deltas[i].getModuleResource();
+ if( res != null && res instanceof IModuleFile)
+ count++;
+ count += countChanges(deltas[i].getAffectedChildren());
+ }
+ return count;
+ }
+
+ protected int countMembers(IModule module) {
+ try {
+ ModuleDelegate delegate = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, new NullProgressMonitor());
+ return delegate == null ? 0 : countMembers(delegate.members());
+ } catch( CoreException ce ) {}
+ return 0;
+ }
+ protected int countMembers(IModuleResource[] resources) {
+ int count = 0;
+ for( int i = 0; i < resources.length; i++ ) {
+ if( resources[i] instanceof IModuleFile ) {
+ count++;
+ } else if( resources[i] instanceof IModuleFolder ) {
+ count += countMembers(((IModuleFolder)resources[i]).members());
+ }
+ }
+ return count;
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/NullPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/NullPublisher.java 2007-11-02 11:13:03 UTC (rev 4655)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/NullPublisher.java 2007-11-02 11:49:02 UTC (rev 4656)
@@ -39,8 +39,7 @@
return IServer.PUBLISH_STATE_NONE;
}
- public IStatus publishModule(int kind, int deltaKind, int modulePublishState,
- IModule[] module, IProgressMonitor monitor) throws CoreException {
+ public IStatus publishModule(IModule[] module, int publishType, IProgressMonitor monitor) throws CoreException {
return null;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java 2007-11-02 11:13:03 UTC (rev 4655)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java 2007-11-02 11:49:02 UTC (rev 4656)
@@ -29,12 +29,14 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.IModuleResource;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.modules.PackageModuleFactory.ExtendedModuleFile;
import org.jboss.ide.eclipse.as.core.modules.PackageModuleFactory.IExtendedModuleResource;
@@ -43,6 +45,7 @@
import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.PublisherFileUtilListener;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
@@ -72,45 +75,39 @@
return IServer.PUBLISH_STATE_NONE;
}
- public IStatus publishModule(int kind, int deltaKind, int modulePublishState,
- IModule[] module, IProgressMonitor monitor) throws CoreException {
+ public IStatus publishModule(IModule[] module, int publishType, IProgressMonitor monitor) throws CoreException {
try {
IModule module2 = module[0];
// if it's being removed
- if( deltaKind == ServerBehaviourDelegate.REMOVED ) {
- removeModule(module2, kind, deltaKind, modulePublishState, monitor);
- return null;
+ if( publishType == REMOVE_PUBLISH ) {
+ removeModule(module2, monitor);
+ } else if( publishType == FULL_PUBLISH ) {
+ publishModule(module2, true, monitor);
+ } else if( publishType == INCREMENTAL_PUBLISH ) {
+ publishModule(module2, false, monitor);
}
-
- if( deltaKind == ServerBehaviourDelegate.ADDED || deltaKind == ServerBehaviourDelegate.CHANGED) {
- publishModule(module2, kind, deltaKind, modulePublishState, monitor);
- return null;
- }
}catch(Exception e) {
- e.printStackTrace();
+ IStatus status = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Error during publish", e);
+ JBossServerCorePlugin.getDefault().getLog().log(status);
}
return null;
}
- protected void removeModule(IModule module, int kind, int deltaKind, int publishState, IProgressMonitor monitor) {
+ protected void removeModule(IModule module, IProgressMonitor monitor) {
IArchive pack = getPackage(module);
// remove all of the deployed items
- PublishEvent event = PublisherEventLogger.createModuleRootEvent(
- eventRoot, new IModule[]{module}, kind, deltaKind, publishState);
if( pack != null ) {
IPath sourcePath = pack.getArchiveFilePath();
IPath destPath = new Path(server.getDeployDirectory()).append(sourcePath.lastSegment());
// remove the entire file or folder
- PublisherFileUtilListener listener = new PublisherFileUtilListener(event);
+ PublisherFileUtilListener listener = new PublisherFileUtilListener(eventRoot);
FileUtil.safeDelete(destPath.toFile(), listener);
}
}
- protected void publishModule(IModule module, int kind, int deltaKind, int modulePublishState, IProgressMonitor monitor) {
- PublishEvent event = PublisherEventLogger.createModuleRootEvent(
- eventRoot, new IModule[]{module}, kind, deltaKind, modulePublishState);
+ protected void publishModule(IModule module, boolean incremental, IProgressMonitor monitor) {
IArchive pack = getPackage(module);
IPath sourcePath = pack.getArchiveFilePath();
IPath destPathRoot = new Path(server.getDeployDirectory());
@@ -121,20 +118,15 @@
return;
}
- PublisherFileUtilListener listener = new PublisherFileUtilListener(event);
-
- if( shouldPublishIncremental(module, kind, deltaKind, modulePublishState) ) {
+ PublisherFileUtilListener listener = new PublisherFileUtilListener(eventRoot);
+ if( incremental ) {
publishFromDelta(module, destPathRoot, sourcePath.removeLastSegments(1), delta, listener);
} else {
// full publish, copy whole folder or file
FileUtil.fileSafeCopy(sourcePath.toFile(), destPathRoot.append(sourcePath.lastSegment()).toFile(), listener);
}
}
- protected boolean shouldPublishIncremental(IModule module, int kind, int deltaKind, int modulePublishState) {
- if(modulePublishState == IServer.PUBLISH_STATE_FULL || kind == IServer.PUBLISH_FULL)
- return false;
- return true;
- }
+
protected void publishFromDelta(IModule module, IPath destPathRoot, IPath sourcePrefix,
IModuleResourceDelta[] delta, PublisherFileUtilListener listener) {
ArrayList changedFiles = new ArrayList();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublisherEventLogger.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublisherEventLogger.java 2007-11-02 11:13:03 UTC (rev 4655)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublisherEventLogger.java 2007-11-02 11:49:02 UTC (rev 4656)
@@ -23,11 +23,7 @@
setProperty(MODULE_NAME, module.getName());
}
}
-
- public static PublishEvent createTopEvent(EventLogTreeItem parent) {
- return new PublishEvent(parent, ROOT_EVENT);
- }
-
+
// type
public static final String ROOT_EVENT = "org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.ROOT_EVENT";
public static final String MODULE_ROOT_EVENT = "org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.MODULE_ROOT_EVENT";
@@ -35,6 +31,7 @@
public static final String MODULE_KIND = "org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.MODULE_KIND";
public static final String DELTA_KIND = "org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.DELTA_KIND";
public static final String MODULE_PUBLISH_STATE = "org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.MODULE_PUBLISH_STATE";
+
public static PublishEvent createModuleRootEvent(EventLogTreeItem parent, IModule[] module,
int kind, int deltaKind, int moduleStateKind) {
PublishEvent event = new PublishEvent(parent, MODULE_ROOT_EVENT);
@@ -83,6 +80,10 @@
public static final String SOURCE_PROPERTY = "org.jboss.ide.eclipse.as.core.publishers.Events.Properties.SOURCE_PROPERTY";
public static final String DEST_PROPERTY = "org.jboss.ide.eclipse.as.core.publishers.Events.Properties.DEST_PROPERTY";
public static final String EXCEPTION_MESSAGE = "org.jboss.ide.eclipse.as.core.publishers.Events.Properties.EXCEPTION_PROPERTY";
+ public static final String CHANGED_MODULE_COUNT = "org.jboss.ide.eclipse.as.core.publishers.Events.Properties.CHANGED_MODULE_COUNT_PROPERTY";
+ public static final String CHANGED_FILE_COUNT = "org.jboss.ide.eclipse.as.core.publishers.Events.Properties.CHANGED_FILE_COUNT_PROPERTY";
+
+
public static class DeletedEvent extends EventLogTreeItem {
public DeletedEvent(EventLogTreeItem parent, File file, boolean result, Exception e) {
super(parent, FILE_EVENT_MAJOR_TYPE, file.isDirectory() ? FOLDER_DELETED_EVENT : FILE_DELETED_EVENT);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2007-11-02 11:13:03 UTC (rev 4655)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2007-11-02 11:49:02 UTC (rev 4656)
@@ -13,7 +13,6 @@
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
@@ -40,27 +39,26 @@
return publishState;
}
- public IStatus publishModule(int kind, int deltaKind,
- int modulePublishState, IModule[] module, IProgressMonitor monitor)
+ public IStatus publishModule(IModule[] module, int publishType, IProgressMonitor monitor)
throws CoreException {
IModule module2 = module[0];
IStatus status = null;
- if(ServerBehaviourDelegate.REMOVED == deltaKind){
- status = unpublish(server, module2, kind, deltaKind, modulePublishState, monitor);
- } else if( ServerBehaviourDelegate.NO_CHANGE != deltaKind || kind == IServer.PUBLISH_FULL || kind == IServer.PUBLISH_CLEAN ){
+ if(publishType == REMOVE_PUBLISH){
+ status = unpublish(server, module2, monitor);
+ } else if( publishType == FULL_PUBLISH ){
// if there's no change, do nothing. Otherwise, on change or add, re-publish
- status = publish(server, module2, kind, deltaKind, modulePublishState, true, monitor);
- } else if( ServerBehaviourDelegate.NO_CHANGE != deltaKind && kind == IServer.PUBLISH_INCREMENTAL ){
- status = publish(server, module2, kind, deltaKind, modulePublishState, false, monitor);
+ status = publish(server, module2, true, monitor);
+ } else if( publishType == INCREMENTAL_PUBLISH ) {
+ status = publish(server, module2, false, monitor);
}
+ root.setProperty(PublisherEventLogger.CHANGED_FILE_COUNT, new Integer(1));
return status;
}
- protected IStatus publish(IDeployableServer server, IModule module, int kind, int deltaKind,
- int modulePublishState, boolean updateTimestamp, IProgressMonitor monitor) throws CoreException {
+ protected IStatus publish(IDeployableServer server, IModule module, boolean updateTimestamp, IProgressMonitor monitor) throws CoreException {
SingleDeployableModuleDelegate delegate = (SingleDeployableModuleDelegate)module.loadAdapter(SingleDeployableModuleDelegate.class, new NullProgressMonitor());
if( delegate != null ) {
IPath sourcePath = delegate.getGlobalSourcePath();
@@ -83,7 +81,7 @@
return null;
}
- protected IStatus unpublish(IDeployableServer server, IModule module, int kind, int deltaKind, int modulePublishState, IProgressMonitor monitor) throws CoreException {
+ protected IStatus unpublish(IDeployableServer server, IModule module, IProgressMonitor monitor) throws CoreException {
// delete file
SingleDeployableModuleDelegate delegate = (SingleDeployableModuleDelegate)module.loadAdapter(SingleDeployableModuleDelegate.class, new NullProgressMonitor());
if( delegate != null ) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublisher.java 2007-11-02 11:13:03 UTC (rev 4655)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublisher.java 2007-11-02 11:49:02 UTC (rev 4656)
@@ -33,10 +33,13 @@
*
*/
public interface IJBossServerPublisher {
- public IStatus publishModule(int kind, int deltaKind, int modulePublishState,
- IModule[] module, IProgressMonitor monitor)
- throws CoreException;
+ public static final int NO_PUBLISH = 0;
+ public static final int INCREMENTAL_PUBLISH = 1;
+ public static final int FULL_PUBLISH = 2;
+ public static final int REMOVE_PUBLISH = 3;
+
+ public IStatus publishModule(IModule[] module, int publishType,
+ IProgressMonitor monitor) throws CoreException;
public int getPublishState();
public void setDelta(IModuleResourceDelta[] delta);
-
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2007-11-02 11:13:03 UTC (rev 4655)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2007-11-02 11:49:02 UTC (rev 4656)
@@ -69,38 +69,12 @@
workingCopy.setAttribute(DeployableLaunchConfiguration.ACTION_KEY, DeployableLaunchConfiguration.START);
}
- private String print(int kind, int deltaKind, IModule[] module) {
- String ret = "";
- String name = "";
- for( int i = 0; i < module.length; i++ )
- name += module[i].getName();
-
- ret += "publishing module (" + name + "): ";
- switch( kind ) {
- case IServer.PUBLISH_INCREMENTAL: ret += "incremental, "; break;
- case IServer.PUBLISH_FULL: ret += "full, "; break;
- case IServer.PUBLISH_AUTO: ret += "auto, "; break;
- case IServer.PUBLISH_CLEAN: ret += "clean, "; break;
- }
- switch( deltaKind ) {
- case ServerBehaviourDelegate.NO_CHANGE: ret += "no change"; break;
- case ServerBehaviourDelegate.ADDED: ret += "added"; break;
- case ServerBehaviourDelegate.CHANGED: ret += "changed"; break;
- case ServerBehaviourDelegate.REMOVED: ret += "removed"; break;
- }
- ret += " to server " + getServer().getName() + "(" + getServer().getId() + ")";
- return ret;
- }
-
- protected PublishEvent publishEvent;
+ protected PublishEvent publishRootEvent;
protected void publishStart(IProgressMonitor monitor) throws CoreException {
- EventLogTreeItem root = EventLogModel.getModel(getServer()).getRoot();
- publishEvent = PublisherEventLogger.createTopEvent(root);
+ publishRootEvent = new PublishEvent(null, PublisherEventLogger.ROOT_EVENT);
}
protected void publishFinish(IProgressMonitor monitor) throws CoreException {
- publishEvent = null;
-
IModule[] modules = this.getServer().getModules();
boolean allpublished= true;
for (int i = 0; i < modules.length; i++) {
@@ -109,7 +83,12 @@
}
if(allpublished)
setServerPublishState(IServer.PUBLISH_STATE_NONE);
-
+
+ if( publishRootEvent.getChildren().length != 0 ) {
+ EventLogTreeItem root = EventLogModel.getModel(getServer()).getRoot();
+ root.addChild(publishRootEvent);
+ }
+ publishRootEvent = null;
}
@@ -125,32 +104,58 @@
// kind = [incremental, full, auto, clean] = [1,2,3,4]
// delta = [no_change, added, changed, removed] = [0,1,2,3]
if( module.length == 0 ) return;
+ int modulePublishState = getServer().getModulePublishState(module);
+ int publishType = getPublishType(kind, deltaKind, modulePublishState);
IJBossServerPublisher publisher;
- int modulePublishState = getServer().getModulePublishState(module);
- PublishEvent root = PublisherEventLogger.createModuleRootEvent(publishEvent, module, kind, deltaKind, modulePublishState);
+
- if( module.length > 0 ) {
+ if( module.length > 0 && publishType != IJBossServerPublisher.NO_PUBLISH) {
+ Integer i,j;
+ i = (Integer)publishRootEvent.getProperty(PublisherEventLogger.CHANGED_MODULE_COUNT);
+ publishRootEvent.setProperty(PublisherEventLogger.CHANGED_MODULE_COUNT, new Integer(i == null ? 1 : i.intValue()+1));
+ PublishEvent modulePublishEvent = PublisherEventLogger.createModuleRootEvent(publishRootEvent, module, kind, deltaKind, modulePublishState);
+
IModule lastMod = module[module.length -1];
if( isJstModule(lastMod) ) {
- publisher = new JstPublisher(getServer(), root);
+ publisher = new JstPublisher(getServer(), modulePublishEvent);
} else if( isPackagesTypeModule(lastMod) ) {
- publisher = new PackagesPublisher(getServer(), root);
+ publisher = new PackagesPublisher(getServer(), modulePublishEvent);
} else if( lastMod.getModuleType().getId().equals("jboss.singlefile")){
- publisher = new SingleFilePublisher(getServer(), root);
+ publisher = new SingleFilePublisher(getServer(), modulePublishEvent);
} else {
publisher = new NullPublisher();
}
publisher.setDelta(getPublishedResourceDelta(module));
try {
- publisher.publishModule(kind, deltaKind, modulePublishState, module, monitor);
+ publisher.publishModule(module, publishType, monitor);
} catch( CoreException ce ) {
throw ce;
} finally {
setModulePublishState(module, publisher.getPublishState());
}
+
+ // add file changed count to top level element
+ i = (Integer)publishRootEvent.getProperty(PublisherEventLogger.CHANGED_FILE_COUNT);
+ j = (Integer)modulePublishEvent.getProperty(PublisherEventLogger.CHANGED_FILE_COUNT);
+ j = j == null ? new Integer(0) : j;
+ int count = (i == null ? 0 : i.intValue()) + j.intValue();
+ publishRootEvent.setProperty(PublisherEventLogger.CHANGED_FILE_COUNT, count);
}
}
+
+ protected int getPublishType(int kind, int deltaKind, int modulePublishState) {
+ if (ServerBehaviourDelegate.REMOVED == deltaKind) {
+ return IJBossServerPublisher.REMOVE_PUBLISH;
+ } else if (kind == IServer.PUBLISH_FULL || modulePublishState == IServer.PUBLISH_STATE_FULL || kind == IServer.PUBLISH_CLEAN ) {
+ return IJBossServerPublisher.FULL_PUBLISH;
+ } else if (kind == IServer.PUBLISH_INCREMENTAL || modulePublishState == IServer.PUBLISH_STATE_INCREMENTAL || kind == IServer.PUBLISH_AUTO) {
+ if( ServerBehaviourDelegate.CHANGED == deltaKind )
+ return IJBossServerPublisher.INCREMENTAL_PUBLISH;
+ }
+ return IJBossServerPublisher.NO_PUBLISH;
+ }
+
/* Temporary and will need to be fixed */
// TODO: Change to if it is a flex project. Don't know how to do that yet.
protected boolean isJstModule(IModule mod) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/SimpleTreeItem.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/SimpleTreeItem.java 2007-11-02 11:13:03 UTC (rev 4655)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/SimpleTreeItem.java 2007-11-02 11:49:02 UTC (rev 4656)
@@ -56,10 +56,6 @@
item.setParent(this);
}
}
-
- public void addChild(int loc, SimpleTreeItem item) {
- children.add(loc, item);
- }
public void addChildren(SimpleTreeItem[] kids) {
for( int i = 0; i < kids.length; i++ ) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java 2007-11-02 11:13:03 UTC (rev 4655)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java 2007-11-02 11:49:02 UTC (rev 4656)
@@ -75,6 +75,8 @@
propertyToMessageMap.put(PublisherEventLogger.DELTA_KIND + DELIMITER + ServerBehaviourDelegate.REMOVED, "Removed");
propertyToMessageMap.put(PublisherEventLogger.DELTA_KIND + DELIMITER + ServerBehaviourDelegate.NO_CHANGE, "No Change");
+ propertyToMessageMap.put(PublisherEventLogger.CHANGED_FILE_COUNT, "Changed Files");
+ propertyToMessageMap.put(PublisherEventLogger.CHANGED_MODULE_COUNT, "Changed Modules");
// propertyToMessageMap.put(IJBossServerPublisher.MODULE_NAME, "Module Name");
// propertyToMessageMap.put(PackagesPublisher.PackagesPublisherRemoveEvent.PACKAGE_NAME, "Package Name");
@@ -155,8 +157,15 @@
}
if( type.equals(PublisherEventLogger.ROOT_EVENT)) {
- return "Publishing to server";
+ Integer tmp;
+ int files, mods;
+ tmp = (Integer)item.getProperty(PublisherEventLogger.CHANGED_FILE_COUNT);
+ files = tmp == null ? 0 : tmp.intValue();
+ tmp = (Integer)item.getProperty(PublisherEventLogger.CHANGED_MODULE_COUNT);
+ mods = tmp == null ? 0 : tmp.intValue();
+ return "Publishing [" + mods + " modules, " + files + " files changed]";
}
+
if( type.equals(PublisherEventLogger.MODULE_ROOT_EVENT)) {
return getKindDeltaKind(item) + " " + item.getProperty(PublisherEventLogger.MODULE_NAME);
}
17 years, 2 months
JBoss Tools SVN: r4655 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: src/org/jboss/tools/jsf/vpe/richfaces/template and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-11-02 07:13:03 -0400 (Fri, 02 Nov 2007)
New Revision: 4655
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inputNumberSlider/inputNumberSlider.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inputNumberSlider/pos.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSliderTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1249
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inputNumberSlider/inputNumberSlider.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inputNumberSlider/inputNumberSlider.css 2007-11-02 10:03:26 UTC (rev 4654)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inputNumberSlider/inputNumberSlider.css 2007-11-02 11:13:03 UTC (rev 4655)
@@ -75,8 +75,8 @@
width:100%;
}
.cell-with-picture {
- border-color: #ffffff;
- border: 1px solid white;
+ background-color : transparent;
+ border: 1px solid transparent;
align: left;
height: 4px;
width: 7px;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inputNumberSlider/pos.gif
===================================================================
(Binary files differ)
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSliderTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSliderTemplate.java 2007-11-02 10:03:26 UTC (rev 4654)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSliderTemplate.java 2007-11-02 11:13:03 UTC (rev 4655)
@@ -29,7 +29,8 @@
import org.w3c.dom.Node;
/**
- * Template for input number slider control
+ * Template for input number slider control
+ * // TODO We should refactor this class. There is a lot of reflection and a lot of direct work with mozzila.
*/
public class RichFacesInputNumberSliderTemplate extends
AbstractRichFacesInputNumberTemplate {
@@ -198,7 +199,8 @@
table1Tr1Td3input.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
INPUT_STYLE_CLASS);
table1Tr1Td3input.setAttribute(HtmlComponentUtil.HTML_SIZE_ATTR, "3");
- table1Tr1Td3input.setAttribute(HtmlComponentUtil.HTML_VALUE_ATTR, "50");
+ table1Tr1Td3input.setAttribute(HtmlComponentUtil.HTML_VALUE_ATTR, "50");
+ table1Tr1Td3input.setAttribute("style", ComponentUtil.getHeaderBackgoundImgStyle());
table1Tr2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
table1Tr2Td1 = visualDocument
@@ -224,22 +226,30 @@
.createElement(HtmlComponentUtil.HTML_TAG_TD);
table1Tr2Td1Table2Tr1Td1.setAttribute(
HtmlComponentUtil.HTML_CLASS_ATTR, "empty-cell-style");
+
+ table1Tr2Td1Table2Tr1Td1.setAttribute("style", ComponentUtil.getHeaderBackgoundImgStyle());
+
table1Tr2Td1Table2Tr1Td1.setAttribute(
HtmlComponentUtil.HTML_WIDTH_ATTR, "50%");
table1Tr2Td1Table2Tr1Td2 = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TD);
table1Tr2Td1Table2Tr1Td2.setAttribute(
- HtmlComponentUtil.HTML_CLASS_ATTR, "cell-with-picture");
+ HtmlComponentUtil.HTML_CLASS_ATTR, "cell-with-picture");
+
+ table1Tr2Td1Table2Tr1Td2.setAttribute("style", ComponentUtil.getHeaderBackgoundImgStyle());
table1Tr2Td1Table2Tr1Td2Img = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_IMG);
ComponentUtil.setImg(table1Tr2Td1Table2Tr1Td2Img, IMAGE_SLIDER);
-
+
table1Tr2Td1Table2Tr1Td3 = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TD);
table1Tr2Td1Table2Tr1Td3.setAttribute(
HtmlComponentUtil.HTML_CLASS_ATTR, "empty-cell-style");
+
+ table1Tr2Td1Table2Tr1Td3.setAttribute("style", ComponentUtil.getHeaderBackgoundImgStyle());
+
table1Tr2Td1Table2Tr1Td3.setAttribute(
HtmlComponentUtil.HTML_WIDTH_ATTR, "50%");
@@ -273,11 +283,11 @@
try {
function.invoke(this, inPatams);
} catch (IllegalArgumentException e1) {
- RichFacesTemplatesActivator.getPluginLog().logWarning("IllegalArgumentException: " + e.getKey() + ":" + e1.getMessage() );
+ RichFacesTemplatesActivator.getPluginLog().logWarning("IllegalArgumentException: " + e.getKey() + ":" + e1.getMessage(), e1);
} catch (IllegalAccessException e2) {
- RichFacesTemplatesActivator.getPluginLog().logWarning("IllegalAccessException: " + e.getKey() + ":" + e2.getMessage() );
+ RichFacesTemplatesActivator.getPluginLog().logWarning("IllegalAccessException: " + e.getKey() + ":" + e2.getMessage(), e2);
} catch (InvocationTargetException e3) {
- RichFacesTemplatesActivator.getPluginLog().logWarning("InvocationTargetException: " + e3.getMessage() );
+// RichFacesTemplatesActivator.getPluginLog().logWarning("InvocationTargetException: " + e3.getMessage(), e3);
}
}
}
@@ -308,7 +318,7 @@
} catch (IllegalAccessException e2) {
RichFacesTemplatesActivator.getPluginLog().logWarning("IllegalAccessException: " + name + ":" + e2.getMessage() );
} catch (InvocationTargetException e3) {
- RichFacesTemplatesActivator.getPluginLog().logWarning("InvocationTargetException: " + name + ":"+ e3.getMessage() );
+// RichFacesTemplatesActivator.getPluginLog().logWarning("InvocationTargetException: " + name + ":"+ e3.getMessage() );
}
}
@@ -389,7 +399,12 @@
nsIDOMNode td1 = trList.item(0);
nsIDOMNodeList td1List = td1.getChildNodes();
nsIDOMNode minValue = td1List.item(0);
- nsIDOMElement minValueElement = (nsIDOMElement) minValue.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ nsIDOMElement minValueElement = null;
+ try {
+ minValueElement = (nsIDOMElement) minValue.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ } catch (org.mozilla.xpcom.XPCOMException e) {
+ return null; // It could happen if source code doesn't have such element.
+ }
return minValueElement;
}
17 years, 2 months