Wednesday, April 20, 2011

Adobe LiveCycle ES2.5 Migration Woes

So recently I had to migrate LiveCycle ES to ES2 / ES2.5

Surprisingly the install and deployment of the application went smooth. When I got Workbench installed and everything up and running it was time to migrate the old forms over to a new application and get everything working. All was well until I hit the Deploy button.

The resource [resourceUri] is exclusive-locked by user [userId].

When this used to happen in LiveCycle ES there was always an unlock option in the context menu, in ES2.5 it's nowhere to be found. Numerous calls to Adobe Support no help. Until today I stumbled upon Locking a resource using the Java API. I'm not sure where this was before but it contained some valuable information. So I quickly wrote up the source for my server running on WebSphere 6.1.

import java.util.*;

import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;
import com.adobe.repository.bindings.dsc.client.ResourceRepositoryClient;
import com.adobe.repository.infomodel.bean.*;

public class UnlockFile {
 public static void main(String[] args) {
  try {
   Properties connectionProps = new Properties();
   connectionProps.setProperty(
     ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT,
     "iiop://myhost:2809");
   connectionProps.setProperty(
     ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,
     ServiceClientFactoryProperties.DSC_EJB_PROTOCOL);
   connectionProps.setProperty(
     ServiceClientFactoryProperties.DSC_SERVER_TYPE,
     ServiceClientFactoryProperties.DSC_WEBSPHERE_SERVER_TYPE);
   connectionProps.setProperty(
     ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME,
     "login");
   connectionProps.setProperty(
     ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD,
     "pass");

   ServiceClientFactory myFactory = ServiceClientFactory
     .createInstance(connectionProps);

   ResourceRepositoryClient repositoryClient = new ResourceRepositoryClient(
     myFactory);

   String resourceUri = "/MyResourceDir/";

   for (Resource resource : (List) repositoryClient
     .listMembers(resourceUri)) {
    repositoryClient.unlockResource(resource.getPath());

   }
  } catch (Exception e) {
   e.printStackTrace();
  }
 }
}


What I did here to make my life easier instead of going through 50 forms 1 by 1 You can pass in their parent directory as a ResourceURI.

Hope this helps. Thanks to the Adobe docs, wish they were much easier to find though. Seems they became better for crawlers recently because I haven't seen these links when I was searching for this a little while ago.

No comments:

Post a Comment