[Building Sakai] Sitebrowser description

Prakash, Savitha savithap at umich.edu
Thu May 28 06:33:30 PDT 2009


Daniel,
These are things you have to do to incorporate stripped and trimmed description for sitebrowser-

1. You have to add http://bugs.sakaiproject.org/jira/secure/attachment/17753/SiteTextEditUtil.java file into site-manage-util/src/java

2. In site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteBrowserAction.java,
[a] replace  "context.put("siteBrowserTextEdit", new SiteBrowserTextEditAction());" with "context.put("siteBrowserTextEdit", new SiteTextEditUtil());" in buildListContext method.
[b] you will have import the package import org.sakaiproject.site.util.SiteTextEditUtil;

3.  In /site-manage-tool/tool/src/webapp/vm/sitebrowser/chef_sitebrowser_list.vm, replace the description
 "<td headers="description">  #set ($desc = $site.Description)  </td>" with
" <td headers="description">   #set ($desc = $site.Description)                                           $siteBrowserTextEdit.doPlainTextAndLimit($desc,50,$tlang.getString("list.desc.ellipse"))  </td>"

Where $tlang.getString("list.desc.ellipse") refers to the ellipse pattern you would like to end the description with, like "...."; and second parameter refers to the number of characters you would like to restrict for the description.

Hope this helps,
Savitha


On 5/28/09 4:29 AM, "Daniel Merino" <daniel.merino at unavarra.es> wrote:

Hi all.

We are experiencing the problems described in the JIRA
http://bugs.sakaiproject.org/jira/browse/SAK-13149 . This JIRA is
related to another one
(http://bugs.sakaiproject.org/jira/browse/SAK-15823) where is a patch,
but I think that this patch is for Sakai 2.6 and we need to apply it to
2.5.3. The problem is that, in the Site Browser tool,  the descriptions
of the sites are made with HTML and this umbalance all the display.

I have been tracking the code and in the velocity file
/site-manage-tool/tool/src/webapp/vm/sitebrowser/chef_sitebrowser_list.vm
there is this:

$validator.escapeHtml($desc)

And AFAIK, in the class
site-manage/tags/sakai_2-5-3/site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteBrowserAction.java
is implemented the logic of the application.

I would like to know how could I add in SiteBrowserAction.java some
plainText method to convert the HTML to plain text, as in the patch's
class
(http://bugs.sakaiproject.org/jira/secure/attachment/17753/SiteTextEditUtil.java)
and after, how could I pass this new text to the vm file.

I don't know very much of Velocity, I'm sorry if this question is too basic.

Of course, if somebody has patched this already in their 2.5.X, I would
be very grateful to try his patch.

Thanks in advance.
Regards.
--
Daniel Merino
daniel.merino at unavarra.es
Gestor de teleformación - Centro Superior de Innovación Educativa.
Tfno: 948-168489 - Universidad Pública de Navarra.
_______________________________________________
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/20090528/ddd00155/attachment.html 


More information about the sakai-dev mailing list