Hello Gbenga,

sorry that I answer so late. Didn't check the Slide mails :(

I tried to reproduce the error but with minor success. How do you create versions - 
via Slide API or with a WebDAV client?

Have you had a look into your repository directories (by default store/content, 
store/metadata and store/sequence in the current execution directory)? You can read 
the XML files there. If you configured ExtendedStore in Domain.xml then you should 
find a file called store/metadata/files/yourpath/yourfile.def.xml. If there is only 
one revision inside then maybe the problem is that you create revisions via WebDAV and 
try to read them via Slide API?!

I've attached a working example for versioning which uses the Slide API with the 
appropriate Domain.xml. Note that settings regarding versioning in Domain.xml don't 
affect my code since it is hacked into the WebDAV layer.

Best regards
Stefan



Am Thu, 2 Sep 2004 07:19:20 -0700 (PDT) schrieb Gbenga Bello <[EMAIL PROTECTED]>:

Hello Stefan,

Thanks for your contribution the other time

I tried the code snippet but I get only the latest revision.
For instance I had revisions 1.0,1.1,1.2

It brings out only 1.2 as the lis of revision numbers available for that resource.
What is it that is the problem

Pls I will appreciate your reply today.

Thanks in advance

Gbenga

Stefan Fromm <[EMAIL PROTECTED]> wrote:
Hello Gbenga,

1) I want to able to view the list of all previous revision number
[revision history] for a specific document resource thru the Java
application. Which class of the slide native api helps to achieve
this. I have searched the api doc but couldn't get something
meaningful yet. Pls I need your input

Note that there might occur problems with the versions because functionality is implemented inconsistently in the helper-layer and WebDAV-layer as mentioned in these messages:

http://www.mail-archive.com/[EMAIL PROTECTED]/msg06761.html
http://www.mail-archive.com/[EMAIL PROTECTED]/msg03708.html
http://www.mail-archive.com/[EMAIL PROTECTED]/msg10230.html

So it depends on if you access versions with Slide-API or via WebDAV.

For Slide-API it should work like this:

NamespaceAccessToken nsat =
Domain.accessNamespace(new SecurityToken(""), Domain.getDefaultNamespace());
SlideToken token = new SlideTokenImpl(new CredentialsToken(slideusername));
Content contentHelper = nsat.getContentHelper();
NodeRevisionDescriptors revisions = contentHelper.retrieve(token, "/files/test.txt");
for ( Enumeration e = revisions.enumerateRevisionNumbers(); e.hasMoreElements(); )
{
NodeRevisionNumber nrno = (NodeRevisionNumber)e.nextElement();
// get metadata
NodeRevisionDescriptor nrd = contentHelper.retrieve(token, revisions, nrno);
// get content
NodeRevisionContent nrc = contentHelper.retrieve(token, revisions, nrd);
}

For WebDAV there is defined the DAV:version-tree report in RFC3253
(DeltaV Specification). See http://www.ietf.org/rfc.html



2) I want to be able to request to view content for a specific
revision (from the revision history) of a document . Take for
instance, if there are the following revision nos for a document
resource; 1.0,1.1,1.2,1.3,1.4 where 1.4 is the latest document
revision number. I should be able to programmatically and randomly
pool revision 1.2 to see what is in there.

NodeRevisionNumber provides some constructors where you can provide a version number in different ways. In connection with the above shown code for Helper-API you should be able to do it.

For WebDAV it could be the additional Label-Header in the GET-request
where you can provide a version label. Since version numbers are just
server-side generated version labels this could work.



3) You may have observed the way slide handles numbering of revisions
for a document; that instead of increamenting the whole number part of
the revision no, it rather increaments the decimal part of the number.
Take for instance, if previous revision number is 1.0. When Slide does
the next revision, it assigns the number, 1.1
At what point will it move the version numbering to 2.0?

To me it seems there is never created a next major version. Good points to have a look at are

org.apache.slide.content.ContentImpl and
org.apache.slide.webdav.util.VersioningHelper

Regards
Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------- Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard.

<?xml version="1.0"?>
<slide>
    <namespace name="slide">
        <definition>
            <store name="tx">
                <parameter name="tlock-timeout">120</parameter>
                <nodestore classname="org.apache.slide.store.txfile.TxXMLFileDescriptorsStore">
                    <parameter name="rootpath">store/metadata</parameter>
                    <parameter name="workpath">work/metadata</parameter>
                    <parameter name="defer-saving">true</parameter>
                    <parameter name="timeout">120</parameter>
                </nodestore>
                <sequencestore classname="org.apache.slide.store.txfile.FileSequenceStore">
                    <parameter name="rootpath">store/sequence</parameter>
                </sequencestore>
                <securitystore>
                    <reference store="nodestore"/>
                </securitystore>
                <lockstore>
                    <reference store="nodestore"/>
                </lockstore>
                <revisiondescriptorsstore>
                    <reference store="nodestore"/>
                </revisiondescriptorsstore>
                <revisiondescriptorstore>
                    <reference store="nodestore"/>
                </revisiondescriptorstore>
                <contentstore classname="org.apache.slide.store.txfile.TxFileContentStore">
                    <parameter name="rootpath">store/content</parameter>
                    <parameter name="workpath">work/content</parameter>
                    <parameter name="defer-saving">true</parameter>
                    <parameter name="timeout">120</parameter>
                </contentstore>
                <!-- uncomment if you want to use the sample Indexer -->
                <!-- be sure to have Lucene in your classpath             -->
                <!--
                <contentindexer classname="org.apache.slide.index.SampleTxtContainsIndexer">
                <parameter name="indexpath">./index</parameter>
                </contentindexer>
        -->
            </store>
            <scope match="/" store="tx"/>
        </definition>
        <configuration>
            <!-- Actions mapping -->
            <read-object>/actions/read</read-object>
            <create-object>/actions/write</create-object>
            <remove-object>/actions/write</remove-object>
            <grant-permission>/actions/write-acl</grant-permission>
            <revoke-permission>/actions/write-acl</revoke-permission>
            <read-permissions>/actions/read-acl</read-permissions>
            <read-own-permissions>/actions/read-current-user-privilege-set</read-own-permissions>
            <lock-object>/actions/write</lock-object>
            <kill-lock>/actions/unlock</kill-lock>
            <read-locks>/actions/read</read-locks>
            <read-revision-metadata>/actions/read</read-revision-metadata>
            <create-revision-metadata>/actions/write-properties</create-revision-metadata>
            <modify-revision-metadata>/actions/write-properties</modify-revision-metadata>
            <remove-revision-metadata>/actions/write-properties</remove-revision-metadata>
            <read-revision-content>/actions/read</read-revision-content>
            <create-revision-content>/actions/write-content</create-revision-content>
            <modify-revision-content>/actions/write-content</modify-revision-content>
            <remove-revision-content>/actions/write-content</remove-revision-content>
            <bind-member>/actions/bind</bind-member>
            <unbind-member>/actions/unbind</unbind-member>
            <!-- Paths configuration -->
            <userspath>/users</userspath>
            <rolespath>/roles</rolespath>
            <actionspath>/actions</actionspath>
            <filespath>/files</filespath>
            <parameter name="dav">true</parameter>
            <parameter name="standalone">true</parameter>
            <parameter name="acl_inheritance_type">path</parameter>
            <!-- Nested roles: 0 means no nesting (default), 1 means one sublevel, etc. -->
            <parameter name="nested_roles_maxdepth">0</parameter>
            <!-- Can be "off", "write" and "full" -->
            <parameter name="sequential-mode">full</parameter>
            <!-- "false" lets all read-only methods be executed outside of transactions -->
            <parameter name="all-methods-in-transactions">true</parameter>
        </configuration>
        <data>
            <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/">
                <!-- Subject can be:
                any user             "all"
                authenticated user   "authenticated"
                unauthenticated user "unauthenticated"
                self                 "self"
                owner of resource    "owner"
                a user               "/users/john"
                a role               "/roles/admin"
                -->
                <permission action="all" subject="/roles/root" inheritable="true"/>
                <permission action="/actions/read-acl" subject="all" inheritable="true" negative="true"/>
                <permission action="/actions/write-acl" subject="all" inheritable="true" negative="true"/>
                <permission action="/actions/unlock" subject="all" inheritable="true" negative="true"/>
                <permission action="/actions/read" subject="all" inheritable="true"/>
                <!-- /users -->
                <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/users">
                    <permission action="all" subject="self" inheritable="true"/>
                    <permission action="all" subject="/roles/projector" inheritable="true"/>
                    <permission action="all" subject="unauthenticated" inheritable="true" negative="true"/>
                    <!-- /users/root represents the administrator -->
                    <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/users/root">
                        <revision>
                            <property namespace="http://jakarta.apache.org/slide/"; name="password">root</property>
                        </revision>
                    </objectnode>
                    <!-- /users/john and /users/john2 represent authenticated users -->
                    <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/users/john">
                        <revision>
                            <property namespace="http://jakarta.apache.org/slide/"; name="password">john</property>
                        </revision>
                    </objectnode>
                    <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/users/john2">
                        <revision>
                            <property namespace="http://jakarta.apache.org/slide/"; name="password">john2</property>
                        </revision>
                    </objectnode>
                    <!-- /users/guest represents an authenticated or unauthenticated guest user -->
                    <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/users/guest">
                        <revision>
                            <property namespace="http://jakarta.apache.org/slide/"; name="password">guest</property>
                        </revision>
                    </objectnode>
                    <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/users/projector">
                        <revision>
                            <property namespace="http://jakarta.apache.org/slide/"; name="password">projector</property>
                        </revision>
                    </objectnode>
                </objectnode>
                <!-- /roles -->
                <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/roles">
                    <permission action="all" subject="self" inheritable="true"/>
                    <permission action="all" subject="/roles/projector" inheritable="true"/>
                    <permission action="all" subject="unauthenticated" inheritable="true" negative="true"/>
                    <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/roles/root">
                        <revision>
                            <property name="group-member-set"><![CDATA[<D:href xmlns:D='DAV:'>/users/root</D:href>]]></property>
                        </revision>
                    </objectnode>
                    <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/roles/user">
                        <revision>
                            <property name="group-member-set"><![CDATA[<D:href xmlns:D='DAV:'>/users/john</D:href><D:href xmlns:D='DAV:'>/users/john2</D:href><D:href xmlns:D='DAV:'>/users/root</D:href><D:href xmlns:D='DAV:'>/users/projector</D:href>]]></property>
                        </revision>
                    </objectnode>
                    <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/roles/guest">
                        <revision>
                            <property name="group-member-set"><![CDATA[<D:href xmlns:D='DAV:'>/users/guest</D:href>]]></property>
                        </revision>
                    </objectnode>
                    <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/roles/projector">
                        <revision>
                            <property name="group-member-set"><![CDATA[<D:href xmlns:D='DAV:'>/users/root</D:href><D:href xmlns:D='DAV:'>/users/projector</D:href>]]></property>
                        </revision>
                    </objectnode>
                </objectnode>
                <!-- action -->
                <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions">
                    <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions/read">
                        <revision>
                            <property name="privilege-member-set"><![CDATA[<D:href xmlns:D='DAV:'>/actions/read-acl</D:href> <D:href xmlns:D='DAV:'>/actions/read-current-user-privilege-set</D:href>]]></property>
                        </revision>
                    </objectnode>
                    <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions/read-acl">
                        <revision>
                            <property name="privilege-member-set"/>
                        </revision>
                    </objectnode>
                    <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions/read-current-user-privilege-set">
                        <revision>
                            <property name="privilege-member-set"/>
                        </revision>
                    </objectnode>
                    <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions/write">
                        <revision>
                            <property name="privilege-member-set"><![CDATA[<D:href xmlns:D='DAV:'>/actions/write-acl</D:href> <D:href xmlns:D='DAV:'>/actions/write-properties</D:href> <D:href xmlns:D='DAV:'>/actions/write-content</D:href>]]></property>
                        </revision>
                    </objectnode>
                    <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions/write-acl">
                        <revision>
                            <property name="privilege-member-set"/>
                        </revision>
                    </objectnode>
                    <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions/write-properties">
                        <revision>
                            <property name="privilege-member-set"/>
                        </revision>
                    </objectnode>
                    <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions/write-content">
                        <revision>
                            <property name="privilege-member-set"><![CDATA[<D:href xmlns:D='DAV:'>/actions/bind</D:href> <D:href xmlns:D='DAV:'>/actions/unbind</D:href>]]></property>
                        </revision>
                    </objectnode>
                    <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions/bind">
                        <revision>
                            <property name="privilege-member-set"/>
                        </revision>
                    </objectnode>
                    <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions/unbind">
                        <revision>
                            <property name="privilege-member-set"/>
                        </revision>
                    </objectnode>
                    <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions/unlock">
                        <revision>
                            <property name="privilege-member-set"/>
                        </revision>
                    </objectnode>
                </objectnode>
                <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/files">
                    <permission action="all" subject="unauthenticated" inheritable="true"/>
                    <permission action="/actions/write" subject="/roles/user" inheritable="true"/>
                    <permission action="/actions/read-acl" subject="owner" inheritable="true"/>
                </objectnode>
                <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/projector">
                    <permission action="all" subject="unauthenticated" inheritable="true"/>
                    <permission action="/actions/write" subject="/roles/projector" inheritable="true"/>
                    <permission action="/actions/read-acl" subject="owner" inheritable="true"/>
                    <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/projector/work">
                    </objectnode>
                </objectnode>
                <!-- DeltaV: default history and workspace paths -->
                <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/history">
                    <permission action="all" subject="unauthenticated" inheritable="true"/>
                    <permission action="/actions/write" subject="/roles/user" inheritable="true"/>
                    <permission action="/actions/read-acl" subject="owner" inheritable="true"/>
                </objectnode>
                <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/workspace">
                    <permission action="all" subject="unauthenticated" inheritable="true"/>
                    <permission action="/actions/write" subject="/roles/user" inheritable="true"/>
                    <permission action="/actions/read-acl" subject="owner" inheritable="true"/>
                </objectnode>
                <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/workingresource">
                    <permission action="all" subject="unauthenticated" inheritable="true"/>
                    <permission action="/actions/write" subject="/roles/user" inheritable="true"/>
                    <permission action="/actions/read-acl" subject="owner" inheritable="true"/>
                </objectnode>
            </objectnode>
        </data>
    </namespace>
    <!--
    DeltaV global parameters
    ========================
    * historypath (mandatory=no, default="/history"):
    Specifies a Slide path which determines the location where this DeltaV
    server stores history data.

    * workspacepath (mandatory=no, default="/workspace"):
    Specifies a Slide path which determines the location where this DeltaV
    server allows workspaces to reside.

    * workingresourcepath (mandatory=no, default="/workingresource"):
    Specifies a Slide path which determines the location where this DeltaV
    server stores working resources.

    * auto-version (mandatory=no, default="checkout-checkin"):
    Controls the DeltaV auto-version behaviour.

    * auto-version-control (mandatory=no, default="false"):
    Indicates if a resource just created by a PUT should be set under
    version-control.

    * versioncontrol-exclude (mandatory=no, default=""):
    Specifies a Slide path which determines resources which are excluded from version-control.
    The default value "" makes no path being excluded.

    * checkout-fork (mandatory=no, default="forbidden"):
    Controls the DeltaV check-out behaviour when a version is already
    checked-out or has a successor.

    * checkin-fork (mandatory=no, default="forbidden"):
    Controls the DeltaV check-out behaviour when a version has already a
    successor.

    * standardLivePropertiesClass (mandatory=no,
    default="org.apache.slide.webdav.util.resourcekind.AbstractResourceKind"):
    Determines the "agent" knowing about what the standard live properties are.
    It should be a loadable class containing the following static methods:
    - boolean isLiveProperty(String propName)
    - boolean isProtectedProperty(String propName)
    - boolean isComputedProperty(String propName)
    - Set getAllLiveProperties()
    - Set getAllProtectedProperties()
    - Set getAllComputedProperties()

    * uriRedirectorClass (mandatory=no,
    default="org.apache.slide.webdav.util.DeltavUriRedirector"):
    Determines the URI redirector class. The DeltaV URI redirector is in
    charge of the following redirections:
    - version URI to history URI, e.g. /history/2/1.4 to /history/2
    - latest revision number for history resource to 0.0
    - latest revision number for version resource to last URI token,
    e.g. /history/2/1.4 to 1.4
    It should be a loadable class containing the following static methods:
    - String redirectUri(String uri)
    - NodeRevisionNumber redirectLatestRevisionNumber(String uri)
    -->
    <parameter name="historypath">/history</parameter>
    <parameter name="workspacepath">/workspace</parameter>
    <parameter name="workingresourcepath">/workingresource</parameter>
    <parameter name="auto-version">checkout-checkin</parameter>
    <parameter name="auto-version-control">true</parameter>
    <parameter name="versioncontrol-exclude"/>
    <parameter name="checkout-fork">forbidden</parameter>
    <parameter name="checkin-fork">forbidden</parameter>
</slide>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to