In general, registry objects can be related to each other via associations. An association belongs to a specified association type. CentraSite supports predefined association types, such as "HasParent" and "Uses"; in addition, you can create custom association types.
In CentraSite, an association type is uniquely identified by its value (for example: "HasParent", "Uses", etc.). The value is specified when the association type is created; it cannot be subsequently modified.
An association type can optionally have one or more locale-specific display names. If no locale-specific display names are specified, the association type's value is used by default.
Each association type has a forward label; this is shown, for example, when a corresponding association is displayed by the impact analysis. See the section Impact Analysis in the document Using the Asset Catalog for related information.
You can optionally specify a backward label. Multiple association types can share forward and/or backward labels.
The CentraSite Application Framework type management feature provides methods for creating, updating, deleting and finding association types. For details of the methods, please refer to the Javadoc.
//Get a sessionContext instance SessionContext sessionContext = initSessionContext(); // Get a TypeManager instance from sessionContext TypeManager tm = sessionContext.getTypeManager(); AssociationType at = tm.createAssociationType("MyAssociationType", "MyDisplayName", "MyForwardLabel", "MyBackwardLabel", Locale.EN); tm.saveAssociationType(at); // find an association type by its value AssociationType myAssociationType = tm.getAssociationType("MyAssociationType"); // find an association type by its display name myAssociationType = tm.getAssociationTypeByName("MyDisplayName"); // add a display name with a different locale myAssociationType.setName("MonNom", Locale.FRENCH); tm.saveAssociationType(myAssociationType); // delete an association type tm.deleteAsssociationType(myAssociationType);