mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
. Dashboards impl checkpoint
- beginnings of the dashboard configuration wizard (layouts) - icons for various layouts (a bit of Photoshop fun) - working layouts for single column, 2 column left and right narrow, three column . Added "immediate" attribute to ActionLink component - same functionality as for standard JSF Command Button . Fixed Wizard container.jsp to use "immediate=true" on Cancel button git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3354 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -854,7 +854,19 @@ dashboard_info=My Alfresco Dashboard
|
||||
dashboard_description=Configure this view and build your personal Alfresco dashboard
|
||||
configure=Configure
|
||||
|
||||
# My Alfresco Dashlets messages
|
||||
# My Alfresco Layout Manager wizard messages
|
||||
configure_dashboard_title=Configure Dashboard Wizard
|
||||
configure_dashboard_desc=This wizard helps you configure your dashboard layout and contents
|
||||
step_layout=Layout
|
||||
configure_dashboard_step1_title=Step One - Select Layout
|
||||
configure_dashboard_step1_desc=Choose the layout and number of columns for your dashboard.
|
||||
step_columns=Components
|
||||
configure_dashboard_step2_title=Step Two - Select Components
|
||||
configure_dashboard_step2_desc=Select the components for your dashboard and add them to the columns.
|
||||
configure_dashboard_finish_instruction=To save the dashboard configuration click Finish. To review or change your selections click Back.
|
||||
select_layout=Select the style of layout for your dashboard.
|
||||
|
||||
# My Alfresco Layouts 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
|
||||
@@ -863,6 +875,8 @@ 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
|
||||
|
||||
# My Alfresco Dashlet components messages
|
||||
dashlet_gettingstarted_label=Getting Started
|
||||
dashlet_gettingstarted_desc=This component displays helpful information and links for getting started with the Alfresco web-client application
|
||||
|
||||
|
@@ -158,6 +158,30 @@
|
||||
</step>
|
||||
</wizard>
|
||||
|
||||
<!-- Definition of the Dashboard Layout wizard -->
|
||||
<wizard name="configureDashboard" managed-bean="DashboardWizard"
|
||||
title-id="configure_dashboard_title" description-id="configure_dashboard_desc"
|
||||
icon="/images/icons/configure_dashboard_large.gif">
|
||||
<step name="layout" title-id="step_layout" description-id="configure_dashboard_step1_desc">
|
||||
<page path="/jsp/dashboards/wizard/layout.jsp"
|
||||
title-id="configure_dashboard_step1_title"
|
||||
description-id="configure_dashboard_step1_desc"
|
||||
instruction-id="default_instruction" />
|
||||
</step>
|
||||
<step name="columns" title-id="step_columns" description-id="configure_dashboard_step2_desc">
|
||||
<page path="/jsp/dashboards/wizard/columns.jsp"
|
||||
title-id="configure_dashboard_step2_title"
|
||||
description-id="configure_dashboard_step2_desc"
|
||||
instruction-id="default_instruction" />
|
||||
</step>
|
||||
<step name="summary" title-id="summary" description-id="summary_step_description">
|
||||
<page path="/jsp/wizard/summary.jsp"
|
||||
title-id="summary"
|
||||
description-id="summary_desc"
|
||||
instruction-id="configure_dashboard_finish_instruction" />
|
||||
</step>
|
||||
</wizard>
|
||||
|
||||
</wizards>
|
||||
</config>
|
||||
|
||||
|
@@ -166,16 +166,16 @@
|
||||
<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"
|
||||
<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"
|
||||
<layout id="narrow-left-2column" columns="2" column-length="4" image="/images/icons/layout_narrow_left_2column.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"
|
||||
<layout id="narrow-right-2column" columns="2" column-length="4" image="/images/icons/layout_narrow_right_2column.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"
|
||||
<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>
|
||||
|
@@ -42,8 +42,8 @@ public final class DashboardManager
|
||||
private static Log logger = LogFactory.getLog(DashboardManager.class);
|
||||
|
||||
private static final String PREF_DASHBOARD = "dashboard";
|
||||
private static final String LAYOUT_DEFAULT = "default";
|
||||
private static final String DASHLET_DEFAULT = "getting-started";
|
||||
static final String LAYOUT_DEFAULT = "default";
|
||||
static final String DASHLET_DEFAULT = "getting-started";
|
||||
|
||||
private static final String JSP_DUMMY = "/jsp/dashboards/dummy.jsp";
|
||||
|
||||
@@ -202,7 +202,7 @@ public final class DashboardManager
|
||||
/**
|
||||
* @return The externally configured WebClient config element for the Dashboards
|
||||
*/
|
||||
private static DashboardsConfigElement getDashboardConfig()
|
||||
public static DashboardsConfigElement getDashboardConfig()
|
||||
{
|
||||
ConfigService service = Application.getConfigService(FacesContext.getCurrentInstance());
|
||||
DashboardsConfigElement config = (DashboardsConfigElement)service.getConfig("Dashboards").getConfigElement(
|
||||
|
173
source/java/org/alfresco/web/bean/dashboard/DashboardWizard.java
Normal file
173
source/java/org/alfresco/web/bean/dashboard/DashboardWizard.java
Normal file
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
* 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.bean.dashboard;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.wizard.BaseWizardBean;
|
||||
import org.alfresco.web.config.DashboardsConfigElement;
|
||||
import org.alfresco.web.config.DashboardsConfigElement.DashletDefinition;
|
||||
import org.alfresco.web.config.DashboardsConfigElement.LayoutDefinition;
|
||||
import org.alfresco.web.ui.common.component.UIListItem;
|
||||
import org.alfresco.web.ui.common.component.description.UIDescription;
|
||||
|
||||
/**
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public class DashboardWizard extends BaseWizardBean
|
||||
{
|
||||
/** List of icons items to display as selectable Layout definitions */
|
||||
private List<UIListItem> layoutIcons = null;
|
||||
|
||||
/** List of descriptions of the layouts */
|
||||
private List<UIDescription> layoutDescriptions= null;
|
||||
|
||||
/** Currently selected layout */
|
||||
private String layout = DashboardManager.LAYOUT_DEFAULT;
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Wizard implementation
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.bean.dialog.BaseDialogBean#init(java.util.Map)
|
||||
*/
|
||||
public void init(Map<String, String> parameters)
|
||||
{
|
||||
super.init(parameters);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.bean.dialog.BaseDialogBean#finishImpl(javax.faces.context.FacesContext, java.lang.String)
|
||||
*/
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the summary data for the wizard.
|
||||
*/
|
||||
public String getSummary()
|
||||
{
|
||||
LayoutDefinition def = DashboardManager.getDashboardConfig().getLayoutDefinition(this.layout);
|
||||
String label = def.Label;
|
||||
if (label == null || label.length() == 0)
|
||||
{
|
||||
label = Application.getMessage(FacesContext.getCurrentInstance(), def.LabelId);
|
||||
}
|
||||
return buildSummary(
|
||||
new String[]{"Layout"},
|
||||
new String[]{label});
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Dashboard Wizard bean getters
|
||||
|
||||
/**
|
||||
* @return The currently selected layout ID - used by the Dynamic Description component
|
||||
*/
|
||||
public String getLayout()
|
||||
{
|
||||
// TODO: implement - need current PageConfig from DashboardManager
|
||||
return this.layout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the currently selected layout ID
|
||||
*/
|
||||
public void setLayout(String layout)
|
||||
{
|
||||
this.layout = layout;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return List of UIDescription objects for the available layouts
|
||||
*/
|
||||
public List<UIDescription> getLayoutDescriptions()
|
||||
{
|
||||
if (this.layoutDescriptions == null)
|
||||
{
|
||||
buildLayoutValueLists();
|
||||
}
|
||||
return this.layoutDescriptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the List of UIListItem objects representing the Layout icons
|
||||
*/
|
||||
public List<UIListItem> getLayoutIcons()
|
||||
{
|
||||
if (this.layoutIcons == null)
|
||||
{
|
||||
buildLayoutValueLists();
|
||||
}
|
||||
return this.layoutIcons;
|
||||
}
|
||||
|
||||
private void buildLayoutValueLists()
|
||||
{
|
||||
List<UIListItem> icons = new ArrayList<UIListItem>(4);
|
||||
List<UIDescription> descriptions = new ArrayList<UIDescription>(4);
|
||||
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
|
||||
DashboardsConfigElement config = DashboardManager.getDashboardConfig();
|
||||
Iterator<LayoutDefinition> layoutItr = config.getLayouts().iterator();
|
||||
while (layoutItr.hasNext())
|
||||
{
|
||||
LayoutDefinition layoutDef = layoutItr.next();
|
||||
|
||||
// build UIListItem to represent the layout image
|
||||
String label = layoutDef.Label;
|
||||
if (label == null || label.length() == 0)
|
||||
{
|
||||
label = Application.getMessage(context, layoutDef.LabelId);
|
||||
}
|
||||
String desc = layoutDef.Description;
|
||||
if (desc == null || desc.length() == 0)
|
||||
{
|
||||
desc = Application.getMessage(context, layoutDef.DescriptionId);
|
||||
}
|
||||
UIListItem item = new UIListItem();
|
||||
item.setLabel(label);
|
||||
item.setTooltip(desc);
|
||||
item.setValue(layoutDef.Id);
|
||||
// set the special attribute used by the imageRadioPicker component
|
||||
item.getAttributes().put("image", layoutDef.Image);
|
||||
icons.add(item);
|
||||
|
||||
// build UIDescription to represent the layout description text
|
||||
UIDescription description = new UIDescription();
|
||||
description.setControlValue(layoutDef.Id);
|
||||
description.setText(desc);
|
||||
descriptions.add(description);
|
||||
}
|
||||
|
||||
this.layoutIcons = icons;
|
||||
this.layoutDescriptions = descriptions;
|
||||
}
|
||||
}
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package org.alfresco.web.config;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
@@ -99,14 +100,14 @@ public class DashboardsConfigElement extends ConfigElementAdapter
|
||||
return this.dashletDefs.get(id);
|
||||
}
|
||||
|
||||
public Iterator getLayouts()
|
||||
public Collection<LayoutDefinition> getLayouts()
|
||||
{
|
||||
return this.layoutDefs.entrySet().iterator();
|
||||
return this.layoutDefs.values();
|
||||
}
|
||||
|
||||
public Iterator getDashlets()
|
||||
public Collection<DashletDefinition> getDashlets()
|
||||
{
|
||||
return this.dashletDefs.entrySet().iterator();
|
||||
return this.dashletDefs.values();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -57,7 +57,7 @@ public class ActionLinkTag extends HtmlComponentTag
|
||||
setStringProperty(component, "value", this.value);
|
||||
setStringProperty(component, "target", this.target);
|
||||
setStringProperty(component, "onclick", this.onclick);
|
||||
|
||||
setBooleanProperty(component, "immediate", this.immediate);
|
||||
// TODO: Add image width/height properties
|
||||
}
|
||||
|
||||
@@ -77,6 +77,7 @@ public class ActionLinkTag extends HtmlComponentTag
|
||||
this.href = null;
|
||||
this.target = null;
|
||||
this.onclick = null;
|
||||
this.immediate = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,6 +179,11 @@ public class ActionLinkTag extends HtmlComponentTag
|
||||
{
|
||||
this.onclick = onclick;
|
||||
}
|
||||
|
||||
public void setImmediate(String immediate)
|
||||
{
|
||||
this.immediate = immediate;
|
||||
}
|
||||
|
||||
/** the target */
|
||||
private String target;
|
||||
@@ -208,4 +214,7 @@ public class ActionLinkTag extends HtmlComponentTag
|
||||
|
||||
/** the onclick handler */
|
||||
private String onclick;
|
||||
|
||||
/** the immediate flag */
|
||||
private String immediate;
|
||||
}
|
||||
|
@@ -657,6 +657,12 @@
|
||||
<required>false</required>
|
||||
<rtexprvalue>true</rtexprvalue>
|
||||
</attribute>
|
||||
|
||||
<attribute>
|
||||
<name>immediate</name>
|
||||
<required>false</required>
|
||||
<rtexprvalue>true</rtexprvalue>
|
||||
</attribute>
|
||||
</tag>
|
||||
|
||||
<tag>
|
||||
|
@@ -1443,6 +1443,43 @@
|
||||
<managed-bean-class>org.alfresco.web.bean.dashboard.DashboardManager</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
</managed-bean>
|
||||
|
||||
<managed-bean>
|
||||
<description>
|
||||
The bean that backs up the Dashboard Config Wizard
|
||||
</description>
|
||||
<managed-bean-name>DashboardWizard</managed-bean-name>
|
||||
<managed-bean-class>org.alfresco.web.bean.dashboard.DashboardWizard</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>nodeService</property-name>
|
||||
<value>#{NodeService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>fileFolderService</property-name>
|
||||
<value>#{FileFolderService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>searchService</property-name>
|
||||
<value>#{SearchService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>navigator</property-name>
|
||||
<value>#{NavigationBean}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>browseBean</property-name>
|
||||
<value>#{BrowseBean}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>dictionaryService</property-name>
|
||||
<value>#{DictionaryService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>namespaceService</property-name>
|
||||
<value>#{NamespaceService}</value>
|
||||
</managed-property>
|
||||
</managed-bean>
|
||||
|
||||
|
||||
<!-- ==================== COMPONENT GENERATOR BEANS ==================== -->
|
||||
|
@@ -492,16 +492,19 @@ a.topToolbarLinkHighlight, a.topToolbarLinkHighlight:link, a.topToolbarLinkHighl
|
||||
.tableThirdWidth
|
||||
{
|
||||
width: 33%;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.tableNarrowWidth
|
||||
{
|
||||
width: 30%;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.tableWideWidth
|
||||
{
|
||||
width: 70%;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.summaryPopupPanel
|
||||
|
BIN
source/web/images/icons/configure_dashboard.gif
Normal file
BIN
source/web/images/icons/configure_dashboard.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 998 B |
BIN
source/web/images/icons/configure_dashboard_large.gif
Normal file
BIN
source/web/images/icons/configure_dashboard_large.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
source/web/images/icons/layout_narrow_left_2column.gif
Normal file
BIN
source/web/images/icons/layout_narrow_left_2column.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 840 B |
BIN
source/web/images/icons/layout_narrow_right_2column.gif
Normal file
BIN
source/web/images/icons/layout_narrow_right_2column.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 841 B |
BIN
source/web/images/icons/layout_single_column.gif
Normal file
BIN
source/web/images/icons/layout_single_column.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 807 B |
BIN
source/web/images/icons/layout_three_column.gif
Normal file
BIN
source/web/images/icons/layout_three_column.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 866 B |
@@ -73,6 +73,9 @@
|
||||
<div class="mainTitle"><h:outputText value="#{msg.dashboard_info}" /></div>
|
||||
<div class="mainSubText"><h:outputText value="#{msg.dashboard_description}" /></div>
|
||||
</td>
|
||||
<td align="right">
|
||||
<a:actionLink value="#{msg.configure}" image="/images/icons/configure_dashboard.gif" padding="2" action="wizard:configureDashboard" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
|
||||
<%@ page import="org.alfresco.web.app.Application" %>
|
||||
|
||||
<h:panelGrid columns="2" cellpadding="2" cellspacing="2" width="100%" columnClasses="tableWideWidth,tableNarrowWidth" style="vertical-align:middle">
|
||||
<h:panelGrid columns="2" cellpadding="2" cellspacing="2" width="100%" columnClasses="tableWideWidth,tableNarrowWidth">
|
||||
<% Application.getDashboardManager().initDashboard(); %>
|
||||
<h:panelGroup>
|
||||
<a:panel label="#{DashboardManager.dashletTitle[0]}" id="dashlet-0" progressive="true" rendered="#{DashboardManager.dashletAvailable[0]}"
|
||||
|
@@ -22,7 +22,7 @@
|
||||
<%@ page import="org.alfresco.web.app.Application" %>
|
||||
|
||||
<% Application.getDashboardManager().initDashboard(); %>
|
||||
<h:panelGrid columns="1" cellpadding="2" cellspacing="2" width="100%" style="vertical-align:middle">
|
||||
<h:panelGrid columns="1" cellpadding="2" cellspacing="2" width="100%">
|
||||
<a:panel label="#{DashboardManager.dashletTitle[0]}" id="dashlet-1" progressive="true" rendered="#{DashboardManager.dashletAvailable[0]}"
|
||||
border="white" bgcolor="white" titleBorder="blue" titleBgcolor="#D3E6FE">
|
||||
<f:subview id="dashlet-1-view">
|
||||
|
@@ -21,8 +21,8 @@
|
||||
|
||||
<%@ page import="org.alfresco.web.app.Application" %>
|
||||
|
||||
<%=Application.getDashboardManager()...%>
|
||||
<h:panelGrid columns="3" cellpadding="2" cellspacing="2" width="100%" columnClasses="tableThirdWidth">
|
||||
<% Application.getDashboardManager().initDashboard(); %>
|
||||
<h:panelGroup>
|
||||
<a:panel label="#{DashboardManager.dashletTitle[0]}" id="dashlet-0" progressive="true" rendered="#{DashboardManager.dashletAvailable[0]}"
|
||||
border="white" bgcolor="white" titleBorder="blue" titleBgcolor="#D3E6FE">
|
||||
|
@@ -64,7 +64,7 @@
|
||||
<td><nobr><a href="http://www.alfresco.com/services/support/issues/" target="new"><h:outputText value="#{msg.raise_issue}" /></a></nobr></td>
|
||||
<td width=8> </td>
|
||||
<td><nobr>
|
||||
<a:actionLink id="logout" image="/images/icons/logout.gif" value="#{msg.logout} (#{NavigationBean.currentUser.userName})" rendered="#{NavigationBean.isGuest == false}" action="#{LoginBean.logout}" />
|
||||
<a:actionLink id="logout" image="/images/icons/logout.gif" value="#{msg.logout} (#{NavigationBean.currentUser.userName})" rendered="#{NavigationBean.isGuest == false}" action="#{LoginBean.logout}" immediate="true" />
|
||||
<a:actionLink id="login" image="/images/icons/login.gif" value="#{msg.login} (#{NavigationBean.currentUser.userName})" rendered="#{NavigationBean.isGuest == true}" action="#{LoginBean.logout}" />
|
||||
</nobr></td>
|
||||
</tr>
|
||||
|
@@ -163,7 +163,7 @@
|
||||
<td align="center">
|
||||
<h:commandButton id="cancel-button" styleClass="wizardButton"
|
||||
value="#{WizardManager.cancelButtonLabel}"
|
||||
action="#{WizardManager.cancel}" />
|
||||
action="#{WizardManager.cancel}" immediate="true" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
Reference in New Issue
Block a user