How to Change the Alfresco Share Landing Page to Document Library page for all Users

cancel
Showing results for 
Search instead for 
Did you mean: 
Member II

How to Change the Alfresco Share Landing Page to Document Library page for all Users

Hi, we're using enterprise edition of Alfresco 5.2 Share. Here we want to redirect the users to document library page rather dashboard of enterprise site. After making below changes and build the project when i login I get the error screen “Back to My Dashboard” button redirects unprivileged users to their own home page(dashboard page). What could be issue here..please advise.

PS: When the admin is already a member to private site then he should be to login without error. What changes would need to be made to verify site membership and only redirect site members to the new document library page. 

<!-- // site-index.jsp -->

<%@ page import="org.alfresco.web.site.*" %>
<%@ page import="org.springframework.extensions.surf.*" %>
<%@ page import="org.springframework.extensions.surf.site.*" %>
<%@ page import="org.springframework.extensions.surf.util.*" %>
<%@ page import="java.util.*" %>

<%
   <!-- // retrieve user name from the session -->
   String userid = (String)session.getAttribute(SlingshotUserFactory.SESSION_ATTRIBUTE_KEY_USER_ID);
   <!-- // test user dashboard page exists? -->
   RequestContext context = (RequestContext)request.getAttribute(RequestContext.ATTR_REQUEST_CONTEXT);
   if (!context.getObjectService().hasPage("user/" + userid + "/dashboard"))
   {
   <!-- // no user dashboard page found! create initial dashboard for this user... -->
      Map<String, String> tokens = new HashMap<String, String>();
      tokens.put("userid", userid);
      FrameworkUtil.getServiceRegistry().getPresetsManager().constructPreset("user-dashboard", tokens);
   }
   
   <!-- // redirect to site or user dashboard as appropriate -->
   <!-- // String siteName = request.getParameter("site"); -->
   siteName = "enterprise";
   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) + "/documentlibrary");
   }
%>

Capture.PNG

 

  

1 Reply
Moderator
Moderator

Re: How to Change the Alfresco Share Landing Page to Document Library page for all Users

There is already a post here: https://hub.alfresco.com/t5/alfresco-content-services-forum/how-to-change-the-alfresco-share-landing...

Dont create duplicate posts.

~Abhinav
(ACSCE, AWS SAA-C02, GAIQ)