Export XML component from CRXDE Lite
Asked Answered
C

3

6

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?

Conn answered 25/7, 2014 at 8:7 Comment(0)
E
17

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.

Environs answered 25/7, 2014 at 8:48 Comment(3)
Thank you for your answer :) I noticed that Step 1 and Step 3 produced different but similar results. Step 1 includes a lot of xmlns: attributes in the <dialog> root. Also, Step 1 does not include the String[] properties of node. While Step 3 does. I still have trouble making Step 2 work as of now. But Step 3 is what I need :) Will still try to make Step 2 work. Thank you!Conn
Option 1 has <lists jcr:primaryType="nt:unstructured"/> compared to <lists jcr:primaryType="nt:unstructured" features="[unordered]"/> from Option 3. This is from an rtePlugins node if you wish to know.Conn
I managed to make the Option 2 work. I was removing the space between the host uri and the jcr-path before and that causes the error. :) Thank you!Conn
B
8

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.

Buskined answered 19/11, 2015 at 18:5 Comment(1)
Thank you for the detailed answer about the CRX Package Manager. Yes, I use both this and step 3 a lot. :)Conn
A
-1

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)

Adai answered 29/7, 2014 at 8:23 Comment(2)
Hi Alexander, when i was using WebDAV I can only upload and copy files such as JSP and image files. But I can't export the generated component xml using that. What worked was the VLT tool described in the other answer.Conn
WEBDav fits for downloading and uploading binary files and making folder structure, but, yes, it is not suitable for copying of component resources (as dialog). My point is in alternative way of how to download some structures from repository.Adai

© 2022 - 2024 — McMap. All rights reserved.