2
我在我的項目中遇到的問題之一是如何在登錄到Alfresco後將用戶重定向到您的特定站點。我在Alfresco論壇上找到的解決方案可以在下面看到。如何在登錄後重定向站點成員
我在我的項目中遇到的問題之一是如何在登錄到Alfresco後將用戶重定向到您的特定站點。我在Alfresco論壇上找到的解決方案可以在下面看到。如何在登錄後重定向站點成員
你需要修改位於站點index.jsp文件「\ Alfrescoe \ tomcat的\的webapps \共享」,這裏的代碼解決方案,我在露天論壇發現:
<%@ 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/site/TestSiteExample1/documentlibrary");
}
else
{
// forward to site specific dashboard page
response.sendRedirect(request.getContextPath() + "/page/site/" + URLEncoder.encode(siteName) + "/dashboard");
}
%>