You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Sam Weinger <sa...@wrycan.com> on 2005/03/24 17:57:48 UTC

SearchMethod issue

Is there a way to recursively search all resources under /slide/files to
any depth using the org.apach.webdav.lib.methods.SearchMethod class?  I
am only able to get results that are up to 2 levels below the value of
the <DAV:href> element in the request body.  So if I have a file
/slide/files/set1/set2/set3/test.xml and the following function:

Enumeration getPaths(String propertyName, String value) {
       HttpURL httpURL = new HttpURL("http://localhost:8080/slide");
        String query = "<?xml version=\"1.0\"?>" +
        "<D:searchrequest xmlns:D = \"DAV:\" >" +
            "<D:basicsearch>" +
                "<D:select>" +
                    "<D:prop><D:"+ propertyName + "/></D:prop>" +
                "</D:select>" +
                "<D:from>" +
                    "<D:scope>" +
                        "<D:href>/slide/files</D:href>" +
                        "<D:depth>infinity</D:depth>" +
                    "</D:scope>" +
                "</D:from>" +
                "<D:where>" +
                    "<D:eq>" +
                        "<D:prop>" +
                            "<D:" + propertyName + "/>" +
                        "</D:prop>" +
                        "<D:literal>" +
                            value +
                        "</D:literal>" +
                    "</D:eq>" +
                "</D:where>" +
            "</D:basicsearch>" +
        "</D:searchrequest>";
        SearchMethod method = new SearchMethod("/slide/files", query);
        HttpClient client = new HttpClient();
        client.setState(new WebdavState());
        client.getHostConfiguration().setHost(httpURL);
        client.executeMethod(method);
        return method.getAllResponseURLs(); 
} 
 calling getXMLFiles("getcontenttype", "text/xml");
should return "/slide/files/set1/set2/set3/test.xml" in the enumeration,
but it does not. 



---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: SearchMethod issue

Posted by Sam Weinger <sa...@wrycan.com>.
Found cause of problem in the web.xml file of my slide servlet 
(depth-limit param).  So many xml config files, so little time!

Sam Weinger wrote:

> Is there a way to recursively search all resources under /slide/files to
> any depth using the org.apach.webdav.lib.methods.SearchMethod class?  I
> am only able to get results that are up to 2 levels below the value of
> the <DAV:href> element in the request body.  So if I have a file
> /slide/files/set1/set2/set3/test.xml and the following function:
>
> Enumeration getPaths(String propertyName, String value) {
>       HttpURL httpURL = new HttpURL("http://localhost:8080/slide");
>        String query = "<?xml version=\"1.0\"?>" +
>        "<D:searchrequest xmlns:D = \"DAV:\" >" +
>            "<D:basicsearch>" +
>                "<D:select>" +
>                    "<D:prop><D:"+ propertyName + "/></D:prop>" +
>                "</D:select>" +
>                "<D:from>" +
>                    "<D:scope>" +
>                        "<D:href>/slide/files</D:href>" +
>                        "<D:depth>infinity</D:depth>" +
>                    "</D:scope>" +
>                "</D:from>" +
>                "<D:where>" +
>                    "<D:eq>" +
>                        "<D:prop>" +
>                            "<D:" + propertyName + "/>" +
>                        "</D:prop>" +
>                        "<D:literal>" +
>                            value +
>                        "</D:literal>" +
>                    "</D:eq>" +
>                "</D:where>" +
>            "</D:basicsearch>" +
>        "</D:searchrequest>";
>        SearchMethod method = new SearchMethod("/slide/files", query);
>        HttpClient client = new HttpClient();
>        client.setState(new WebdavState());
>        client.getHostConfiguration().setHost(httpURL);
>        client.executeMethod(method);
>        return method.getAllResponseURLs(); } calling 
> getXMLFiles("getcontenttype", "text/xml");
> should return "/slide/files/set1/set2/set3/test.xml" in the enumeration,
> but it does not.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: Problem using custom JAAS authentication

Posted by "Christopher W. Farnham" <ch...@wrycan.com>.
I was able to fix my own problem by adding these two lines to the 
<definitions> section of my Domain.xml
|
<auto-create-users>true</auto-create-users>            
<auto-create-users-role>org.apache.slide.structure.SubjectNode</auto-create-users-role>|

Christopher Farnham
Senior Consultant at Wrycan, Inc.

chris.farnham@wrycan.com
http://www.wrycan.com



Christopher W. Farnham wrote:

> I've been able to set up custom JAAS authentication in Slide 2.1.  I'm 
> not using Slide's JAAS implementation, but one of my own.
>
> I've turned off locking and security using the slide.properties file.
>
> I can log into slide using my custom JAAS Realm and navigate the tree 
> structure but when I try to PUT or GET, the following HTTP error is 
> thrown:|
>
> http-8080-Processor4, 25-Mar-2005 13:10:08, username, PUT, 409 
> "Conflict", 311 ms, /files/sample.txt
> |
> I've included my slide.properties file and Domain.xml file.  Any help 
> would be greatly appreciated.
>
> Thank you,
> Chris|
>
> |
>
>Christopher Farnham
>Senior Consultant at Wrycan, Inc.
>
>chris.farnham@wrycan.com
>http://www.wrycan.com
>
>
>
>>
>------------------------------------------------------------------------
>
><?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 classname="org.apache.slide.store.mem.TransientLockStore">
>                   <!-- <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>
>            <!-- Custom Wrycan ContentInterceptor !-->
>            <content-interceptor class="com.wrycan.slide.content.DocumentIDContentInterceptor">
>            	<parameter name="match-xml-files">^.*\.xml$</parameter> 
>            </content-interceptor>
>            
>            <!-- 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>
>            <!-- Setting this to true will force Slide to internally convert the username a user
>                 enters at login to lowercase. This is useful for users who can't be bothered
>                 with turning off their capslock key before logging in. -->
>            <parameter name="force-lowercase-login">false</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="authenticated" inheritable="true"/>
>                <!--
>                
>                
>                <permission action="all" subject="/roles/wrycan-developers" 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"/>
>                !-->
>                
>                <!-- 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">false</parameter>
>    <parameter name="versioncontrol-exclude"/>
>    <parameter name="checkout-fork">forbidden</parameter>
>    <parameter name="checkin-fork">forbidden</parameter>
>
>
>    <!-- Extractor configuration -->
>    <extractors>
>        <extractor classname="org.apache.slide.extractor.SimpleXmlExtractor" uri="/files/articles/test.xml">
>            <configuration>
>                <instruction property="title" xpath="/article/title/text()" />
>                <instruction property="summary" xpath="/article/summary/text()" />
>            </configuration>
>        </extractor>
>        <extractor classname="org.apache.slide.extractor.OfficeExtractor" uri="/files/docs/">
>            <configuration>
>                <instruction property="author" id="SummaryInformation-0-4" />
>                <instruction property="application" id="SummaryInformation-0-18" />
>            </configuration>
>        </extractor>
>    </extractors>
>
>    <!-- Event configuration -->
>    <events>
>        <event classname="org.apache.slide.webdav.event.WebdavEvent" enable="true" />
>        <event classname="org.apache.slide.event.ContentEvent" enable="true" />
>        <event classname="org.apache.slide.event.ContentEvent" method="retrieve" enable="false" />
>        <event classname="org.apache.slide.event.EventCollection" enable="true" />
>        <event classname="org.apache.slide.event.TransactionEvent" enable="true" />
>
>        <event classname="org.apache.slide.event.MacroEvent" enable="true"/>
>
>        <!--listener classname="org.apache.slide.util.event.EventLogger" /-->
>        <listener classname="org.apache.slide.event.VetoableEventCollector" />
>        <listener classname="org.apache.slide.event.TransientEventCollector" />
>        <listener classname="org.apache.slide.webdav.event.NotificationTrigger">
>            <configuration>
>                <notification include-events="false" />
>                <persist-subscriptions filename="subscriptions.xml" />
>            </configuration>
>        </listener>
>        <listener classname="org.apache.slide.extractor.PropertyExtractorTrigger" />
>        <listener classname="org.apache.slide.search.IndexTrigger">
>            <configuration>
>                <indexer classname="org.apache.slide.search.LoggingIndexer" synchronous="false" uri="/files/articles" />
>            </configuration>
>        </listener>
>        
>		<!-- Uncomment for cluster support. Be sure to local-host and repository-host -->
>		<!--
>		<listener classname="org.apache.slide.cluster.ClusterCacheRefresher">
>			<configuration>
>				<node local-host="local.host.domain"
>				      local-port="4444"
>					  repository-host="remote.host.domain"
>					  repository-port="8080"
>					  repository-protocol="http"
>					  username="root"
>					  password="root"
>					  base-uri="/files/"
>				/>
>			</configuration>
>		</listener>
>		-->
>
>        <listener classname="org.apache.slide.macro.MacroPropertyUpdater">
>          <!-- Listener that updates some properties if resources are 
>               copied or moved.  This requires MacroEvents enabled (at 
>               least methods copy and move) -->
>          <configuration>
>            <update-displayname>true</update-displayname>
>            <update-owner-on-move>false</update-owner-on-move>
>            <update-owner-on-copy>true</update-owner-on-copy>
>          </configuration>
>        </listener>
>    </events>
></slide>
>  
>
>------------------------------------------------------------------------
>
># Domain XML definition file
># Default : Will look for domain.xml in current directory
>#org.apache.slide.domain=Domain.xml
>
># Automatically perform security checks
># Default : true
>org.apache.slide.security=false
>
># Automatically perform locking checks
># Default : true
>org.apache.slide.lock=false
>
># Use version control (DeltaV)
># Default: true
>org.apache.slide.versioncontrol=false
>
># DASL
># Default: true
>org.apache.slide.search=true
>
># Binding extension to WebDAV
># Default: true
>org.apache.slide.binding=false
>
># URL Encoding
># Default: platform default encoding is used, if the entry is not present
>org.apache.slide.urlEncoding=UTF-8
>
># Debug
># Default: false
>org.apache.slide.debug=true
>
># Servlet auto-reload after changes to the stores configuration
># Default: true
>org.apache.slide.store.tamino.servlet.autoreload=true
>
>
>  
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: slide-user-help@jakarta.apache.org
>

Problem using custom JAAS authentication

Posted by "Christopher W. Farnham" <ch...@wrycan.com>.
I've been able to set up custom JAAS authentication in Slide 2.1.  I'm 
not using Slide's JAAS implementation, but one of my own.

I've turned off locking and security using the slide.properties file.

I can log into slide using my custom JAAS Realm and navigate the tree 
structure but when I try to PUT or GET, the following HTTP error is thrown:|

http-8080-Processor4, 25-Mar-2005 13:10:08, username, PUT, 409 
"Conflict", 311 ms, /files/sample.txt
|
I've included my slide.properties file and Domain.xml file.  Any help 
would be greatly appreciated.

Thank you,
Chris|

|

Christopher Farnham
Senior Consultant at Wrycan, Inc.

chris.farnham@wrycan.com
http://www.wrycan.com



>