// (even if the list not empty, it may contain only relations from
// hidden component)
boolean isReverseAggregPropsEmpty = true;
if (!reverseAggregProps.isEmpty()) {
for (AggregationPropertyDefinition agg : reverseAggregProps) {
AbstractManagedObjectDefinition fromMo =
agg.getManagedObjectDefinition();
@SuppressWarnings("unchecked")
Collection<RelationDefinition> rels =
fromMo.getAllReverseRelationDefinitions();
for (RelationDefinition rel : rels) {
if (rel.hasOption(RelationOption.HIDDEN)) {
continue;
}
isReverseAggregPropsEmpty = false;
}
}
}
//
// Relations FROM this component
//
if (!isCompRelsEmpty || !aggregProps.isEmpty()) {
heading3("Relations From this Component");
}
if (!isCompRelsEmpty) {
paragraph(
"The following components have a direct COMPOSITION relation FROM " +
mo.getUserFriendlyPluralName() + " :");
for ( RelationDefinition rel : compRels) {
if (rel.hasOption(RelationOption.HIDDEN)) {
continue;
}
beginList();
AbstractManagedObjectDefinition childRel = rel.getChildDefinition();
link(childRel.getUserFriendlyName().toString(), childRel.getName() +
".html");
endList();
}
}
if (!aggregProps.isEmpty()) {
paragraph(
"The following components have a direct AGGREGATION relation FROM " +
mo.getUserFriendlyPluralName() + " :");
TreeMap<String, AbstractManagedObjectDefinition> componentList =
new TreeMap<String, AbstractManagedObjectDefinition>();
for ( AggregationPropertyDefinition agg : aggregProps) {
RelationDefinition rel = agg.getRelationDefinition();
AbstractManagedObjectDefinition childRel = rel.getChildDefinition();
componentList.put(childRel.getName(), childRel);
}
for (AbstractManagedObjectDefinition component : componentList.values()) {
beginList();
link(component.getUserFriendlyName().toString(), component.getName() +
".html");
endList();
}
}
//
// Relations TO this component
//
if (!isReverseCompRelsEmpty || !isReverseAggregPropsEmpty) {
heading3("Relations To this Component");
}
if (!mo.getReverseRelationDefinitions().isEmpty()) {
if (!isReverseCompRelsEmpty) {
paragraph(
"The following components have a direct COMPOSITION relation TO " +
mo.getUserFriendlyPluralName() + " :");
for ( RelationDefinition rel : reverseCompRels) {
beginList();
AbstractManagedObjectDefinition childRel = rel.getParentDefinition();
link(childRel.getUserFriendlyName().toString(), childRel.getName() +
".html");
endList();
}
}
}
if (!isReverseAggregPropsEmpty) {
paragraph(
"The following components have a direct AGGREGATION relation TO " +
mo.getUserFriendlyPluralName() + " :");
TreeMap<String, AbstractManagedObjectDefinition> componentList =
new TreeMap<String, AbstractManagedObjectDefinition>();
for ( AggregationPropertyDefinition agg : reverseAggregProps) {
AbstractManagedObjectDefinition fromMo =
agg.getManagedObjectDefinition();
componentList.put(fromMo.getName(), fromMo);
}
for (AbstractManagedObjectDefinition component : componentList.values()) {
beginList();
link(component.getUserFriendlyName().toString(), component.getName() +
".html");