Element Editor

by Cuong Nguyen

In ActionCenters, a contribution can be elaborated by multiple properties. For example, a "Project" contribution might have the properties "project name", "project icon", "project description" etc. ActionCenters allows users to configure the values of the properties of a contribution by a tool called "Element Editor".

The purpose of this document is to introduce to developers about:

  • How to create a new property for a contribution.
  • The field types that developers can use to let the users configure the value(s) of a property.

Creating a new property for a contribution

You can create new property for a contribution and update it in the Element Editor. In this section, we illustrate how to do it by an example: create a new property called "projectNewProperty" for the contributions of type "AC_Project_Definition"

All the contribution types are defined in the ActionCenterElements.xml file. Therefore, to modify the definition of the "AC_Project_Definition" contributions, we go to ActionCenterElements.xml. You can access the file through ../AC/actioncenters/src/main/resources/plugins/ActionCenterElements.xml. Open the file and look for <Contribution type="AC_Project_Definition">. You can see something like this

 		    
<?xml version="1.0" encoding="UTF-8"?>
  <ActionCenterElements xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://server.actioncenters.org/svn/AC/actioncenters-xml/ActionCenterElements.xsd">
    //...
	<Contribution type="AC_Project_Definition">
	 	//...
  	</Contribution>
  	//...  				
  </ActionCenterElements>
			 
			

We arrange the properties of a contribution in categories. You can either choose an existing category to insert your property or create a new category. The arrangement of categories in a contribution definition looks like this

 		    
<?xml version="1.0" encoding="UTF-8"?>
  <ActionCenterElements xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://server.actioncenters.org/svn/AC/actioncenters-xml/ActionCenterElements.xsd">
    //...
	<Contribution type="AC_Project_Definition">					
    	<Categories>
        				<Category>
        					<Name>//Category name is here</Name>
        					//...
        				</Category>
        				//...
        				<Category>
        					<Name>//Category name is here</Name>
        					//...
        				</Category>
        				//...
        				<Category>
        					<Name>//Category name is here</Name>
        					//...
        				</Category>
    				</Categories>
  	</Contribution>				  	
  </ActionCenterElements>
			 
			

There can be multiple properties inside a category. Each property can be configured by a specific field type (We will talk more about field types in the next section). The fields are put inside the <Fields></Fields> tag. In our example, suppose that we will use <TextField> to configure our "projectNewProperty" property. The code should look like this

 		    
<?xml version="1.0" encoding="UTF-8"?>
  <ActionCenterElements xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://server.actioncenters.org/svn/AC/actioncenters-xml/ActionCenterElements.xsd">
    //...
	<Contribution type="AC_Project_Definition">					
    	<Categories>
        				<Category>
        					<Name>//Category name is here</Name>
        					//...
        				</Category>
        				//...
        				<Category>
        					<Name>//Category name is here</Name>
        					<Fields>
                    <TextField>
                        <Name>newProjectProperty</Name>
                        <Label>A new property of a project</Label>
                        <HelpText>A new property of a project</HelpText>
                        <HoverText>A new property of a project</HoverText>
                        <CharacterWidth>25</CharacterWidth>
                        <MaximumCharacters>65535</MaximumCharacters>
                        <RegularExpression/>
                        <ValidationMessage/>
                        <InitialTextValue>
                            <DefaultValue>Some value</DefaultValue>
                            <Incremented>true</Incremented>
                            <Required>true</Required>
                        </InitialTextValue>
                    </TextField>
                 </Fields>
        				</Category>
        				//...
        				<Category>
        					<Name>//Category name is here</Name>
        					//...
        				</Category>
    				</Categories>
  	</Contribution>				  	
  </ActionCenterElements>
			 
			

Among the configuration elements of the TextField, the <Name> element is the most important and required because it is where we specify the name of the new property, which in this case is "newProjectProperty". We will use this name to get the value of the property at the client side.

Save the change you have made for the ActionCenterElements.xml, then upload the file to the ActionCenters. To upload the file, you go to ActionCenters lobby page, click on Administrator tab, then click on "System Configuration" link.

After this point, all of the contributions of type "AC_Project_Definition" will have a property named "projectNewProperty".

Note: Be careful when you change the existing properties, especially the names of the properties. They might be used somewhere in the application!!!

Field types

A field type is a way to specify a value for a contribution property. To configure the value of a property, we can use different field types e.g. TextField, ComboBox, RadioButton. In this section, we give a brief introduction of the field types that ActionCenters offers.

For detail definitions of the field types, you can have a look at ActionCenterElements.xsd. To access the file, please follow the path ../AC/actioncenters-xml/ActionCenterElements.xsd.

  • TextField: A TextField allows users to input the value of a property as a line of text e.g. a project name, an author name or version number.

  • MultiLineTextField: A MultilineTextField allows users to input the value of a property as a paragraph of text e.g. a project description.

  • RichTextField: A RichTextField allows users to input the value of a property as a paragraph of text and edit the format of the text(e.g. text font, colors) and insert images in the text.

  • DurationField: A DurationField allows users to input the value of a property as a duration of time in minutes e.g. the duration of an activity in a meeting session.

  • ImageField: An ImageField allows users to input the value of a property as an image. This is often used to specify contribution icons.

  • BooleanField: A BooleanField allows users to input the value of a property in the form of binary values (Yes-No, True-False etc.). The field can be represented as RadioButton, CheckBox, or SingleSelectDropDown i.e. a Combo Box that supports selecting one item at a time.

  • PickListField: A PickListField allows users to specify a list of values for a property from a fixed set of values. The field can be represented as RadioButton, CheckBox, SingleSelectDropDown i.e. a Combo Box that supports selecting one item at a time, or MultiSelectDropDown i.e. a Combo Box that supports selecting multiple items at a time.

  • ColorPickerField: A ColorPickerField allows users to specify a certain color for a contribution. For example, we can specify the background color of a contribution by using ColorPickerField.