04-25-2012 11:13 PM
<%@ 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");
// forward to Example site
siteName = "Example";
response.sendRedirect(request.getContextPath() + "/page/site/" + URLEncoder.encode(siteName) + "/dashboard");
%>
05-29-2014 07:47 PM
<?xml version="1.0" encoding="UTF-8"?>
<template-type>
<title>Site index landing page template type</title>
<description>Site index landing page JSP Template Type</description>
<!– Define the rendering processors for this template type –>
<processor mode="view">
<id>jsp</id>
<jsp-path>/custom-site-index.jsp</jsp-path>
</processor>
</template-type>
<% response.sendRedirect(request.getContextPath() + "/page/site/ourcompany/documentlibrary"); %>
<?xml version="1.0" encoding="UTF-8"?>
<template-type>
<title>Site index landing page template type</title>
<description>Site index landing page JSP Template Type</description>
<!– Define the rendering processors for this template type –>
<processor mode="view">
<id>jsp</id>
<jsp-path>/jsp/custom-site-index.jsp</jsp-path>
</processor>
</template-type>
|– pom.xml
`– src/main
|– amp
| |– module.properties
| `– web/jsp
| `– custom-site-index.jsp
`– resources/alfresco
|– site-data
| |– configurations
| | `– custom.slingshot.site.configuration.xml
| |– pages
| | `– custom-site-index.xml
| |– template-instances
| | `– custom-site-index.xml
| `– template-types
| `– custom-site-index.xml
`– web-extension
`– share-config-custom.xml
<page>
<template-instance>custom-site-index</template-instance>
<authentication>user</authentication>
</page>
<template-instance>
<template-type>custom-site-index</template-type>
</template-instance>
<% response.sendRedirect(request.getContextPath() + "/page/site/foo/documentlibrary"); %>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.