Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to use paths in VLT tool

Avatar

Level 2

Hello,

I'd like to use a command:

vlt.bat -v --credentials admin:admin import http://localhost:4503/crx . /

Above example imports all files and directories in jcr_root. I'd like to specify local path to import just one/several folders. I tried many ways to put the local path as argument, but I always get errors, for example:

[ERROR] import: java.io.IOException: The filename, directory name, or volume label syntax is incorrect

 

Could anybody help me and tell me what is the proper way to write paths in the command?

 

Thanks in advance,

Bernard

 

EDITED:

I got to know something new.

"." means current folder, and works like %cd% 
When I call the command with . /etc/docroot/myproject/common/css, VLT tries copying all content from local jcr_root o  /etc/docroot/myproject/common/css on the CQ server, of course with errors:

[ERROR] E /etc/docroot/myproject/common/css/etc/map.publish/http/www.example.cm/home-html (java.lang.IllegalStateException: Parent
node not found.)

If I call the command with ./etc/docroot/myproject/common/css /etc/docroot/myproject/common/css there occurs an error

[ERROR] import: java.io.FileNotFoundException: C:\workspace\myproject\myproject-docroot\src\main\cq\jcr_root\etc\docroot\myproject\common\css\etc\docroot\myproject\common\css

So as I said before - dot works like %cd% and the path after the dot is added to the path

 

What I just want to do is importing files from the current folder (ex. css) to the analogical folder on the server.

1 Accepted Solution

Avatar

Correct answer by
Level 2

Hi smacdonald,

You helped a lot.

Thanks to the tips I've found the solution.

curl -T C:\workspace\myproject\myproject-docroot\src\main\cq\jcr_root\etc\docroot\myproject\sites\path\to\file\someStyle.css -u admin:admin -v http://localhost:4502/etc/docroot/myproject/sites/path/to/file/someStyle.css

However if the path doesn't exist you have to create it. You can't create it in one command (well, I don't know the way, if you know it, let me know, please), so for each parent folder you have to call:

curl -u admin:admin -X MKCOL -v http://localhost:4502/etc/docroot/myproject/sites/path/to

curl -u admin:admin -X MKCOL -v http://localhost:4502/etc/docroot/myproject/sites/path/file

After creating the path you can upload file with the first command.

Now I want to make a batch script which will be called from SublimeText (or any other editor). This way frontend developer will be able to upload files just like that.

BTW

It works for me, I have Windows 7.

View solution in original post

9 Replies

Avatar

Level 1

Looks like I've faced with similar issue. I'd like to use vlt import command for sub-tree import only (ex. /apps/test) but when I try this vlt starts full import based on corresponding filter.xml. Is it possible to import only sub-tree /apps/test regardles filter.xml?

Avatar

Level 10

Here is an URL to an old community thread that may help:

http://forums.adobe.com/thread/987065


 

Avatar

Level 2

Hi Ivan,

you're right. It's quite the same thing which I want to do.

Avatar

Former Community Member

I too have a number of problems with the VLT import function. Here's today's problem.

According to the VLT import help the import syntax is:
import -v|-s|--sysview <uri> <local-path> <jcr-path>

What is the relationship between the <jcr-path> in the command line and the path in <filter root=""/>?
Consider the following cases:

1 - Import works fine with the <jcr-path> empty and a 'normal' filter path, e.g. "/content/something/somethingelse" that represents a path in the Vault.

2 - I have found no way of usefully combining the jcr-path and the filter path.

Two absolute paths are concatenated and the import just goes around in circles.
Any kind of relative path is rejected 'java.io.IOException: Only absolute paths allowed'
Most of my experiments with the filter path lead to ' java.lang.NullPointerException: null' (e.g. empty, removing it altogether, etc.)

I want to be able to store a file structure in a vault and then insert it in the repository according to the jcr-path. Therefore, what is the relationship between these paths?

So far I have not found this point documented anywhere.

Thanks for your help.

Avatar

Correct answer by
Level 2

Hi smacdonald,

You helped a lot.

Thanks to the tips I've found the solution.

curl -T C:\workspace\myproject\myproject-docroot\src\main\cq\jcr_root\etc\docroot\myproject\sites\path\to\file\someStyle.css -u admin:admin -v http://localhost:4502/etc/docroot/myproject/sites/path/to/file/someStyle.css

However if the path doesn't exist you have to create it. You can't create it in one command (well, I don't know the way, if you know it, let me know, please), so for each parent folder you have to call:

curl -u admin:admin -X MKCOL -v http://localhost:4502/etc/docroot/myproject/sites/path/to

curl -u admin:admin -X MKCOL -v http://localhost:4502/etc/docroot/myproject/sites/path/file

After creating the path you can upload file with the first command.

Now I want to make a batch script which will be called from SublimeText (or any other editor). This way frontend developer will be able to upload files just like that.

BTW

It works for me, I have Windows 7.

Avatar

Level 10

When you mentioned that the AEM docs do not answer your questions -- can you let me know what questions that docs fail to address. I am working with that team and we will get those docs improved and your questions answered. Please list all questions in the reply. Thanks,

Avatar

Level 2

Thank you for the links. I know the sites, but unfortunatelly the don't answet for my question.

Have a nice day,

Bernard

Avatar

Level 10

I am sorry to hear that the AEM VLT doc topic did not address your needs. I have reached out to the docs team and they will follow up.