Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Storing a component property under a different node

Avatar

Level 4

I am building a tool under the Tools/Misc admin (/etc) for managing a particular custom configuration.  This tool has some characteristics/constraints that I wish to satisfy:

  1. I would like to build this page with a custom component for the input of the configuration, so that the Content Managers responsible for this configuration has a consistent experience between using this tool and authoring content.
  2. I would like to decouple the tool and its data, so that the tool may be included in and deployed with a project, without affecting the configuration.

In order to satisfy #2, I believe the data must be stored under a node outside of this configuration management tool.

I believe the easiest/preferable approach to this would be if the component's dialog could specify a name outside of the current node (either relative [../../...] or absolute [/etc/persistent/nodename]).  I've attempted this, and while the approach allows me to save the dialog's property value to a different location, it cannot seem to retrieve the data (how peculiar).  Is there a way to make the population of that dialog field work, when the data is stored on a different node?  Example dialog included below.

I've managed to satisfy the requirement by moving the entire component to the other location (/etc/persistent/nodename) and including that component in my configuration manager page.  I'm not sure this is the best approach, though.

Example dialog (this uses the ACS AEM Commons multifieldpanel, but a simple textfield should work also):

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" jcr:primaryType="cq:Panel" title="Options Configuration"> <items jcr:primaryType="cq:WidgetCollection"> <container jcr:primaryType="cq:Widget" collapsible="{Boolean}false" xtype="dialogfieldset"> <items jcr:primaryType="cq:WidgetCollection"> <options jcr:primaryType="cq:Widget" fieldLabel="Options" name="/etc/persistent/options" orderable="{Boolean}true" xtype="multifield"> <fieldConfig jcr:primaryType="cq:Widget" xtype="multifieldpanel"> <items jcr:primaryType="cq:WidgetCollection"> <text jcr:primaryType="cq:Widget" allowBlank="{Boolean}false" fieldLabel="Breakpoint Name" fieldDescription="Appears as the text for options in the Image Rendition dialog." key="text" xtype="textfield"/> <value jcr:primaryType="cq:Widget" allowBlank="{Boolean}false" fieldLabel="Media Query" fieldDescription="The media query that this breakpoint consists of." key="value" xtype="textfield"/> <qtip jcr:primaryType="cq:Widget" fieldLabel="Hover Text" fieldDescription="A mouseover tip to describe the breakpoint, when the option is hovered over." key="qtip" xtype="textfield"/> </items> </fieldConfig> </options> </items> </container> </items> </jcr:root>
0 Replies