Webpackage

A Webpackage

A webpackage is a versioned container for artifacts. Each webpackage is described by its manifest file.

Version of artifacts

Note: A webpackage is intended to be used as a collection of related artifacts (e.g. a component library, a well structured compound or different variants of one component). Keep in mind, that all artifacts are versioned with the webpackage.

The manifest.webpackage file

The manifest.webpackage file is the most important document of each webpackage since it contains all data describing the webpackage (and of each of its artifacts). 

In the following sections we will describe the manifest file in a general way. If want a more detailed description of the manifest file please check our JSON schemas.

Model version

Please, note that this document is based on model version 9. Check this to explore the valid structure, description and details of a whole manifest file for each model version.

Required properties

The required properties of a manifest file are: 

PropertyObservation
nameThe name of the webpackage
groupIdA namespace for the webpackage (e.g. org.example). It may also be ""
versionVersion number of the webpackage. Use -SNAPSHOT suffix for work in progress.
modelVersionVersion of the webpackage specification
docTypeType of this document (it must be "webpackage")
authorThe author of this webpackage
licenseLicense name. For recommended values see https://spdx.org/licenses/
artifactsArtifacts represent independent parts of a webpackage - with an enclosed responsibility and usable as a dependency of other artifacts. (More details below)

Optional properties

The optional properties of a manifest file are: 

PropertyObservation
descriptionA short description of the webpackage

contributors

A list of contributors of this webpackage
homepageThe url of the webpackage's related website
keywordsKeywords which support other developers to find this webpackage
man1 or more urls to external manual(s) related to this webpackage
runnablesResources that are actually runnable in a users webbrowser, e.g. html files
manifest.webpackage (Example)
{
  "name": "my-webpackage",
  "version": "1.0",
  "modelVersion": "9.1.1",
  "docType": "webpackage",
  "author": {
    "name": "John Doe",
    "email": "john.doe@example.org"
  },
  "contributors": [
    {
		"name": "Jane Doe",
    	"email": "jane.doe@example.org"
	}
  ],
  "license": "MIT",
  "homepage": "http://project.home.com",
  "keywords": [
    "connectors",
    "energy"
  ],
  "runnables": [
      {
        "name": "readme",
        "path": "/doc/readme.html",
        "description": "Read this ..."
      }
  ],
  "artifacts": {
    "apps": [
		{
		  "artifactId": "app-a1",
		  "description": " ...",
		  // ...
		}
    ],
    "compoundComponents": [
		{
		  "artifactId": "component-c2",
		  "description": " ...",
		  // ...
		}
    ],
    "elementaryComponents": [
		{
		  "artifactId": "component-c1",
		  "description": " ...",
		  // ...
		}
    ],
    "utilities": [
		{
		  "artifactId": "utility-u1",
		  "description": " ...",
		  // ...
		}
    ]
}

The artifacts property


The artifacts property of the manifest is object containing the definition of each app, compound component, elementary component and utility belonging to the webpackage (Check this for more information). Below we will provide a brief description of the properties used for defining an artifact within the manifest.

PropertyObservationConstraint
appcompoundComponentelementaryComponentutility
artifactIdA name for this artifact. It should be unique within the webpackageRequiredRequiredRequiredRequired
descriptionDescription of this artifact: responsibility, usage scenariosOptionalOptionalOptionalOptional
runnablesResources that are actually runnable in a users web browserRequiredOptionalOptionalOptional
resourcesContains the first-level resources, which will be used by the artifactOptionalRequiredRequiredRequired
dependencies0 or more artifacts needed for this artifact to work properly. For the sake of backwards compatibility down to model version 8 you can reference endpoints as well. Note: 'webpackage': 'this' refers artifact(s) of this webpackageOptionalOptionalOptionalOptional

dependencyExcludes

0 or more artifacts, which will be excluded from dependency tree.OptionalOptionalOptionalOptional
slots1 or more slots to exchange data with other elementaries or compoundsNot usedOptionalOptionalNot used
membersReferenced components (elementaries or compounds) acting as members of this compound componentNot usedRequiredNot usedNot used
connectionsList of connections between the members and between members and this compound componentNot usedRequiredNot usedNot used
initsList of slot initializations of the compound and member component(s)Not usedOptionalNot usedNot used

An example of a compoundComponent definition is presented:

compoundComponent definition in manifest (Example)
{
  ...
  "artifacts": {
    ...
    "compoundComponents": [
		{
			"artifactId": "compound-component",
        	"description": "This is a compound component",
        	"runnables": [
          		{
            		"name": "demo",
	            	"path": "/demo/index.html",
		            "description": "Demo app..."
	    	    }
    	    ],
        	"slots": [
          		{
		            "slotId": "input",
		            "type": "string",
		            "direction": [
		              "input"
        		    ],
        		    "value": "inputText"
	            }
      		],
       		"members": [
          		{
		            "memberId": "firstMember",
		            "artifactId": "member-artifact-id"
	            }
      		],
        	"connections": [
          		{
            		"connectionId": "input",
		            "source": {
        			      "slot": "input"
		            },
        		    "destination": {
						  "memberIdRef": "firstMember",
	                	  "slot": "firstMemberInput"
      	            }
             	}
        	],
        	"inits": [
          		{
	    	        "slot": "type",
    	    	    "value": "text",
		            "memberIdRef": "input"
	            }
      		 ],
	        "resources": [
    		      "css/compound-component.css"
	         ],
     	    "dependencies": [
         		 {
            		"artifactId": "member-artifact-id"
	             }
       		 ]
		}
    ],
    ...
}