Meta Declaration

In accordance with the Resource Model, you should add a new APS type and a respective service for the APS type.

../../../../_images/event-step-model.png ../../../../_images/event-step-meta-b.png ../../../../_images/event-step-provision.png ../../../../_images/event-step-presentation.png ../../../../_images/event-step-deploy.png ../../../../_images/event-step-provisioning.png

Required Metadata

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 Your Demo Project

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:

  1. In the UX1 navigation tree, declare one more item, events, that must be presented as one more sub-item in the application navigation tree.

  2. 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>
    
  3. 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.

Conclusion

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.