| | |
| | | package org.opends.guitools.controlpanel.ui; |
| | | |
| | | import static org.forgerock.opendj.ldap.schema.CoreSchema.*; |
| | | import static org.forgerock.opendj.ldap.schema.SchemaValidationPolicy.*; |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | | |
| | | import java.awt.Component; |
| | |
| | | import java.awt.event.ActionEvent; |
| | | import java.awt.event.ActionListener; |
| | | import java.io.IOException; |
| | | import java.io.StringReader; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Comparator; |
| | |
| | | import org.forgerock.opendj.ldap.RDN; |
| | | import org.forgerock.opendj.ldap.schema.AttributeType; |
| | | import org.forgerock.opendj.ldap.schema.ObjectClass; |
| | | import org.forgerock.opendj.ldif.LDIFEntryReader; |
| | | import org.opends.guitools.controlpanel.datamodel.BinaryValue; |
| | | import org.opends.guitools.controlpanel.datamodel.ObjectClassValue; |
| | | import org.opends.guitools.controlpanel.datamodel.SortableTableModel; |
| | |
| | | import org.opends.guitools.controlpanel.ui.renderer.AttributeCellEditor; |
| | | import org.opends.guitools.controlpanel.ui.renderer.LDAPEntryTableCellRenderer; |
| | | import org.opends.guitools.controlpanel.util.Utilities; |
| | | import org.opends.server.types.LDIFImportConfig; |
| | | import org.opends.server.types.OpenDsException; |
| | | import org.opends.server.types.Schema; |
| | | import org.opends.server.util.LDIFReader; |
| | | import org.opends.server.util.ServerConstants; |
| | | |
| | | /** The panel displaying a table view of an LDAP entry. */ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public org.opends.server.types.Entry getEntry() throws OpenDsException |
| | | public Entry getEntry() throws OpenDsException |
| | | { |
| | | if (SwingUtilities.isEventDispatchThread()) |
| | | { |
| | |
| | | } |
| | | } |
| | | String ldif = getLDIF(); |
| | | try (LDIFImportConfig ldifImportConfig = new LDIFImportConfig(new StringReader(ldif)); |
| | | LDIFReader reader = new LDIFReader(ldifImportConfig)) |
| | | try (LDIFEntryReader reader = new LDIFEntryReader(ldif) |
| | | .setSchemaValidationPolicy(checkSchema() ? defaultPolicy() : ignoreAll())) |
| | | { |
| | | org.opends.server.types.Entry entry = reader.readEntry(checkSchema()); |
| | | Entry entry = reader.readEntry(); |
| | | addValuesInRDN(entry); |
| | | return entry; |
| | | } |