Logging Activates, Deactivates and Deletes

- Sensei Martin

To keep a log of who has activated or deactivated a page, add this to your logging :-

Log Level: Debug

Logger: com.day.cq.replication.impl.queue.ReplicationJob

........

---------------

Read the complete post at My Day CQ Blog.

Creating Adobe CQ bundles that consume web services

- Scott Macdonald

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.

------------

Read the complete blog post at Scott's Digital Community.

Creating an Adobe CQ web application that uses MySQL

- Scott Macdonald

You can create an Adobe CQ web application that performs database operations on a relational database. For example, you can create an Adobe CQ web application that retrieves data from MySQL and displays the data in a JSP. The following illustration shows data being retrieved from a relational database and displayed in a JSP.

You can create an OSGi bundle that can be used within the Adobe Digital Marketing Suite by using CDXDE. An OSGi bundle is essentially a Java module that contains application logic that meets your business requirements. An OSGi bundle lets you dynamically load, unload, configure, and control the Java module without restarting the server. CRXDE is the IDE that lets you develop applications for Adobe CQ (part of the Adobe Digital Marketing Suite).

The OSGi component that is created in this development article contains Java JDBC application logic that retrieves data from MySQL. (This OSGi component corresponds to the JDBC Java code shown in the previous illustration.) To keep this article simple, the MySQL database is named bank and contains a single table named user. The user table contains two fields named id and name. This development article guides you through how to create an Adobe CQ application that displays data located in the user table in a JSP.

------------

Read the complete blog post at Scott's Digital Community.

CQ Developer Tricks

- Feike Visser

While working with Adobe CQ5 every now and then you discover some new tricks or options, here the list that I use daily:

Remove #cf/

Don’t want to see/wait for the content-finder while refereshing pages, just remove #cf/ in your url.

?debug=layout

Shows you all details of the components used on your page

?debugConsole=true

Runs Firebug Lite inside your browser

?wcmmode=(edit|preview|design|disabled)

This parameter sets your WcmMode in the specified mode, makes testing for a particular WcmMode easier .

...

----------

Read the complete blog post at the Experience Delivers blog.

Creating a Column Control in Adobe CQ

- Dan Klco

Column Controls in Adobe CQ allow authors to easily create and configure column-based layouts.  This guide shows advanced users and developers how to create and configure a column control.

Step 1: Add a Parsys to a Component JSP

Include a Paragraph System into the page’s component JSP.  You can use any node name for the path, the resource type is ‘foundation/components/parsys’

<cq:includepath="par"resourceType="foundation/components/parsys "/>

Step 2: Configure the Paragraph System

To add a Column Control to the Paragraph System, you will first need to update the design.  Select design mode on the sidekick.

Selecting Design Mode

Selecting Design Mode

...

-------

Read the complete post on the Six Dimensions blog.

Using XMLBeans in Adobe CQ

- Dan Klco

Apache XMLBeans is a powerful tool for reading, writing and updating XML files.  XMLBeans dynamically creates Java classes based on an XSD Schema.  This makes it powerful and easy to use, however can make it more complicated to integrate into OSGi based applications, such as Adobe CQ, as the XML Element to Java Class mapping uses the Java Classloader.

This guide shows you how to integrate XMLBeans in your Adobe CQ application.

 

.....

----------

Read the full post on the Six Dimensions blog.

CQ Project Planning: Development Strategy

- TJ Iaciofano

Several questions come up to me consistently while I move from client to client as a technical PM or solution architect. I felt compelled to list my responses to these questions so that you ask yourself the same questions every time you approach a new CQ5 project. MY response questions often lead to longer brainstorming sessions. Here are a few situations.

  • Components
    • Initial Topic:
      • What gets “componentized” versus consumed, integrated or remain separated with regard to CQ5?
    • My Response:
      • How reusable is this functionality?
      • What is the current life-cycle of this development? How frequently is it changed?
      • How modular does this need to be?
      • Will this functionality be replaced by another CQ effort running in parallel?
      • Do authors need to interact with it and set parameters and variables that customize it for that given instance of the function?
      • Would exposing dialogs to CQ authors help the website? or confuse the issue?
      • How complex do they expect the CQ effort to be? Duration? How does it impact project time-lines and time to market?

...

-------------

Read the complete post at the Six Dimensions blog.

Creating OSGi bundles for the Adobe Digital Marketing Suite using CRXDE

- Scott McDonald, Senior Content and Community Lead - Adobe Digital Marketing

You can create an OSGi bundle that can be used within the Adobe Digital Marketing Suite by using CDXDE. An OSGi bundle is essentially a Java module that contains application logic that meets your business requirements. An OSGi bundle lets you dynamically load, unload, configure, and control the Java module without restarting the server. CRXDE is the IDE that lets you develop applications for Adobe CQ (part of the Adobe Digital Marketing Suite).

An OSGi bundle can use third-party JAR files. That is, classes located within a third-party JAR file can be used within an OSGi bundle. To demonstrate how to create an OSGi bindle that uses a third-party JAR file, this development article uses a third-party JAR file and EchoService.jar. This JAR file contains the following basic Java class named EchoService2.

package com.adobe.myexample;
public class EchoService2 {
    
    public String sayHello(String val){
        
        return "Echo Service says: " +val ;
    }
}

Note: Before following along with this development article, install Adobe CQ 5.5 and have it running. Also, ensure that you have CRXDE, which is the development environment. Finally create a JAR file named EchoService.jar and ensure that it contains the EchoService2 class shown above. 

The objective of this article is to demonstrate how to create an Adobe CQ project that uses an OSGi bundle. The OSGi bundle uses the EchoService.jar file and makes use of the EchoService2 class. To create an Adobe CQ project that uses an OSGi bundle, perform the following tasks:

  1. Create an Adobe CQ 5.5 application that contains the page that displays results from the OSGi bundle.
  2. Create a template on which the page component is based.
  3. Create a render component that uses the template.
  4. Create the OSGi bundle that uses the EchoService JAR file.
  5. Modify the JSP to call a Java method defined in the OSGi bundle.
  6. Create a new site that contains a page that displays content from the OSGi bundle.

....

--------------

Read the full post at Scott's Digital Community.

Unit Testing in Adobe/Day/CQ5

- Jochen Toppe

There are a two approaches to effectively test your code in CQ5 – either outside of CQ5 using standard unit tests instantiated from your build tool (i.e. maven). While this approach will cover most simple functionality, the need will quickly arise to execute unit tests within CQ5/Sling/OSGi.

Testing outside of CQ5

In addition to your standard junit tests, you can grab a hold of the CRX repository and start writing some basic tests against that. As you can see in the following example, you ca even wrap the JCR-repository in its Sling equivalent:

 
package com.jtoee.cq.test;

import org.a~pache.jackrabbit.commons.JcrUtils;
import org.apache.sling.jcr.api.SlingRepository;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.jcr.Repository;
import javax.jcr.RepositoryException;

public class SimpleTest {
    private Logger log = LoggerFactory.getLogger(SimpleTest.class);

    @Test
    public void runTest() {
        try {
            log.debug("Connecting to respository");
            Repository repository = JcrUtils.
                    getRepository("http://localhost:4502/crx/server");
            SlingRepository slingRepo =
                    new RepositoryUtil.RepositoryWrapper(repository);
            log.debug("Retrieved sling repository");
            // .. do something
        } catch (RepositoryException e) {
            log.debug("Exception retrieving repository.", e);
        }
    }
}

Testing within CQ5

If you’ve dug into CQ5 a little more, you’ve noticed the the power of the OSGi container and have probably started writing a lot of components (services) and wired them together via dependency injection. Luckily there’s a very easy way to run unit tests directly in the container and even use the OSGi-style dependency injection directly in your test, allowing you not only to write simple unit tests but also more involved automated integration tests.

According to the Apache Sling testing guideline there are a few approaches but I shall only focus on one of them today.

....

----------

Read the full blog post at this URL.

Disk space growing on the CQ author server?

- Sensei Martin

If the disk space on the CQ5 author server is growing at 1-2GBs per day, then check on the filesystem, to see where the growth is at.

If you find that the "journal" directory is GigaBytes then check out this article: http://dev.day.com/content/kb/home/Crx/Troubleshooting/JournalTooMuchDiskSpace.html.

Symptoms

With a default FileJournal configuration in place, depending on the activity on the repository, over time, many Journal log-files will be created. This eventually may cause a disk space issue and performance problems in applications that use CRX.

...

-----

Read the full post at this URL.


Copyright © 2012 Adobe Systems Incorporated. All rights reserved.
Terms of Use | Privacy Policy and Cookies (Updated)