From ef275a586af9d00a6d068512f5ba1e6d183786c8 Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Wed, 14 Jun 2006 09:36:35 +0000 Subject: [PATCH] Fix to add explicity IDs to all components in Spaces and Content panels in Browse screen so they can be expanded/collapsed. Fix to allow page size of Spaces/Content panels to be changes on the fly git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3097 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/messages/webclient.properties | 1 + .../org/alfresco/web/bean/BrowseBean.java | 58 +++++-- .../ui/common/component/data/UIRichList.java | 2 +- source/web/jsp/browse/browse.jsp | 151 ++++++++++-------- 4 files changed, 134 insertions(+), 78 deletions(-) diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index d3b53defa4..015e2815fb 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -176,6 +176,7 @@ link_to=Link to icon=Icon lock=Lock unlock=Unlock +items_per_page=Items Per Page # Properties username=User Name diff --git a/source/java/org/alfresco/web/bean/BrowseBean.java b/source/java/org/alfresco/web/bean/BrowseBean.java index 346689fca2..9df7f30315 100644 --- a/source/java/org/alfresco/web/bean/BrowseBean.java +++ b/source/java/org/alfresco/web/bean/BrowseBean.java @@ -186,10 +186,6 @@ public class BrowseBean implements IContextListener FacesContext fc = FacesContext.getCurrentInstance(); fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "dashboard"); } - else - { - navigateBrowseScreen(); - } } /** @@ -206,8 +202,25 @@ public class BrowseBean implements IContextListener public void setBrowsePageSize(int browsePageSize) { this.browsePageSize = browsePageSize; + this.browsePageSizeString = Integer.toString(browsePageSize); } + /** + * @return browsePageSizeString + */ + public String getBrowsePageSizeString() + { + return this.browsePageSizeString; + } + + /** + * @param browsePageSizeString to set + */ + public void setBrowsePageSizeString(String browsePageSizeString) + { + this.browsePageSizeString = browsePageSizeString; + } + /** * @return Returns the minimum length of a valid search string. */ @@ -489,14 +502,12 @@ public class BrowseBean implements IContextListener if (logger.isDebugEnabled()) logger.debug("Browse view page size set to: " + getBrowsePageSize()); - // in case we left for dashboard - if (isDashboardView() == true) - { - setDashboardView(false); - } + setDashboardView(false); // push the view mode into the lists setBrowseViewMode(viewMode); + + navigateBrowseScreen(); } else { @@ -1001,6 +1012,31 @@ public class BrowseBean implements IContextListener this.navigator.setCurrentNodeId( this.navigator.getCurrentNodeId() ); } + /** + * Update page size based on user selection + */ + public void updatePageSize(ActionEvent event) + { + try + { + int size = Integer.parseInt(this.browsePageSizeString); + if (size >= 0) + { + this.browsePageSize = size; + } + else + { + // reset to known value if this occurs + this.browsePageSizeString = Integer.toString(this.browsePageSize); + } + } + catch (NumberFormatException err) + { + // reset to known value if this occurs + this.browsePageSizeString = Integer.toString(this.browsePageSize); + } + } + /** * Action called when a folder space is clicked. * Navigate into the space. @@ -1417,8 +1453,7 @@ public class BrowseBean implements IContextListener getConfigElement(ViewsConfigElement.CONFIG_ELEMENT_ID); this.browseViewMode = this.viewsConfig.getDefaultView(PAGE_NAME_BROWSE); - this.browsePageSize = this.viewsConfig.getDefaultPageSize(PAGE_NAME_BROWSE, - this.browseViewMode); + setBrowsePageSize(this.viewsConfig.getDefaultPageSize(PAGE_NAME_BROWSE, this.browseViewMode)); } /** @@ -1706,6 +1741,7 @@ public class BrowseBean implements IContextListener /** The current browse view page size */ private int browsePageSize; + private String browsePageSizeString; /** True if current space has a dashboard (template) view available */ private boolean dashboardView; diff --git a/source/java/org/alfresco/web/ui/common/component/data/UIRichList.java b/source/java/org/alfresco/web/ui/common/component/data/UIRichList.java index e75c924781..cfe42bbd9d 100644 --- a/source/java/org/alfresco/web/ui/common/component/data/UIRichList.java +++ b/source/java/org/alfresco/web/ui/common/component/data/UIRichList.java @@ -409,7 +409,7 @@ public class UIRichList extends UIComponentBase implements IDataContainer int rowCount = getDataModel().size(); // if a page size is specified, then we use that int pageSize = getPageSize(); - if (pageSize != -1) + if (pageSize != -1 && pageSize != 0) { // calc start row index based on current page index this.rowIndex = (this.currentPage * pageSize) - 1; diff --git a/source/web/jsp/browse/browse.jsp b/source/web/jsp/browse/browse.jsp index 3d0b6e7859..af768df5d7 100644 --- a/source/web/jsp/browse/browse.jsp +++ b/source/web/jsp/browse/browse.jsp @@ -182,7 +182,18 @@ - + <%-- wrapper comment used by the panel to add additional component facets --%> + + + + + + + + + + <%-- Spaces List --%> <%-- TODO: either build complete message in BrowseBean or have no icon... --%> - + <%-- Primary column for details view mode --%> - + - + - + - + <%-- Primary column for icons view mode --%> - + - + - + <%-- Primary column for list view mode --%> - + - + - + <%-- Description column for all view modes --%> - + - + - + <%-- Path column for search mode in details view mode --%> - + - + - + <%-- Created Date column for details view mode --%> - + - + - + <%-- Modified Date column for details/icons view modes --%> - + - + - + <%-- Node Descendants links for list view mode --%> - - + + <%-- Space Actions column --%> - + - + <%-- actions are configured in web-client-config-actions.xml --%> - + <%-- More actions menu --%> - + - + @@ -306,7 +317,15 @@ - + <%-- + + + + + + --%> + <%--facetsId="content-panel-facets"--%> <%-- Content list --%> <%-- TODO: either build complete message in BrowseBean or have no icon... --%> - + <%-- Primary column for details view mode --%> - + - + - + - - + + <%-- Primary column for icons view mode --%> - + - + - - + + <%-- Primary column for list view mode --%> - + - + - - + + <%-- Description column for all view modes --%> - + - + - + <%-- Path column for search mode in details view mode --%> - + - + - + <%-- Size for details/icons view modes --%> - + - + - + <%-- Created Date column for details view mode --%> - + - + - + <%-- Modified Date column for details/icons view modes --%> - + - + - + <%-- Content Actions column --%> - + - + <%-- actions are configured in web-client-config-actions.xml --%> - + <%-- More actions menu --%> - + - +