From e8a69ca7fb54513cb3b9edb412535189322077df Mon Sep 17 00:00:00 2001 From: jensp Date: Wed, 24 Sep 2014 13:37:41 +0000 Subject: [PATCH] Syncing Foundry files git-svn-id: https://svn.libreccm.org/ccm/trunk@2875 8810af33-2d31-482b-a856-94f89814c4df --- .../ui/AbstractWorkspaceComponent.java | 28 ++--- .../templates/ccm-portalworkspace/index.jsp | 44 +++---- .../foundry/lib/template-tags/html-tags.xsl | 44 ++++++- .../foundry/lib/template-tags/navigation.xsl | 99 ++++++++++----- .../utils/SciProjectCSVExporter.java | 118 ++++++++++-------- 5 files changed, 216 insertions(+), 117 deletions(-) diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/AbstractWorkspaceComponent.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/AbstractWorkspaceComponent.java index 662369263..3a1bff533 100755 --- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/AbstractWorkspaceComponent.java +++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/AbstractWorkspaceComponent.java @@ -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; @@ -26,8 +25,8 @@ import com.arsdigita.portalworkspace.Workspace; import com.arsdigita.portalworkspace.WorkspacePage; /** - * - * + * + * */ public abstract class AbstractWorkspaceComponent extends SimpleContainer { @@ -42,16 +41,15 @@ public abstract class AbstractWorkspaceComponent extends SimpleContainer { private PersistentPortal m_portalDisplay; /** - * Default constructor creates a new, empty - * AbstractWorkspaceComponent using parents - * (SimpleContainer) default constructor. + * Default constructor creates a new, empty AbstractWorkspaceComponent using + * parents (SimpleContainer) default constructor. */ public AbstractWorkspaceComponent() { this(null); } /** - * + * * @param workspace */ public AbstractWorkspaceComponent(WorkspaceSelectionAbstractModel workspace) { @@ -63,7 +61,7 @@ public abstract class AbstractWorkspaceComponent extends SimpleContainer { m_workspace = workspace; m_details = new WorkspaceDetails(m_workspace); m_portal = new DefaultPortalSelectionModel(new BigDecimalParameter( - "portal")); + "portal")); m_portalList = createPortalList(m_portal); m_portalDisplay = createPortalDisplay(m_portal); @@ -87,25 +85,25 @@ public abstract class AbstractWorkspaceComponent extends SimpleContainer { } /** - * To be overwritten by children class with class specific logic. - * + * To be overwritten by children class with class specific logic. + * * @param portal * @return */ protected abstract PortalList createPortalList(PortalSelectionModel portal); /** - * To be overwritten by children class with class specific logic. - * + * To be overwritten by children class with class specific logic. + * * @param portal * @return */ protected abstract PersistentPortal createPortalDisplay( - PortalSelectionModel portal); + PortalSelectionModel portal); /** - * - */ + * + */ public void register(Page page) { super.register(page); diff --git a/ccm-portalworkspace/web/templates/ccm-portalworkspace/index.jsp b/ccm-portalworkspace/web/templates/ccm-portalworkspace/index.jsp index 3a6af9632..64966651f 100755 --- a/ccm-portalworkspace/web/templates/ccm-portalworkspace/index.jsp +++ b/ccm-portalworkspace/web/templates/ccm-portalworkspace/index.jsp @@ -1,36 +1,36 @@ + xmlns:define="/WEB-INF/bebop-define.tld" + xmlns:show="/WEB-INF/bebop-show.tld" + version="1.2"> - - - - - - + + + + + + - - DispatcherHelper.cacheDisable(response); - - - + DispatcherHelper.cacheDisable(response); + + + + if (Workspace.getConfig().getCheckWorkspaceReadPermissions()) { viewWorkspace.addRequestListener( new ApplicationAuthenticationListener(PrivilegeDescriptor.READ)); } - + - - + + ((AbstractWorkspaceComponent) view).setWorkspaceModel( new WorkspaceSelectionDefaultModel()); - - + + - + diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/html-tags.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/html-tags.xsl index 8556cf37a..f5b7cc452 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/html-tags.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/html-tags.xsl @@ -29,13 +29,40 @@ - Generates a HTML a element. +

+ Generates a HTML a element. There are some differences to the + a element in HTML. First, there two attribute for the URL: +

+
+
+ href-property +
+
+ The name of a property of the current object which contains the URL for the + link. +
+
+
+ href-static +
+
+ A static URL. +
+ +
+

+ The third variant for providing an URL is to call the template with a href + parameter in the XSL. +

+ + + @@ -52,6 +79,11 @@ + + + + + @@ -62,6 +94,16 @@ + + + + + + + + + + diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/navigation.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/navigation.xsl index 478de4833..98e505efb 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/navigation.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/navigation.xsl @@ -9,29 +9,39 @@ exclude-result-prefixes="xsl bebop foundry nav" version="1.0"> - - - - - - - - - - - - - - + + + The id of the navigation/category system from which URL should be retrieved. Default + value is categoryMenu, which is suitable in most cases. + + + If set to true (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 false, the translated name of the category system will be used. + + + if set the to true (default) Foundry will try to translate the title of the + navigation/category system using the language file lang/navigation.xml. + If set to false the title is retrieved from the data tree XML. + + + 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 a + HTML tag. The title of the navigation is printed using the navigation-title + tag. + + #a + #navigation-title + + + - - + + + + @@ -49,11 +59,34 @@ - - - + + + + + + + + + + + + + + + + + + + + @@ -95,13 +128,21 @@

applied navigation-link-list with these values:

navigation-id
-
+
+ +
min-level
-
+
+ +
max-level
-
+
+ +
current-level
-
+
+ +
diff --git a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/utils/SciProjectCSVExporter.java b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/utils/SciProjectCSVExporter.java index 6181872b6..58fc0d6e5 100644 --- a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/utils/SciProjectCSVExporter.java +++ b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/utils/SciProjectCSVExporter.java @@ -44,56 +44,56 @@ public class SciProjectCSVExporter extends Program { super("SciProjectCSVExporter", "1.0.0", ""); getOptions().addOption(OptionBuilder - .hasArg(true) - .withLongOpt(START_BEFORE) - .withDescription( - "Include only projects started before a data. Date is in ISO format (yyyy-mm-dd)") - .create()); + .hasArg(true) + .withLongOpt(START_BEFORE) + .withDescription( + "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()); + .hasArg(true) + .withLongOpt(START_AFTER) + .withDescription( + "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()); + .hasArg(true) + .withLongOpt(END_BEFORE) + .withDescription( + "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()); + .hasArg(true) + .withLongOpt(END_AFTER) + .withDescription( + "Include only projects finished after a data. Date is in ISO format (yyyy-mm-dd)"). + create()); getOptions().addOption(OptionBuilder - .hasArg(false) - .withLongOpt(OMIT_FUNDING_VOLUME) - .withDescription("Omit funding volume") - .create()); + .hasArg(false) + .withLongOpt(OMIT_FUNDING_VOLUME) + .withDescription("Omit funding volume") + .create()); getOptions().addOption(OptionBuilder - .hasArg(false) - .withLongOpt(OMIT_FUNDING_CODE) - .withDescription("Omit funding code") - .create()); + .hasArg(false) + .withLongOpt(OMIT_FUNDING_CODE) + .withDescription("Omit funding code") + .create()); getOptions().addOption(OptionBuilder - .hasArg(false) - .withLongOpt(OMIT_ROLES) - .withDescription("Omit roles") - .create()); + .hasArg(false) + .withLongOpt(OMIT_ROLES) + .withDescription("Omit roles") + .create()); getOptions().addOption(OptionBuilder - .hasArg(false) - .withLongOpt(WITH_DESC) - .withDescription("Add description to CSV") - .create()); + .hasArg(false) + .withLongOpt(WITH_DESC) + .withDescription("Add description to CSV") + .create()); } @@ -141,10 +141,28 @@ 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 - .getDataObject()); + .getDataObject()); createLine(project, buffer); @@ -208,16 +226,16 @@ public class SciProjectCSVExporter extends Program { while (members.next()) { buffer - .append(members.getSurname()) - .append(", ") - .append(members.getGivenName()); + .append(members.getSurname()) + .append(", ") + .append(members.getGivenName()); if (withRoles) { final String roleName = members.getRoleName(); final String roleLabel; final RelationAttributeCollection roles = new RelationAttributeCollection( - SciProject.ROLE_ENUM_NAME, roleName); + SciProject.ROLE_ENUM_NAME, roleName); roles.addLanguageFilter(Kernel.getConfig().getDefaultLanguage()); if (roles.isEmpty()) { @@ -229,9 +247,9 @@ public class SciProjectCSVExporter extends Program { } buffer - .append(" (") - .append(roleLabel) - .append(')'); + .append(" (") + .append(roleLabel) + .append(')'); } buffer.append("; "); @@ -246,14 +264,14 @@ public class SciProjectCSVExporter extends Program { while (sponsors.next()) { if (withFundingCode && sponsors.getFundingCode() != null) { buffer - .append(sponsors.getSponsor().getTitle()) - .append(" (") - .append(sponsors.getFundingCode()) - .append(");"); + .append(sponsors.getSponsor().getTitle()) + .append(" (") + .append(sponsors.getFundingCode()) + .append(");"); } else { buffer - .append(sponsors.getSponsor().getTitle()) - .append("; "); + .append(sponsors.getSponsor().getTitle()) + .append("; "); } } }