In our source code, we have some dialog.xml files to represent the structure of our dialog components. We deploy the project via maven to our local CQ server for development and testing. There are times we need to modify the dialog component via CRXDE Lite (in the CQ server) because it's much faster to edit the dialog that way.
The problem is: How do I export (from CRXDE Lite) the edited dialog component back to it's corresponding dialog.xml file?
CRXDE Lite itself doesn't provide export-to-XML feature, but you can get your dialog.xml in a few different ways. Let's assume you want to get dialog for the /libs/foundation/components/text component: 1. Sling GET servlet - quick & dirty
With CRXDE Lite, you can create a project, create and edit files (like .jsp and .java), folders, templates, components, dialogs, nodes, properties and bundles while logging.
Open CRXDE Lite in your browser. In the Navigation pane, right-click the folder under which you want to create the new folder, select Create …, then Create Folder …. Enter the folder Name and click OK. Click Save All to save the changes on the server.
CRXDE Lite is part of the AEM quickstart and is available to you to access and modify the repository in your local development environments within the browser. With CRXDE Lite, you can edit files, folders, nodes, and properties. The entire repository is accessible to you in this easy-to-use interface.
CRXDE Lite itself doesn't provide export-to-XML feature, but you can get your dialog.xml
in a few different ways. Let's assume you want to get dialog for the /libs/foundation/components/text
component:
1. Sling GET servlet - quick & dirty
Enter the dialog path to your browser and add .xml
extension:
http://localhost:4502/libs/foundation/components/text/dialog.xml
2. VLT - recommended way
Use VLT Tool which is a standard way to synchronize between JCR and local filesystem:
vlt export http://localhost:4502/crx /libs/foundation/components/text my-export
# cat my-export/jcr_root/libs/foundation/components/text/dialog.xml
3. Package manager
Open /crx/packmgr/index.jsp
and click Build on the package that contains the first version of dialog. It'll rebuild the package using current content. Download the package, unzip it and find appropriate dialog.xml
file inside.
Another way of doing this (related to the third option described in Tomek Rękawek's answer) is to create a package using CRXDE Lite's Package Manager. Here is an easy step-by-step guide on how to do it:
Open CQ5, and go to CRXDE Lite.
Click on the "Package" icon on the top bar
Click on the "Create Package" link.
A pop-up will open, enter a name and version for the package that you want to create and assign it to a group:
Now the package that you created will be displayed in the list of packages, click on its title to get some additional options:
Click on edit and a new pop-up window will show up. Then click on the "Filters" tab, you should not have any as you just created the package:
Click on "Add filter" button, and enter the path of the component that you wan to export in the "Root path" field (for example, I created a textimage2 component for the Geometrixx app based on this tutorial):
Click on "Done", the filter should show now:
Click on the "Save" button.
The filter should display now in the description of the package. Click on the "Build" option:
A confirmation message will be displayed, click on "Build" again:
Now all the options for the package will be active. Click on the "Download" one to get the ZIP with all the files.
Extract the contents of the ZIP file, the dialog.xml file will be there for you to modify.
I know the process may seem a bit long, but it is really easy to complete, and it has the great advantage of being reusable: once you create a package, you only need to rebuild it to get the latest version of the component's code in ZIP.
It is really easy to import/share too once modified: just zip again all the files (keeping the folder structure) and use the "Upload Package" feature from CRX Package Manager.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With