Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Open the menu Window > Preferences > Java > Installed JREs.
  2. Ensure that a JDK version of Java is used in your JRE definition
  3. If the used JRE definition points to a JRE version of Java, then remove the reference to the JRE and create a new reference to the JDK.


Back to Top

...

In This Topic

Table of Contents
maxLevel2

Building Your First Plugin

Now that XperienCentral is installed, it’s time to build your first plugin. The first plugin will contain one component: the helloWorld element component. After building and deploying this plugin, there will be a new element in XperienCentral. If that element is placed on a page, the text “Hello World!” will be displayed on the web page.

Maven

XperienCentral requires Maven 3.3.x. It’s very easy to check which version you are currently using: open a command prompt and type:  

mvn -version

To download the latest version of Maven 3.3.x, go to the website: http://maven.apache.org/download.html.

...

Creating the helloWorld Element Plugin

To create a plugin that will add an element to XperienCentral, perform the following steps:

...

A new subfolder called helloworldelement is now present.

Building and Deploying the Plugin

In order to build and deploy the plugin, perform the following steps:

...

Back to Top

Creating a Plugin with a Panel Component

After creating your first plugin with an element component, it’s time to create a new type of component: a panel. A panel is a pop-up in XperienCentral that usually contains functionality that performs maintenance on objects. An example of such a panel is the pop-up in which you can maintain web users in XperienCentral.

Creating the helloWorld Panel

To create a plugin that will add a panel to XperienCentral, perform the following steps:

...

Building and Deploying the Panel

In order to build and deploy the plugin, perform the following steps:

...

Press F5 to refresh XperienCentral - The panel is now available in XperienCentral in the Configuration menu.

Back to Top

Creating a Plugin with a Media Item Component

In XperienCentral, the Content Repository can be filled with articles and multimedia items. These objects have a predefined set of metadata. If you need additional metadata for specific types of objects in the Content Repository, a new media item can be created. For example, vacancies have an additional selection list of predefined locations in the metadata.

Note

In XperienCentral, the terms "media item" and "content item" are synonymous. For reasons of backward compatability with earlier versions of GX WebManager 9.x, these terms are used interchangeably throughout our documentation.

Creating the helloWorld Media Item

To create a plugin that will add a media Item to XperienCentral, perform the following steps:

...

A new subfolder called "helloworldmediaitem" is now present.

Building and Deploying the Media Item

In order to build and deploy the plugin, perform the following steps:

...

Note

If you create a custom download media item that you want to be downloadable directly from a Content Overview and/or Dynamic Content Overview element, the custom mediaItemVersionImpl should implement: nl.gx.webmanager.cms.mediarepository.MediaItemDownloadVersion.

Back to Top

Creating a Plugin with a Page Metadata Component

In XperienCentral, pages are the building blocks of your website. Pages have some default metadata properties like title, navigation title, publication date and so forth. The page metadata component allows the plugin programmer to add additional metadata fields to each page in XperienCentral. This part describes how to create a plugin based on the pagemetadata archetype.

Creating the helloWorld pagemetadata

To create a plugin that will add page metadata to XperienCentral, perform the following steps:

...

 A new subfolder called "helloworldpagemetadata" is now present.

Building and Deploying the pagemetadata

In order to build and deploy the plugin, take the following steps:

...

Press F5 to refresh XperienCentral - The Page Metadata component is now available in XperienCentral. For each page it is now possible to enter a value for the new properties as defined in the page metadata component.

Back to Top

Creating a Plugin with a Presentation Component

Each XperienCentral page is connected to a presentation (appearance). A presentation is connected to its own JSP template, used by XperienCentral to generate the HTML of the page. With this component it is possible to create new presentation. Presentations can have small differences (like another lead color or logo) or can be completely different.

Creating the helloWorld Presentation

To create a plugin that will add a new presentation style to XperienCentral, perform the following steps:

...

A new subfolder called "helloworldpresentation" is now present.

Building and Deploying the Presentation Component

In order to build and deploy the plugin, perform the following steps:

...

The style is now available in XperienCentral.

Back to Top

Creating a Plugin with a Service Component

A service component is a so-called headless service - It has no user interface. Examples of services are mailing services, newsfeed imports, storage services and scheduling services. Often a service is used as support for components that work together, like a bookstore panel and a bookstore element: they depend on a service that regulates the storage of the content of the business objects.

Creating the helloWorld Service

To create a plugin that will add a new service component to XperienCentral, perform the following steps:

...

Building and Deploying the Service Component

In order to build and deploy the plugin, perform the following steps:

...

The service is now available to other plugins in XperienCentral.

Back to Top

Creating a Plugin with a Servlet Component

A servlet is a Java program that runs in a web container. A servlet is an object that receives a request and generates a response based on that request. Examples of servlets are the controller and show servlet of XperienCentral. An example use case of a servlet: a servlet that handles AJAX calls.

Creating the helloWorld Servlet

To create a plugin that will add a new servlet component to XperienCentral, perform the following steps:

...

Building and Deploying the Servlet Component

In order to build and deploy the plugin, perform the following steps:

...

The servlet is now available to other plugins in XperienCentral. To test the proper working of the servlet, open a browser window and navigate to either:

...

or

http://<hostname>:<portnumber>/<context>/helloworldservlet.servlet

...

helloworldservlet - Hello World!
Init parameter: ‘key’ = ‘value’

Back to Top

Creating a Plugin with a Sidebar Widget

You can add new sidebar (DOJO) widgets to XperienCentral. This archetype will give you a small working sidebar widget example which will respond to the current context and show the title of the content item (Page, Page Section, Media Item) that is being editted and enable the editor to change the url title.

Creating the helloWorld Sidebar Widget 

To create a plugin that will add a new presentation style to XperienCentral, perform the following steps:

...

A new subfolder called "helloworldsidebarwidget" is now present.

Building and Deploying the Sidebar Widget Component

In order to build and deploy the plugin, perform the following steps:

...

The widget is now available in XperienCentral (refresh the browser to load the new component in the JavaScript client framework).

Back to Top

Creating a Plugin with a Presentation Component

Each XperienCentral page is connected to a presentation (appearance). A presentation is connected to its own JSP template, used by XperienCentral to generate the HTML of the page. With this component it is possible to create new presentation. Presentations can have small differences (like another lead color or logo) or can be completely different.

Creating the helloWorld Presentation

To create a plugin that will add a new presentation style to XperienCentral, perform the following steps:

...

A new subfolder called "helloworldpresentation" is now present.

Building and Deploying the Presentation Component

In order to build and deploy the plugin, perform the following steps:

...

The style is now available in XperienCentral.

Back to Top

Troubleshooting

The Plugin Does not Compile

Sun Microsystems provides two versions of Java for download on http://java.sun.com/:

  • The Java Runtime Environment (JRE)
  • The Java Development Kit (JDK)

The JDK consists of the JRE plus added extras. For plugin development you will need the JDK. If you get a build failure, check the following:

  1. Open the menu Window > Preferences > Java > Installed JREs.
  2. Ensure that a JDK version of Java is used in your JRE definition
  3. If the used JRE definition points to a JRE version of Java, then remove the reference to the JRE and create a new reference to the JDK.

Back to Top

...

In This Topic

Table of Contents
maxLevel2

Building Your First Plugin

Now that XperienCentral is installed, it’s time to build your first plugin. The first plugin will contain one component: the helloWorld element component. After building and deploying this plugin, there will be a new element in XperienCentral. If that element is placed on a page, the text “Hello World!” will be displayed on the web page.

Maven

XperienCentral requires Maven 3.3.x. It’s very easy to check which version you are currently using: open a command prompt and type:  

mvn -version

To download the latest version of Maven 3.3.x, go to the website: http://maven.apache.org/download.html.

...

Creating the helloWorld Element Plugin

To create a plugin that will add an element to XperienCentral, perform the following steps:

...

A new subfolder called helloworldelement is now present.

Building and Deploying the Plugin

In order to build and deploy the plugin, perform the following steps:

...

Back to Top

Creating a Plugin with a Panel Component

After creating your first plugin with an element component, it’s time to create a new type of component: a panel. A panel is a pop-up in XperienCentral that usually contains functionality that performs maintenance on objects. An example of such a panel is the pop-up in which you can maintain web users in XperienCentral.

Creating the helloWorld Panel

To create a plugin that will add a panel to XperienCentral, perform the following steps:

...

Building and Deploying the Panel

In order to build and deploy the plugin, perform the following steps:

...

Press F5 to refresh XperienCentral - The panel is now available in XperienCentral in the Configuration menu.

Back to Top

Creating a Plugin with a Media Item Component

In XperienCentral, the Content Repository can be filled with articles and multimedia items. These objects have a predefined set of metadata. If you need additional metadata for specific types of objects in the Content Repository, a new media item can be created. For example, vacancies have an additional selection list of predefined locations in the metadata.

Note

In XperienCentral, the terms "media item" and "content item" are synonymous. For reasons of backward compatability with earlier versions of GX WebManager 9.x, these terms are used interchangeably throughout our documentation.

Creating the helloWorld Media Item

To create a plugin that will add a media Item to XperienCentral, perform the following steps:

...

A new subfolder called "helloworldmediaitem" is now present.

Building and Deploying the Media Item

In order to build and deploy the plugin, perform the following steps:

...

Note

If you create a custom download media item that you want to be downloadable directly from a Content Overview and/or Dynamic Content Overview element, the custom mediaItemVersionImpl should implement: nl.gx.webmanager.cms.mediarepository.MediaItemDownloadVersion.

Back to Top

Creating a Plugin with a Page Metadata Component

In XperienCentral, pages are the building blocks of your website. Pages have some default metadata properties like title, navigation title, publication date and so forth. The page metadata component allows the plugin programmer to add additional metadata fields to each page in XperienCentral. This part describes how to create a plugin based on the pagemetadata archetype.

Creating the helloWorld pagemetadata

To create a plugin that will add page metadata to XperienCentral, perform the following steps:

...

 A new subfolder called "helloworldpagemetadata" is now present.

Building and Deploying the pagemetadata

In order to build and deploy the plugin, take the following steps:

...

Press F5 to refresh XperienCentral - The Page Metadata component is now available in XperienCentral. For each page it is now possible to enter a value for the new properties as defined in the page metadata component.

Back to Top

Creating a Plugin with a Presentation Component

Each XperienCentral page is connected to a presentation (appearance). A presentation is connected to its own JSP template, used by XperienCentral to generate the HTML of the page. With this component it is possible to create new presentation. Presentations can have small differences (like another lead color or logo) or can be completely different.

Creating the helloWorld Presentation

To create a plugin that will add a new presentation style to XperienCentral, perform the following steps:

...

A new subfolder called "helloworldpresentation" is now present.

Building and Deploying the Presentation Component

In order to build and deploy the plugin, perform the following steps:

...

The style is now available in XperienCentral.

Back to Top

Creating a Plugin with a Service Component

A service component is a so-called headless service - It has no user interface. Examples of services are mailing services, newsfeed imports, storage services and scheduling services. Often a service is used as support for components that work together, like a bookstore panel and a bookstore element: they depend on a service that regulates the storage of the content of the business objects.

Creating the helloWorld Service

To create a plugin that will add a new service component to XperienCentral, perform the following steps:

...

Building and Deploying the Service Component

In order to build and deploy the plugin, perform the following steps:

...

The service is now available to other plugins in XperienCentral.

Back to Top

Creating a Plugin with a Servlet Component

A servlet is a Java program that runs in a web container. A servlet is an object that receives a request and generates a response based on that request. Examples of servlets are the controller and show servlet of XperienCentral. An example use case of a servlet: a servlet that handles AJAX calls.

Creating the helloWorld Servlet

To create a plugin that will add a new servlet component to XperienCentral, perform the following steps:

...

Building and Deploying the Servlet Component

In order to build and deploy the plugin, perform the following steps:

...

The servlet is now available to other plugins in XperienCentral. To test the proper working of the servlet, open a browser window and navigate to either:

...

or

http://<hostname>:<portnumber>/<context>/helloworldservlet.servlet

...

helloworldservlet - Hello World!
Init parameter: ‘key’ = ‘value’

Back to Top

Creating a Plugin with a Sidebar Widget

You can add new sidebar (DOJO) widgets to XperienCentral. This archetype will give you a small working sidebar widget example which will respond to the current context and show the title of the content item (Page, Page Section, Media Item) that is being editted and enable the editor to change the url title.

Creating the helloWorld Sidebar Widget 

To create a plugin that will add a new presentation style to XperienCentral, perform the following steps:

...

A new subfolder called "helloworldsidebarwidget" is now present.

Building and Deploying the Sidebar Widget Component

In order to build and deploy the plugin, perform the following steps:

...

The widget is now available in XperienCentral (refresh the browser to load the new component in the JavaScript client framework).

Back to Top

Creating a Plugin with a Presentation Component

Each XperienCentral page is connected to a presentation (appearance). A presentation is connected to its own JSP template, used by XperienCentral to generate the HTML of the page. With this component it is possible to create new presentation. Presentations can have small differences (like another lead color or logo) or can be completely different.

Creating the helloWorld Presentation

To create a plugin that will add a new presentation style to XperienCentral, perform the following steps:

...

A new subfolder called "helloworldpresentation" is now present.

Building and Deploying the Presentation Component

In order to build and deploy the plugin, perform the following steps:

...

The style is now available in XperienCentral.

Back to Top

Troubleshooting

The Plugin Does not Compile

Sun Microsystems provides two versions of Java for download on http://java.sun.com/:

  • The Java Runtime Environment (JRE)
  • The Java Development Kit (JDK)

The JDK consists of the JRE plus added extras. For plugin development you will need the JDK. If you get a build failure, check the following:

  1. Open the menu Window > Preferences > Java > Installed JREs.
  2. Ensure that a JDK version of Java is used in your JRE definition
  3. If the used JRE definition points to a JRE version of Java, then remove the reference to the JRE and create a new reference to the JDK.

Back to Top