Child pages
  • Specification (.spec file)

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: SVY-13572 Be able to deprecate components or services

...

Code Block
languagejs
titlespec file definition
{
	"name": "packagename-componentname", // String
	"displayName": "more descriptive name that is shown in the designer", // String
	"version": the component version (integer)
	"icon": "A reference to the icon shown in designer" ,
    "preview": "A reference to the preview gif to be displayed" ,

	"definition": "A reference to the js file that implements this component's in the browser",
    "serverscript": "[optional] A reference to the js file that implements this component's server-side logic, if any.",

    "group": true // default true, so the definition file can be grouped when creating the .war file for deployment
    "deprecated": "This component will be replaced in the next versions.",//some string to mark the component as deprecated
	"replacement": "package-compname",
	"libraries": /* Array of js/css definitions (which are JSON objects with 
                             'name'-the lib name, 'version'-the lib version, 'url'-the lib url, 
                             'mimetype'-the lib mimetype, one of 'text/javascript' or 'text/css', 
                             'group' - give false here when this lib dependency should not be grouped when exported
                             as .war; default true)
                    that need to be included for this component. */,

    "categoryName": "Advanced", // category for form designer palette; only makes sense for components, not services

	"model": {
	    "property1Name": /* type description (optionally including optional default value and others) */,
	    "property2Name": /* type description (optionally including optional default value and others) */
	},

	"handlers": {
	    "handler1Name": { /* handler function type definition*/ },
	    "handler2Name": { /* handler function type definition*/ }
	},

	"api": {
	    "apiFunction1Name": { */ api function signature description json*/ },
	    "apiFunction2Name": { */ api function signature description json*/ }
	},

    "internalApi" : {
	    "internalApiFunction1Name": { */ internal api function signature description json*/ },
	    "internalApiFunction2Name": { */ internal api function signature description json*/ }
    },

	"types": {
	    "customType1Name": {
            "subProp1Name": /* type description" */,
            "subProp2Name": /* type description" */
        },
	    "customType2Name": {
            "subProp1Name": /* type description" */,
            "subProp2Name": /* type description" */
       }
    }
}

...

Info
titleThe "group" property

The libraries which contain references to external files cannot be grouped because in the deployed applications the relative paths to those resources are lost, therefore the components will not work.

Such libraries are font-awesome.css or tinymce.js, they should always have "group": false in the specification file of the components that use them.

Deprecation support

A component/service/layout can be marked as deprecated by using the "deprecated" and/or "replacement" properties.

The deprecated components/layouts will not be shown anymore in the palette.

The deprecated services will not be shown anymore under the Solution Explorer plugins node. Markers will be added in case they are used in scripting.

The following combinations are possible:

Code Block
languagejs
"deprecated": "true" //a boolean as a string


Code Block
languagejs
"deprecated": This component will be removed in version X.",//some extra message


In the case when the "replacement" property is used, the generated markers for the used deprecated components will also have a quickfix.  

Code Block
languagejs
"deprecated": "This component will be removed in version X.",//some extra message
"replacement": "packagename-compname"


Using the "replacement" property only will mark the component as deprecated, and the generated marker will have  a quickfix.

Code Block
languagejs
"replacement": "packagename-compname"


Info
titleThe "deprecated" property

The "deprecated" property can also be used to deprecate service api or component properties:

e.g. service function

"removeKeyListener":
{
"returns":"boolean",
"deprecated": "true",
"parameters":
[
{
"name":"callbackKey",
"type":"string"
}
]
}


e.g. component property

"model":
{
"enabled" : {"type":"boolean", "default":true, "deprecated": "true"},

...

}

In this case, the deprecated property will not be shown in the properties view.


Model


A ng web component or ng service specifies all its properties and the type of each property in the model section of the .spec file.

...