The goal is to add visual settings easily in the VDoc standard screens.
These sections will be inserted in the settings tab.
The current users settings will now be in the "Advanced" sub-tab.
Configuration settings can be managed to following levels:
The idea is to set .xml files in the configuration folder custom/configuration (that also contains properties),
so that the properties and XML will operate all together.
The XML file will be linked to Editor java classes so that you can manipulate setting parameters.
<?xml version="1.0" encoding="UTF-8"?> <configuration> <tab name="Tab1" label="Tab1 label" scope="The Scope for Tab1"> <class qualifiedName="com.axemble.vdoc.sdk.configuration.base.BaseConfigurationEditor_DerivedClass1" /> <section name="Section1" label="Section1 label" > <fields> <field name="Field1" label="Field1 Label" ctrl="text" /> <field name="Field2" label="Field2 Label" ctrl="text" /> </fields> </section> <section name="Section2" label="Section2 label" > <fields> <field name="Field3" label="Field3 Label" ctrl="text" /> </fields> </section> <custom> <customElement1 attribute1="attributeValue1" attribute2="attributeValue2" /> <customElement2 attribute1="attributeValue1" attribute2="attributeValue2" /> </custom> </tab> <tab name="Tab2" label="Tab2 label" scope="The Scope for Tab2" > <class qualifiedName="com.axemble.vdoc.sdk.configuration.base.BaseConfigurationEditor_DerivedClass2" /> <section name="Section" label="Section label" > <fields> <field name="Field4" label="Field4 label" ctrl="text" /> </fields> </section> </tab> </configuration>
Element | Attribute | Description |
configuration | The root tag containing all other elements | |
tab | Define a new tab that will include sections and fields. You can define as many tabs as you wish. | |
name | The tab name. | |
label | Displayed tab label. | |
scope | Specifies where the tab will be displayed. The scope attribute can take the following values: * server: Server property * project: Projects property * process-catalog: Group of processes * storage-catalog: Data stockrooms see Settings scope for more details. | |
class | A class that implement a BaseConfigurationEditor. It will be associated with the corresponding parent tab. | |
qualifiedName | The class name of the implemented BaseConfigurationEditor for the corresponding tab. | |
section | Define a section inside the corresponding tab. The fields are included in the section tag. It can be defined many time. | |
name | Section name. | |
label | Displayed section label. | |
description | Information about the section label. | |
fields | Container of field elements, see Fields framework | |
custom | You can define your own elements and attributes for your personal usage. |
An editor class is a Java class that allows developers to produce dynamic behaviors on the configuration properties (XML definition file). An editor class must extend the com.axemble.vdoc.sdk.configuration.base.BaseConfigurationEditor class.
The editor class works in the same way as the document or resource extensions.
You can override the following standard methods:
Method | Description |
init() | Called at the instantiation time. |
onBeforeLoad() | Called just before the screen is loaded on the server side. |
onAfterLoad() | Called just after the screen is loaded on the server side. |
onBeforeSave() | Called just before saving the settings. |
onAfterSave() | Called just after saving the settings. |
validate() | Allows to validate the configuration. |
package com.axemble.vdoc.configuration; import com.axemble.vdoc.sdk.configuration.base.BaseConfigurationEditor; public class ImplementationExample extends BaseConfigurationEditor { public ImplementationExample() { super(); // TODO Auto-generated constructor stub } @Override public void init() { // TODO Auto-generated method stub super.init(); } @Override public boolean onBeforeLoad() { // TODO Auto-generated method stub return super.onBeforeLoad(); } @Override public boolean onAfterLoad() { // TODO Auto-generated method stub return super.onAfterLoad(); } @Override public boolean onBeforeSave() { // TODO Auto-generated method stub return super.onBeforeSave(); } public boolean onAfterSave() { // TODO Auto-generated method stub return super.onAfterSave(); } @Override public boolean validate() { // TODO Auto-generated method stub return super.validate(); } }
see Adding setting tab for example