You can use the Directory Manager Service API (Java and
web service) to programmatically add users to LiveCycle.
After you add a user, you can use that user when performing a service
operation that requires a user. For example, you can assign a task
to the new user. (See Assigning Tasks.)
Summary of stepsTo add a user, perform the following steps:
Include project files.
Create a DirectoryManagerService client.
Define user information.
Add the user to LiveCycle.
Verify that the user is added.
Include project filesInclude necessary files in your development
project. If you are creating a client application using Java, include
the necessary JAR files. If you are using web services, include
the proxy files.
Create a DirectoryManagerService clientBefore you can programmatically
perform a Directory Manager service operation, create a Directory
Manager Service API client.
Define user informationWhen you add a new user by using the
Directory Manager Service API, define information for that user.
Typically, when you add a new user, you define the following values:
Domain name: The domain to which the user belongs (for
example, DefaultDom).
User identifier value: The identifier value of the
user (for example, wblue).
Principal type: The type of user (for example, you
can specify USER).
Given name: A given name for the user (for example, Wendy).
Family name: The family name for the user (for example, Blue).
Locale: Locale information for the user.
Add the user to LiveCycleAfter you define user information,
you can add the user to LiveCycle. To add a user, invoke
the DirectoryManagerServiceClient object’s createLocalUser method.
Verify that the user was addedYou can verify that the user was
added to ensure that no issues occurred. Locate the new user by
using the user identifier value.
Add users using the Java APIAdd users by using the Directory Manager Service API (Java):
Include project files.
Include client JAR files,
such as adobe-usermanager-client.jar, in your Java project’s class
path.
Create a DirectoryManagerServices client.
Create a DirectoryManagerServiceClient object
by using its constructor and passing a ServiceClientFactory object
that contains connection properties.
Define user information.
Create a UserImpl object
by using its constructor.
Set the demain name by invoking the UserImpl object’s setDomainName method.
Pass a string value that specifies the domain name.
Set the principal type by invoking the UserImpl object’s setPrincipalType method.
Pass a string value that specifies the type of user. For example,
you can specify USER.
Set the user identifier value by invoking the UserImpl object’s setUserid method.
Pass a string value that specifies the user identifier value. For
example, you can specify wblue.
Set the canonical name by invoking the UserImpl object’s setCanonicalName method.
Pass a string value that specifies the user’s canonical name. For
example, you can specify wblue.
Set the given name by invoking the UserImpl object’s setGivenName method.
Pass a string value that specifies the user’s given name. For example,
you can specify Wendy.
Set the family name by invoking the UserImpl object’s setFamilyName method.
Pass a string value that specifies the user’s family name. For example,
you can specify Blue.
Note: Invoke
a method that belongs to the UserImpl object to
set other values. For example, you can set the locale value by invoking
the UserImpl object’s setLocale method.
Add the user to LiveCycle.
Invoke the DirectoryManagerServiceClient object’s createLocalUser method
and pass the following values:
The createLocalUser method
returns a string value that specifies the local user identifier
value.
Verify that the user was added.
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.
Add users using the web service APIAdd users by using the Directory Manager Service API (web service):
Include project files.
Create a Microsoft .NET
project that uses MTOM. Ensure that you use the following WSDL definition
for the service reference: http://localhost:8080/soap/services/DirectoryManagerService?WSDL&lc_version=9.0.1.
Note: Replace localhost with the IP
address of the server hosting LiveCycle.
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 LiveCycle 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.
Define user information.
Create a UserImpl object
by using its constructor.
Set the demain name by assigning a string value to the UserImpl object’s domainName field.
Set the principal type by assigning a string value to the UserImpl object’s principalType field.
For example, you can specify USER.
Set the user identifier value by assigning a string value
to the UserImpl object’s userid field.
Set the canonical name value by assigning a string value
to the UserImpl object’s canonicalName field.
Set the given name value by assigning a string value to the UserImpl object’s givenName field.
Set the family name value by assigning a string value to
the UserImpl object’s familyName field.
Add the user to LiveCycle.
Invoke the DirectoryManagerServiceClient object’s createLocalUser method
and pass the following values:
The createLocalUser method
returns a string value that specifies the local user identifier
value.
Verify that the user was added.
Create a PrincipalSearchFilter object
by using its constructor.
Set the user identifier value of the user by assigning a
string value that represents the user identifier 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.
|
|
|