|
From: Michael K. <ko...@us...> - 2004-03-30 13:21:49
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22484 Modified Files: PortalManagerImpl.java Log Message: Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- PortalManagerImpl.java 30 Mar 2004 12:31:58 -0000 1.6 +++ PortalManagerImpl.java 30 Mar 2004 13:10:12 -0000 1.7 @@ -185,7 +185,7 @@ */ public PortalPage getPage(String pagePath, String pageName) { - if (pagePath == null) pagePath = "/"; + if (pagePath == null) pagePath = ""; if (pageName == null) pageName = "index.html"; PortalPage p = pageCache.getPage(pagePath, pageName); if (p == null) { @@ -432,22 +432,23 @@ */ public int getPageItemId(String pagePath, String pageName) { + // TBD: currently we store the path in the filename + // this will be changed when the category component is + // finished - then we will first query the categories for + // the path, then check all page items in the given categroy + // for the pageName ... + String key = pagePath+pageName; Integer itemid = (Integer)pageItemIdCache.get(key); if (itemid!=null) { return itemid.intValue(); } - // first get category for path - PortalFolder c = getPortalFolder(pagePath); - if (c == null) return 0; - - // and now look for a portalpage item that has the portalfolder - // category assigned - - // tbd - - if (itemid!=null) { + String sql = "select itemid from page_object_html where " + +"filename = '"+pagePath+pageName+"'"; + Map m = dbAccess.sqlQuerySingleRow(sql); + if (m!=null && m.get("itemid")!=null) { + itemid = (Integer)m.get("itemid"); pageItemIdCache.put(key, itemid); return itemid.intValue(); } @@ -466,16 +467,24 @@ Map result = new HashMap(); Map conditions = new HashMap(); conditions.put("itemid", new Integer(itemid)); - - // tbd - // result.put(lang, m.get("content")); - + List fields = new ArrayList(); + fields.add("lang"); + fields.add("content"); + fields.add("fullcontext"); + List l = dbAccess.sqlSelect("page_object_html", conditions, fields); + Iterator i = l.iterator(); + while (i.hasNext()) { + Map m = (Map)i.next(); + String lang = (String)m.get("lang"); + String fullcontext = (String)m.get("fullcontext"); + result.put(lang, m.get("content")); + } return result; } /** - * Create a new portalpage item with the given attributes + * */ public int createPage(String pagePath, String pageName, String lang, String title, String content, boolean fullcontext, @@ -487,18 +496,54 @@ pagePath += "/"; if (!pagePath.startsWith("/")) pagePath = "/"+pagePath; - - // check if the pagePath is created - PortalFolder c = getPortalFolder(pagePath); - if (c == null) - throw new CobricksException("portal", "nopath", ""); - - // check if page already exits - // tbd - - // create new item - - + // check if there are already items for this pagePath + // tbd: check in the category information + Map conditions = new HashMap(); + conditions.put("filename", pagePath+pageName); + List fields = new ArrayList(); + fields.add("itemid"); + fields.add("lang"); + List l = dbAccess.sqlSelect("page_object_html", conditions, fields); + Integer itemid = null; + boolean exists = false; + Iterator i = l.iterator(); + while (i.hasNext()) { + Map m = (Map)i.next(); + itemid = (Integer)m.get("itemid"); + String mlang = (String)m.get("lang"); + if (mlang.equals(lang)) { + exists = true; + break; + } + } + // update or insert new item + if (itemid == null) { + // create new item + // tbd: currently just create a new itemid for the page_object_html + // table ... but this should call the item manager + String sql = "select max(itemid)+1 as maxid from page_object_html"; + Map m = dbAccess.sqlQuerySingleRow(sql); + if (m!=null && m.get("maxid")!=null) { + itemid = (Integer)m.get("maxid"); + if (itemid.intValue()<1) + itemid = new Integer(1); + } else { + itemid = new Integer(1); + } + } + if (exists) { + Map attrs = new HashMap(); + attrs.put("content", content); + dbAccess.sqlUpdate("page_object_html", attrs, "itemid=" + +itemid.toString()+" and lang='"+lang+"'"); + } else { + Map attrs = new HashMap(); + attrs.put("itemid", itemid); + attrs.put("filename", pagePath+pageName); // tbd: only pageName + attrs.put("lang", lang); + attrs.put("content", content); + dbAccess.sqlInsert("page_object_html", attrs); + } String key = pagePath+pageName; pageItemIdCache.put(key, itemid); portalStats.addPageUpdate(pagePath, pageName); @@ -950,3 +995,6 @@ } + + + |
|
From: Michael K. <ko...@us...> - 2004-05-28 08:08:56
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26840/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- PortalManagerImpl.java 31 Mar 2004 12:05:37 -0000 1.8 +++ PortalManagerImpl.java 28 May 2004 08:08:47 -0000 1.9 @@ -107,10 +107,12 @@ protected String adminPermissionAction = null; protected Category rootPortalFolder = null; + /** * Map holding all portal folders indexed by categoryid */ protected Map portalFolders; + /** * Map holding all portal folders indexed by path */ @@ -444,9 +446,14 @@ // and now look for a portalpage item that has the portalfolder // category assigned - - // tbd - + String xpath = "/item[itemclass='portalpagehtml' and " + +"name='"+pageName+"'] and " + +"folders/category/id="+Integer.toString(c.getId()); + List p = itemManager.searchItems(xpath); + if (p != null && p.size()>0) { + Item i = (Item)p.iterator().next(); + itemid = new Integer(i.getId()); + } if (itemid!=null) { pageItemIdCache.put(key, itemid); return itemid.intValue(); @@ -464,18 +471,25 @@ public Map getPageContents(int itemid) { Map result = new HashMap(); - Map conditions = new HashMap(); - conditions.put("itemid", new Integer(itemid)); - - // tbd - // result.put(lang, m.get("content")); - + try { + PortalPage page = (PortalPage)itemManager.getItem(itemid); + Set langs = page.getUsedLanguages(); + Iterator i = langs.iterator(); + while (i.hasNext()) { + String lang = (String)i.next(); + String content = page.getDescription(lang); + if (content != null) + result.put(lang, content); + } + } catch (CobricksException e) { + logger.warn("failed loading page item for id="+itemid); + } return result; } /** - * Create a new portalpage item with the given attributes + * Create a new portal page item with the given attributes */ public int createPage(String pagePath, String pageName, String lang, String title, String content, boolean fullcontext, @@ -496,19 +510,27 @@ // check if the page already exits // item aus klasse "portalpagehtml" mit bestimmtem namen - List items = itemManager.searchItems(""); - // tbd + String xpath = "/item[itemclass='portalpagehtml' and " + +"name='"+pageName+"'] and " + +"folders/category/id="+Integer.toString(c.getId()); + List items = itemManager.searchItems(xpath); + if (items != null && items.size()>0) + throw new CobricksException("portal", "exists", ""); // create new item object Map attrs = new HashMap(); Item item = null; try { attrs.put("itemclass", "portalpagehtml"); - attrs.put("name", ""); // tbd + attrs.put("name", pageName); attrs.put("mimetype", "text/html"); - attrs.put("title_en", ""); - attrs.put("folders", ""); // tbd + attrs.put("title_en", title); + Set folders = new HashSet(); + folders.add(c); + attrs.put("folders", folders); + logger.info("creating page item ..."); item = itemManager.createItem(attrs); + logger.info("created page item ..."); } catch (Exception e) { logger.error(LogUtil.ex("failed creating item", e)); throw new CobricksException("portal", "", ""); |
|
From: Michael K. <ko...@us...> - 2004-06-02 07:10:44
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23663/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- PortalManagerImpl.java 28 May 2004 12:53:49 -0000 1.10 +++ PortalManagerImpl.java 2 Jun 2004 07:10:19 -0000 1.11 @@ -448,7 +448,7 @@ // category assigned String xpath = "/item[itemclass='portalpagehtml' and " +"name='"+pageName+"'] and " - +"folders/category/id="+Integer.toString(c.getId()); + +"/item/folders/category/id="+Integer.toString(c.getId()); List p = itemManager.searchItems(xpath); if (p != null && p.size()>0) { Item i = (Item)p.iterator().next(); @@ -512,7 +512,7 @@ // item aus klasse "portalpagehtml" mit bestimmtem namen String xpath = "/item[itemclass='portalpagehtml' and " +"name='"+pageName+"'] and " - +"folders/category/id="+Integer.toString(c.getId()); + +"/item/folders/category/id="+Integer.toString(c.getId()); List items = itemManager.searchItems(xpath); if (items != null && items.size()>0) throw new CobricksException("portal", "exists", ""); |
|
From: Michael K. <ko...@us...> - 2004-06-07 10:28:21
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6430 Modified Files: PortalManagerImpl.java Log Message: Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- PortalManagerImpl.java 4 Jun 2004 05:34:48 -0000 1.12 +++ PortalManagerImpl.java 7 Jun 2004 10:28:12 -0000 1.13 @@ -904,6 +904,7 @@ while (i.hasNext()) { String path = (String)i.next(); PortalFolder c = getPortalFolder(path); + logger.debug("getPortalFolder("+path+") returned "+c); if (c == null) { // create category object attrs = new HashMap(); @@ -938,6 +939,7 @@ public List getPortalFolderPaths() { + logger.debug("getPortalFolderPaths()"); if (sortedFolderPathList != null) return sortedFolderPathList; sortedFolderPathList = new ArrayList(); sortedFolderPathList.addAll(portalFoldersByPath.keySet()); |
|
From: Michael K. <ko...@us...> - 2004-08-20 10:58:35
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9092/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- PortalManagerImpl.java 20 Aug 2004 07:44:26 -0000 1.20 +++ PortalManagerImpl.java 20 Aug 2004 10:58:24 -0000 1.21 @@ -591,7 +591,7 @@ HashMap attrs = new HashMap(); attrs.put("categoryclass", "portalfolder"); attrs.put("title_en", title); - attrs.put("path", path); + //attrs.put("path", path); PortalFolder pf = getPortalFolder(parentPath); Integer parentid = new Integer(pf.getId()); if (parentid != null) |
|
From: Florian F. <flo...@us...> - 2004-09-11 18:53:46
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6365/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Further Adaptions Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- PortalManagerImpl.java 11 Sep 2004 00:11:37 -0000 1.24 +++ PortalManagerImpl.java 11 Sep 2004 18:53:37 -0000 1.25 @@ -1621,11 +1621,11 @@ if (pageName.equalsIgnoreCase("index.html")) { htmlCode += "<tr><td><img src=\"/images/newfolder.jpg\" width=\"20\" height=\"20\" title=\"Neuer Ordner\" /></td>"; - htmlCode += "<td><a href='/cm/newFolder.html?navPageName=" + pageName + "&navPagePath=" + pagePath + "&ppath=" + pagePath + "'>"; + htmlCode += "<td><a href='/cm/pages/newfolder.html?navPageName=" + pageName + "&navPagePath=" + pagePath + "&ppath=" + pagePath + "'>"; htmlCode += "Neuer Ordner</a></td></tr>"; htmlCode += "<tr><td><img src=\"/images/edit.jpg\" width=\"20\" height=\"20\" title=\"Ordner bearbeiten\" /></td>"; - htmlCode += "<td><a href='/cm/editPage.html?navPageName=" + pageName + "&navPagePath=" + pagePath + "&ppath=" + pagePath + + htmlCode += "<td><a href='/cm/pages/editpage.html?navPageName=" + pageName + "&navPagePath=" + pagePath + "&ppath=" + pagePath + "&page_id="+ getPageItemId(pagePath,pageName) + "'>"; htmlCode += "Ordner bearbeiten</a></td></tr>"; @@ -1638,12 +1638,12 @@ htmlCode += "Ordner löschen</a></td></tr>"; htmlCode += "<tr><td><img src=\"/images/new.jpg\" width=\"20\" height=\"20\" title=\"Neue Seite\" /></td>"; - htmlCode += "<td><a href='/cm/newPage.html?navPageName=" + pageName + "&navPagePath=" + pagePath + "&ppath=" + pagePath + "'>"; + htmlCode += "<td><a href='/cm/pages/newpage.html?navPageName=" + pageName + "&navPagePath=" + pagePath + "&ppath=" + pagePath + "'>"; htmlCode += "Neue Seite</a></td></tr>"; } else { htmlCode += "<tr><td><img src=\"/images/edit.jpg\" width=\"20\" height=\"20\" title=\"Seite bearbeiten\" /></td>"; - htmlCode += "<td><a href='/cm/editPage.html?navPageName=" + pageName + "&navPagePath=" + pagePath + "&ppath=" + pagePath + + htmlCode += "<td><a href='/cm/pages/editpage.html?navPageName=" + pageName + "&navPagePath=" + pagePath + "&ppath=" + pagePath + "&page_id="+ getPageItemId(pagePath,pageName) + "'>"; htmlCode += "Seite bearbeiten</a></td></tr>"; |
|
From: Wolfgang L. <w_l...@us...> - 2004-09-12 13:30:09
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8466/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Removed access rights check from portal pages since it does not yet work. Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- PortalManagerImpl.java 12 Sep 2004 12:31:04 -0000 1.26 +++ PortalManagerImpl.java 12 Sep 2004 13:30:00 -0000 1.27 @@ -194,7 +194,6 @@ if (pagePath == null) pagePath = "/"; if (pageName == null) pageName = "index.html"; PortalPage p = pageCache.getPage(pagePath, pageName); - p = null; // deactivate cache if (p == null) { int itemid = getPageItemId(pagePath, pageName); if (itemid > 0) { @@ -224,9 +223,6 @@ { if (itemid < 1) return null; PortalPage p = pageCache.getPage(itemid); - - p = null; // deactivate cache - if (p == null) { // load data from database p = loadPageFromDatabase(itemid); @@ -250,9 +246,12 @@ logger.warn("Item class of portal page is "+o.getClass().getName()); return null; } + logger.info("Portal Page loaded."); PortalPage result = (PortalPage)o; // explicitly set content + logger.info("Initialising content."); result.initContent(); + logger.info("Content initialised."); return result; } catch (Exception e) { logger.warn(LogUtil.ex("Failed loading PortalPage object", e)); @@ -367,15 +366,18 @@ String lang = portalRequest.getLang(); PortalPage page = getPage(pagePath, pageName); - - // check access rights + + // check access rights - does not work yet + + /* if (!checkAccessPermission(page, portalRequest.getPortalUser(), "read")) { pagePath = "/"; pageName = "noaccess.html"; page = getPage(pagePath, pageName); } - + */ + // get page content Map pc = page.getStringContent(lang); if (pc == null || pc.size()<1) { @@ -409,7 +411,7 @@ portalRequest.setPageLang(pageLang); try { // parse Velocity template - Velocity.evaluate(portalRequest.getVelocityContext(), out, + Velocity.evaluate(portalRequest.getVelocityContext(), out, pageName, pageContent); } catch (ParseErrorException epe) { // syntax error - failed parsing the template |
|
From: Wolfgang L. <w_l...@us...> - 2004-09-14 21:49:15
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2881/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: fixed some minor bugs Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- PortalManagerImpl.java 14 Sep 2004 19:46:43 -0000 1.33 +++ PortalManagerImpl.java 14 Sep 2004 21:49:07 -0000 1.34 @@ -868,6 +868,12 @@ PortalFolder c = (PortalFolder)categoryManager.createCategory(attrs, creator, null); addPortalFolderToCache(c); + Set pfChildren = pf.getChildrenIds(); + Integer newChildID= new Integer(c.getId()); + pfChildren.add(newChildID); + pf.setChildrenIds(pfChildren); + logger.info("Neuen Ordner eingetragen!"); + return c.getId(); } @@ -903,12 +909,31 @@ */ public void deleteFolder(int cid, User user) throws CobricksException - { - PortalFolder pf = getPortalFolder(cid); - if (pf == null) return; - removePortalFolderFromCache(pf); - categoryManager.deleteCategory(cid, user); + { + String xpath_query = "/item[itemclass='portalpagehtml' and " + + " name='index.html' and " + + " folders/category/id="+cid + "]"; + logger.info("Suche nach Items in diesem Ordner"); + List pages = itemManager.searchItems(xpath_query); + for (int i = 0; i < pages.size(); i++) { + PortalPage p = (PortalPage) pages.get(i); + int itemid=p.getId(); + logger.info("Lösche Item ID "+itemid); + deletePage(itemid,null,user); } + PortalFolder pf = getPortalFolder(cid); + if (pf == null) return; + PortalFolder parentfolder = getPortalFolder(pf.getParentId()); + Set menge = parentfolder.getChildrenIds(); + Integer zahl = new Integer(pf.getId()); + menge.remove(zahl); + parentfolder.setChildrenIds(menge); + removePortalFolderFromCache(pf); + categoryManager.deleteCategory(cid, user); + logger.info("Kategorie "+cid+" wurde erfolgreich gelöscht."); + +} + public void deleteFoldertree(PortalFolder rootfolder, User user) throws CobricksException |
|
From: Florian F. <flo...@us...> - 2004-09-16 23:50:55
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4546/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Changed the pagesearch to case-insensitivity getTitle for a category iterates the languages if it's called for a language for that a title is not available Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- PortalManagerImpl.java 16 Sep 2004 00:07:26 -0000 1.38 +++ PortalManagerImpl.java 16 Sep 2004 23:50:45 -0000 1.39 @@ -2088,9 +2088,9 @@ String searchWord = searchExp; String query = "/item[itemclass='portalpagehtml' and (" + - "contains(description,'" + searchWord + "') or " + - "contains(navtitle,'" + searchWord + "') or " + - "contains(title,'" + searchWord + "')" + + "contains(translate(description, 'ABCDEFGHIJKLMNOPSQRTUVWXYZ', 'abcdefghijklmnopsqrtuvwxyz'),'" + searchWord + "') or " + + "contains(translate(navtitle, 'ABCDEFGHIJKLMNOPSQRTUVWXYZ', 'abcdefghijklmnopsqrtuvwxyz'),'" + searchWord + "') or " + + "contains(translate(title, 'ABCDEFGHIJKLMNOPSQRTUVWXYZ', 'abcdefghijklmnopsqrtuvwxyz'),'" + searchWord + "')" + ")]"; logger.info("Making XPathQuery with " + query); |
|
From: Florian F. <flo...@us...> - 2004-09-23 21:38:11
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20754/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: changed the style of the html-output Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- PortalManagerImpl.java 22 Sep 2004 16:29:26 -0000 1.43 +++ PortalManagerImpl.java 23 Sep 2004 21:37:59 -0000 1.44 @@ -1645,7 +1645,7 @@ if (page.getPageName().equals(pageName) && page.getPagePath().equals(pagePath)) selectedPage = true; - htmlCode += "<a href='"+page.getPagePath()+page.getPageName()+"'> "; + htmlCode += "<a href='"+page.getPagePath()+page.getPageName()+"' class='box'> "; String navtitle = page.getNavtitle(lang); if (selectedPage) htmlCode += "<b>" + navtitle + "</b>"; @@ -1716,8 +1716,8 @@ htmlCode += "<td><img src='/cm/images/tab_left.jpg' /></td>" + "<td style=\"background-image: url('/cm/images/tab_middle.jpg'); width: 100px; text-align: center;\">"; - //htmlCode += "<a href='" + mainFolderPath +"index.html'><nobr>" + mainNavTitle + "</nobr></a>"; - htmlCode += "<a href='" + mainFolderPath +"index.html'><nobr>" + "Home" + "</nobr></a>"; + //htmlCode += "<a href='" + mainFolderPath +"index.html' class='tabs'><nobr>" + mainNavTitle + "</nobr></a>"; + htmlCode += "<a href='" + mainFolderPath +"index.html' class='tabs'><nobr>" + "Home" + "</nobr></a>"; if (pagePath.equals(mainFolderPath)) htmlCode += "</td><td><img src='/cm/images/tab_right_selected.jpg' /></td>"; @@ -1732,6 +1732,7 @@ // Just the folders! logger.info("PortalPage with name " + folderPage.getPageName() + " found "); if (folderPage.getPageName().equals("index.html")) { + htmlCode+="<td> </td>"; if (pagePath.startsWith(folderPage.getPagePath())) htmlCode += "<td><img src='/cm/images/tab_left_selected.jpg' /></td>" + "<td style=\"background-image: url('/cm/images/tab_middle_selected.jpg');width: 100px; text-align: center;\" valign='center'>"; @@ -1739,7 +1740,7 @@ htmlCode += "<td><img src='/cm/images/tab_left.jpg' /></td>" + "<td style=\"background-image: url('/cm/images/tab_middle.jpg'); width: 100px; text-align: center;\">"; - htmlCode += "<a href='" + folderPage.getPagePath() +"index.html'><nobr>" + folderPage.getNavtitle(lang) + "</nobr></a>"; + htmlCode += "<a href='" + folderPage.getPagePath() +"index.html' class='tabs'><nobr>" + folderPage.getNavtitle(lang) + "</nobr></a>"; if (pagePath.startsWith(folderPage.getPagePath())) htmlCode += "</td><td><img src='/cm/images/tab_right_selected.jpg' /></td>"; @@ -1801,7 +1802,7 @@ if (page.getPageName().equalsIgnoreCase(pageName) && page.getPagePath().equalsIgnoreCase(pagePath)) selectedPage = true; - htmlCode += "<a href='"+page.getPagePath()+page.getPageName()+"'>"; + htmlCode += "<a href='"+page.getPagePath()+page.getPageName()+"' class='box'>"; String navtitle = page.getNavtitle(lang); if (selectedPage) htmlCode += "<b>" + navtitle + "</b>"; @@ -1867,8 +1868,8 @@ String htmlCode = ""; htmlCode += "<tr><td class=\"box\">\n"; - htmlCode += "<div class=\"boxheadline\">Admin Toolbox</div>\n"; - htmlCode += "<div class=\"box\">\n"; + htmlCode += "<div class=\"toolboxheadline\"><font size='1'><br /></font>Admin Toolbox</div>\n"; + htmlCode += "<div class=\"boxcontent\">\n"; htmlCode += "<table style=\"border: 0px; padding: 2px;\">"; @@ -1929,7 +1930,7 @@ htmlCode += "<td><a href='/PORTAL/?cmd=swapsortorder&p1_id=" + page_vorher.getId() + "&p2_id=" + page.getId() + "&cmd.success="+ pagePath + pageName + - "'>"; + "' class='box'>"; if (lang.equals("de")) htmlCode += "Nach oben verschieben"; else @@ -1943,7 +1944,7 @@ htmlCode += "<td><a href='/PORTAL/?cmd=swapsortorder&p1_id=" + page_nachher.getId() + "&p2_id=" + page.getId() + "&cmd.success="+ pagePath + pageName + - "'>"; + "' class='box'>"; if (lang.equals("de")) htmlCode += "Nach unten verschieben"; else @@ -1961,7 +1962,7 @@ if (pageName.equalsIgnoreCase("index.html")) { htmlCode += "<tr><td><img src=\"/cm/images/newfolder.jpg\" width=\"20\" height=\"20\" title=\"Neuer Ordner\" /></td>"; - htmlCode += "<td><a href='/cm/pages/newfolder.html?navPageName=" + pageName + "&navPagePath=" + pagePath + "&ppath=" + pagePath + "'>"; + htmlCode += "<td><a href='/cm/pages/newfolder.html?navPageName=" + pageName + "&navPagePath=" + pagePath + "&ppath=" + pagePath + "' class='box'>"; if (lang.equals("de")) htmlCode += "Neuer Ordner"; else @@ -1971,7 +1972,7 @@ htmlCode += "<tr><td><img src=\"/cm/images/edit.jpg\" width=\"20\" height=\"20\" title=\"Ordner bearbeiten\" /></td>"; htmlCode += "<td><a href='/cm/pages/editpage.html?navPageName=" + pageName + "&navPagePath=" + pagePath + "&ppath=" + pagePath + - "&page_id="+ getPageItemId(pagePath,pageName) + "'>"; + "&page_id="+ getPageItemId(pagePath,pageName) + "' class='box'>"; if (lang.equals("de")) htmlCode += "Ordner bearbeiten"; else @@ -1984,7 +1985,7 @@ String ruecksprung = parentfolder.getPath(); htmlCode += "<tr><td><img src=\"/cm/images/del.jpg\" width=\"20\" height=\"20\" title=\"Ordner löschen\" /></td>"; - htmlCode += "<td><a href=\"\" onClick=\"return confirmDeleteFolder('" + pagePath + "','"+ruecksprung+"');\">"; + htmlCode += "<td><a href=\"\" class='box' onClick=\"return confirmDeleteFolder('" + pagePath + "','"+ruecksprung+"');\">"; if (lang.equals("de")) htmlCode += "Ordner löschen"; else @@ -1993,7 +1994,7 @@ htmlCode += "</a></td></tr>"; htmlCode += "<tr><td><img src=\"/cm/images/new.jpg\" width=\"20\" height=\"20\" title=\"Neue Seite\" /></td>"; - htmlCode += "<td><a href='/cm/pages/newpage.html?navPageName=" + pageName + "&navPagePath=" + pagePath + "&ppath=" + pagePath + "'>"; + htmlCode += "<td><a href='/cm/pages/newpage.html?navPageName=" + pageName + "&navPagePath=" + pagePath + "&ppath=" + pagePath + "' class='box'>"; if (lang.equals("de")) htmlCode += "Neue Seite"; else @@ -2006,7 +2007,7 @@ } else { htmlCode += "<tr><td><img src=\"/cm/images/edit.jpg\" width=\"20\" height=\"20\" title=\"Seite bearbeiten\" /></td>"; htmlCode += "<td><a href='/cm/pages/editpage.html?navPageName=" + pageName + "&navPagePath=" + pagePath + "&ppath=" + pagePath + - "&page_id="+ getPageItemId(pagePath,pageName) + "'>"; + "&page_id="+ getPageItemId(pagePath,pageName) + "' class='box'>"; if (lang.equals("de")) htmlCode += "Seite bearbeiten"; else @@ -2017,7 +2018,7 @@ htmlCode += "<tr><td><img src=\"/cm/images/del.jpg\" width=\"20\" height=\"20\" title=\"Seite löschen\" /></td>"; htmlCode += "<td><a href=\"\" onClick=\"return confirmDelete('" + pagePath + "','" + getPageItemId(pagePath,pageName) + - "');\">"; + "');\" class='box'>"; if (lang.equals("de")) htmlCode += "Seite löschen"; @@ -2030,7 +2031,8 @@ } htmlCode += "</table>"; - htmlCode += "</div>"; + htmlCode += "</div>"; + htmlCode += "<div class='boxfooter'> </div>"; htmlCode += "</td></tr>"; return htmlCode; |
|
From: Florian F. <flo...@us...> - 2004-09-26 19:22:36
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11158/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: bugfixed search changed color of tabbar Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- PortalManagerImpl.java 24 Sep 2004 17:23:24 -0000 1.46 +++ PortalManagerImpl.java 26 Sep 2004 19:22:22 -0000 1.47 @@ -26,6 +26,7 @@ import java.util.Properties; import java.util.Set; import java.util.StringTokenizer; +import java.util.regex.*; import javax.servlet.*; import javax.servlet.http.*; @@ -509,7 +510,6 @@ if (c == null) throw new CobricksException("portal", "nopath", ""); -/* // check if the page already exits // item aus klasse "portalpagehtml" mit bestimmtem namen String xpath = "/item[itemclass='portalpagehtml' and " @@ -518,7 +518,21 @@ List items = itemManager.searchItems(xpath); if (items != null && items.size()>0) throw new CobricksException("portal", "exists", ""); -*/ + + // check if the pagename and pagepath would be a valid url + String url = "http://localhost" + pagePath + pageName; + Pattern urlPattern = Pattern.compile("(?:https?|ftp)://[^\\s,<>\\?]+?\\.[^\\s,<>\\?]+"); + Matcher m = urlPattern.matcher(url); + if (!m.find()) + throw new CobricksException("portal","invalidURL",""); + + + // check if the pagename ends with .htm or .html + if (!pageName.endsWith(".htm") && !pageName.endsWith(".html")) + throw new CobricksException("portal","invalidURL",""); + + + logger.info("Creating new item object."); // create new item object Map attrs = new HashMap(); @@ -1753,7 +1767,7 @@ htmlCode += "<td> $portalPresenter.printLang($portalRequest)</td>"; htmlCode += "</tr>"; htmlCode += "</table><table border='0' width='100%' cellspacing='0' cellpadding='0'>"; - htmlCode += "<tr><td colspan='100' height='2' width='100%' bgcolor='#5284E7'>\n</td></tr>"; + htmlCode += "<tr><td colspan='100' height='2' width='100%' bgcolor='#999999'>\n</td></tr>"; htmlCode += "</table>"; return htmlCode; } @@ -2091,7 +2105,7 @@ // ... String searchWord = searchExp; - + searchWord = searchWord.toLowerCase(); String query = "/item[itemclass='portalpagehtml' and (" + "contains(translate(description, 'ABCDEFGHIJKLMNOPSQRTUVWXYZ', 'abcdefghijklmnopsqrtuvwxyz'),'" + searchWord + "') or " + "contains(translate(navtitle, 'ABCDEFGHIJKLMNOPSQRTUVWXYZ', 'abcdefghijklmnopsqrtuvwxyz'),'" + searchWord + "') or " + |
|
From: Wolfgang L. <w_l...@us...> - 2004-11-08 19:39:54
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10426/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- PortalManagerImpl.java 26 Oct 2004 13:30:04 -0000 1.48 +++ PortalManagerImpl.java 8 Nov 2004 19:39:45 -0000 1.49 @@ -1372,8 +1372,8 @@ return sortedFolderPathList; } - - /** + + /** * Add PortalFolder object to caches */ public void addPortalFolderToCache(PortalFolder c) |
|
From: Florian F. <flo...@us...> - 2004-12-03 23:14:47
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24275/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Various improvements to enable the community feature Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- PortalManagerImpl.java 8 Nov 2004 19:39:45 -0000 1.49 +++ PortalManagerImpl.java 3 Dec 2004 23:14:38 -0000 1.50 @@ -2057,7 +2057,7 @@ } - htmlCode += "<tr><td><img src=\"\" width=\"20\" height=\"20\" title=\"Edit page access\" /></td>"; + htmlCode += "<tr><td><img src=\"pageaccess.jpg\" width=\"20\" height=\"20\" title=\"Edit page access\" /></td>"; htmlCode += "<td><a href='/cm/pages/editpageaccess.html?navPageName=" + pageName + "&navPagePath=" + pagePath + "&ppath=" + pagePath + "&page_id="+ getPageItemId(pagePath,pageName) + "' class='box'>"; if (lang.equals("de")) |
|
From: Michael K. <ko...@us...> - 2004-12-06 20:38:55
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17537/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- PortalManagerImpl.java 6 Dec 2004 05:58:45 -0000 1.51 +++ PortalManagerImpl.java 6 Dec 2004 20:38:41 -0000 1.52 @@ -356,7 +356,9 @@ } private String addGlossaryInfo(String htmlText){ - List glossaryTerms = itemManager.searchItems("/item[itemclass='glossaryitem' and state=1]"); + List glossaryTerms = + itemManager.searchItems("/item[itemclass='glossaryitem' and state=1]"); + if (glossaryTerms == null) return ""; Iterator i = glossaryTerms.iterator(); while (i.hasNext()) { Item nextItem = (Item)i.next(); |
|
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(); |
|
From: Wolfgang L. <w_l...@us...> - 2004-12-17 08:18:27
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7337/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Added some more functional documentation Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- PortalManagerImpl.java 15 Dec 2004 17:26:52 -0000 1.56 +++ PortalManagerImpl.java 17 Dec 2004 08:18:06 -0000 1.57 @@ -356,13 +356,15 @@ } /** - * This method adds glossary information to the HTML content. + * 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 the - * explanation of a term. Furthermore, the state has to be set to "1". + * 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 - * marked by an information sign. + * @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 @@ -380,7 +382,7 @@ { Pattern pattern = Pattern.compile(nextTerm); Matcher matcher = pattern.matcher(htmlText); - htmlText = matcher.replaceAll("<u class=\"dottedline\">"+nextTerm+"</u> <img width=12 height=12 src=\"/images/info.gif\" border=\"0\" alt=\""+nextDesc+"\" />"); + htmlText = matcher.replaceAll("<span title=\""+nextDesc+"\"><u class=\"dottedline\">"+nextTerm+"</u></span>"); } } return htmlText; |
|
From: Michael K. <ko...@us...> - 2004-12-17 14:14:26
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12417 Modified Files: PortalManagerImpl.java Log Message: Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- PortalManagerImpl.java 17 Dec 2004 08:18:06 -0000 1.57 +++ PortalManagerImpl.java 17 Dec 2004 14:14:12 -0000 1.58 @@ -2163,14 +2163,15 @@ String searchWord = searchExp; searchWord = searchWord.toLowerCase(); - if (SearchInTitle == true") { - String query = "/item[itemclass='portalpagehtml' and (" + + String query = ""; + if (SearchInTitle == true) { + query = "/item[itemclass='portalpagehtml' and (" + "contains(translate(description, 'ABCDEFGHIJKLMNOPSQRTUVWXYZ', 'abcdefghijklmnopsqrtuvwxyz'),'" + searchWord + "') or " + "contains(translate(navtitle, 'ABCDEFGHIJKLMNOPSQRTUVWXYZ', 'abcdefghijklmnopsqrtuvwxyz'),'" + searchWord + "') or " + "contains(translate(title, 'ABCDEFGHIJKLMNOPSQRTUVWXYZ', 'abcdefghijklmnopsqrtuvwxyz'),'" + searchWord + "')" + ")]"; - else { - String query = "/item[itemclass='portalpagehtml' and (" + + } else { + query = "/item[itemclass='portalpagehtml' and (" + "contains(translate(description, 'ABCDEFGHIJKLMNOPSQRTUVWXYZ', 'abcdefghijklmnopsqrtuvwxyz'),'" + searchWord + "') )]"; } |
|
From: Florian F. <flo...@us...> - 2005-01-05 17:01:29
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26557/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Searchfunction fixed Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- PortalManagerImpl.java 4 Jan 2005 07:27:10 -0000 1.59 +++ PortalManagerImpl.java 5 Jan 2005 17:00:59 -0000 1.60 @@ -744,8 +744,15 @@ /** + * Updates a already existing PortalPage-Object * + * @param itemid the id of the portal page object to be altered + * lang the chosen language (two-letter-format) + * content the new page content in the chosen language + * optional_attrs contains all other attributes that need to be updated + * @return void */ + public void updatePage(int itemid, String lang, String title, String content, Map optional_attrs, User updater) @@ -914,8 +921,16 @@ } /** + * Sets the access permissions to a portalpage object * + * @param page_id the id of the portal page object whose access permissions need to be set + * admins a set of user-objects with the user having full access to the page + * visibile if set to true, all users can read the site, otherweise only the users in the visibletousers + * and the admins set have access + * visibletousers set of users who can read the page even when the visibility is set to false + * @return success | error */ + public String updatePageAccess(int page_id, Set admins, boolean visible, Set visibletousers) { if (page_id == 0) return "error"; @@ -932,10 +947,17 @@ } - /** + * Creates a new portal folder * + * @param parentPath the path of the parent object for the new portal folder + * name the name of the folder (only url-compliant strings!) + * title title for the folder + * creator the user object of the user who creates the folder + * @return the new folder's id */ + + public int createFolder(String parentPath, String name, String title, User creator) throws CobricksException @@ -1000,8 +1022,14 @@ } /** + * Deletes a portal folder object and alle portal pages within the folder * + * @param cid the id of the folder who will be deleted + * user the user object of the user who wants to delete the folder + * + * @return void */ + public void deleteFolder(int cid, User user) throws CobricksException { @@ -1012,7 +1040,7 @@ for (int i = 0; i < pages.size(); i++) { PortalPage p = (PortalPage) pages.get(i); int itemid=p.getId(); - logger.info("Lösche Item ID "+itemid); + logger.info("Loesche Item ID "+itemid); deletePage(itemid,null,user); } PortalFolder pf = getPortalFolder(cid); @@ -1028,7 +1056,15 @@ } - + /** + * Deletes a folder, together with all subfolders and pages that it contains + * + * @param rootfolder the id of the folder object + * user the user that wants to delete the folder + * + * @return void + */ + public void deleteFoldertree(PortalFolder rootfolder, User user) throws CobricksException { @@ -1447,14 +1483,20 @@ } } - /** - * get the main folder name of a given path - * e.g. getPortalMainFolder("/portal1/sub1/sub2"): "/portal1/" - * - */ - public String getPortalMainFolder(String path) + + /** + * get the main folder name of a given path + * e.g. getPortalMainFolder("/portal1/sub1/sub2"): "/portal1/" + * + * @param path a arbitrary path of a folder object + * lang the chosen language (two-letter-format) + * content the new page content in the chosen language + * optional_attrs contains all other attributes that need to be updated + * @return the path of the portal main folder + */ + public String getPortalMainFolder(String path) { - if (path==null) return "/"; + if (path==null || path.equals("/")) return "/"; StringTokenizer st = new StringTokenizer(path, "/", true); int slashcount = 0; String mainfolder = ""; @@ -1534,8 +1576,17 @@ return pages; } - - public List getPortalPagesSorted(String folderpath) { + + /** + * Builds a list of the pages in the folder "folderpath", sorted by the page's sortorder attribute + * including the index.html files of direct subfolders. + * + * @param folderPath path to the PortalFolder whose pages are to be returned sorted + * + * @return List of PortalPages-Objects sorted by the attribute "sortorder" + */ + + public List getPortalPagesSorted(String folderpath) { PortalFolder folder = getPortalFolder(folderpath); if (folder == null) { @@ -1748,6 +1799,18 @@ } + /** + * Tabbed navigation, in sense that the PortalMainFolder and all folders directly descendent to it + * (in the 2nd level of the hierarchy) are represented as tabs + * + * @param lang language (for the nav_title to be displayed on the tabs) + * pagePath path to the PortalPage for which the navigation is to be rendered + * pageName name of the PortalPage for which the navigation is to be rendered + * + * @return HTML representation of the navigation for the referred PortalPage + * Doesn't work with pages from the filesystem! + */ + public String getTabbedNavigation (String lang, String pagePath,String pageName) { String htmlCode = ""; @@ -1807,6 +1870,19 @@ return htmlCode; } + + /** + * windows explorer-like representation of a folder/page-hierarchy from the view of a specific page + * + * @param lang language (for the nav_title to be displayed in the navigation) + * currentPath the path the function is working at the moment + * pagePath path of the PortalPage for which the navigation is to be rendered + * pageName path of the PortalPage for which the navigation is to be rendered + * + * @return HTML representation of the navigation for the referred PortalPage + * Doesn't work with pages from the filesystem! + */ + private String getExplorerView(String lang, String currentPath, String pagePath, String pageName) { //logger.debug("getExplorerView (" + currentPath + ", "+pagePath+", "+ pageName +")"); @@ -1883,6 +1959,17 @@ htmlCode += "</table>"; return htmlCode; } + + /** + * Swaps the sortorder-attributes of two pages + * + * @param p1_id id of the first portal page object + * p2_id id of the second portal page object + * + * @return void + * + */ + public void swapSortOrder(int p1_id, int p2_id) { logger.debug("swapSortOrder("+p1_id+", "+p2_id+")"); @@ -2183,6 +2270,16 @@ } + /** + * gets the id of the style item that is assigned to a page. it no style attribute is assigned, the style of + * the parent object is used and so on + * + * @param p portal page for which the style id has to be determined + * + * @return id of the style item corresponding to the page + * + */ + public int getHeritedStyleId(PortalPage p) { logger.info("getHeritedStyleId for page " + p.getId()); if (p == null) return 0; @@ -2210,6 +2307,15 @@ } + /** + * gets the set of all admins who may alter the page + * + * @param p portal page for which the admins are to be determined + * + * @return set of portal users who are admins of the page + * + */ + public Set getAllPageAdmins(PortalPage p) { logger.info ("Entering getAllPageAdmins for page " + p.getPagePath() + p.getPageName()); // Build a Set of all users which have admin-rights to this page or to a page @@ -2253,6 +2359,16 @@ return admins; } + /** + * gets the set of all admins who have herited the admin-right for a page object by a direct assignment in + * a page that is standing on a higher level in the hierarchy + * + * @param p portal page for which the indirect admins have to be determined + * + * @return set of portal users who are indirect admins of the page + * + */ + public Set getAllIndirectPageAdmins(PortalPage p) { // if we are in the "/"-path, there are no admin-rights String path = p.getPagePath(); |
|
From: Wolfgang L. <w_l...@us...> - 2005-01-05 20:02:41
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8575/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Fixed a minor displaying bug. Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- PortalManagerImpl.java 5 Jan 2005 17:00:59 -0000 1.60 +++ PortalManagerImpl.java 5 Jan 2005 20:02:26 -0000 1.61 @@ -2015,7 +2015,12 @@ String htmlCode = ""; htmlCode += "<tr><td class=\"box\">\n"; htmlCode += "<div class=\"toolboxheadline\"><font size='1'><br /></font>Admin Toolbox</div>\n"; - htmlCode += "<div class=\"boxcontent\">\n"; + //htmlCode += "<div class=\"boxcontent\">\n"; + htmlCode += "<script language=\"javascript\" type=\"text/javascript\">"; + htmlCode += "if(document.all&&!window.opera&&window.clipboardData)"; + htmlCode += "{document.write('<div class=\"boxcontent\" style=\"width: 165px\">');} else"; + htmlCode += "{document.write('<div class=\"boxcontent\" style=\"width: 159px\">');}"; + htmlCode += "</script>"; htmlCode += "<table style=\"border: 0px; padding: 2px;\">"; |
|
From: Florian F. <flo...@us...> - 2005-01-06 18:13:25
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1520/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Optimized explorer-like navigation view Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- PortalManagerImpl.java 5 Jan 2005 20:02:26 -0000 1.61 +++ PortalManagerImpl.java 6 Jan 2005 18:13:13 -0000 1.62 @@ -1919,7 +1919,10 @@ htmlCode += "<tr>"; - htmlCode += "<td> </td>"; + if (page.getPageName().equalsIgnoreCase("index.html")) + htmlCode += "<td><img src='/cm/images/nav_arrow.gif' border='0' /></td>"; + else + htmlCode += "<td><img src='/cm/images/nav_empty.gif' border='0' /></td>"; htmlCode += "<td>"; // Hyperlink to page |
|
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; |
|
From: Michael K. <ko...@us...> - 2006-01-03 09:36:27
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22566 Modified Files: PortalManagerImpl.java Log Message: Support for sub classes of portalpagehtml itemclass Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- PortalManagerImpl.java 7 Dec 2005 14:00:50 -0000 1.68 +++ PortalManagerImpl.java 3 Jan 2006 09:36:18 -0000 1.69 @@ -466,8 +466,8 @@ // and now look for a portalpage item that has the portalfolder // category assigned - String xpath = "/item[itemclass='portalpagehtml' and " - +"name='"+pageName+"'] and " + String xpath = "/item[itemclass~'portalpagehtml'] and " + +"/item[name='"+pageName+"'] and " +"/item/folders/category/id="+Integer.toString(c.getId()); List p = itemManager.searchItems(xpath); if (p != null && p.size()>0) { @@ -520,8 +520,8 @@ throw new CobricksException("portal", "nopath", ""); // check if the page already exits - String xpath = "/item[itemclass='portalpagehtml' and " - +"name='"+pageName+"'] and " + String xpath = "/item[itemclass~'portalpagehtml'] and " + +"/item[name='"+pageName+"'] and " +"/item/folders/category/id="+Integer.toString(c.getId()); List items = itemManager.searchItems(xpath); if (items != null && items.size()>0) @@ -692,8 +692,8 @@ throws CobricksException { // search for page items in this folder - String xpath_query = "/item[itemclass='portalpagehtml' and " - + " folders/category/id="+cid + "]"; + String xpath_query = "/item[itemclass~'portalpagehtml'] and " + + "/item[folders/category/id="+cid + "]"; List pages = itemManager.searchItems(xpath_query); for (int i = 0; i < pages.size(); i++) { PortalPage p = (PortalPage) pages.get(i); @@ -1131,16 +1131,16 @@ public List getPagesWithPageCategory(int pagecategory_id) { String xpathQuery = - "/item[itemclass=\"portalpagehtml\" " - +"and pagecategories/category/id=" + pagecategory_id + "]"; + "/item[itemclass~\"portalpagehtml\"] " + +"and /item[pagecategories/category/id=" + pagecategory_id + "]"; return itemManager.searchItems(xpathQuery); } public List getPagesWithPortalCategory(int portalcategory_id) { String xpathQuery = - "/item[itemclass=\"portalpagehtml\" " - +"and portalcategory/id=" + portalcategory_id + "]"; + "/item[itemclass~\"portalpagehtml\"] " + +"and /item[portalcategory/id=" + portalcategory_id + "]"; return itemManager.searchItems(xpathQuery); } @@ -1155,13 +1155,13 @@ searchWord = searchWord.toLowerCase(); String query = ""; if (searchInTitle == true) { - query = "/item[itemclass='portalpagehtml' and (" + + query = "/item[itemclass~'portalpagehtml'] and /item[(" + "contains(translate(content, 'ABCDEFGHIJKLMNOPSQRTUVWXYZ', 'abcdefghijklmnopsqrtuvwxyz'),'" + searchWord + "') or " + "contains(translate(navtitle, 'ABCDEFGHIJKLMNOPSQRTUVWXYZ', 'abcdefghijklmnopsqrtuvwxyz'),'" + searchWord + "') or " + "contains(translate(title, 'ABCDEFGHIJKLMNOPSQRTUVWXYZ', 'abcdefghijklmnopsqrtuvwxyz'),'" + searchWord + "')" + ")]"; } else { - query = "/item[itemclass='portalpagehtml' and (" + + query = "/item[itemclass~'portalpagehtml'] and /item[(" + "contains(translate(content, 'ABCDEFGHIJKLMNOPSQRTUVWXYZ', 'abcdefghijklmnopsqrtuvwxyz'),'" + searchWord + "') )]"; } |
|
From: Alexander G. <gaf...@us...> - 2006-01-18 16:22:54
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv928/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Wiki functionality added Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- PortalManagerImpl.java 16 Jan 2006 09:23:57 -0000 1.70 +++ PortalManagerImpl.java 18 Jan 2006 16:22:43 -0000 1.71 @@ -393,7 +393,7 @@ String itemclass = null; try { itemclass = (String)page.getAttribute("itemclass"); - + //Get verseionid of page versionid = Integer.valueOf( portalRequest.getRequestParameter("versionid")); @@ -414,20 +414,23 @@ Map pc = null; + if(itemclass != null && itemclass.equals("wikipage")) { pc = new HashMap(); String content = null; if (versionid != null) { content = itemManager.getContentVersion( - page.getLocalId(), lang, versionid.intValue()); + page.getLocalId(), pageLanguage, versionid.intValue()); if(content == null) { + pageLanguage = defaultLanguage; content = itemManager.getContentVersion( page.getLocalId(), defaultLanguage, versionid.intValue()); } } else { content = this.getHighestContentVersion( - page.getLocalId(), lang); + page.getLocalId(), pageLanguage); if(content == null) { + pageLanguage = defaultLanguage; content = this.getHighestContentVersion( page.getLocalId(), defaultLanguage); } @@ -436,13 +439,6 @@ //Parse the wiki-content content = Utility.parse(content); -// content = content+"<br>"; -// content = Utility.insertEditLink(page.getLocalId(), -// content, content.length()); -// content = content+"<br>"; -// content = Utility.insertHistoryLink(page.getLocalId(), lang, -// content, content.length()); -// content = Utility.deleteToken(content); pc.put(pageLanguage, content); } |
|
From: Alexander G. <gaf...@us...> - 2006-01-18 18:23:52
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23199/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Versioned attribute added Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- PortalManagerImpl.java 18 Jan 2006 16:22:43 -0000 1.71 +++ PortalManagerImpl.java 18 Jan 2006 18:23:44 -0000 1.72 @@ -53,6 +53,9 @@ import org.cobricks.core.ComponentManagerAdaptor; import org.cobricks.core.ComponentManagerInterface; import org.cobricks.core.ComponentPresenterInterface; +import org.cobricks.core.Ontology; +import org.cobricks.core.OntologyClass; +import org.cobricks.core.OntologyClassAttr; import org.cobricks.core.db.DBAccess; import org.cobricks.core.util.DateUtil; import org.cobricks.core.util.LogUtil; @@ -391,9 +394,19 @@ String pageLanguage = null; String itemclass = null; + + Ontology ontology = null; + OntologyClass ontologyClass = null; + OntologyClassAttr ontologyAttr = null; + try { itemclass = (String)page.getAttribute("itemclass"); + //Check if the content is versioend + ontology = itemManager.getOntology(); + ontologyClass= ontology.getClass(itemclass); + ontologyAttr = ontologyClass.getAttribute("content"); + //Get verseionid of page versionid = Integer.valueOf( portalRequest.getRequestParameter("versionid")); @@ -414,8 +427,7 @@ Map pc = null; - - if(itemclass != null && itemclass.equals("wikipage")) { + if((ontologyAttr != null) && ontologyAttr.isVersioned()) { pc = new HashMap(); String content = null; if (versionid != null) { |
|
From: Alexander G. <gaf...@us...> - 2006-02-02 17:17:00
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1740/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.74 retrieving revision 1.75 diff -u -d -r1.74 -r1.75 --- PortalManagerImpl.java 2 Feb 2006 11:39:26 -0000 1.74 +++ PortalManagerImpl.java 2 Feb 2006 17:16:52 -0000 1.75 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2005 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -13,7 +13,6 @@ package org.cobricks.portal; import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.File; import java.io.FilenameFilter; @@ -23,7 +22,6 @@ import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.URL; -import java.net.URLConnection; import java.util.ArrayList; import java.util.Collections; import java.util.Date; @@ -37,8 +35,8 @@ import java.util.Set; import java.util.StringTokenizer; import java.util.regex.*; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; +import javax.servlet.*; +import javax.servlet.http.*; import org.apache.log4j.Logger; import org.apache.velocity.VelocityContext; @@ -517,26 +515,30 @@ String pageName = page.getPageName(); String lang = portalRequest.getLang(); - // language of the page + //Versionid of the page + Integer versionid = null; + //Language of the page String pageLanguage = null; - pageLanguage = (String)portalRequest.getRequestParameter("lang"); + + String itemclass = null; + + Ontology ontology = null; + OntologyClass ontologyClass = null; + OntologyClassAttr ontologyAttr = null; - // versionid of the page (if versioned) - Integer versionid = null; - boolean isVersioned = false; try { - String itemclass = (String)page.getAttribute("itemclass"); - // check if the content is versioned - Ontology ontology = itemManager.getOntology(); - OntologyClass ontologyClass= ontology.getClass(itemclass); - OntologyClassAttr ontologyAttr = - ontologyClass.getAttribute("content"); - if ((ontologyAttr != null) && ontologyAttr.isVersioned()) { - isVersioned = true; - } - // get versionid of page - versionid = Integer. - valueOf(portalRequest.getRequestParameter("versionid")); + itemclass = (String)page.getAttribute("itemclass"); + + //Check if the content is versioend + ontology = itemManager.getOntology(); + ontologyClass= ontology.getClass(itemclass); + ontologyAttr = ontologyClass.getAttribute("content"); + + //Get verseionid of page + versionid = Integer.valueOf( + portalRequest.getRequestParameter("versionid")); + //Get language of the page + pageLanguage = (String)portalRequest.getRequestParameter("lang"); } catch (Exception e) { versionid = null; } @@ -552,32 +554,36 @@ Map pc = null; - if (isVersioned) { + //Get all childs of 'wikipage' + OntologyClass wikiOntologyClass = ontology.getClass("wikipage"); + Set wikiVersionedPages = ontology.getChildren(ontologyClass, true); + wikiVersionedPages.add(wikiOntologyClass); + + if(wikiVersionedPages.contains(ontologyClass)) { pc = new HashMap(); String content = null; if (versionid != null) { - content = itemManager. - getContentVersion(page.getLocalId(), pageLanguage, - versionid.intValue()); - if (content == null) { + content = itemManager.getContentVersion( + page.getLocalId(), pageLanguage, versionid.intValue()); + if(content == null) { pageLanguage = defaultLanguage; - content = itemManager. - getContentVersion(page.getLocalId(), defaultLanguage, - versionid.intValue()); + content = itemManager.getContentVersion( + page.getLocalId(), defaultLanguage, versionid.intValue()); } } else { - content = this. - getHighestContentVersion(page.getLocalId(), pageLanguage); + content = this.getHighestContentVersion( + page.getLocalId(), pageLanguage); if(content == null) { pageLanguage = defaultLanguage; - content = this. - getHighestContentVersion(page.getLocalId(), - defaultLanguage); + content = this.getHighestContentVersion( + page.getLocalId(), defaultLanguage); } } if (content != null) { + //Parse the content content = Utility.parse(content); + pc.put(pageLanguage, content); } } else { @@ -586,8 +592,9 @@ } if (pc == null || pc.size()<1) { - logger.warn("Failed getting content for page "+pagePath+pageName - +","+lang+" - loading "+notFoundPath); + if (!pageName.equals("favicon.ico")) + logger.warn("Failed getting content for page "+pagePath+pageName + +","+lang+" - loading "+notFoundPath); pagePath = notFoundPath; pageName = "notfound.html"; int pos = pagePath.indexOf("/"); @@ -614,15 +621,6 @@ String pageLang = (String)pc.keySet().iterator().next(); String pageContent = (String)pc.get(pageLang); portalRequest.setPageLang(pageLang); - - // if it is a wiki page, then parse the content - String itemclass = ""; - if (page != null) itemclass = page.getItemClass(); - if (itemclass!=null && itemclass.equals("wikipage")) { - pageContent = Utility.parse(pageContent); - } - - // finally parse the page via Velocity and print it try { // parse Velocity template Velocity.evaluate(portalRequest.getVelocityContext(), out, @@ -639,14 +637,13 @@ } } - /** * Gets the highest content version to the itemid. * @param itemid The id for the content version. * @param lang Language for the content. - * @return Returns the content of the highest versionid if exist, - * otherwise null. + * @return Returns the content of the highest versionid if exist, otherwise + * null. */ private String getHighestContentVersion(int itemid, String lang) { @@ -676,7 +673,6 @@ } return content; } - /* -------------------------------------------------------------------- */ /* database access @@ -1109,6 +1105,9 @@ { super.init(componentId, managerId, properties, coreManager, dbAccess); + //Set properties + Utility.setProperties(properties); + // portal properties webspaceDir = properties.getProperty("portal.webspace.dir"); defaultLanguage = properties.getProperty("default.language", "en"); |