| | |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | | |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | |
| | | import org.opends.guitools.controlpanel.util.Utilities; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.opends.server.schema.SchemaConstants; |
| | | import org.opends.server.types.*; |
| | | import org.opends.server.util.Base64; |
| | |
| | | RDN rdn = oldDN.rdn(); |
| | | List<AttributeType> attributeTypes = new ArrayList<AttributeType>(); |
| | | List<String> attributeNames = new ArrayList<String>(); |
| | | List<AttributeValue> attributeValues = new ArrayList<AttributeValue>(); |
| | | List<ByteString> attributeValues = new ArrayList<ByteString>(); |
| | | for (int i=0; i<rdn.getNumValues(); i++) |
| | | { |
| | | String attrName = rdn.getAttributeName(i); |
| | | AttributeValue value = rdn.getAttributeValue(i); |
| | | |
| | | String sValue = value.getValue().toString(); |
| | | ByteString value = rdn.getAttributeValue(i); |
| | | |
| | | List<String> values = getDisplayedStringValues(attrName); |
| | | if (!values.contains(sValue)) |
| | | if (!values.contains(value.toString())) |
| | | { |
| | | if (values.size() > 0) |
| | | { |
| | |
| | | AttributeType attr = rdn.getAttributeType(i); |
| | | attributeTypes.add(attr); |
| | | attributeNames.add(rdn.getAttributeName(i)); |
| | | attributeValues.add(AttributeValues.create( |
| | | attr, firstNonEmpty)); |
| | | attributeValues.add(ByteString.valueOf(firstNonEmpty)); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | attributeTypes.add(attr); |
| | | attributeNames.add(attrName); |
| | | attributeValues.add( |
| | | AttributeValues.create(attr, (String)o)); |
| | | attributeValues.add(ByteString.valueOf((String) o)); |
| | | } |
| | | break; |
| | | } |