Deleting Content from Content Services (deprecated)

You can use the Document Management (Deprecated) Java or web service API to delete content from LiveCycle Content Services (deprecated). You can delete either spaces or files that are located in a space. A space is essentially a folder that stores content such as PDF or XML documents, images, audio, video, and so on. If you delete a space, all content located in the space is deleted.

When you delete a resource, the deletion is permanent. Therefore, when deleting a resource, ensure that you will not need that resource again. A common reason to delete a resource is to increase the available space. If you delete a space, everything in that space, including subfolders, is deleted.

Remarque : Access to Document Management service operations using APIs were added in LiveCycle ES2.5.

The web service quick starts that correspond to the Document Management service use the following WSDL:

http://localhost:8080/soap/services/DocumentManagementService?WSDL&lc_version=9.0.1

For more information about the Document Management service, see Services Reference for LiveCycle.

Remarque : Adobe is migrating Adobe® LiveCycle® Content Services ES customers to the Content Repository built on the modern, modular CRX architecture, acquired during the Adobe acquisition of Day Software. The Content Repository is provided with LiveCycle Foundation and is available as of the LiveCycle ES4 release.

Summary of steps

To delete content, follow these steps:

  1. Include project files.

  2. Create the service client.

  3. Specify the content to delete.

Include project files

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

Add the following JAR files to your project’s class path:

  • adobe-livecycle-client.jar

  • adobe-usermanager-client.jar

  • adobe-contentservices-client.jar

  • adobe-utilities.jar (required if LiveCycle is deployed on JBoss)

  • jbossall-client.jar (required if LiveCycle is deployed on JBoss)

Remarque : These JAR files are required if you are using the EJB connection mode. If you are using the SOAP connection mode, include additional JAR files.

Create the service client

Before you can programmatically delete content, establish a connection and provide credentials. This task is accomplished by creating a service client.

Specify the content to delete

Invoke the Document Management service’s deleteContent method to delete a space. Specify the name of the space to delete. Also specify the store name. The default value for this parameter is SpacesStore.

Delete Content Services (deprecated) content using the Java API

Delete content by using the Document Management API (Java):

  1. Include project files.

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

  2. Create the service client.

    • Create a ServiceClientFactory object that contains connection properties.

    • Create a DocumentManagementServiceClientImpl object by using its constructor and passing the ServiceClientFactory object.

  3. Specify the content to delete.

    Delete content by invoking the DocumentManagementServiceClientImpl object’s deleteContent method and passing the following values:

    • A string value that specifies the name of the store. You can specify SpacesStore for this parameter value. This value is a mandatory parameter.

    • A string value that specifies the fully qualified path of the space to delete (for example, /Company Home/Test Directory). This value is a mandatory parameter.

    The deleteContent method returns a Boolean value that specifies whether the content is deleted. That is, if the content is successfully deleted, the value true is returned.

Delete Content Services (deprecated) content using the web service API

Delete content by using the Document Management service API (web service):

  1. Include project files.

    Create a Microsoft .NET project that uses MTOM. Ensure that you use the following WSDL definition: http://localhost:8080/soap/services/DocumentManagementService?WSDL&lc_version=9.0.1.

    Remarque : Replace localhost with the IP address of the server hosting LiveCycle.
  2. Create the service client.

    • Create a DocumentManagementServiceClient object by using its default constructor.

    • Create a DocumentManagementServiceClient.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/DocumentManagementService?WSDL). You do not need to use the lc_version attribute. This attribute is used when you create a service reference.)

    • Create a System.ServiceModel.BasicHttpBinding object by getting the value of the DocumentManagementServiceClient.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 LiveCycle user name to the field DocumentManagementServiceClient.ClientCredentials.UserName.UserName.

      • Assign the corresponding password value to the field DocumentManagementServiceClient.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 content to delete.

    Delete a space by invoking the DocumentManagementServiceClient object’s deleteContent method and passing the following values:

    • A string value that specifies the name of the store where the space is created. You can specify SpacesStore for this parameter value.

    • A string value that specifies the fully qualified path of the space to delete (for example, /Company Home/Test Directory).

    The deleteContent method returns a Boolean value that specifies whether the content is deleted. That is, if the content is successfully deleted, the value true is returned.