Wednesday, 16 April 2014

Creating a Custom LiveCycle DSC that returns MySQL data in XML


From time to time, I write development articles for other Adobe technologies (other than Adobe Experience Manager) based on community requests. This use case was made from a LiveCycle community member that I have worked with for many years.

You can create a custom LiveCycle custom service that queries a relational database, dynamically creates an XML document, and places the data within an XML document. The advantage to creating a LiveCycle service that creates XML is the XML can be developed to meet your business requirements. For this use case, assume that the requirement is the XML does not contain CDATA section.

Data within an XML document can be parsed and displayed by a client application. However, data located within an XML CDATA section cannot be parsed and is ignored.  The LiveCycle custom service created in this development queries MySQL, dynamically creates an XML document, places the MySQL data within the XML document, and returns the XML. Futhermore, a .NET application invokes the service by using the web service exposed by the LiveCycle custom service.


This development article walks you through creating the custom LiveCycle custom service that returns XML data that contains data queried from MySQL. The XML does not contain additional sections such as CDATA, as shown here in a .NET client application.




In addition, this article walks you through creating the client .NET application that invokes the custom LiveCycle Service using web services. To read this development article, check back on Mon April 21, 2014. 

Thursday, 10 April 2014

Creating AEM components that displays DAM Assets in 3D

From time to time, I enjoy looking at the some of the new JQuery plug-ins to see if I can find interesting ones to use with Adobe Experience Manager. As I have stated in previous posts in  Scotts Digital Community, one of the powerful features of AEM is the ability to create custom components using JavaScript frameworks, such as JQuery. I have located a new plug-in that I think the AEM community will like named 3dEye.js. See: https://github.com/metalshan/3dEye.

You can use this JQuery plug-in to create a custom AEM component that displays AEM DAM assets in 3D, as shown here:

By building engaging components, you can create an even better experience for Digital Marketers to do their jobs. To read this development article, check back on Fri April 25, 2014.

Posting Special Characters to Adobe Experience Manager

In some some business use cases, you may have to post special characters, such as ®, to Adobe Experience Manager. Once posted to AEM, you can use special characters to set node properties, as shown in the following illustration.


By default, you cannot post strings to AEM that contain special characters. For example, you cannot run this CURL command to post special characters to AEM.

curl -H "charset=utf-8" -u admin:admin -X POST --data "test=€ , Š , Œ , ™ , š , œ , ž" http://localhost:4502/content/mynodetest

If you attempt this command with CURL, wrong characters are inserted into AEM. That is, you will see: "Ç , è , î , Ö , Ü , £ , P , Ä , " instead of "€ , Š , Œ , ™ , š , œ , ž , Ž , Ÿ".

To successfully post special characters to AEM and use them to set node values in the AEM JCR, you have to create a custom Sling Servlet that is able to handle UTF-8 (UCS Transformation Format—8-bit) encoded strings. This encoding type is a variable-width encoding that represents every character in the Unicode character set.

The Sling Servlet can decode the strings that contain special characters using Java application logic.

String id = java.net.URLDecoder.decode(request.getParameter("id"), "UTF-8");
String firstName = java.net.URLDecoder.decode(request.getParameter("firstName"),"UTF-8");

To post these special characters to the AEM Sling Servlet, encode the strings, as shown in this Java code example.

String val = java.net.URLEncoder.encode("cust®", "UTF-8");
String firstName = java.net.URLEncoder.encode("TOM®", "UTF-8");

To read this development article, click,   http://helpx.adobe.com/experience-manager/using/post_chars.html.

Adobe Digital Marketing Community

Join the Adobe Digital Marketing Community. Start by clicking this banner

About the Author

I (Scott Macdonald) am a Senior Digital Marketing Community Manager at Adobe Systems with over 16 years in the high tech industry. I am also a programmer with knowledge in Java, JavaScript, C#,C++, HTML, XML and ActionScript. If  you would like to see more CQ or other Adobe Digital Marketing end to end articles like this, then leave a comment and let me know what content you would like to see.

Linked Inhttp://www.linkedin.com/in/scottmacdonald2010
TwitterFollow the Digital Marketing Customer Care team on Twitter @AdobeMktgCare.

Wednesday, 9 April 2014

Creating Event Handlers for Adobe Experience Manager

You can develop a custom event handler for Adobe Experience Manager (AEM) that responds to events that occur at the JCR level. For example, you can write an event handler to respond to the following JCR events:

  • A node was added
  • A node was moved
  • A node was deleted
  • A property was added to a node
  • A property was changed
  • A property was deleted
To create an AEM event handler, you create an OSGi bundle that contains a class that implements javax.jcr.observation.EventListener. For information, see EventListener.

The following illustration shows a client making a change in an AEM web page that results in a new node being created in the AEM JCR. For example, a new customer signs up that results in a new node being created within the AEM JCR. The custom event handler listens for that event and responds.  



To read this development article, click http://helpx.adobe.com/experience-manager/using/events.html

Monday, 31 March 2014

Creating Java Swing applications that post files to AEM ClientLibs folders

You can create a custom Java Swing client application that lets a user select a file from the local desktop and post the file to an AEM ClientLibs folder. In most AEM applications, you create a ClientLibs folder to store required application files such as CSS file and JS files. In some cases, you can place third-party files like JQuery JS files when you want to incorporate functionality offered by these files into your AEM application.

The following illustration shows CSS and JS files located in an AEM client libs folder.



For more information about a ClientLibs folder, see Using Client-Side Libraries.

Note: There are other ways to get files into a ClientLibs folder. For example, you can use the CRXDE tool to drag and drop files from the local desktop to a ClientLibs folder. However, there are drawbacks to using CRXDE to drag and drop files from the desktop to an AEM client libs folder.

To develop a Java Swing application that posts files to an AEM client libs folder, you use Java APIs located in the org.apache.http package. The APIs located in this package lets you post files to a custom AEM Sling Servlet. The Sling Servlet saves the file in the specified ClientLibs folder using the JCR API.



The following illustration shows the Java client application that is created in this development article.


A Java client application that posts files to an AEM ClientLibs folder

To read this development article, click http://helpx.adobe.com/experience-manager/using/post_files.html.

Adobe Digital Marketing Community

Join the Adobe Digital Marketing Community. Start by clicking this banner

About the Author

I (Scott Macdonald) am a Senior Digital Marketing Community Manager at Adobe Systems with over 16 years in the high tech industry. I am also a programmer with knowledge in Java, JavaScript, C#,C++, HTML, XML and ActionScript. If  you would like to see more CQ or other Adobe Digital Marketing end to end articles like this, then leave a comment and let me know what content you would like to see.

Linked Inhttp://www.linkedin.com/in/scottmacdonald2010
TwitterFollow the Digital Marketing Customer Care team on Twitter @AdobeMktgCare.


Friday, 21 March 2014

Storing LiveCycle ES process data in a remote Adobe Experience Manager JCR

As a user of both Adobe LiveCycle ES and Adobe Experience Manager, you can create business applications that make use of both platforms. That is, you can create an enterprise solution that uses functionality provided by Adobe CQ and LiveCycle ES. By combining the functionality of both server products, you can create applications to solve your business requirements.

For example, assume that you have a LiveCycle business process that uses PDF documents. Next assume that the process extracts data from the PDF document and you want to store the data in a JCR that belongs to a remote AEM server.

Process data is sent from a LiveCycle ES process to the AEM JCR
As shown in the previous illustration, you can create a custom LiveCycle ES Document Service Component (DSC) that is able to post process data to a custom AEM Sling Servlet. The custom Sling Servlet persists the process data in the AEM JCR by using the JCR API. The following illustration shows a LiveCycle ES process that sets process variables and then uses the custom DSC to persist the data into the AEM JCR.





To read this development article, see http://helpx.adobe.com/experience-manager/using/custom-sling-servlets11.html.

Adobe Digital Marketing Community

Join the Adobe Digital Marketing Community. Start by clicking this banner

About the Author

I (Scott Macdonald) am a Senior Digital Marketing Community Manager at Adobe Systems with over 16 years in the high tech industry. I am also a programmer with knowledge in Java, JavaScript, C#,C++, HTML, XML and ActionScript. If  you would like to see more CQ or other Adobe Digital Marketing end to end articles like this, then leave a comment and let me know what content you would like to see.

Linked Inhttp://www.linkedin.com/in/scottmacdonald2010
TwitterFollow the Digital Marketing Customer Care team on Twitter @AdobeMktgCare.

Monday, 17 March 2014

Meet the Digital Marketing Community team at Digital Marketing Summit 2014

The Digital Marketing summit is a week away. If you are attending, please stop by the community booth and meet the Digital Marketing community team. This will give you a chance to meet us in person. We have lots of interesting stuff to give away and look forward to meeting you as well as hearing about your thoughts.



Adobe Digital Marketing Community

Join the Adobe Digital Marketing Community. Start by clicking this banner

About the Author

I (Scott Macdonald) am a Senior Digital Marketing Community Manager at Adobe Systems with over 16 years in the high tech industry. I am also a programmer with knowledge in Java, JavaScript, C#,C++, HTML, XML and ActionScript. If  you would like to see more CQ or other Adobe Digital Marketing end to end articles like this, then leave a comment and let me know what content you would like to see.

Linked Inhttp://www.linkedin.com/in/scottmacdonald2010
TwitterFollow the Digital Marketing Customer Care team on Twitter @AdobeMktgCare.