Making the new page the default - Alfresco Content Services - 23.4 - 23.4 - Ready - Alfresco - external

Alfresco Content Services

Platform
Alfresco
Product
Alfresco Content Services
Release
23.4
License

This tutorial demonstrates how to make the new page you created in the previous tutorial the default landing page.

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.

  1. This tutorial assumes you have created a new SDK All-In-One project.
  2. Create a folder called configurations in aio/aio-share-jar/src/main/resources/alfresco/web-extension/site-data
  3. In the configurations folder create a file called slingshot.site.configuration.xml, with the following contents:
    <configuration>
        <source-id>site</source-id>
        <properties>
            <root-page>home-page</root-page>
        </properties>
    </configuration>
    
    Note: The file is located on the web-extension path so that it is resolved before the Share default.
  4. The implementation of this sample is now done, build and start the application server as follows:
    /all-in-one$ ./run.sh build_start
    
  5. Load the page http://localhost:8080/share. After logging in your new landing page will be displayed.