khakiout
khakiout

Reputation: 2400

Export XML component from CRXDE Lite

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?

Upvotes: 6

Views: 9349

Answers (3)

Alvaro Montoro
Alvaro Montoro

Reputation: 29645

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.

Upvotes: 8

Alexander Drobyshevsky
Alexander Drobyshevsky

Reputation: 4257

WebDAV is one more way to export and import jcr-repository content; To get access to the repository, at first, you have to take any webdav client (Total Commander with WebDAV plugin is the best or BitKinex). Ensure 'Apache Sling Simple WebDAV Access to repositories (org.apache.sling.jcr.webdav)' bundle is in 'active' state (on the tab 'h t t p://host:port/system/console/bundles'); Just connect to your instance by webdav client by url: host:port\crx\repository\crx.default provide instance's login and password; As a result - you can download or upload files from or into repository to/from your file system. It works more stable than vlt synchronization starting from cq 5.5 (we had problems with cq 5.4); An we had many probles with vlt even on cq 5.6 (like '[ERROR] checkout: java.lang.NullPointerException: null' during check out process)

Upvotes: -1

Tomek Rękawek
Tomek Rękawek

Reputation: 9304

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.

Upvotes: 17

Related Questions