mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
. Changing default view after Login to the MyAlfresco dashboard for all users
- so new users see the helpful Getting Started page when logging in - this client config value can be changed if the sys admin does not want the MyAlfresco to be the default page . Add User Preference to change the default view after login - so users familiar with the system can change their default view back to Home Space or similar . Added client config to allow Guest user access to Configure Dashboard action (set to 'false' by default) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3652 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -91,13 +91,21 @@ public class LoginBean
|
||||
}
|
||||
|
||||
/**
|
||||
* @param navigator The NavigationBean to set.
|
||||
* @param navigator The NavigationBean to set.
|
||||
*/
|
||||
public void setNavigator(NavigationBean navigator)
|
||||
{
|
||||
this.navigator = navigator;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param preferences The UserPreferencesBean to set
|
||||
*/
|
||||
public void setUserPreferencesBean(UserPreferencesBean preferences)
|
||||
{
|
||||
this.preferences = preferences;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if the default Alfresco authentication process is being used, else false
|
||||
* if an external authorisation mechanism is present.
|
||||
@@ -329,7 +337,7 @@ public class LoginBean
|
||||
else
|
||||
{
|
||||
// special case to handle jump to My Alfresco page initially
|
||||
String location = Application.getClientConfig(FacesContext.getCurrentInstance()).getInitialLocation();
|
||||
String location = this.preferences.getStartLocation();
|
||||
if (NavigationBean.LOCATION_MYALFRESCO.equals(location))
|
||||
{
|
||||
return "myalfresco";
|
||||
@@ -451,4 +459,7 @@ public class LoginBean
|
||||
|
||||
/** The NavigationBean bean reference */
|
||||
protected NavigationBean navigator;
|
||||
|
||||
/** The user preferences bean reference */
|
||||
protected UserPreferencesBean preferences;
|
||||
}
|
||||
|
@@ -126,6 +126,14 @@ public class NavigationBean
|
||||
this.contentDiskDriver = contentDiskDriver;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param preferences The UserPreferencesBean to set
|
||||
*/
|
||||
public void setUserPreferencesBean(UserPreferencesBean preferences)
|
||||
{
|
||||
this.preferences = preferences;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the User object representing the current instance for this user
|
||||
*/
|
||||
@@ -507,13 +515,8 @@ public class NavigationBean
|
||||
{
|
||||
if (this.location == null)
|
||||
{
|
||||
// get the initial location from the client config
|
||||
String initialLocation = clientConfig.getInitialLocation();
|
||||
if (initialLocation == null || initialLocation.length() == 0)
|
||||
{
|
||||
initialLocation = LOCATION_HOME;
|
||||
}
|
||||
processToolbarLocation(initialLocation, false);
|
||||
// get the initial location from the user preferences
|
||||
processToolbarLocation(this.preferences.getStartLocation(), false);
|
||||
}
|
||||
|
||||
return this.location;
|
||||
@@ -798,10 +801,10 @@ public class NavigationBean
|
||||
private static Logger s_logger = Logger.getLogger(NavigationBean.class);
|
||||
|
||||
/** constant values used by the toolbar location modelist control */
|
||||
static final String LOCATION_COMPANY = "companyhome";
|
||||
static final String LOCATION_HOME = "userhome";
|
||||
static final String LOCATION_GUEST = "guesthome";
|
||||
static final String LOCATION_MYALFRESCO = "myalfresco";
|
||||
public static final String LOCATION_COMPANY = "companyhome";
|
||||
public static final String LOCATION_HOME = "userhome";
|
||||
public static final String LOCATION_GUEST = "guesthome";
|
||||
public static final String LOCATION_MYALFRESCO = "myalfresco";
|
||||
|
||||
private static final String MSG_MYALFRESCO = "my_alfresco";
|
||||
|
||||
@@ -828,6 +831,9 @@ public class NavigationBean
|
||||
/** Client configuration object */
|
||||
protected ClientConfigElement clientConfig = null;
|
||||
|
||||
/** The user preferences bean reference */
|
||||
protected UserPreferencesBean preferences;
|
||||
|
||||
/** Cached path to our CIFS server and top level node DIR */
|
||||
private String cifsServerPath;
|
||||
|
||||
|
66
source/java/org/alfresco/web/bean/UserPreferencesBean.java
Normal file
66
source/java/org/alfresco/web/bean/UserPreferencesBean.java
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.model.SelectItem;
|
||||
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.repository.PreferencesService;
|
||||
|
||||
/**
|
||||
* Simple bean backing the user preferences settings.
|
||||
*
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public class UserPreferencesBean
|
||||
{
|
||||
private static final String PREF_STARTLOCATION = "start-location";
|
||||
private static final String MSG_MYALFRESCO = "my_alfresco";
|
||||
private static final String MSG_MYHOME = "my_home";
|
||||
private static final String MSG_COMPANYHOME = "company_home";
|
||||
private static final String MSG_GUESTHOME = "guest_home";
|
||||
|
||||
|
||||
public String getStartLocation()
|
||||
{
|
||||
String location = (String)PreferencesService.getPreferences().getValue(PREF_STARTLOCATION);
|
||||
if (location == null)
|
||||
{
|
||||
// default to value from client config
|
||||
location = Application.getClientConfig(FacesContext.getCurrentInstance()).getInitialLocation();
|
||||
}
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setStartLocation(String location)
|
||||
{
|
||||
PreferencesService.getPreferences().setValue(PREF_STARTLOCATION, location);
|
||||
}
|
||||
|
||||
public SelectItem[] getStartLocations()
|
||||
{
|
||||
ResourceBundle msg = Application.getBundle(FacesContext.getCurrentInstance());
|
||||
return new SelectItem[] {
|
||||
new SelectItem(NavigationBean.LOCATION_MYALFRESCO, msg.getString(MSG_MYALFRESCO)),
|
||||
new SelectItem(NavigationBean.LOCATION_HOME, msg.getString(MSG_MYHOME)),
|
||||
new SelectItem(NavigationBean.LOCATION_COMPANY, msg.getString(MSG_COMPANYHOME)),
|
||||
new SelectItem(NavigationBean.LOCATION_GUEST, msg.getString(MSG_GUESTHOME))};
|
||||
}
|
||||
}
|
@@ -125,6 +125,14 @@ public class DashboardWizard extends BaseWizardBean
|
||||
// ------------------------------------------------------------------------------
|
||||
// Dashboard Wizard bean getters
|
||||
|
||||
/**
|
||||
* @return true to allow the Guest user to configure the dashboard, false otherwise
|
||||
*/
|
||||
public boolean getAllowGuestConfig()
|
||||
{
|
||||
return DashboardManager.getDashboardConfig().getAllowGuestConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The currently selected layout ID - used by the Dynamic Description component
|
||||
*/
|
||||
|
Reference in New Issue
Block a user