Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export XML component from CRXDE Lite

Tags:

aem

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?

like image 950
khakiout Avatar asked Jul 25 '14 08:07

khakiout


People also ask

How to export crxde Lite dialog to 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

What can I do with crxde Lite?

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.

How do I create a folder in crxde Lite?

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.

What is crxde Lite in AEM?

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.


2 Answers

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.

like image 103
Tomek Rękawek Avatar answered Oct 12 '22 12:10

Tomek Rękawek


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:

  1. Open CQ5, and go to CRXDE Lite.

  2. Click on the "Package" icon on the top bar

    enter image description here

  3. Click on the "Create Package" link.

    enter image description here

  4. A pop-up will open, enter a name and version for the package that you want to create and assign it to a group:

    enter image description here

  5. Now the package that you created will be displayed in the list of packages, click on its title to get some additional options:

    enter image description here

  6. 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:

    enter image description here

  7. 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):

    enter image description here

  8. Click on "Done", the filter should show now:

    enter image description here

  9. Click on the "Save" button.

  10. The filter should display now in the description of the package. Click on the "Build" option:

    enter image description here

  11. A confirmation message will be displayed, click on "Build" again:

    enter image description here

  12. Now all the options for the package will be active. Click on the "Download" one to get the ZIP with all the files.

    enter image description here

  13. 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.

like image 42
Alvaro Montoro Avatar answered Oct 12 '22 12:10

Alvaro Montoro