Designer 10.7 | Centrasite Eclipse UI Help | Concepts | Profiles | Computed Profiles | Defining a Computed Profile | Implementation guidelines for Java-based computed profiles
 
Implementation guidelines for Java-based computed profiles
This section describes the Java interfaces and methods that you need to implement for a computed profile.
Interfaces
Description
ComputedProfile
This interface declares basic rendering methods for the user interface.
void: init(java.lang.Object, Locale): with CentraSiteRegistryObject as a parameter where the necessary implementation is done and updateAsset() which would return a collection of registry object serves as a save hook.
boolean: canRenderUI(): This determines whether the rendering is based on the UI (true) or on the triples associated with the profile (false).
Collection: getAttributes(): returns a collection of ProfileAttribute and would be called only when canRenderUI() returns true.
Collection: updateAsset(): returns a collection of CentraSiteRegistryObject and would be called only when canRenderUI() returns true.
WebUIProfile
This interface is specific to the rendering for CentraSite Control. (Other rendering can be provided for e.g. Eclipse)
java.lang.Object: createProfileContent(): create the profile contents with XML content (in compliance with Application Designer).
ProfileAttribute
This interface deals with the standard UI rendering of the profile's attributes and allows defining the attributes as key value pairs. The rendering of each attribute will be the standard rendering for the corresponding datatype of the attribute.
AttributeDescriptor: getAttributeDescriptor(): returns the descriptor of the attribute.
String: getAttributeKey(): returns the key of the attribute.
String: getName(): returns the name of the attribute.
Collection: getValue(): returns the value of the attribute.
ComputedAttribute Line
This interface deals with the user-defined UI rendering of the profile's attributes. The UI rendering of the attributes will be determined by the coding of this interface.
void: buildUI(StringBuilder layout): This method is responsible for rendering the layout definition.
void: passivate(): This method is responsible for storing the values back to the object.
void: revert(): This method is to revert the changes.
AttributeDescriptor
This interface deals with the standard properties (isReadOnly(), is Required()...) for an attribute.
String: getMinOccurs(): returns the minimum allowed occurrences of this attribute.
String: getMaxOccurs(): returns the maximum allowed occurrences of this attribute.
boolean: isRequired(): returns whether this attribute is required.
boolean: isReadOnly(): returns whether this attribute is read-only.
boolean: hasDefaultValue(): returns whether this attribute has a default value.
Object: getDefaultValue(): returns the default value of this attribute.
int: getMaxLength(): returns the maximum length of this attribute.
String: getDataType(): returns the data type of this attribute.
Object: getNativeAtribute(): returns the native attribute instance if the data type is not primitive, otherwise returns null.
String[]: getEnumValues():
boolean: isPrefix(): returns whether this slot's unit label is a prefix or suffix value. Return true if the unit label is a prefix, false for suffix.
int getPrecision(): returns the precision for a number attribute.
String: getUnitLabel(): returns this slot's unit label. The label may be null.