Site Configuration Reference

From bemoko developer wiki

Jump to: navigation, search

Default Site Configuration

<?xml version="1.0" encoding="UTF-8"?>
<!-- 
  bemokoLive default site configuration file
 -->
<site characterEncoding="utf-8">
  <!-- 
      Plugin configuration
    -->
  <content-sources>
    <source name="AccessLogger" plugin="AccessLoggerPlugin" scope="site"/>
  </content-sources>
 
  <!-- 
      Data source configuration
   -->  
  <datasource>
    <mode>${platform.datasource.mode}</mode>
    <jndiName>${platform.datasource.jndi.name}</jndiName>
    <prefix>site</prefix>
  </datasource>  
 
  <!-- 
       HTTP Header configuration - default response headers so send 
    -->
  <headers>
    <header name="Cache-Control" value="no-transform"/>
    <header name="Cache-Control" value="no-cache" expr="!(uri.endsWith('.css') || uri.endsWith('.js') || uri.endsWith('.gif') || uri.endsWith('.png') || uri.endsWith('.jpg') || uri.endsWith('.ico') || uri.startsWith('/lib/') || uri.startsWith('/media/') )"/>
    <header name="Cache-Control" value="max-age=3600" expr="uri.endsWith('.css') || uri.endsWith('.js') || uri.endsWith('.gif') || uri.endsWith('.png') || uri.endsWith('.jpg') || uri.endsWith('.ico') || uri.startsWith('/lib/') || uri.startsWith('/media/')"/>
  </headers>
 
  <!-- 
      Intent configuration
    -->
  <intents>
    <intent name="r" type="resource" />
  </intents>
 
  <!-- 
      Default ui configuration 
      falls back to default "mobile" ui
    -->
  <uigroup default="unknown" index="i">
    <!-- Primary matches for special cases-->
 
    <!-- iPhone -->
    <ui name="iphone" expr="device.vendor=='Apple'" fallback="ajax" />
 
    <!-- PC browsers -->
    <ui name="pc" expr="!device.isMobile"/>
 
    <!-- Screen width fallback chain -->
    <!-- At least 480px screen width with good css -->
    <ui name="480" expr="device.displayWidth ge 480" fallback="320" />
    <!-- Widescreen devices at least 320px wide -->
    <ui name="320wide" expr="device.displayWidth gt 320 and device.displayWidth gt device.displayHeight" fallback="320" />
    <!-- At least 320px screen width with good css -->
    <ui name="320" expr="device.displayWidth ge 320" fallback="240" />
    <!-- At least 240px screen width with good css -->
    <ui name="240" expr="device.displayWidth ge 240" fallback="208" />
    <!-- At least 208px screen width with good css -->
    <ui name="208" expr="device.displayWidth ge 208" fallback="176" />
    <!-- At least 176px screen width with good css -->
    <ui name="176" expr="device.displayWidth ge 176" fallback="128" />
    <!-- At least 128px screen width with good css -->
    <ui name="128" expr="device.displayWidth lt 176" fallback="root" />
 
    <!-- All unknown devices -->
    <ui name="unknown" fallback="128" />
  </uigroup>
 
  <!-- 
      MIME types to run through templating engine 
    -->
  <templatable-mimetypes>
    <!-- Javascript is templated unless it is not in the lib directory or it is in the "lib/site" directory -->
    <mimetype name="text/javascript" expr="!uri.startsWith('/lib/') || uri.startsWith('/lib/dynamic/')"/>
    <mimetype name="application/json" expr="!uri.startsWith('/lib/') || uri.startsWith('/lib/dynamic/')" />
    <mimetype name="text/cache-manifest" />
    <mimetype name="text/css" expr="!uri.startsWith('/lib/') || uri.startsWith('/lib/dynamic/')" />
    <mimetype name="text/html" expr="!uri.startsWith('/lib/') || uri.startsWith('/lib/dynamic/')" />
    <mimetype name="text/plain" />
    <mimetype name="text/xml" />
  </templatable-mimetypes>
 
  <!-- 
      Security configuration 
    -->
  <security>
    <!-- authentication-cookie values
      maxage: Age of cookie in seconds from the point it is received by client.
        Default value is 0, meaning cookie will only last the length of a browser session.
      domain: Cookie domain. Only needed if dealing with cross-domain cookies
      path:   Cookie path. Default value is /deploymentcontext/sitename. 
     -->
     <authentication-cookie maxage="63072000" /> <!-- 2 years -->
     <authentication-key maxage="63072000"/>
  </security>
 
  <!-- 
      MIME types to run through the tweaker engine 
    -->
  <tweakable-mimetypes>
    <mimetype name="text/html" />
    <mimetype name="application/xhtml+xml" />
    <mimetype name="application/vnd.wap.xhtml+xml" />
  </tweakable-mimetypes>  
 
  <!--  
      Default markup tweakers 
    -->
  <tweakers>
    <tweaker plugin="AbsoluteUrlRewriter" />
    <tweaker plugin="ReportWriter" expr="!profile.prod" />
    <tweaker plugin="MetaHttpEquiv" />
  </tweakers> 
</site>
 
</site>