cancel
Showing results for 
Search instead for 
Did you mean: 

Plantilla para usuarios

gousak
Champ in-the-making
Champ in-the-making
Hola buenas tardes,
Como puede configurar alfresco para que al iniciar sesion un usuario, la pagina inicial de mi alfresco tenga una forma u otra?
Muchas gracias
1 REPLY 1

psantis
Confirmed Champ
Confirmed Champ
hola debes modificar el archivo site-index.jsp que se encuantra en la ruta /Alfresco/tomcat/webapps/share

y es algo mas o menos asi:

<%@ 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");
   siteName = "MI-SITIO";
   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");