[Building Sakai] Sakai new Tool - currentUser

Jaco Gillman jaco at opencollab.co.za
Mon Feb 10 12:30:19 PST 2014


Hi John

Thanks for your reply. I have copied the content of the tool's web.xml at
the bottom.



I found the following information that I most definitely believe may the
cause of the problems I experience:



https://confluence.sakaiproject.org/display/~markjnorton/JSP+in+Sakai

http://osdir.com/ml/cms.sakai.devel/2006-06/msg00466.html



I only wonder how relevant these posts and example (ServletTool2) still is,
seeing that they were posted in 2006. Finding documentation that deals with
this matter (new tool implementation and request implementation) has been
unsuccessful thusfar.



 <display-name>sakai.mytool</display-name>

    <!--  This application's servlet class -->
    <servlet>
        <servlet-name>sakai.apcmanager</servlet-name>

<servlet-class>uk.ac.cam.caret.sakai.WebappToolServlet</servlet-class>
        <init-param>
            <param-name>main-page</param-name>
            <param-value>/index.htm</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <!-- Sakai Request Filter -->
    <filter>
        <filter-name>sakai.request</filter-name>
        <filter-class>org.sakaiproject.util.RequestFilter</filter-class>
        <!-- If you need to do uploads you will need this -->
        <init-param>
            <param-name>upload.enabled</param-name>
            <param-value>false</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>sakai.request</filter-name>
        <servlet-name>sakai.mytool</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
     <!-- Sakai Tool Listener -->
    <listener>
        <listener-class>org.sakaiproject.util.ToolListener</listener-class>
    </listener>
    <!-- Sakai Spring Listener -->
    <listener>

<listener-class>org.sakaiproject.util.ContextLoaderListener</listener-class>
    </listener>
    <!-- Dispatcher servlet -->
    <servlet>
        <servlet-name>springapp</servlet-name>

<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <!--   Dispatcher servlet mapping -->
    <servlet-mapping>
        <servlet-name>springapp</servlet-name>
        <url-pattern>*.htm</url-pattern>
    </servlet-mapping>



Regards,

*Jaco Gillman*

Java Developer

opencollab

*Tel*: +27 21 970 4017  |  *Fax*: +27 21 914 3098

*Email*: jaco at opencollab.co.za  |  *Skype*: gillmanjc

*Web*: www.opencollab.co.za



On 10 February 2014 17:50, John Bush <jbush at anisakai.com> wrote:

> Are you sure that sakai' request filter is being used on every
> request, without that you are dead in the water.  Might want to review
> your web.xml.
>
> On Mon, Feb 10, 2014 at 5:31 AM, Jaco Gillman <jaco at opencollab.co.za>
> wrote:
> > Hi All
> >
> > I am in the process of creating a new Sakai Tool. Programmatically
> creating
> > course Sites, adding users, creating groups etc etc.
> >
> > When I select the tool as Admin, my first request contains this admin
> user,
> > but all other requests inside my tool return a User object from
> > userDirectoryService.getCurrentUser(); with no ID or EID value. I then
> tried
> > to set this user on the HttpSession, but again, once I enter my tool's
> > context, and any other controller method, the user object is no where to
> be
> > found on the session. Some of my previous emails mentioned the fact that
> I
> > struggled to create Course Site, add users due to Permission
> restrictions.
> >
> >
> > I used the Sakai archetype to create the tool.  I have created a Service
> > interface, with which my tool's frond-end integrates with, and in my
> Service
> > implementation I integrate with
> >
> >
> > Regards,
> >
> > Jaco Gillman
> >
> > Java Developer
> >
> > opencollab
> >
> > Tel: +27 21 970 4017  |  Fax: +27 21 914 3098
> >
> > Email: jaco at opencollab.co.za  |  Skype: gillmanjc
> >
> > Web: www.opencollab.co.za
> >
> >
> > ________________________________
> > See OpenCollab email disclaimer at
> > http://www.opencollab.co.za/email-disclaimer
> > _______________________________________________
> > sakai-dev mailing list
> > sakai-dev at collab.sakaiproject.org
> > http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> >
> > TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org
> > with a subject of "unsubscribe"
>
>
>
> --
> John Bush
> 602-490-0470
>
> ** This message is neither private nor confidential in fact the US
> government is storing it in a warehouse located in Utah for future
> data mining use cases should they arise. **
>

-- 

------------------------------
See OpenCollab email disclaimer at 
http://www.opencollab.co.za/email-disclaimer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20140210/05e5f081/attachment.html 


More information about the sakai-dev mailing list