From db96af145ee58bc2e3f50a5835699428e2dbe4eb Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Mon, 31 May 2010 12:53:45 +0000
Subject: [PATCH] Use cn as naming attribute for the WorkFlow and WorkFlowElements like other objects in OpenDS configuration

---
 opendj-sdk/opends/src/server/org/opends/server/workflowelement/ndb/NDBWorkflowElement.java                   |    5 +-
 opendj-sdk/opends/src/server/org/opends/server/core/WorkflowConfigManager.java                               |    5 +-
 opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/WorkflowConfiguration.xml                       |   19 ---------
 opendj-sdk/opends/src/server/org/opends/server/workflowelement/WorkflowElementConfigManager.java             |    7 ++-
 opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/WorkflowElementConfiguration.xml                |   29 +-------------
 opendj-sdk/opends/src/admin/messages/WorkflowElementCfgDefn.properties                                       |    2 -
 opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java |    5 +-
 opendj-sdk/opends/src/admin/messages/WorkflowCfgDefn.properties                                              |    2 -
 opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/RootConfiguration.xml                           |    6 +-
 opendj-sdk/opends/src/admin/messages/LocalBackendWorkflowElementCfgDefn.properties                           |    2 -
 opendj-sdk/opends/resource/schema/02-config.ldif                                                             |   14 +------
 11 files changed, 20 insertions(+), 76 deletions(-)

diff --git a/opendj-sdk/opends/resource/schema/02-config.ldif b/opendj-sdk/opends/resource/schema/02-config.ldif
index 74d324c..e2b0d79 100644
--- a/opendj-sdk/opends/resource/schema/02-config.ldif
+++ b/opendj-sdk/opends/resource/schema/02-config.ldif
@@ -2124,20 +2124,10 @@
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
   SINGLE-VALUE
   X-ORIGIN 'OpenDS Directory Server' )
-attributeTypes: ( 1.3.6.1.4.1.26027.1.1.436
-  NAME 'ds-cfg-workflow-id'
-  SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
-  SINGLE-VALUE
-  X-ORIGIN 'OpenDS Directory Server' )
 attributeTypes: ( 1.3.6.1.4.1.26027.1.1.437
   NAME 'ds-cfg-workflow'
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.12
   X-ORIGIN 'OpenDS Directory Server' )
-attributeTypes: ( 1.3.6.1.4.1.26027.1.1.438
-  NAME 'ds-cfg-workflow-element-id'
-  SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
-  SINGLE-VALUE
-  X-ORIGIN 'OpenDS Directory Server' )
 attributeTypes: ( 1.3.6.1.4.1.26027.1.1.439
   NAME 'ds-cfg-workflow-element'
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
@@ -3983,7 +3973,7 @@
   NAME 'ds-cfg-workflow'
   SUP top
   STRUCTURAL
-  MUST ( ds-cfg-workflow-id $
+  MUST ( cn $
          ds-cfg-enabled $
          ds-cfg-workflow-element $
          ds-cfg-base-dn )
@@ -3992,7 +3982,7 @@
   NAME 'ds-cfg-workflow-element'
   SUP top
   STRUCTURAL
-  MUST ( ds-cfg-workflow-element-id $
+  MUST ( cn $
          ds-cfg-enabled $
          ds-cfg-java-class )
   X-ORIGIN 'OpenDS Directory Server' )
diff --git a/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/RootConfiguration.xml b/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/RootConfiguration.xml
index 5f6250d..05f8a1f 100644
--- a/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/RootConfiguration.xml
+++ b/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/RootConfiguration.xml
@@ -23,7 +23,7 @@
   ! CDDL HEADER END
   !
   !
-  !      Copyright 2007-2009 Sun Microsystems, Inc.
+  !      Copyright 2007-2010 Sun Microsystems, Inc.
   ! -->
 <adm:root-managed-object xmlns:adm="http://www.opends.org/admin"
   xmlns:ldap="http://www.opends.org/admin-ldap"
@@ -429,7 +429,7 @@
     </adm:profile>
   </adm:relation>
   <adm:relation name="workflow">
-    <adm:one-to-many naming-property="workflow-id" />
+    <adm:one-to-many />
     <adm:profile name="ldap">
       <ldap:rdn-sequence>cn=Workflows,cn=config</ldap:rdn-sequence>
     </adm:profile>
@@ -440,7 +440,7 @@
     </adm:profile>
   </adm:relation>
   <adm:relation name="workflow-element">
-    <adm:one-to-many naming-property="workflow-element-id" />
+    <adm:one-to-many />
     <adm:profile name="ldap">
       <ldap:rdn-sequence>
         cn=Workflow elements,cn=config
diff --git a/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/WorkflowConfiguration.xml b/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/WorkflowConfiguration.xml
index 45df51f..4ea43b2 100644
--- a/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/WorkflowConfiguration.xml
+++ b/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/WorkflowConfiguration.xml
@@ -63,25 +63,6 @@
       </ldap:attribute>
     </adm:profile>
   </adm:property>
-  <adm:property name="workflow-id" mandatory="true" read-only="true">
-    <adm:synopsis>
-      Provides a name that identifies the
-      <adm:user-friendly-name />.
-    </adm:synopsis>
-    <adm:description>
-      The name must be unique among all
-      <adm:user-friendly-plural-name />
-      in the server.
-    </adm:description>
-    <adm:syntax>
-      <adm:string />
-    </adm:syntax>
-    <adm:profile name="ldap">
-      <ldap:attribute>
-        <ldap:name>ds-cfg-workflow-id</ldap:name>
-      </ldap:attribute>
-    </adm:profile>
-  </adm:property>
   <adm:property name="workflow-element" mandatory="true">
     <adm:synopsis>
       Specifies the root Workflow Element in the
diff --git a/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/WorkflowElementConfiguration.xml b/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/WorkflowElementConfiguration.xml
index 89f0ce0..66544cb 100644
--- a/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/WorkflowElementConfiguration.xml
+++ b/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/WorkflowElementConfiguration.xml
@@ -23,13 +23,12 @@
   ! CDDL HEADER END
   !
   !
-  !      Copyright 2007-2008 Sun Microsystems, Inc.
+  !      Copyright 2007-2010 Sun Microsystems, Inc.
   ! -->
 <adm:managed-object name="workflow-element"
   plural-name="workflow-elements" package="org.opends.server.admin.std"
   xmlns:adm="http://www.opends.org/admin"
-  xmlns:ldap="http://www.opends.org/admin-ldap"
-  xmlns:cli="http://www.opends.org/admin-cli">
+  xmlns:ldap="http://www.opends.org/admin-ldap">
   <adm:synopsis>
     <adm:user-friendly-plural-name />
     implement a single processing step in a Work Flow.
@@ -51,9 +50,6 @@
       <ldap:superior>top</ldap:superior>
     </ldap:object-class>
   </adm:profile>
-  <adm:profile name="cli">
-    <cli:managed-object custom="true" />
-  </adm:profile>
   <adm:property name="enabled" mandatory="true">
     <adm:synopsis>
       Indicates whether the
@@ -75,27 +71,6 @@
       </ldap:attribute>
     </adm:profile>
   </adm:property>
-  <adm:property name="workflow-element-id" mandatory="true"
-    read-only="true">
-    <adm:synopsis>
-      Provides a name that identifies the associated
-      <adm:user-friendly-name />
-      .
-    </adm:synopsis>
-    <adm:description>
-      The name must be unique among all
-      <adm:user-friendly-plural-name />
-      in the server.
-    </adm:description>
-    <adm:syntax>
-      <adm:string />
-    </adm:syntax>
-    <adm:profile name="ldap">
-      <ldap:attribute>
-        <ldap:name>ds-cfg-workflow-element-id</ldap:name>
-      </ldap:attribute>
-    </adm:profile>
-  </adm:property>
   <adm:property name="java-class" mandatory="true">
     <adm:synopsis>
       Specifies the fully-qualified name of the Java class that provides the
diff --git a/opendj-sdk/opends/src/admin/messages/LocalBackendWorkflowElementCfgDefn.properties b/opendj-sdk/opends/src/admin/messages/LocalBackendWorkflowElementCfgDefn.properties
index 14847f5..4a51ffa 100644
--- a/opendj-sdk/opends/src/admin/messages/LocalBackendWorkflowElementCfgDefn.properties
+++ b/opendj-sdk/opends/src/admin/messages/LocalBackendWorkflowElementCfgDefn.properties
@@ -5,5 +5,3 @@
 property.enabled.synopsis=Indicates whether the Local Backend Workflow Element is enabled for use in the server.
 property.enabled.description=If a Local Backend Workflow Element is not enabled, then its contents are not accessible when processing operations.
 property.java-class.synopsis=Specifies the fully-qualified name of the Java class that provides the Local Backend Workflow Element implementation.
-property.workflow-element-id.synopsis=Provides a name that identifies the associated Local Backend Workflow Element .
-property.workflow-element-id.description=The name must be unique among all Local Backend Workflow Elements in the server.
diff --git a/opendj-sdk/opends/src/admin/messages/WorkflowCfgDefn.properties b/opendj-sdk/opends/src/admin/messages/WorkflowCfgDefn.properties
index ba5730c..117be33 100644
--- a/opendj-sdk/opends/src/admin/messages/WorkflowCfgDefn.properties
+++ b/opendj-sdk/opends/src/admin/messages/WorkflowCfgDefn.properties
@@ -6,5 +6,3 @@
 property.enabled.description=If a Workflow is not enabled, then its contents are not accessible when processing operations.
 property.workflow-element.synopsis=Specifies the root Workflow Element in the Workflow .
 property.workflow-element.syntax.aggregation.constraint-synopsis=The referenced workflow element must be enabled.
-property.workflow-id.synopsis=Provides a name that identifies the Workflow.
-property.workflow-id.description=The name must be unique among all Workflows in the server.
diff --git a/opendj-sdk/opends/src/admin/messages/WorkflowElementCfgDefn.properties b/opendj-sdk/opends/src/admin/messages/WorkflowElementCfgDefn.properties
index 2904e2e..b4a493f 100644
--- a/opendj-sdk/opends/src/admin/messages/WorkflowElementCfgDefn.properties
+++ b/opendj-sdk/opends/src/admin/messages/WorkflowElementCfgDefn.properties
@@ -5,5 +5,3 @@
 property.enabled.synopsis=Indicates whether the Workflow Element is enabled for use in the server.
 property.enabled.description=If a Workflow Element is not enabled, then its contents are not accessible when processing operations.
 property.java-class.synopsis=Specifies the fully-qualified name of the Java class that provides the Workflow Element implementation.
-property.workflow-element-id.synopsis=Provides a name that identifies the associated Workflow Element .
-property.workflow-element-id.description=The name must be unique among all Workflow Elements in the server.
diff --git a/opendj-sdk/opends/src/server/org/opends/server/core/WorkflowConfigManager.java b/opendj-sdk/opends/src/server/org/opends/server/core/WorkflowConfigManager.java
index 0b30de4..9fd0cdd 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/core/WorkflowConfigManager.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/core/WorkflowConfigManager.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2007-2008 Sun Microsystems, Inc.
+ *      Copyright 2007-2010 Sun Microsystems, Inc.
  */
 package org.opends.server.core;
 
@@ -348,7 +348,8 @@
       ) throws DirectoryException
   {
     // The ID of the workflow to create
-    String workflowId = workflowCfg.getWorkflowId();
+    String workflowId =
+        workflowCfg.dn().getRDN().getAttributeValue(0).toString();
 
     // Create the root workflow element to associate with the workflow
     String rootWorkflowElementID = workflowCfg.getWorkflowElement();
diff --git a/opendj-sdk/opends/src/server/org/opends/server/workflowelement/WorkflowElementConfigManager.java b/opendj-sdk/opends/src/server/org/opends/server/workflowelement/WorkflowElementConfigManager.java
index 5ae20fe..2b15153 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/workflowelement/WorkflowElementConfigManager.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/workflowelement/WorkflowElementConfigManager.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2007-2009 Sun Microsystems, Inc.
+ *      Copyright 2007-2010 Sun Microsystems, Inc.
  */
 package org.opends.server.workflowelement;
 
@@ -238,7 +238,7 @@
 
     WorkflowElement<?> workflowElement =
             DirectoryServer.getWorkflowElement(
-            configuration.getWorkflowElementId());
+            configuration.dn().getRDN().getAttributeValue(0).toString());
     if (workflowElement != null)
     {
       // Notify to observers that the workflow element is now disabled
@@ -303,7 +303,8 @@
 
     // Get the existing workflow element if it's already enabled.
     WorkflowElement<?> existingWorkflowElement =
-      DirectoryServer.getWorkflowElement(configuration.getWorkflowElementId());
+      DirectoryServer.getWorkflowElement(
+      configuration.dn().getRDN().getAttributeValue(0).toString());
 
     // If the new configuration has the workflow element disabled,
     // then disable it if it is enabled, or do nothing if it's already disabled.
diff --git a/opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java b/opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
index f3b7bbd..6c5d318 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2008-2009 Sun Microsystems, Inc.
+ *      Copyright 2008-2010 Sun Microsystems, Inc.
  */
 package org.opends.server.workflowelement.localbackend;
 
@@ -248,7 +248,8 @@
       if (applyChanges)
       {
         super.initialize(
-          configuration.getWorkflowElementId(), BACKEND_WORKFLOW_ELEMENT);
+          configuration.dn().getRDN().getAttributeValue(0).toString(),
+          BACKEND_WORKFLOW_ELEMENT);
         backend = newBackend;
         if (backend != null)
         {
diff --git a/opendj-sdk/opends/src/server/org/opends/server/workflowelement/ndb/NDBWorkflowElement.java b/opendj-sdk/opends/src/server/org/opends/server/workflowelement/ndb/NDBWorkflowElement.java
index 8110ee2..82171f7 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/workflowelement/ndb/NDBWorkflowElement.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/workflowelement/ndb/NDBWorkflowElement.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2008-2009 Sun Microsystems, Inc.
+ *      Copyright 2008-2010 Sun Microsystems, Inc.
  */
 package org.opends.server.workflowelement.ndb;
 
@@ -236,7 +236,8 @@
       if (applyChanges)
       {
         super.initialize(
-          configuration.getWorkflowElementId(), BACKEND_WORKFLOW_ELEMENT);
+          configuration.dn().getRDN().getAttributeValue(0).toString(),
+          BACKEND_WORKFLOW_ELEMENT);
         backend = newBackend;
       }
     }

--
Gitblit v1.10.0