Luca Zago wrote:
> Thank you very much for the suggesstons, Christopher .
> But my doubts remain:, following my observations:
>
> Christopher Lenz wrote:
>
>> Luca Zago wrote:
>>
>>>
>>> Hi,
>>> - has somebody ever created a template to associate to webDav servlet?
>>> In my opinion it's a tricky..because it does only a forward....then the
>>> only solution for the template is building
>>> another servlet..with different html format..inside.
>>
>>
>>
>> I don't understand. Could you try to explain why it's a problem that
>> the webdav-servlet forwards to the template? You can forward to a
>> JSP-page that uses the Slide taglib as a template, for example.
>
> ---> Sure I can do it, but I wonder in that case what is the utility of
> the webDav servlet. In the sense that all the permissions checking must
> be done by taglib in the page. Instead using the standard servlet these
> cheking is done by the servlet itself..and the result are the files you
> really can access.
> I am evaluating the possibility to rewrite this servlet to templatize
> the static HTML code hard coded inside.
To be honest, I have no idea what your problem is. :-P
The WebdavServlet does processing of the WebDAV and HTTP requests. The
*only* thing it delegates to the template is GET requests to collection
nodes. Using the Slide taglib in the template you can effectively
generate the same kind of listing the WebDAV servlet generates, but you
can customize it.
The permission checking is done in the Slide kernel layer. Both the
taglib andd the WebDAV servlet get the permission checking for free.
Of course, you can also just extend the WebdavServlet and override
doGet(). But that's for people who like HTML in servlets, or who don't
want to use JSP.
>>> - And what about creating new roles? when I create a user with a new
>>> role I got the error:
>>>
>>> Sep 2002 19:34:25 - org.apache.slide.common.Domain - WARNING -
>>> Service slidestore.reference.JDBCDescriptorsStore@88df60 access error
>>> : mypackage.acl.slide.roles.SlideEditorImpl
>>> org.apache.slide.common.ServiceAccessException: Service
>>> slidestore.reference.JDBCDescriptorsStore@88df60 access error :
>>> mypackage.acl.slide.roles.
>>> SlideEditorImpl
>>
>>
>>
>> Make sure that class (SlideEditorImpl) is public and not abstract,
>> i.e. it must be instantiatable from outside the
>> mypackage.acl.slide.riles package.
>>
>> In addition, it needs to extend ObjectNode, and have a constructor
>> that matches the one in ObjectNode. I.e. it should look like:
>>
>> public class SlideEditorImpl extends SubjectNode {
>>
>> public SlideEditorImpl(String uri, Vector children, Vector links) {
>> super(uri, children, links);
>> }
>>
>> [...]
>>
>> }
>
>
> My class is exactly as you wrote :)
> then in the Domain.xml I added:
>
> <role name="editor">mypackage.acl.slide.roles.SlideEditorImpl </role>
>
> the code to create the user is:
>
> ObjectNode object = (ObjectNode)(Class.forName(ROLE_PACKAGE +
> info.getRole())).newInstance();
Here you're using the default constructor. The class must also have a
constructor with the parameters are outlined above, so that it can be
instantiated by the store.
> structure.create(slideToken, object, strUri);
> NodeRevisionDescriptor revision = new
> NodeRevisionDescriptor(0);
> revision.setProperty(new
> NodeProperty("resourcetype", "<collection/>",true));
> revision.setCreationDate(new Date());
> revision.setLastModified(new Date());
> revision.setProperty(
> new NodeProperty("getcontentlength", "0", true));
> revision.setProperty(
> new NodeProperty("source", "", true));
> revision.setProperty(
> new NodeProperty("password",info.getPassword(),
> NodeProperty.SLIDE_NAMESPACE));
>
> content.create(getSlideToken(), strUri, revision,null);
>
>
> The Errror is thrown by the last method call..at the content creation.
Weird. Can you send the full stack trace?
--
Christopher Lenz
/=/ cmlenz at gmx.de
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>