Syncing Foundry files

git-svn-id: https://svn.libreccm.org/ccm/trunk@2899 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-10-05 13:26:14 +00:00
parent d337647696
commit 6f89ff9d92
15 changed files with 1265 additions and 230 deletions

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<css-files>
</css-files>

View File

@ -8,6 +8,14 @@
</applications>
<content-items>
<default>content-items/default.xml</default>
<detail>
<content-item content-type="com.arsdigita.cms.contenttypes.Article">
content-items/article-detail.xml
</content-item>
<default>content-items/detail-default.xml</default>
</detail>
<list>
<default>content-items/list-default.xml</default>
</list>
</content-items>
</template>
</templates>

View File

@ -1672,12 +1672,6 @@
The entry point for creating Foundry documentation.
@ -2260,7 +2254,7 @@
<div>
<p xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
A message string of the for <code>[Foundry $level] $message</code> with
A message string of the form <code>[Foundry $level] $message</code> with
<code>$level</code> and <code>$message</code> replaced by the values of the
parameters.
@ -2363,7 +2357,7 @@
<h3>Result type</h3>
<p>
any
xs:string
</p>
@ -2371,6 +2365,11 @@
<div>
<p xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
A message string of the form <code>[Foundry INFO] $message</code> with
<code>$message</code> replaced by the value of the parameter.
</p>
</div>
@ -2471,7 +2470,7 @@
<h3>Result type</h3>
<p>
any
xs:string
</p>
@ -2479,6 +2478,11 @@
<div>
<p xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
A message string of the form <code>[Foundry WARNING] $message</code> with
<code>$message</code> replaced by the value of the parameter.
</p>
</div>
@ -2490,72 +2494,589 @@
</section>
<section id="foundry:message-error" class="function">
The message text.
<h1>
Function foundry:message-error
</h1>
<div>
<foundry:doc-desc xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
<p>
Helper function to generate an info message. This function be used together with
&lt;xsl:message&gt; to output a message in the CCM log when
<code>&lt;xsl:message&gt;</code> to output a message in the CCM log when
something goes wrong in the theme, for example when a layout file has a wrong
structure. Example:
</p>
<pre>
...
&lt;xsl:message&gt;
&lt;xsl:message select="foundry:message-info('Some error has occurred...')" /&gt;
&lt;/xsl:message&gt;
...
</pre>
</foundry:doc-desc>
</div>
#foundry-message-info
<h2>Parameters</h2>
<table>
<thead>
<td>
<th>Name</th>
<th>Mandatory</th>
<th>Type</th>
<th>Description</th>
</td>
</thead>
<tbody>
<td>
<td>
message
</td>
<td>
yes
</td>
<td>
any
</td>
<td>
#foundry-message-warn
</td>
</td>
</tbody>
</table>
<div>
<h2>Result</h2>
<h3>Result type</h3>
<p>
xs:string
</p>
<h3>Description</h3>
<div>
<p xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
A message string of the form <code>[Foundry ERROR] $message</code> with
<code>$message</code> replaced by the value of the parameter.
</p>
</div>
</div>
The node from which the value of the attribute is read.
</section>
The attribute to check for.
<section id="foundry:get-attribute-value" class="function">
<h1>
Function foundry:get-attribute-value
</h1>
The default value if the attribute is not set.
The value of the attribute if it is set on the current element, the
default-value otherwise.
<div>
<foundry:doc-desc xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
<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 default-value is used. This
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(current(), 'width', '640')" /&gt;
&lt;xsl:variable name="height"
select="foundry:get-attribute-value(current(), 'height', '480')" /&gt;
/&lt;xsl:template&gt;
In this example, the element example has two optional attributes:
with and height. If the attribute is set in processed XML,
the value set there is used. Otherwise the default value (640
respectively 480) is used. Without this function a code block like the
one in the xsl:choose block of this function would be necessary for
</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>
</div>
<h2>Parameters</h2>
<table>
<thead>
<td>
<th>Name</th>
<th>Mandatory</th>
<th>Type</th>
<th>Description</th>
</td>
</thead>
<tbody>
<td>
<td>
node
</td>
<td>
</td>
<td>
any
</td>
<td>
</td>
</td>
<td>
<td>
attribute-name
</td>
<td>
</td>
<td>
any
</td>
<td>
</td>
</td>
<td>
<td>
default-value
</td>
<td>
</td>
<td>
any
</td>
<td>
</td>
</td>
</tbody>
</table>
<div>
<h2>Result</h2>
<h3>Result type</h3>
<p>
any
</p>
<h3>Description</h3>
<div>
<p xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
The value of the attribute if it is set on the current element, the
<code>default-value</code> otherwise.
</p>
</div>
</div>
</section>
<section id="foundry:get-setting" class="function">
<h1>
Function foundry:get-setting
</h1>
<div>
<foundry:doc-desc xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
<p>
Convenient function for calling <code>foundry:get-setting</code> with only the
module name and setting name.
</p>
</foundry:doc-desc>
</div>
<h2>Parameters</h2>
<table>
<thead>
<td>
<th>Name</th>
<th>Mandatory</th>
<th>Type</th>
<th>Description</th>
</td>
</thead>
<tbody>
<td>
<td>
module
</td>
<td>
yes
</td>
<td>
string
</td>
<td>
<p xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
The module of the settings. May be an empty string (<code>''</code>).
</p>
</td>
</td>
<td>
<td>
setting
</td>
<td>
yes
</td>
<td>
string
</td>
<td>
<p xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
The name of the setting to retrieve.
</p>
</td>
</td>
</tbody>
</table>
<div>
<h2>Result</h2>
<h3>Result type</h3>
<p>
string
</p>
<h3>Description</h3>
<div>
<p xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
The value of the setting.
</p>
</div>
</div>
</section>
<section id="foundry:get-setting" class="function">
<h1>
Function foundry:get-setting
</h1>
<div>
<foundry:doc-desc xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
<p>
Convenient function for calling <code>foundry:get-setting</code> with only the
module name, the setting name and an default value.
</p>
</foundry:doc-desc>
</div>
<h2>Parameters</h2>
<table>
<thead>
<td>
<th>Name</th>
<th>Mandatory</th>
<th>Type</th>
<th>Description</th>
</td>
</thead>
<tbody>
<td>
<td>
module
</td>
<td>
yes
</td>
<td>
string
</td>
<td>
<p xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
The module of the settings. May be an empty string (<code>''</code>).
</p>
</td>
</td>
<td>
<td>
setting
</td>
<td>
yes
</td>
<td>
string
</td>
<td>
<p xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
The name of the setting to retrieve.
</p>
</td>
</td>
<td>
<td>
default
</td>
<td>
yes
</td>
<td>
string
</td>
<td>
<p xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
A default value which is used when the setting is not configured.
</p>
</td>
</td>
</tbody>
</table>
<div>
<h2>Result</h2>
<h3>Result type</h3>
<p>
string
</p>
<h3>Description</h3>
<div>
<p xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
The value of the setting or the default value if the setting is not configured.
</p>
</div>
</div>
</section>
@ -2582,70 +3103,282 @@
The value of the requested setting or if no value has been set the provided default
value. If no default value has been provided the result is an empty string.
This function retrieves the value of a setting from the theme configuration. For
more informations about the configuration system of Foundry please refer to the
configuration section of the Foundry documentation.
<section id="foundry:get-static-text" class="function">
<h1>
Function foundry:get-static-text
</h1>
he module of the settings. At the moment this corresponds to the name of the file
in the texts directory. The empty string as value corresponds to the
global.xml file.
The name of the text to retrieve.
The language to retrieve. Normally there is no need to set this parameter because
it is determined automatically.
The requested static text. If there is no value for the requested static text in the
module provided by the module parameter the value depends if the debug mode is
enabled or not. If the debug mode is not not enabled the result is an empty
string. If the debug mode is enabled, a identifier of the text (the value of the
id parameter) is displayed. If you point the mouse pointer of the
placeholder, the complete path of the text is shown as hovering box.
<div>
<foundry:doc-desc xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
<p>
Retrieves at static text. For more informations about static texts in Foundry please
refer to the static texts section in the Foundry documentation.
</p>
</foundry:doc-desc>
</div>
true if the debug mode if active, false otherwise.
<h2>Parameters</h2>
<table>
<thead>
<td>
<th>Name</th>
<th>Mandatory</th>
<th>Type</th>
<th>Description</th>
</td>
</thead>
<tbody>
<td>
<td>
module
</td>
<td>
yes
</td>
<td>
string
</td>
<td>
<p xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
he module of the settings. At the moment this corresponds to the name of the file
in the <code>texts</code> directory. The empty string as value corresponds to the
<code>global.xml</code> file.
</p>
</td>
</td>
<td>
<td>
id
</td>
<td>
yes
</td>
<td>
string
</td>
<td>
</td>
</td>
<td>
<td>
lang
</td>
<td>
no
</td>
<td>
string
</td>
<td>
<p xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
The language to retrieve. Normally there is no need to set this parameter because
it is determined automatically.
</p>
</td>
</td>
</tbody>
</table>
<div>
<h2>Result</h2>
<h3>Result type</h3>
<p>
string
</p>
<h3>Description</h3>
<div>
<p xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
The requested static text. If there is no value for the requested static text in the
module provided by the module parameter the value depends if the debug mode is
enabled or not. If the debug mode is <em>not</em> not enabled the result is an empty
string. If the debug mode is enabled, a identifier of the text (the value of the
<code>id</code> parameter) is displayed. If you point the mouse pointer of the
placeholder, the complete path of the text is shown as hovering box.
</p>
</div>
</div>
</section>
<section id="foundry:debug-enabled" class="function">
<h1>
Function foundry:debug-enabled
</h1>
<div>
<foundry:doc-desc xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
<p>
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.
</p>
</foundry:doc-desc>
Helper template for processing additional attributes. This are copied from the result
tree XML created by CCM to the HTML output generated by Foundry without any further
processing.
</div>
A helper function for reading the current category from the datatree. The
function joins the titles of all categories in nav:categoryPath to a
string. The tokens a separated by a slash (/).
<div>
<h2>Result</h2>
<h3>Result type</h3>
<p>
any
</p>
<h3>Description</h3>
<div>
<p xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
<code>true</code> if the debug mode if active, <code>false</code> otherwise.
</p>
</div>
</div>
</section>
<section id="foundry:read-current-category" class="function">
<h1>
Function foundry:read-current-category
</h1>
<div>
</div>
<div>
<h2>Result</h2>
<h3>Result type</h3>
<p>
any
</p>
<h3>Description</h3>
<div>
<p xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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:nav="http://ccm.redhat.com/navigation">
The path of the current category.
</p>
</div>
</div>
</section>
@ -2706,7 +3439,6 @@
The entry point for creating Foundry documentation.

View File

@ -0,0 +1,20 @@
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
<jsp:directive.page import="javax.xml.transform.TransformerFactory"/>
<jsp:directive.page import="javax.xml.transform.Transformer"/>
<jsp:directive.page import="javax.xml.transform.stream.StreamSource"/>
<jsp:directive.page import="javax.xml.transform.stream.StreamResult"/>
<jsp:scriptlet>
response.setContentType("text/html;charset=utf-8");
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(new StreamSource("../start.xsl"));
System.out.println(request.getContextPath());
transformer.setParameter("theme-prefix", request.getRequestURI() + "/../");
transformer.transform(new StreamSource("foundry-documentation.xml"),
new StreamResult(response.getOutputStream()));
</jsp:scriptlet>
</jsp:root>

View File

@ -201,12 +201,12 @@
<xsl:when test="$internal = true()">
<xsl:apply-templates select="document(concat($theme-prefix,
'foundry/templates/',
$template-file))"/>
normalize-space($template-file)))"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="document(concat($theme-prefix,
'/templates/',
$template-file))"/>
normalize-space($template-file)))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

View File

@ -29,6 +29,8 @@
exclude-result-prefixes="xsl xs bebop cms foundry nav ui"
version="2.0">
<xsl:import href="content-items/article.xsl"/>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
<p>
@ -85,32 +87,66 @@
</foundry:doc-desc>
</foundry:doc>
<xsl:template match="content-item">
<xsl:variable name="mode">
<xsl:choose>
<xsl:when test="./@mode = 'detail'">
<xsl:value-of select="'detail'"/>
</xsl:when>
<xsl:when test="./@mode = 'list'">
<xsl:value-of select="'list'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'detail'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$data-tree/cms:contentPanel or $data-tree/nav:greetingItem">
<xsl:variable name="contentitem-tree">
<xsl:choose>
<xsl:when test="$data-tree/nav:greetingItem">
<xsl:value-of select="$data-tree/nav:greetingItem/cms:item"/>
<xsl:copy-of select="$data-tree/nav:greetingItem/cms:item/*"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$data-tree/cms:contentPanel/cms:item"/>
<xsl:copy-of select="$data-tree/cms:contentPanel/cms:item/*"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="oid" select="$contentitem-tree/masterVersion/@oid"/>
<xsl:variable name="content-section"
select="$contentitem-tree/../cms:pathInfo/cms:sectionPath"/>
<xsl:variable name="content-section">
<xsl:choose>
<xsl:when test="$data-tree/nav:greetingItem">
<xsl:value-of select="$data-tree/nav:greetingItem/cms:pathInfo/cms:sectionPath"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$data-tree/cms:contentPanel/cms:pathInfo/cms:sectionPath"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="category" select="foundry:read-current-category()"/>
<xsl:variable name="content-type" select="$contentitem-tree/object-type"/>
<xsl:variable name="content-type" select="$contentitem-tree/objectType"/>
<xsl:variable name="template-map"
select="document($theme-prefix/conf/templates.xml)/templates/content-items"/>
<xsl:variable name="template-map">
<xsl:choose>
<xsl:when test="$mode = 'list'">
<xsl:copy-of select="document(concat($theme-prefix, '/conf/templates.xml'))/templates/content-items/list/*"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="document(concat($theme-prefix, '/conf/templates.xml'))/templates/content-items/detail/*"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$template-map/content-item[@oid = $oid]">
<xsl:message>
<xsl:value-of select="foundry:message-info('Found template for this special item.')"/>
</xsl:message>
<xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file"
select="$template-map/content-item[@oid = $oid]"/>
@ -211,17 +247,30 @@
</xsl:when>
<xsl:when test="$template-map/default">
<xsl:message>
<xsl:value-of select="foundry:message-info('No template for item found. Using default')"/>
</xsl:message>
<xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file"
select="'contentitem-default.xml'"/>
select="$template-map/default"/>
<xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/>
<xsl:with-param name="internal" select="true()"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:value-of select="foundry:message-info('No template for item found and not default configured. Using internal default')"/>
</xsl:message>
<xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file"
select="concat('contentitem-default-', $mode ,'.xml')"/>
<xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/>
<xsl:with-param name="internal" select="true()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
@ -236,7 +285,7 @@
<xsl:when test="$internal = true()">
<xsl:apply-templates select="document(concat($theme-prefix,
'foundry/templates/',
$template-file))">
normalize-space($template-file)))">
<xsl:with-param name="contentitem-tree"
tunnel="yes"
select="$contentitem-tree"/>
@ -245,7 +294,7 @@
<xsl:otherwise>
<xsl:apply-templates select="document(concat($theme-prefix,
'/templates/',
$template-file))">
normalize-space($template-file)))">
<xsl:with-param name="contentitem-tree"
tunnel="yes"
select="$contentitem-tree"/>
@ -254,4 +303,8 @@
</xsl:choose>
</xsl:template>
<xsl:template match="content-item-layout">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
This file is part of the Foundry Theme Engine for LibreCCM
Foundry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Foundry is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foundry If not, see <http://www.gnu.org/licenses/>.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
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:nav="http://ccm.redhat.com/navigation"
xmlns:ui="http://www.arsdigita.com/ui/1.0"
exclude-result-prefixes="xsl xs bebop cms foundry nav ui"
version="2.0">
<xsl:template match="/content-item-layout//lead-text">
<xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:value-of select="$contentitem-tree/lead"/>
</xsl:template>
<xsl:template match="/content-item-layout//main-text">
<xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:value-of select="$contentitem-tree/textAsset/content"
disable-output-escaping="yes"/>
</xsl:template>
</xsl:stylesheet>

View File

@ -24,9 +24,6 @@
exclude-result-prefixes="xsl foundry"
version="2.0">
<xsl:template match="content-item">
</xsl:template>
<foundry:doc section="user"
type="template-tag">
<foundry:doc-desc>

View File

@ -205,6 +205,41 @@
<xsl:template match="body">
<body>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:if test="foundry:debug-enabled()">
<div id="foundry-debug-panel">
<div id="foundry-debug-panel-content">
<h1>Foundry Debug Panel</h1>
<div>
<h2>Foundry system information</h2>
<dl>
<dt>Version</dt>
<dd>
<xsl:value-of select="$foundry-version"/>
</dd>
</dl>
</div>
<div>
<h2>Server related environment variables</h2>
<dl>
<dt>theme-prefix</dt>
<dd>
<xsl:value-of select="$theme-prefix"/>
</dd>
<dt>context-prefix</dt>
<dd>
<xsl:value-of select="$context-prefix"/>
</dd>
<dt>dispatcher-prefix</dt>
<dd>
<xsl:value-of select="$dispatcher-prefix"/>
</dd>
</dl>
</div>
</div>
</div>
</xsl:if>
<span id="top"/>
<a href="#startcontent" accesskey="S" class="nav-hide">
<xsl:attribute name="title">
@ -212,6 +247,7 @@
</xsl:attribute>
<xsl:value-of select="foundry:get-static-text('', 'layout/page/skipnav/link')"/>
</a>
<xsl:apply-templates/>
</body>
</xsl:template>
@ -395,6 +431,11 @@
<xsl:apply-templates/>
<!-- Load the CSS files for Foundry's debug mode if debug mode is active -->
<xsl:if test="foundry:debug-enabled()">
<link rel="stylesheet" type="text/css" href="{$theme-prefix}/foundry/styles/debug-mode.css"/>
</xsl:if>
<!-- Not implemented yet <xsl:call-template name="bebop:double-click-protection"/> -->
<xsl:apply-templates select="$data-tree//script"/>

View File

@ -144,7 +144,7 @@ XSLT 2.0 functions.
</foundry:doc-params>
<foundry:doc-result type="xs:string">
<p>
A message string of the for <code>[Foundry $level] $message</code> with
A message string of the form <code>[Foundry $level] $message</code> with
<code>$level</code> and <code>$message</code> replaced by the values of the
parameters.
</p>
@ -183,6 +183,12 @@ XSLT 2.0 functions.
The message text.
</foundry:doc-param>
</foundry:doc-params>
<foundry:doc-result type="xs:string">
<p>
A message string of the form <code>[Foundry INFO] $message</code> with
<code>$message</code> replaced by the value of the parameter.
</p>
</foundry:doc-result>
<foundry:doc-desc>
<p>
Helper function to generate an info message. This function be used together with
@ -215,6 +221,12 @@ XSLT 2.0 functions.
The message text.
</foundry:doc-param>
</foundry:doc-params>
<foundry:doc-result type="xs:string">
<p>
A message string of the form <code>[Foundry WARNING] $message</code> with
<code>$message</code> replaced by the value of the parameter.
</p>
</foundry:doc-result>
<foundry:doc-desc>
<p>
Helper function to generate an info message. This function be used together with
@ -242,13 +254,19 @@ XSLT 2.0 functions.
<xsl:sequence select="foundry:message('WARNING', $message)"/>
</xsl:function>
<foundry:doc section="devel">
<foundry:doc section="devel" type="function">
<foundry:doc-params>
<foundry:doc-param name="message"
mandatory="yes">
The message text.
</foundry:doc-param>
</foundry:doc-params>
<foundry:doc-result type="xs:string">
<p>
A message string of the form <code>[Foundry ERROR] $message</code> with
<code>$message</code> replaced by the value of the parameter.
</p>
</foundry:doc-result>
<foundry:doc-desc>
<p>
Helper function to generate an info message. This function be used together with
@ -277,7 +295,7 @@ XSLT 2.0 functions.
<xsl:sequence select="foundry:message('ERROR', $message)"/>
</xsl:function>
<foundry:doc section="devel">
<foundry:doc section="devel" type="function">
<foundry:doc-params>
<foundry:doc-param name="node">
The node from which the value of the attribute is read.
@ -290,8 +308,10 @@ XSLT 2.0 functions.
</foundry:doc-param>
</foundry:doc-params>
<foundry:doc-result>
<p>
The value of the attribute if it is set on the current element, the
<code>default-value</code> otherwise.
</p>
</foundry:doc-result>
<foundry:doc-desc>
<p>
@ -334,6 +354,31 @@ XSLT 2.0 functions.
</xsl:choose>
</xsl:function>
<foundry:doc section="devel" type="function">
<foundry:doc-desc>
<p>
Convenient function for calling <code>foundry:get-setting</code> with only the
module name and setting name.
</p>
</foundry:doc-desc>
<foundry:doc-params>
<foundry:doc-param name="module" mandatory="yes" type="string">
<p>
The module of the settings. May be an empty string (<code>''</code>).
</p>
</foundry:doc-param>
<foundry:doc-param name="setting" mandatory="yes" type="string">
<p>
The name of the setting to retrieve.
</p>
</foundry:doc-param>
</foundry:doc-params>
<foundry:doc-result type="string">
<p>
The value of the setting.
</p>
</foundry:doc-result>
</foundry:doc>
<xsl:function name="foundry:get-setting" as="xs:string">
<xsl:param name="module" as="xs:string"/>
<xsl:param name="setting" as="xs:string"/>
@ -341,6 +386,36 @@ XSLT 2.0 functions.
<xsl:sequence select="foundry:get-setting($module, $setting, '', '')"/>
</xsl:function>
<foundry:doc section="devel" type="function">
<foundry:doc-desc>
<p>
Convenient function for calling <code>foundry:get-setting</code> with only the
module name, the setting name and an default value.
</p>
</foundry:doc-desc>
<foundry:doc-params>
<foundry:doc-param name="module" mandatory="yes" type="string">
<p>
The module of the settings. May be an empty string (<code>''</code>).
</p>
</foundry:doc-param>
<foundry:doc-param name="setting" mandatory="yes" type="string">
<p>
The name of the setting to retrieve.
</p>
</foundry:doc-param>
<foundry:doc-param name="default" mandatory="yes" type="string">
<p>
A default value which is used when the setting is not configured.
</p>
</foundry:doc-param>
</foundry:doc-params>
<foundry:doc-result type="string">
<p>
The value of the setting or the default value if the setting is not configured.
</p>
</foundry:doc-result>
</foundry:doc>
<xsl:function name="foundry:get-setting" as="xs:string">
<xsl:param name="module" as="xs:string"/>
<xsl:param name="setting" as="xs:string"/>
@ -351,36 +426,34 @@ XSLT 2.0 functions.
<foundry:doc section="devel">
<foundry:doc-params>
<foundry:doc-param name="module"
mandatory="yes">
<foundry:doc-param name="module" mandatory="yes" type="string">
<p>
The module of the settings. At the moment this corresponds to the name of the file
in the <code>conf</code> directory. The empty string as value corresponds to the
<code>global.xml</code> file.
</p>
</foundry:doc-param>
<foundry:doc-param name="setting"
mandatory="yes">
<foundry:doc-param name="setting" mandatory="yes" type="string">
<p>
The name of the setting to retrieve.
</p>
</foundry:doc-param>
<foundry:doc-param name="default"
mandatory="no">
<foundry:doc-param name="default" mandatory="no" type="string">
<p>
The value to use if there is no entry for the setting in the settings file.
</p>
</foundry:doc-param>
<foundry:doc-param name="node"
mandatory="no">
<foundry:doc-param name="node" mandatory="no" type="string">
<p>
A node from the layout template which overrides the value from the configuration.
</p>
</foundry:doc-param>
</foundry:doc-params>
<foundry:doc-result>
<foundry:doc-result type="string">
<p>
The value of the requested setting or if no value has been set the provided default
value. If no default value has been provided the result is an empty string.
</p>
</foundry:doc-result>
<foundry:doc-desc>
This function retrieves the value of a setting from the theme configuration. For
@ -441,39 +514,40 @@ XSLT 2.0 functions.
<xsl:sequence select="foundry:get-static-text($module, $id, $html, $lang)"/>
</xsl:function>
<foundry:doc section="devel">
<foundry:doc section="devel" type="function">
<foundry:doc-params>
<foundry:doc-param name="module"
mandatory="yes">
<foundry:doc-param name="module" mandatory="yes" type="string">
<p>
he module of the settings. At the moment this corresponds to the name of the file
in the <code>texts</code> directory. The empty string as value corresponds to the
<code>global.xml</code> file.
</p>
</foundry:doc-param>
<foundry:doc-param name="id"
mandatory="yes">
<foundry:doc-param name="id" mandatory="yes" type="string">
The name of the text to retrieve.
</foundry:doc-param>
<foundry:doc-param name="lang"
mandatory="no">
<foundry:doc-param name="lang" mandatory="no" type="string">
<p>
The language to retrieve. Normally there is no need to set this parameter because
it is determined automatically.
</p>
</foundry:doc-param>
</foundry:doc-params>
<foundry:doc-result>
<foundry:doc-result type="string">
<p>
The requested static text. If there is no value for the requested static text in the
module provided by the module parameter the value depends if the debug mode is
enabled or not. If the debug mode is <em>not</em> not enabled the result is an empty
string. If the debug mode is enabled, a identifier of the text (the value of the
<code>id</code> parameter) is displayed. If you point the mouse pointer of the
placeholder, the complete path of the text is shown as hovering box.
</p>
</foundry:doc-result>
<foundry:doc-desc>
<p>
Retrieves at static text. For more informations about static texts in Foundry please
refer to the static texts section in the Foundry documentation.
</p>
</foundry:doc-desc>
</foundry:doc>
<xsl:function name="foundry:get-static-text" as="xs:string">
@ -544,31 +618,43 @@ XSLT 2.0 functions.
</xsl:choose>
</xsl:function>
<foundry:doc section="devel">
<foundry:doc section="devel" type="function">
<foundry:doc-result>
<p>
<code>true</code> if the debug mode if active, <code>false</code> otherwise.
</p>
</foundry:doc-result>
<foundry:doc-desc>
<p>
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.
</p>
</foundry:doc-desc>
</foundry:doc>
<xsl:function name="foundry:debug-enabled" as="xs:boolean">
<xsl:choose>
<xsl:when test="contains($theme-prefix, 'devel-themedir')">
<xsl:message>
debug mode active
</xsl:message>
<xsl:sequence select="true()"/>
</xsl:when>
<xsl:otherwise>
<xsl:message>
debug mode NOT active
</xsl:message>
<xsl:sequence select="false()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>
<foundry:doc section="devel">
<foundry:doc section="devel" type="function-template">
<foundry:doc-desc>
<p>
Helper template for processing additional attributes. This are copied from the result
tree XML created by CCM to the HTML output generated by Foundry without any further
processing.
</p>
</foundry:doc-desc>
</foundry:doc>
<xsl:template name="foundry:process-attributes">
@ -588,15 +674,22 @@ XSLT 2.0 functions.
</xsl:if>
</xsl:template>
<foundry:doc section="devel">
<foundry:doc section="devel" type="function">
<xsl:doc-desc>
<p>
A helper function for reading the current category from the <code>datatree</code>. The
function joins the titles of all categories in <code>nav:categoryPath</code> to a
string. The tokens a separated by a slash (<code>/</code>).
</p>
</xsl:doc-desc>
<foundry:doc-result>
<p>
The path of the current category.
</p>
</foundry:doc-result>
</foundry:doc>
<xsl:function name="foundry:read-current-category">
<xsl:sequence select="string-join($data-tree/nav:categoryPath/@title, '/')"/>
<xsl:sequence select="string-join($data-tree/nav:categoryPath/nav:category/@title, '/')"/>
</xsl:function>
<xsl:function name="foundry:shying" as="xs:string">

View File

@ -65,7 +65,7 @@
</xsl:message>
<xsl:call-template name="foundry:process-template">
<xsl:with-param name="template-file"
select="document(concat($theme-prefix, '/conf/templates.xml'))/applications/application[@name=$application and not(@class)]"/>
select="document(concat($theme-prefix, '/conf/templates.xml'))/templates/applications/application[@name=$application and not(@class)]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
@ -73,10 +73,10 @@
<xsl:value-of select="foundry:message-info('Using default layout')"/>
</xsl:message>
<xsl:choose>
<xsl:when test="document(concat($theme-prefix, '/conf/templates.xml'))/applications/default">
<xsl:when test="document(concat($theme-prefix, '/conf/templates.xml'))/templates/applications/default">
<xsl:call-template name="foundry:process-template">
<xsl:with-param name="template-file"
select="document(concat($theme-prefix, '/conf/templates.xml'))/applications/default"/>
select="document(concat($theme-prefix, '/conf/templates.xml'))/templates/applications/default"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
@ -99,41 +99,14 @@
</xsl:template>
<foundry:doc section="devel">
<!--<foundry:doc section="devel">
<foundry:doc-desc>
<p>
The entry point for creating Foundry documentation.
</p>
</foundry:doc-desc>
</foundry:doc>
</foundry:doc>-->
<xsl:template match="/foundry:documentation">
<!--<html>
<head>
<meta http-equiv="content-type"
content="text/html; charset=UTF-8"/>
<title>Foundry Theming Engine for LibreCCM - Documentation</title>
<style type="text/css">
.missing-static-text {
border: 2px solid red;
color: red;
font-weight: bold;
}
</style>
</head>
<body>
<header>
Header
</header>
<nav>
Navigation
</nav>
<main>
<xsl:apply-templates/>
</main>
<footer>
Footer
</footer>
</body>
</html>-->
<xsl:apply-templates select="document(concat($theme-prefix, '/foundry/templates/doc/foundry-documentation.xml'))"/>
</xsl:template>

View File

@ -0,0 +1,50 @@
#foundry-debug-panel {
position: absolute;
left: 0;
top: 0;
width: 1em;
height: 1em;
}
#foundry-debug-panel #foundry-debug-panel-content{
display: none;
}
#foundry-debug-panel:hover {
width: 100%;
height: 24em;
background-color: #000;
/*border: 1px solid #0ff;*/
border-radius: 1em;
}
#foundry-debug-panel:hover #foundry-debug-panel-content {
display: block;
overflow:auto;
margin: 0.2em 1em;
font-family: monospace;
font-size: 10pt;
color: #0ff;
}
#foundry-debug-panel:hover #foundry-debug-panel-content dl {
}
#foundry-debug-panel:hover #foundry-debug-panel-content dt {
float: left;
width: 15em;
}
#foundry-debug-panel:hover #foundry-debug-panel-content dt::after {
content: " = ";
}
#foundry-debug-panel:hover #foundry-debug-panel-content dd {
padding-left: 0.5em;
}
#foundry-debug-panel:hover #foundry-debug-panel-content dd::after {
clear: both;
content: " ";
}

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<content-item-layout>
<div class="lead">
<lead-text/>
</div>
<div class="main">
<main-text/>
</div>
</content-item-layout>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<content-item-layout>
<div>
<show-property name="pageDescription"/>
</div>
</content-item-layout>

View File

@ -6,6 +6,7 @@
<show-text>layout/page/head/title</show-text>
<show-page-title/>
</title>
<load-css-files/>
</head>
<body>
<nav>
@ -14,7 +15,7 @@
<navigation-title/>
</a>
</navigation-home-link>
<h1><show-text>layout/page/head/title</show-text></h1>
<h1><show-text>layout/page/head/title</show-text>: <show-page-title/></h1>
<navigation>
<div class="nav-wrapper">
<navigation-links>
@ -33,6 +34,7 @@
<main>
<div>
<h1>TEST</h1>
<content-item/>
</div>
</main>
</body>