SciAuthor im Publikationenmodul hinzugefügt. Bisher gabe es, wenn das Publikationenmodul ohne ccm-sci-types-publications oder ccm-cms-types-member installiert

wird, kein im ContentCenter verwendbaren, von GenericPerson abgeleiteteten Typ.


git-svn-id: https://svn.libreccm.org/ccm/trunk@643 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2010-12-06 10:10:54 +00:00
parent df1b5ca91d
commit 47729728d7
12 changed files with 369 additions and 3 deletions

View File

@ -0,0 +1,8 @@
model com.arsdigita.cms.contenttypes;
import com.arsdigita.kernel.ACSObject;
import com.arsdigita.cms.*;
object type SciAuthor extends GenericPerson {
reference key ( ct_sciauthors.author_id );
}

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
<ctd:content-type label="SciPublications/Author"
description="Author of a publication"
objectType="com.arsdigita.cms.contenttypes.SciAuthor"
classname="com.arsdigita.cms.contenttypes.SciAuthor">
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.GenericPersonCreate">
<ctd:authoring-step labelKey="cms.contenttypes.shared.basic_properties.title"
labelBundle="com.arsdigita.cms.CMSResources"
descriptionKey="cms.contenttypes.shared.basic_properties.description"
descriptionBundle="com.arsdigita.cms.CMSResources"
component="com.arsdigita.cms.contenttypes.ui.SciAuthorPropertiesStep"
ordering="1"/>
<ctd:authoring-step
labelKey="person.authoring.contact_properties.title"
labelBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
descriptionKey="person.authoring.contact_properties.description"
descriptionBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
component="com.arsdigita.cms.contenttypes.ui.GenericPersonContactPropertiesStep"
ordering="2"/>
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
</ctd:authoring-kit>
</ctd:content-type>
</ctd:content-types>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<xrd:adapters
xmlns:xrd="http://xmlns.redhat.com/schemas/waf/xml-renderer-rules"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://rhea.redhat.com/schemas/waf/xml-renderer-rules xml-renderer-rules.xsd">
<xrd:context name="com.arsdigita.cms.dispatcher.SimpleXMLGenerator">
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.SciAuthor"
extends="com.arsdigita.cms.ContentPage">
<xrd:associations rule="include">
<xrd:property name="/object/contacts"/>
<xrd:property name="/object/contacts/contactentries"/>
<xrd:property name="/object/contacts/address"/>
</xrd:associations>
</xrd:adapter>
</xrd:context>
</xrd:adapters>

View File

@ -23,6 +23,7 @@
<table name="ct_working_paper"/>
<table name="ct_expertise"/>
<table name="ct_review"/>
<table name="sciauthors"/>
<initializer class="com.arsdigita.cms.contenttypes.PublicationInitializer"/>
<initializer class="com.arsdigita.cms.contenttypes.PublicationWithPublisherInitializer"/>
<initializer class="com.arsdigita.cms.contenttypes.SeriesInitializer"/>
@ -40,6 +41,7 @@
<initializer class="com.arsdigita.cms.contenttypes.WorkingPaperInitializer"/>
<initializer class="com.arsdigita.cms.contenttypes.ExpertiseInitializer"/>
<initializer class="com.arsdigita.cms.contenttypes.ReviewInitializer"/>
<initializer class="com.arsdigita.cms.contenttypes.SciAuthorInitializer"/>
</provides>
<scripts>
<schema directory="ccm-sci-publications"/>
@ -60,5 +62,6 @@
<data class="com.arsdigita.cms.contenttypes.WorkingPaperLoader"/>
<data class="com.arsdigita.cms.contenttypes.ExpertiseLoader"/>
<data class="com.arsdigita.cms.contenttypes.ReviewLoader"/>
<data class="com.arsdigita.cms.contenttypes.SciAuthorLoader"/>
</scripts>
</load>

View File

@ -0,0 +1,58 @@
/*
* Copyright (c) 2010 Jens Pelzetter,
* for the Center of Social Politics of the University of Bremen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* 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.cms.contenttypes;
import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.persistence.DataObject;
import com.arsdigita.persistence.OID;
import java.math.BigDecimal;
/**
* A concrete class extending {@link GenericPerson}. Does not add any new
* fields, it just makes the internal type <code>GenericPerson</code> usable
* without any other modules.
*
* @author Jens Pelzetter
*/
public class SciAuthor extends GenericPerson {
public static final String BASE_DATA_OBJECT_TYPE =
"com.arsdigita.cms.contenttypes.SciAuthor";
public SciAuthor() {
this(BASE_DATA_OBJECT_TYPE);
}
public SciAuthor(BigDecimal id) throws DataObjectNotFoundException {
this(new OID(BASE_DATA_OBJECT_TYPE, id));
}
public SciAuthor(OID oid) throws DataObjectNotFoundException {
super(oid);
}
public SciAuthor(DataObject dobj) {
super(dobj);
}
public SciAuthor(String type) {
super(type);
}
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2010 Jens Pelzetter,
* for the Center of Social Politics of the University of Bremen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* 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.cms.contenttypes;
/**
* Initializer for {@link SciAuthor}
*
* @author Jens Pelzetter
*/
public class SciAuthorInitializer extends ContentTypeInitializer {
public SciAuthorInitializer() {
super("empty.pdl.mf", SciAuthor.BASE_DATA_OBJECT_TYPE);
}
@Override
public String[] getStylesheets() {
return new String[] {
"/static/content-types/com/arsdigita/cms/contenttypes/SciAuthor.xsl"
};
}
@Override
public String getTraversalXML() {
return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciAuthor.xml";
}
}

View File

@ -0,0 +1,36 @@
/*
* Copyright (c) 2010 Jens Pelzetter,
* for the Center of Social Politics of the University of Bremen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* 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.cms.contenttypes;
/**
* Loader for {@link SciAuthor}
*
* @author Jens Pelzetter
*/
public class SciAuthorLoader extends AbstractContentTypeLoader {
private static final String[] TYPES = {"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciAuthor.xml"};
@Override
public String[] getTypes() {
return TYPES;
}
}

View File

@ -206,3 +206,4 @@ publications.ui.series.volumes.none=No volumes
publications.ui.series.volumes.remove=Remove volume
publications.ui.series.volumes.remove.confirm=Really remove this volume?
publications.ui.series.volumes.volume_of_series=Volume of series
sciauthor.ui.edit_basic_properties=Basic properties

View File

@ -205,3 +205,4 @@ publications.ui.series.volumes.none=Keine B\u00e4nde gefunden.
publications.ui.series.volumes.remove=Band entfernen.
publications.ui.series.volumes.remove.confirm=Diesen Band wirklich entfernen
publications.ui.series.volumes.volume_of_series=Band der Serie
sciauthor.ui.edit_basic_properties=Basiseigenschaften

View File

@ -0,0 +1,64 @@
/*
* Copyright (c) 2010 Jens Pelzetter,
* for the Center of Social Politics of the University of Bremen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* 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.cms.contenttypes.ui;
import com.arsdigita.bebop.Component;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.SciAuthor;
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
/**
* Step for editing a {@link SciAuthor}
*
* @author Jens Pelzetter
*/
public class SciAuthorPropertiesStep extends SimpleEditStep {
public static final String EDIT_SHEET_NAME = "edit";
public SciAuthorPropertiesStep(ItemSelectionModel itemModel,
AuthoringKitWizard parent) {
super(itemModel, parent);
BasicPageForm editSheet;
editSheet = new SciAuthorPropertyForm(itemModel, this);
add(EDIT_SHEET_NAME,
(String) PublicationGlobalizationUtil.globalize(
"sciauthor.ui.edit_basic_properties").localize(),
new WorkflowLockedComponentAccess(editSheet, itemModel),
editSheet.getSaveCancelSection().getCancelButton());
setDisplayComponent(getSciAuthorPropertySheet(itemModel));
}
public static Component getSciAuthorPropertySheet(
ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet;
sheet = (DomainObjectPropertySheet) GenericPersonPropertiesStep.
getGenericPersonPropertySheet(itemModel);
return sheet;
}
}

View File

@ -0,0 +1,76 @@
/*
* Copyright (c) 2010 Jens Pelzetter,
* for the Center of Social Politics of the University of Bremen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* 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.cms.contenttypes.ui;
import com.arsdigita.bebop.FormData;
import com.arsdigita.bebop.event.FormInitListener;
import com.arsdigita.bebop.event.FormSectionEvent;
import com.arsdigita.bebop.event.FormSubmissionListener;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.SciAuthor;
/**
* Form for editing the basic properties of a {@link SciAuthor}. This form
* extends the form for editing the basic properties of {@link GenericPerson}.
*
* @author Jens Pelzetter
* @see SciAuthor
* @see GenericPerson
* @see GenericPersonPropertyForm
*/
public class SciAuthorPropertyForm
extends GenericPersonPropertyForm
implements FormInitListener,
FormSubmissionListener {
public SciAuthorPropertyForm(ItemSelectionModel itemModel) {
this(itemModel, null);
}
public SciAuthorPropertyForm(ItemSelectionModel itemModel,
SciAuthorPropertiesStep step) {
super(itemModel);
}
@Override
protected void addWidgets() {
super.addWidgets();
}
@Override
public void init(FormSectionEvent fse) {
super.init(fse);
super.initBasicWidgets(fse);
}
@Override
public void process(FormSectionEvent fse) {
super.process(fse);
SciAuthor author = (SciAuthor) super.processBasicWidgets(fse);
if ((author != null) && getSaveCancelSection().getSaveButton().
isSelected(fse.getPageState())) {
author.save();
init(fse);
}
}
}

View File

@ -0,0 +1,20 @@
<!DOCTYPE stylesheet [
<!ENTITY nbsp "&#160;" ><!-- no-break space = non-breaking space, U+00A0 ISOnum -->
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:cms="http://www.arsdigita.com/cms/1.0"
version="1.0">
<xsl:template match="cms:item[objectType='com.arsdigita.cms.contenttypes.SciAuthor']"
mode="cms:CT_graphics"
name="cms:CT_graphics_com_arsdigita_cms_contenttypes_SciAuthor">
<p><xsl:value-of select="./name"/></p>
</xsl:template>
<xsl:template match="cms:item[objectType='com.arsdigita.cms.contenttypes.SciAuthor']" mode="cms:CT_text"
name="cms:CT_text_com_arsdigita_cms_contenttypes_SciAuthor">
<p><xsl:value-of select="./name"/></p>
</xsl:template>
</xsl:stylesheet>