Adobe Experience Manager(AEM) LiveCycle 커넥터를 사용하면 AEM 웹 앱 및 워크플로우 내에서 Adobe LiveCycle ES4 Acrobat Services를 원활하게 호출할 수 있습니다. LiveCycle은 클라이언트 애플리케이션이 Java™ API를 사용하여 LiveCycle 서비스를 시작할 수 있도록 해주는 리치 클라이언트 SDK를 제공합니다. AEM LiveCycle 커넥터는 OSGi 환경 내에서 이러한 API를 간단하게 사용할 수 있습니다.
AEM LiveCycle 커넥터는 AEM Forms 추가 기능 패키지. AEM Forms 추가 기능 패키지를 설치한 후 LiveCycle 서버의 세부 사항을 AEM 웹 콘솔에 추가할 수 있도록 다음 단계를 수행하십시오.
속성이 설명적이긴 하지만 중요한 속성은 다음과 같습니다.
서버 URL - LiveCycle 서버의 URL을 지정합니다. LiveCycle과 AEM이 https를 통해 통신하도록 하려면 다음 JVM으로 AEM을 시작하십시오
argument
-Djavax.net.ssl.trustStore=<<em>path to LC keystore</em>>
옵션을 선택합니다.
사용자 이름- AEM과 LiveCycle 간의 통신을 설정하는 데 사용되는 계정의 사용자 이름을 지정합니다. 계정은 Acrobat 서비스를 시작할 권한이 있는 LiveCycle 사용자 계정입니다.
암호- 암호를 지정합니다.
서비스 이름 - 사용자 이름 및 암호 필드에 제공된 사용자 자격 증명을 사용하여 시작하는 서비스를 지정합니다. LiveCycle 서비스를 시작하는 동안 기본적으로 자격 증명이 전달되지 않습니다.
클라이언트 애플리케이션은 프로그래밍 방식으로 Java™ API, 웹 서비스, 원격 및 REST를 사용하여 LiveCycle 서비스를 시작할 수 있습니다. Java™ 클라이언트의 경우 애플리케이션에서 LiveCycle SDK를 사용할 수 있습니다. LiveCycle SDK는 이러한 서비스를 원격으로 시작하기 위한 Java™ API를 제공합니다. 예를 들어 Microsoft® Word 문서를 PDF으로 변환하려면 클라이언트가 GeneratePDFService를 시작합니다. 호출 플로우는 다음 단계로 구성됩니다.
AEM LiveCycle 커넥터는 이러한 클라이언트 인스턴스를 표준 OSGi 수단을 사용하여 액세스할 수 있는 OSGi 서비스로 노출함으로써 흐름을 간소화합니다. LiveCycle 커넥터는 다음 기능을 제공합니다.
AEM 내에서 노출된 서비스를 시작하려면 다음 단계를 수행하십시오.
전문가 종속성을 결정합니다. Maven pom.xml 파일의 필수 클라이언트 jar에 종속성을 추가합니다. 적어도 adobe-livecycle-client 및 adobe-usermanager-client jar에 종속성을 추가합니다.
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-livecycle-client</artifactId>
<version>11.0.0</version>
</dependency>
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-usermanager-client</artifactId>
<version>11.0.0</version>
</dependency>
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-cq-integration-api</artifactId>
<version>11.0.0</version>
</dependency>
서비스를 시작하려면 서비스에 해당하는 Maven 종속성을 추가하십시오. 종속성 목록은 다음을 참조하십시오. Acrobat 서비스 목록. 예를 들어 PDF 생성 서비스의 경우 다음 종속성을 추가합니다.
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-generatepdf-client</artifactId>
<version>11.0.0</version>
</dependency>
서비스 참조를 가져옵니다. 서비스 인스턴스에 대한 핸들을 가져옵니다. Java™ 클래스를 작성하는 경우 선언 서비스 주석을 사용할 수 있습니다.
import com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient;
import com.adobe.livecycle.generatepdf.client.CreatePDFResult;
import com.adobe.idp.Document;
@Reference
GeneratePdfServiceClient generatePDF;
...
Resource r = resourceResolver.getResource("/path/tp/docx");
Document sourceDoc = new Document(r.adaptTo(InputStream.class));
CreatePDFResult result = generatePDF.createPDF2(
sourceDoc,
extension, //inputFileExtension
null, //fileTypeSettings
null, //pdfSettings
null, //securitySettings
settingsDoc, //settingsDoc
null //xmpDoc
);
위의 코드 스니펫은 GeneratePdfServiceClient의 createPDF API를 시작하여 문서를 PDF으로 변환합니다. 다음 코드를 사용하여 JSP에서 유사한 호출을 수행할 수 있습니다. 주요 차이점은 다음 코드에서 Sling ScriptHelper를 사용하여 GeneratePdfServiceClient에 액세스한다는 것입니다.
<%@ page import="com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient" %>
<%@ page import="com.adobe.livecycle.generatepdf.client.CreatePDFResult" %>
<%@ page import="com.adobe.idp.Document" %>
GeneratePdfServiceClient generatePDF = sling.getService(GeneratePdfServiceClient.class);
Document sourceDoc = ...
CreatePDFResult result = generatePDF.createPDF2(
sourceDoc,
extension, //inputFileExtension
null, //fileTypeSettings
null, //pdfSettings
null, //securitySettings
settingsDoc, //settingsDoc
null //xmpDoc
);
ServiceClientFactory 클래스가 필요한 경우가 있습니다. 예를 들어 프로세스를 호출하려면 ServiceClientFactory가 필요합니다.
import com.adobe.livecycle.dsc.clientsdk.ServiceClientFactoryProvider;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
@Reference
ServiceClientFactoryProvider scfProvider;
...
ServiceClientFactory scf = scfProvider.getDefaultServiceClientFactory();
...
LiveCycle의 거의 모든 Acrobat 서비스에는 인증이 필요합니다. 코드에 명시적 자격 증명을 제공하지 않고 다음 옵션 중 하나를 사용하여 이러한 서비스를 시작할 수 있습니다.
LiveCycle 클라이언트 SDK 구성에 서비스 이름에 대한 설정이 포함되어 있습니다. 이 구성은 호출 로직이 즉시 관리자 자격 증명을 사용하는 서비스 목록입니다. 예를 들어 DirectoryManager 서비스(사용자 관리 API의 일부)를 이 목록에 추가하면 모든 클라이언트 코드에서 서비스를 직접 사용할 수 있습니다. 또한 호출 계층은 LiveCycle 서버로 전송된 요청의 일부로서 구성된 자격 증명을 자동으로 전달합니다.
통합의 일부로 새 서비스 RunAsManager가 제공됩니다. LiveCycle 서버를 호출할 때 사용할 자격 증명을 프로그래밍 방식으로 제어할 수 있습니다.
import com.adobe.livecycle.dsc.clientsdk.security.PasswordCredential;
import com.adobe.livecycle.dsc.clientsdk.security.PrivilegedAction;
import com.adobe.livecycle.dsc.clientsdk.security.RunAsManager;
import com.adobe.idp.dsc.registry.component.ComponentRegistry;
@Reference
private RunAsManager runAsManager;
List<Component> components = runAsManager.doPrivileged(new PrivilegedAction<List<Component>>() {
public List<Component> run() {
return componentRegistry.getComponents();
}
});
assertNotNull(components);
다른 자격 증명을 전달하려면 PasswordCredential 인스턴스를 사용하는 오버로드된 메서드를 사용할 수 있습니다.
PasswordCredential credential = new PasswordCredential("administrator","password");
List<Component> components = runAsManager.doPrivileged(new PrivilegedAction<List<Component>>() {
public List<Component> run() {
return componentRegistry.getComponents();
}
},credential);
프로세스를 호출하거나 ServiceClientFactory 클래스를 직접 사용하고 InvocationRequest를 만드는 경우 호출 계층에서 구성된 자격 증명을 사용해야 함을 나타내는 속성을 지정할 수 있습니다.
import com.adobe.idp.dsc.InvocationResponse
import com.adobe.idp.dsc.InvocationRequest
import com.adobe.livecycle.dsc.clientsdk.ServiceClientFactoryProvider
import com.adobe.idp.dsc.clientsdk.ServiceClientFactory
import com.adobe.livecycle.dsc.clientsdk.InvocationProperties
ServiceClientFactoryProvider scfp = sling.getService(ServiceClientFactoryProvider.class)
ServiceClientFactory serviceClientFactory = scfp.getDefaultServiceClientFactory()
InvocationRequest ir = serviceClientFactory.createInvocationRequest("sample/LetterSubmissionProcess", "invoke", new HashMap(), true);
//Here we are invoking the request with system user
ir.setProperty(InvocationProperties.INVOKER_TYPE,InvocationProperties.INVOKER_TYPE_SYSTEM)
InvocationResponse response = serviceClientFactory.getServiceClient().invoke(ir);
다음 서비스를 사용할 수 있습니다.
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-livecycle-client</artifactId>
<version>11.0.0</version>
</dependency>
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-usermanager-client</artifactId>
<version>11.0.0</version>
</dependency>
다음 서비스를 사용할 수 있습니다.
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-livecycle-cq-integration-api</artifactId>
<version>1.1.10</version>
</dependency>
다음 서비스를 사용할 수 있습니다.
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-taskmanager-client</artifactId>
<version>11.0.0</version>
</dependency>
다음 서비스를 사용할 수 있습니다.
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-workflow-client-sdk</artifactId>
<version>11.0.0</version>
</dependency>
다음 서비스를 사용할 수 있습니다.
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-generatepdf-client</artifactId>
<version>11.0.0</version>
</dependency>
다음 서비스를 사용할 수 있습니다.
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-applicationmanager-client-sdk</artifactId>
<version>11.0.0</version>
</dependency>
다음 서비스를 사용할 수 있습니다.
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-assembler-client</artifactId>
<version>11.0.0</version>
</dependency>
다음 서비스를 사용할 수 있습니다.
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-formdataintegration-client</artifactId>
<version>11.0.0</version>
</dependency>
다음 서비스를 사용할 수 있습니다.
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-forms-client</artifactId>
<version>11.0.0</version>
</dependency>
다음 서비스를 사용할 수 있습니다.
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-output-client</artifactId>
<version>11.0.0</version>
</dependency>
다음 서비스를 사용할 수 있습니다.
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-reader-extensions-client</artifactId>
<version>11.0.0</version>
</dependency>
다음 서비스를 사용할 수 있습니다.
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-rightsmanagement-client</artifactId>
<version>11.0.0</version>
</dependency>
다음 서비스를 사용할 수 있습니다.
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-signatures-client</artifactId>
<version>11.0.0</version>
</dependency>
다음 서비스를 사용할 수 있습니다.
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-truststore-client</artifactId>
<version>11.0.0</version>
</dependency>
다음 서비스를 사용할 수 있습니다.
<dependency>
<groupId>com.adobe.livecycle</groupId>
<artifactId>adobe-repository-client</artifactId>
<version>11.0.0</version>
</dependency>