diff --git a/ccm-sci-publications/pdl/com/arsdigita/content-types/SciAuthor.pdl b/ccm-sci-publications/pdl/com/arsdigita/content-types/SciAuthor.pdl new file mode 100644 index 000000000..4a490ea35 --- /dev/null +++ b/ccm-sci-publications/pdl/com/arsdigita/content-types/SciAuthor.pdl @@ -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 ); +} \ No newline at end of file diff --git a/ccm-sci-publications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciAuthor.xml b/ccm-sci-publications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciAuthor.xml new file mode 100644 index 000000000..4748f5f6e --- /dev/null +++ b/ccm-sci-publications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciAuthor.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ccm-sci-publications/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciAuthor.xml b/ccm-sci-publications/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciAuthor.xml new file mode 100644 index 000000000..993ca8d7b --- /dev/null +++ b/ccm-sci-publications/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciAuthor.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/ccm-sci-publications/src/ccm-sci-publications.load b/ccm-sci-publications/src/ccm-sci-publications.load index 480252506..856ff9533 100644 --- a/ccm-sci-publications/src/ccm-sci-publications.load +++ b/ccm-sci-publications/src/ccm-sci-publications.load @@ -22,7 +22,8 @@
-
+
+
@@ -39,7 +40,8 @@ - + + @@ -59,6 +61,7 @@ - + + diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/SciAuthor.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/SciAuthor.java new file mode 100644 index 000000000..66cd88d87 --- /dev/null +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/SciAuthor.java @@ -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 GenericPerson 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); + } +} diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/SciAuthorInitializer.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/SciAuthorInitializer.java new file mode 100644 index 000000000..5f1017c39 --- /dev/null +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/SciAuthorInitializer.java @@ -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"; + } + +} diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/SciAuthorLoader.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/SciAuthorLoader.java new file mode 100644 index 000000000..b90883ea0 --- /dev/null +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/SciAuthorLoader.java @@ -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; + } + +} diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources.properties b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources.properties index 9d66a1d1d..f423f900e 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources.properties +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources.properties @@ -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 diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources_de.properties b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources_de.properties index f6de5bce1..b7db89d95 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources_de.properties +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources_de.properties @@ -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 diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SciAuthorPropertiesStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SciAuthorPropertiesStep.java new file mode 100644 index 000000000..e107e4bb7 --- /dev/null +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SciAuthorPropertiesStep.java @@ -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; + } +} diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SciAuthorPropertyForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SciAuthorPropertyForm.java new file mode 100644 index 000000000..1a3aa1605 --- /dev/null +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SciAuthorPropertyForm.java @@ -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); + } + } +} diff --git a/ccm-sci-publications/web/static/content-types/com/arsdigita/cms/contenttypes/SciAuthor.xsl b/ccm-sci-publications/web/static/content-types/com/arsdigita/cms/contenttypes/SciAuthor.xsl new file mode 100644 index 000000000..621df5eda --- /dev/null +++ b/ccm-sci-publications/web/static/content-types/com/arsdigita/cms/contenttypes/SciAuthor.xsl @@ -0,0 +1,20 @@ + +]> + + + + +

+
+ + +

+
+ +
\ No newline at end of file