Application Packaging Standard

Last updated 14-Nov-2018

APS Resource Model

The fundamental term in APS is APS Resource. Each application must expose its own set of APS types that declare the structure, properties, and operations of APS resources created from those types.

The APS controller stores APS resources in the JSON (RFC-4627) format and allows the actors on the APS bus to manage the resources through the RESTful API (often mentioned simply as REST).

Application and APS Resources

The conversion of the application original (native) API and resource presentation to the APS REST API and APS resources respectively must be performed by a special integration code (provisioning logic) exposed through the APS application endpoint.

../../_images/resource-mapping.png

An APS application can expose several services. An APS application service is a factory of APS resources based on a certain APS type. An APS resource is uniquely identified by its APS ID - UUID (universally unique identifier). In the platform, an APS application service is a part of the application provisioning logic. It synchronizes creation, updates, and removal of APS resources with respective application original resources.

Model-View-Controller Schema

APS is based on the well known Model-View-Controller (MVC) architecture.

../../_images/aps-mvc-schema.png

The MVC components are:

  • Data model of an application defined by the ISV and package developer.

    The application original resources are synchronized with the APS resources controlled by the APS controller. The synchronization goes through the services exposed by an application specific APS connector.

  • The APS controller as the message broker on the APS bus connecting all APS participants.

    All messages between applications and systems connected to the APS bus go through the APS controller. This makes the APS bus and APS controller terms equivalent.

  • The customizable user interface (UI) representing resources through custom view components.

On a user action, the UI code must be able to request the APS controller to perform one of CRUD (create-read-update-delete) operations or a custom operation. The APS controller synchronizes all those requests with the application through its endpoint. Each APS resource is created based on an APS type, which is a formal description of resources. The APS controller processes each REST request in the following order:

  1. It finds the APS type in the request and processes the requested operation in the APS database.
  2. It finds the mapping between the APS type and the APS application service. Each service is exposed as a unique URL on the APS application connector.
  3. The APS controller sends the corresponding REST request to the APS application service to process the respective application original resource.

Development

In accordance with this model, application developers must do the following in an APS package:

  • Define APS types, as they are used for creating APS resources.
    • Each type must be bound to a service running in the APS application connector.
    • APS types are defined using JSON format.
  • Develop provisioning logic for the APS application connector.
    • Each service is implemented by a PHP or another executable file.
    • A service is accessible through its own unique URL (the service endpoint).
    • A service must process all REST requests related to resources of a certain type.
  • Develop custom UI for control panels used by providers and customers.
    • UI views (screens) are arranged into navigation trees, one tree for the provider panel, one for the customer panel, and one for the end-user panel.
    • Each UI view presents a set of widgets enabling users to monitor and operate the application resources.
    • The UI view code (Javascript) processes a user request for a resource operation by generating the corresponding REST request for the APS controller.
Types