From b10cbd3a763bbc4f1ef3c86bd72d301f99bea7e6 Mon Sep 17 00:00:00 2001 From: jensp Date: Mon, 9 Aug 2010 15:42:28 +0000 Subject: [PATCH] First files for the publication module (only for backup) git-svn-id: https://svn.libreccm.org/ccm/trunk@503 8810af33-2d31-482b-a856-94f89814c4df --- .../arsdigita/content-types/Publication.pdl | 51 +++++++++++++++ .../PublicationWithPublisher.pdl | 48 ++++++++++++++ .../com/arsdigita/content-types/Series.pdl | 65 +++++++++++++++++++ .../postgres-create.sql | 3 + .../GenericOrganizationalUnit.pdl | 2 +- .../GenericOrganizationalUnit.java | 2 +- 6 files changed, 169 insertions(+), 2 deletions(-) create mode 100644 ccm-cms-types-publications/pdl/com/arsdigita/content-types/Publication.pdl create mode 100644 ccm-cms-types-publications/pdl/com/arsdigita/content-types/PublicationWithPublisher.pdl create mode 100644 ccm-cms-types-publications/pdl/com/arsdigita/content-types/Series.pdl create mode 100644 ccm-cms-types-publications/sql/ccm-cms-types-publications/postgres-create.sql diff --git a/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Publication.pdl b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Publication.pdl new file mode 100644 index 000000000..316bf04df --- /dev/null +++ b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Publication.pdl @@ -0,0 +1,51 @@ +// +// Copyright (C) 2010 Jens Pelzetter, for the Center of Social Politics (ZeS) 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 +// +// + +model com.arsdigita.cms.contenttypes; + +import com.arsdigita.cms.ContentPage; + +//PDL definition for the basic attributes of publication. +object type Publication extends ContentPage { + + Integer[0..1] yearOfPublication = ct_publications.year INTEGER; + String[0..1] abstract = ct_publications.abstract VARCHAR(2048); + String[0..1] misc = ct_publications.misc VARCHAR(2048); + + reference key (ct_publications.publication_id); +} + +//Assoication for the editors +association { + + Publication[0..1] publication = join cms_persons.person_id + to ct_publications_authorship.person_id, + join ct_publications_authorship.publication_id + to ct_publications.publication_id; + + GenericPerson[0..n] persons = join ct_publications.publication_id + to ct_publications_authorship.publication_id, + join ct_publications_authorship.person_id + to cms_persons.person_id; + + // Additional attributes + Boolean[0..1] editor = ct_publications_authorship.editor BIT; + Integer[0..1] authorOrder = ct_publications_authorship.authorship_order INTEGER; +} \ No newline at end of file diff --git a/ccm-cms-types-publications/pdl/com/arsdigita/content-types/PublicationWithPublisher.pdl b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/PublicationWithPublisher.pdl new file mode 100644 index 000000000..0e62565de --- /dev/null +++ b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/PublicationWithPublisher.pdl @@ -0,0 +1,48 @@ +// +// Copyright (C) 2010 Jens Pelzetter, for the Center of Social Politics (ZeS) 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 +// +// + +model com.arsdigita.cms.contenttypes; + +import com.arsdigita.cms.ContentPage; + +// PDL definition for a publication with publisher +object type PublicationWithPublisher extends Publication { + + String[0..1] isbn = ct_publication_with_publisher.isbn VARCHAR(13); + + reference key (ct_publication_with_publisher.publication_with_publisher_id); + +} + +// Association which links to the publisher (an GenericOrganizationalUnit). +association { + + PublicationWithPublisher[0..1] publication = join cms_organizationalunits.organizationalunit_id + to ct_publication_publisher.publisher_id, + join ct_publication_publisher.publication_with_publisher_id + to ct_publication_with_publisher.publication_with_publisher_id; + GenericOrganizationalUnit[0..n] publisher = join ct_publication_with_publisher.publication_with_publisher_id + to ct_publication_publisher.publication_with_publisher_id, + join ct_publication_publisher.publisher_id + to cms_organizationalunits.organizationalunit_id; + // Additional attributes + String[0..1] place = ct_publication_publisher.place VARCHAR(256); + +} \ No newline at end of file diff --git a/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Series.pdl b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Series.pdl new file mode 100644 index 000000000..d39be7a37 --- /dev/null +++ b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Series.pdl @@ -0,0 +1,65 @@ +// +// Copyright (C) 2010 Jens Pelzetter, for the Center of Social Politics (ZeS) 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 +// +// + +model com.arsdigita.cms.contenttypes; + +import com.arsdigita.cms.ContentPage; + +// The contenttype described in this PDL file represents a series of publications. +object types Series extends ContentPage { + + reference key (ct_series.series_id); + +} + +//Assoication for the editship of a series +association { + + Series[0..1] series = join cms_persons.persons_id + to ct_series_editship.person_id, + join ct_series_editship.series_id + to ct_series.series_id; + + GenericPerson[0..n] persons = join ct_series.series_id + to ct_series_editship.series_id, + join ct_series_editship.person_id + to cms_persons.person_id; + + // Additional attributes for the editship + Date[0..1] from = ct_series_editship.from DATE + Date[0..] to = ct_series_editship.to DATE + +} + +//Assoication for the volumes in the series +association { + + Series[0..1] series = join ct_publications.publication_id + to ct_publications_volume_in_series.publication_id, + join ct_publications_volume_in_series.series_id + to ct_series.series_id; + + Publication[0..n] publications = join ct_series.series_id + to ct_publications_volume_in_series.series_id, + join ct_publications_volume_in_series.publication_id + to ct_publications.publication_id; + // Additional attributes + Integer[0..1] volumeOfSeries = ct_publications_volume_in_series.volumeOfSeries INTEGER; +} \ No newline at end of file diff --git a/ccm-cms-types-publications/sql/ccm-cms-types-publications/postgres-create.sql b/ccm-cms-types-publications/sql/ccm-cms-types-publications/postgres-create.sql new file mode 100644 index 000000000..a733590e2 --- /dev/null +++ b/ccm-cms-types-publications/sql/ccm-cms-types-publications/postgres-create.sql @@ -0,0 +1,3 @@ +begin; +\i ddl/postgres/create.sql +end; \ No newline at end of file diff --git a/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl b/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl index 1abc17810..fa90e37bc 100644 --- a/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl +++ b/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl @@ -22,7 +22,7 @@ model com.arsdigita.cms.contenttypes; import com.arsdigita.cms.ContentPage; -// PDL definition for a commons base type for orgnizations, departments, projects etc. +// PDL definition for a commons base type for organizations, departments, projects etc. object type GenericOrganizationalUnit extends ContentPage { //String[0..1] orgaunit_name = cms_organizationalunits.name VARCHAR(256); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java index e3681507e..b60d1b18e 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java @@ -117,7 +117,7 @@ public class GenericOrganizationalUnit extends ContentPage { DataObject link = add(ORGAUNIT_CHILDREN, child); link.set(ORGAUNIT_CHILDREN_ORDER, Integer.valueOf((int) getOrgaUnitChildren(). - size())); + size())); } public void removeOrgaUnitChildren(GenericOrganizationalUnit child) {