Presentation Logic

In accordance with the design requests and the UI navigation declared in APP-meta.xml, the APS application must provide the following user interface:

  • In the provider control panel, the provider must be able to configure the needed number of licenses based on application SKUs.

  • The UX1 panel must allow customers to view the license data and a list of repositories. Besides this, it must allow them to create and remove their repositories. The latter can be prohibited by the license.

../../../_images/step-project1.png ../../../_images/step-meta1.png ../../../_images/step-provision1.png ../../../_images/step-presentation-b.png ../../../_images/step-deploy1.png ../../../_images/step-provisioning1.png

In accordance with the UI navigation declared in the metadata, we will develop the required views following this workflow:

../../../_images/step-presentation-licenses.png ../../../_images/step-presentation-license-new.png ../../../_images/step-presentation-license-edit.png ../../../_images/step-presentation-services.png

General UI Configuration

In APP-META.xml, you declared the navigation trees with the following view sources:

  • ui/licenses.html as the front-end view for managing licenses to be offered for customers.

  • ui/license-new.html as the license editor for creating licenses.

  • ui/license-new.html as the editor for updating licenses.

  • ui/services.js as the main service view for customers to manage repositories and monitor the license data.

You can select the most appropriate offer of the ones provided by a cloud application to sell to your client. This list can be hardcoded in the APS application, or the application integrator can allow providers to choose which services they want to license for their customers. Here, we will consider the former case and therefore define a limited source of all available scopes provided by the GitHub API.

The ui/newlicense.json will be the source of possible scopes. Its structure will correspond to the structure of the license APS type to make it easier to sync UI with the backend. Earlier, for simplicity, we decided to use only two scopes: repo and delete_repo. So, the file contents must look as follows (download):

{
  "aps": {
    "type": "http://aps-standard.org/samples/github/license/1.0"
  },
  "name": "Premium",
  "scopes": [
    "repo",
    "delete_repo"
  ],
  "description": "Premium access level to repositories"
}

Conclusion

This document outlined the tasks to be done in the next steps, where you will use the newly created JSON file containing the default representation of a license APS resource.