Deleting Users

You can use the Directory Manager Service API (Java and web service) to programmatically delete users from LiveCycle. After you delete a user, the user can no longer be used to perform a service operation that requires a user. For example, you cannot assign a task to a deleted user. (See Assigning Tasks .)

Summary of steps

To delete a user, perform the following steps:

  1. Include project files.

  2. Create a DirectoryManagerService client.

  3. Specify the user to delete.

  4. Delete the user from LiveCycle.

Include project files

Include necessary files in your development project. If you are creating a client application by using Java, include the necessary JAR files. If you are using web services, include the proxy files.

Create a DirectoryManagerService client

Before you can programmatically perform a Directory Manager Service API operation, create a Directory Manager service client.

Specify the user to delete

You can specify a user to delete by using the user’s identifier value.

Delete the user from LiveCycle

To delete a user, invoke the DirectoryManagerServiceClient object’s deleteLocalUser method.

Delete users using the Java API

Delete users by using the Directory Manager Service API (Java):

  1. Include project files.

    Include client JAR files, such as adobe-usermanager-client.jar, in your Java project’s class path.

  2. Create a DirectoryManagerService client.

    Create a DirectoryManagerServiceClient object by using its constructor and passing a ServiceClientFactory object that contains connection properties.

  3. Specify the user to delete.

    • Create a PrincipalSearchFilter object by using its constructor.

    • Set the user identifier value by invoking the PrincipalSearchFilter object’s setUserId method. Pass a string value that represents the user identifier value.

    • Invoke the DirectoryManagerServiceClient object’s findPrincipals method and pass the PrincipalSearchFilter object. This method returns a java.util.List instance, where each element is a User object. Iterate through the java.util.List instance to locate the user to delete.

  4. Delete the user from LiveCycle.

    Invoke the DirectoryManagerServiceClient object’s deleteLocalUser method and pass the value of the User object’s oid field. Invoke the User object’s getOid method. Use the User object retrieved from the java.util.List instance.

Delete users using the web service API

Delete users by using the Directory Manager Service API (web service):

  1. Include project files.

    Include client JAR files, such as adobe-usermanager-client.jar, in your Java project’s class path.

  2. Create a DirectoryManagerService client.

    • Create a DirectoryManagerServiceClient object by using its default constructor.

    • Create a DirectoryManagerServiceClient.Endpoint.Address object by using the System.ServiceModel.EndpointAddress constructor. Pass a string value that specifies the WSDL to the LiveCycle service (for example, http://localhost:8080/soap/services/DirectoryManagerService?blob=mtom ). You do not need to use the lc_version attribute. This attribute is used when you create a service reference. Ensure that you specify blob=mtom.

    • Create a System.ServiceModel.BasicHttpBinding object by getting the value of the DirectoryManagerServiceClient.Endpoint.Binding field. Cast the return value to BasicHttpBinding .

    • Set the System.ServiceModel.BasicHttpBinding object’s MessageEncoding field to WSMessageEncoding.Mtom . This value ensures that MTOM is used.

    • Enable basic HTTP authentication by performing the following tasks:

      • Assign the AEM forms user name to the field DirectoryManagerServiceClient.ClientCredentials.UserName.UserName .

      • Assign the corresponding password value to the field DirectoryManagerServiceClient.ClientCredentials.UserName.Password .

      • Assign the constant value HttpClientCredentialType.Basic to the field BasicHttpBindingSecurity.Transport.ClientCredentialType .

      • Assign the constant value BasicHttpSecurityMode.TransportCredentialOnly to the field BasicHttpBindingSecurity.Security.Mode .

  3. Specify the user to delete.

    • Create a PrincipalSearchFilter object by using its constructor.

    • Set the user identifier value by assigning a string value to the PrincipalSearchFilter object’s userId field.

    • Invoke the DirectoryManagerServiceClient object’s findPrincipals method and pass the PrincipalSearchFilter object. This method returns a MyArrayOfUser collection object, where each element is a User object. Iterate through the MyArrayOfUser collection to locate the user. The User object retrieved from the MyArrayOfUser collection object is used to delete the user.

  4. Delete the user from LiveCycle.

    Delete the user by passing the User object’s oid field value to the DirectoryManagerServiceClient object’s deleteLocalUser method.

// Ethnio survey code removed