You can programmatically search for content that is located
in LiveCycle Content Services (deprecated) by using the Java API.
For example, consider the PDF document shown in this illustration.
When you search for content, create a query statement that defines
search criteria. To create a query statement, use operators such
as the contains operator. For example, you can search for content
that contains the title Mortgage.
The web service quick starts that correspond to the Document
Management service (Deprecated) use the following WSDL:
http://localhost:8080/soap/services/DocumentManagementService?WSDL&lc_version=9.0.1
注意: 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 stepsTo search for content, follow these steps:
Include project files.
Create the service client.
Define the query statement.
Perform the search.
Retrieve the search results.
Include project filesInclude 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)
注意: 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 clientBefore you can programmatically retrieve
content, establish a connection and provide credentials. This task
is accomplished by creating a service client.
Define the query statementTo search for cotent, define a query
statement by using one of the following operators:
When you use web services
to search for conten, use a lucene query string. A lucene query string lets
you search Content Services (deprecated). For example, to search
for a PDF file named MortgageForm.pdf, specify the following lucene query
string.
@cm\\:name:\"MortgageForm\"
For
information about creating lucene query strings, see Apache Lucene -- Query Parser Syntax.
注意: When using the Java API to search for content,
use a QueryImpl object, instead of a lucene query
string.
Perform the searchAfter you define the query statement, you can
perform the search by using the Document Management service’s searchRepository method.
The results are returned in a com.adobe.livecycle.contentservices.client.ResultSet object.
Retrieve the search resultsIterate through the com.adobe.livecycle.contentservices.client.ResultSet object
to retrieve the search results.
Search Content Services (deprecated) content using the Java APISearch content by using the Document Management Service
API (Java):
Include project files.
Include client JAR files,
such as adobe-contentservices-client.jar, in your Java project’s
class path.
Create the service client.
Define the query statement.
Create a QueryImpl object
by using its constructor.
Create a StatementImpl object by using its
constructor and passing the following values:
The
fully qualified attribute name. For example, the fully qualified
name attribute is {http://www.alfresco.org/model/content/1.0}name.
A StatementImpl enumeration value that specifies
the search operation. For example, to use the contains operator,
specify StatementImpl.OPERATOR_CONTAINS.
A string value that specifies the value to search for. For
example, to search for a document with the name mortgageform, specify MortgageForm.
Attach the statement to the query by invoking the QueryImpl object’s addStatement method
and passing the StatementImpl object.
Perform the search.
Perform the search by invoking
the DocumentManagementServiceClientImpl object’s searchRepository method
and passing the following values:
A string value that
specifies the store name. The default store is SpacesStore.
This value is a mandatory parameter.
A string value that specifies the path where the search is
performed (for example, /Company Home). This value
is a mandatory parameter.
A Boolean value that specifies whether to
search sub-folders that are located in the specified path. The value true indicates
to search sub-folders.
The QueryImpl object that represents the
query statement.
An integer value that specifies the maximum value for the
return set.
The searchRepository method
returns a com.adobe.livecycle.contentservices.client.ResultSet object
that contains the search results.
Retrieve the search results.
Use the returned ResultSet object
to retrieve the search results. You can determine the number of
search results by invoking the ResultSet object’s getResultSize method.
Search Content Services (deprecated) content using the web service APISearch content by using the Document Management Service
API (web service):
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.
注意: Replace localhost with the IP
address of the server hosting LiveCycle.
Create the service client.
Create a DocumentManagementServiceClient object
by using its default constructor.
Create an 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.
Define the query statement.
Create a string variable
and assign it a lucene query string value. For example, to search
for a PDF document named MortgageForm, assign the string variable
the value @cm\\:name:\"MortgageForm\. (See Apache Lucene -- Query Parser Syntax.)
Perform the search.
Perform the search by invoking
the DocumentManagementServiceClient object’s searchRepositoryAPI method
and passing the following values:
A string value that
specifies the store name. The default store is SpacesStore.
This value is a mandatory parameter.
A string value that specifies the path where the search is
performed (for example, /Company Home). This value
is a mandatory parameter.
A Boolean value that specifies whether to
search sub-folders that are located in the specified path. The value true indicates
to search sub-folders.
A string variable that represents the lucene query string.
An integer value that specifies the maximum value for the
return set.
The searchRepository method
returns a ResultSet object that contains the search
results.
Retrieve the search results.
Use the returned ResultSet object
to retrieve the search results. You can determine the number of
search results by retrieving the value of the ResultSet object’s resultSize field.
|
|
|