|
From: Wolfgang L. <w_l...@us...> - 2004-12-08 23:05:01
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14737/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Commenting / Bugfixing Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- PortalManagerImpl.java 8 Dec 2004 15:19:44 -0000 1.54 +++ PortalManagerImpl.java 8 Dec 2004 23:04:23 -0000 1.55 @@ -355,11 +355,23 @@ return true; } + /** + * This method adds glossary information to the HTML content. + * Therefore, the item class "glossaryitem" has to exist and be filled + * with items where the title is the term and the description the + * explanation of a term. Furthermore, the state has to be set to "1". + * @param htmlText The HTML text to which glossary information should be added + * @return The htmlText enriched by glossary (the terms are underlined and + * marked by an information sign. + */ private String addGlossaryInfo(String htmlText){ - List glossaryTerms = + // get all published (state=1) glossary items + List glossaryTerms = itemManager.searchItems("/item[itemclass='glossaryitem' and state=1]"); if (glossaryTerms == null) return htmlText; - Iterator i = glossaryTerms.iterator(); + // 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(); |