2.1.4. Skin service

The skin service of GateIn 3.5 manages various types of skins. This service is responsible for discovering and deploying the skins into the portal.

This section consists of the following topics:

Skin configuration

GateIn 3.5 automatically discovers web archives that contain a file descriptor for skins (WEB-INF/gatein-resources.xml). This file is responsible for specifying the portal, portlet and window decorators to be deployed into the skin service.

The full schema can be found in the lib directory: http://www.gatein.org/xml/ns/gatein_resources_1_3.

Here is an example where a skin (MySkin) with its CSS location is defined, and a few window decorator skins are specified:


<gatein-resources>
  <portal-skin>
    <skin-name>MySkin</skin-name>
    <css-path>/skin/myskin.css</css-path>
    <overwrite>false</overwrite>
  </portal-skin>
</gatein-resources>

<!-- window style -->
<window-style>
    <style-name>MyThemeCategory</style-name>
    <style-theme>
        <theme-name>MyThemeBlue</theme-name>
    </style-theme>
    <style-theme>
        <theme-name>MyThemeRed</theme-name>
    </style-theme>
    ...

Resource Request Filter

Because of the Right-To-Left support, all CSS files need to be retrieved through a Servlet filter and the web application needs to be configured to activate this filter. This is already done for the eXoResources.war web application which contains the default skin.

Any new web applications containing skinning CSS files will need to have the following added to their web.xml.


<filter>
    <filter-name>ResourceRequestFilter</filter-name>
    <filter-class>org.exoplatform.portal.application.ResourceRequestFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>ResourceRequestFilter</filter-name>
    <url-pattern>*.css</url-pattern>
</filter-mapping>

Note

The display-name element also needs to be specified in the web.xml for the skinning service to work properly with the web application.

Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus