Versions Compared

Key

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

Anchor
top
top

In This Topic

Table of Contents
maxLevel2

 

XperienCentral provides a Configuration Management service. This service is used to store environment specific settings (hostname, for example). The settings of the Configuration Management service can be edited through the Setup Tool (/web/setup). This section topic explains how to add a property to the Configuration Management service and how to retrieve the contents of the properties in the Java code. When creating and reading configuration entries, be sure that you conform to the plugin development guidelines (G046 and G152 in particular). When you follow the steps explained in this sectiontopic, your plugin will conform to these guidelines.

 

In This Topic

Table of Contents
maxLevel2

 

...

Adding Properties to the Configuration Management

Beginning with XperienCentral.version 10.4, it is possible to add properties to the Configuration Management through a plugin. This section topic explains the steps you need to take to create two new extra properties. One extra property is an array (a list of server names). The second extra property is the portnumber.

...

Using Custom Configuration Properties

This section part describes in detail how to use properties that were added to the Configuration Management service. The following steps have to be taken to make the properties available:

...

Code Block
themeEclipse
ServiceComponentDefinitionImpl serviceDef = new ServiceComponentDefinitionImpl( false );
serviceDef.setId("nl.gx.helloworld.configurationservice");
serviceDef.setName("HelloWorld configuration service.");
serviceDef.setDescription( "Service which contains the configuration for this WCBplugin." );
serviceDef.setTypeId( ServiceComponentType.class.getName() );
serviceDef.setProperties( new Hashtable<String, String>() );
serviceDef.setImplementationClassName(HelloWorldConfigurationServiceImpl.class.getName() );
serviceDef.setInterfaceClassNames( new String[] {HelloWorldConfigurationService.class.getName()} );
serviceDef.setWrapperClassNames( new String[] {} );
ComponentDependencyImpl serviceDependency = new ComponentDependencyImpl();
serviceDependency.setServiceName(ConfigurationManagement.class.getName());
serviceDependency.setRequired(true);
serviceDef.setDependencies(new ComponentDependency[] { serviceDependency });

...

The interface for the HWC (HelloWorld Configuration) service component is very small. The getters in the interface are based on the XML examples of the previous sectionsearlier in this topic. A basic interface looks like this:

...

The components that want access to the properties need to create a dependency on the HWC service that was created earlier in the previous sectionsthis topic. If, for example, an element needs access to the properties, the dependency would look like this:

...

Once the properties are present in the Configuration Management service, the value of the properties can be changed through the /web/setup tool. Log onto the Setup Tool (/web/setup) and navigate to the General configuration tab. Your configuration set should be present between the default configuration sets (the sets are alphabetically ordered).

 

Back to Top