Presentation is loading. Please wait.

Presentation is loading. Please wait.

Presented by: SIF3: Provider Exercise - Java Joerg Huber SIF3 Provider Exercise: SchoolInfo Provider.

Similar presentations


Presentation on theme: "Presented by: SIF3: Provider Exercise - Java Joerg Huber SIF3 Provider Exercise: SchoolInfo Provider."— Presentation transcript:

1 Presented by: SIF3: Provider Exercise - Java Joerg Huber SIF3 Provider Exercise: SchoolInfo Provider

2 © Systemic Pty Ltd September 2014 Training Course - Sydney: SIF3: Provider Exercise 2 Setting the Scene  Decide on Data Model  Decide on SIF Object(s) – i.e. SchoolInfo  CRUD only  DIRECT Environment Environment Management Considerations  No Events  Immediate Request/Response

3 © Systemic Pty Ltd September 2014 Training Course - Sydney: SIF3: Provider Exercise 3 Data Model Classes (as with Consumer)  The SIF3 Framework has a library with the SIF AU 1.3 data model ( sifDataModel_au1.3.jar ). Generated based on SIF AU 1.3 XSD. Has methods to marshal/unmarshal to/from XML  Classes are named as the SIF Object: Single Student: StudentPersonalType Student List: StudentPersonalCollectionType Refer to “First Consumer” presentation for more details on Data Model Classes.

4 © Systemic Pty Ltd September 2014 Training Course - Sydney: SIF3: Provider Exercise 4 Core Object Provider Classes The following is a list of core classes required for developing an Object Provider. Details will follow as part of the exercise.  BaseProvider (CRUD) or BaseEventProvider (CRUD & Events) Each SIF Object used in the final provider must extend one of these two classes. Forces a number of methods to be implemented  ProviderServletContext Initialises & frees up resources of a provider when webapp (provider) is started or shutdown. Already implemented. Developer does not need to do anything here (configured in web.xml)

5 © Systemic Pty Ltd September 2014 Training Course - Sydney: SIF3: Provider Exercise 5 Steps developing an Object Provider  For each SIF Object used in the provider write a separate class extending BaseProvider or BaseEventProvider  Implement abstract and/or interface methods => May want to look into StudentPersonalProvider  Link marshal/unmarshal with provider Ensures that SIF3 Framework produces correct XML Use DataModelUnmarshalFactory & DataModelMarshalFactory from sifDataModel_au1.3.jar!  Link SIF Object Class with each provider Implement getSingleObjectClassInfo and getMultiObjectClassInfo methods to return appropriate ModelObjectInfo (see demo code) Use predefined constants

6 © Systemic Pty Ltd September 2014 Training Course - Sydney: SIF3: Provider Exercise 6 Steps developing an Object Provider (cont.) Note: You can read some SchoolInfo objects from a file (refer to SIF3 Training Exercises - Java.docx – Exercise 5 for details)  CRUD Operations Attempt to implement createSingle()  Deal with “useAdvisory” parameter. Attempt to implement retrieve()  Deal with “paging” Null out other methods.

7 © Systemic Pty Ltd September 2014 Training Course - Sydney: SIF3: Provider Exercise 7 Steps developing an Object Provider (cont.) Configure the following in the provider.properties file:  List each provider class as a comma separated list in the “provider.classes” property  Set the package name of the consumer classes in the “provider.basePackageName” property. As part of this training most of the above should be pre-set. Refer to Developer’s Guide for much more details on how to develop a provider.

8 © Systemic Pty Ltd September 2014 Training Course - Sydney: SIF3: Provider Exercise 8 Run Object Provider  Deploy your Object Provider to your web- or application container. Deploy = Stop/Start your web- or application server. If you load schools from the supplied XML file you should see a log entry indicating 2 schools are loaded. If not check weather the property provider.school.file.location in the provider.properties file points to a valid location.  Within your IDE you should be able to run the DemoConsumer class. It is an executable. Comment out SchoolConsumer methods.  Observe the output on the command line…


Download ppt "Presented by: SIF3: Provider Exercise - Java Joerg Huber SIF3 Provider Exercise: SchoolInfo Provider."

Similar presentations


Ads by Google