[Building Sakai] MSGCNTR-691

Matthew Jones matthew at longsight.com
Wed Oct 10 12:41:18 PDT 2012


It looks like context is only stored directly for private topics (private
messages)? I'm not seeing a context stored on either topic or forum.

My guess is you'd have to go through the area some how off the forum. I
think I'd know how to do this on the database, but not sure about through
the api's. I think the surrogateKey on the Forum relates to the Area.

Forum->getAreaindex()->Get the Area by Index somehow->getContextId()

Sounds like the better idea, I had to do this for a few things in
assignments recently to get them to work outside of the UI.:)

On Wed, Oct 10, 2012 at 2:55 PM, Zhen Qian <zqian at umich.edu> wrote:

> Hi, all:
>
> I have question about MSGCNTR-691: NPE caused Forum messages not
> searchable under server-client search config
>
> Stacktrace is included inside the ticket, and here is the related code:
>
>
>   public boolean isRead(DiscussionTopic topic, DiscussionForum forum,
> String userId){
>       return isRead(topic, forum, userId, getContextId());
>   }
>
> ....
>   private String getContextId()
>   {
>     LOG.debug("getContextId()");
>     if (TestUtil.isRunningTests())
>     {
>       return "test-context";
>     }
>     Placement placement = toolManager.getCurrentPlacement();
>     String presentSiteId = placement.getContext();
>     return presentSiteId;
>   }
>
> Notice when user did search inside Search tool,
> toolManager.getCurrentPlacement() returns null value inside getContextId()
> call.
>
> I would suggest a change in the isRead() function: get the site id value
> from DiscussionTopic object or Forum object, instead of calling
> getContextId(). Can anyone show me the right way to do this?
>
> Thanks,
>
> - Zhen
>
> _______________________________________________
> 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/20121010/65311534/attachment.html 


More information about the sakai-dev mailing list