- Changed log level in RelationAtttributeImportTool to debug for all none error messages

- Fixed some typos in the Foundry documentation


git-svn-id: https://svn.libreccm.org/ccm/trunk@4047 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2016-05-04 06:10:09 +00:00
parent 3f1a1c9930
commit 5818a27d7b
3 changed files with 273 additions and 269 deletions

View File

@ -25,10 +25,10 @@ import org.xml.sax.Attributes;
import org.xml.sax.helpers.DefaultHandler; import org.xml.sax.helpers.DefaultHandler;
/** /**
* This is a helper tool for loading data for the RelationAttributes (Database * This is a helper tool for loading data for the RelationAttributes (Database
* Driven Enums) into the database in a loader of a module. This helper class * Driven Enums) into the database in a loader of a module. This helper class
* uses a XML format for loading the enum data, which looks like this: * uses a XML format for loading the enum data, which looks like this:
* *
* <pre> * <pre>
* &lt;ddenums&gt; * &lt;ddenums&gt;
* &lt;ddenum name="..."&gt; * &lt;ddenum name="..."&gt;
@ -39,27 +39,27 @@ import org.xml.sax.helpers.DefaultHandler;
* &lt;/ddenum&gt; * &lt;/ddenum&gt;
* &lt;/ddenums&gt; * &lt;/ddenums&gt;
* </pre> * </pre>
* *
* The root element is {@code <ddenums>} which can appear only once per file. * The root element is {@code <ddenums>} which can appear only once per file.
* The {@code <ddenums} can have multiple {@code <ddenum>} elements as child * The {@code <ddenums} can have multiple {@code <ddenum>} elements as child
* elements. The {@code <ddenum> element has one attribute, {@code name} which * elements. The {@code <ddenum> element has one attribute, {@code name} which
* contains the name of the enumeration. Each {@code <ddenum>} may have multiple * contains the name of the enumeration. Each {@code <ddenum>} may have multiple
* {@code<entry>} child elements. The {@code <entry>} element has three attributes. * {@code<entry>} child elements. The {@code <entry>} element has three attributes.
* *
* <dl> * <dl>
* <dt>{@code key}</dt><dd>The key of the entry. This attribute is mandatory.</dd> * <dt>{@code key}</dt><dd>The key of the entry. This attribute is mandatory.</dd>
* <dt>{@code lang}</dt><dd>The language of the entry. This attribute is * <dt>{@code lang}</dt><dd>The language of the entry. This attribute is
* mandatory. The combination of {@code key} * mandatory. The combination of {@code key}
* and {@code lang} should be unique.</dd> * and {@code lang} should be unique.</dd>
* <dt>{@code id}</dt><dd>This attribute is optional and contains the * <dt>{@code id}</dt><dd>This attribute is optional and contains the
* database id of the entry if necessary. The * database id of the entry if necessary. The
* value is maybe ignored by this import tool.</dd> * value is maybe ignored by this import tool.</dd>
* </dl> * </dl>
* *
* Each entry has at least a {@code <value>} element as child. The {@code <value>} * Each entry has at least a {@code <value>} element as child. The {@code <value>}
* element contains the value of the enum entry. Optionally there can also be * element contains the value of the enum entry. Optionally there can also be
* an description element containing a description of the entry. * an description element containing a description of the entry.
* *
* @author Jens Pelzetter <jens@jp-digital.de> * @author Jens Pelzetter <jens@jp-digital.de>
* @version $Id$ * @version $Id$
*/ */
@ -67,7 +67,7 @@ public class RelationAttributeImportTool {
/** Internal logger instance to faciliate debugging. Enable logging output /** Internal logger instance to faciliate debugging. Enable logging output
* by editing /WEB-INF/conf/log4j.properties int hte runtime environment * by editing /WEB-INF/conf/log4j.properties int hte runtime environment
* and set com.arsdigita.cms.RelationAttributeImportTool=DEBUG * and set com.arsdigita.cms.RelationAttributeImportTool=DEBUG
* by uncommenting or adding the line. */ * by uncommenting or adding the line. */
private final static Logger LOGGER = Logger.getLogger(RelationAttributeImportTool.class); private final static Logger LOGGER = Logger.getLogger(RelationAttributeImportTool.class);
@ -168,18 +168,18 @@ public class RelationAttributeImportTool {
currentKey)); currentKey));
return; return;
} }
LOGGER.warn("Creating RelationAttribute entry with this values:"); LOGGER.debug("Creating RelationAttribute entry with this values:");
LOGGER.warn(String.format("\tcurrentEnum = '%s'", currentEnum)); LOGGER.debug(String.format("\tcurrentEnum = '%s'", currentEnum));
LOGGER.warn(String.format("\tcurrentKey = '%s'", currentKey)); LOGGER.debug(String.format("\tcurrentKey = '%s'", currentKey));
LOGGER.warn(String.format("\tcurrentLang = '%s'", currentLang)); LOGGER.debug(String.format("\tcurrentLang = '%s'", currentLang));
LOGGER.warn(String.format("\tcurrentValue = '%s'", currentValue)); LOGGER.debug(String.format("\tcurrentValue = '%s'", currentValue));
final RelationAttribute entry = new RelationAttribute(); final RelationAttribute entry = new RelationAttribute();
if ((currentId != null) && !currentId.isEmpty()) { if ((currentId != null) && !currentId.isEmpty()) {
entry.setID(new BigDecimal(currentId)); entry.setID(new BigDecimal(currentId));
} }
entry.setAttribute(currentEnum); entry.setAttribute(currentEnum);
entry.setKey(currentKey); entry.setKey(currentKey);
entry.setLanguage(currentLang); entry.setLanguage(currentLang);

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
This file is part of the Foundry Theme Engine for LibreCCM This file is part of the Foundry Theme Engine for LibreCCM
Foundry is free software: you can redistribute it and/or modify Foundry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or the Free Software Foundation, either version 2 of the License, or
@ -28,7 +28,7 @@
xmlns:ui="http://www.arsdigita.com/ui/1.0" xmlns:ui="http://www.arsdigita.com/ui/1.0"
exclude-result-prefixes="xsl xs bebop cms foundry nav ui" exclude-result-prefixes="xsl xs bebop cms foundry nav ui"
version="2.0"> version="2.0">
<xsl:import href="content-items/article.xsl"/> <xsl:import href="content-items/article.xsl"/>
<xsl:import href="content-items/bookmark.xsl"/> <xsl:import href="content-items/bookmark.xsl"/>
<xsl:import href="content-items/contact.xsl"/> <xsl:import href="content-items/contact.xsl"/>
@ -60,8 +60,8 @@
</foundry:doc-file-title> </foundry:doc-file-title>
<foundry:doc-file-desc> <foundry:doc-file-desc>
<p> <p>
These tags are common tags for displaying Content Items. These tags are common tags for displaying Content Items.
For most Content Types there are special tags provided by other For most Content Types there are special tags provided by other
files. files.
</p> </p>
</foundry:doc-file-desc> </foundry:doc-file-desc>
@ -70,27 +70,27 @@
<foundry:doc section="user" type="template-tag"> <foundry:doc section="user" type="template-tag">
<foundry:doc-desc> <foundry:doc-desc>
<p> <p>
The <code>content-item</code> element with the attribute The <code>content-item</code> element with the attribute
<code>mode</code> set to <code>detail</code> or without the <code>mode</code> set to <code>detail</code> or without the
attribute inserts the HTML representation of the detail view of attribute inserts the HTML representation of the detail view of
the current content item. The content item can either be the the current content item. The content item can either be the
greeting item or normal item. greeting item or a normal item.
</p> </p>
<p> <p>
The HTML representation of a content item is defined using The HTML representation of a content item is defined using
special templates with the <code>contentitem-layout</code> special templates with the <code>contentitem-layout</code>
element as root. Usually these templates are located in the element as root. Usually these templates are located in the
<code>templates/content-items</code> folder. Which template is <code>templates/content-items</code> folder. Which template is
used for a particular content item is defined by the used for a particular content item is defined by the
<code>conf/templates.xml</code> file. In this file there is a <code>conf/templates.xml</code> file. In this file there is a
<code>content-items</code> element below the <code>content-items</code> element below the
<code>templates</code> element. The association between <code>templates</code> element. The association between
templates and content items is described by the templates and content items is described by the
<code>content-item</code> elements in the <code>content-item</code> elements in the
<code>content-items</code> element. The <code>content-items</code> element. The
<code>content-item</code> has four optional attributes <code>content-item</code> has four optional attributes
(at least on must be present) which are used to limit the (at least on must be present) which are used to limit the
content items for which a template is used. The four attributes content items for which a template is used. The four attributes
are: are:
</p> </p>
<dl> <dl>
@ -98,24 +98,24 @@
<code>oid</code> <code>oid</code>
</dt> </dt>
<dd> <dd>
Limit the use of the template to a specific content item, Limit the use of the template to a specific content item,
identified by its OID (the OID of the master version). Can't identified by its OID (the OID of the master version). Can't
be used in combination with the other attributes. be used in combination with the other attributes.
</dd> </dd>
<dt> <dt>
<code>content-section</code> <code>content-section</code>
</dt> </dt>
<dd> <dd>
The name of the content section to which the item belongs. The name of the content section to which the item belongs.
Can be used in combination with the <code>category</code> Can be used in combination with the <code>category</code>
and <code>content-type</code> attributes. and <code>content-type</code> attributes.
</dd> </dd>
<dt> <dt>
<code>category</code> <code>category</code>
</dt> </dt>
<dd> <dd>
The template is only used for the content item if the item The template is only used for the content item if the item
is viewed as item of the category. The category is set as is viewed as item of the category. The category is set as
a path containing the names the categories. a path containing the names the categories.
</dd> </dd>
<dt> <dt>
@ -157,26 +157,26 @@
</xsl:with-param> </xsl:with-param>
<xsl:with-param name="style" select="./@style" /> <xsl:with-param name="style" select="./@style" />
</xsl:call-template> </xsl:call-template>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<xsl:template name="process-content-item-detail"> <xsl:template name="process-content-item-detail">
<xsl:param name="contentitem-tree"/> <xsl:param name="contentitem-tree"/>
<xsl:param name="content-section" select="''"/> <xsl:param name="content-section" select="''"/>
<xsl:param name="style" select="''"/> <xsl:param name="style" select="''"/>
<xsl:param name="mode" select="'detail'"/> <xsl:param name="mode" select="'detail'"/>
<xsl:variable name="oid" select="$contentitem-tree/masterVersion/@oid"/> <xsl:variable name="oid" select="$contentitem-tree/masterVersion/@oid"/>
<xsl:variable name="category" select="foundry:read-current-category()"/> <xsl:variable name="category" select="foundry:read-current-category()"/>
<xsl:variable name="content-type" select="$contentitem-tree/objectType"/> <xsl:variable name="content-type" select="$contentitem-tree/objectType"/>
<xsl:variable name="template-map"> <xsl:variable name="template-map">
<xsl:choose> <xsl:choose>
<xsl:when test="$mode = 'portlet-item' <xsl:when test="$mode = 'portlet-item'
and document(foundry:gen-path('conf/templates.xml'))/templates/content-items/portlet-item"> and document(foundry:gen-path('conf/templates.xml'))/templates/content-items/portlet-item">
<xsl:copy-of select="document(foundry:gen-path('conf/templates.xml'))/templates/content-items/portlet-item/*"/> <xsl:copy-of select="document(foundry:gen-path('conf/templates.xml'))/templates/content-items/portlet-item/*"/>
</xsl:when> </xsl:when>
<xsl:when test="$mode = 'greeting-item' <xsl:when test="$mode = 'greeting-item'
and document(foundry:gen-path('conf/templates.xml'))/templates/content-items/greeting-item"> and document(foundry:gen-path('conf/templates.xml'))/templates/content-items/greeting-item">
<xsl:copy-of select="document(foundry:gen-path('conf/templates.xml'))/templates/content-items/greeting-item/*"/> <xsl:copy-of select="document(foundry:gen-path('conf/templates.xml'))/templates/content-items/greeting-item/*"/>
</xsl:when> </xsl:when>
@ -187,8 +187,8 @@
<xsl:copy-of select="document(foundry:gen-path('conf/templates.xml'))/templates/content-items/detail/*"/> <xsl:copy-of select="document(foundry:gen-path('conf/templates.xml'))/templates/content-items/detail/*"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable> </xsl:variable>
<xsl:choose> <xsl:choose>
<xsl:when test="$template-map/content-item[@oid = $oid]"> <xsl:when test="$template-map/content-item[@oid = $oid]">
@ -196,279 +196,279 @@
<xsl:with-param name="message" <xsl:with-param name="message"
select="'Found template for this special item.'"/> select="'Found template for this special item.'"/>
</xsl:call-template> </xsl:call-template>
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/content-item[@oid = $oid]"/> select="$template-map/content-item[@oid = $oid]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="$template-map/content-item[@content-section = $content-section <xsl:when test="$template-map/content-item[@content-section = $content-section
and @category = $category and @category = $category
and @style = $style and @style = $style
and @content-type = $content-type]"> and @content-type = $content-type]">
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/content-item[@content-section = $content-section select="$template-map/content-item[@content-section = $content-section
and @category = $category and @category = $category
and @style = $style and @style = $style
and @content-type = $content-type]"/> and @content-type = $content-type]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="$template-map/content-item[@content-section = $content-section <xsl:when test="$template-map/content-item[@content-section = $content-section
and @category = $category and @category = $category
and not(@style) and not(@style)
and @content-type = $content-type]"> and @content-type = $content-type]">
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/content-item[@content-section = $content-section select="$template-map/content-item[@content-section = $content-section
and @category = $category and @category = $category
and not(@style) and not(@style)
and @content-type = $content-type]"/> and @content-type = $content-type]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="$template-map/content-item[@content-section = $content-section <xsl:when test="$template-map/content-item[@content-section = $content-section
and @category = $category and @category = $category
and @style = $style and @style = $style
and not(@content-type)]"> and not(@content-type)]">
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/content-item[@content-section = $content-section select="$template-map/content-item[@content-section = $content-section
and @category = $category and @category = $category
and @style = $style and @style = $style
and not(@content-type)]"/> and not(@content-type)]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="$template-map/content-item[@content-section = $content-section <xsl:when test="$template-map/content-item[@content-section = $content-section
and @category = $category and @category = $category
and not(@style) and not(@style)
and not(@content-type)]"> and not(@content-type)]">
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/content-item[@content-section = $content-section select="$template-map/content-item[@content-section = $content-section
and @category = $category and @category = $category
and not(@style) and not(@style)
and not(@content-type)]"/> and not(@content-type)]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="$template-map/content-item[@content-section = $content-section <xsl:when test="$template-map/content-item[@content-section = $content-section
and not(@category) and not(@category)
and @style = $style and @style = $style
and @content-type = $content-type]"> and @content-type = $content-type]">
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/content-item[@content-section = $content-section select="$template-map/content-item[@content-section = $content-section
and not(@category) and not(@category)
and @style = $style and @style = $style
and @content-type = $content-type]"/> and @content-type = $content-type]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="$template-map/content-item[@content-section = $content-section <xsl:when test="$template-map/content-item[@content-section = $content-section
and not(@category) and not(@category)
and not(@style) and not(@style)
and @content-type = $content-type]"> and @content-type = $content-type]">
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/content-item[@content-section = $content-section select="$template-map/content-item[@content-section = $content-section
and not(@category) and not(@category)
and not(@style) and not(@style)
and @content-type = $content-type]"/> and @content-type = $content-type]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="$template-map/content-item[@content-section = $content-section <xsl:when test="$template-map/content-item[@content-section = $content-section
and not(@category) and not(@category)
and @style = $style and @style = $style
and not(@content-type)]"> and not(@content-type)]">
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/content-item[@content-section = $content-section select="$template-map/content-item[@content-section = $content-section
and not(@category) and not(@category)
and @style = $style and @style = $style
and not(@content-type)]"/> and not(@content-type)]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="$template-map/content-item[@content-section = $content-section <xsl:when test="$template-map/content-item[@content-section = $content-section
and not(@category) and not(@category)
and not(@style) and not(@style)
and not(@content-type)]"> and not(@content-type)]">
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/content-item[@content-section = $content-section select="$template-map/content-item[@content-section = $content-section
and not(@category) and not(@category)
and not(@style) and not(@style)
and not(@content-type)]"/> and not(@content-type)]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="$template-map/content-item[not(@content-section) <xsl:when test="$template-map/content-item[not(@content-section)
and @category = $category and @category = $category
and @style = $style and @style = $style
and @content-type = $content-type]"> and @content-type = $content-type]">
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/content-item[not(@content-section) select="$template-map/content-item[not(@content-section)
and @category = $category and @category = $category
and @style = $style and @style = $style
and @content-type = $content-type]"/> and @content-type = $content-type]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="$template-map/content-item[not(@content-section) <xsl:when test="$template-map/content-item[not(@content-section)
and @category = $category and @category = $category
and not(@style) and not(@style)
and @content-type = $content-type]"> and @content-type = $content-type]">
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/content-item[not(@content-section) select="$template-map/content-item[not(@content-section)
and @category = $category and @category = $category
and not(@style) and not(@style)
and @content-type = $content-type]"/> and @content-type = $content-type]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="$template-map/content-item[not(@content-section) <xsl:when test="$template-map/content-item[not(@content-section)
and @category = $category and @category = $category
and @style = $style and @style = $style
and not(@content-type)]"> and not(@content-type)]">
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/content-item[not(@content-section) select="$template-map/content-item[not(@content-section)
and @category = $category and @category = $category
and @style = $style and @style = $style
and not(@content-type)]"/> and not(@content-type)]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="$template-map/content-item[not(@content-section) <xsl:when test="$template-map/content-item[not(@content-section)
and @category = $category and @category = $category
and not(@style) and not(@style)
and not(@content-type)]"> and not(@content-type)]">
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/content-item[not(@content-section) select="$template-map/content-item[not(@content-section)
and @category = $category and @category = $category
and not(@style) and not(@style)
and not(@content-type)]"/> and not(@content-type)]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="$template-map/content-item[not(@content-section) <xsl:when test="$template-map/content-item[not(@content-section)
and not(@category) and not(@category)
and @style = $style and @style = $style
and @content-type = $content-type]"> and @content-type = $content-type]">
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/content-item[not(@content-section) select="$template-map/content-item[not(@content-section)
and not(@category) and not(@category)
and @style = $style and @style = $style
and @content-type = $content-type]"/> and @content-type = $content-type]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="$template-map/content-item[not(@content-section) <xsl:when test="$template-map/content-item[not(@content-section)
and not(@category) and not(@category)
and not(@style) and not(@style)
and @content-type = $content-type]"> and @content-type = $content-type]">
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/content-item[not(@content-section) select="$template-map/content-item[not(@content-section)
and not(@category) and not(@category)
and not(@style) and not(@style)
and @content-type = $content-type]"/> and @content-type = $content-type]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="$template-map/default"> <xsl:when test="$template-map/default">
<xsl:call-template name="foundry:message-warn"> <xsl:call-template name="foundry:message-warn">
<xsl:with-param name="message" <xsl:with-param name="message"
select="'No layout template for item found. Using default'"/> select="'No layout template for item found. Using default'"/>
</xsl:call-template> </xsl:call-template>
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/default"/> select="$template-map/default"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:call-template name="foundry:message-warn"> <xsl:call-template name="foundry:message-warn">
<xsl:with-param name="message" <xsl:with-param name="message"
select="'No template for item found and not default configured. Using internal default'"/> select="'No template for item found and not default configured. Using internal default'"/>
</xsl:call-template> </xsl:call-template>
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="'contentitem-default-detail.xml'"/> select="'contentitem-default-detail.xml'"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
<xsl:with-param name="internal" <xsl:with-param name="internal"
select="true()"/> select="true()"/>
</xsl:call-template> </xsl:call-template>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<foundry:doc section="user" type="template-tag"> <foundry:doc section="user" type="template-tag">
<foundry:doc-desc> <foundry:doc-desc>
<p> <p>
The <code>content-item</code> with the <code>mode</code> The <code>content-item</code> with the <code>mode</code>
attribute set to <code>link</code> insert the HTML attribute set to <code>link</code> insert the HTML
representation of a content item. In this case the content item representation of a content item. In this case the content item
to show is provided using by a XSL parameter which has to be to show is provided using by a XSL parameter which has to be
provided by a surrounding tag like <code>related-link</code>. provided by a surrounding tag like <code>related-link</code>.
</p> </p>
</foundry:doc-desc> </foundry:doc-desc>
</foundry:doc> </foundry:doc>
<xsl:template match="content-item[@mode = 'link']"> <xsl:template match="content-item[@mode = 'link']">
<xsl:param name="contentitem-tree" tunnel="yes"/> <xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:variable name="oid" select="$contentitem-tree/@oid"/> <xsl:variable name="oid" select="$contentitem-tree/@oid"/>
<xsl:variable name="content-type" select="$contentitem-tree/objectType"/> <xsl:variable name="content-type" select="$contentitem-tree/objectType"/>
<xsl:variable name="template-map"> <xsl:variable name="template-map">
<xsl:copy-of select="document(foundry:gen-path('conf/templates.xml'))/templates/content-items/link/*"/> <xsl:copy-of select="document(foundry:gen-path('conf/templates.xml'))/templates/content-items/link/*"/>
</xsl:variable> </xsl:variable>
<xsl:choose> <xsl:choose>
<xsl:when test="$template-map/content-item[@content-type = $content-type]"> <xsl:when test="$template-map/content-item[@content-type = $content-type]">
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
@ -480,9 +480,9 @@
</xsl:when> </xsl:when>
<xsl:when test="$template-map/default"> <xsl:when test="$template-map/default">
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/default"/> select="$template-map/default"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
@ -491,48 +491,48 @@
<xsl:with-param name="message" <xsl:with-param name="message"
select="'No template for item found and not default configured. Using internal default'"/> select="'No template for item found and not default configured. Using internal default'"/>
</xsl:call-template> </xsl:call-template>
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="'contentitem-default-link.xml'"/> select="'contentitem-default-link.xml'"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
<xsl:with-param name="internal" select="true()"/> <xsl:with-param name="internal" select="true()"/>
</xsl:call-template> </xsl:call-template>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<foundry:doc section="user" type="template-tag"> <foundry:doc section="user" type="template-tag">
<foundry:doc-desc> <foundry:doc-desc>
<p> <p>
The <code>content-item</code> element with the <code>mode</code> The <code>content-item</code> element with the <code>mode</code>
attribute set to <code>list</code> inserts the HTML attribute set to <code>list</code> inserts the HTML
representation of the the list view of a content item. The list representation of the the list view of a content item. The list
view is primarily used in object lists. view is primarily used in object lists.
</p> </p>
<p> <p>
As for the detail view, the HTML representation of the list view As for the detail view, the HTML representation of the list view
of a conten item is defined using special templates with the of a conten item is defined using special templates with the
<code>contentitem-layout</code> element as root. Usually these <code>contentitem-layout</code> element as root. Usually these
templates are located in the templates are located in the
<code>templates/content-items</code> folder. Which is used for a <code>templates/content-items</code> folder. Which is used for a
particular content item is defined in the particular content item is defined in the
<code>conf/templates.xml</code> file. In this file there is a <code>conf/templates.xml</code> file. In this file there is a
<code>content-items</code> element below the <code>content-items</code> element below the
<code>templates</code> element. <code>templates</code> element.
</p> </p>
<p> <p>
There three attributes which can be used to define in which There three attributes which can be used to define in which
cases a specific template is used: cases a specific template is used:
</p> </p>
<dl> <dl>
<dt>style</dt> <dt>style</dt>
<dd> <dd>
Used to select a specific style for the list view of the Used to select a specific style for the list view of the
item. To select a style add a <code>style</code> attribute item. To select a style add a <code>style</code> attribute
to the <code>content-item</code> attribute in the to the <code>content-item</code> attribute in the
application layout file. application layout file.
</dd> </dd>
<dt>content-type</dt> <dt>content-type</dt>
@ -541,26 +541,26 @@
<code>category</code> <code>category</code>
</dt> </dt>
<dd> <dd>
The template is only used for the content item if the item The template is only used for the content item if the item
is viewed as item of the category. The category is set as a is viewed as item of the category. The category is set as a
path contains the names the categories. path contains the names the categories.
</dd> </dd>
</dl> </dl>
</foundry:doc-desc> </foundry:doc-desc>
<foundry:doc-see-also> <foundry:doc-see-also>
<foundry:doc-link href="#layout-templates">The template system</foundry:doc-link> <foundry:doc-link href="#layout-templates">The template system</foundry:doc-link>
</foundry:doc-see-also> </foundry:doc-see-also>
</foundry:doc> </foundry:doc>
<xsl:template match="content-item[@mode = 'list']"> <xsl:template match="content-item[@mode = 'list']">
<xsl:param name="contentitem-tree" tunnel="yes"/> <xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:variable name="category" select="foundry:read-current-category()"/> <xsl:variable name="category" select="foundry:read-current-category()"/>
<xsl:variable name="content-type" <xsl:variable name="content-type"
select="if ($contentitem-tree/nav:attribute[@name = 'objectType']) select="if ($contentitem-tree/nav:attribute[@name = 'objectType'])
then $contentitem-tree/nav:attribute[@name = 'objectType'] then $contentitem-tree/nav:attribute[@name = 'objectType']
else $contentitem-tree/objectType"/> else $contentitem-tree/objectType"/>
<xsl:variable name="style"> <xsl:variable name="style">
<xsl:choose> <xsl:choose>
<xsl:when test="./@style"> <xsl:when test="./@style">
@ -571,11 +571,11 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable> </xsl:variable>
<xsl:variable name="template-map"> <xsl:variable name="template-map">
<xsl:copy-of select="document(foundry:gen-path('conf/templates.xml'))/templates/content-items/list/*"/> <xsl:copy-of select="document(foundry:gen-path('conf/templates.xml'))/templates/content-items/list/*"/>
</xsl:variable> </xsl:variable>
<xsl:choose> <xsl:choose>
<xsl:when test="$style != ''"> <xsl:when test="$style != ''">
<xsl:choose> <xsl:choose>
@ -587,7 +587,7 @@
select="$template-map/content-item[@style = $style select="$template-map/content-item[@style = $style
and @content-type = $content-type and @content-type = $content-type
and @category = $category]"/> and @category = $category]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
@ -599,7 +599,7 @@
select="$template-map/content-item[@style = $style select="$template-map/content-item[@style = $style
and @content-type = $content-type and @content-type = $content-type
and not(@category)]"/> and not(@category)]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
@ -611,7 +611,7 @@
select="$template-map/content-item[@style = $style select="$template-map/content-item[@style = $style
and not(@content-type) and not(@content-type)
and not(@category)]"/> and not(@category)]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
@ -619,7 +619,7 @@
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/default"/> select="$template-map/default"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
@ -627,9 +627,9 @@
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="'contentitem-default-list.xml'"/> select="'contentitem-default-list.xml'"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
<xsl:with-param name="internal" <xsl:with-param name="internal"
select="true()"/> select="true()"/>
</xsl:call-template> </xsl:call-template>
</xsl:otherwise> </xsl:otherwise>
@ -645,7 +645,7 @@
select="$template-map/content-item[@content-type = $content-type select="$template-map/content-item[@content-type = $content-type
and @category = $category and @category = $category
and not(@style)]"/> and not(@style)]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
@ -657,7 +657,7 @@
select="$template-map/content-item[@content-type = $content-type select="$template-map/content-item[@content-type = $content-type
and not(@category) and not(@category)
and not(@style)]"/> and not(@style)]"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
@ -665,7 +665,7 @@
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="$template-map/default"/> select="$template-map/default"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
@ -673,9 +673,9 @@
<xsl:call-template name="foundry:process-contentitem-template"> <xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file" <xsl:with-param name="template-file"
select="'contentitemitem-default-list'"/> select="'contentitemitem-default-list'"/>
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/> select="$contentitem-tree"/>
<xsl:with-param name="internal" <xsl:with-param name="internal"
select="true()"/> select="true()"/>
</xsl:call-template> </xsl:call-template>
</xsl:otherwise> </xsl:otherwise>
@ -683,18 +683,18 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<xsl:template name="foundry:process-contentitem-template"> <xsl:template name="foundry:process-contentitem-template">
<xsl:param name="template-file" as="xs:string"/> <xsl:param name="template-file" as="xs:string"/>
<xsl:param name="internal" as="xs:boolean" select="false()"/> <xsl:param name="internal" as="xs:boolean" select="false()"/>
<xsl:param name="contentitem-tree"/> <xsl:param name="contentitem-tree"/>
<xsl:choose> <xsl:choose>
<xsl:when test="$internal = true()"> <xsl:when test="$internal = true()">
<xsl:apply-templates select="document(foundry:gen-path( <xsl:apply-templates select="document(foundry:gen-path(
concat('foundry/templates/', concat('foundry/templates/',
normalize-space($template-file))))"> normalize-space($template-file))))">
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
tunnel="yes" tunnel="yes"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:apply-templates> </xsl:apply-templates>
@ -703,14 +703,14 @@
<xsl:apply-templates select="document(foundry:gen-path( <xsl:apply-templates select="document(foundry:gen-path(
concat('/templates/', concat('/templates/',
normalize-space($template-file))))"> normalize-space($template-file))))">
<xsl:with-param name="contentitem-tree" <xsl:with-param name="contentitem-tree"
tunnel="yes" tunnel="yes"
select="$contentitem-tree"/> select="$contentitem-tree"/>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<foundry:doc section="user" type="template-tag"> <foundry:doc section="user" type="template-tag">
<foundry:doc-desc> <foundry:doc-desc>
<p> <p>
@ -721,7 +721,7 @@
</foundry:doc> </foundry:doc>
<xsl:template match="content-item-layout"> <xsl:template match="content-item-layout">
<xsl:param name="contentitem-tree" tunnel="yes"/> <xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:apply-templates> <xsl:apply-templates>
<xsl:with-param name="id" <xsl:with-param name="id"
select="$contentitem-tree/name"/> select="$contentitem-tree/name"/>
@ -747,28 +747,28 @@
</xsl:when> </xsl:when>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<foundry:doc section="user" type="template-tag"> <foundry:doc section="user" type="template-tag">
<foundry:doc-desc> <foundry:doc-desc>
<p> <p>
Provides a link to content item itself. Useful if a content item Provides a link to content item itself. Useful if a content item
is shown using a portlet and you want to create a link to the is shown using a portlet and you want to create a link to the
normal detail view of the item. normal detail view of the item.
</p> </p>
</foundry:doc-desc> </foundry:doc-desc>
</foundry:doc> </foundry:doc>
<xsl:template match="content-item-layout//content-item-link"> <xsl:template match="content-item-layout//content-item-link">
<xsl:param name="contentitem-tree" tunnel="yes"/> <xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:apply-templates> <xsl:apply-templates>
<xsl:with-param name="href" <xsl:with-param name="href"
tunnel="yes" tunnel="yes"
select="concat($context-prefix, select="concat($context-prefix,
'/redirect/?oid=', '/redirect/?oid=',
$contentitem-tree/masterVersion/@oid)"/> $contentitem-tree/masterVersion/@oid)"/>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:template> </xsl:template>
<foundry:doc section="user" type="template-tag"> <foundry:doc section="user" type="template-tag">
<foundry:doc-desc> <foundry:doc-desc>
<p> <p>
@ -782,7 +782,7 @@
<xsl:template match="/content-item-layout//if-property"> <xsl:template match="/content-item-layout//if-property">
<xsl:param name="contentitem-tree" tunnel="yes"/> <xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:variable name="name" select="./@name"/> <xsl:variable name="name" select="./@name"/>
<xsl:choose> <xsl:choose>
<xsl:when test="$contentitem-tree/*[name() = $name]"> <xsl:when test="$contentitem-tree/*[name() = $name]">
<xsl:apply-templates/> <xsl:apply-templates/>
@ -791,15 +791,15 @@
<xsl:apply-templates/> <xsl:apply-templates/>
</xsl:when> </xsl:when>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<foundry:doc section="user" type="template-tag"> <foundry:doc section="user" type="template-tag">
<foundry:doc-desc> <foundry:doc-desc>
<p> <p>
Generic tag to show the value of the property with the Generic tag to show the value of the property with the
specified name. This tag can be used if there are no special specified name. This tag can be used if there are no special
tags for a content type. tags for a content type.
</p> </p>
</foundry:doc-desc> </foundry:doc-desc>
<foundry:doc-see-also> <foundry:doc-see-also>
@ -811,19 +811,19 @@
<xsl:template match="/content-item-layout//show-property"> <xsl:template match="/content-item-layout//show-property">
<xsl:param name="contentitem-tree" tunnel="yes"/> <xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:variable name="name" select="./@name"/> <xsl:variable name="name" select="./@name"/>
<xsl:choose> <xsl:choose>
<xsl:when test="$contentitem-tree/*[name() = $name]"> <xsl:when test="$contentitem-tree/*[name() = $name]">
<xsl:choose> <xsl:choose>
<xsl:when test="foundry:boolean(./@disable-output-escaping)"> <xsl:when test="foundry:boolean(./@disable-output-escaping)">
<xsl:value-of disable-output-escaping="yes" <xsl:value-of disable-output-escaping="yes"
select="$contentitem-tree/*[name() = $name]"/> select="$contentitem-tree/*[name() = $name]"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$contentitem-tree/*[name() = $name]"/> <xsl:value-of select="$contentitem-tree/*[name() = $name]"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:when> </xsl:when>
<xsl:when test="$contentitem-tree/nav:attribute[@name = $name]"> <xsl:when test="$contentitem-tree/nav:attribute[@name = $name]">
<xsl:choose> <xsl:choose>
@ -835,7 +835,7 @@
<xsl:value-of select="$contentitem-tree/nav:attribute[@name = $name]"/> <xsl:value-of select="$contentitem-tree/nav:attribute[@name = $name]"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:if test="foundry:debug-enabled()"> <xsl:if test="foundry:debug-enabled()">
@ -846,14 +846,14 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<foundry:doc section="user" type="template-tag"> <foundry:doc section="user" type="template-tag">
<foundry:doc-desc> <foundry:doc-desc>
<p> <p>
Generic tag for showing date properties. The format of the Generic tag for showing date properties. The format of the
date is configured using one or more <code>date-element</code> date is configured using one or more <code>date-element</code>
inside this tag. tags inside this tag.
</p> </p>
</foundry:doc-desc> </foundry:doc-desc>
<foundry:doc-see-also> <foundry:doc-see-also>
<foundry:doc-link href="#show-property"> <foundry:doc-link href="#show-property">
@ -869,11 +869,11 @@
<xsl:template match="/content-item-layout//show-date-property"> <xsl:template match="/content-item-layout//show-date-property">
<xsl:param name="contentitem-tree" tunnel="yes"/> <xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:variable name="name" select="./@name"/> <xsl:variable name="name" select="./@name"/>
<xsl:choose> <xsl:choose>
<xsl:when test="$contentitem-tree/*[name() = $name]"> <xsl:when test="$contentitem-tree/*[name() = $name]">
<xsl:call-template name="foundry:format-date"> <xsl:call-template name="foundry:format-date">
<xsl:with-param name="date-elem" <xsl:with-param name="date-elem"
select="$contentitem-tree/*[name() = $name]"/> select="$contentitem-tree/*[name() = $name]"/>
<xsl:with-param name="date-format" <xsl:with-param name="date-format"
select="./date-format"/> select="./date-format"/>
@ -881,7 +881,7 @@
</xsl:when> </xsl:when>
<xsl:when test="$contentitem-tree/nav:attribute[@name = $name]"> <xsl:when test="$contentitem-tree/nav:attribute[@name = $name]">
<xsl:call-template name="foundry:format-date"> <xsl:call-template name="foundry:format-date">
<xsl:with-param name="date-elem" <xsl:with-param name="date-elem"
select="$contentitem-tree/nav:attribute[@name = $name]"/> select="$contentitem-tree/nav:attribute[@name = $name]"/>
<xsl:with-param name="date-format" <xsl:with-param name="date-format"
select="./date-format"/> select="./date-format"/>
@ -896,16 +896,16 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<foundry:doc section="user" type="template-tag"> <foundry:doc section="user" type="template-tag">
<foundry:doc-desc> <foundry:doc-desc>
<p> <p>
Provides the <code>href</code> for creating a link to edit the current item in the Provides the <code>href</code> for creating a link to edit the current item in the
content centre if the current user is logged in and has the permission to edit the content centre if the current user is logged in and has the permission to edit the
item. item.
</p> </p>
<p> <p>
To use this feature put the following snippet like the following into the To use this feature put something following snippet into the
templates for the content items in your theme: templates for the content items in your theme:
</p> </p>
<pre> <pre>
@ -920,19 +920,19 @@
&#x3c;/edit-link&#x3e; &#x3c;/edit-link&#x3e;
</pre> </pre>
<p> <p>
The example uses an UTF-8 character from the <em>Dingbats</em> block (a pencil). The example uses an UTF-8 character from the <em>Dingbats</em> block (a pencil).
You can of course use another character, text or an image. To You can of course use another character, text or an image. To
reduce the amount of code needed you may add a fragment template and include this reduce the amount of code needed you may add a fragment template and include this
template using the <code>include</code> tag. template using the <code>include</code> tag.
</p> </p>
<p> <p>
You also have to include styles for the edit link into your theme. You also have to include styles for the edit link into your theme.
The <em>foundry-base</em> theme, for example, puts the edit link the top right The <em>foundry-base</em> theme, for example, puts the edit link the top right
corner of the area which shows the content item. This is done by the following corner of the area which shows the content item. This is done by the following
styles: styles:
</p> </p>
<pre> <pre>
/* Sets the reference point for position: absolute /* Sets the reference point for position: absolute
to the main element block */ to the main element block */
main { main {
position: relative; position: relative;
@ -943,20 +943,20 @@
display: none; display: none;
} }
/* Display the edit link in the top right corner /* Display the edit link in the top right corner
of the content item area if the cursor is in of the content item area if the cursor is in
the content item area */ the content item area */
main:hover .edit-link { main:hover .edit-link {
display: block; display: block;
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
font-size: 30px; font-size: 30px;
color: #0776a0; color: #0776a0;
/* Blue border around the link */ /* Blue border around the link */
border: 1px solid #0776a0; border: 1px solid #0776a0;
/* Make the link 32px in width and height */ /* Make the link 32px in width and height */
width: 32px; width: 32px;
height: 32px; height: 32px;
text-align: center; text-align: center;
} }
@ -964,7 +964,7 @@
/* Remove default decoration for links */ /* Remove default decoration for links */
main:hover .edit-link a:link, main:hover .edit-link a:link,
main:hover .edit-link a:hover, main:hover .edit-link a:hover,
main:hover .edit-link a:active, main:hover .edit-link a:active,
main:hover .edit-link a:visited { main:hover .edit-link a:visited {
color: #0776a0; color: #0776a0;
text-decoration: none; text-decoration: none;
@ -974,25 +974,25 @@
</foundry:doc-desc> </foundry:doc-desc>
</foundry:doc> </foundry:doc>
<xsl:template match="content-item-layout//edit-link | fragment-layout//edit-link"> <xsl:template match="content-item-layout//edit-link | fragment-layout//edit-link">
<xsl:param name="contentitem-tree" tunnel="yes"/> <xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:if test="$contentitem-tree/editLink"> <xsl:if test="$contentitem-tree/editLink">
<xsl:apply-templates> <xsl:apply-templates>
<xsl:with-param name="href" <xsl:with-param name="href"
tunnel="yes" tunnel="yes"
select="concat($context-prefix, '/ccm', select="concat($context-prefix, '/ccm',
$contentitem-tree/editLink)"/> $contentitem-tree/editLink)"/>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<xsl:function name="foundry:generate-contentitem-link"> <xsl:function name="foundry:generate-contentitem-link">
<xsl:param name="oid"/> <xsl:param name="oid"/>
<xsl:sequence select="concat($context-prefix, '/redirect/?oid=', $oid)"/> <xsl:sequence select="concat($context-prefix, '/redirect/?oid=', $oid)"/>
</xsl:function> </xsl:function>
</xsl:stylesheet> </xsl:stylesheet>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
This file is part of the Foundry Theme Engine for LibreCCM This file is part of the Foundry Theme Engine for LibreCCM
Foundry is free software: you can redistribute it and/or modify Foundry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or the Free Software Foundation, either version 2 of the License, or
@ -28,18 +28,20 @@
<foundry:doc-file-title>Data tags</foundry:doc-file-title> <foundry:doc-file-title>Data tags</foundry:doc-file-title>
<foundry:doc-file-desc> <foundry:doc-file-desc>
<p> <p>
These tags can be used to display several informations from the These tags can be used to display several informations provided
XML provided by CCM. by CCM.
</p> </p>
</foundry:doc-file-desc> </foundry:doc-file-desc>
</foundry:doc-file> </foundry:doc-file>
<foundry:doc section="user" <foundry:doc section="user"
type="template-tag"> type="template-tag">
<foundry:doc-desc> <foundry:doc-desc>
Outputs the title of the current page. For a content item, this is <p>
the title of the content item. For more details please refer to Outputs the title of the current page. For a content item, this
the documentation of the <code>foundry:title</code> function. is the title of the content item. For more details please refer
to the documentation of the <code>foundry:title</code> function.
</p>
</foundry:doc-desc> </foundry:doc-desc>
<foundry:doc-see-also> <foundry:doc-see-also>
<foundry:doc-link href="#foundry:title"> <foundry:doc-link href="#foundry:title">
@ -48,30 +50,32 @@
</foundry:doc-see-also> </foundry:doc-see-also>
</foundry:doc> </foundry:doc>
<xsl:template match="show-page-title"> <xsl:template match="show-page-title">
<xsl:variable name="useCategoryMenu" <xsl:variable name="useCategoryMenu"
select="if(./@useCategoryMenu) select="if(./@useCategoryMenu)
then ./@useCategoryMenu then ./@useCategoryMenu
else 'categoryMenu'"/> else 'categoryMenu'"/>
<xsl:variable name="useRootCategoryIndexItemTitle" <xsl:variable name="useRootCategoryIndexItemTitle"
select="if(./@useRootCategoryIndexItemTitle) select="if(./@useRootCategoryIndexItemTitle)
then foundry:boolean(./@useRootCategoryIndexItemTitle) then foundry:boolean(./@useRootCategoryIndexItemTitle)
else false()"/> else false()"/>
<xsl:value-of select="foundry:title($useCategoryMenu, <xsl:value-of select="foundry:title($useCategoryMenu,
$useRootCategoryIndexItemTitle)"/> $useRootCategoryIndexItemTitle)"/>
</xsl:template> </xsl:template>
<foundry:doc section="user" <foundry:doc section="user"
type="template-tag"> type="template-tag">
<foundry:doc-desc> <foundry:doc-desc>
Outputs a static text which is retrieved from a file in the <p>
<code>texts</code> directory. If the <code>module</code> attribute Outputs a static text which is retrieved from a file in the
is not present, the <code>texts/global.xml</code> file is used. <code>texts</code> directory. If the <code>module</code> attribute
Otherwise the file provided by the module element ist used. The key is not present, the <code>texts/global.xml</code> file is used.
is the content of the element. If at least one of the attributes Otherwise the file provided by the module element ist used. The key
<code>id</code>, <code>class</code> or <code>with-colorset</code> is is the content of the element. If at least one of the attributes
present at the attribute, the text is wrapped in a <code>id</code>, <code>class</code> or <code>with-colorset</code> is
present at the attribute, the text is wrapped in a
<code>span</code> element. <code>span</code> element.
</p>
</foundry:doc-desc> </foundry:doc-desc>
<foundry:doc-attributes> <foundry:doc-attributes>
<foundry:doc-attribute name="id"> <foundry:doc-attribute name="id">
@ -82,13 +86,13 @@
</foundry:doc-attribute> </foundry:doc-attribute>
<foundry:doc-attribute name="module"> <foundry:doc-attribute name="module">
<p> <p>
The module (file) from the text is retrieved. The name of the file should be The module (file) from the text is retrieved. The name of the file should be
provided without file extension. provided without file extension.
</p> </p>
</foundry:doc-attribute> </foundry:doc-attribute>
<foundry:doc-attribute name="with-colorset"> <foundry:doc-attribute name="with-colorset">
<p> <p>
Add the classes for using the Colorset feature to the <code>span</code> element Add the classes for using the Colorset feature to the <code>span</code> element
the text is wrapped in. the text is wrapped in.
</p> </p>
</foundry:doc-attribute> </foundry:doc-attribute>
@ -96,7 +100,7 @@
</foundry:doc> </foundry:doc>
<xsl:template match="show-text"> <xsl:template match="show-text">
<xsl:variable name="module" select="if (./@module) then ./@module else ''"/> <xsl:variable name="module" select="if (./@module) then ./@module else ''"/>
<xsl:choose> <xsl:choose>
<xsl:when test="@id != '' or @class != '' or with-colorset = 'true'"> <xsl:when test="@id != '' or @class != '' or with-colorset = 'true'">
<span> <span>
@ -109,10 +113,10 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<xsl:template match="show-internal-text"> <xsl:template match="show-internal-text">
<xsl:variable name="module" select="if (./@module) then ./@module else ''"/> <xsl:variable name="module" select="if (./@module) then ./@module else ''"/>
<xsl:choose> <xsl:choose>
<xsl:when test="@id != '' or @class != '' or with-colorset = 'true'"> <xsl:when test="@id != '' or @class != '' or with-colorset = 'true'">
<span> <span>
@ -125,13 +129,13 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<xsl:template match="space"> <xsl:template match="space">
<xsl:value-of select="'&#x20;'"/> <xsl:value-of select="'&#x20;'"/>
</xsl:template> </xsl:template>
<xsl:template match="show-characters"> <xsl:template match="show-characters">
<xsl:value-of select="."/> <xsl:value-of select="."/>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>