From 3683f0e5117248924169794c3c600c76228b2216 Mon Sep 17 00:00:00 2001 From: jensp Date: Fri, 23 May 2014 08:58:35 +0000 Subject: [PATCH] PublicationsPersons finished. git-svn-id: https://svn.libreccm.org/ccm/trunk@2647 8810af33-2d31-482b-a856-94f89814c4df --- .../publications_persons_relations.xml | 25 + .../SciPublicationsPersonsLoader.java | 6 +- ...ciPublicationsPersonsResources.properties} | 1 + ...ublicationsPersonsResources_de.properties} | 1 + .../SciPublicationsPersonsService.java | 1 + ...iPublicationsPersonsExtraXMLGenerator.java | 16 +- .../ui/SciPublicationsPersonsPersonForm.java | 2 +- .../ui/SciPublicationsPersonsPersonTable.java | 21 +- .../PublicationTypeAssetResources.properties | 1 + ...ublicationTypeAssetResources_de.properties | 1 + .../mandalay/includes/mandalay/toolbox.xsl | 1013 +++++++++-------- .../themes/mandalay/layout/defaultLayout.xml | 1 + .../user/includes/mandalay/layoutParser.xsl | 4 + .../user/includes/types/SciPublications.xsl | 59 +- .../SciPublications/publications-persons.xsl | 92 ++ 15 files changed, 711 insertions(+), 533 deletions(-) create mode 100644 ccm-sci-assets-publicationspersons/src/WEB-INF/resources/publications_persons_relations.xml rename ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/{SciPublicationsPersonsResource.properties => SciPublicationsPersonsResources.properties} (93%) rename ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/{SciPublicationsPersonsResource_de.properties => SciPublicationsPersonsResources_de.properties} (93%) create mode 100644 ccm-sci-bundle/web/themes/mandalay/user/includes/types/SciPublications/publications-persons.xsl diff --git a/ccm-sci-assets-publicationspersons/src/WEB-INF/resources/publications_persons_relations.xml b/ccm-sci-assets-publicationspersons/src/WEB-INF/resources/publications_persons_relations.xml new file mode 100644 index 000000000..12d07f18a --- /dev/null +++ b/ccm-sci-assets-publicationspersons/src/WEB-INF/resources/publications_persons_relations.xml @@ -0,0 +1,25 @@ + + + + + + Interview + + + + + Interview + + + + + Character + + + + + Charakter + + + + \ No newline at end of file diff --git a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsLoader.java b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsLoader.java index 840117919..2741a9f60 100644 --- a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsLoader.java +++ b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsLoader.java @@ -18,6 +18,8 @@ */ package com.arsdigita.cms.contentassets; +import com.arsdigita.cms.RelationAttribute; +import com.arsdigita.cms.RelationAttributeImportTool; import com.arsdigita.loader.PackageLoader; import com.arsdigita.runtime.ScriptContext; @@ -30,7 +32,9 @@ public class SciPublicationsPersonsLoader extends PackageLoader { @Override public void run(final ScriptContext ctx) { - //Nothing + + final RelationAttributeImportTool importTool = new RelationAttributeImportTool(); + importTool.loadData("WEB-INF/resources/publications_persons_relations.xml"); } } diff --git a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsResource.properties b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsResources.properties similarity index 93% rename from ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsResource.properties rename to ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsResources.properties index a15c45f8c..d4a9681ba 100644 --- a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsResource.properties +++ b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsResources.properties @@ -11,3 +11,4 @@ com.arsdigita.cms.contentassets.publications_persons.person=Person com.arsdigita.cms.contentassets.publications_persons.person.relation=Relation com.arsdigita.cms.contentassets.publications_persons.person.remove=Remove com.arsdigita.cms.contentassets.publications_persons.person.remove.confirm=Are you sure to remove the relation to the selected person? +com.arsdigita.cms.contentassets.publications_persons.person_add=Add person diff --git a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsResource_de.properties b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsResources_de.properties similarity index 93% rename from ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsResource_de.properties rename to ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsResources_de.properties index 379c7ee58..87777a336 100644 --- a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsResource_de.properties +++ b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsResources_de.properties @@ -11,3 +11,4 @@ com.arsdigita.cms.contentassets.publications_persons.person=Person com.arsdigita.cms.contentassets.publications_persons.person.relation=Beziehung com.arsdigita.cms.contentassets.publications_persons.person.remove=Entfernen com.arsdigita.cms.contentassets.publications_persons.person.remove.confirm=Sie sie sicher das Sie die Beziehung mit der ausgew\u00e4hlten Person l\u00f6schen wollen? +com.arsdigita.cms.contentassets.publications_persons.person_add=Person hinzuf\u00fcgen diff --git a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsService.java b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsService.java index e4258f08d..e98471bfb 100644 --- a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsService.java +++ b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsService.java @@ -36,6 +36,7 @@ public class SciPublicationsPersonsService { public static final String PERSONS = "persons"; public static final String PUBLICATIONS = "publications"; public static final String RELATION = "relation"; + public static final String RELATION_ATTRIBUTE = "publications_persons_relations"; private static final String PUBLICATIONS_PERSONS = "publicationsPersons"; private static final String PERSONS_PUBLICATIONS = "personsPublications"; diff --git a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/ui/SciPublicationsPersonsExtraXMLGenerator.java b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/ui/SciPublicationsPersonsExtraXMLGenerator.java index 50def4d2d..4f8c9d0ba 100644 --- a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/ui/SciPublicationsPersonsExtraXMLGenerator.java +++ b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/ui/SciPublicationsPersonsExtraXMLGenerator.java @@ -22,11 +22,13 @@ import com.arsdigita.bebop.Page; import com.arsdigita.bebop.PageState; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ExtraXMLGenerator; +import com.arsdigita.cms.RelationAttributeCollection; import com.arsdigita.cms.contentassets.SciPublicationsPersonsPersonCollection; import com.arsdigita.cms.contentassets.SciPublicationsPersonsService; import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.cms.contenttypes.Publication; import com.arsdigita.cms.dispatcher.SimpleXMLGenerator; +import com.arsdigita.globalization.GlobalizationHelper; import com.arsdigita.xml.Element; /** @@ -59,7 +61,7 @@ public class SciPublicationsPersonsExtraXMLGenerator implements ExtraXMLGenerato final SciPublicationsPersonsService service = new SciPublicationsPersonsService(); final SciPublicationsPersonsPersonCollection persons = service.getPersons(publication); if ((persons != null) && !persons.isEmpty()) { - final Element personsElem = element.newChildElement("persons"); + final Element personsElem = element.newChildElement("relatedPersons"); while (persons.next()) { addPerson(personsElem, persons.getPerson(), persons.getRelation(), state); @@ -75,7 +77,17 @@ public class SciPublicationsPersonsExtraXMLGenerator implements ExtraXMLGenerato final XmlGenerator generator = new XmlGenerator(person); generator.setItemElemName("person", ""); - generator.addItemAttribute("relation", relation); + final RelationAttributeCollection relations = new RelationAttributeCollection( + SciPublicationsPersonsService.RELATION_ATTRIBUTE); + relations.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale().getLanguage()); + relations.addKeyFilter(relation); + if (relations.isEmpty()) { + generator.addItemAttribute("relation", relation); + } else { + relations.next(); + generator.addItemAttribute("relation", relations.getName()); + relations.close(); + } generator.setListMode(true); generator.generateXML(state, parent, ""); diff --git a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/ui/SciPublicationsPersonsPersonForm.java b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/ui/SciPublicationsPersonsPersonForm.java index e089013e5..3c727c7c5 100644 --- a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/ui/SciPublicationsPersonsPersonForm.java +++ b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/ui/SciPublicationsPersonsPersonForm.java @@ -80,7 +80,7 @@ public class SciPublicationsPersonsPersonForm extends BasicItemForm { relationSelect.addOption(new Option("", new Label(ContenttypesGlobalizationUtil.globalize( "cms.ui.select_one")))); final RelationAttributeCollection relations = new RelationAttributeCollection( - "publications_persons_relations"); + SciPublicationsPersonsService.RELATION_ATTRIBUTE); relations.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale().getLanguage()); while (relations.next()) { RelationAttribute relation; diff --git a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/ui/SciPublicationsPersonsPersonTable.java b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/ui/SciPublicationsPersonsPersonTable.java index ab2f27658..1bebb79e5 100644 --- a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/ui/SciPublicationsPersonsPersonTable.java +++ b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/ui/SciPublicationsPersonsPersonTable.java @@ -34,12 +34,15 @@ import com.arsdigita.bebop.table.TableModelBuilder; import com.arsdigita.cms.CMS; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.RelationAttribute; +import com.arsdigita.cms.RelationAttributeCollection; import com.arsdigita.cms.contentassets.SciPublicationsPersonsPersonCollection; import com.arsdigita.cms.contentassets.SciPublicationsPersonsService; import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.cms.contenttypes.Publication; import com.arsdigita.cms.dispatcher.ItemResolver; import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.globalization.GlobalizationHelper; import com.arsdigita.globalization.GlobalizedMessage; import com.arsdigita.util.LockableImpl; import java.math.BigDecimal; @@ -190,7 +193,7 @@ public class SciPublicationsPersonsPersonTable extends Table implements TableAct final boolean canEdit = securityManager.canAccess( state.getRequest(), - "com.arsdigita.cms.SecurityManager.EDIT_ITEM", + com.arsdigita.cms.SecurityManager.EDIT_ITEM, publication); if (canEdit) { @@ -229,8 +232,22 @@ public class SciPublicationsPersonsPersonTable extends Table implements TableAct final int row, final int column) { - return new Label(value.toString()); + final String relation = (String) value; + final RelationAttributeCollection relations = new RelationAttributeCollection( + SciPublicationsPersonsService.RELATION_ATTRIBUTE, + relation); + relations.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale().getLanguage()); + if (relations.isEmpty()) { + return new Label(relation); + } else { + relations.next(); + final String label = relations.getName(); + relations.close(); + return new Label(label); + } + + //return new Label(value.toString()); } } diff --git a/ccm-sci-assets-publicationspublicationtype/src/com/arsdigita/cms/contentassets/PublicationTypeAssetResources.properties b/ccm-sci-assets-publicationspublicationtype/src/com/arsdigita/cms/contentassets/PublicationTypeAssetResources.properties index 4fc3172db..41a39fdd2 100644 --- a/ccm-sci-assets-publicationspublicationtype/src/com/arsdigita/cms/contentassets/PublicationTypeAssetResources.properties +++ b/ccm-sci-assets-publicationspublicationtype/src/com/arsdigita/cms/contentassets/PublicationTypeAssetResources.properties @@ -1,3 +1,4 @@ \ com.arsdigita.cms.contentassets.publicationtypes.label\ =Also published as scipublications.publication_type_asset.none=No publication types found +com.arsdigita.cms.contentassets.publicationtypes.label=Type of publication diff --git a/ccm-sci-assets-publicationspublicationtype/src/com/arsdigita/cms/contentassets/PublicationTypeAssetResources_de.properties b/ccm-sci-assets-publicationspublicationtype/src/com/arsdigita/cms/contentassets/PublicationTypeAssetResources_de.properties index 5f90d86b7..ec7ce2fdc 100644 --- a/ccm-sci-assets-publicationspublicationtype/src/com/arsdigita/cms/contentassets/PublicationTypeAssetResources_de.properties +++ b/ccm-sci-assets-publicationspublicationtype/src/com/arsdigita/cms/contentassets/PublicationTypeAssetResources_de.properties @@ -1,3 +1,4 @@ \ com.arsdigita.cms.contentassets.publicationtypes.label\ =Auch ver\u00f6ffentlicht als scipublications.publication_type_asset.none=Noch keine Publikationsarten definiert +com.arsdigita.cms.contentassets.publicationtypes.label=Typ der Publikation diff --git a/ccm-sci-bundle/web/themes/mandalay/includes/mandalay/toolbox.xsl b/ccm-sci-bundle/web/themes/mandalay/includes/mandalay/toolbox.xsl index dcf615039..a1ce0641d 100755 --- a/ccm-sci-bundle/web/themes/mandalay/includes/mandalay/toolbox.xsl +++ b/ccm-sci-bundle/web/themes/mandalay/includes/mandalay/toolbox.xsl @@ -40,564 +40,581 @@ Setting up global templates like getStaticText and getSetting exclude-result-prefixes="xsl bebop cms ui nav mandalay" version="1.0"> - - - - - - - - - + + + + + + + + + - - + + - - - - + + + + - - + + - - - - + + + + - - - - + + - - - - + + - - - - + + - - - + + + - - + + - - - - + + + + - - - + + + + + + + + + + + + - - - - - - + - - - - - + + + + - - - - - - + - - - - - - - - + + + + + + + + - - - + + + - - + + - - - - + + + + - - - - + + - - - + + + - - + + - - - - + + + + - - - - - - + + + + + + - - - - - - - - - Missing Translation: - - - - - - - - - - - - - - - - - - - - - - - colorset_ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dynamic - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dynamic - + + + + + + + Missing Translation: + + + + + + + + + + + - - - - - - - - dynamic - - - + + + + + + + + + + + colorset_ + + - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + dynamic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + dynamic + + + + + + + + + + + dynamic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - = 3 or $opera_version1 > 7 or $opera_version2 > 7 or $webkit_version >= 417 or $msie_version >= 5"> - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - Mo - Di - Mi - Do - Fr - Sa - So + - ., - - + + + + + + + + + + + + + + + + - Montag - Dienstag - Mittwoch - Donnerstag - Freitag - Samstag - Sonntag - - , - - - - - - . - - - - - - - 01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - 11 - 12 + + + Mo + Di + Mi + Do + Fr + Sa + So + + ., + + + + Montag + Dienstag + Mittwoch + Donnerstag + Freitag + Samstag + Sonntag + + , + + + + . - - - + + + - Januar - Februar - März - April - Mai - Juni - Juli - August - September - Oktober - November - Dezember + + + 01 + 02 + 03 + 04 + 05 + 06 + 07 + 08 + 09 + 10 + 11 + 12 + + . + + + + + Januar + Februar + März + April + Mai + Juni + Juli + August + September + Oktober + November + Dezember + + + - - - - - - - + + + + diff --git a/ccm-sci-bundle/web/themes/mandalay/layout/defaultLayout.xml b/ccm-sci-bundle/web/themes/mandalay/layout/defaultLayout.xml index fc4b77b9a..68da120bf 100755 --- a/ccm-sci-bundle/web/themes/mandalay/layout/defaultLayout.xml +++ b/ccm-sci-bundle/web/themes/mandalay/layout/defaultLayout.xml @@ -83,6 +83,7 @@ + diff --git a/ccm-sci-bundle/web/themes/mandalay/user/includes/mandalay/layoutParser.xsl b/ccm-sci-bundle/web/themes/mandalay/user/includes/mandalay/layoutParser.xsl index de91f4d9d..c3a7e8536 100644 --- a/ccm-sci-bundle/web/themes/mandalay/user/includes/mandalay/layoutParser.xsl +++ b/ccm-sci-bundle/web/themes/mandalay/user/includes/mandalay/layoutParser.xsl @@ -116,6 +116,10 @@ + + + + diff --git a/ccm-sci-bundle/web/themes/mandalay/user/includes/types/SciPublications.xsl b/ccm-sci-bundle/web/themes/mandalay/user/includes/types/SciPublications.xsl index 44d874057..8b1ebad9e 100644 --- a/ccm-sci-bundle/web/themes/mandalay/user/includes/types/SciPublications.xsl +++ b/ccm-sci-bundle/web/themes/mandalay/user/includes/types/SciPublications.xsl @@ -21,38 +21,39 @@ --> + xmlns:mandalay="http://mandalay.quasiweb.de" + xmlns:dabin="http://dabin.quasiweb.de" + exclude-result-prefixes="xsl bebop cms mandalay dabin" + version="1.0"> - - - - - + + + + + + - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/ccm-sci-bundle/web/themes/mandalay/user/includes/types/SciPublications/publications-persons.xsl b/ccm-sci-bundle/web/themes/mandalay/user/includes/types/SciPublications/publications-persons.xsl new file mode 100644 index 000000000..934655bc5 --- /dev/null +++ b/ccm-sci-bundle/web/themes/mandalay/user/includes/types/SciPublications/publications-persons.xsl @@ -0,0 +1,92 @@ + +]> + + + + + + + + + + + + + + + + + + + + + +
+ + +

+ + + + +

+
+ +
    + + + +
  • + + + + + + + + + + + + + , + + +
  • +
    +
+ +
+ +
+ +
+ +
\ No newline at end of file