Foundry now supports the ccm-cms-types-decisiontree

git-svn-id: https://svn.libreccm.org/ccm/trunk@3007 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-12-05 12:41:05 +00:00
parent 15d742c003
commit b0bfa388bf
8 changed files with 364 additions and 0 deletions

View File

@ -21,6 +21,9 @@
<content-item content-type="com.arsdigita.cms.contenttypes.Bookmark">
content-items/bookmark-detail.xml
</content-item>
<content-item content-type="com.arsdigita.cms.contenttypes.DecisionTree">
content-items/decisiontree-detail.xml
</content-item>
<content-item content-type="com.arsdigita.cms.contenttypes.Event">
content-items/event-detail.xml
</content-item>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<content-item-layout>
<!--<h2>
<content-item-title/>
</h2>-->
<div class="lead">
<show-property name="pageDescription"/>
</div>
<div class="main">
<decisiontree-current-section>
<h2>
<section-title/>
</h2>
<div>
<section-instructions/>
</div>
<options>
<class-form>decisiontree-section</class-form>
<class-formgroup>formgroup</class-formgroup>
<class-label>option-label</class-label>
<class-input>option-input</class-input>
<class-buttons>submit-cancel-section</class-buttons>
<class-cancel>decisiontree-cancel</class-cancel>
<class-submit>decisiontree-submit</class-submit>
</options>
</decisiontree-current-section>
</div>
</content-item-layout>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<portlet-layout>
<div class="portlet portlet-simple">
<portlet-simple-content/>
</div>
</portlet-layout>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<foundry:static-texts xmlns:foundry="http://foundry.libreccm.org">
<text id="cancel">
<translation lang="de">Abbrechen</translation>
<translation lang="en">Cancel</translation>
</text>
<text id="submit">
<translation lang="de">Weiter</translation>
<translation lang="en">Next</translation>
</text>
</foundry:static-texts>

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stylesheet [<!ENTITY nbsp '&#160;'>
<!ENTITY shy '&#173;'>
<!ENTITY ndash '&#8211;'>]>
<!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
This file is part of the Foundry Theme Engine for LibreCCM
Foundry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Foundry is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foundry If not, see <http://www.gnu.org/licenses/>.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:foundry="http://foundry.libreccm.org"
xmlns:nav="http://ccm.redhat.com/navigation"
xmlns:ui="http://www.arsdigita.com/ui/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="xsl xs bebop foundry ui"
version="2.0">
<!--
Edit this file to include custom extensions into your theme.
For each file to include add a line like
<xsl:import href="your-extension.xsl"/>
The path is relative to this file.
-->
</xsl:stylesheet>

View File

@ -31,6 +31,7 @@
<xsl:import href="content-items/article.xsl"/>
<xsl:import href="content-items/bookmark.xsl"/>
<xsl:import href="content-items/decisiontree.xsl"/>
<xsl:import href="content-items/event.xsl"/>
<xsl:import href="content-items/mpa.xsl"/>
<xsl:import href="content-items/news.xsl"/>

View File

@ -0,0 +1,230 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
This file is part of the Foundry Theme Engine for LibreCCM
Foundry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Foundry is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foundry If not, see <http://www.gnu.org/licenses/>.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:cms="http://www.arsdigita.com/cms/1.0"
xmlns:foundry="http://foundry.libreccm.org"
xmlns:nav="http://ccm.redhat.com/navigation"
xmlns:ui="http://www.arsdigita.com/ui/1.0"
exclude-result-prefixes="xsl xs bebop cms foundry nav ui"
version="2.0">
<foundry:doc-file>
<foundry:doc-file-title>Tags for displaying a Decisiontree item</foundry:doc-file-title>
<foundry:doc-file-desc>
<p>
The tags are used to configure the output of the decisiontree item. For technical
reasons it is not yet possible to customise the HTML for the decisiontree
completely.
</p>
<p>
For title and description of the decisiontree the standard tags can be used.
</p>
</foundry:doc-file-desc>
</foundry:doc-file>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
<p>
Root element for outputting the current section of a decisiontree.
</p>
</foundry:doc-desc>
</foundry:doc>
<xsl:template match="/content-item-layout//decisiontree-current-section">
<xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:variable name="current-section">
<xsl:copy-of select="$contentitem-tree/sections[title]/*"/>
</xsl:variable>
<xsl:variable name="parameters">
<xsl:copy-of select="$contentitem-tree/parameters"/>
</xsl:variable>
<xsl:apply-templates>
<xsl:with-param name="current-section" tunnel="yes" select="$current-section"/>
<xsl:with-param name="current-section-oid"
tunnel="yes"
select="$contentitem-tree/sections[title]/@oid"/>
<xsl:with-param name="parameters" tunnel="yes" select="$parameters"/>
<xsl:with-param name="current-url"
tunnel="yes"
select="$contentitem-tree/customInfo/@currentURL"/>
</xsl:apply-templates>
</xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
<p>
Outputs the title of the current section of a decisiontree.
</p>
</foundry:doc-desc>
</foundry:doc>
<xsl:template match="decisiontree-current-section//section-title">
<xsl:param name="current-section" tunnel="yes"/>
<xsl:value-of select="$current-section/title"/>
</xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
<p>
Outputs the instructions for the current section of a decisiontree.
</p>
</foundry:doc-desc>
</foundry:doc>
<xsl:template match="decisiontree-current-section//section-instructions">
<xsl:param name="current-section" tunnel="yes"/>
<xsl:value-of disable-output-escaping="yes" select="$current-section/instructions"/>
</xsl:template>
<foundry:doc section="user" type="decisiontree">
<foundry:doc-desc>
<p>
Outputs the options for the current section of a decisiontree. This tag outputs
a complete HTML form because the current implementation of the decisiontree does not
provide enough information in the XML to support a fully customisable HTML.
</p>
<p>
Nevertheless this it is possible to customise the classes set on various of the HTML
in the created form using subelements:
</p>
<dl>
<dt>
<code>class-form</code>
</dt>
<dd>
Classes for the form itself.
</dd>
<dt>
<code>class-formgroup</code>
</dt>
<dd>
Classes to set on the <code>div</code> surrouding each pair of a label and an
input element.
</dd>
<dt>
<code>class-label</code>
</dt>
<dd>
Classes to set on each label.
</dd>
<dt>
<code>class-input</code>
</dt>
<dd>
Classes to set on each input element.
</dd>
<dt>
<code>class-buttons</code>
</dt>
<dd>
Classes to set on the <code>div</code> surrounding the submit and cancel button.
</dd>
<dt>
<code>class-cancel</code>
</dt>
<dd>
Classes to set on the cancel button.
</dd>
<dt>
<code>class-submit</code>
</dt>
<dd>
Classes to set on the submit button.
</dd>
</dl>
</foundry:doc-desc>
</foundry:doc>
<xsl:template match="decisiontree-current-section//options">
<xsl:param name="current-section" tunnel="yes"/>
<xsl:param name="current-section-oid" tunnel="yes"/>
<xsl:param name="parameters" tunnel="yes"/>
<xsl:param name="current-url" tunnel="yes"/>
<xsl:variable name="class-form" select="./class-form"/>
<xsl:variable name="class-formgroup" select="./class-formgroup"/>
<xsl:variable name="class-label" select="./class-label"/>
<xsl:variable name="class-input" select="./class-input"/>
<xsl:variable name="class-buttons" select="./class-buttons"/>
<xsl:variable name="class-submit" select="./class-submit"/>
<xsl:variable name="class-cancel" select="./class-cancel"/>
<script type="text/javascript"
src="{$context-prefix}/templates/ccm-cms-types-decisiontree/forms.js"/>
<form method="get"
action="{$context-prefix}/templates/ccm-cms-types-decisiontree/form-handler.jsp"
class="{$class-form}">
<input name="section_oid"
type="hidden"
value="{$current-section-oid}"/>
<input name="return_url"
type="hidden"
value="{$current-url}"/>
<xsl:for-each select="$parameters">
<xsl:if test="./@name != 'output'">
<input type="hidden"
name="{./@name}"
value="{./@value}"/>
</xsl:if>
</xsl:for-each>
<xsl:for-each select="$current-section/sectionOptions">
<xsl:sort select="./rank"/>
<div class="{$class-formgroup}">
<label for="{./@oid}"
class="{$class-label}">
<xsl:value-of select="./label"/>
</label>
<input type="radio"
class="{$class-input}"
name="{$current-section/parameterName}"
value="{./value}"
id="./@oid"/>
</div>
</xsl:for-each>
<xsl:variable name="cancel-text"
select="foundry:get-static-text('decisiontree', 'cancel')"/>
<xsl:variable name="submit-text"
select="foundry:get-static-text('decisiontree', 'submit')"/>
<div class="{$class-buttons}">
<input type="submit"
class="{$class-cancel}"
value="{$cancel-text}"
name="cancel">
</input>
<input type="submit"
class="{$class-submit}"
onclick="return-validate(this.form)"
value="{$submit-text}"
name="next"/>
</div>
</form>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stylesheet>
<!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
This file is part of the Foundry Theme Engine for LibreCCM
Foundry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Foundry is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foundry If not, see <http://www.gnu.org/licenses/>.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:portlet="http://www.uk.arsdigita.com/portlet/1.0"
exclude-result-prefixes="xsl portlet"
version="2.0">
<xsl:template match="portlet-layout//portlet-simple-content">
<xsl:param name="portlet-data-tree" tunnel="yes"/>
<xsl:apply-templates select="$portlet-data-tree/portlet:simple/*"/>
</xsl:template>
</xsl:stylesheet>