- 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;
/**
* 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
* 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
* uses a XML format for loading the enum data, which looks like this:
*
*
* <pre>
* &lt;ddenums&gt;
* &lt;ddenum name="..."&gt;
@ -39,27 +39,27 @@ import org.xml.sax.helpers.DefaultHandler;
* &lt;/ddenum&gt;
* &lt;/ddenums&gt;
* </pre>
*
* The root element is {@code <ddenums>} which can appear only once per file.
* The {@code <ddenums} can have multiple {@code <ddenum>} elements as child
* elements. The {@code <ddenum> element has one attribute, {@code name} which
* contains the name of the enumeration. Each {@code <ddenum>} may have multiple
*
* The root element is {@code <ddenums>} which can appear only once per file.
* The {@code <ddenums} can have multiple {@code <ddenum>} elements as child
* elements. The {@code <ddenum> element has one attribute, {@code name} which
* contains the name of the enumeration. Each {@code <ddenum>} may have multiple
* {@code<entry>} child elements. The {@code <entry>} element has three attributes.
*
*
* <dl>
* <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}
* 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
* value is maybe ignored by this import tool.</dd>
* </dl>
*
* 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
*
* 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
* an description element containing a description of the entry.
*
*
* @author Jens Pelzetter <jens@jp-digital.de>
* @version $Id$
*/
@ -67,7 +67,7 @@ public class RelationAttributeImportTool {
/** Internal logger instance to faciliate debugging. Enable logging output
* 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. */
private final static Logger LOGGER = Logger.getLogger(RelationAttributeImportTool.class);
@ -168,18 +168,18 @@ public class RelationAttributeImportTool {
currentKey));
return;
}
LOGGER.warn("Creating RelationAttribute entry with this values:");
LOGGER.warn(String.format("\tcurrentEnum = '%s'", currentEnum));
LOGGER.warn(String.format("\tcurrentKey = '%s'", currentKey));
LOGGER.warn(String.format("\tcurrentLang = '%s'", currentLang));
LOGGER.warn(String.format("\tcurrentValue = '%s'", currentValue));
LOGGER.debug("Creating RelationAttribute entry with this values:");
LOGGER.debug(String.format("\tcurrentEnum = '%s'", currentEnum));
LOGGER.debug(String.format("\tcurrentKey = '%s'", currentKey));
LOGGER.debug(String.format("\tcurrentLang = '%s'", currentLang));
LOGGER.debug(String.format("\tcurrentValue = '%s'", currentValue));
final RelationAttribute entry = new RelationAttribute();
if ((currentId != null) && !currentId.isEmpty()) {
entry.setID(new BigDecimal(currentId));
}
}
entry.setAttribute(currentEnum);
entry.setKey(currentKey);
entry.setLanguage(currentLang);

View File

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

View File

@ -1,9 +1,9 @@
<?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
@ -28,18 +28,20 @@
<foundry:doc-file-title>Data tags</foundry:doc-file-title>
<foundry:doc-file-desc>
<p>
These tags can be used to display several informations from the
XML provided by CCM.
These tags can be used to display several informations provided
by CCM.
</p>
</foundry:doc-file-desc>
</foundry:doc-file>
<foundry:doc section="user"
type="template-tag">
<foundry:doc-desc>
Outputs the title of the current page. For a content item, this is
the title of the content item. For more details please refer to
the documentation of the <code>foundry:title</code> function.
<p>
Outputs the title of the current page. For a content item, this
is the title of the content item. For more details please refer
to the documentation of the <code>foundry:title</code> function.
</p>
</foundry:doc-desc>
<foundry:doc-see-also>
<foundry:doc-link href="#foundry:title">
@ -48,30 +50,32 @@
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="show-page-title">
<xsl:variable name="useCategoryMenu"
select="if(./@useCategoryMenu)
<xsl:variable name="useCategoryMenu"
select="if(./@useCategoryMenu)
then ./@useCategoryMenu
else 'categoryMenu'"/>
<xsl:variable name="useRootCategoryIndexItemTitle"
select="if(./@useRootCategoryIndexItemTitle)
select="if(./@useRootCategoryIndexItemTitle)
then foundry:boolean(./@useRootCategoryIndexItemTitle)
else false()"/>
<xsl:value-of select="foundry:title($useCategoryMenu,
<xsl:value-of select="foundry:title($useCategoryMenu,
$useRootCategoryIndexItemTitle)"/>
</xsl:template>
<foundry:doc section="user"
type="template-tag">
<foundry:doc-desc>
Outputs a static text which is retrieved from a file in the
<code>texts</code> directory. If the <code>module</code> attribute
is not present, the <code>texts/global.xml</code> file is used.
Otherwise the file provided by the module element ist used. The key
is the content of the element. If at least one of the attributes
<code>id</code>, <code>class</code> or <code>with-colorset</code> is
present at the attribute, the text is wrapped in a
<p>
Outputs a static text which is retrieved from a file in the
<code>texts</code> directory. If the <code>module</code> attribute
is not present, the <code>texts/global.xml</code> file is used.
Otherwise the file provided by the module element ist used. The key
is the content of the element. If at least one of the attributes
<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.
</p>
</foundry:doc-desc>
<foundry:doc-attributes>
<foundry:doc-attribute name="id">
@ -82,13 +86,13 @@
</foundry:doc-attribute>
<foundry:doc-attribute name="module">
<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.
</p>
</foundry:doc-attribute>
<foundry:doc-attribute name="with-colorset">
<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.
</p>
</foundry:doc-attribute>
@ -96,7 +100,7 @@
</foundry:doc>
<xsl:template match="show-text">
<xsl:variable name="module" select="if (./@module) then ./@module else ''"/>
<xsl:choose>
<xsl:when test="@id != '' or @class != '' or with-colorset = 'true'">
<span>
@ -109,10 +113,10 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="show-internal-text">
<xsl:variable name="module" select="if (./@module) then ./@module else ''"/>
<xsl:choose>
<xsl:when test="@id != '' or @class != '' or with-colorset = 'true'">
<span>
@ -125,13 +129,13 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="space">
<xsl:value-of select="'&#x20;'"/>
</xsl:template>
<xsl:template match="show-characters">
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>