cancel
Showing results for 
Search instead for 
Did you mean: 

Login to Document Library

rob88silva
Champ in-the-making
Champ in-the-making
Hi guys…
I need to change my homepage to be the sites Document Library. In other words, after the users sucefully login I want them to go straight to the Document Library page.

how can I do this?
4 REPLIES 4

jonash
Champ in-the-making
Champ in-the-making
You can modify site-index.jsp (in the root of the share webapp) to redirect to the document library instead of the user's dashboard.

rob88silva
Champ in-the-making
Champ in-the-making
Hi again,
I'm kind of new to this all, so can you tell me where do I need to change this?

my site name is MCEL and  y site-index.jsp looks like this:

<%@ 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().getPage("user/" + userid + "/dashboard") == null)
   {
      // 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");
   if (siteName == null || siteName.length() == 0)
   {
      // forward to user specific dashboard page
      response.sendRedirect(request.getContextPath() + "/page/user/" + URLEncoder.encode(userid) + "/dashboard");
   }
   else
   {
      // forward to site specific dashboard page
      response.sendRedirect(request.getContextPath() + "/page/site/" + URLEncoder.encode(siteName) + "/dashboard");
   }
%>

jonash
Champ in-the-making
Champ in-the-making
Change the line


response.sendRedirect(request.getContextPath() + "/page/user/" + URLEncoder.encode(userid) + "/dashboard");

to


response.sendRedirect(request.getContextPath() + "/page/site/MCEL/documentlibrary");

This should redirect everyone to the MCEL site document library on login.

rob88silva
Champ in-the-making
Champ in-the-making
Thank you very nuch  Smiley Very Happy