04-28-2020 07:43 AM
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));
}
04-28-2020 11:53 AM
Is this feature what are you looking for?
https://docs.alfresco.com/5.1/tasks/set-homepage.html
04-29-2020 01:44 AM
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.
04-29-2020 02:14 AM
Hi,
What if one user assigned to multiple site?
04-29-2020 03:21 AM
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.
Explore our Alfresco products with the links below. Use labels to filter content by product module.