PublicationsPersons finished.
git-svn-id: https://svn.libreccm.org/ccm/trunk@2647 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
6b0caaff4e
commit
3683f0e511
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ddenums>
|
||||
|
||||
<ddenum name="publications_persons_relations">
|
||||
<entry key="interview" lang="en">
|
||||
<value>Interview</value>
|
||||
</entry>
|
||||
</ddenum>
|
||||
<ddenum name="publications_persons_relations">
|
||||
<entry key="interview" lang="de">
|
||||
<value>Interview</value>
|
||||
</entry>
|
||||
</ddenum>
|
||||
<ddenum name="publications_persons_relations">
|
||||
<entry key="character" lang="en">
|
||||
<value>Character</value>
|
||||
</entry>
|
||||
</ddenum>
|
||||
<ddenum name="publications_persons_relations">
|
||||
<entry key="character" lang="de">
|
||||
<value>Charakter</value>
|
||||
</entry>
|
||||
</ddenum>
|
||||
|
||||
</ddenums>
|
||||
|
|
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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, "");
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -83,6 +83,7 @@
|
|||
<useEditLink/>
|
||||
<showDiscussedPublications/>
|
||||
<showDiscussingPublications/>
|
||||
<showPublicationRelatedPersons/>
|
||||
</showContent>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -116,6 +116,10 @@
|
|||
<xsl:template match="showDiscussingPublications">
|
||||
<xsl:call-template name="showDiscussingPublications"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="showPublicationRelatedPersons">
|
||||
<xsl:call-template name="showPublicationRelatedPersons"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="showPPPOwnerName">
|
||||
<xsl:apply-templates select="$resultTree//ppp:ownerName"/>
|
||||
|
|
|
|||
|
|
@ -21,38 +21,39 @@
|
|||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
||||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
||||
xmlns:nav="http://ccm.redhat.com/navigation"
|
||||
xmlns:mandalay="http://mandalay.quasiweb.de"
|
||||
xmlns:dabin="http://dabin.quasiweb.de"
|
||||
exclude-result-prefixes="xsl bebop cms mandalay dabin"
|
||||
version="1.0">
|
||||
xmlns:mandalay="http://mandalay.quasiweb.de"
|
||||
xmlns:dabin="http://dabin.quasiweb.de"
|
||||
exclude-result-prefixes="xsl bebop cms mandalay dabin"
|
||||
version="1.0">
|
||||
|
||||
<xsl:import href="SciPublications/common.xsl"/>
|
||||
<xsl:import href="SciPublications/exportLinks.xsl"/>
|
||||
<xsl:import href="SciPublications/formatParser.xsl"/>
|
||||
<xsl:import href="SciPublications/librarySignatures.xsl"/>
|
||||
<xsl:import href="SciPublications/publications-about.xsl"/>
|
||||
<xsl:import href="SciPublications/common.xsl"/>
|
||||
<xsl:import href="SciPublications/exportLinks.xsl"/>
|
||||
<xsl:import href="SciPublications/formatParser.xsl"/>
|
||||
<xsl:import href="SciPublications/librarySignatures.xsl"/>
|
||||
<xsl:import href="SciPublications/publications-about.xsl"/>
|
||||
<xsl:import href="SciPublications/publications-persons.xsl"/>
|
||||
|
||||
<xsl:import href="SciPublications/SciPublicationsList.xsl"/>
|
||||
<xsl:import href="SciPublications/SciPublicationsList.xsl"/>
|
||||
|
||||
<xsl:import href="SciPublications/ArticleInCollectedVolume.xsl"/>
|
||||
<xsl:import href="SciPublications/ArticleInJournal.xsl"/>
|
||||
<xsl:import href="SciPublications/CollectedVolume.xsl"/>
|
||||
<xsl:import href="SciPublications/Expertise.xsl"/>
|
||||
<xsl:import href="SciPublications/GreyLiterature.xsl"/>
|
||||
<xsl:import href="SciPublications/InProceedings.xsl"/>
|
||||
<xsl:import href="SciPublications/InternetArticle.xsl"/>
|
||||
<xsl:import href="SciPublications/Journal.xsl"/>
|
||||
<xsl:import href="SciPublications/Monograph.xsl"/>
|
||||
<xsl:import href="SciPublications/Proceedings.xsl"/>
|
||||
<xsl:import href="SciPublications/Publisher.xsl"/>
|
||||
<xsl:import href="SciPublications/Review.xsl"/>
|
||||
<xsl:import href="SciPublications/ResearchReport.xsl"/>
|
||||
<xsl:import href="SciPublications/SciAuthor.xsl"/>
|
||||
<xsl:import href="SciPublications/Series.xsl"/>
|
||||
<xsl:import href="SciPublications/UnPublished.xsl"/>
|
||||
<xsl:import href="SciPublications/WorkingPaper.xsl"/>
|
||||
<xsl:import href="SciPublications/ArticleInCollectedVolume.xsl"/>
|
||||
<xsl:import href="SciPublications/ArticleInJournal.xsl"/>
|
||||
<xsl:import href="SciPublications/CollectedVolume.xsl"/>
|
||||
<xsl:import href="SciPublications/Expertise.xsl"/>
|
||||
<xsl:import href="SciPublications/GreyLiterature.xsl"/>
|
||||
<xsl:import href="SciPublications/InProceedings.xsl"/>
|
||||
<xsl:import href="SciPublications/InternetArticle.xsl"/>
|
||||
<xsl:import href="SciPublications/Journal.xsl"/>
|
||||
<xsl:import href="SciPublications/Monograph.xsl"/>
|
||||
<xsl:import href="SciPublications/Proceedings.xsl"/>
|
||||
<xsl:import href="SciPublications/Publisher.xsl"/>
|
||||
<xsl:import href="SciPublications/Review.xsl"/>
|
||||
<xsl:import href="SciPublications/ResearchReport.xsl"/>
|
||||
<xsl:import href="SciPublications/SciAuthor.xsl"/>
|
||||
<xsl:import href="SciPublications/Series.xsl"/>
|
||||
<xsl:import href="SciPublications/UnPublished.xsl"/>
|
||||
<xsl:import href="SciPublications/WorkingPaper.xsl"/>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,92 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE stylesheet [<!ENTITY nbsp ' '>]>
|
||||
|
||||
<!--
|
||||
Copyright: 2014 Jens Pelzetter
|
||||
|
||||
This file is part of Mandalay.
|
||||
|
||||
Mandalay 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.
|
||||
|
||||
Mandalay 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 Mandalay. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<!--
|
||||
XSL file for displaying the informations from the related persons asset.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
||||
xmlns:nav="http://ccm.redhat.com/navigation"
|
||||
xmlns:mandalay="http://mandalay.quasiweb.de"
|
||||
exclude-result-prefixes="xsl bebop cms nav mandalay"
|
||||
version="1.0">
|
||||
|
||||
<xsl:template name="showPublicationRelatedPersons">
|
||||
<xsl:param name="layoutTree" select="."/>
|
||||
|
||||
<xsl:if test="$resultTree//relatedPersons">
|
||||
|
||||
<xsl:variable name="setHeading">
|
||||
<xsl:call-template name="mandalay:getSetting">
|
||||
<xsl:with-param name="node" select="$layoutTree/setHeading" />
|
||||
<xsl:with-param name="module" select="'SciPublications'" />
|
||||
<xsl:with-param name="setting" select="'relatedPersons/setHeading'" />
|
||||
<xsl:with-param name="default" select="'true'" />
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
|
||||
<div class="relatedPersons">
|
||||
|
||||
<xsl:if test="$setHeading = 'true'">
|
||||
<h2>
|
||||
<xsl:call-template name="mandalay:getStaticText">
|
||||
<xsl:with-param name="module"
|
||||
select="'SciPublications'"/>
|
||||
<xsl:with-param name="id"
|
||||
select="'relatedPersons/heading'"/>
|
||||
</xsl:call-template>
|
||||
</h2>
|
||||
</xsl:if>
|
||||
|
||||
<ul>
|
||||
<xsl:for-each select="$resultTree//relatedPersons/person">
|
||||
<xsl:sort select="./surname" data-type="text"/>
|
||||
<xsl:sort select="./givenname" data-type="text"/>
|
||||
<li>
|
||||
<xsl:if test="string-length(./titlepre) > 0">
|
||||
<xsl:value-of select="./titlepre"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:if test="string-length(./givenname) > 0">
|
||||
<xsl:value-of select="./givenname"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:if test="string-length(./givenname) > 0">
|
||||
<xsl:value-of select="./surname"/>
|
||||
</xsl:if>
|
||||
<xsl:if test="string-length(./titlepost) > 0">
|
||||
<xsl:text>, </xsl:text>
|
||||
<xsl:value-of select="./titlepost"/>
|
||||
</xsl:if>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
</xsl:if>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
Loading…
Reference in New Issue