Creating Content Services (deprecated) Associations

You can programmatically create associations between content by using the Java API or web service API. For example, consider the files shown in this illustration.

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.

The illustration shows an association between a PDF form named MortgageForm.pdf and an XML file named Loan.xml. The XML file represents form data that is used to populate the form with data. There are three kinds of associations:

  • linkedBy: An association between an XML data file and a PDF form. The XML file must have the aspect linkable applied to it. This association is a many-to-one association, which means that multiple data files can be associated with the same PDF form.

  • linkedTo: An association between two PDF documents. The source document must have the aspect PDFToPDFLink applied to it. This association is a many-to-one association, which means that two or more documents can be linked together.

  • linkedToXML: An association between an XDP Document attachment and the XDP data XML file. The attachment must have the aspect xdpAttachment applied to it. This association is a many-to-one association, which means that multiple XDP Document attachments can be associated with a single XML file.

Remarque : Access to Document Management service operations using APIs was added in LiveCycle.

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

Summary of steps

To create an association between content, follow these steps:

  1. Include project files.

  2. Create the service client.

  3. Set the required aspect values.

  4. Define the association.

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 create associations, establish a connection and provide credentials. This task is accomplished by creating a service client.

Set the required aspect values

When creating an association, ensure that the proper aspect is set. The required aspect is dependent on the type of association. That is, if you create a linkedBy association, ensure that the source document contains a linkable aspect. The following example shows a linkable aspect:

{http://www.adobe.com/lc/datacapture/1.0}linkable

If you are creating a linkedTo association, ensure that the source document contains a PDFToPDFLink aspect. A PDFToPDFLink aspect is expressed as:

{http://www.adobe.com/lc/datacapture/1.0}PDFToPDFLink

If you are creating a linkedToXML association, ensure that the source document contains a PDFToPDFLink aspect. A PDFToPDFLink aspect is expressed as:

{http://www.adobe.com/lc/nativereference/1.0}xdpAttachment

You can obtain all applicable aspect values by using the Document Management’s getAspectsList method.

Define the association

After you set the required aspect value, you can define the association between content. When defining content, specify the parent content, child content, aspect values, and attributes. The corresponding quick starts demonstrate how to set the description attribute.

Create Content Services (deprecated) associations using the Java API

Create an association between content by using the Document Management Service API (Java) (Deprecated):

  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 Java connection properties.

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

  3. Set the required aspect values.

    • Create a java.util.List object by using the ArrayList constructor. The java.util.List object is used to store aspect values.

    • Invoke the java.util.List object’s add method and pass a string value that specifies the aspect value. For example, if you are creating a linkedBy association, pass {http://www.adobe.com/lc/datacapture/1.0}linkable.

    • Invoke the DocumentManagementServiceClientImpl object’s setContentAttributes method and pass the following values:

      • A string value that specifies the store where the content is added. The default store is SpacesStore. This value is a mandatory parameter.

      • A string value that specifies the fully qualified path to the content (for example, /Company Home/MortgageForm.pdf). This value is a mandatory parameter.

      • The java.util.List object that contains the aspect value.

    • A java.util.Map object that contains content attributes.

    Remarque : For information about using the java.util.Map object to set content attributes, see Adding Content to Content Services (deprecated).
  4. Define the association.

    Invoke the DocumentManagementServiceClientImpl object’s createAssociation method and pass the following arguments:

    • A string value that specifies the store where the content is added. The default store is SpacesStore. This value is a mandatory parameter.

    • A string value that specifies the association type. To create a linkedBy association, pass {http://www.adobe.com/lc/datacapture/1.0}linkable. This value is a mandatory parameter.

    • A string value that specifies the fully qualified path to the parent content. For example, if you create a linkedBy association, specify the path to the PDF document. This value is a mandatory parameter.

    • A string value that specifies the fully qualified path to the child content. For example, if you create a linkedBy association, specify the path to the XML document. This value is a mandatory parameter.

Create Content Services (deprecated) associations using the web service API

Create an association between content by using the Document Management Service API (web service) (Deprecated):

  1. Include project files.

    Create a Microsoft .NET client project that uses MTOM and consumes the Document Management WSDL.

  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, such as http://localhost:8080/soap/services/DocumentManagementService. 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 using 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. Set the required aspect values.

    • Create a MyArrayOf_xsd_string object by using its constructor. The MyArrayOf_xsd_string object is used to store aspect values.

    • Invoke the MyArrayOf_xsd_string object’s Add method and pass a string value that specifies the aspect value. For example, if you are creating a linkedBy association, pass {http://www.adobe.com/lc/datacapture/1.0}linkable.

    • Invoke the DocumentManagementServiceClient object’s setContentAttributesAPI method and pass the following values:

      • A string value that specifies the store where the content is added. The default store is SpacesStore. This value is a mandatory parameter.

      • A string value that specifies the fully qualified path to the content (for example, /Company Home/MortgageForm.pdf). This value is a mandatory parameter.

      • The MyArrayOf_xsd_string object that contains the aspect value.

    • A MyMapOf_xsd_string_To_xsd_anyType object that contains content attributes.

    Remarque : For information about using the MyMapOf_xsd_string_To_xsd_anyType object to set content attributes, see Adding Content to Content Services (deprecated).
  4. Define the association.

    Invoke the DocumentManagementServiceClient object’s createAssociation method and pass the following arguments:

    • A string value that specifies the store where the content is added. The default store is SpacesStore. This value is a mandatory parameter.

    • A string value that specifies the association type. To create a linkedBy association, pass {http://www.adobe.com/lc/datacapture/1.0}linkable. This value is a mandatory parameter.

    • A string value that specifies the fully qualified path to the parent content. For example, if you create a linkedBy association, specify the path to the PDF document. This value is a mandatory parameter.

    • A string value that specifies the fully qualified path to the child content. For example, if you create a linkedBy association, specify the path to the XML document. This value is a mandatory parameter.