128 |
128 |
orderedByTypesByBaseEntity = manager.getOrderedTypeDesignationSets();
|
129 |
129 |
TypeDesignationSet typeDesignationSet = orderedByTypesByBaseEntity.get(baseEntity);
|
130 |
130 |
|
131 |
|
TaggedTextBuilder workingsetBuilder = new TaggedTextBuilder();
|
|
131 |
TaggedTextBuilder taggedTextBuilder = new TaggedTextBuilder();
|
132 |
132 |
if(typeSetCount > 0){
|
133 |
|
workingsetBuilder.add(TagEnum.separator, TYPE_SEPARATOR);
|
|
133 |
taggedTextBuilder.add(TagEnum.separator, TYPE_SEPARATOR);
|
134 |
134 |
}else if (withStartingTypeLabel){
|
135 |
135 |
//TODO this is not really exact as we may want to handle specimen types and
|
136 |
136 |
//name types separately, but this is such a rare case (if at all) and
|
137 |
137 |
//increases complexity so it is not yet implemented
|
138 |
138 |
boolean isPlural = hasMultipleTypes(orderedByTypesByBaseEntity);
|
139 |
139 |
if(typeDesignationSet.getWorkingsetType().isSpecimenType()){
|
140 |
|
workingsetBuilder.add(TagEnum.label, (isPlural? "Types:": "Type:"));
|
|
140 |
taggedTextBuilder.add(TagEnum.label, (isPlural? "Types:": "Type:"));
|
141 |
141 |
} else if (typeDesignationSet.getWorkingsetType().isNameType()){
|
142 |
|
workingsetBuilder.add(TagEnum.label, (isPlural? "Nametypes:": "Nametype:"));
|
|
142 |
taggedTextBuilder.add(TagEnum.label, (isPlural? "Nametypes:": "Nametype:"));
|
143 |
143 |
} else {
|
144 |
144 |
//do nothing for now
|
145 |
145 |
}
|
... | ... | |
147 |
147 |
|
148 |
148 |
boolean hasExplicitBaseEntity = hasExplicitBaseEntity(baseEntity, typeDesignationSet);
|
149 |
149 |
if(hasExplicitBaseEntity && !entityLabel(baseEntity).isEmpty()){
|
150 |
|
workingsetBuilder.add(TagEnum.specimenOrObservation, entityLabel(baseEntity), baseEntity);
|
|
150 |
taggedTextBuilder.add(TagEnum.specimenOrObservation, entityLabel(baseEntity), baseEntity);
|
151 |
151 |
}
|
152 |
152 |
int typeStatusCount = 0;
|
153 |
153 |
if (withBrackets && hasExplicitBaseEntity){
|
154 |
|
workingsetBuilder.add(TagEnum.separator, TYPE_STATUS_PARENTHESIS_LEFT);
|
|
154 |
taggedTextBuilder.add(TagEnum.separator, TYPE_STATUS_PARENTHESIS_LEFT);
|
155 |
155 |
}
|
156 |
156 |
for(TypeDesignationStatusBase<?> typeStatus : typeDesignationSet.keySet()) {
|
157 |
|
typeStatusCount = buildTaggedTextForSingleTypeStatus(manager, workingsetBuilder,
|
|
157 |
typeStatusCount = buildTaggedTextForSingleTypeStatus(manager, taggedTextBuilder,
|
158 |
158 |
typeDesignationSet, typeStatusCount, typeStatus,
|
159 |
159 |
lastWsType, typeSetCount);
|
160 |
160 |
}
|
161 |
161 |
if (withBrackets && hasExplicitBaseEntity){
|
162 |
|
workingsetBuilder.add(TagEnum.separator, TYPE_STATUS_PARENTHESIS_RIGHT);
|
|
162 |
taggedTextBuilder.add(TagEnum.separator, TYPE_STATUS_PARENTHESIS_RIGHT);
|
163 |
163 |
}
|
164 |
|
typeDesignationSet.setRepresentation(workingsetBuilder.toString());
|
165 |
|
finalBuilder.addAll(workingsetBuilder);
|
|
164 |
typeDesignationSet.setRepresentation(taggedTextBuilder.toString());
|
|
165 |
finalBuilder.addAll(taggedTextBuilder);
|
166 |
166 |
return;
|
167 |
167 |
}
|
168 |
168 |
|
cleanup