jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Parvez Ahmad <parve...@gmail.com>
Subject Re: version creation using httpclient
Date Tue, 13 Sep 2011 13:08:06 GMT
sir,
I did that but got no answer.
I actually want to create version using webdav rather than RMI repositories
I need to add a label to every version that i create.
My best regards. I am fan of jackrabbit team and make my living by use of
your invention-- jackrabbit.

I am struggling to create version for a file from last 15 days. Version is
getting created but I am unable to retrieve the version labels using code. I
am using httpclient and am creating version for the file using webdav.

I use jackrabit/apache sling. I want to retrieve version labels. Please help


regards
Ahmad
Kashmir
Srinagar Kashmir India

Sample code i use is :-
  public void createVersion(String un_encoded_virtual_Path){
        String virtualPath = Utility.encodePath(un_encoded_
virtual_Path);
        String remotePath = getServerRoot() + virtualPath;
        int status;
         try {
             VersionControlMethod vcMethod = new
VersionControlMethod(remotePath);
              executeMethod(vcMethod);
             vcMethod.releaseConnection();

             // execute check in and check out methods

             if(urlExists(remotePath)){
                 /**
                    CheckoutMethod checkOut = new
CheckoutMethod(remotePath);
                    executeMethod(checkOut);
                    checkOut.releaseConnection();
                    */

                    CheckinMethod checkIn = new CheckinMethod(remotePath);
                    executeMethod(checkIn);
                    checkIn.releaseConnection();
            }


             LabelMethod lbMethod = new LabelMethod(remotePath,"FLINTOFF",
LabelInfo.TYPE_ADD);
             status  = executeMethod(lbMethod);
             System.out.println("status : " + status + "--" +
lbMethod.getResponseBodyAsString());



           } catch (Exception e2){
               e2.printStackTrace();
           }



    }
    public List<VersionVo> getVersions(String un_encoded_virtual_Path){
         List<VersionVo> lstVersions = new ArrayList<VersionVo>();
        String virtualPath = Utility.encodePath(un_encoded_virtual_Path);
        String remotePath = getServerRoot() + virtualPath;
         try {
              /// get versions
             // create the report
            // I am unable to get version names  using reportmethod , though
I get the URLS of versions
I want to attach version name to every version

 regards
Ahmad

On Tue, Sep 13, 2011 at 6:10 PM, Julian Reschke <julian.reschke@gmx.de>wrote:

> On 2011-09-12 13:27, Parvez Ahmad wrote:
>
>> Sir,
>> My best regards. I am fan of jackrabbit team and make my living by use of
>> your invention-- jackrabbit.
>>
>> I am struggling to create version for a file from last 15 days. Version is
>> getting created but I am unable to retrieve
>> the version labels using code.
>>
>> I use jackrabit/apache sling. I want to retrieve version labels. Please
>> help
>> ...
>>
>
> Please be more specific -- "/// HERE I SEE THE PROBLEM" isn't very helpful
> for people trying to understand what you want to do, and what might be going
> wrong.
>
> Best regards, Julian
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message