Invoking AEM Forms 6.2 services via EJB in JBoss

From Jboss AS6 onwards (AEM Forms JEE 6.0+) , the way you invoke Forms services via EJB has changed.

Below is a code snippet from a DSC of how to invoke the TaskManagerService via EJB in AEM Forms 6.2. Note how the scheme ‘jnp://’ has been removed from the URL.

long taskId = 1234;
Document document = null;
ServiceClientFactory factory = null;

Properties ConnectionProps = new Properties();
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "localhost:4447");
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,
				ServiceClientFactoryProperties.DSC_EJB_PROTOCOL);
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "JBoss");
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");

factory = ServiceClientFactory.createInstance(ConnectionProps);
TaskManager tmObj = TaskManagerClientFactory.getTaskManager(factory);
FormInstance formInst = tmObj.getFormInstanceForTask(taskId, 0, true);
document = formInst.getDocument();
System.out.println("Document size = " + document.length());

NOTE: You also need to start using the updated JBoss client library from your JBoss instance (\bin\client\jboss-client.jar)

Advertisements

Inside AEM Forms JEE LDAP Connector

I have been working with a client recently who had some interesting questions about the AEM Forms JEE LDAP connector and how it actually worked. Other than how to configure it, most of the internal workings are a mystery. So I thought I would share some of the (edited) responses on how the LDAP connector actually processes directories internally and how parts of it works.

Shout out goes to Neerav at Adobe Engineering for the great answers.

Filtering LDAP Attributes

LDAP query clients allow for the ability to specify which attributes are searched and also which attributes are returned in the search results. Some complex directories return many attributes by default, thus slowing down performance and creating unnecessary network overhead.

Q: Is there a way to filter out the attributes that LDAP returns when it tries to search for users in AEM Forms JEE?

A: The LDAP sync process fetches only those attributes which are configured in User/Group synchronization screen. There are many attributes which are optional on that screen and those can be set blank. If any attribute is blank on that screen, then it is not fetched from LDAP.

Moving User around Forests

Q: If a user is Active in Forest A and moves to Forest B, they will be made inactive in the first and active in the second. They will be granted the exact same idmGUID [LDAP unique identifier]. Will the LDAP Import Process simply recognise this as the same user and update their details in the Adobe Database with the details from the new forest?

A: As long as its unique fields like canonicalName (i.e. idmGUID) and userid (i.e. samAccountName or uid) remain the same, the user identity would be same.

Delta Synchronization

Q: The Delta Sync process in AEM Forms, is only a Delta in terms of the Adobe product. A Full import against the LDAP backend occurs, before a comparison of modifyTimeStamp fields in the new Full Import is carried out against the current list in Adobe. Hence, would the [network] impact of a Full Sync v.s. a Delta be identical on the LDAP Infrastructure?

A. Delta sync would have less load on LDAP infrastructure. We do not fetch details of groups (and group members) if a particular group is unchanged. modifyTimeStamp is an operational attribute and is not fetched unless it is part of requested attributes. It is present in all standard LDAPs (including Active Directory). This attribute is used to determine if a User or Group record has changed since last synchronization. If delta sync is enabled, users and groups which have not changed since last synchronization are not updated during synchronization.

A note on modifiedTimeStamp

modifiedTimeStamp and delta sync presented an interesting challenge since each server in the IAM farm updated the modifiedTimeStamp when it received the user update from the IAM master. This could possibly be a second or two after the master was updated. Since the LDAP queries were load balanced between the LDAP servers and each server (potentially) had a slightly different modifiedTimeStamp, it made it impossible to reliably do a delta sync with the LDAP directory. This is potentially a large overhead with a large LDAP population.

AEM Forms 6.2 is released

Adobe_Experience_Manager_logo_SCREEN_RGB_128px AEM Forms 6.2 has now been released to the general public. It contains a lot of nice new features like Touch UI forms building, Theme editor and a bigger and better Rule Editor that was introduced in AEM Forms 6.1 FP1. One of the additions I am looking forward to trying is pre-configuring a web service for use in the Rule Editor.

Check out what’s new in 6.2: https://helpx.adobe.com/aem-forms/6-2/whats-new.html

 

Adaptive Forms reserved words

There are a number of reserved words that you should not name your form elements in your Adaptive Forms. It is also suggested you should not use them in your schema for element or attribute names.

As a rule of thumb:

  1. Any property that is defined on the panel should not be used as the name of an element. Because that will restrict access to that property and lead to problems in the code. Examples (case-sensitive)
    1. panel
    2. repeatable
    3. toolbar
    4. instanceManager
    5. title
    6. summary
    7. enabled
    8. visible
    9. id
    10. name
    11. children
    12. items
    13. bindRef
    14. shortDescription/longDescription
    15. index
    16. any other API mentioned in https://helpx.adobe.com/aem-forms/6-1/javascript-api/Panel.html
  1. Some other words that are used in the generated script should not be used in the scripts or element names. e.g.
    1. Calculate
    2. Visibility
    3. Enabled
  2. You should not have field names starting with _, to prevent future name collisions with any of Adobe’s private APIs.

Edit: It wasn’t related to the schema elements per se, but the ‘elements’ in the adaptive form. Since dragging a schema object onto the form automatically names the form element the same name as the schema element or attribute, the form will stop working.

Edit 2: Ok it seems that naming your schema elements and attributes any of the above is aactually not recommended.

Changing administrator password on AEM Forms JEE

LC_bugOk, so this isn’t really a bug but it was damn annoying to figure out.

So we had a development server that was publicly available, so the first thing you do is change the default administrator password (right?).

Then I start seeing messages from JBoss server.log:

19:14:56,218 WARN  [com.adobe.idp.um.businesslogic.authentication.AuthenticationManagerBean] (Thread-166) Authentication failed for user [admin] (Scheme - Username/Password) Reason: Username or password is incorrect . Refer to debug level logs for category com.adobe.idp.um.businesslogic.authentication for further details

What? Where is that coming from?

Anyway, to cut a long story short, it turns out if you want to change the default administrator password on AEM Forms JEE 6.X, you need to update the OSGi configuration for the Adobe LiveCycle Client SDK Configuration or it will lock out your administrator account!

Adobe_LiveCycleClient_SDK_Config

The URL to get to it directly is: http://localhost:8080/lc/system/console/configMgr/com.adobe.livecycle.dsc.clientsdk.internal.DSCConfigService

Remember that if you have any Author or Publish instances pointing to your Processing server, they will need to be updated too or the same thing will happen.

Maven, Forms Workflows and DSC’s

maven-logo-black-on-whiteFound this gem while I was converting an old Ant-based DSC project to a Maven build.

LiveCycle Maven Plugin

It gives you a Maven plugin to control a bunch of features in LiveCycle / Forms Workflows in the Maven build such as:

  • Configuration of LiveCycle / Forms Workflows services
  • Deploying DSC’s
  • Deploying LCA’s
  • Generating component.xml files

AEM Forms Workflows

Adobe_Experience_Manager_logo_SCREEN_RGB_128pxSince Adobe have moved on and deprecated all things named LiveCycle, I figured I should do the same. Those of us who have worked with LiveCycle knows it still looks and smells like LiveCycle, but has a shiny new icon and a new name1: AEM Forms Workflows. Which is a lot better than their previous effort at renaming the product2.

There’s no point changing the URL, but the site will be updated to include AEM Forms in the title as well so people can find it.

I have quite a bit to share on the new product and a lot of it is in flux or in snapshot builds I have of the product, so I will post up the generic hacks and workarounds that apply to GA versions of the product going forward plus some other cool stuff that brings LiveCycle AEM Forms into the new era of Adobe’s Enterprise Marketing platform.

1Ok… its not really new, I’ve just been slack busy working on AEM Forms projects
2 Adobe Digital Enterprise Platform – Adobe’s short-lived and much maligned name change for LiveCycle. Was renamed to LiveCycle ES3 after the horror of what they had done dawned on them. AEM Forms Workflows is still not great, but acceptable with the integration with AEM.

AEM 6.0 Released

Code Monkey

At the end of last week, AEM 6.0 was finally released. As both a LiveCycle and AEM developer this is very interesting news for me, since LiveCycle is being merged into the AEM product suite, under AEM Forms. This also includes Adaptive Forms – forms with a responsive design and a host of other cool features.

Here are some links where you can find more information on AEM 6.0:

AEM 6.0 Release Notes

AEM 6.0 Documentation

Sightly – The New AEM 6 Templating Language

Introduction to AEM Forms

AEM Forms Help

AEM Forms Forums

There’s a lot more information out there, but this is some good reading to get started.

View original post

Changing default server ports in Livecycle ES4 JBoss

JBoss Livecycle ES4 JBoss (including Turnkey) changed the underlying application server to JBoss EAP 5.1.0 and later to 5.2.0 in the SP1 release. This changed the way you alter the port vales for various services. Instead of looking in various different places for the port values, they amalgamated them all into one central configuration file.

The file is located in [server]/conf/bindingservice.beans/META-INF/bindings-jboss-beans.xml

Mastertheboss has a great page about the new Jboss port configuration for JBoss EAP 5.1+ – check it out!

 

Generating useful current-dateTime() values

setvalueOne common operation that you find yourself doing as a developer is time-stamping various operations. Creation DateTime, Save DateTime or Submission DateTime values are very useful when processing data. However, in Livecycle there are some small gotchas when dealing with system generated dateTime strings that they don’t make you aware of.
 

current-dateTime() default Timezone

Even in the latest help file for current-dateTime() XPath function, they don’t tell you that when you make a call to this function, it will always return the time string as GMT+0 no matter what timezone the server is running in. Now this is fine if you live in London, Burkina Faso or Tórshavn but no good if you live anywhere else in the world.

Adjusting the default

Adjusting this value to your default timezone is fairly easy as the format-dateTime() function does this for you if you feed it right. You just need to know what values to put in for the four optional fields and how to source them. Adobe give some help to the values on the Date and Time parameters help page and I will demonstrate using format-dateTime():

Syntax

format-dateTime(strDateTime, (language, country, variant, timezone)?)

Parameters

So, to get the real current-dateTime() string for an application based in Auckland, New Zealand you would do the following:

format-dateTime(current-dateTime(), "en", "NZ", "WIN", "Pacific/Auckland")

 

aemblog

Everything AEM aka CQ5 based on my experience listed here.

Adobe AEM The Right Way

Best practices, tips, and tricks for your Adobe AEM project

/home/bkondepudi

A WCM journey with Day/Adobe CQ

Technoracle (a.k.a. "Duane's World")

A multi-purpose toolkit for the Adobe LiveCycle and AEM Forms developer.

Adobe LiveCycle Blog

A multi-purpose toolkit for the Adobe LiveCycle and AEM Forms developer.

A multi-purpose toolkit for the Adobe LiveCycle and AEM Forms developer.

XFA@Mobile

A multi-purpose toolkit for the Adobe LiveCycle and AEM Forms developer.

Code Monkey

Ramblings of a Developer