Download presentation
Presentation is loading. Please wait.
1
SIF3: Provider Exercise - Java
SchoolInfo Provider Joerg Huber
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 Training Course SIF3: Provider Exercise January 19
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: SchoolInfoType Student List: SchoolCollectionType Refer to “First Consumer” presentation for more details on Data Model Classes. Training Course SIF3: Provider Exercise January 19
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) Training Course SIF3: Provider Exercise January 19
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 Training Course SIF3: Provider Exercise January 19
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 3 for details) CRUD Operations Attempt to implement createSingle() Deal with “useAdvisory” parameter. Attempt to implement retrieve() Deal with “paging” Null out other methods. Training Course SIF3: Provider Exercise January 19
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. Training Course SIF3: Provider Exercise January 19
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… Training Course SIF3: Provider Exercise January 19
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.