mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

neil_a_wilson
30.04.2006 572fb271e9866c819a28b6bdcaf6f8db74814ff3
Update the LDIF export utility to provide a way to exclude operational
attributes from the export.

OpenDS Issue Number: 1046
3 files modified
40 ■■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/messages/ToolMessages.java 11 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/ExportLDIF.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/LDIFExportConfig.java 20 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/messages/ToolMessages.java
@@ -7466,6 +7466,15 @@
  /**
   * The message ID for the message that will be used as the description of the
   * excludeOperational argument.  This does not take any arguments.
   */
  public static final int MSGID_LDIFEXPORT_DESCRIPTION_EXCLUDE_OPERATIONAL =
       CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 785;
  /**
   * Associates a set of generic messages with the message IDs defined in this
   * class.
   */
@@ -7600,6 +7609,8 @@
    registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_EXCLUDE_FILTER,
                    "Filter to identify entries to exclude from the LDIF " +
                    "export");
    registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_EXCLUDE_OPERATIONAL,
                    "Exclude operational attributes from the LDIF export");
    registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_WRAP_COLUMN,
                    "Column at which to wrap long lines (0 for no wrapping)");
    registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_COMPRESS_LDIF,
opendj-sdk/opends/src/server/org/opends/server/tools/ExportLDIF.java
@@ -106,6 +106,7 @@
    BooleanArgument compressLDIF            = null;
    BooleanArgument displayUsage            = null;
    BooleanArgument encryptLDIF             = null;
    BooleanArgument excludeOperationalAttrs = null;
    BooleanArgument signHash                = null;
    IntegerArgument wrapColumn              = null;
    StringArgument  backendID               = null;
@@ -210,6 +211,12 @@
      argParser.addArgument(excludeFilterStrings);
      excludeOperationalAttrs =
           new BooleanArgument("excludeoperational", 'O', "excludeOperational",
                    MSGID_LDIFEXPORT_DESCRIPTION_EXCLUDE_OPERATIONAL);
      argParser.addArgument(excludeOperationalAttrs);
      wrapColumn =
           new IntegerArgument("wrapcolumn", 'w', "wrapColumn", false, false,
                               true, "{wrapColumn}", 0, null, true, 0, false, 0,
@@ -714,6 +721,8 @@
    exportConfig.setIncludeBranches(includeBranches);
    exportConfig.setIncludeFilters(includeFilters);
    exportConfig.setSignHash(signHash.isPresent());
    exportConfig.setIncludeOperationalAttributes(
                      (! excludeOperationalAttrs.isPresent()));
    // FIXME -- Should this be conditional?
    exportConfig.setInvokeExportPlugins(true);
opendj-sdk/opends/src/server/org/opends/server/types/LDIFExportConfig.java
@@ -636,6 +636,26 @@
  /**
   * Specifies whether the set of operational attributes should be
   * included in the export.
   *
   * @param  includeOperationalAttributes  Specifies whether the set
   *                                       of operational attributes
   *                                       should be included in the
   *                                       export.
   */
  public void setIncludeOperationalAttributes(
                   boolean includeOperationalAttributes)
  {
    assert debugEnter(CLASS_NAME, "setIncludeOperationalAttributes",
                      String.valueOf(includeOperationalAttributes));
    this.includeOperationalAttributes = includeOperationalAttributes;
  }
  /**
   * Retrieves the set of attributes that should be excluded from the
   * entries written to LDIF.  The set that is returned may be altered
   * by the caller.