[Building Sakai] Need help setting a tool title in 2.6

Matthew Jones jonespm at umich.edu
Sun Jan 9 19:39:36 PST 2011


Sorry, I didn't see your email last week Seth,

Both of the i18n fixes that might be involved in this that I could think of
(which I'd mentioned a few days ago here:
http://collab.sakaiproject.org/pipermail/sakai-dev/2011-January/010447.html)
were only in 2.7+ (SAK-16679 & KNL-241). These were related to KNL-447 where
exceptions were made and there's a few other SAK's for sakai.iframe.site
specifically (SAK-17863 & SAK-18733) that were filed. None of them still
look like problems for 2.6 though. :/

The only thing I can see from the webservice that's different from your code
is that it doesn't set the title on the "ToolConfiguration" it sets it on
the Tool - "ToolConfiguration.getTool()"

I'm guessing that setting the title for the tool placement is slightly
different
(
http://source.sakaiproject.org/release/kernel/1.1.9/apidocs/org/sakaiproject/tool/api/Placement.html#setTitle(java.lang.String)
)
Than the on the tool?
(
http://source.sakaiproject.org/release/kernel/1.1.9/apidocs/org/sakaiproject/tool/impl/ToolImpl.html#setTitle(java.lang.String)
)

 1288 for (Iterator i = pageEdits.iterator(); i.hasNext();) 1289 {
1290SitePage pageEdit = (SitePage) i.next();
1291 if (pageEdit.getTitle().equals(pagetitle)) 1292 {
1293ToolConfiguration tool = pageEdit.addTool();
1294 Tool t = tool.getTool(); 1295 1296 tool.setTool(toolid,
toolManager.getTool(toolid)); 1297 tool.setTitle(tooltitle);
1298//toolEdit.setTitle(tooltitle);
1299 //toolEdit.setToolId(toolid); 1300 tool.setLayoutHints(layouthints);
1301 } 1302 } 1303 siteService.save(siteEdit);


-Matthew

On Sun, Jan 9, 2011 at 9:46 PM, Steve Swinsburg
<steve.swinsburg at gmail.com>wrote:

> Hi Seth,
>
> Is there a chance this is related somehow to tool/page localisation work?
> The same thing happens when trying to set the title of the Home page using a
> web service call so it sounds like it is further down the stack.
>
> cheers,
> s
>
>
> On 31/12/2010, at 3:10 AM, Seth Theriault wrote:
>
> > Hello,
> >
> > I am doing some local work on an automated site feed in 2.6. One
> > of the requirements is to set the title of the "Site Information
> > Display" tool (sakai.iframe.site) that sits on the site's Home
> > page.
> >
> > I tried this code (courseID is the siteId), but I can't for the
> > life of me get it to work:
> >
> > String iframeToolId = "sakai.iframe.site";
> >
> > ToolConfiguration toolConfig =
> SiteService.getSite(courseID).getToolForCommonId(iframeToolId);
> > if (toolConfig == null) {
> >    LOG.error("Failed to find tool for siteId: " + courseID + " and
> toolId: " + iframeToolId );
> >  } else {
> >    LOG.debug("Setting title..... " );
> >    toolConfig.setTitle("Seth Testing");
> >    toolConfig.save();
> >    SiteService.save(site);
> >  }
> >
> > At the time I set the title, I will have just created a site, so
> > I know its siteId and that the sakai.iframe.site toolId is unique
> > to the site.
> >
> > Since setting it from the GUI works just fine, I took a look at
> > that code in:
> >
> > web/web-tool/tool/src/java/org/sakaiproject/web/tool/IFrameAction.java
> >
> > This code uses a Placement object to make the change:
> >
> >  Placement placement = ToolManager.getCurrentPlacement();
> > [...]
> >  // title
> >  String title = data.getParameters().getString(TITLE);
> >  // state.setAttribute(TITLE, title);
> >  if (StringUtil.trimToNull(title) == null)
> >  {
> >    addAlert(state, rb.getString("gen.tootit"));
> >    return;
> >  }
> >  placement.setTitle(title);
> >
> > [...]
> >
> >  // save
> >  // TODO: we might have just saved the entire site, so this would not be
> needed -ggolden
> >  placement.save();
> >
> > I know I am missing something, so help anyone?
> >
> > Seth
> >
> > _______________________________________________
> > 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"
>
> _______________________________________________
> 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/20110109/75e74076/attachment.html 


More information about the sakai-dev mailing list