cancel
Showing results for 
Search instead for 
Did you mean: 

Site dashboard is not getting set as default home page

Isha
Champ in-the-making
Champ in-the-making

Hi,

I can see the below code in site-index.jsp..I want to have dynamic site dashboard as the default homepagepage once the user login to alfresco.

But in below code siteName is getting null so it is redirecting to alfresco home page only. kindly suggest how can I get different sites for users dynamically and set it as home page

// redirect to site or user dashboard as appropriate
String siteName = request.getParameter("site");
if (siteName == null || siteName.length() == 0)
{
// Get and forward to user's home page
SlingshotUserFactory slingshotUserFactory =
(SlingshotUserFactory) FrameworkUtil.getServiceRegistry().getUserFactory();
String userHomePage = slingshotUserFactory.getUserHomePage(context, userid);
response.sendRedirect(request.getContextPath() + userHomePage);
}
else
{
// forward to site specific dashboard page
response.sendRedirect(request.getContextPath() + "/page/site/" + URLEncoder.encode(siteName));
}

4 REPLIES 4

angelborroy
Community Manager Community Manager
Community Manager

Is this feature what are you looking for?

https://docs.alfresco.com/5.1/tasks/set-homepage.html

Hyland Developer Evangelist

Isha
Champ in-the-making
Champ in-the-making

Thanks for the link .But I want admin to set default homepage for all the users. 

for Example if user1 has assigned site1 then he should be able to view site1 dashboard after login.

if user2 has assigned site2 then he shoud be able to view site2 dashboard.

Hi,

What if one user assigned  to multiple site?

Isha
Champ in-the-making
Champ in-the-making

If user has multiple site then we can fetch any site and set it as homepage. But where to set all this that i am not getting.