|
From: Michael K. <ko...@us...> - 2005-06-01 16:37:03
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1277 Modified Files: PortalManagerImpl.java Log Message: Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- PortalManagerImpl.java 6 Jan 2005 18:13:13 -0000 1.62 +++ PortalManagerImpl.java 1 Jun 2005 16:36:52 -0000 1.63 @@ -355,39 +355,6 @@ return true; } - /** - * Add glossary information to the HTML content - * This method adds descriptive HTML span tags for predefined terms which are - * displayed when the user drags the mouse over the terms. - * Therefore, the item class "glossaryitem" has to exist and be filled - * with items where the title is the term and the description is the - * explanation of a term. Furthermore, the state has to be set to "1" (= published). - * @param htmlText The HTML text to which glossary information should be added - * @return The htmlText enriched by glossary (the terms are underlined and - * display information when the mouse is dragged over them. - */ - private String addGlossaryInfo(String htmlText){ - // get all published (state=1) glossary items - List glossaryTerms = - itemManager.searchItems("/item[itemclass='glossaryitem' and state=1]"); - if (glossaryTerms == null) return htmlText; - // for each term found, add the information to the text by using regular expressions - // tbd: change reg. ex. to add this information not while within tags - Iterator i = glossaryTerms.iterator(); - while (i.hasNext()) { - Item nextItem = (Item)i.next(); - String nextTerm = (String)nextItem.getTitle(); - String nextDesc = (String)nextItem.getDescription(); - if (nextTerm!="") - { - Pattern pattern = Pattern.compile(nextTerm); - Matcher matcher = pattern.matcher(htmlText); - htmlText = matcher.replaceAll("<span title=\""+nextDesc+"\"><u class=\"dottedline\">"+nextTerm+"</u></span>"); - } - } - return htmlText; - } - /** * Print page after parsing the template as Velocity template @@ -441,7 +408,6 @@ } String pageLang = (String)pc.keySet().iterator().next(); String pageContent = (String)pc.get(pageLang); - pageContent = addGlossaryInfo(pageContent); if (page.getHeader() != null && !page.getHeader().equals("")) pageContent = "#parse (\""+page.getHeader()+"\")\n" + pageContent; |