Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere...

download Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

of 19

Transcript of Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere...

  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    1/19

    www.GetPedia.com

    * The Ebook starts from the next page : Enjoy !

    http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/
  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    2/19

    M WebSphere Developer Technical Journal: Accelerated JSF deve... http://www-128.ibm.com/developerworks/websphere/techjournal/04...

    18 24/07/2005 0.51

    Country/region [select] Terms of use

    All of dWAll of dW

    Contents:

    Introduction

    Installing the XSD SDOTransform feature

    XSD SDO Transform featurecontents

    Scenario

    Application design flow

    Runtime architecture

    Implementing the solution

    Conclusion

    Resources

    Download

    About the authors

    Rate this article

    Related content:

    IBM WebSphere DeveloperTechnical Journal

    Part 2: Extending andcustomizing an SDO solution

    Part 3: Manipulating SDOinstances

    Part 4: Portlet development

    Subscriptions:

    dW newsletters

    dW Subscription(CDs and downloads)

    Home Products Services & solutions Support & downloads My account

    developerWorks > WebSphere >

    IBM WebSphere Developer Technical Journal:Accelerated JSF development for XML-based SOA

    using Rational Application Developer and WebSphereApplication Server -- Part 1

    Introducing the XSD SDO transform featureLevel: Intermediate

    Narinder Makin ([email protected]), Advisory Software Engineer, IBM, Rational SOA toolsRitchie Schacher ([email protected]), Advisory Software Engineer, IBM, Rational SOA toolsDaniel Berg ([email protected]), Senior Software Engineer, IBM, Rational SOA toolsDaimar Hernandez ([email protected]), Staff Software Engineer, IBM, PVT Team

    01 Dec 2004

    This article series presents a solution that accelerates presentation development for XML-based Service OrientedArchitecture (SOA) applications. This solution includes an Eclipse feature that enables the generation of statically

    typed Service Data Objects (SDO) for an XSD Schema, and provides a runtime framework for using SDOs in thetransformation of presentation element data to and from XML data.

    IntroductionLoosely coupled, coarse-grain Service Oriented Architecture (SOA) applications developed around XML Data Interchangeoften require some level of presentation development. A basic requirement of such an architecture is the binding ofpresentation controls to the data objects and the transformation of data objects to/from XML data. The existing frameworksused for presentation development, such as JavaServer Faces (JSF), enable the data transfer between the presentationelements to the attributes and references of the Java bean classes. The tedious task of accomplishing transformation fromXML to/from data objects is left to the developer, either by using third party specialized frameworks or by writing code.

    This five-part article series presents a solution that accelerates presentation development of XML-based SOA applications,and includes an Eclipse feature that enables the generation of statically typed service data objects (SDO) for an XSDSchema, and a runtime framework for the transformation of presentation element data to/from XML data using SDOs.

    In Part 1 of this five-part series, we will walk through the development of a simple JSF application using the supplied plug-inset that communicates to a service per the specified XML schema. The application scenario in this article makes one serviceinvocation that sends one XML request and receives one XML response. This application illustrates the master-detail view ofdata objects along with pagination and sorting capabilities. The design-time and runtime architecture of the application arealso depicted in this article.

    Rational Application Developer V6 and Websphere Application Server V6 are required to take advantage of thistransformation feature. This article also assumes familiarity with Rational Application Developer's JSF page designer.

    Installing the XSD SDO Transform feature

    Unzip the xsdsdotransform-feature.zip download file into your Rational Application Developer installation'srad\eclipse directory (for example,D:\IBM\RSDP\6.0\rad\eclipse).

    1.

    Start Rational Application Developer (hereafter referred to as Application Developer).2.Select Help => Software Updates => Manage Configuration (Figure 1).

    Figure 1. Feature install

    3.

    Enable the XSD SDO Transform Feature as shown in Figure 2, then restart Application Developer.

    Figure 2. Feature install

    4.

    http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/http://www.getpedia.com/
  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    3/19

    M WebSphere Developer Technical Journal: Accelerated JSF deve... http://www-128.ibm.com/developerworks/websphere/techjournal/04...

    18 24/07/2005 0.51

    You may ensure the configuration updates for the feature by starting Application Developer with -clean command line argument.

    XSD SDO Transform feature contentsThe XSD SDO Transform feature contains artifacts for generating the SDO package from an XSD schema, and framework components to transform an SDOpackage instance to/from an XML instance document:

    Create SDO Package Action

    This action on the XSD resources generates the SDO package from an XSD schema (Figure 3).

    Figure 3. Create SDO Package

    1.

    dw.ibm.etools.xsd.sdo.xmltransformservice.XMLTransformServiceFactory classThis class provides the APIs to transform an SDO package instance to/from an XML instance document. (XMLTransformServiceFactory.javacode is available in the xsd_sdo_soa_part1_listings.zip download file.)

    2.

    ScenarioWe will develop a simple insurance application scenario that illustrates the master-detail view, sorting, and paging functionality. In this scenario:

    We assume that XYZ Insurance Comany has many brokers registered to it.Each broker has many clients, and each client has many policies registered with that broker.The insurance company exposes broker services via a standard BrokerService schema.Any communication from the broker is an XML request/response that complies to the schema definition in Listing 1. (BrokerService.xsd code isalso available in the xsd_sdo_soa_part1_listings.zip download file.)

    Listing 1. BrokerService.xsd

  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    4/19

    M WebSphere Developer Technical Journal: Accelerated JSF deve... http://www-128.ibm.com/developerworks/websphere/techjournal/04...

    18 24/07/2005 0.51

    Broker Service Schema for xyz.com.Copyright 2004 ibm.com. All rights reserved.

    Figure 4. BrokerService Schema Model

  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    5/19

    M WebSphere Developer Technical Journal: Accelerated JSF deve... http://www-128.ibm.com/developerworks/websphere/techjournal/04...

    18 24/07/2005 0.51

    In this scenario, we develop a brokerdetail.jsp JavaServer Faces JSP page. This page sends the broker detail request(brokerDetailRequest.xml, Listing 2) and receives a response containing all the broker's clients and their policies ( brokerDetailResponse.xml,

    Listing 3). One client's details are displayed per page and policies can be sorted by name.

    Figure 5. BrokerDetail Request/Response Message Flow

    (The code shown in Listings 2 and 3 are also available in the xsd_sdo_soa_part1_listings.zip download file.)

    Listing 2. brokerDetailRequest.xml

    narindermakin

    Listing 3. brokerDetailResponse.xml

    NarinderMakin

    DanMoore

  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    6/19

    M WebSphere Developer Technical Journal: Accelerated JSF deve... http://www-128.ibm.com/developerworks/websphere/techjournal/04...

    18 24/07/2005 0.51

    1967-08-13

    113 Oak Pine St.

    Santa ClaraLA91929US

    123 Demi LaneCaryNC22999

    US

    Life2004-01-012005-01-01100000.00Life Insurance policy includes any

    accidental damages.

    House2004-01-012005-01-0150000.00Home Insurance

    Car 12004-01-012005-01-0115000.00Car Insurance - Ferrari 2004 - Primary

    Car

    Car 22004-01-012005-01-015000.00Car Insurance - Lexus 2003 - Secondary

    Car

    Restaurant2004-01-012005-01-01

    25000.00Business Insurance - Restaurant

    TomCross1970-11-11

    113 Duke St.SheltonCT

    08989US

    123 Lex Lane

    FairfieldNY09833US

    House

    2004-01-012005-01-012000.00Home Insurance

    Life2004-01-012005-01-01100000.00Life Insurance

    Car 12004-01-012005-01-012000.00Car Insurance - Camry 2004 - Primary

    Car

  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    7/19

    M WebSphere Developer Technical Journal: Accelerated JSF deve... http://www-128.ibm.com/developerworks/websphere/techjournal/04...

    18 24/07/2005 0.51

    Application design flowFigure 6 depicts the application design flow for this scenario.

    Figure 6. Application design flow

    Runtime architectureUpon page request, the following occurs (Figure 7):

    The JSF runtime invokes the BrokerDetailRoot bean.1.BrokerDetailRoot preloads the data by sending brokerDetailRequest.xml to the BrokerService.2.BrokerService sends the response as brokerDetailResponse.xml.3.The response received from the broker service invocation, as brokerDetailResponse.xml, is passed to XMLTransformServiceFactory.4.The XML is transformed to SDOs wrapped in the BrokerDetailRoot bean.5.The bean is processed by the JSF runtime.6.The JSF runtime renders the controls with populated data.7.

    Figure 7. Runtime architecture

  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    8/19

    M WebSphere Developer Technical Journal: Accelerated JSF deve... http://www-128.ibm.com/developerworks/websphere/techjournal/04...

    18 24/07/2005 0.51

    Implementing the solutionThe steps to implement the solution are described in detail in the next sections:

    Import project interchange1.Create SDO package from XSD schema2.Create a base root Java bean3.Create a broker service root Java bean4.Create a JSF JSP5.Add the page BrokerDetailRoot bean to paga data6.Add command method to page code7.Create and Bind controls on the page to the SDO types in the page data8.Run brokerdetail.jsp.9.

    Import project interchange

    Import the project interchange xsd_sdo_soa_xml_tutorial.zip download file into the Application Developer workspace. As a result, thefollowing projects will be imported (Figure 8):

    XYZInsuranceEAR: The enterprise application project that contains all the other projects as modules or utilities.XYZInsuranceWeb : The dynamic Web project for the application where all the JSF JSP pages will be created. The WebContent folder of thisproject contains the BrokerService.xsd schema and sample data files in a Schema folder. For the sake of simplicity, in this example theschema and the SDO packages are part of the WebProject. If sharing the same SDOs across multiple Web projects is desired, you cancreate a separate Java project for the SDO packages. The SDO packages are constructed in the same project where the XML Schemaresides.XYZInsuranceService: Contains the Java class implementation for the broker service. The service loads and sends the appropriate XMLresponse based on the service method request. This basic implementation is provided to simulate the service behavior; its implementation isbeyond the scope of this article.XYZInsuranceServiceProxy: Contains a basic implementation of ServiceProxy for invoking the broker service.

    The next sections describe the additions to the XYZInsuranceWeb project.

    Figure 8. Imported tutorial project interchange

    1.

    Create SDO package from XSD schema

    In Application Developer, right-click on BrokerService.xsd, then select Create SDO Package (Figure 9).

    Figure 9. Create SDO Package

    2.

  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    9/19

    M WebSphere Developer Technical Journal: Accelerated JSF deve... http://www-128.ibm.com/developerworks/websphere/techjournal/04...

    18 24/07/2005 0.51

    As a result, the following artifacts will be generated (Figure 10):

    The xyz.brokerservice, xyz.brokerservice.impl, and xyz.brokerservice.util Java packages that contain the SDOs andrelated utilities that are constructed for the types defined in the XSD schema.A framework JAR file, xsdsdotransform.jar, is added to the EAR project and the Web project's JAR dependencies are updatedaccordingly for the build and runtime classpath.

    Figure 10. Generated SDO Packages

    The name of the package is derived from the targetNamespace defined in the schema declaration in the XSD (Figure 11).

    Figure 11. TargetNamespace declaration

    Create a base root Java bean

    Create a BaseBrokerServiceRoot.java (available in the xsd_sdo_soa_part1_listings.zip download file) Java class in thebrokerservice.root package to be used as the base class for all the page root bean wrappers. The schema namespace to the SDO packageregistration is done in the static block. At run time, the namespace of the XML instance document is examined to locate the related SDO packagefrom this registry:

    3.

  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    10/19

    M WebSphere Developer Technical Journal: Accelerated JSF deve... http://www-128.ibm.com/developerworks/websphere/techjournal/04...

    18 24/07/2005 0.51

    static{EPackage.Registry.INSTANCE.put(

    BrokerservicePackage.eINSTANCE.getNsURI()

    , BrokerservicePackage.eINSTANCE);}

    Create a broker service root Java bean

    Create a BrokerDetailRoot.java (available in the xsd_sdo_soa_part1_listings.zip download file) Java class to be used as a beanwrapper for the BrokerDetail.jsp page. This bean wraps the SDO packages and enables the SDO package usage as a Java bean in the pagedata. It also contains methods for preLoading the bean via the response received from the service invocation on request:

    create methodIn this example, this method simply returns an XML request string, but could be coded to invoke a request creator service (for example, onethat adds appropriate header information to the XML request as required by the service for the purpose of auditing, and so on).

    protected String createBrokerDetailRequest(){String request = "

    narindermakin";

    //you may also use the create/convert API to create a new request string/*DocumentRoot docRoot = (DocumentRoot)

    XMLTransformServiceFactory.INSTANCE.create(BrokerservicePackage.eINSTANCE.getNsURI());BrokerServiceType bs = docRoot.createBrokerService();xyz.brokerservice.BrokerType b = bs.createBroker();

    b.setBrokerId("099-99-9999");b.setLoginName("narinder");b.setLoginPassword("makin");request = XMLTransformServiceFactory.INSTANCE.convert((DataObject)b);*/return request;

    }

    a.

    load methodInvokes the XMLTransformServiceFactory methods to transform the broker detail response XML into the SDOs.

    protected void loadBrokerDetailResponse(String response){

    DocumentRoot docRoot=(DocumentRoot) XMLTransformServiceFactory.INSTANCE.load(response);

    brokerServiceRoot = docRoot.getBrokerService();}

    b.

    preload methodInvokes the service with the request and processes the response.

    protected void preLoadBrokerDetail(){String xmlData = createBrokerDetailRequest();String response =

    BrokerServiceFactory.invoke(xmlData,BrokerServiceFactory.BROKERDETAIL_REQUEST);

    loadBrokerDetailResponse(response);}

    c.

    sortByPolicyName methodSorts the policies by name in the policies collection.

    public void sortByPolicyName(List listPolicies){ObjectUtil.INSTANCE.sort(listPolicies,

    BrokerserviceFactory.eINSTANCE,

    BrokerservicePackage.eINSTANCE.getPolicyType_PolicyName(),true);

    }

    d.

    dw.ibm.etools.xsd.sdo.xmltransform.util.ObjectUtil helper classProvided with the framework code to sort the list.

    /**

    * Sorts the Objects in the list* @param list the instance of the EList containing EObjects* @param eFactory the instance of the SDO factory* @param sortBy the EAttribute to be used for sorting* @param desc true for descending sort, false for ascending* @return true if the order of objects in list is changed*/

    e.

    4.

  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    11/19

    M WebSphere Developer Technical Journal: Accelerated JSF deve... http://www-128.ibm.com/developerworks/websphere/techjournal/04...

    di 18 24/07/2005 0.51

    public boolean sort(List list, EFactory eFactory, EAttribute sortBy, boolean desc);

    Create a JSF JSP

    Create a JavaServer Faces JSP file as brokerdetail.jsp

    In Application Developer, open the Web site Navigation, drop a new page from the palette, and rename it as brokerdetail.jsp.

    Figure 12. Web site Navigation

    a.

    Double-click on the page and realize it as a Faces JSP.

    Figure 13 brokerdetail.jsp

    b.

    5.

    Add the page BrokerDetailRoot bean to paga data

    The BrokerDetailRoot bean wraps the SDO classes that were generated from the XSD. The Java bean is introspected, and the page data shows theSDO types and the attributes and references as a tree. To add the root bean to the page data:

    Right-click in the Page Data view and add a new Java Bean by selecting New => JavaBean (Figure 14).

    Figure 14. New java bean menu in page data view

    a.

    In the Add JavaBean dialog (Figure 15), enter the name of the JavaBean instance to be used as a variable, varBrokerDetailRootBean.

    Figure 15. Java bean properties

    b.

    6.

  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    12/19

    M WebSphere Developer Technical Journal: Accelerated JSF deve... http://www-128.ibm.com/developerworks/websphere/techjournal/04...

    di 18 24/07/2005 0.51

    Select Finish. The new bean will display in the Page Data view (Figure 16).

    Figure 16. BrokerServiceRoot java bean

    c.

    Add command method to page code

    Edit the BrokerDetail.java page code file and add the method below to be used as the command action's method. This action invokes thesortByPolicyName method on the page root bean to sort the displayed data for the policy by name. (The table2 control being accessed is added inthe next section.) You can create a param scope variable for the policy list and use that rather than accessing the list from the table control.

    public String doSortByPolicyNameAction(){//table2 is the policy data table

    //you may choose to add a param scope variable//for policy list, instead of using the table controlgetVarBrokerDetailRootBean().sortByPolicyName

    ((java.util.List)getTable2().getValue());// returning empty string re-displays the same page with same data bindingreturn "";

    }

    7.

    Create and bind controls on the page to the SDO types in the page data

    You can project the root data to the page and let the page editor create the controls for you based on the type of the data being projected, or you candrop the individual controls and bind the data elements yourself. For the sake of simplicity, we will use the page editor to create the controls. A datatable is created and binded for each of the SDO types, and output text fields are created and binded for each of the attributes and single valuedreference in these types. For each of the multi values referenced, a nested data table is created and binded.

    Drag the broker SDO from the page data view and drop it onto the page editor (Figures 17 and 18).

    Figure 17. Broker SDO

    a.

    8.

  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    13/19

    M WebSphere Developer Technical Journal: Accelerated JSF deve... http://www-128.ibm.com/developerworks/websphere/techjournal/04...

    di 18 24/07/2005 0.51

    Figure 18. Page Designer

    The Depth property determines the depth for the creation of nested table controls. Customize the table properties by setting the depth to 5(Figure 19).

    Figure 19. Data table properties

    b.

    Specify the data type for the "client" list (Figure 20). You will need to provide the data type for each of the list attributes if you will be bindingthem to any control on a page.

    Figure 20. Object type for client collection

    c.

    Customize the broker's projected attributes by deselecting the clientAsArrayattribute (Figure 21).

    Figure 21. Customize broker projections

    d.

  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    14/19

    M WebSphere Developer Technical Journal: Accelerated JSF deve... http://www-128.ibm.com/developerworks/websphere/techjournal/04...

    di 18 24/07/2005 0.51

    Click on the ellipses ... that display after the the client attribute (Figure 21) and specify the data type for the "policy" list (Figure 22).

    Figure 22. Object type for policy collection

    e.

    Customize "client" projected attributes and deselect the policyAsArrayattribute (Figure 23).

    Figure 23. Customize client projections

    f.

  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    15/19

    M WebSphere Developer Technical Journal: Accelerated JSF deve... http://www-128.ibm.com/developerworks/websphere/techjournal/04...

    di 18 24/07/2005 0.51

    Select Finish. The page controls are created and binded to the elements of the root bean (Figure 24).

    Figure 24. Created controls

    g.

    Add a paging control of your choice to the client data table and set the rows per page to be displayed at 1 (Figures 25 and 26).

    Figure 25. Display options

    h.

  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    16/19

  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    17/19

    M WebSphere Developer Technical Journal: Accelerated JSF deve... http://www-128.ibm.com/developerworks/websphere/techjournal/04...

    di 18 24/07/2005 0.51

    The sorting mechanism demonstrated here does a server side sort by invoking a command action. Based on your requirements, you canchoose to do a client side implementation for the sort.

    Run brokerdetail.jsp

    In Application Developer, right-click on brokerdetail.jsp and select Run On Server. (If you are not prompted to start the server, start theserver and then add the XYZInsuranceEAR project to the server before running the page.)

    a.

    The URL for the page in the test container is (or will be similar to):http://localhost:9080/XYZInsuranceWeb/faces/brokerdetail.jsp.

    Figure 30. brokerdetail.jsp

    b.

    Use the paging control to page for clients.c.Select the SortByPolicyNamecommand to sort the policies by name.d.

    9.

    ConclusionIn Part 1 of this article series, we presented an accelerated JSF development solution for a XML-based SOA application. The solution provided an Eclipsefeature and framework utilities for use at design time to transform the XML Schema to a Java package containing static service data objects, and, at runtime,to transform XML instance documents to and from these SDOs. SDOs wrapped as JavaBeans were used with JavaServer Faces for presentationdevelopment. This article also provided the general steps for developing a JSF presentation for a basic scenario of an insurance application, includingmaster-detail view, sorting, and pagination capabilities.

  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    18/19

    M WebSphere Developer Technical Journal: Accelerated JSF deve... http://www-128.ibm.com/developerworks/websphere/techjournal/04...

    di 18 24/07/2005 0.51

    Part 2 of this series enhances the solution developed in Part 1 to include the create, update, and delete functions, and includes customizations to thegenerated SDOs with local variable addition and basic transformations. The article will illustrate a scenario of multiple schema models, multiplerequests/responses for a single page, and will show the JSF dropdown control binding for XML data.

    Also upcoming in this series:

    Part 3 will describe the advanced techniques for manipulating the generated SDOs and customizing the XML-SDO transformer. It also providesutilities for the aggregate methods (sum, mean, average, and so on) that operate generically on the SDO objects and collections.Part 4 will focus on portlet development for the XML-based SOA that uses the XSDO SDO transform feature, addressing JSR 168 portlet creation,parameter passing across portlets, and setting the target portlet view dynamically on a portlet action in any other portlet.Part 5 will discuss localizing JSF and portlet applications for the XML-based SOA that uses the XSDO SDO transform feature, and will address thelocalizing static and dynamic content that is displayed based on the preferred locale.

    Resources

    IBM developerWorks Rational

    The article Getting started with the Eclipse Platform (developerWorks, November 2002) provides a history and overview of Eclipse, including detailson how to install Eclipse and plug-ins.

    Eclipse In Action: A Guide for Java Developers(Independent Pub Group, 2003) is a must-read for Java developers using Eclipse.

    Browse all of the Charming Pythoncolumns on developerWorks.

    An Introduction to Service Data Objects

    Introduction to Service Data Objects: Next generation data programming in the Java environment

    The Eclipse Modeling Framework (EMF) Overview

    To learn more, visit the developerWorks WebSphere Studio zone and the developerWorks WebSphere Application Server zone. You'll find technicaldocumentation, how-to articles, education, downloads, product information, technical support resources, and more.

    Developer Bookstore. Hundreds of technical books for developers at up to 35% off retail.

    WebSphere forums. Product-specific forums where you can ask questions and share your opinions with other WebSphere users.

    developerWorks blogs. Ongoing, free-form columns by software experts, with space for you to add your comments.

    Download

    Description Name Size Download method

    Download file 1 xsd_sdo_soa_xml_sample.zip 727 KB FTP | HTTP

    Download fi le 2 xsd_sdo_soa_xml_tutorial.zip 685 KB FTP | HTTP

    Download fi le 3 xsdsdotransform-feature.zip 727 KB FTP | HTTP

    Download file 4 XYZInsuranceEAR.zip 725 KB FTP | HTTP

    Download file 5 xsd_sdo_soa_part1_listings.zip 8 KB FTP | HTTP

    Information about download methods

    About the authorsNarinder Makin is a software engineer at IBM Research Triangle Part Lab in Durham, North Carolina. He is a developer of J2EE and SOA/SDO tools for theRational Application Developer team.

    Ritchie Schacher is a software engineer at IBM Research Triangle Part Lab in Durham, North Carolina. He is a developer of J2EE and SOA/SDO tools forthe Rational Application Developer team.

    Daniel Berg is a software engineer at IBM Research Triangle Park Lab in Durham, North Carolina. He is a lead architect for J2EE and SOA/SDO tools forthe Rational Application Developer team.

    Daimar Hernandez is a software engineer at IBM Research Triangle Park Lab in Durham, North Carolina. She is a developer in the PVT team for theRational Application Developer team.

    Rate this article

    This content was helpful to me:

    Strongly disagree (1) Disagree (2) Neutral (3) Agree (4) Strongly agree (5)

    Comments?

  • 8/3/2019 Accelerated JSF Development for XML-Based SOA Using Rational Application Developer and WebSphere Application Server - Part 1

    19/19

    M WebSphere Developer Technical Journal: Accelerated JSF deve... http://www-128.ibm.com/developerworks/websphere/techjournal/04...

    Submitfeedback

    developerWorks > WebSphere >

    About IBM Privacy Contact