Hi at all.
We are trying to retrieve an object's categories' values which can be set in the objects category tab. Unfortunately we are only getting some numbers like: 74380.4.3. Instead of these numbers we want to see the values which we have set at the object's category, e.g. a String like "My comment". What is needed to get these values of a category which is assigned to an object?
The code looks like that:
List<AttributeGroup> attGroups = otwsUtilities.getDocMan().getNode(34886).getMetadata().getAttributeGroups();
for(AttributeGroup attGroup : attGroups) { System.out.println("AttributeGroup Display Name: " + attGroup.getDisplayName()); System.out.println("AttributeGroup Type: " + attGroup.getType()); System.out.println("AttributeGroup Key: " + attGroup.getKey()); AttributeGroupDefinition attrGroupDef = otwsUtilities.getDocMan().getAttributeGroupDefinition(attGroup.getType(), attGroup.getKey()); List<Attribute> attributes = attrGroupDef.getAttributes(); for(Attribute attribute : attributes) { System.out.println("Attribute Key " + attribute.getKey()); System.out.println("Attribute Display Name " + attribute.getDisplayName()); System.out.println("Attribute Type " + attribute.getType()); } List<DataValue> values = attGroup.getValues(); for(DataValue value : values) { System.out.println("Value Description: " + value.getDescription()); System.out.println("Value Key: " + value.getKey()); } }
The output is:
AttributeGroup Display Name: testcatAttributeGroup Type: CategoryAttributeGroup Key: 74380.4Attribute Key 74380.4.2Attribute Display Name testcommentAttribute Type StringAttribute Key 74380.4.3Attribute Display Name testAttribute Type StringAttribute Key 74380.4.4Attribute Display Name AdresseAttribute Type SetValue Description: testcommentValue Key: 74380.4.2Value Description: testValue Key: 74380.4.3Value Description: AdresseValue Key: 74380.4.4
Thanks a lot.
Best regards,
Yves