You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by Mano Swerts <m....@aca-it.be> on 2012/01/30 14:54:56 UTC
OpenCMIS 0.5.0 - Getting all versions of a particular document.
Hi all,
I'm trying to show the user a list of all versions for a particular
document. I tried to execute a query which searches on cmis:objectId with
the boolean "search all versions" on true, but that doesn't work. Search on
cmis:name doesn't work either. It just gives me the last version of the
document (in my case 3.0). Versions 2.0 and 1.0 are never returned.
I used following queries:
SELECT DOCUMENT.* FROM park:document AS DOCUMENT WHERE
DOCUMENT.cmis:objectId =
'workspace://SpacesStore/c526c9bc-eab4-4f12-9361-3eaf77ff171e'
or
SELECT DOCUMENT.* FROM park:document AS DOCUMENT WHERE DOCUMENT.cm:name =
'123_Hasselt_06-12-2011_15-33-23_1.pdf'
No succes whatsoever. I tried this through the library's
"cmisSession.query(query, true)" method and through the OpenCMIS Workbench
application selecting "search all versions". I am approaching this problem
the wrong way?
Thanks in advance.
Met vriendelijke groeten,
Kind regards,
Bien à vous,
Mano Swerts
Solution Engineer
_______________________________________________________
ACA IT-Solutions
Ilgatlaan 5C Clovislaan 82
B-3500 Hasselt B-1000 Brussel
Belgium Belgium
T: +32 (0)11 26 50 10 E: m.swerts@aca-it.be
F: +32 (0)11 26 50 11 U: www.aca-it.be
M: +32 (0)484 80 81 45
______________________________________________________
Re: OpenCMIS 0.5.0 - Getting all versions of a particular document.
Posted by Mano Swerts <m....@aca-it.be>.
Hi Jeff,
I figured it out. I need to use the VersioningService:
String repositoryId = cmisSession.getRepositoryInfo().getId();
List<ObjectData> versions =
cmisSession.getBinding().getVersioningService().getAllVersions(repositoryId,
documentId, null, null, null, null);
Just in case somebody has the same question.
-- Mano
On Mon, Jan 30, 2012 at 3:14 PM, Mano Swerts <m....@aca-it.be> wrote:
> Hi Jeff,
>
> Thanks for the quick reply.
>
> Yes I am using Alfresco 3.4. Is it possible to do this in future versions
> of Alfresco (4.0 or not yet released versions)? Does this mean that I need
> to resort to WebScripts and the Alfresco Node API with Lucene?
>
> -- Mano
>
>
> On Mon, Jan 30, 2012 at 3:09 PM, Jeff Potts <je...@gmail.com> wrote:
>
>> Mano,
>>
>> Not all repositories support searching across all versions. It looks like
>> you might be using Alfresco. If you ask the Alfresco repo for a list of its
>> capabilities, you'll see that Alfresco returns 'AllVersionsSearchable' as
>> False.
>>
>> Jeff
>>
>> On Jan 30, 2012, at 7:54 AM, Mano Swerts wrote:
>>
>> > Hi all,
>> >
>> > I'm trying to show the user a list of all versions for a particular
>> > document. I tried to execute a query which searches on cmis:objectId
>> with
>> > the boolean "search all versions" on true, but that doesn't work.
>> Search on
>> > cmis:name doesn't work either. It just gives me the last version of the
>> > document (in my case 3.0). Versions 2.0 and 1.0 are never returned.
>> >
>> > I used following queries:
>> >
>> > SELECT DOCUMENT.* FROM park:document AS DOCUMENT WHERE
>> > DOCUMENT.cmis:objectId =
>> > 'workspace://SpacesStore/c526c9bc-eab4-4f12-9361-3eaf77ff171e'
>> >
>> > or
>> >
>> > SELECT DOCUMENT.* FROM park:document AS DOCUMENT WHERE DOCUMENT.cm:name
>> =
>> > '123_Hasselt_06-12-2011_15-33-23_1.pdf'
>> >
>> > No succes whatsoever. I tried this through the library's
>> > "cmisSession.query(query, true)" method and through the OpenCMIS
>> Workbench
>> > application selecting "search all versions". I am approaching this
>> problem
>> > the wrong way?
>> >
>> > Thanks in advance.
>> >
>> > Met vriendelijke groeten,
>> > Kind regards,
>> > Bien à vous,
>> >
>> > Mano Swerts
>> > Solution Engineer
>> >
>> > _______________________________________________________
>> >
>> > ACA IT-Solutions
>> >
>> > Ilgatlaan 5C Clovislaan 82
>> > B-3500 Hasselt B-1000 Brussel
>> > Belgium Belgium
>> >
>> > T: +32 (0)11 26 50 10 E: m.swerts@aca-it.be
>> > F: +32 (0)11 26 50 11 U: www.aca-it.be
>> > M: +32 (0)484 80 81 45
>> > ______________________________________________________
>>
>>
>
Re: OpenCMIS 0.5.0 - Getting all versions of a particular document.
Posted by Mano Swerts <m....@aca-it.be>.
Hi Jeff,
Thanks for the quick reply.
Yes I am using Alfresco 3.4. Is it possible to do this in future versions
of Alfresco (4.0 or not yet released versions)? Does this mean that I need
to resort to WebScripts and the Alfresco Node API with Lucene?
-- Mano
On Mon, Jan 30, 2012 at 3:09 PM, Jeff Potts <je...@gmail.com> wrote:
> Mano,
>
> Not all repositories support searching across all versions. It looks like
> you might be using Alfresco. If you ask the Alfresco repo for a list of its
> capabilities, you'll see that Alfresco returns 'AllVersionsSearchable' as
> False.
>
> Jeff
>
> On Jan 30, 2012, at 7:54 AM, Mano Swerts wrote:
>
> > Hi all,
> >
> > I'm trying to show the user a list of all versions for a particular
> > document. I tried to execute a query which searches on cmis:objectId with
> > the boolean "search all versions" on true, but that doesn't work. Search
> on
> > cmis:name doesn't work either. It just gives me the last version of the
> > document (in my case 3.0). Versions 2.0 and 1.0 are never returned.
> >
> > I used following queries:
> >
> > SELECT DOCUMENT.* FROM park:document AS DOCUMENT WHERE
> > DOCUMENT.cmis:objectId =
> > 'workspace://SpacesStore/c526c9bc-eab4-4f12-9361-3eaf77ff171e'
> >
> > or
> >
> > SELECT DOCUMENT.* FROM park:document AS DOCUMENT WHERE DOCUMENT.cm:name =
> > '123_Hasselt_06-12-2011_15-33-23_1.pdf'
> >
> > No succes whatsoever. I tried this through the library's
> > "cmisSession.query(query, true)" method and through the OpenCMIS
> Workbench
> > application selecting "search all versions". I am approaching this
> problem
> > the wrong way?
> >
> > Thanks in advance.
> >
> > Met vriendelijke groeten,
> > Kind regards,
> > Bien à vous,
> >
> > Mano Swerts
> > Solution Engineer
> >
> > _______________________________________________________
> >
> > ACA IT-Solutions
> >
> > Ilgatlaan 5C Clovislaan 82
> > B-3500 Hasselt B-1000 Brussel
> > Belgium Belgium
> >
> > T: +32 (0)11 26 50 10 E: m.swerts@aca-it.be
> > F: +32 (0)11 26 50 11 U: www.aca-it.be
> > M: +32 (0)484 80 81 45
> > ______________________________________________________
>
>
Re: OpenCMIS 0.5.0 - Getting all versions of a particular document.
Posted by Jeff Potts <je...@gmail.com>.
Mano,
Not all repositories support searching across all versions. It looks like you might be using Alfresco. If you ask the Alfresco repo for a list of its capabilities, you'll see that Alfresco returns 'AllVersionsSearchable' as False.
Jeff
On Jan 30, 2012, at 7:54 AM, Mano Swerts wrote:
> Hi all,
>
> I'm trying to show the user a list of all versions for a particular
> document. I tried to execute a query which searches on cmis:objectId with
> the boolean "search all versions" on true, but that doesn't work. Search on
> cmis:name doesn't work either. It just gives me the last version of the
> document (in my case 3.0). Versions 2.0 and 1.0 are never returned.
>
> I used following queries:
>
> SELECT DOCUMENT.* FROM park:document AS DOCUMENT WHERE
> DOCUMENT.cmis:objectId =
> 'workspace://SpacesStore/c526c9bc-eab4-4f12-9361-3eaf77ff171e'
>
> or
>
> SELECT DOCUMENT.* FROM park:document AS DOCUMENT WHERE DOCUMENT.cm:name =
> '123_Hasselt_06-12-2011_15-33-23_1.pdf'
>
> No succes whatsoever. I tried this through the library's
> "cmisSession.query(query, true)" method and through the OpenCMIS Workbench
> application selecting "search all versions". I am approaching this problem
> the wrong way?
>
> Thanks in advance.
>
> Met vriendelijke groeten,
> Kind regards,
> Bien à vous,
>
> Mano Swerts
> Solution Engineer
>
> _______________________________________________________
>
> ACA IT-Solutions
>
> Ilgatlaan 5C Clovislaan 82
> B-3500 Hasselt B-1000 Brussel
> Belgium Belgium
>
> T: +32 (0)11 26 50 10 E: m.swerts@aca-it.be
> F: +32 (0)11 26 50 11 U: www.aca-it.be
> M: +32 (0)484 80 81 45
> ______________________________________________________