|
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(); |