Monday 28 May 2012

Using JSONWriter objects to display Adobe CQ OSGi data

You can create an org.apache.sling.commons.json.io.JSONWriter instance to invoke Adobe CQ OSGi bundle operations and display data within a JSP. A JSONWriter instance lets you define value and key methods to retrieve data. You can create an Adobe CQ component that uses a JSONWriter instance to submit data to an OSGi bundle operation and get back the results. You can then display the results in a JSP. That is, you can dynamically display data based on user input.

For example, consider the OSGi bundle that uses web services to return weather information. (For information about this OSGi bundle, see  http://scottsdigitalcommunity.blogspot.ca/2012/05/creating-adobe-cq-bundles-that-consume.html.)

Note: The OSGi bundle that returns weather data uses web services to expose various operations that return weather data. To follow along with this development article, you must create the weather OSGi bundle by following that article.

You can use a JSONWriter instance to return weather data based on user input. For example, consider the following graphical user interface that lets a user select a US ZIP code from a drop-down menu:



When the user selects a US Zip code from the drop-down menu and clicks the Click Me button, the weather service OSGi bundle is invoked. A JSONWriter instance is used to invoke the OSGi bundle and the data is returned to the JSP, as shown in the following illustration.


To read this full article, click this link: 

http://helpx.adobe.com/experience-manager/using/using-jsonwriter-objects-display-cq.html


Join the Adobe Experience Cloud Community 

Join the Adobe Experience Cloud Community by clicking this banner




I (Scott Macdonald) am a Senior Digital Marketing Community Manager at Adobe Systems with 20 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.


TwitterFollow the Digital Marketing Customer Care team on Twitter @AdobeExpCare.

YouTube: Subscribe to the AEM Community Channel


Friday 18 May 2012

Packaging Adobe CQ 5.5 applications that contain an OSGi bundle

You can package an Adobe CQ 5.5 application that contains an OSGi bundle into a package by using Package Manager. Once an application (including the OSGi bundle) is placed into a package, you can deploy the package to another instance of Adobe CQ. If your CQ package does not include the OSGi bundle, then the application will not successfully work when deployed to a new CQ instance.

For example, assume that you created the weather application that uses an OSGi bundle by following the development article here: http://scottsdigitalcommunity.blogspot.ca/2012/05/creating-adobe-cq-bundles-that-consume.html.

To successfully package the weather application, you have to also include the cdynewebservice_1.0.0.jar (which represents the OSGi bundle) into the package.

Note: This article describes how to package the weather application (that depends upon an OSGi bundle) as an example. You can build the weather application by following the instructions located in the previous link. For more information about Adobe CQ packages, see http://dev.day.com/docs/en/cq/current/administering/package_manager.html.

To read this entire article, click this link:

https://helpx.adobe.com/experience-manager/using/packaging-cq-applications-contain-osgi.html

Join the Adobe Experience Cloud Community 

Join the Adobe Experience Cloud Community by clicking this banner




I (Scott Macdonald) am a Senior Digital Marketing Community Manager at Adobe Systems with 20 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.


TwitterFollow the Digital Marketing Customer Care team on Twitter @AdobeExpCare.

YouTube: Subscribe to the AEM Community Channel


Thursday 3 May 2012

Creating Adobe CQ bundles that consume web services


You can create an Adobe CQ bundle that consumes data from a third-party web service and then display the data in a web page. For example, assume that you use Adobe CQ to create a web site for a government department that tracks weather information. In this situation, you can create a CQ bundle that retrieves data from a third-party web service and display the data within a form located in a web page. The following illustration shows data being retrieved from a third-party web service and displayed in a JSP.


You can develop an OSGi bundle that contains Java proxy classes that were created by using JAX-WS or AXIS. That is, you can use a tool such as  JAX-WS to generate the Java proxy classes that are based on the WSDL of an external web service. Then you can use these Java proxy classes within your OSGi bundle. The OSGi bundle that is created in this development article contains Java proxy classes that consume operations exposed by the following third-party WSDL:

http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL

To read this article, click this link:

https://helpx.adobe.com/experience-manager/using/creating-cq-bundles-consume-web.html

Note: This article uses JAX-WS to generate the Java proxy classes. You can use Apache CXF. For information, see Creating Adobe CQ bundles using Apache CXF that consume web services.

Note: This article discusses using a WSDL to consume a web service. To learn how to build an AEM application that consumes a Restful web service, see http://scottsdigitalcommunity.blogspot.ca/2013/11/creating-adobe-experience-manager.html.

Join the Adobe Experience Cloud Community 

Join the Adobe Experience Cloud Community by clicking this banner




I (Scott Macdonald) am a Senior Digital Marketing Community Manager at Adobe Systems with 20 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.


TwitterFollow the Digital Marketing Customer Care team on Twitter @AdobeExpCare.

YouTube: Subscribe to the AEM Community Channel