Configuration added for web-client to setup default dashlets shown in a user Dashboard on first login

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5979 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-06-15 15:07:36 +00:00
parent 3131468788
commit 1883c7b020
4 changed files with 63 additions and 11 deletions

View File

@@ -24,6 +24,7 @@
*/
package org.alfresco.web.config;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashMap;
@@ -45,6 +46,7 @@ public class DashboardsConfigElement extends ConfigElementAdapter
private Map<String, LayoutDefinition> layoutDefs = new LinkedHashMap<String, LayoutDefinition>(4, 1.0f);
private Map<String, DashletDefinition> dashletDefs = new LinkedHashMap<String, DashletDefinition>(8, 1.0f);
private List<String> defaultDashlets = null;
private boolean allowGuestConfig = false;
/**
@@ -91,6 +93,18 @@ public class DashboardsConfigElement extends ConfigElementAdapter
combinedElement.allowGuestConfig = newElement.allowGuestConfig;
}
// the default-dashlets list is completely replaced if config is overriden
if (newElement.defaultDashlets != null)
{
combinedElement.defaultDashlets =
(List<String>)((ArrayList<String>)newElement.defaultDashlets).clone();
}
else if (this.defaultDashlets != null)
{
combinedElement.defaultDashlets =
(List<String>)((ArrayList<String>)this.defaultDashlets).clone();
}
return combinedElement;
}
@@ -134,6 +148,20 @@ public class DashboardsConfigElement extends ConfigElementAdapter
return this.dashletDefs.values();
}
/*package*/ void addDefaultDashlet(String id)
{
if (this.defaultDashlets == null)
{
this.defaultDashlets = new ArrayList<String>(2);
}
this.defaultDashlets.add(id);
}
public Collection<String> getDefaultDashlets()
{
return this.defaultDashlets;
}
/**
* Structure class for the definition of a dashboard page layout
*/