[Building Sakai] About the content tool and the permissions helper tool

Glauber Cabral glauber.sp at gmail.com
Wed Apr 15 12:54:02 PDT 2009


Hi Jim.
I've downloaded sakai 2.5.4 and debbuged it.
I found that only initializeAction is called inside content tool.
cancelAction and finalizeAction have no call inside this tool neither
inside authz tool.

I found that org.sakaiproject.authz.tool.PermissionsAction has methods
doSave and doCancel that are called when the respective action is
executed in the UI in the permission tool.

I think I can make calls to finalizeAction and cancelAction inside
these functions, respectively.
As I'm new to sakai development, I'd like to ask the opinion of the
list about this choice. And ask if I have missed the point where those
functions are already being called.

To solve my problem and avoid other tools to calling those functions
(if this is not the expected behavior), I can verify that the
SessionState property "sakaiproject.permissions.prefix" has the value
"content.", inside authz tool, before calling finalizeAction and
cancelAction.

I' just asking the list because you told me this was working and,
because I could not make it work, I'm not sure if I've missed
something.

Thank you in advance,
Glauber Cabral



On Wed, Apr 8, 2009 at 2:57 PM, Jim Eng <jimeng at umich.edu> wrote:
> Hi Glauber,
>
> Since 2.5.0, the permission helper has been launched in response to the user
> invoking a org.sakaiproject.content.types.FolderType.FolderPermissionsAction
> with respect to a particular folder.  The FolderPermissionsAction implements
> the InteractionAction interface, which defines a pair of methods that might
> be what you are looking for:
>
>        /**
>
> *ResourcesActioncallsthismethodbeforestartingthehelper.Thisisintendedtogive
>
> *theregistrantachancetodoanypreparationneededbeforethehelperstartswithrespect
>
> *tothisactionandthereferencespecifiedintheparameter.ThemethodreturnsaString
>
> *(possiblynull)whichwillbeprovidedasthe"initializationId"parametertoother
>         *methodsandin
>         *@paramreference
>         *@return
>         */
>        public String initializeAction(Reference reference);
>
>        /**
>
> *ResourcesActioncallsthismethodaftercompletionofitsportionoftheaction.
>         *@paramreferenceThe
>         *@paraminitializationId
>         */
>        public void finalizeAction(Reference reference, String
> initializationId);
>
>        /**
>
> *ResourcesActioncallsthismethodiftheusercancelsoutoftheactionorsomeerror
>
> *occurspreventingcompletionoftheactionafterthehelpercompletesitspartofthe
>         *action.
>         *@paramreference
>         *@paraminitializationId
>         */
>        public void cancelAction(Reference reference, String
> initializationId);
>
> The point is that initializeAction() is called before the permissions helper
> is launched and either finalizeAction() or cancelAction() is called when the
> helper is done.  Those would be the places where you could participate in
> the activity of the helper.
>
> HTH.
>
> Jim
>
>
>
> On Apr 8, 2009, at 9:27 AM, Glauber Cabral wrote:
>
>> Dear Sakai devs.
>>
>> This is my first message to the list and I'm developing using sakai2.4.
>> I need to execute an action when folder permissions are changed in the
>> Content tool.
>> As I could see, it uses the permissions.helper tool from authz tool..
>>
>> I tried to overwrite ToolServlet.sendToHelper inside ResourcesAction
>> to get permissions before and after the execution of the helper tool.
>> The problem in this function is that it is called 2 or 3 times before
>> getting into the helper and 2 or 3 times after leaving the helper and
>> i could not see any difference in the request and response parameters.
>>
>> The other method I tried working on was the
>> ResourcesActions.doDispatchAction().
>> Inside this method there is a call to ToolServlet.startHelper(). So I
>> tried to get existing permissions before and after this function call.
>> The problem is that the call returns immediately after setting the
>> helper tool and not after leaving the helper tool.
>>
>> I could not find where (inside Content tool) the return from the
>> helper tool is treated to get the permissions in this place.
>>
>> Do you have any suggestions about which method should I overwrite? Is
>> there such a service in another sakai tool that I could use?
>> I need to code the action inside Content tool.
>>
>> Thank you a lot for your attention.
>>
>> Glauber Cabral
>> _______________________________________________
>> 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"
>>
>>
>
>


More information about the sakai-dev mailing list