CentraSite Documentation : CentraSite Administrator’s Guide : Object Type Management : Creating a New Type : Define Attributes for a Type : Defining a Computed Attribute : Implementation Guidelines for Java-Based Computed Attributes
Implementation Guidelines for Java-Based Computed Attributes
This section describes the Java interfaces and methods that you need to implement for a computed attribute.
Interfaces
Description
ComputedAttribute
This interface declares basic rendering methods for the user interface. It extends the ProfileAttribute interface.
boolean: isUsed(): returns true if this attribute is used by at least one instance of the corresponding asset type.
Collection: setValue(Collection): sets the value of this attribute.
AttributeDescriptor: getAttributeDescriptor(): returns the definition of this attribute.
String: getName(): returns the JAXR-based name of this attribute.
Collection: getValue(): returns the value of this attribute.
init(): adds the required parameters to the objects argument for attribute initialization.
Collection<Concept>: getTargetObjectTypes(): returns the appropriate target registry object of this attribute. This method will be used when the attribute is of the relationship data type.
Concept: getAssociationType(): returns the appropriate association type of this attribute. This method will be used when the attribute is of the relationship data type.
ClassificationScheme: getTaxonomy(): returns the appropriate classification scheme of this attribute. This method will be used when the attribute is of the classification data type.
ProfileAttribute
void: init(Collection<CentraSiteRegistryObject>, Locale)
Collection: getValue();
String: getAttributeKey();
AttributeDescriptor: getAttributeDescriptor();
AttributeDescriptor
This interface deals with the standard properties (isReadOnly(), is Required()...) for an attribute.
String: getDataType(): returns the data type of this attribute. This can be one of the supported standard types (xs:...), or one of the special types: File, RichText, Image (allows the specification of the image type).
Object: getDefaultValue(): returns the default value of this attribute.
String[]: getEnumValues():
int: getMaxLength(): returns the maximum length of this attribute.
String: getMaxOccurs(): returns whether the attribute can have multiple occurrences.
String: getMinOccurs(): returns whether the attribute is optional or required.
Object: getNativeAtribute(): returns the native attribute instance if the data type is not primitive, otherwise returns null.
int: getPrecision(): gets the precision for a number attribute.
String: getUnitLabel(): returns the slot's unit label.
boolean: hasDefaultValue(): returns whether this attribute has a default value.
boolean: isPrefix(): Returns true if the slot's unit label is a prefix, and false if it is a suffix.
boolean: isReadOnly(): returns whether this attribute is read-only.
boolean: isRequired(): returns whether this attribute is required.
Copyright © 2005-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback