cancel
Showing results for 
Search instead for 
Did you mean: 

Site dashboard as welcome page

anakin59490
Star Contributor
Star Contributor

Hi,

after the login step i would like to have my dasboard site as welcome page

http://localhost:8080/share/page/site/documed/dashboard 

So i try to use slingshot.site.configuration.xml file (Making the new page the default | Alfresco Documentation

without succes :

Thank's in advance

6 REPLIES 6

krutik_jayswal
Elite Collaborator
Elite Collaborator

Was having similar issue, resolved it by modifying the site-index.jsp, below is code for same.bold letter contains the name of site

<%@ 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().hasPage("user/" + userid + "/dashboard"))
{
// 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/{NAME OF SITE}/dashboard");

}
else
{
// forward to site specific dashboard page
response.sendRedirect(request.getContextPath() + "/page/site/" + URLEncoder.encode(siteName) + "/dashboard");
}
%>

Great ! I run an embedded Tomcat on sdk 3 architecture. Where can i place this code ?

I think \src\main\resources\META-INF\resources

Ok, so i have created site-index.jsp file with your code in \src\main\resources\META-INF\resources and i have deleted slingshot.site.configuration.xml file but it doesn't work.

i try to move site-index.jsp in  \src\main\resources\META-INF\resources\project-share-jar without succes...

I have made new test by adding a new slingshot.site.configuration.xml in site-data\configurations :

<configuration>
<source-id>site</source-id>
<properties>
<root-page>site-index</root-page>
</properties>
</configuration>

 but it still doesn't work

Other configurations are not required, you only need to override site-index.jsp.

anakin59490
Star Contributor
Star Contributor

ok than you, this is what i have done :

- i have deleted configurations folder

- I have added a log trace to know if the file is loaded

But it doesn't work...

The site name is ok : 

The user is well affected to this site

I don't know....

I'm going to try by moving site-index.jsp file in other folder

Thx in advance for your help