Skip navigation
jasonjifly
Currently Being Moderated

I can't execute command "import" with the VLT Tool

Apr 9, 2012 12:36 AM

Tags: #vlt

When I use "exec" of Apache Ant to execute command "import" of the VLT, the VLT always reports errors. Only in this situation, it can work: set <jcrPath> "." and set <localPath> "/" . Once I change any of them, an error message will be displayed by VLT in Console.

How can I set them, when I want to import a file "C:\main\remote\localhost_4502\jcr_root\apps\vdc\test.txt", and the server url is "jcr_root/apps/vdc/test.txt"?? Thanks

 
Replies
  • Justin Edelson
    276 posts
    Nov 24, 2010
    Currently Being Moderated
    Apr 9, 2012 7:02 AM   in reply to jasonjifly

    If you are really just trying to upload a single file, VLT is probably not the right tool for you. Just use curl:

     

    curl -TC:\main\remote\localhost_4502\jcr_root\apps\vdc\test.txt -u admin:admin http://localhost:4502/apps/vdc/test.txt

     
    |
    Mark as:
  • Justin Edelson
    276 posts
    Nov 24, 2010
    Currently Being Moderated
    Apr 10, 2012 4:47 AM   in reply to jasonjifly

    You should use VLT for this, but not import (at least not in day to day operation). When you make a change in Eclipse, run "vlt commit" on the command line to push the changed file into your CRX repository. If there's a new file, run "vlt add <file>", then "vlt commit". If you're removing a file, run "vlt rm <file>" then "vlt commit".

     

    I believe there are ways to hook this into Eclipse as some kind of automatically running external tool, but I don't know the details of this.

     

    import and export are very coarse grained operations. commit (and, conversly update) only deal with the files that have changed. You do need to use import when you are first setting up a project. Usually, the first developer does a checkout from their local repository, then an import into version control and then subsequent developers do a checkout from version control, an import into their local repository, and then a checkout to set up the VLT working copy.

     

    There's also a new "sync" feature available in some versions of vlt which runs as a background process keeping a working copy and repository structure in sync with each other. I'd suggest contacting DayCare if you are interested in this.

     

    Be sure to read http://dev.day.com/docs/en/crx/current/how_to/how_to_use_the_vlttool.h tml, especially the section about a filtered checkout.

     

    Justin

     
    |
    Mark as:
  • Justin Edelson
    276 posts
    Nov 24, 2010
    Currently Being Moderated
    Apr 11, 2012 7:37 AM   in reply to jasonjifly

    It depends

     

    CQ supports Java as a scripting language. This isn't as commonly used as JSP or ESP. You'll see an example here: /libs/foundation/components/parbase/img.GET.java

     

    In this case, if you update the java file using vlt, it'll be recompiled (just like a JSP).

     

    If you are talking about code in an OSGi bundle, just updating the file won't cause the bundle to be recompiled. You should use a CI server for this.

     
    |
    Mark as:
  • Justin Edelson
    276 posts
    Nov 24, 2010
    Currently Being Moderated
    Apr 12, 2012 6:23 AM   in reply to jasonjifly

    I'm sure this is possible. I'd suggest using something like Firebug to capture the HTTP request.

     
    |
    Mark as:
  • Daniel Klco
    7 posts
    Apr 6, 2012
    Currently Being Moderated
    Apr 24, 2012 5:25 PM   in reply to jasonjifly

    If you are using Eclipse, VaultClipse is a tool that might help you.  You can create your content structure inside Eclipse and use VaultClipse to Import and Export it.

     

    http://vaultclipse.sourceforge.net/

     

    Otherwise, I've also seen people create simple forms that make requests against the Sling REST API, but it's kind of clunky and not very reusable.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points