In accordance with the Resource Model, you should add a new APS type and a respective service for the APS type.
In this document:
To meet the Scenario and the Resource Model, set requirements for the developer, such as the following:
Declare a new APS type and a service to subscribe to certain event types and process them.
Declare a new view to monitor event notifications. That view must plug into the UX1 navigation tree.
Continue the demo project started in the previous step.
In the project workspace, for example, in the event-mgmt/
folder, edit
the APP-META.xml
file as follows:
In the UX1 navigation tree, declare one more item, events
, that must be presented as one more sub-item
in the application navigation tree.
In the new item, add a view with the ui/events.js
source file,
which name corresponds to the view ID - events
. The view will print out the list of event notifications.
Also declare the events
variable to be used in the UI view.
<item id="events" label="Event Notifications">
<view id="events" label="Event Notification Log" src="ui/events.js">
<var type-id="http://aps-standard.org/samples/event-mgmt/event/1.0" name="events" />
</view>
</item>
Declare one more singular service, events
that will be responsible for the following operations:
Subscribe to events during provisioning of its resource.
Process event notifications by collecting them in a log file.
On a REST request, return the list of event notifications and flush the log.
<service id="events">
<schema path="schemas/event.schema"/>
<presentation>
<name>Event Processing</name>
<summary>Processing event notifications</summary>
</presentation>
</service>
Note
Unlike the other services, this service declaration contains the <schema> element instead of <code>.
This binds the events
service to the APS type defined in the schemas/event.schema
file that is not
generated from a PHP script. You will define the APS type later in this project.
The modified metadata updates the navigation tree in UX1 by adding one more view to show event notifications and adds the declaration of the new service the application will expose to process event notifications.
The APP-META.xml
file you have created is similar to the respective file in the
sample package
.