/share/site_index.jsp







Presets에 정의된 컴포넌트가 생성되는 시점을 못찾아서 삽질을 했었는데, 드디어 발견했다.






[installLocation]\tomcat\webapps\share\sire_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().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");



}



%>










위의 소스에서 수행하는 작업은 "userid"를 세션에서 조회하여 해당 페이지가 존재하는지를 체크하고 없다면 "PresetsManager"를 통해서 "preset"를 구성한다. 그 후, 해당 페이지로 리다이렉트,,,






가장 중요한건


FrameworkUtil.getServiceRegistry().getPresetsManager().constructPreset("user-dashboard", tokens);


를 발견했다거...











댓글

가장 많이 본 글