Current status of Foundry

git-svn-id: https://svn.libreccm.org/ccm/trunk@2870 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-09-21 16:46:27 +00:00
parent 27a4153e84
commit c94a9f8a2a
15 changed files with 468 additions and 109 deletions

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<foundry:configuration xmlns:foundry="http://foundry.libreccm.org">
<supported-languages default="de">
<language locale="de"/>
<language locale="en"/>
</supported-languages>
</foundry:configuration>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<applications>
<default>default-layout.xml</default>
</applications>

View File

@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stylesheet>
<!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation

View File

@ -54,10 +54,10 @@ processor, some are read from the configuration files of Foundry and some are de
<xsl:param name="theme-prefix"/>
<foundry:doc section="devel">
<foundry:doc-dec>
<foundry:doc-desc>
The context prefix in which CCM is installed. If CCM is installed into the ROOT context
of the servlet container, this variable will be empty.
</foundry:doc-dec>
</foundry:doc-desc>
</foundry:doc>
<xsl:param name="context-prefix"/>
@ -113,6 +113,11 @@ processor, some are read from the configuration files of Foundry and some are de
</foundry:doc>
<xsl:param name="negotiated-language"/>
<!-- Temporary workaround until https://redmine.libreccm.org/issues/2186 is decided -->
<xsl:variable name="lang">
<xsl:value-of select="negoitated-language"/>
</xsl:variable>
<!--<foundry:doc section="devel">
<foundry:doc-desc>
The languages supported by this theme. Set in the <code>global.xml</code> configuration
@ -126,23 +131,23 @@ processor, some are read from the configuration files of Foundry and some are de
<foundry:doc section="devel">
<foundry:doc-desc>
The languages supported by this theme. They are configured in
<code>settings/global.xml</code> using the <code>&lt;supported-languages&gt;</code>
<code>conf/global.xml</code> using the <code>&lt;supported-languages&gt;</code>
element. Example for german and english:
<pre>
&lt;?xml version="1.0"?&gt;
&lt;settings&gt;
&lt;foundry:configuration&gt;
&hellip;
&lt;supported-languages default="de"&gt;
&lt;language locale=de"&gt;
&lt;language locale=en"&gt;
&lt;/supported-languages&gt;
&hellip;
&lt;/settings&gt;
&lt;/foundry:configuration&gt;
</pre>
</foundry:doc-desc>
</foundry:doc>
<xsl:variable name="supported-languages"
select="document(concat($theme-prefix, 'settings/global.xml'))/settings/supported-languages"/>
select="document(concat($theme-prefix, '/conf/global.xml'))/foundry:configuration/supported-languages"/>
<foundry:doc section="devel">
<foundry:doc-desc>

View File

@ -23,8 +23,10 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:cms="http://www.arsdigita.com/cms/1.0"
xmlns:foundry="http://foundry.libreccm.org"
xslns:func="http://exslt.org/functions"
xmlns:func="http://exslt.org/functions"
xmlns:nav="http://ccm.redhat.com/navigation"
xmlns:ui="http://www.arsdigita.com/ui/1.0"
version="1.0">
@ -193,7 +195,7 @@
on a HTML element.
</foundry:doc-desc>
</foundry:doc>
<xsl:template name="mandalay:set-id-and-class">
<xsl:template name="foundry:set-id-and-class">
<xsl:param name="current-layout-node" select="."/>
<xsl:variable name="cond-class">

View File

@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stylesheet>
<!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
@ -22,7 +22,10 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:import href="template-tags/data-tags.xsl"/>
<xsl:import href="template-tags/html-tags.xsl"/>
<xsl:import href="template-tags/loaders.xsl"/>
<xsl:import href="template-tags/navigation.xsl"/>
<xsl:import href="template-tags/subsite.xsl"/>
</xsl:stylesheet>

View File

@ -21,20 +21,20 @@
<!-- This file contains several template tags which output data from the result tree -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:foundry="http://foundry.libreccm.org"
xslns:func="http://exslt.org/functions"
xmlns:func="http://exslt.org/functions"
version="1.0">
<foundry:doc section="user"
type="template-tag">
<foundry:doc-desc>
Outputs the title of the current page. For a content item, this is
the title of the content item. For more details please refer to
the documentation of the <code>foundry:title</code> function.
</foundry:doc-desc>
<foundry:doc-see-also>#foundry:title</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="show-page-title">
<xsl:choose>
<xsl:when test="name(./..) = 'title'">
<xsl:value-of select="foundry:title()"/>
</xsl:when>
<xsl:otherwise>
<h1>
<xsl:value-of select="foundry:title"/>
</h1>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<foundry:doc section="user"
@ -63,12 +63,12 @@
<xsl:choose>
<xsl:when test="@id != '' or @class != '' or with-colorset = 'true'">
<span>
<xsl:call-template name="foundry-set-id-and-class"/>
<xsl:value-of select="foundry:get-static-text(.)"/>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:value-of select="foundry:get-static-text('', .)"/>
</span>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="foundry:get-static-text(.)"/>
<xsl:value-of select="foundry:get-static-text('', .)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

View File

@ -38,22 +38,34 @@
<xsl:template match="a">
<a>
<xsl:if test="./@download">
<xsl:attribute name="download" select="./@download"/>
<xsl:attribute name="download">
<xsl:value-of select="./@download"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="./@href-property">
<xsl:attribute name="href" select="$data-tree/*[name = ./@href-property]"/>
<xsl:attribute name="href">
<xsl:value-of select="$data-tree/*[name = ./@href-property]"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="./@href-static">
<xsl:attribute name="href" select="./@href-static"/>
<xsl:attribute name="href">
<xsl:value-of select="./@href-static"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="./@hreflang">
<xsl:attribute name="hreflang" select="./@hreflang"/>
<xsl:if test="./@href-lang">
<xsl:attribute name="hreflang">
<xsl:value-of select="./@href-lang"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="./@rel">
<xsl:attribute name="rel" select="./@rel"/>
<xsl:attribute name="rel">
<xsl:value-of select="./@rel"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="./@type">
<xsl:attribute name="type" select="./@type"/>
<xsl:attribute name="type">
<xsl:value-of select="./@type"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
@ -88,8 +100,9 @@
<xsl:call-template name="foundry:set-id-and-class"/>
<span id="top"/>
<a href="#startcontent" accesskey="S" class="nav-hide">
<xsl:attribute name="title"
select="foundry:get-static-text('layout/page/skipnav/title')"/>
<xsl:attribute name="title">
<xsl:value-of select="foundry:get-static-text('layout/page/skipnav/title')"/>
</xsl:attribute>
<xsl:value-of select="foundry:get-static-text('layout/page/skipnav/link')"/>
</a>
<xsl:apply-templates/>
@ -127,7 +140,7 @@
<xsl:if test="normalize-space($divContent)">
<div>
<xsl:call-template name="mandalay:set-id-and-class"/>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</div>
</xsl:if>
@ -135,32 +148,32 @@
<xsl:template match="h1">
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply:templates/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="h2">
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply:templates/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="h3">
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply:templates/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="h4">
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply:templates/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="h5">
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply:templates/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="h6">
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply:templates/>
<xsl:apply-templates/>
</xsl:template>
<foundry:doc section="user" type="template-tag">
@ -173,7 +186,7 @@
</foundry:doc>
<xsl:template match="footer">
<footer>
<xsl:call-template name="mandalay:set-id-and-class"/>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</footer>
</xsl:template>
@ -196,8 +209,9 @@
</xsl:attribute>
</meta>
<!-- EN These meta informations are needed to get Level 3 WAI -->
<!-- These meta informations are needed to get Level 3 WAI -->
<meta name="language" content="{$language}"/>
<!-- ToDo
<meta name="keywords">
<xsl:attribute name="content">
<xsl:call-template name="foundry:keywords"/>
@ -207,11 +221,11 @@
<xsl:attribute name="content">
<xsl:call-template name="foundry:description"/>
</xsl:attribute>
</meta>
</meta>-->
<xsl:apply-templates/>
<xsl:call-template name="bebop:double-click-protection"/>
<!-- Not implemented yet <xsl:call-template name="bebop:double-click-protection"/> -->
<xsl:apply-templates select="$data-tree//script"/>
<!--
@ -234,7 +248,7 @@
</foundry:doc>
<xsl:template match="header">
<header>
<xsl:call-template name="mandalay:set-id-and-class"/>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</header>
</xsl:template>
@ -242,7 +256,9 @@
<xsl:template match="img">
<img>
<xsl:if test="./@href-property">
<xsl:attribute name="href" select="$data-tree/*[name = ./@href-property]"/>
<xsl:attribute name="href">
<xsl:value-of select="$data-tree/*[name = ./@href-property]"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="./@href-static">
<xsl:attribute name="href">
@ -251,7 +267,7 @@
<xsl:value-of select="./@href-static"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($theme-prefix, ./@href-static"/>
<xsl:value-of select="concat($theme-prefix, ./@href-static)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
@ -289,7 +305,7 @@
</foundry:doc>
<xsl:template match="main">
<main>
<xsl:call-template name="mandalay:set-id-and-class"/>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</main>
</xsl:template>
@ -334,14 +350,14 @@
</foundry:doc>
<xsl:template match="nav">
<nav>
<xsl:call-template name="mandalay:set-id-and-class"/>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</nav>
</xsl:template>
<xsl:template match="p">
<p>
<xsl:call-template name="mandalay:set-id-and-class"/>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</p>
</xsl:template>
@ -423,7 +439,7 @@
</foundry:doc>
<xsl:template match="section">
<section>
<xsl:call-template name="mandalay:set-id-and-class"/>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</section>
</xsl:template>
@ -438,7 +454,7 @@
</foundry:doc>
<xsl:template match="span">
<span>
<xsl:call-template name="mandalay:set-id-and-class"/>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</span>
</xsl:template>

View File

@ -31,7 +31,7 @@
type="template-tag">
<foundry:doc-desc>
Invokes the foundry CSS loader. The CSS loader will parse the file
<code>settings/css-files.xml</code> to determine for which CSS an
<code>conf/css-files.xml</code> to determine for which CSS an
<code>&lt;link&gt;</code> element should be added to the HTML output. For a full
explanation please refer to the <a href="#user_css-files">CSS files section</a>.
</foundry:doc-desc>
@ -39,11 +39,11 @@
<xsl:template match="load-css-files">
<xsl:variable name="application">
<xsl:choose>
<xsl:when test="$resultTree/@application">
<xsl:value-of select="$resultTree/@application"/>
<xsl:when test="$data-tree/@application">
<xsl:value-of select="$data-tree/@application"/>
</xsl:when>
<xsl:when test="$resultTree/@class">
<xsl:value-of select="$resultTree/@class"/>
<xsl:when test="$data-tree/@class">
<xsl:value-of select="$data-tree/@class"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'none'"/>
@ -52,8 +52,8 @@
</xsl:variable>
<xsl:choose>
<xsl:when test="document(concat($theme-prefix, '/settings/css-files.xml'))/css-files/application[@name=$application]">
<xsl:for-each select="document(concat($theme-prefix, '/settings/css-files.xml'))/css-files/application[@name=$application]/css-file">
<xsl:when test="document(concat($theme-prefix, '/conf/css-files.xml'))/css-files/application[@name=$application]">
<xsl:for-each select="document(concat($theme-prefix, '/conf/css-files.xml'))/css-files/application[@name=$application]/css-file">
<xsl:call-template name="foundry:load-css-file">
<xsl:with-param name="filename" select="."/>
<xsl:with-param name="media" select="./@media"/>
@ -61,7 +61,7 @@
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="document(concat($theme-prefix, '/settings/css-files.xml'))/css-files/default/css-file">
<xsl:for-each select="document(concat($theme-prefix, '/conf/css-files.xml'))/css-files/default/css-file">
<xsl:call-template name="foundry:load-css-file">
<xsl:with-param name="filename" select="."/>
<xsl:with-param name="media" select="./@media"/>
@ -75,8 +75,8 @@
conditional comments in the other CSS files instead? -->
<xsl:if test="$msie_version >= '5' and $msie_version &lt; '7'">
<xsl:choose>
<xsl:when test="document(concat($theme-prefix, '/settings/css-files.xml'))/css-files/application[@name=$application]">
<xsl:for-each select="document(concat($theme-prefix, '/settings/css-files.xml'))/css-files/application[@name=$application]/iehacks">
<xsl:when test="document(concat($theme-prefix, '/conf/css-files.xml'))/css-files/application[@name=$application]">
<xsl:for-each select="document(concat($theme-prefix, '/conf/css-files.xml'))/css-files/application[@name=$application]/iehacks">
<xsl:call-template name="foundry:load-css-file">
<xsl:with-param name="filename" select="."/>
<xsl:with-param name="media" select="./@media"/>
@ -84,7 +84,7 @@
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="document(concat($theme-prefix, '/settings/css-files.xml'))/css-files/default/iehacks">
<xsl:for-each select="document(concat($theme-prefix, '/conf/css-files.xml'))/css-files/default/iehacks">
<xsl:call-template name="foundry:load-css-file">
<xsl:with-param name="filename" select="."/>
<xsl:with-param name="media" select="./@media"/>

View File

@ -0,0 +1,189 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stylesheet>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:foundry="http://foundry.libreccm.org"
xmlns:func="http://exslt.org/functions"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:nav="http://ccm.redhat.com/navigation"
exclude-result-prefixes="xsl bebop foundry nav"
version="1.0">
<xsl:template match="navigation-layout">
<xsl:apply-templates>
<xsl:with-param name="navigation-id"
select="foundry:get-attribute-value('navigation-id', 'categoryMenu')"/>
<xsl:with-param name="with-colorset"
select="foundry:get-attribute-value('with-colorset', 'false')"/>
<xsl:with-param name="min-level"
select="foundry:get-attribute-value('min-level', '1')"/>
<xsl:with-param name="max-level"
select="foundry:get-attribute-value('max-level', '999')"/>
<xsl:with-param name="show-description-text"
select="foundry:get-attribute-value('show-description-text', 'true')"/>
<xsl:with-param name="current-level-tree"
select="$data-tree//nav:categoryMenu[@id=foundry:get-attribute-value('navigation-id', 'categoryMenu')]/nav:category/nav:category"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="navigation-layout//navigation-home-link">
<xsl:param name="navigation-id"/>
<xsl:param name="show-description-text"/>
<a href="{$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@url}">
<xsl:attribute name="title">
<xsl:choose>
<xsl:when test="./@show-description-text = 'false'">
<xsl:choose>
<xsl:when test="./@use-static-title = 'false'">
<xsl:value-of select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@title"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="foundry:get-static-text('navigation',
$data-tree//nav:categoryMenu[@id=$navigation-id]/@navigation-id,
'false')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@description"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="foundry:shying($data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@title)"/>
</a>
</xsl:template>
<xsl:template match="navigation-layout//navigation-link-list"
name="navigation-link-list">
<xsl:param name="navigation-id"/>
<xsl:param name="with-colorset"/>
<xsl:param name="min-level"/>
<xsl:param name="max-level"/>
<xsl:param name="show-description-text"/>
<xsl:param name="current-level" select="1"/>
<xsl:param name="current-level-tree"/>
<xsl:param name="navigation-link-layout" select="."/>
<xsl:message>
navigation-link-list applied
</xsl:message>
<xsl:apply-templates>
<xsl:with-param name="navigation-id" select="$navigation-id"/>
<xsl:with-param name="with-colorset" select="$with-colorset"/>
<xsl:with-param name="min-level" select="$min-level"/>
<xsl:with-param name="max-level" select="$max-level"/>
<xsl:with-param name="show-description-text" select="$show-description-text"/>
<xsl:with-param name="current-level" select="$current-level"/>
<xsl:with-param name="current-level-tree" select="$current-level-tree"/>
<xsl:with-param name="navigation-link-layout" select="$navigation-link-layout"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="navigation-link-list//navigation-link-layout">
<xsl:param name="navigation-id"/>
<xsl:param name="with-colorset"/>
<xsl:param name="min-level"/>
<xsl:param name="max-level"/>
<xsl:param name="show-description-text"/>
<xsl:param name="current-level" select="1"/>
<xsl:param name="current-level-tree"
select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/nav:category"/>
<xsl:param name="navigation-link-layout" select="."/>
<dl>
<dt>navigation-id</dt>
<dd><xsl:value-of select="$navigation-id"/></dd>
</dl>
<dt>
<dt>navigation-id</dt>
<dd><xsl:value-of select="$navigation-id"/></dd>
<dt>min-level</dt>
<dd><xsl:value-of select="$min-level"/></dd>
<xsl:value-of select="concat('navigation-id = ', $navigation-id)"/>
<xsl:value-of select="concat('min-level = ', $min-level)"/>
<xsl:value-of select="concat('max-level = ', $max-level)"/>
<xsl:value-of select="concat('current-level = ', $current-level, '; ')"/>
<xsl:value-of select="count($current-level-tree)"/>
</dt>
<xsl:if test="$current-level &gt;= min-level">
<xsl:message>
Processing current level categories...
</xsl:message>
<xsl:apply-templates select="$current-level-tree">
<xsl:with-param name="with-colorset"/>
<xsl:with-param name="show-description-text"/>
<xsl:with-param name="navigation-link-layout" select="$navigation-link-layout"/>
</xsl:apply-templates>
</xsl:if>
<xsl:if test="($current-level &lt; $max-level) and $current-level-tree/nav:category">
<xsl:message>Processing sub level categories</xsl:message>
<xsl:call-template name="navigation-link-list">
<xsl:with-param name="navigation-id" select="$navigation-id"/>
<xsl:with-param name="with-colorset" select="$with-colorset"/>
<xsl:with-param name="min-level" select="$min-level"/>
<xsl:with-param name="max-level" select="$max-level"/>
<xsl:with-param name="show-description-text" select="$show-description-text"/>
<xsl:with-param name="current-level" select="$current-level + 1"/>
<xsl:with-param name="current-level-tree" select="$current-level-tree/nav:category"/>
<xsl:with-param name="navigation-link-layout" select="$navigation-link-layout"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="nav:category">
<xsl:param name="with-colorset"/>
<xsl:param name="show-description-text"/>
<xsl:param name="navigation-link-layout"/>
<xsl:message>nav:category applied</xsl:message>
<xsl:apply-templates select="$navigation-link-layout">
<xsl:with-param name="url" select="./@url"/>
<xsl:with-param name="title" select="./@title"/>
<xsl:with-param name="description" select="./@description"/>
<xsl:with-param name="with-colorset" select="$with-colorset"/>
<xsl:with-param name="show-description-text" select="$show-description-text"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="navigation-link">
<xsl:param name="url"/>
<xsl:param name="title"/>
<xsl:param name="description"/>
<xsl:param name="with-colorset"/>
<xsl:param name="show-description-text"/>
<xsl:message>navigation-link applied</xsl:message>
<a href="{$url}">
<xsl:attribute name="title">
<xsl:choose>
<xsl:when test="$show-description-text = 'true'">
<xsl:value-of select="$description"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="$title"/>
</a>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stylesheet [<!ENTITY nbsp '&#160;'>]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:cms="http://www.arsdigita.com/cms/1.0"
xmlns:foundry="http://foundry.libreccm.org"
xmlns:ui="http://www.arsdigita.com/ui/1.0"
exclude-result-prefixes="xsl bebop cms foundry ui"
version="1.0">
<xsl:template match="subsite-name">
<xsl:variable name="subsite-banner-text">
<xsl:value-of select="foundry:get-static-text('subsite-banner', $data-tree//ui:siteBanner[@bebop:classname='com.arsdigita.subsite.ui.SubSiteBanner']/@sitename)"/>
</xsl:variable>
<xsl:variable name="exclude">
<xsl:value-of select="foundry:get-setting('subsite-banner', concat($data-tree//ui:siteBanner[@bebop:classname='com.arsdigita.subsite.ui.SubSiteBanner']/@sitename, '/exclude'), 'false')"/>
</xsl:variable>
<xsl:if test="$exclude != 'true'">
<xsl:choose>
<xsl:when test="(string-length($subsite-banner-text) &lt; 1) or (contains(subsite-banner-text, 'missing translation'))">
<xsl:value-of select="$data-tree//ui:siteBanner[@bebop:classname='com.arsdigita.subsite.ui.SubSiteBanner']/@sitename"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$subsite-banner-text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@ -26,13 +26,14 @@
EXSLT functions.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:cms="http://www.arsdigita.com/cms/1.0"
xmlns:foundry="http://foundry.libreccm.org"
xslns:func="http://exslt.org/functions"
xmlns:func="http://exslt.org/functions"
xmlns:nav="http://ccm.redhat.com/navigation"
version="1.0">
<foundry:doc section="devel">
<foundry:doc-param name="level"
mandatory="yes">
@ -66,7 +67,7 @@ EXSLT functions.
<xsl:param name="message"/>
<func:result>
<xsl:value-of select="concat('[Foundry', $level', '] ', $message)"/>
<xsl:value-of select="concat('[Foundry ', $level, '] ', $message)"/>
</func:result>
</func:function>
@ -163,11 +164,66 @@ EXSLT functions.
</foundry:doc-see-also>
</foundry:doc>
<func:function name="foundry:message-error">
<xsl:param name="message"/>
<func:result>
<xsl:value-of select="foundry:message('ERROR', $message)"/>
</func:result>
</func:function>
<foundry:doc section="devel">
<foundry:doc-param name="attribute-name"
mandatory="yes">
The attribute to check for.
</foundry:doc-param>
<foundry:doc-param name="default-value"
mandatory="yes">
The default value if the attribute is not set.
</foundry:doc-param>
<foundry:doc-result>
The value of the attribute if it is set on the current element, the
<code>default-value</code> otherwise.
</foundry:doc-result>
<foundry:doc-desc>
<p>
A helper function for retrieving an attribute value from an element. If the attribute is
set on the current element the value of the attribute is used as result. If the
attribute is not set the <code>default-value</code> is used. This method is used
by several layout tags with optional attributes. A common use pattern looks like this:
</p>
<pre>
&lt;xsl:template match="example"&gt;
&lt;xsl:variable name="width"
select="foundry:get-attribute-value('width', '640')" /&gt;
&lt;xsl:variable name="height"
select="foundry:get-attribute-value('height', '480')" /&gt;
/&lt;xsl:template&gt;
</pre>
<p>
In this example, the element <code>example</code> has two optional attributes:
<code>with</code> and <code>height</code>. If the attribute is set in processed XML,
the value set there is used. Otherwise the default value (<code>640</code>
respectively <code>480</code>) is used. Without this function a code block like the
one in the <code>xsl:choose</code> block of this function would be necessary for
each of the variables.
</p>
</foundry:doc-desc>
</foundry:doc>
<func:function name="foundry:get-attribute-value">
<xsl:param name="attribute-name"/>
<xsl:param name="default-value"/>
<func:result>
<xsl:choose>
<xsl:when test="./@*[name() = $attribute-name]">
<xsl:value-of select="./@*[name() = $attribute-name]"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$default-value"/>
</xsl:otherwise>
</xsl:choose>
</func:result>
</func:function>
<foundry:doc section="devel">
<foundry:doc-param name="module"
mandatory="yes">
@ -275,22 +331,21 @@ EXSLT functions.
<func:function name="foundry:get-static-text">
<xsl:param name="module"/>
<xsl:param name="id"/>
<xsl:param name="html" Select="'true'"/>
<xsl:param name="html" select="'true'"/>
<xsl:param name="lang" select="$lang"/>
<func:result>
<xsl:choose>
<xsl:when test="$module = '' and document(concat($theme-prefix}, '/texts/global.xml'))/foundry:staticTexts/text[@id=$id]/translation[@lang = $lang]">
<func:result select="document'{$theme-prefix}/texts/global.xml')/foundry:staticTexts/text[@id=$id]"/>
<xsl:when test="$module = '' and document(concat($theme-prefix, '/texts/global.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang = $lang]">
<xsl:value-of select="document(concat($theme-prefix, '/texts/global.xml'))/foundry:static-texts/text[@id=$id]"/>
</xsl:when>
<xsl:when test="not($module = '') and document(concat($theme-prefix}, '/texts/', $module, '.xml'))/foundry:staticTexts/text[@id=$id]/translation[@lang = $lang]">
<func:result select="document(concat($theme-prefix}, '/texts/', $module, '.xml'))/foundry:staticTexts/text[@id=$id]/translation[@lang = $lang]"/>
<xsl:when test="not($module = '') and document(concat($theme-prefix, '/texts/', $module, '.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang = $lang]">
<xsl:value-of select="document(concat($theme-prefix, '/texts/', $module, '.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang = $lang]"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="foundry:debugEnabled()">
<xsl:when test="foundry:debug-enabled()">
<xsl:choose>
<xsl:when test="$html = 'true'">
<func:result>
<span class="foundry-debug-missing-translation">
<span class="foundry-placeholder">
<xsl:value-of select="$id"/>
@ -298,15 +353,14 @@ EXSLT functions.
<span class="foundry-missing-translation-path">
<xsl:choose>
<xsl:when test="$module = ''">
<xsl:value-of select="concat($theme-prefix, '/texts/global.xml/foundry:staticTexts/text[@id=', $id, ']/translation[@lang=', $lang, ']'"/>
<xsl:value-of select="document(concat($theme-prefix, '/texts/global.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang=$lang]"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'concat($theme-prefix, '/texts/', $module, '.xml/foundry:staticTexts/text[@id=', $id, ']/translation[@lang=', $lang, ']'"/>
<xsl:value-of select="document(concat($theme-prefix, '/texts/', $module, '.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang=$lang]"/>
</xsl:otherwise>
</xsl:choose>
</span>
</span>
</func:result>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$id"/>
@ -316,17 +370,17 @@ EXSLT functions.
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</func:result>
</func:function>
<foundry:doc section="devel">
<foundry:doc-result>
<code>true</code> if the debug mode if active, <code>false</code> otherwise.
</foundry:doc-result>
<foudry:doc-desc>
<foundry:doc-desc>
A helper function to determine if the debug mode should be enabled. The debug mode
of foundry is automatically enabled if the theme is viewed as development theme.
</foudry:doc-desc>
</foundry:doc-desc>
</foundry:doc>
<func:function name="foundry:debug-enabled">
<xsl:choose>
@ -365,7 +419,7 @@ EXSLT functions.
<func:function name="foundry:shying">
<xsl:param name="text"/>
<func:result select="translate($text, '\-', '&shy;'"/>
<func:result select="translate($text, '\-', '&shy;')"/>
</func:function>
@ -376,17 +430,16 @@ EXSLT functions.
<xsl:when test="$data-tree//cms:contentPanel">
<xsl:choose>
<!-- Glossary -->
<xsl:when test="$data-tree/cms:contentPanel/cms:item/type/label = 'Glossary Item'">
<xsl:when test="$data-tree//cms:contentPanel/cms:item/type/label = 'Glossary Item'">
<xsl:value-of select="foundry:get-static-text('layout/page/title/glossary')"/>
</xsl:when>
<!-- FAQ -->
<xsl:when test="$data-tree/cms:contentPanel/cms:item/type/label = 'FAQ Item'">
<xsl:when test="$data-tree//cms:contentPanel/cms:item/type/label = 'FAQ Item'">
<xsl:value-of select="foundry:get-static-text('layout/page/title/faq')"/>
</xsl:when>
<!-- Else use title of CI -->
<xsl:otherwise>
<xsl:value-of select="foundry:shying($data-tree//cms:contentPanel/cms:item/title)"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>

View File

@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stylesheet [<!ENTITY nbsp '&#160;'>]>
<!--
@ -49,16 +49,22 @@
<xsl:variable name="class" select="@class" />
<xsl:choose>
<xsl:when test="document(concat($theme-prefix, '/settings/templates.xml'))/applications/application[@name=$application and @class=$class]">
<xsl:call-template name="foundry:parse-template">
<xsl:when test="document(concat($theme-prefix, '/conf/templates.xml'))/applications/application[@name=$application and @class=$class]">
<xsl:message>
<xsl:value-of select="foundry:message-info('Using application template')"/>
</xsl:message>
<xsl:call-template name="foundry:process-template">
<xsl:with-param name="template-file"
select="document(concat($theme-prefix, '/settings/templates.xml'))/applications/application[@name=$application and @class=$class]"/>
select="document(concat($theme-prefix, '/conf/templates.xml'))/applications/application[@name=$application and @class=$class]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:value-of select="foundry:message-info('Using default layout')"/>
</xsl:message>
<xsl:call-template name="foundry:process-template">
<xsl:with-param name="template-file"
select="document(concat($theme-prefix, '/settings/templates.xml'))/applications/default"/>
select="document(concat($theme-prefix, '/conf/templates.xml'))/applications/default"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
@ -69,11 +75,11 @@
</xsl:template>
<fondry:doc section="devel">
<foundry:doc section="devel">
<foundry:doc-desc>
The entry point for creating Foundry documentation.
</foundry:doc-desc>
</fondry:doc>
</foundry:doc>
<xsl:template match="/foundry:documentation">
<xsl:value-of select="'&lt;!DOCTYPE HTML&gt;'"
disable-output-escaping="yes" />

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<page-layout>
<head>
<title>
<separator>: </separator>
<show-text>layout/page/head/title</show-text>
<show-page-title/>
</title>
</head>
<body>
<nav>
<navigation-layout>
<navigation-home-link/>
<navigation-link-list>
<ul>
<navigation-link-layout>
<li>
<navigation-link/>
</li>
</navigation-link-layout>
</ul>
</navigation-link-list>
</navigation-layout>
</nav>
<main>
<div>
<h1>TEST</h1>
</div>
</main>
</body>
</page-layout>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<foundry:static-texts xmlns:foundry="http://foundry.libreccm.org">
<text id="layout/page/head/title">
<translation lang="de">Foundry</translation>
<translation lang="en">Foundry</translation>
</text>
</foundry:static-texts>