In this tutorial you will see how to make a page the default landing page.
Surf supports the notion of a default page which is defined in the configuration for the entire website. By default the landing page is site-index.jsp, which redirects to the authenticated user's dashboard page. The site default landing page will be rendered when a request is mapped to the Spring MVC RequestDispatcher (which by default is at /page and /p) but no page is included in the request, for example, /share/page. This is also configured as the welcome-file in the Share web.xml file.
To change the landing page for the application, you can override the default site configuration for Alfresco Share. The site configuration used is defined in surf.xml and is set to slingshot.site.configuration by default.
- This tutorial assumes you have generated an All-In-One SDK 3.0 Project.
- Create a folder called configurations in aio/aio-share-jar/src/main/resources/alfresco/web-extension/site-data
In the configurations folder create a file called
slingshot.site.configuration.xml, with the following
<configuration> <source-id>site</source-id> <properties> <root-page>home-page</root-page> </properties> </configuration>Important: Note that the file is located on the web-extension path so that it is resolved before the Share default.
The implementation of this sample is now done, build and start the application
server as follows:
/all-in-one$ mvn clean install alfresco:run
Load the page http://localhost:8080/share.
After logging in your new landing page will be displayed.