[Building Sakai] How difficult is to implement event registering for other tools?

Luiz Antonio Falaguasta Barbosa lafbarbosa at gmail.com
Mon Mar 16 10:33:49 PDT 2009


Hi Stephen,

Thanks! I'll look for where I should to do that.

About my last message, where I said I got to change the calling putting the
it into AnnouncementAction class (in initState method), it didn't work. I
though I had made deploy, but not. It's running only from a calling into
announcement-api.

Luiz

2009/3/16 Steve Swinsburg <s.swinsburg at lancaster.ac.uk>

> Hi Luiz,
> Ok well to make your life easier, and to save modifying every tool, I am
> almost certain that you could add the event generation code that you need to
> the part of the portal that loads up the tool in the iframe, when its
> selected from the tool list. So it goes in one place only (the portal)
> rather than every tool.
>
> It would already know what the toolId is and you could just generate an
> event that userX visited toolY in locationZ.
>
> I reckon that is your best bet :)
>
>
> cheers,
> Steve
>
> ---
> Steve Swinsburg
> Portal Systems Developer
> Centre for e-Science
> Lancaster University
> Lancaster
> LA1 4YT
>
> email: s.swinsburg at lancaster.ac.uk
> phone: +44 (0) 1524 594870
>
>
>
>
>
>
>
> On 16 Mar 2009, at 17:17, Luiz Antonio Falaguasta Barbosa wrote:
>
> Hi guys,
>
> Aaron:
>
> - Thanks for tip about to make callings from tool and not from api, I
> changed the calling, putting the it into AnnouncementAction class (in
> initState method) and it worked fine. Thanks!
>
> - What should I do to don't need to put dependencies?
>
> Stephen:
>
> I just need to put events related to the visit of users in a tool (when
> user click on tool name in menu).
>
> Thanks in advance!
>
> Luiz
>
> 2009/3/16 Steve Swinsburg <s.swinsburg at lancaster.ac.uk>
>
>> Hi Luiz,
>> What kinds of events are you trying to add support for? Announcements
>> already publishes events (annc.new), so does Resources/ Content
>> (content.new, content.delete, content.revise).
>> Perhaps with this info we can guide you a bit better.
>>
>>
>> cheers,
>> Steve
>>
>> ---
>> Steve Swinsburg
>> Portal Systems Developer
>> Centre for e-Science
>> Lancaster University
>> Lancaster
>> LA1 4YT
>>
>> email: s.swinsburg at lancaster.ac.uk
>> phone: +44 (0) 1524 594870
>>
>>
>>
>>
>>
>>
>>
>> On 16 Mar 2009, at 14:17, Luiz Antonio Falaguasta Barbosa wrote:
>>
>> Hi people,
>>
>> I got to put it into Announcement tool, only doing the following:
>>
>> Putting it in a method of
>> org.sakaiproject.announcement.cover.AnnouncementService:
>>
>> EventTrackingService.post(EventTrackingService.newEvent("sakai.announcement",
>> "/announcement", true));
>>
>> Putting it into announcement/announcement-api/api/project.xml:
>>
>> <dependency>
>>             <groupId>sakaiproject</groupId>
>>             <artifactId>sakai-event-api</artifactId>
>>             <version>${sakai.version}</version>
>> </dependency>
>>
>> Putting it into announcement/announcement-api/api/pom.xml:
>>
>> <dependency>
>>       <groupId>org.sakaiproject</groupId>
>>       <artifactId>sakai-event-api</artifactId>
>>       <version>${sakai.version}</version>
>>       <scope>provided</scope>
>>     </dependency>
>>
>> Now, I've been trying to do the same thing with content tool, but I didn't
>> get to obtain an event from none method of ContentHostingService and
>> ContentHostingService classes.
>>
>> Please, does anybody know how could I get to do this?
>>
>> Thanks in advance!
>>
>> Regards,
>>
>> Luiz
>>
>> 2009/3/11 Stephen Swinsburg <s.swinsburg at lancaster.ac.uk>
>>
>>> No problem. One thing though, you mentioned in your last post that you
>>> wnted to add event publishing to other tools:
>>>
>>> - Repository
>>>> - Wiki
>>>> - Members
>>>> - Blogger
>>>> - Weblog
>>>> - etc
>>>>
>>>>
>>>  You will find that many other Sakai tools publish events, you just need
>>> to know what events to look for, have a trawl through the SAKAI_EVENT table
>>> after creating some files in Resources, or editing a few pages in the wiki,
>>> posting some blog posts etc. If you find that a specific tool isn't
>>> publishing events then you can search for or file a Jira (
>>> http://jira.sakaiproject.org/jira) feature request for those tools to
>>> add event publishing.
>>>
>>> If you figure out where the event support should go in particular tools
>>> that lack it, create some patches and attach to the Jira tickets.
>>>
>>> Best of luck!
>>>
>>> cheers,
>>> Steve
>>>
>>> ---
>>> Steve Swinsburg
>>> Portal Systems Developer
>>> Centre for e-Science
>>> Lancaster University
>>> Lancaster
>>> LA1 4YT
>>>
>>> email: s.swinsburg at lancaster.ac.uk
>>> phone: +44 (0) 1524 594870
>>>
>>> On 11/03/2009, at 7:11 PM, Luiz Antonio Falaguasta Barbosa wrote:
>>>
>>> Fine!
>>>
>>> Now, I need to discover where I should make calls for
>>> someLogic.postEvent(...); in each tool.
>>>
>>> Thanks Steve!
>>>
>>> Regards,
>>>
>>> Luiz
>>>
>>> 2009/3/11 Stephen Swinsburg <s.swinsburg at lancaster.ac.uk>
>>>
>>>> Hi Luiz,
>>>> An event is just a notification that someone did something somewhere. If
>>>> you have a tool that you want to register events into the Sakai Event table,
>>>> then you just need to inject the EventTrackingService like this:
>>>> private EventTrackingService eventTrackingService;
>>>> public void setEventTrackingService(EventTrackingService
>>>> eventTrackingService) {
>>>>  this.eventTrackingService = eventTrackingService;
>>>> }
>>>>
>>>> then have a method in your API/IMPL (lets call it someLogic) that post's
>>>> the event:
>>>> public void postEvent(String event,String reference,boolean modify) {
>>>>  eventTrackingService.post(eventTrackingService
>>>> .newEvent(event,reference,modify));
>>>> }
>>>>
>>>> then in your tool, when appropriate, ie after said event has just
>>>> occurred, post the event:
>>>>
>>>> someLogic.postEvent("my.tool.event", "whereverTheEventOccurred", true);
>>>>
>>>> true for modify type events, ie if something was changed, false for just
>>>> viewing/accessing something.
>>>>
>>>> cheers,
>>>> Steve
>>>>
>>>> ---
>>>> Steve Swinsburg
>>>> Portal Systems Developer
>>>> Centre for e-Science
>>>> Lancaster University
>>>> Lancaster
>>>> LA1 4YT
>>>>
>>>> email: s.swinsburg at lancaster.ac.uk
>>>> phone: +44 (0) 1524 594870
>>>>
>>>>  On 11/03/2009, at 6:40 PM, Luiz Antonio Falaguasta Barbosa wrote:
>>>>
>>>> Hi people,
>>>>
>>>> I've been looking for a way to implement event storing for other tools,
>>>> like these:
>>>>
>>>> - Repository
>>>> - Wiki
>>>> - Members
>>>> - Blogger
>>>> - Weblog
>>>> - etc
>>>>
>>>> What I could see is that I need to call newEvent method from
>>>> EventTrackingService class, as described in this mail list by Steve
>>>> Swingsburg.
>>>>
>>>> But, besides to call this method, what more may I do to give support to
>>>> event registering for old tools (I don't need to show results into sitestats
>>>> because I'm inserting events in a database of other tool, my own tool; I
>>>> just need send the event to be registered by calling writeBatchEvents
>>>> method)?
>>>>
>>>> Thanks in advance!
>>>>
>>>> Regards,
>>>>
>>>> Luiz
>>>> _______________________________________________
>>>> 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"
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090316/8c8b7e75/attachment.html 


More information about the sakai-dev mailing list