Thursday, August 28, 2014

Finding out what components my page is using

There are a few ways to do this. One way is to go into the felix console: http://localhost:4502/system/console/bundles, and go under main, and click on the "Sling Resource Resolver" link. Enter the url you want to know more about and press enter. It will give you a list of possible pages it is using. Open up crx/de or the Eclipse plug-in and find the page, and find where the page or template is located.


A quicker way is to add ?debug=layout to the end of the url of the page in question. It will display where every component on your page is located.

Thursday, August 7, 2014

AEM Blogs in the Community worth reading - Work in Progress

I seem to continually go to these blogs for some reason...

Blog for How to in Adobe CQ or WEM by Yogesh Upadhyay
http://www.wemblog.com/

Jorg Hoh - Tips and tricks for CQ5 and Adobe AEM, trying to avoid BS
http://cqdump.wordpress.com/

AEM Operations
http://cq-ops.tumblr.com/

AEM 5.6 - Quick Reference
http://activecq.com/system/assets/46/original/quick-reference.html

Monday, August 4, 2014

AEM 6 - Asset Improvement Capabilities

Dynamic video
  • Preview and annotate videos (Notes at certain parts of videos)
  • Set video profiles for auto-encoding
  • Insight into viewer drop-off reporting to improve video content
  • Smart, responsive video players that automatically resize based on page break points
  • Video deliver in the cloud. Device optimized streaming on demand
  • Video Publishing. Easily add videos to web properties using sites components, URL or embed code
  • Social Video: Grow reach by publishing to YouTube and Social Sharing (Facebook, Twitter, Linked-in, etc…)
Dynamic media
  • Sizes, Formats, resolutions without knowing the device or browser. Creates multiple renditions based on one asset.
  • Dynamic Image Rendition 
    • Swap out colors dynamically
    • Create media sets for 360 degree views. Think of looking at a car from all angles.
Metadata, search, workflow, and share
  • Bulk Metadata Operations
  • Smart Collections - Think saved searches that update automatically
  • Easy Metadata Schema definitions with ability to set fields as required / visible
  • Search paths, mime types, last modified, file size, orientation, style, video height, video width, publish status, approval status. Much easier to add custom tags.
  • Saved Searches and share with other teams
Task and Workflow Management
  • Photoshoot-to-site workflow
  • PIM Integration (Product Information Management)
  • Organize Teams
  • Track tasks and Deadlines
  • Pre-configured workflows
  • Review and Approval
  • Dashboards and team assignments
Admin & Security
  • Reports
    • Added
    • Downloaded
    • Modified
    • Expired License
    • Published 
    • Custom
Creative Cloud integration

Significant Engine Improvements

  • TarPM and MongoDB as preferred repositories
  • Reads and Writes Improvements
  • Many Performance improvements

Monday, July 28, 2014

Using Automated Tests for Sling Based Applications

Testing Sling based Applications:
http://sling.apache.org/documentation/tutorials-how-tos/testing-sling-based-applications.html

Automated UI Testing
http://www.seleniumhq.org/


AEM Dev Tools for eclipse released TODAY

Just released today. The new AEM Dev Tools for Eclipse:

Need the stand-alone files if you work disconnnected?, you can get the contents here:
http://eclipse.adobe.com/aem/dev-tools/com.adobe.granite.ide.p2update-1.0.0.zip

Use this link to learn how to use it:
https://sling.apache.org/documentation/development/ide-tooling.html

The main features of this Eclipse plugin are:
  • Seamless integration with AEM instances through Eclipse Server Connector.
  • Synchronization for both content and OSGI bundles.
  • Debugging support with code hot-swaping capability.
  • Simple bootstrap of AEM projects via a specific Project Creation Wizard.
  • Easy JCR properties editing.
Here are a few screenshots of the plug-in in action. It's a great tool that will get you away from using CRXDE Lite and finally optimizes your development workflow. You will still need to configure your filter.xml to set what syncs to your server.

Configuring the server, publishing changes

Adding Nodes

Local changes automatically published

Setting Properties

Wednesday, July 23, 2014

Migrating Assets Approach

I'm working on a project that requires a significant asset migration from a legacy system. I've used this approach for a few different migrations from legacy systems, and it has not failed me yet. As much as I would like to use a connector or some other easy route out of a lot of code, I didn't have a choice because the legacy software was ancient or the customer didn't want to keep both systems up.

So, the approach was to:
  1. If this is a mass asset migration, turn off the workflow, "DAM Update Asset" and any other custom workflows that might interfere and cause noise.
  2. If you have a slave, turn it off to eliminate another variable. When you turn the slave on, it will sync.
  3. Ensure your aem instance is patched.
  4. Go into the legacy system, zip up each package of content with an associated metadata xml file
  5. Curl it over from the legacy system to AEM to a place under /content/dam/migrate/
  6. Excluded a directory from the DAM Update Asset workflow so it wouldn't create renditions of content I was about to migrate. (see my post about regular expressions)
  7. Create a workflow launcher that listens for zip files being created in that directory
  8. Execute a custom workflow model
    1. Created a custom workflow step that saves the path. This was needed because the payload gets destroyed in the next step.
    2. Executes the DAM unarchiver workflow to extract the contents, destroys the zip
    3. Execute a custom workflow step to process the data
      1. Use the path stored in step 1, use JAXB to read the data from the XML file
      2. Create the asset/page/etc... and add the custom data fields as needed
I've used other variations in my workflow model to DRM documents using the LiveCycle connector, executing other processes, and sending emails.

If you migrated a ton of assets, you can put the assets back into the "DAM Update Asset" workflow by using the script here:
http://www.wemblog.com/2012/09/how-to-put-dam-asset-back-to-workflow.html

AEM 6 Reference materials

AEM 6 Documentation
http://docs.adobe.com/docs/en/aem/6-0.html

What's new in AEM 6?
http://cq-ops.tumblr.com/post/86504895994/whats-new-in-aem-6-0

Gems on Adobe Experience Manager - Many recorded in depth videos
http://dev.day.com/gems

AEM 6.0 and Admin Sessions
https://cqdump.wordpress.com/2014/06/23/aem-6-0-admin-sessions/

What is Sightly? (Preferred HTML templating system in AEM 6. No more JSP's!)
http://docs.adobe.com/content/docs/en/aem/6-0/develop/sightly.html

AEM 6 Hotfixes
http://helpx.adobe.com/experience-manager/kb/aem6-available-hotfixes.html

RELEASED TODAY (July 28th, 2014) - The AEM Sightly Brackets Extension:

Thursday, July 17, 2014

Another way to get an OSGI Reference

The code below will return a ResourceResolver without using an annotation. This will significantly clean up your method signatures in many cases. The only caveat to using this approach is understanding how this command will execute (currently under admin), so if you need to perform an action under a particular user, you will need to pass in additional parameters depending on what you're trying to do.


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.resource.ResourceResolverFactory;
org.osgi.framework.ServiceReference;

private ResourceResolverFactory factory;

...
private ResourceResolver getResolver() throws LoginException {

//Get the Bundle's context
BundleContext context = FrameworkUtil.getBundle(this.getClass().getBundleContext();
//Set the service reference you want
ServiceReference ref = context.getServiceReference(ResourceResolverFactory.class.getName());
//Retrieve the Service
factory = (ResourceResolverFactory) context.getService(ref);
return factory.getAdministrativeResourceResolver(null);

}
...

Regular Expressions and Workflow Launcher Paths

An invaluable tool to configuring workflow launcher paths is regular expressions. The rules that are used to launch models uses regular expressions. I've been using www.regexr.com to test and validate my launcher paths with great success. There are a few other sites out there, but this one has worked for me.

Friday, July 11, 2014

Applying Hotfixes to CQ 5.6.1

On most projects we just patch the environments individually and create a document which lets us know which ones have been installed, i.e not checking them into github/other SCM. You should be judicious in choosing which hotfixes you install. The following link shows in bold which ones are important and I would start with just those. If you're not using a feature such as twitter, social, and others, I wouldn't install.

http://helpx.adobe.com/experience-manager/kb/cq561-available-hotfixes.html

For installing, one approach is to curl the hotfixes over with sleep statements between each statement. Be aware of hotfix 3285. For now, you need to downgrade com.adobe.granite.ui.commons-5.5.86.jar and use 5.5.77.CQ561-006.

Tuesday, July 8, 2014

Structuring Content for Faceted / QueryBuilder Searches

Tip #1 - Use the correct data types and ensure values are saved correctly. For example, if you have a date that is being saved as a string. Everything may seem fine right now, but as soon as you want to use QueryBuilder to find the content, it won't return the results you expect.

Tip #2 - Never, ever use custom data types. Use mix-ins. You've been warned.

Tip #3 - Test your content to make sure it is searchable by using the Query Builder Debugger. http://localhost:4502/libs/cq/search/content/querydebug.html

Tip #4 - Don't over complicate your data structure. For example, don't nest a bunch of nt:unstructured nodes so it makes it impossible to search the content.

Tip #5 - When you search, you typically want to sort by jcr:score. If you're not receiving the results you want, then you need to tweak the rules in your query. For example, if you want to do this at runtime, you could add, "^2" to the end of a query to property the value of a result.

QueryBuilder Predicate Operations

Exists
1_property.operation=exists
1_property=submitted

Not Exists
1_property.operation=not
1_property=submitted

Like
1_property.operation=like
1_property.value=%Apples%
1_property=jcr:title

Equals
1_property.operation=equals
1_property=jcr:title
1_property.value=Apples

Unequals (Not equals)
1_property.operation=unequals
1_property=jcr:title
1_property.value=Apples

Date Ranges
1_daterange.property=@jcr:content/jcr:created
1_daterange.lowerBound=2015-02-22
1_daterange.upperBound=2015-01-01

Skip Node Iterator Count in QueryBuilder (Save significant amount time if you have a custom authorization provider for nodes, but you don't get a count)
p.guessTotal=true