Export XML component from CRXDE Lite - 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?

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.

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)

Related

Adding a CHM help file in VSIX to distributed developer guide

I am writing VSIX to distribute a multi-project template with wizard for VS 2013, which allow user to write extensions for our application. I have problem in providing a user guide document, which is a chm file, along with template. VSIX manifest allow me to provide a "Getting Started Guide", however file support by these feature does not includes "CHM" file.
We use RoboHelp to create CHM, there is an option to create html files too. however the html files created are multiple files distributed into multiple folders (there is a index page, which has the link to all other html files). I am not sure how to package these files into VSIX.
I have few questions here;
Is it possible for us to run any script or batch file as part of
vsix installation?
Is it possible to create a Windiows Start manu folder to show a link to chm file?
If I point "Getting Started Guide" to any inner directory html file.
"Getting Started" link is not available in "Extensions and Updates",
is there any work around?
Am I doing all wrong? is there better way to provide a template &
help?
If i decide to deploy html help; I am thinking of deploying zipped copy of getting started help, which have many folder and files, then extract during the vsix installation. otherwise i need to mark each of those 100+ file as "Include in VSIX"
You can add the .chm (or any other file type) to the package project, select the file in the Solution Explorer, show the Properties window for the file (not for the project, and set the "Include in VSIX" property to true.
1: you can run any code on launch of your extension.
2: you can add any commands to the Tools menu
Made chm file as part of vsix and marked it as "Include in VSIX" as
suggested by #Carlos Quintero
Create a new Visual Studio Package project (using Templates -> Visual C# -> Extensibility -> Visual Studio Package) for adding a new menu item for our sdk help under VS IDE "Help" menu.Visual Studio Package wizard will be shown
Page 1) Welcome page
Page 2) Select a Programming Language: allow us to choose a programing language & way to sign the assembly
Page 3) Basic VSPackage Information: like company name, VSPackage name, icon, etc.
Page 4) Select VSPackage Options: Select Menu Command checkbox, This menu item will be added in VS IDE -> Tools
Page5) Command Options: Provided information for the menu, name & id.
After providing this information "Finish" the wizard using button
provided.
Open the ".vsct" file in the newly created project and look for "IDM_VS_MENU_TOOLS" and change it to "IDM_VS_MENU_HELP" move the menu item to VS IDE -> Help
MenuItemCallback method in the main class of the project to open chm file.
private void MenuItemCallback(object sender, EventArgs e){
string codeBase = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
UriBuilder uri = new UriBuilder(codeBase);
string path = Uri.UnescapeDataString(uri.Path);
string helpFilePath = string.Format("file://{0}\\myHelp.chm", System.IO.Path.GetDirectoryName(path))
System.Windows.Forms.Help.ShowHelp(null, helpFilePath); }

Eclipse - Making a file quickly accessbile

I use eclipse (Spring STS actually). I need quick access to two files:
- web.xml
- servlet-context.xml (spring config)
Every time I want to open the files, I need to find them and that takes time.
Is there a way to create a link on the root folder of a project? This way I can quickly access it?
Thanks!
One option is to use Ctrl+Shift+R and type the name of the file that you want to open.
You can also create a link to some file under the root of the project:
Right click the project and select New->File
In the New File dialog click Advanced and then select Link to file in the file system
Click Browse and select the file for which you want to have quick access
Click Finish and you are done

How to add a file as a link in Eclipse

In VS 2008 there is a nice feature that I can share a single file between two projects
How can i do the same in Eclipse (Android)
For Java, you can right click on the project and go to Properties then into Java Build Path. Under the Source tab you can click on the Link Source... button and then input the location of your common source directory - that will allow you to put all "shared" files in the one spot and link them into the projects you want.

Open directory containing a source file via Eclipse

In Visual Studio, or MyEclipse, you have a button which is able to locate a source file on disk, and open the containing directory in Windows explorer.
This is useful, for example, to browse images, or to use an other tool when a conflict occurs in CVS or SVN.
What would be the way to do it in Eclipse with a free plugin, or without any plugin ?
I found it :
"In eclipse, it is common requirement to open the folder containing source file but there is no direct method to do that like in Visual studio of Microsoft."
http://shivasoft.in/blog/others/tips/locate-source-file-on-local-disc-in-eclipse-external-tool/
An actual plugin can be found at http://blog.samsonis.me/2009/02/open-explorer-plugin-for-eclipse/
And version 1.5 can be found here http://blog.samsonis.me/2011/08/openexplorer-eclipse-plugin-1-5-0/
One that I've since upgraded to & find more useful
http://basti1302.github.io/startexplorer/
I always do this:
right click on file/folder, show in..., system explorer. Done.
I guess we don't need a plugin to do that, or I am misunderstanding the question?? I am using Luna 4.4.2 on Windows 7.
On Mac you can follow this steps to add it without a plug-in:
Click the disclosure icon to the right of the External Tools icon:
Select External Tools Configuration:
The External Tools Configuration window will appear. Select Programs and then click New Launch Configuration:
This will create a new launch configuration. Enter a name of the configuration in the name field:
In the Location field enter the path to the Open Finder, "/usr/bin/open" without quotes:
In the Arguments field enter the following argument, "${container_loc}" with quotes:
Click Apply. It should look like the following:
Switch to the build tab and deselect Build before launch:
Switch to the Common tab and select the External Tools checkbox in Favorites. Click Apply again and close out of the window.
You are done. Now to use:
Select a file or folder in Eclipse Package Explorer.
Click the disclosure icon to the right of the External Tools icon:
Select the Open Containing Folder from the drop down menu:
You're file or folder should open in Finder.
PRO TIP: After you use the external tool once you can click the External Tools icon again and it will run the last used external tool. In other words, you won't need to select it from the pop up menu each time.
You can also look up the source directory by right clicking on the project, going to properties, and looking at "Location: ... "

How to use eclox, the doxygen plugin for Eclipse

How do I get eclox working in Eclipse 3.5?
I'm using Ubuntu 9.04. I installed Doxygen from ubuntu repositories(version 1.5.8). Then I installed eclox on eclipse through the update site.
Despite this, I don't get any option to in any menu to initiate it.
Also the eclox site doesn't seem to have any "getting started" guide.
Please help.
BTW there is a manual inside org.gna.eclox_0.8.0.jar, wierd they did not post this on the project site!!!
Here is the content
Eclox, a Doxygen frontend plugin for Eclipse.
<http://gna.org/projects/eclox>
INSTALLATION
There are two options to install the plugin: using the update site or
using the packaged feature.
The update site is the more convenient way to install eclox. It is
located at https://anb0s.github.io/eclox. See eclipse's user
guilde for additionnal details.
When using the packaged feature, you must extract the archive content into
your eclipse's root location. For additionnal details, please refer to
eclipse's user guide.
CONFIGURATION
Once the plugin installed, you must ensure that the default PATH environment
variable makes the doxygen binary reachable for the plugin. If not, you can
update PATH to include to directory containing the Doxygen binary, or you can
tell Eclox where that binary is located on your system (which is in my opinion
the better solution). To do this, open eclipse's preference edition dialog
window and go into the new "Doxygen" section.
USAGE
You can create new Doxygen projects (also called doxyfiles) using the
creation wizard. Go to "File->New->Other->Other->Doxygen Configuration". Press
next and set both file location and name. Then a empty doxyfile will be
created at the specified location, the wizard automatically adds the
".Doxyfile" extension.
You should now see a file with a blue #-sign icon. This is your new
doxyfile. Double-clicking on it will open the editor. You can now browse and
edit the settings.
Once your have properly set all doxyfile fields, you can launch a
documentation build using the toolbar icon showing a blue #-sign. In
the case the button is not visible in the toolbar, your current perspective
needs to get configured. Go to "Window->Customize perspective->Commands" and
in "Available command groups" check "Doxygen". Additionnaly, you can browse
the laetest builds by clicking the down arrow right to the toolbar button.
When the documentation build starts, a new view showing the build log opens.
In its toolbar, a button named "Stop" allows you to halt the current build
process. The current build also appears in the Eclipse job progress view and
you can control the job from there.
The build toolbar action determine the next doxyfile to build depending on
the current active workbench part (editor or view) and the current selection
in that part. For example, if the active part is a doxyfile editor, the next
doxyfile to build will be the one being edited. If the active part is the
resource explorer and the current selection is a doxyfile, that doxyfile will
be next to get build. In the case the active part selection doesn't correspond
to a doxyfile, the last built doxyfile will be rebuiled. And if the build
history is empty, you will be asked for the doxyfile to build.
HTH Anybody
Never mind, worked it out my self.
First you need to create a DoxyFile (which is the configuration file) by giving the source path and the output path.
Then only you can generate the documentation by right clicking the project and selecting the "Generate Documentation".
Thanks anyway!
I just faced a problem setting the Doxygen binary path in eclox 0.8.0 settings in Eclipse on Mac OS X 10.7.
There is no way to configure the path via Eclipse-preferences->Doxygen.
The solution is to edit the preferences file manually
add a (fake) location, let's say /Applications, using the wizard mentioned above.
close Eclipse
edit this file:
$WORKSPACE/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.gna.eclox.core.prefs:
Replace the value for doxygen.default (currently eclox.core.doxygen.CustomDoxygen /Applications\n) with eclox.core.doxygen.CustomDoxygen /Applications/Doxygen.app/Contents/Resources/doxygen\n.
restart Eclipse
For MacOS user there is a very easy way to get around via the issue of the Doxygen version selection. The link that provides details is here:https://github.com/theolind/mahm3lib/wiki/Integrating-Doxygen-with-Eclipse
After installing the Eclox plugging:
1)"go to "Eclipse --> Preferences --> Oxygen"
2)"Press Shift+CMD+G then Add: "/Applications/Doxygen.app/Contents/Resources/doxygen"
3) Doxygen's version should be displayed
this might help you or any windows user trying to install eclox:
Tutorial for Installing eclox — Document Transcript
Step 1: go to eclox website (http://home.gna.org/eclox/) and to copy the update link address.Step
step 2: Insert the link into the update manager in eclipse and press OK.
Step 3: Select the Eclox item and to complete the installation.
Step 4: When the installation has done, you should select a project that you want to generate thedoxygen documents. Then, create a doxygen project for it.
Step 5: config the options. Note: You have to provide the “Input directories” correctly and to select the “Scan recursively”item. Finally, save the configuration file.
Step 6: find out the “#” and to choice “Choose Doxyfile...”.
Step 7: select a doxyfile.Step 8: wait for few seconds and the doucments will be generated.
its from this link: http://www.slideshare.net/pickerweng/tutorial-for-installing-eclox
Like claus I had to dig into the preferences file maually, because eclox 0.8.0 would just not take a good path from Eclipse Preferences file chooser.
So, edit this file: $WORKSPACE/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.gna.eclox.core.prefs and alter the given path (in my case I had to change from
doxygen.default=eclox.core.doxygen.CustomDoxygen C\:\\Programm Files\\doxygen\\bin
to this
doxygen.default=eclox.core.doxygen.CustomDoxygen C\:\\Programme\\doxygen\\bin
Hope this helps.
I find a webpage https://github.com/theolind/mahm3lib/wiki/Integrating-Doxygen-with-Eclipse where you can find more details. Especially, for Mac users, you need to Press Shift+CMD+G then Add: "/Applications/Doxygen.app/Contents/Resources/doxygen" when you configure the doxygen in eclipse before compiling .doxygfile by using Eclox.
Alternative from eclipse is to use Javadoc:
From menu (...Search Project Run...)
Project > Generate Javadoc
You should be in Java project and add comments with tags.
!!!