Syncing Foundry files

git-svn-id: https://svn.libreccm.org/ccm/trunk@2875 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-09-24 13:37:41 +00:00
parent b18536aa4f
commit e8a69ca7fb
5 changed files with 216 additions and 117 deletions

View File

@ -15,7 +15,6 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package com.arsdigita.portalworkspace.ui;
import com.arsdigita.bebop.Page;
@ -42,9 +41,8 @@ public abstract class AbstractWorkspaceComponent extends SimpleContainer {
private PersistentPortal m_portalDisplay;
/**
* Default constructor creates a new, empty
* <code>AbstractWorkspaceComponent</code> using parents
* (SimpleContainer) default constructor.
* Default constructor creates a new, empty <code>AbstractWorkspaceComponent</code> using
* parents (SimpleContainer) default constructor.
*/
public AbstractWorkspaceComponent() {
this(null);

View File

@ -29,13 +29,40 @@
<foundry:doc>
<foundry:doc-desc>
Generates a HTML <code>a</code> element.
<p>
Generates a HTML <code>a</code> element. There are some differences to the
<code>a</code> element in HTML. First, there two attribute for the URL:
</p>
<dl>
<dt>
<code>href-property</code>
</dt>
<dd>
The name of a property of the current object which contains the URL for the
link.
</dd>
<dt>
<dt>
<code>href-static</code>
</dt>
<dd>
A static URL.
</dd>
</dt>
</dl>
<p>
The third variant for providing an URL is to call the template with a href
parameter in the XSL.
</p>
</foundry:doc-desc>
<foundry:doc-see-also>
<foundry:doc-link href="http://www.w3.org/TR/html5/text-level-semantics.html#the-a-element"/>
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="a">
<xsl:with-param name="href" select="''"/>
<xsl:with-param name="title" select="''"/>
<a>
<xsl:if test="./@download">
<xsl:attribute name="download">
@ -52,6 +79,11 @@
<xsl:value-of select="./@href-static"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$href != ''">
<xsl:attribute name="href">
<xsl:value-of select="$href"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="./@href-lang">
<xsl:attribute name="hreflang">
<xsl:value-of select="./@href-lang"/>
@ -62,6 +94,16 @@
<xsl:value-of select="./@rel"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="./title-static">
<xsl:attribute name="title">
<xsl:value-of select="foundry:get-static-text('', ./@static-title)"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$title != ''">
<xsl:attribute name="title">
<xsl:value-of select="$title"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="./@type">
<xsl:attribute name="type">
<xsl:value-of select="./@type"/>

View File

@ -9,6 +9,65 @@
exclude-result-prefixes="xsl bebop foundry nav"
version="1.0">
<foundry:doc>
<foundry:doc-attribute name="navigation-id">
The id of the navigation/category system from which URL should be retrieved. Default
value is <code>categoryMenu</code>, which is suitable in most cases.
</foundry:doc-attribute>
<foundry:doc-attribute name="show-description-text">
If set to <code>true</code> (true) the description text for the category system from the
data tree XML will be used as value of the title attribute.
If set to <code>false</code>, the translated name of the category system will be used.
</foundry:doc-attribute>
<foundry:doc-attribute name="use-static-title">
if set the to <code>true</code> (default) Foundry will try to translate the title of the
navigation/category system using the language file <code>lang/navigation.xml</code>.
If set to <code>false</code> the title is retrieved from the data tree XML.
</foundry:doc-attribute>
<foundry:doc-desc>
Environment for outputting the home link for a navigation/category system. This tag
only intializes the context. The link itself has to be rendered using the <code>a</code>
HTML tag. The title of the navigation is printed using the <code>navigation-title</code>
tag.
</foundry:doc-desc>
<foundry:doc-see-also>#a</foundry:doc-see-also>
<foundry:doc-see-also>#navigation-title</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="navigation-home-link">
<xsl:variable name="navigation-id"
select="foundry:get-attribute-value('navigation-id', 'categoryMenu')"/>
<xsl:apply-templates>
<xsl:with-param name="href"
select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@url"/>
<xsl:with-param name="navigation-id" select="$navigation-id"/>
<xsl:with-param name="title">
<xsl:choose>
<xsl:when test="./@show-description-text = 'false'">
<xsl:choose>
<xsl:when test="./@use-static-title = 'false'">
<xsl:value-of select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@title"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="foundry:get-static-text('navigation',
$data-tree//nav:categoryMenu[@id=$navigation-id]/@navigation-id,
'false')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@description"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="navigation-home-link//navigation-title">
<xsl:param name="navigation-id"/>
<xsl:value-of select="foundry:shying($data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@title)"/>
</xsl:template>
<xsl:template match="navigation-layout">
<xsl:apply-templates>
<xsl:with-param name="navigation-id"
@ -26,33 +85,7 @@
</xsl:apply-templates>
</xsl:template>
<xsl:template match="navigation-layout//navigation-home-link">
<xsl:param name="navigation-id"/>
<xsl:param name="show-description-text"/>
<a href="{$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@url}">
<xsl:attribute name="title">
<xsl:choose>
<xsl:when test="./@show-description-text = 'false'">
<xsl:choose>
<xsl:when test="./@use-static-title = 'false'">
<xsl:value-of select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@title"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="foundry:get-static-text('navigation',
$data-tree//nav:categoryMenu[@id=$navigation-id]/@navigation-id,
'false')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@description"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="foundry:shying($data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@title)"/>
</a>
</xsl:template>
<xsl:template match="navigation-layout//navigation-link-list"
name="navigation-link-list">
@ -95,13 +128,21 @@
<h1>applied navigation-link-list with these values:</h1>
<dl>
<dt>navigation-id</dt>
<dd><xsl:value-of select="$navigation-id"/></dd>
<dd>
<xsl:value-of select="$navigation-id"/>
</dd>
<dt>min-level</dt>
<dd><xsl:value-of select="$min-level"/></dd>
<dd>
<xsl:value-of select="$min-level"/>
</dd>
<dt>max-level</dt>
<dd><xsl:value-of select="$max-level"/></dd>
<dd>
<xsl:value-of select="$max-level"/>
</dd>
<dt>current-level</dt>
<dd><xsl:value-of select="$current-level"/></dd>
<dd>
<xsl:value-of select="$current-level"/>
</dd>
</dl>
<xsl:if test="$current-level &gt;= min-level">

View File

@ -47,29 +47,29 @@ public class SciProjectCSVExporter extends Program {
.hasArg(true)
.withLongOpt(START_BEFORE)
.withDescription(
"Include only projects started before a data. Date is in ISO format (yyyy-mm-dd)")
.create());
"Include only projects started before a data. Date is in ISO format (yyyy-mm-dd)").
create());
getOptions().addOption(OptionBuilder
.hasArg(true)
.withLongOpt(START_AFTER)
.withDescription(
"Include only projects started after a data. Date is in ISO format (yyyy-mm-dd)")
.create());
"Include only projects started after a data. Date is in ISO format (yyyy-mm-dd)").
create());
getOptions().addOption(OptionBuilder
.hasArg(true)
.withLongOpt(END_BEFORE)
.withDescription(
"Include only projects finished before a data. Date is in ISO format (yyyy-mm-dd)")
.create());
"Include only projects finished before a data. Date is in ISO format (yyyy-mm-dd)").
create());
getOptions().addOption(OptionBuilder
.hasArg(true)
.withLongOpt(END_AFTER)
.withDescription(
"Include only projects finished after a data. Date is in ISO format (yyyy-mm-dd)")
.create());
"Include only projects finished after a data. Date is in ISO format (yyyy-mm-dd)").
create());
getOptions().addOption(OptionBuilder
.hasArg(false)
@ -141,6 +141,24 @@ public class SciProjectCSVExporter extends Program {
withDesc = true;
}
//First line with column labels
createColumn("Name", buffer);
createColumn("Begin", buffer);
createColumn("End", buffer);
createColumn("Members", buffer);
createColumn("Short description", buffer);
if (withDesc) {
createColumn("Description", buffer);
}
createColumn("Sponsors", buffer);
if (withFundingVolume) {
createColumn("Funding volme", buffer);
}
buffer.append(LINE_SEPARATOR);
while (projects.next()) {
final SciProject project = (SciProject) DomainObjectFactory.newInstance(projects