You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Parvez Ahmad <pa...@gmail.com> on 2011/09/12 13:27:39 UTC

version creation using httpclient

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


regards
Ahmad
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
       /// HERE I SEE THE PROBLEM

                ReportInfo reportInfo = new
ReportInfo(ReportType.VERSION_TREE ,DavConstants.DEPTH_INFINITY);
                ReportMethod report = new ReportMethod(remotePath,
reportInfo);
                client.executeMethod(report);
                MultiStatus multiStatus =
report.getResponseBodyAsMultiStatus();
                MultiStatusResponse responses[] =
multiStatus.getResponses();
                String responseAsString = "";
                VersionVo v;
                for(int i = 0; i < responses.length; i++) {
                    responseAsString += responses[i].getHref() + "\n";
                    v = new VersionVo();
                    v.setVersionNodePath(responses[i].getHref());

                    v.setVersionComment("version-" +i++);
                    v.setCreatedDate("hhhhh");
                    lstVersions.add(v);
                }


                report.releaseConnection();

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

Re: version creation using httpclient

Posted by Julian Reschke <ju...@gmx.de>.
On 2011-09-29 17:23, parvez12 wrote:
> Yes i tried that but do not know how to pass  label name_set property to
> htttpropmethod/propertypatch
>   of jackrabbit

Then by all means show us the code that you have, and ask a more 
concrete question.

Best regards, Julian

Re: version creation using httpclient

Posted by parvez12 <pa...@gmail.com>.
Yes i tried that but do not know how to pass  label name_set property to
htttpropmethod/propertypatch
 of jackrabbit


On Thu, Sep 29, 2011 at 7:46 PM, Julian Reschke [via Jackrabbit] <
ml-node+s510166n3855915h0@n4.nabble.com> wrote:

> On 2011-09-29 13:38, parvez12 wrote:
>
> > Hi,
> > Does any body know how to create a named version using webdav in
> > jackrabbit/sling.
> > I am have been struggling on it for a month. The project committers even
> do
> > not know what is the exact way to do it.
> > I my self have 12 years software development .Pleas if you do not know
> it,
> > just make me as a support guy so that i can identify the issues and
> create
> > detailed articles for trivial problems like this.
> > By the way is any solution available. Faced a lot of embarrassment from
> the
> > employer yesterday. What is the fun of having technology which works from
>
> > left to right and not from right to left.
> > Why mercularian does not work on Eclipse  4.1 on push . All open source
> is
> > actually closed source
> > Ahmad Parvez Hakim
>
> You are repeating yourself without providing any new information.
>
> As Angela said, you want the DAV:label-name-set property
> (<http://greenbytes.de/tech/webdav/rfc3253.html#PROPERTY_label-name-set>),
>
> which you should be able to retrieve using PROPFIND.
>
> Did you try that?
>
> Best regards, Julian
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p3855915.html
>  To unsubscribe from version creation using httpclient, click here<http://jackrabbit.510166.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3807209&code=cGFydmV6MTJAZ21haWwuY29tfDM4MDcyMDl8LTE4NjQ4MjI2NTY=>.
>
>


--
View this message in context: http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p3856236.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: version creation using httpclient

Posted by Julian Reschke <ju...@gmx.de>.
On 2011-09-29 13:38, parvez12 wrote:
> Hi,
> Does any body know how to create a named version using webdav in
> jackrabbit/sling.
> I am have been struggling on it for a month. The project committers even do
> not know what is the exact way to do it.
> I my self have 12 years software development .Pleas if you do not know it,
> just make me as a support guy so that i can identify the issues and create
> detailed articles for trivial problems like this.
> By the way is any solution available. Faced a lot of embarrassment from the
> employer yesterday. What is the fun of having technology which works from
> left to right and not from right to left.
> Why mercularian does not work on Eclipse  4.1 on push . All open source is
> actually closed source
> Ahmad Parvez Hakim

You are repeating yourself without providing any new information.

As Angela said, you want the DAV:label-name-set property 
(<http://greenbytes.de/tech/webdav/rfc3253.html#PROPERTY_label-name-set>), 
which you should be able to retrieve using PROPFIND.

Did you try that?

Best regards, Julian

Re: version creation using httpclient

Posted by Parvez Ahmad <pa...@gmail.com>.
Hi,
Does any body know how to create a named version using webdav in
jackrabbit/sling.
I am have been struggling on it for a month. The project committers even do
not know what is the exact way to do it.
I my self have 12 years software development .Pleas if you do not know it,
just make me as a support guy so that i can identify the issues and create
detailed articles for trivial problems like this.
By the way is any solution available. Faced a lot of embarrassment from the
employer yesterday. What is the fun of having technology which works from
left to right and not from right to left.
Why mercularian does not work on Eclipse  4.1 on push . All open source is
actually closed source
Ahmad Parvez Hakim



On Wed, Sep 21, 2011 at 1:09 PM, Angela Schreiber-2 [via Jackrabbit] <
ml-node+s510166n3829227h72@n4.nabble.com> wrote:

> hi ahmad
>
> > is there some sample code .
>
> not really... but if you read about the details of a PROPFIND
> request it shouldn't be a big deal, should it?
> otherwise you may take a look at spi2dav.RepositoryServiceImpl
> which executes quite some PROPFIND requests that retrieve a
> dedicated set of properties.
>
> hope that helps
> angela
>
> > Waiting anxiously for your reply,
> >
> > regards
> > Parvez Ahmad Hakim
> >
> > On Tue, Sep 20, 2011 at 2:55 PM, Angela Schreiber-2 [via Jackrabbit]<
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=3829227&i=0>>
>  wrote:
> >
> >> hi ahmad
> >>
> >>> 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.
> >>
> >> if you access the webdav server responsible for jcr-remoting you
> >> can make use of the protected webdav property DAV:label-name-set
> >> defined by DeltaV. it is exposed by all resources that represent
> >> a jcr version node. since DeltaV defines that property to be
> >> protected to have to explicitly request it in the PROPFIND call.
> >>
> >> hope that helps
> >> angela
> >>
> >>> 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<[hidden email]<
> http://user/SendEmail.jtp?type=node&node=3826252&i=0>>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
> >>>>
> >>
> >>
> >> ------------------------------
> >>   If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> >>
> >>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p3829227.html
>  To unsubscribe from version creation using httpclient, click here<http://jackrabbit.510166.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3807209&code=cGFydmV6MTJAZ21haWwuY29tfDM4MDcyMDl8LTE4NjQ4MjI2NTY=>.
>
>

Re: version creation using httpclient

Posted by parvez12 <pa...@gmail.com>.
Hi,
Does any body know how to create a named version using webdav in
jackrabbit/sling.
I am have been struggling on it for a month. The project committers even do
not know what is the exact way to do it.
I my self have 12 years software development .Pleas if you do not know it,
just make me as a support guy so that i can identify the issues and create
detailed articles for trivial problems like this.
By the way is any solution available. Faced a lot of embarrassment from the
employer yesterday. What is the fun of having technology which works from
left to right and not from right to left.
Why mercularian does not work on Eclipse  4.1 on push . All open source is
actually closed source
Ahmad Parvez Hakim



On Wed, Sep 21, 2011 at 1:09 PM, Angela Schreiber-2 [via Jackrabbit] <
ml-node+s510166n3829227h72@n4.nabble.com> wrote:

> hi ahmad
>
> > is there some sample code .
>
> not really... but if you read about the details of a PROPFIND
> request it shouldn't be a big deal, should it?
> otherwise you may take a look at spi2dav.RepositoryServiceImpl
> which executes quite some PROPFIND requests that retrieve a
> dedicated set of properties.
>
> hope that helps
> angela
>
> > Waiting anxiously for your reply,
> >
> > regards
> > Parvez Ahmad Hakim
> >
> > On Tue, Sep 20, 2011 at 2:55 PM, Angela Schreiber-2 [via Jackrabbit]<
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=3829227&i=0>>
>  wrote:
> >
> >> hi ahmad
> >>
> >>> 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.
> >>
> >> if you access the webdav server responsible for jcr-remoting you
> >> can make use of the protected webdav property DAV:label-name-set
> >> defined by DeltaV. it is exposed by all resources that represent
> >> a jcr version node. since DeltaV defines that property to be
> >> protected to have to explicitly request it in the PROPFIND call.
> >>
> >> hope that helps
> >> angela
> >>
> >>> 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<[hidden email]<
> http://user/SendEmail.jtp?type=node&node=3826252&i=0>>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
> >>>>
> >>
> >>
> >> ------------------------------
> >>   If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> >>
> >>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p3829227.html
>  To unsubscribe from version creation using httpclient, click here<http://jackrabbit.510166.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3807209&code=cGFydmV6MTJAZ21haWwuY29tfDM4MDcyMDl8LTE4NjQ4MjI2NTY=>.
>
>


--
View this message in context: http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p3855303.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: version creation using httpclient

Posted by Lukas Kahwe Smith <ml...@pooteeweet.org>.
On Nov 21, 2011, at 08:22 , parvez12 wrote:

> As a feedback, In webdav implementations of jackrabbit checkout
> method, we should be able to pass a version name that will get
> created.
> When the method is executed we should know get the information about
> the URL of  version of created.
> There should be simple webdav methods for creating, restoring, a
> specific version. The labelmethod and reportmethod are useless.


The davex API in general wasn't really optimized for minimizing HTTP roundtrips. During the implementation of Jackrabbit binding inside Jackalope PHPCR implementation we stumbled over this in a few places and have provided patches that are trickling into Jackrabbit 2.3.x

So in general I can just recommend to identify the places that you feel are inefficient and provide patches.

regards,
Lukas Kahwe Smith
mls@pooteeweet.org




Re: version creation using httpclient

Posted by parvez12 <pa...@gmail.com>.
Thanks Mr. christian for your helping mail.

I checked all the sites, they use jcr rmi repositories to talk to jackrabbit.
I will check what parameters we can pass in checkout method to create a version
with a name(say abc).
It is unfortunate the team who manage jackrabbit are not providing any
documentation, from last two months

As a feedback, In webdav implementations of jackrabbit checkout
method, we should be able to pass a version name that will get
created.
When the method is executed we should know get the information about
the URL of  version of created.
There should be simple webdav methods for creating, restoring, a
specific version. The labelmethod and reportmethod are useless.

regards
Parvez Ahmad Hakim
Software Researcher
Srinagar Kashmir India
www.abobjects.com

On Sat, Nov 19, 2011 at 3:17 PM, Christian Stocker [via Jackrabbit]
<ml...@n4.nabble.com> wrote:
> Hi
>
> Instead of just waiting for an answer, you could have invested some time
> by yourself. Debugging a http-protocol isn't too hard.
>
> 1) write a simple java client, which does what you want. You can take
> https://github.com/jackalope/JavaDavexClient as an example for that
>
> 2) Set up a proxy, which intercepts the HTTP traffic. like
> http://www.charlesproxy.com/
>
> 3) go and see what it does.
>
> If you're more into PHP than Java, you could also check out
> https://github.com/jackalope/jackalope which talks to jackrabbit via
> webdav and implements the major things (like versioning)
>
> and to your question: Use CHECKIN and CHECKOUT as HTTP methods to create
> new versions. But that really isn't too hard to figure out by yourself,
> it's open source after all ;)
>
> christian
>
> On 19.11.11 06:54, Parvez Ahmad wrote:
>> It is sad to see that those how created jackrabbit and sling do not know
>> how to
>> create a version using webdav.
>> Really too bad thing for open source
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p4085973.html
> To unsubscribe from version creation using httpclient, click here.
> NAML


--
View this message in context: http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p4090781.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: version creation using httpclient

Posted by Angela Schreiber <an...@adobe.com>.
hi ahmad

> is there some sample code .

not really... but if you read about the details of a PROPFIND
request it shouldn't be a big deal, should it?
otherwise you may take a look at spi2dav.RepositoryServiceImpl
which executes quite some PROPFIND requests that retrieve a
dedicated set of properties.

hope that helps
angela

> Waiting anxiously for your reply,
>
> regards
> Parvez Ahmad Hakim
>
> On Tue, Sep 20, 2011 at 2:55 PM, Angela Schreiber-2 [via Jackrabbit]<
> ml-node+s510166n3826252h47@n4.nabble.com>  wrote:
>
>> hi ahmad
>>
>>> 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.
>>
>> if you access the webdav server responsible for jcr-remoting you
>> can make use of the protected webdav property DAV:label-name-set
>> defined by DeltaV. it is exposed by all resources that represent
>> a jcr version node. since DeltaV defines that property to be
>> protected to have to explicitly request it in the PROPFIND call.
>>
>> hope that helps
>> angela
>>
>>> 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<[hidden email]<http://user/SendEmail.jtp?type=node&node=3826252&i=0>>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
>>>>
>>
>>
>> ------------------------------
>>   If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p3826252.html
>>   To unsubscribe from version creation using httpclient, click here<http://jackrabbit.510166.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3807209&code=cGFydmV6MTJAZ21haWwuY29tfDM4MDcyMDl8LTE4NjQ4MjI2NTY=>.
>>
>>

Re: version creation using httpclient

Posted by parvez12 <pa...@gmail.com>.
hi Mr Angela
is there some sample code .

Waiting anxiously for your reply,

regards
Parvez Ahmad Hakim

On Tue, Sep 20, 2011 at 2:55 PM, Angela Schreiber-2 [via Jackrabbit] <
ml-node+s510166n3826252h47@n4.nabble.com> wrote:

> hi ahmad
>
> > 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.
>
> if you access the webdav server responsible for jcr-remoting you
> can make use of the protected webdav property DAV:label-name-set
> defined by DeltaV. it is exposed by all resources that represent
> a jcr version node. since DeltaV defines that property to be
> protected to have to explicitly request it in the PROPFIND call.
>
> hope that helps
> angela
>
> > 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<[hidden email]<http://user/SendEmail.jtp?type=node&node=3826252&i=0>>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
> >>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p3826252.html
>  To unsubscribe from version creation using httpclient, click here<http://jackrabbit.510166.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3807209&code=cGFydmV6MTJAZ21haWwuY29tfDM4MDcyMDl8LTE4NjQ4MjI2NTY=>.
>
>


--
View this message in context: http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p3826423.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: version creation using httpclient

Posted by Parvez Ahmad <pa...@gmail.com>.
hi Mr Angela
is there some sample code .

Waiting anxiously for your reply,

regards
Parvez Ahmad Hakim

On Tue, Sep 20, 2011 at 2:55 PM, Angela Schreiber-2 [via Jackrabbit] <
ml-node+s510166n3826252h47@n4.nabble.com> wrote:

> hi ahmad
>
> > 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.
>
> if you access the webdav server responsible for jcr-remoting you
> can make use of the protected webdav property DAV:label-name-set
> defined by DeltaV. it is exposed by all resources that represent
> a jcr version node. since DeltaV defines that property to be
> protected to have to explicitly request it in the PROPFIND call.
>
> hope that helps
> angela
>
> > 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<[hidden email]<http://user/SendEmail.jtp?type=node&node=3826252&i=0>>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
> >>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p3826252.html
>  To unsubscribe from version creation using httpclient, click here<http://jackrabbit.510166.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3807209&code=cGFydmV6MTJAZ21haWwuY29tfDM4MDcyMDl8LTE4NjQ4MjI2NTY=>.
>
>

Re: version creation using httpclient

Posted by Angela Schreiber <an...@adobe.com>.
hi ahmad

> 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.

if you access the webdav server responsible for jcr-remoting you
can make use of the protected webdav property DAV:label-name-set
defined by DeltaV. it is exposed by all resources that represent
a jcr version node. since DeltaV defines that property to be
protected to have to explicitly request it in the PROPFIND call.

hope that helps
angela

> 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<ju...@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
>>

Re: version creation using httpclient

Posted by parvez12 <pa...@gmail.com>.
Is there some way in creating named versions using httpclient without using
jcrUtils
Parvez Ahmad Hakim
www.abobjects.com

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p3811848.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: version creation using httpclient

Posted by maikhorma <MH...@NBME.org>.
If you're application is in Java why not use the JCR api?  You can use
jackrabbit's JcrUtils.getRepository() to connect to your webdav URL, then
you can use straight JCR java code to access the repository.

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p3810424.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: version creation using httpclient

Posted by Parvez Ahmad <pa...@gmail.com>.
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 <ju...@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
>

Re: version creation using httpclient

Posted by Julian Reschke <ju...@gmx.de>.
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

Re: version creation using httpclient

Posted by parvez12 <pa...@gmail.com>.
Hi,
Does any body know how to create a named version using webdav in
jackrabbit/sling.
I am have been struggling on it for a month. The project committers even do
not know what is the exact way to do it.
I my self have 12 years software development .Pleas if you do not know it,
just make me as a support guy so that i can identify the issues and create
detailed articles for trivial problems like this.
By the way is any solution available. Faced a lot of embarrassment from the
employer yesterday. What is the fun of having technology which works from
left to right and not from right to left.
Why mercularian does not work on Eclipse  4.1 on push . All open source is
actually closed source
Ahmad Parvez Hakim



On Wed, Sep 21, 2011 at 1:09 PM, Angela Schreiber-2 [via Jackrabbit] <
ml-node+s510166n3829227h72@n4.nabble.com> wrote:

> hi ahmad
>
> > is there some sample code .
>
> not really... but if you read about the details of a PROPFIND
> request it shouldn't be a big deal, should it?
> otherwise you may take a look at spi2dav.RepositoryServiceImpl
> which executes quite some PROPFIND requests that retrieve a
> dedicated set of properties.
>
> hope that helps
> angela
>
> > Waiting anxiously for your reply,
> >
> > regards
> > Parvez Ahmad Hakim
> >
> > On Tue, Sep 20, 2011 at 2:55 PM, Angela Schreiber-2 [via Jackrabbit]<
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=3829227&i=0>>
>  wrote:
> >
> >> hi ahmad
> >>
> >>> 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.
> >>
> >> if you access the webdav server responsible for jcr-remoting you
> >> can make use of the protected webdav property DAV:label-name-set
> >> defined by DeltaV. it is exposed by all resources that represent
> >> a jcr version node. since DeltaV defines that property to be
> >> protected to have to explicitly request it in the PROPFIND call.
> >>
> >> hope that helps
> >> angela
> >>
> >>> 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<[hidden email]<
> http://user/SendEmail.jtp?type=node&node=3826252&i=0>>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
> >>>>
> >>
> >>
> >> ------------------------------
> >>   If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> >>
> >>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p3829227.html
>  To unsubscribe from version creation using httpclient, click here<http://jackrabbit.510166.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3807209&code=cGFydmV6MTJAZ21haWwuY29tfDM4MDcyMDl8LTE4NjQ4MjI2NTY=>.
>
>


--
View this message in context: http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p3855302.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: version creation using httpclient

Posted by parvez12 <pa...@gmail.com>.
Thanks Mr. christian for your helping mail.

I checked all the sites, they use jcr rmi repositories to talk to jackrabbit.
I will check what parameters we can pass in checkout method to create a version
with a name(say abc).
It is unfortunate the team who manage jackrabbit are not providing any
documentation, from last two months

As a feedback, In webdav implementations of jackrabbit checkout
method, we should be able to pass a version name that will get
created.
When the method is executed we should know get the information about
the URL of  version of created.
There should be simple webdav methods for creating, restoring, a
specific version. The labelmethod and reportmethod are useless.

regards
Parvez Ahmad Hakim
Software Researcher
Srinagar Kashmir India
www.abobjects.com

On Sat, Nov 19, 2011 at 3:17 PM, Christian Stocker [via Jackrabbit]
<ml...@n4.nabble.com> wrote:
> Hi
>
> Instead of just waiting for an answer, you could have invested some time
> by yourself. Debugging a http-protocol isn't too hard.
>
> 1) write a simple java client, which does what you want. You can take
> https://github.com/jackalope/JavaDavexClient as an example for that
>
> 2) Set up a proxy, which intercepts the HTTP traffic. like
> http://www.charlesproxy.com/
>
> 3) go and see what it does.
>
> If you're more into PHP than Java, you could also check out
> https://github.com/jackalope/jackalope which talks to jackrabbit via
> webdav and implements the major things (like versioning)
>
> and to your question: Use CHECKIN and CHECKOUT as HTTP methods to create
> new versions. But that really isn't too hard to figure out by yourself,
> it's open source after all ;)
>
> christian
>
> On 19.11.11 06:54, Parvez Ahmad wrote:
>> It is sad to see that those how created jackrabbit and sling do not know
>> how to
>> create a version using webdav.
>> Really too bad thing for open source
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p4085973.html
> To unsubscribe from version creation using httpclient, click here.
> NAML


--
View this message in context: http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p4090782.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: version creation using httpclient

Posted by Christian Stocker <ch...@liip.ch>.
Hi

Instead of just waiting for an answer, you could have invested some time
by yourself. Debugging a http-protocol isn't too hard.

1) write a simple java client, which does what you want. You can take
https://github.com/jackalope/JavaDavexClient as an example for that

2) Set up a proxy, which intercepts the HTTP traffic. like
http://www.charlesproxy.com/

3) go and see what it does.

If you're more into PHP than Java, you could also check out
https://github.com/jackalope/jackalope which talks to jackrabbit via
webdav and implements the major things (like versioning)

and to your question: Use CHECKIN and CHECKOUT as HTTP methods to create
new versions. But that really isn't too hard to figure out by yourself,
it's open source after all ;)

christian

On 19.11.11 06:54, Parvez Ahmad wrote:
> It is sad to see that those how created jackrabbit and sling do not know how to
> create a version using webdav.
> Really too bad thing for open source

Re: version creation using httpclient

Posted by parvez12 <pa...@gmail.com>.
Dear Julian,
Is there some sample code. I tried to use it, but it never worked.
I tried to add method.addheader(....
It never worked Mr/Ms Julian

regards
Parvez Ahmad

On Mon, Nov 21, 2011 at 8:18 PM, Julian Reschke [via Jackrabbit]
<ml...@n4.nabble.com> wrote:
> On 2011-11-19 06:54, Parvez Ahmad wrote:
>> It is sad to see that those how created jackrabbit and sling do not know
>> how to
>> create a version using webdav.
>> Really too bad thing for open source
>
> Angela answered your question two months ago: the version label is
> exposed in the DAV:label-name-set property (see
> <http://greenbytes.de/tech/webdav/rfc3253.html#label.feature>).
>
> Best regards, Julian
>
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p4091729.html
> To unsubscribe from version creation using httpclient, click here.
> NAML


--
View this message in context: http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p4091856.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: version creation using httpclient

Posted by Julian Reschke <ju...@gmx.de>.
On 2011-11-19 06:54, Parvez Ahmad wrote:
> It is sad to see that those how created jackrabbit and sling do not know how to
> create a version using webdav.
> Really too bad thing for open source

Angela answered your question two months ago: the version label is 
exposed in the DAV:label-name-set property (see 
<http://greenbytes.de/tech/webdav/rfc3253.html#label.feature>).

Best regards, Julian


Re: version creation using httpclient

Posted by Parvez Ahmad <pa...@gmail.com>.
It is sad to see that those how created jackrabbit and sling do not know how to
create a version using webdav.
Really too bad thing for open source


Re: version creation using httpclient

Posted by parvez12 <pa...@gmail.com>.
Does any body know how to create a named version using webdav in
jackrabbit/sling


On Sat, Sep 24, 2011 at 1:48 AM, Furst, Carl [via Jackrabbit] <
ml-node+s510166n3837960h95@n4.nabble.com> wrote:

> Do you make use of this:
>
>
>
> http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/version/Version.html#getCreated%28%29
>
> and
>
> http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/version/VersionHistory.html#getVersion(java.lang.String)
>
>
>
>
>
> Carl Furst
>
>
> -----Original Message-----
> From: Parvez Ahmad [mailto:[hidden email]<http://user/SendEmail.jtp?type=node&node=3837960&i=0>]
>
> Sent: Monday, September 12, 2011 7:28 AM
> To: [hidden email] <http://user/SendEmail.jtp?type=node&node=3837960&i=1>;
> [hidden email] <http://user/SendEmail.jtp?type=node&node=3837960&i=2>;
> [hidden email] <http://user/SendEmail.jtp?type=node&node=3837960&i=3>; [hidden
> email] <http://user/SendEmail.jtp?type=node&node=3837960&i=4>
> Subject: version creation using httpclient
>
> 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
>
>
> regards
> Ahmad
> 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
>        /// HERE I SEE THE PROBLEM
>
>                 ReportInfo reportInfo = new
> ReportInfo(ReportType.VERSION_TREE ,DavConstants.DEPTH_INFINITY);
>                 ReportMethod report = new ReportMethod(remotePath,
> reportInfo);
>                 client.executeMethod(report);
>                 MultiStatus multiStatus =
> report.getResponseBodyAsMultiStatus();
>                 MultiStatusResponse responses[] =
> multiStatus.getResponses();
>                 String responseAsString = "";
>                 VersionVo v;
>                 for(int i = 0; i < responses.length; i++) {
>                     responseAsString += responses[i].getHref() + "\n";
>                     v = new VersionVo();
>                     v.setVersionNodePath(responses[i].getHref());
>
>                     v.setVersionComment("version-" +i++);
>                     v.setCreatedDate("hhhhh");
>                     lstVersions.add(v);
>                 }
>
>
>                 report.releaseConnection();
>
>            } catch (Exception e2){
>                e2.printStackTrace();
>            }
>         return lstVersions;
>     }
>
>
>
>
>
>
> **********************************************************
>
> MLB.com: Where Baseball is Always On
>
> *smime.p7s* (3K) Download Attachment<http://attachment/3837960/0/smime.p7s>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p3837960.html
>  To unsubscribe from version creation using httpclient, click here<http://jackrabbit.510166.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3807209&code=cGFydmV6MTJAZ21haWwuY29tfDM4MDcyMDl8LTE4NjQ4MjI2NTY=>.
>
>


--
View this message in context: http://jackrabbit.510166.n4.nabble.com/version-creation-using-httpclient-tp3807209p3855274.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

RE: version creation using httpclient

Posted by "Furst, Carl" <Ca...@mlb.com>.
Do you make use of this:


http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/version/Version.html#getCreated%28%29

and
http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/version/VersionHistory.html#getVersion(java.lang.String)




Carl Furst


-----Original Message-----
From: Parvez Ahmad [mailto:parvez12@gmail.com]
Sent: Monday, September 12, 2011 7:28 AM
To: users@jackrabbit.apache.org; user@jackrabbit.apache.org; 
users-help@jackrabbit.apache.org; users-owner@jackrabbit.apache.org
Subject: version creation using httpclient

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


regards
Ahmad
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
       /// HERE I SEE THE PROBLEM

                ReportInfo reportInfo = new
ReportInfo(ReportType.VERSION_TREE ,DavConstants.DEPTH_INFINITY);
                ReportMethod report = new ReportMethod(remotePath,
reportInfo);
                client.executeMethod(report);
                MultiStatus multiStatus =
report.getResponseBodyAsMultiStatus();
                MultiStatusResponse responses[] =
multiStatus.getResponses();
                String responseAsString = "";
                VersionVo v;
                for(int i = 0; i < responses.length; i++) {
                    responseAsString += responses[i].getHref() + "\n";
                    v = new VersionVo();
                    v.setVersionNodePath(responses[i].getHref());

                    v.setVersionComment("version-" +i++);
                    v.setCreatedDate("hhhhh");
                    lstVersions.add(v);
                }


                report.releaseConnection();

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