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

Tim "Docteur" Caillot
26.12.2019 728eb3e9368b641832819b7c8687864a938dee4b
Added backwards compatibility with -a (#73)

* Added compatibility to -a

* Added comment on which arg also use a

* Added message to cli.properties for default add
5 files modified
35 ■■■■■ changed files
opendj-cli/src/main/java/com/forgerock/opendj/cli/ArgumentConstants.java 7 ●●●● patch | view | raw | blame | history
opendj-cli/src/main/java/com/forgerock/opendj/cli/CommonArguments.java 16 ●●●●● patch | view | raw | blame | history
opendj-cli/src/main/resources/com/forgerock/opendj/cli/cli.properties 1 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPModify.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/messages/org/opends/messages/tool.properties 4 ●●●● patch | view | raw | blame | history
opendj-cli/src/main/java/com/forgerock/opendj/cli/ArgumentConstants.java
@@ -205,7 +205,12 @@
    /** The value for the long option certNickname . */
    public static final String OPTION_LONG_CERT_NICKNAME = "certNickname";
    /** The value for the short option continueOnError . */
    /** The value for the short option defaultAdd . */
    public static final char OPTION_SHORT_DEFAULT_ADD = 'a';
    /** The value for the long option defaultAdd . */
    public static final String OPTION_LONG_DEFAULT_ADD = "defaultAdd";
  /** The value for the short option continueOnError . */
    public static final char OPTION_SHORT_CONTINUE_ON_ERROR = 'c';
    /** The value for the long option continueOnError . */
    public static final String OPTION_LONG_CONTINUE_ON_ERROR = "continueOnError";
opendj-cli/src/main/java/com/forgerock/opendj/cli/CommonArguments.java
@@ -143,6 +143,22 @@
    }
    /**
     * Returns the "Default Add" boolean argument. <br>
     * This is a legacy argument and exists for backwards compatibility.
     *
     * <br><i> N.B : the 'a' short option is also used by backupall, addBaseEntry.</i>
     * @return The "defaultAdd" argument.
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static BooleanArgument defaultAddArgument() throws ArgumentException {
        return BooleanArgument.builder(OPTION_LONG_DEFAULT_ADD)
                .shortIdentifier(OPTION_SHORT_DEFAULT_ADD)
                .description(INFO_DESCRIPTION_DEFAULT_ADD.get())
                .buildArgument();
    }
    /**
     * Returns the "control" string argument.
     *
     * @return The "control" argument.
opendj-cli/src/main/resources/com/forgerock/opendj/cli/cli.properties
@@ -134,6 +134,7 @@
 information
INFO_DESCRIPTION_CONTINUE_ON_ERROR=Continue processing even if there are \
 errors
INFO_DESCRIPTION_DEFAULT_ADD=Legacy argument for ForgeRock OpenDJ compatibility.
INFO_DESCRIPTION_USE_SSL=Use SSL for secure communication with the server
INFO_DESCRIPTION_START_TLS=Use StartTLS to secure communication with the \
 server
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPModify.java
@@ -263,6 +263,7 @@
        BooleanArgument continueOnError;
        BooleanArgument noop;
        BooleanArgument showUsage;
        BooleanArgument defaultAdd;
        StringArgument assertionFilter;
        StringArgument controlStr;
        StringArgument filename;
@@ -319,6 +320,12 @@
            continueOnError = continueOnErrorArgument();
            argParser.addArgument(continueOnError);
            /* Legacy argument in ForgeRock's OpenDJ to avoid failing when running older scripts.
            The current behaviour is the opposite of Forgerock (defaultAdd false),
            as we treat records with no changetype as add operations by default. */
            defaultAdd = defaultAddArgument();
            argParser.addArgument(defaultAdd);
            noop = noOpArgument();
            argParser.addArgument(noop);
opendj-server-legacy/src/messages/org/opends/messages/tool.properties
@@ -2592,7 +2592,7 @@
ERR_FILE_NOT_FULLY_READABLE_20015=Could not completely read file '%s'
SUPPLEMENT_DESCRIPTION_BACKEND_TOOL_SUBCMD_LIST_INDEX_STATUS_20016=\
  <xinclude:include href="variablelist-backendstat-index-status.xml" />
INFO_DESCRIPTION_DEFAULT_ADD_20017=Legacy argument for ForgeRock OpenDJ compatibility.
INFO_LDAP_CONN_PROMPT_SECURITY_LDAP=LDAP
INFO_LDAP_CONN_PROMPT_SECURITY_USE_SSL=LDAP with SSL
INFO_LDAP_CONN_PROMPT_SECURITY_USE_START_TLS=LDAP with StartTLS
@@ -2689,4 +2689,4 @@
INFO_UPGRADE_TASK_DELETE_SUBORDINATE_BASE_DN_FROM_ROOT_DSE=Removing subordinate-base-dn attribute from \
 Root DSE configuration
INFO_UPGRADE_TASK_ADD_SUBORDINATE_BASE_DN_TO_GLOBAL_CONFIG=Adding subordinate-base-dn attribute to \
 Global configuration
 Global configuration