Quick Tips

A continuously-update list of standalone notes, snippets, and tips extracted from full posts.

CRXDE Lite Isn’t Showing Directories

  • If CRXDE Lite isn’t showing or updating directories, it’s because its session has timed out
  • Log back into CRXDE Lite by clicking on the user name in the top right

Multifields with different xtypes

  • To customize a multifield widget, create another widget inside it called fieldConfig
  • propertyField.get(propertyName, new String[0]) defaults to an empty list instead of null

AEM Author Mode Loading Multiple Sidekicks

  • To check if a page is standalone, compare currentPage.getPath() to resourcePage.getPath()
  • The CQ Sidekick is loaded within pages by including /libs/wcm/core/components/init/init.jsp

Fetching Properties From Dialogs

  • Use the geometrix samples to copy-paste dialog nodes and other boilerplate structures
  • Edit mode is reached by clicking the pencil icon in the CQ Sidekick
  • A component must have some kind of content to be selectable for editing in Edit mode
  • Double-click a component in edit mode to bring up its dialog configuration
  • CRX Explorer is a good tool for exploring properties set by dialogs
  • Within a component, properties.get will fetch its own properties
  • The second parameter of properties.get specifies a default value to get in case no property
  • The second parameter of properties.get cannot be null.  Instead, specify {className}.class
  • To fetch properties from another component, convert it to a Node and call getProperty
  • node.getProperty will fail when a property is not set. First call node.hasProperty
  • To check if a node exists, compare resourceResolver.getResource({path}).getResourceType() to Resource.RESOURCE_TYPE_NON_EXISTING

Creating OSGi Bundles

  • OSGi bundles are standard jar files with extra dependency metadata in META-INF/MANIFEST.MF
  • AEM doesn’t use a /lib folder to drop in 3rd party libraries. Insead it uses OSGi bundles
  • OSGi bundles won’t load unless their dependencies are loaded as OSGi bundles

One thought on “Quick Tips

  1. vikas

    I have a problem that my component is configured and it is not showing up in the author mode but it is showing in the publish mode. How can I make it visible in the author mode/preview mode ?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *