...
The most interesting files for the Sidebar widget are the HTML, .CSS and JS files in the resources, since these are specific for widget plugins. The Activator class is the starting point of every plugin and defines the different parts the plugin consists of and what should happen next. For general information on XperienCentral plugins you can find information on the Plugins page and its subpages, such as the section about Authorization in Plugins. One part of the Activator is specific for widget plugins, namely how a DojoModule
is defined. The DojoModule
Java class is used to register the client-side component in XperienCentral to define where to find its client-side code when loading it and to access language-specific strings. Consider the following code snippet:
...
Generate, build and deploy the plugin containing the "Hello World" widget in XperienCentral. In the Workspace. The widget is now available to be added to a Sidebar. Click the (+) icon on one of the sidebars and click the [Add] button for the "Hello World" widget. The "Hello World" widget will be added to the Sidebar:
...
JSDoc
JSDoc is comparable to JavaDoc, except that it is markup for JavaScript instead of Java code. Our JSDoc documents the client side API of XperienCentral. It is delivered with each release, but it is also available online: https://api.gxsoftware.com/jsdoc. It shows a tree view and is also searchable. To find the class mentioned above, perform the following steps: Search for the class SidebarContentItemWidget
. (You need to click it in the tree view after searching.) Then, expand the Event Summary. Here you see: "Content item change event that published when the current content item changes in the editor". Further you can see that the event handler takes an argument called contentItemInfo
. If you look it up you find out the argument has two properties, identifier
and versionIdentifier
which you can access in you event handler. Here you can see how the properties are used in the handler defined in the archetype:
...