protected Map setupIdToLabelMap(String metatype_pid,
MetaTypeProvider provider) {
Map idToLabelMap = new HashMap();
if (provider != null) {
ObjectClassDefinition ocd = null;
try {
ocd = provider.getObjectClassDefinition(metatype_pid, null);
if (ocd != null) {
AttributeDefinition[] attr = ocd
.getAttributeDefinitions(ObjectClassDefinition.ALL);
for (int i = 0; i < attr.length; i++) {
String id = attr[i].getID();
String label = attr[i].getName();