mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
. Dashboards impl checkpoint
- configurable JSP layouts - configurable "dashlets" (JSP snipets) - page config (de)serialisation per user git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3347 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -849,6 +849,24 @@ recovery_report_reason=Failure Reason
|
||||
|
||||
# My Alfresco messages
|
||||
my_alfresco=My Alfresco
|
||||
title_my_alfresco=My Alfresco
|
||||
dashboard_info=My Alfresco Dashboard
|
||||
dashboard_description=Configure this view and build your personal Alfresco dashboard
|
||||
configure=Configure
|
||||
|
||||
# My Alfresco Dashlets messages
|
||||
layout_single_label=Single Column
|
||||
layout_single_desc=This layout displays components in a single column the full width of the page
|
||||
layout_narrow_left_label=Two Column Narrow Left
|
||||
layout_narrow_left_desc=This layout display components in two columns with a narrow left hand column
|
||||
layout_narrow_right_label=Two Column Narrow Right
|
||||
layout_narrow_right_desc=This layout display components in two columns with a narrow right hand column
|
||||
layout_three_column_label=Three Column
|
||||
layout_three_column_desc=This layout displays components across three columns of equal width
|
||||
dashlet_gettingstarted_label=Getting Started
|
||||
dashlet_gettingstarted_desc=This component displays helpful information and links for getting started with the Alfresco web-client application
|
||||
|
||||
# User Console and Settings messages
|
||||
title_user_console=User Options
|
||||
user_console=User Options
|
||||
user_console_info=User Options
|
||||
|
@@ -16,6 +16,7 @@
|
||||
<element-reader element-name="actions" class="org.alfresco.web.config.ActionsElementReader" />
|
||||
<element-reader element-name="dialogs" class="org.alfresco.web.config.DialogsElementReader"/>
|
||||
<element-reader element-name="wizards" class="org.alfresco.web.config.WizardsElementReader"/>
|
||||
<element-reader element-name="dashboards" class="org.alfresco.web.config.DashboardsElementReader"/>
|
||||
</element-readers>
|
||||
</plug-ins>
|
||||
|
||||
@@ -159,7 +160,37 @@
|
||||
</custom-properties>
|
||||
</advanced-search>
|
||||
</config>
|
||||
|
||||
|
||||
<config evaluator="string-compare" condition="Dashboards">
|
||||
<!-- Dashboard layouts and available dashlets for the My Alfresco pages -->
|
||||
<dashboards>
|
||||
<layouts>
|
||||
<!-- the "default" layout - will be used for all users initially -->
|
||||
<layout id="default" columns="1" column-length="5" image="/images/icons/layout-single-column.gif"
|
||||
label-id="layout_single_label" description-id="layout_single_desc"
|
||||
jsp="/jsp/dashboards/layouts/single-column.jsp" />
|
||||
<layout id="narrow-left-2column" columns="2" column-length="4" image="/images/icons/layout-narrow-left.gif"
|
||||
label-id="layout_narrow_left_label" description-id="layout_narrow_left_desc"
|
||||
jsp="/jsp/dashboards/layouts/narrow-left-2column.jsp" />
|
||||
<layout id="narrow-right-2column" columns="2" column-length="4" image="/images/icons/layout-narrow-right.gif"
|
||||
label-id="layout_narrow_right_label" description-id="layout_narrow_right_desc"
|
||||
jsp="/jsp/dashboards/layouts/narrow-right-2column.jsp" />
|
||||
<layout id="three-column" columns="3" column-length="4" image="/images/icons/layout-three-column.gif"
|
||||
label-id="layout_three_column_label" description-id="layout_three_column_desc"
|
||||
jsp="/jsp/dashboards/layouts/three-column.jsp" />
|
||||
</layouts>
|
||||
<dashlets>
|
||||
<!-- this is the default dashlet shown in the default layout initially -->
|
||||
<dashlet id="getting-started" label-id="dashlet_gettingstarted_label"
|
||||
description-id="dashlet_gettingstarted_desc"
|
||||
jsp="/jsp/dashboards/dashlets/getting-started.jsp" allow-narrow="false" />
|
||||
<!-- TEMP -->
|
||||
<dashlet id="task-list" label="My Tasklist" description="A description of the Task List"
|
||||
jsp="/jsp/dashboards/dashlets/tasklist.jsp" allow-narrow="false" />
|
||||
</dashlets>
|
||||
</dashboards>
|
||||
</config>
|
||||
|
||||
<config evaluator="string-compare" condition="Space Wizards">
|
||||
<!-- The list of custom folder types to show in the advanced space wizard -->
|
||||
<folder-types>
|
||||
|
@@ -38,6 +38,7 @@ import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.web.app.servlet.AuthenticationHelper;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.bean.ErrorBean;
|
||||
import org.alfresco.web.bean.dashboard.DashboardManager;
|
||||
import org.alfresco.web.bean.dialog.DialogManager;
|
||||
import org.alfresco.web.bean.repository.User;
|
||||
import org.alfresco.web.bean.wizard.WizardManager;
|
||||
@@ -189,6 +190,16 @@ public class Application
|
||||
return (WizardManager)FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "WizardManager");
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the DashboardManager managed bean
|
||||
*
|
||||
* @return DashboardManager bean
|
||||
*/
|
||||
public static DashboardManager getDashboardManager()
|
||||
{
|
||||
return (DashboardManager)FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "DashboardManager");
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the configured error page for the application
|
||||
*
|
||||
|
@@ -66,16 +66,18 @@ public abstract class BaseServlet extends HttpServlet
|
||||
static
|
||||
{
|
||||
validRedirectJSPs.add("/jsp/browse/browse.jsp");
|
||||
validRedirectJSPs.add("/jsp/browse/dashboard.jsp");
|
||||
validRedirectJSPs.add("/jsp/admin/admin-console.jsp");
|
||||
validRedirectJSPs.add("/jsp/admin/node-browser.jsp");
|
||||
validRedirectJSPs.add("/jsp/admin/store-browser.jsp");
|
||||
validRedirectJSPs.add("/jsp/users/user-console.jsp");
|
||||
validRedirectJSPs.add("/jsp/categories/categories.jsp");
|
||||
validRedirectJSPs.add("/jsp/dialog/about.jsp");
|
||||
validRedirectJSPs.add("/jsp/dialog/advanced-search.jsp");
|
||||
validRedirectJSPs.add("/jsp/dialog/system-info.jsp");
|
||||
validRedirectJSPs.add("/jsp/forums/forums.jsp");
|
||||
validRedirectJSPs.add("/jsp/users/users.jsp");
|
||||
validRedirectJSPs.add("/jsp/trashcan/trash-list.jsp");
|
||||
validRedirectJSPs.add("/jsp/dashboards/container.jsp");
|
||||
}
|
||||
|
||||
private static Log logger = LogFactory.getLog(BaseServlet.class);
|
||||
|
@@ -62,6 +62,10 @@ import org.apache.log4j.Logger;
|
||||
*/
|
||||
public class NavigationBean
|
||||
{
|
||||
private static final String OUTCOME_MYALFRESCO = "myalfresco";
|
||||
|
||||
private static final String OUTCOME_BROWSE = "browse";
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*/
|
||||
@@ -587,6 +591,9 @@ public class NavigationBean
|
||||
elements.add(new NavigationBreadcrumbHandler(companyHome.getNodeRef(), companyHome.getName()));
|
||||
setLocation(elements);
|
||||
setCurrentNodeId(companyHome.getId());
|
||||
|
||||
// we need to force a navigation to refresh the browse screen breadcrumb
|
||||
context.getApplication().getNavigationHandler().handleNavigation(context, null, OUTCOME_BROWSE);
|
||||
}
|
||||
else if (LOCATION_HOME.equals(location))
|
||||
{
|
||||
@@ -597,6 +604,9 @@ public class NavigationBean
|
||||
elements.add(new NavigationBreadcrumbHandler(homeSpaceRef, homeSpaceName));
|
||||
setLocation(elements);
|
||||
setCurrentNodeId(homeSpaceRef.getId());
|
||||
|
||||
// we need to force a navigation to refresh the browse screen breadcrumb
|
||||
context.getApplication().getNavigationHandler().handleNavigation(context, null, OUTCOME_BROWSE);
|
||||
}
|
||||
else if (LOCATION_GUEST.equals(location))
|
||||
{
|
||||
@@ -605,10 +615,31 @@ public class NavigationBean
|
||||
elements.add(new NavigationBreadcrumbHandler(guestHome.getNodeRef(), guestHome.getName()));
|
||||
setLocation(elements);
|
||||
setCurrentNodeId(guestHome.getId());
|
||||
|
||||
// we need to force a navigation to refresh the browse screen breadcrumb
|
||||
context.getApplication().getNavigationHandler().handleNavigation(context, null, OUTCOME_BROWSE);
|
||||
}
|
||||
else if (LOCATION_DASHBOARD.equals(location))
|
||||
{
|
||||
List<IBreadcrumbHandler> elements = new ArrayList<IBreadcrumbHandler>(1);
|
||||
elements.add(new IBreadcrumbHandler()
|
||||
{
|
||||
public String navigationOutcome(UIBreadcrumb breadcrumb)
|
||||
{
|
||||
setLocation( (List)breadcrumb.getValue() );
|
||||
return OUTCOME_MYALFRESCO;
|
||||
};
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_MYALFRESCO);
|
||||
};
|
||||
});
|
||||
setLocation(elements);
|
||||
|
||||
// we need to force a navigation to refresh the browse screen breadcrumb
|
||||
context.getApplication().getNavigationHandler().handleNavigation(context, null, OUTCOME_MYALFRESCO);
|
||||
}
|
||||
|
||||
// we need to force a navigation to refresh the browse screen breadcrumb
|
||||
context.getApplication().getNavigationHandler().handleNavigation(context, null, "browse");
|
||||
}
|
||||
catch (InvalidNodeRefException refErr)
|
||||
{
|
||||
@@ -711,7 +742,7 @@ public class NavigationBean
|
||||
}
|
||||
else
|
||||
{
|
||||
return "browse";
|
||||
return OUTCOME_BROWSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -734,6 +765,9 @@ public class NavigationBean
|
||||
private static final String LOCATION_COMPANY = "company";
|
||||
private static final String LOCATION_HOME = "home";
|
||||
private static final String LOCATION_GUEST = "guest";
|
||||
private static final String LOCATION_DASHBOARD = "dashboard";
|
||||
|
||||
private static final String MSG_MYALFRESCO = "my_alfresco";
|
||||
|
||||
private static final String ERROR_DELETED_FOLDER = "error_deleted_folder";
|
||||
|
||||
|
@@ -288,7 +288,7 @@ public class ActionsConfigElement extends ConfigElementAdapter
|
||||
return this.actions;
|
||||
}
|
||||
|
||||
/*pacakge*/ Set<String> getHiddenActions()
|
||||
/*package*/ Set<String> getHiddenActions()
|
||||
{
|
||||
return this.hiddenActions;
|
||||
}
|
||||
|
151
source/java/org/alfresco/web/config/DashboardsConfigElement.java
Normal file
151
source/java/org/alfresco/web/config/DashboardsConfigElement.java
Normal file
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
* Copyright (C) 2005 Alfresco, Inc.
|
||||
*
|
||||
* Licensed under the Mozilla Public License version 1.1
|
||||
* with a permitted attribution clause. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.alfresco.org/legal/license.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*/
|
||||
package org.alfresco.web.config;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.config.ConfigElement;
|
||||
import org.alfresco.config.ConfigException;
|
||||
import org.alfresco.config.element.ConfigElementAdapter;
|
||||
|
||||
/**
|
||||
* Dashboard config element.
|
||||
*
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public class DashboardsConfigElement extends ConfigElementAdapter
|
||||
{
|
||||
public static final String CONFIG_ELEMENT_ID = "dashboards";
|
||||
|
||||
private Map<String, LayoutDefinition> layoutDefs = new LinkedHashMap<String, LayoutDefinition>(4, 1.0f);
|
||||
private Map<String, DashletDefinition> dashletDefs = new LinkedHashMap<String, DashletDefinition>(8, 1.0f);
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*/
|
||||
public DashboardsConfigElement()
|
||||
{
|
||||
super(CONFIG_ELEMENT_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name
|
||||
*/
|
||||
public DashboardsConfigElement(String name)
|
||||
{
|
||||
super(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.config.element.ConfigElementAdapter#getChildren()
|
||||
*/
|
||||
public List<ConfigElement> getChildren()
|
||||
{
|
||||
throw new ConfigException("Reading the Dashboards config via the generic interfaces is not supported");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.config.element.ConfigElementAdapter#combine(org.alfresco.config.ConfigElement)
|
||||
*/
|
||||
public ConfigElement combine(ConfigElement configElement)
|
||||
{
|
||||
DashboardsConfigElement newElement = (DashboardsConfigElement)configElement;
|
||||
DashboardsConfigElement combinedElement = new DashboardsConfigElement();
|
||||
|
||||
// put all into combined from this and then from new to override any already present
|
||||
combinedElement.dashletDefs.putAll(this.dashletDefs);
|
||||
combinedElement.dashletDefs.putAll(newElement.dashletDefs);
|
||||
|
||||
combinedElement.layoutDefs.putAll(this.layoutDefs);
|
||||
combinedElement.layoutDefs.putAll(newElement.layoutDefs);
|
||||
|
||||
return combinedElement;
|
||||
}
|
||||
|
||||
/*package*/ void addLayoutDefinition(LayoutDefinition def)
|
||||
{
|
||||
this.layoutDefs.put(def.Id, def);
|
||||
}
|
||||
|
||||
public LayoutDefinition getLayoutDefinition(String id)
|
||||
{
|
||||
return this.layoutDefs.get(id);
|
||||
}
|
||||
|
||||
/*package*/ void addDashletDefinition(DashletDefinition def)
|
||||
{
|
||||
this.dashletDefs.put(def.Id, def);
|
||||
}
|
||||
|
||||
public DashletDefinition getDashletDefinition(String id)
|
||||
{
|
||||
return this.dashletDefs.get(id);
|
||||
}
|
||||
|
||||
public Iterator getLayouts()
|
||||
{
|
||||
return this.layoutDefs.entrySet().iterator();
|
||||
}
|
||||
|
||||
public Iterator getDashlets()
|
||||
{
|
||||
return this.dashletDefs.entrySet().iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* Structure class for the definition of a dashboard page layout
|
||||
*/
|
||||
public static class LayoutDefinition
|
||||
{
|
||||
LayoutDefinition(String id)
|
||||
{
|
||||
this.Id = id;
|
||||
}
|
||||
|
||||
public String Id;
|
||||
public String Image;
|
||||
public int Columns;
|
||||
public int ColumnLength;
|
||||
public String Label;
|
||||
public String LabelId;
|
||||
public String Description;
|
||||
public String DescriptionId;
|
||||
public String JSPPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Structure class for the definition of a dashboard dashlet component
|
||||
*/
|
||||
public static class DashletDefinition
|
||||
{
|
||||
DashletDefinition(String id)
|
||||
{
|
||||
this.Id = id;
|
||||
}
|
||||
|
||||
public String Id;
|
||||
public boolean AllowNarrow = true;
|
||||
public String Label;
|
||||
public String LabelId;
|
||||
public String Description;
|
||||
public String DescriptionId;
|
||||
public String JSPPage;
|
||||
}
|
||||
}
|
205
source/java/org/alfresco/web/config/DashboardsElementReader.java
Normal file
205
source/java/org/alfresco/web/config/DashboardsElementReader.java
Normal file
@@ -0,0 +1,205 @@
|
||||
/*
|
||||
* Copyright (C) 2005 Alfresco, Inc.
|
||||
*
|
||||
* Licensed under the Mozilla Public License version 1.1
|
||||
* with a permitted attribution clause. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.alfresco.org/legal/license.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*/
|
||||
package org.alfresco.web.config;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.alfresco.config.ConfigElement;
|
||||
import org.alfresco.config.ConfigException;
|
||||
import org.alfresco.config.xml.elementreader.ConfigElementReader;
|
||||
import org.alfresco.web.config.DashboardsConfigElement.DashletDefinition;
|
||||
import org.alfresco.web.config.DashboardsConfigElement.LayoutDefinition;
|
||||
import org.dom4j.Element;
|
||||
|
||||
/**
|
||||
* Reader for the 'dashboards' config element and child elements.
|
||||
*
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public class DashboardsElementReader implements ConfigElementReader
|
||||
{
|
||||
public static final String ELEMENT_DASHBOARDS = "dashboards";
|
||||
public static final String ELEMENT_LAYOUTS = "layouts";
|
||||
public static final String ELEMENT_LAYOUT = "layout";
|
||||
public static final String ELEMENT_DASHLETS = "dashlets";
|
||||
public static final String ELEMENT_DASHLET = "dashlet";
|
||||
public static final String ATTR_ID = "id";
|
||||
public static final String ATTR_COLUMNS = "columns";
|
||||
public static final String ATTR_COLUMNLENGTH = "column-length";
|
||||
public static final String ATTR_IMAGE = "image";
|
||||
public static final String ATTR_LABEL = "label";
|
||||
public static final String ATTR_DESCRIPTION = "description";
|
||||
public static final String ATTR_LABELID = "label-id";
|
||||
public static final String ATTR_DESCRIPTIONID = "description-id";
|
||||
public static final String ATTR_JSP = "jsp";
|
||||
public static final String ATTR_ALLOWNARROW = "allow-narrow";
|
||||
|
||||
/**
|
||||
* @see org.alfresco.config.xml.elementreader.ConfigElementReader#parse(org.dom4j.Element)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public ConfigElement parse(Element element)
|
||||
{
|
||||
DashboardsConfigElement configElement = new DashboardsConfigElement();
|
||||
|
||||
if (element != null)
|
||||
{
|
||||
if (DashboardsConfigElement.CONFIG_ELEMENT_ID.equals(element.getName()) == false)
|
||||
{
|
||||
throw new ConfigException("DashboardsElementReader can only process elements of type 'dashboards'");
|
||||
}
|
||||
|
||||
Element layoutsElement = element.element(ELEMENT_LAYOUTS);
|
||||
if (layoutsElement != null)
|
||||
{
|
||||
Iterator<Element> layoutsItr = layoutsElement.elementIterator(ELEMENT_LAYOUT);
|
||||
while (layoutsItr.hasNext())
|
||||
{
|
||||
LayoutDefinition layoutDef = parseLayoutDefinition(layoutsItr.next());
|
||||
configElement.addLayoutDefinition(layoutDef);
|
||||
}
|
||||
}
|
||||
|
||||
Element dashletsElement = element.element(ELEMENT_DASHLETS);
|
||||
if (dashletsElement != null)
|
||||
{
|
||||
Iterator<Element> dashletsItr = dashletsElement.elementIterator(ELEMENT_DASHLET);
|
||||
while (dashletsItr.hasNext())
|
||||
{
|
||||
DashletDefinition dashletDef = parseDashletDefinition(dashletsItr.next());
|
||||
configElement.addDashletDefinition(dashletDef);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return configElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a single Layout definition from config.
|
||||
*
|
||||
* @param config
|
||||
*
|
||||
* @return LayoutDefinition for the specified config element.
|
||||
*/
|
||||
private static LayoutDefinition parseLayoutDefinition(Element config)
|
||||
{
|
||||
String id = getMandatoryLayoutAttributeValue(config, ATTR_ID);
|
||||
|
||||
LayoutDefinition def = new LayoutDefinition(id);
|
||||
|
||||
String columns = getMandatoryLayoutAttributeValue(config, ATTR_COLUMNS);
|
||||
def.Columns = Integer.parseInt(columns);
|
||||
String columnLength = getMandatoryLayoutAttributeValue(config, ATTR_COLUMNLENGTH);
|
||||
def.ColumnLength = Integer.parseInt(columnLength);
|
||||
def.Image = getMandatoryLayoutAttributeValue(config, ATTR_IMAGE);
|
||||
def.JSPPage = getMandatoryLayoutAttributeValue(config, ATTR_JSP);
|
||||
String label = config.attributeValue(ATTR_LABEL);
|
||||
String labelId = config.attributeValue(ATTR_LABELID);
|
||||
if ((label == null || label.length() == 0) && (labelId == null || labelId.length() == 0))
|
||||
{
|
||||
throw new ConfigException("Either 'label' or 'label-id' attribute must be specified for Dashboard 'layout' configuration element.");
|
||||
}
|
||||
def.Label = label;
|
||||
def.LabelId = labelId;
|
||||
String description = config.attributeValue(ATTR_DESCRIPTION);
|
||||
String descriptionId = config.attributeValue(ATTR_DESCRIPTIONID);
|
||||
if ((description == null || description.length() == 0) && (descriptionId == null || descriptionId.length() == 0))
|
||||
{
|
||||
throw new ConfigException("Either 'description' or 'description-id' attribute must be specified for Dashboard 'layout' configuration element.");
|
||||
}
|
||||
def.Description = description;
|
||||
def.DescriptionId = descriptionId;
|
||||
|
||||
return def;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a mandatory layout attribute layout. Throw an exception if the value is not found.
|
||||
*
|
||||
* @param config
|
||||
* @param attr
|
||||
*
|
||||
* @return String value
|
||||
*/
|
||||
private static String getMandatoryLayoutAttributeValue(Element config, String attr)
|
||||
{
|
||||
String value = config.attributeValue(attr);
|
||||
if (value == null || value.length() == 0)
|
||||
{
|
||||
throw new ConfigException("Missing mandatory '" + attr + "' attribute for Dashboard 'layout' configuration element.");
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a single Dashlet definition from config.
|
||||
*
|
||||
* @param config
|
||||
*
|
||||
* @return DashletDefinition for the specified config element.
|
||||
*/
|
||||
private static DashletDefinition parseDashletDefinition(Element config)
|
||||
{
|
||||
String id = getMandatoryDashletAttributeValue(config, ATTR_ID);
|
||||
|
||||
DashletDefinition def = new DashletDefinition(id);
|
||||
|
||||
String allowNarrow = config.attributeValue(ATTR_ALLOWNARROW);
|
||||
if (allowNarrow != null && allowNarrow.length() != 0)
|
||||
{
|
||||
def.AllowNarrow = Boolean.parseBoolean(allowNarrow);
|
||||
}
|
||||
def.JSPPage = getMandatoryDashletAttributeValue(config, ATTR_JSP);
|
||||
String label = config.attributeValue(ATTR_LABEL);
|
||||
String labelId = config.attributeValue(ATTR_LABELID);
|
||||
if ((label == null || label.length() == 0) && (labelId == null || labelId.length() == 0))
|
||||
{
|
||||
throw new ConfigException("Either 'label' or 'label-id' attribute must be specified for Dashboard 'dashlet' configuration element.");
|
||||
}
|
||||
def.Label = label;
|
||||
def.LabelId = labelId;
|
||||
String description = config.attributeValue(ATTR_DESCRIPTION);
|
||||
String descriptionId = config.attributeValue(ATTR_DESCRIPTIONID);
|
||||
if ((description == null || description.length() == 0) && (descriptionId == null || descriptionId.length() == 0))
|
||||
{
|
||||
throw new ConfigException("Either 'description' or 'description-id' attribute must be specified for Dashboard 'dashlet' configuration element.");
|
||||
}
|
||||
def.Description = description;
|
||||
def.DescriptionId = descriptionId;
|
||||
|
||||
return def;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a mandatory dashlet attribute layout. Throw an exception if the value is not found.
|
||||
*
|
||||
* @param config
|
||||
* @param attr
|
||||
*
|
||||
* @return String value
|
||||
*/
|
||||
private static String getMandatoryDashletAttributeValue(Element config, String attr)
|
||||
{
|
||||
String value = config.attributeValue(attr);
|
||||
if (value == null || value.length() == 0)
|
||||
{
|
||||
throw new ConfigException("Missing mandatory '" + attr + "' attribute for Dashboard 'dashlet' configuration element.");
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
@@ -1437,6 +1437,13 @@
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
</managed-bean>
|
||||
|
||||
<managed-bean>
|
||||
<description>Bean that manages the Dashboard framework</description>
|
||||
<managed-bean-name>DashboardManager</managed-bean-name>
|
||||
<managed-bean-class>org.alfresco.web.bean.dashboard.DashboardManager</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
</managed-bean>
|
||||
|
||||
|
||||
<!-- ==================== COMPONENT GENERATOR BEANS ==================== -->
|
||||
<managed-bean>
|
||||
|
@@ -32,6 +32,10 @@
|
||||
<from-outcome>browse</from-outcome>
|
||||
<to-view-id>/jsp/browse/browse.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>myalfresco</from-outcome>
|
||||
<to-view-id>/jsp/dashboards/container.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>about</from-outcome>
|
||||
<to-view-id>/jsp/dialog/about.jsp</to-view-id>
|
||||
|
@@ -488,3 +488,18 @@ a.topToolbarLinkHighlight, a.topToolbarLinkHighlight:link, a.topToolbarLinkHighl
|
||||
{
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.tableThirdWidth
|
||||
{
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
.tableNarrowWidth
|
||||
{
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.tableWideWidth
|
||||
{
|
||||
width: 70%;
|
||||
}
|
||||
|
BIN
source/web/images/icons/configure.gif
Normal file
BIN
source/web/images/icons/configure.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1008 B |
BIN
source/web/images/icons/dashboard.gif
Normal file
BIN
source/web/images/icons/dashboard.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 998 B |
BIN
source/web/images/icons/dashboard_large.gif
Normal file
BIN
source/web/images/icons/dashboard_large.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
@@ -1,169 +0,0 @@
|
||||
<%--
|
||||
Copyright (C) 2005 Alfresco, Inc.
|
||||
|
||||
Licensed under the Mozilla Public License version 1.1
|
||||
with a permitted attribution clause. You may obtain a
|
||||
copy of the License at
|
||||
|
||||
http://www.alfresco.org/legal/license.txt
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
either express or implied. See the License for the specific
|
||||
language governing permissions and limitations under the
|
||||
License.
|
||||
--%>
|
||||
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
|
||||
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
|
||||
|
||||
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
|
||||
<%@ page isELIgnored="false" %>
|
||||
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
|
||||
|
||||
<r:page>
|
||||
|
||||
<f:view>
|
||||
|
||||
<%-- load a bundle of properties with I18N strings --%>
|
||||
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
|
||||
|
||||
<h:form acceptCharset="UTF-8" id="dashboard">
|
||||
|
||||
<%-- Main outer table --%>
|
||||
<table cellspacing="0" cellpadding="2">
|
||||
|
||||
<%-- Title bar --%>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<%@ include file="parts/titlebar.jsp" %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<%-- Main area --%>
|
||||
<tr valign="top">
|
||||
<%-- Shelf --%>
|
||||
<td>
|
||||
<%@ include file="parts/shelf.jsp" %>
|
||||
</td>
|
||||
|
||||
<%-- Work Area --%>
|
||||
<td width="100%">
|
||||
<table cellspacing="0" cellpadding="0" width="100%">
|
||||
<%-- Breadcrumb --%>
|
||||
<%@ include file="parts/breadcrumb.jsp" %>
|
||||
|
||||
<%-- Status and Actions --%>
|
||||
<tr>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
|
||||
<td bgcolor="#EEEEEE">
|
||||
|
||||
<%-- Status and Actions inner contents table --%>
|
||||
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
|
||||
<table cellspacing="4" cellpadding="0" width="100%">
|
||||
<tr valign="top">
|
||||
<td width=32>
|
||||
<h:graphicImage id="logo" url="/images/logo/AlfrescoLogo32.gif" width="32" height="32" />
|
||||
</td>
|
||||
<td>
|
||||
<div class="mainSubTitle"><h:outputText value='#{NavigationBean.nodeProperties.name}' /></div>
|
||||
<div class="mainTitle"><h:outputText value="My Dashboard" /></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with gradient shadow --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
|
||||
</tr>
|
||||
|
||||
<%-- Main --%>
|
||||
<tr valign=top>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
|
||||
<td valign=top>
|
||||
|
||||
<table cellspacing=4 cellpadding=2 border=0 width=100%>
|
||||
<tr valign=top>
|
||||
|
||||
<td width=100% colspan=2>
|
||||
<a:panel label="My Summary" id="dash1" border="innergrey" bgcolor="#e8e8e8" progressive="true">
|
||||
|
||||
<r:template id="t1" template="alfresco/templates/my_summary.ftl" />
|
||||
|
||||
</a:panel>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
|
||||
<td width=50%>
|
||||
<a:panel label="My Docs" id="dash2" border="white" bgcolor="white" progressive="true">
|
||||
|
||||
<r:template id="t2" template="alfresco/templates/my_docs.ftl" />
|
||||
|
||||
</a:panel>
|
||||
</td>
|
||||
|
||||
<td width=50%>
|
||||
<a:panel label="My Spaces" id="dash3" border="white" bgcolor="white" progressive="true">
|
||||
|
||||
<r:template id="t3" template="alfresco/templates/my_spaces.ftl" />
|
||||
|
||||
</a:panel>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
|
||||
<td width=100% colspan=2>
|
||||
<a:panel label="Press Releases" id="dash4" border="blue" bgcolor="#d3e6fe" progressive="true">
|
||||
|
||||
<r:template id="t4" template="alfresco/templates/my_pressreleases.ftl" />
|
||||
|
||||
</a:panel>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
|
||||
<td width=100% colspan=2>
|
||||
<a:panel label="Company Logos" id="dash5" border="white" bgcolor="white" progressive="true">
|
||||
|
||||
<r:template id="t5" template="alfresco/templates/company_logos.ftl" />
|
||||
|
||||
</a:panel>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with bottom panel graphics --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
|
||||
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</h:form>
|
||||
|
||||
</f:view>
|
||||
|
||||
</r:page>
|
@@ -31,7 +31,7 @@
|
||||
<a:listItem value="company" label="#{msg.company_home}" rendered="#{NavigationBean.companyHomeVisible}" />
|
||||
<a:listItem value="home" label="#{msg.my_home}" />
|
||||
<a:listItem value="guest" label="#{msg.guest_home}" rendered="#{NavigationBean.isGuest == false && NavigationBean.guestHomeVisible}" />
|
||||
<a:listItem value="myalfresco" label="#{msg.my_alfresco}" />
|
||||
<a:listItem value="dashboard" label="#{msg.my_alfresco}" />
|
||||
</a:modeList>
|
||||
</td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/titlebar_end.gif" width=8 height=30></td>
|
||||
|
Reference in New Issue
Block a user