From 607d0f7059ded7c1b47dd1812d324c804e864ff9 Mon Sep 17 00:00:00 2001 From: jensp Date: Mon, 16 Aug 2010 08:07:47 +0000 Subject: [PATCH] PDL definitions and contenttype classes for the publication module. git-svn-id: https://svn.libreccm.org/ccm/trunk@505 8810af33-2d31-482b-a856-94f89814c4df --- .../ArticleInCollectedVolume.pdl | 34 +++ .../content-types/CollectedVolume.pdl | 51 +++++ .../com/arsdigita/content-types/Expertise.pdl | 48 ++++ .../content-types/GreyLiterature.pdl | 34 +++ .../arsdigita/content-types/InProceedings.pdl | 39 ++++ .../content-types/InternetArticle.pdl | 43 ++++ .../com/arsdigita/content-types/Monograph.pdl | 33 +++ .../PublicationWithPublisher.pdl | 19 +- .../com/arsdigita/content-types/Publisher.pdl | 33 +++ .../com/arsdigita/content-types/Review.pdl | 39 ++++ .../com/arsdigita/content-types/Series.pdl | 5 +- .../arsdigita/content-types/UnPublished.pdl | 40 ++++ .../arsdigita/content-types/WorkingPages.pdl | 30 +++ .../ArticleInCollectedVolume.java | 87 ++++++++ .../ArticleInCollectedVolumeCollection.java | 154 +++++++++++++ .../contenttypes/AuthorshipCollection.java | 161 ++++++++++++++ .../cms/contenttypes/CollectedVolume.java | 117 ++++++++++ .../cms/contenttypes/EditshipCollection.java | 205 ++++++++++++++++++ .../arsdigita/cms/contenttypes/Expertise.java | 100 +++++++++ .../cms/contenttypes/GreyLiterature.java | 82 +++++++ .../cms/contenttypes/InProceedings.java | 141 ++++++++++++ .../cms/contenttypes/InternetArticle.java | 121 +++++++++++ .../arsdigita/cms/contenttypes/Monograph.java | 91 ++++++++ .../cms/contenttypes/Publication.java | 111 ++++++++++ .../PublicationWithPublisher.java | 75 +++++++ .../arsdigita/cms/contenttypes/Publisher.java | 65 ++++++ .../arsdigita/cms/contenttypes/Review.java | 131 +++++++++++ .../arsdigita/cms/contenttypes/Series.java | 108 +++++++++ .../cms/contenttypes/UnPublished.java | 91 ++++++++ .../VolumeInSeriesCollection.java | 66 ++++++ .../cms/contenttypes/WorkingPaper.java | 54 +++++ .../GenericOrganizationalUnit.java | 7 +- ...cOrganizationalUnitChildrenCollection.java | 4 +- ...ricOrganizationalUnitPersonCollection.java | 17 +- 34 files changed, 2399 insertions(+), 37 deletions(-) create mode 100644 ccm-cms-types-publications/pdl/com/arsdigita/content-types/ArticleInCollectedVolume.pdl create mode 100644 ccm-cms-types-publications/pdl/com/arsdigita/content-types/CollectedVolume.pdl create mode 100644 ccm-cms-types-publications/pdl/com/arsdigita/content-types/Expertise.pdl create mode 100644 ccm-cms-types-publications/pdl/com/arsdigita/content-types/GreyLiterature.pdl create mode 100644 ccm-cms-types-publications/pdl/com/arsdigita/content-types/InProceedings.pdl create mode 100644 ccm-cms-types-publications/pdl/com/arsdigita/content-types/InternetArticle.pdl create mode 100644 ccm-cms-types-publications/pdl/com/arsdigita/content-types/Monograph.pdl create mode 100644 ccm-cms-types-publications/pdl/com/arsdigita/content-types/Publisher.pdl create mode 100644 ccm-cms-types-publications/pdl/com/arsdigita/content-types/Review.pdl create mode 100644 ccm-cms-types-publications/pdl/com/arsdigita/content-types/UnPublished.pdl create mode 100644 ccm-cms-types-publications/pdl/com/arsdigita/content-types/WorkingPages.pdl create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/ArticleInCollectedVolume.java create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/ArticleInCollectedVolumeCollection.java create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/AuthorshipCollection.java create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/CollectedVolume.java create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/EditshipCollection.java create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Expertise.java create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/GreyLiterature.java create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/InProceedings.java create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/InternetArticle.java create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Monograph.java create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Publication.java create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/PublicationWithPublisher.java create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Publisher.java create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Review.java create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Series.java create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/UnPublished.java create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/VolumeInSeriesCollection.java create mode 100644 ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/WorkingPaper.java diff --git a/ccm-cms-types-publications/pdl/com/arsdigita/content-types/ArticleInCollectedVolume.pdl b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/ArticleInCollectedVolume.pdl new file mode 100644 index 000000000..c7fd12873 --- /dev/null +++ b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/ArticleInCollectedVolume.pdl @@ -0,0 +1,34 @@ +// +// 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 collected volume +object type ArticleInCollectedVolume extends PublicationWithPublisher { + + Integer[0..1] pagesFrom = ct_article_in_collected_volume.pages_from INTEGER; + Integer[0..1] pagesTo = ct_article_in_collected_volume.pages_to INTEGER; + String[0..1] chapter = ct_article_in_collected_volume.chapter VARCHAR(512); + + reference key (ct_article_in_collected_volume.article_id); + +} \ No newline at end of file diff --git a/ccm-cms-types-publications/pdl/com/arsdigita/content-types/CollectedVolume.pdl b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/CollectedVolume.pdl new file mode 100644 index 000000000..7659b1db6 --- /dev/null +++ b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/CollectedVolume.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 a collected volume +object type CollectedVolume extends PublicationWithPublisher { + + Integer[0..1] volume = ct_collected_volume.volume INTEGER; + Integer[0..1] numberOfVolumes = ct_collected_volume.number_of_volumes INTEGER; + Integer[0..1] numberOfPages = ct_collected_volume._number_of_pages INTEGER; + String[0..1] editon = ct_collected_volume.editon VARCHAR(256) + + reference key (ct_collected_volume.collected_volume_id); +} + + +association { + + CollectedVolume[0..1] collectedVolume = join ct_article_in_collected_volume.article_id + to ct_collected_volume_article_map.article_id, + join ct_collected_volume_article_map.collected_volume_id + to ct_collected_volume.collected_volume_id; + ArticleInCollectedVolume[0..n] articles = join ct_collected_volume.collected_volume_id + to ct_collected_volume_article_map.collected_volume_id, + join ct_collected_volume_article_map.article_id + to ct_article_in_collected_volume.article_id + + Integer[0..1] articleOrder = ct_collected_volume_article_map.article_order INTEGER; + +} + diff --git a/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Expertise.pdl b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Expertise.pdl new file mode 100644 index 000000000..e5c959e0d --- /dev/null +++ b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Expertise.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 an expertise +object type Expertise extends Publication { + + String[0..1] place = ct_expertise.place VARCHAR(256); + Integer[0..1] numberOfPages = ct_expertise.number_of_pages INTEGER; + String[0..1] url = ct_expertise.url VARCHAR(512); + + reference key (ct_expertise.expertise_id); + +} + +assoication { + + GenericOrganizationalUnit[0..1] organization = join cms_organizationalunit.organizationalunit_id + to ct_expertise.organization_id; + +} + +assoication { + + GenericOrganizationalUnit[0..1] orderer = join cms_organizationalunit.organizationalunit_id + to ct_expertise.orderer_id; +} + diff --git a/ccm-cms-types-publications/pdl/com/arsdigita/content-types/GreyLiterature.pdl b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/GreyLiterature.pdl new file mode 100644 index 000000000..3b6560076 --- /dev/null +++ b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/GreyLiterature.pdl @@ -0,0 +1,34 @@ +// +// 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 grey literature +object type GreyLiterature extends UnPublished { + + Integer[0..1] pagesFrom = ct_grey_literature.pagesFrom INTEGER; + Integer[0..1] pagesTo = ct_grey_literature.pagesTo INTEGER; + String[0..1] url = ct_grey_literature.url VARCHAR(512); + + reference key (ct_grey_literature.grey_literature_id); + +} \ No newline at end of file diff --git a/ccm-cms-types-publications/pdl/com/arsdigita/content-types/InProceedings.pdl b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/InProceedings.pdl new file mode 100644 index 000000000..97697697b --- /dev/null +++ b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/InProceedings.pdl @@ -0,0 +1,39 @@ +// +// 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 InProceedings publication +object type InProceedings extends PublicationWithPublisher { + + String[0..1] organizerOfConference = ct_inproceedings.organizer_of_conference VARCHAR(256); + String[0..1] nameOfConference = ct_inproceedings.name_of_conference VARCHAR(256); + Date[0..1] dateFromOfConference = ct_inproceedings.date_from_of_conference DATE; + Date[0..1] dateToOfConference = ct_inproceedings.date_to_of_conference DATE; + String[0..1] placeOfConference = ct_inproceedings.place_of_conference VARCHAR(256); + Integer volume = ct_inproceedings.volume INTEGER; + Integer numberOfVolumes = ct_inproceedings.numberOfVolumes INTEGER; + Integer numberOfPages = ct_inproceedings.numberOfPages INTEGER; + Integer pagesFrom = ct_inproceedings.pages_from INTEGER; + Integer pagesTo = ct_inproceedings.pages_to INTEGER; + +} diff --git a/ccm-cms-types-publications/pdl/com/arsdigita/content-types/InternetArticle.pdl b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/InternetArticle.pdl new file mode 100644 index 000000000..d5fb4516b --- /dev/null +++ b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/InternetArticle.pdl @@ -0,0 +1,43 @@ +// +// 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 InternetArticle publication +object type InternetArticle extends Publication { + + String[0..1] place = ct_internet_article.place VARCHAR(256); + String[0..1] number = ct_internet_article.number VARCHAR(128); + Integer[0..1] numberOfPages = ct_internet_article.number_of_pages INTEGER; + String[0..1] edition = ct_internet_article.edition VARCHAR(256); + String[0..1] issn = ct_internet_article.issn VARCHAR(8); + Date[0..1] publicationDate = ct_internet_article.publicationDate DATE; + + reference key (ct_internet_article.internet_article_Id); +} + +assoication { + + GenericOrganizationalUnit[0..1] organization = join cms_organizationalunit.organizationalunit_id + to ct_internet_article.organization_id; + +} diff --git a/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Monograph.pdl b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Monograph.pdl new file mode 100644 index 000000000..1eabf0fca --- /dev/null +++ b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Monograph.pdl @@ -0,0 +1,33 @@ +// +// 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 monograph +object type Monograph extends PublicationWithPublisher { + + Integer[0..1] volume = ct_monograph.volume INTEGER; + Integer[0..1] numberOfVolumes = ct_monograph.number_of_volumes INTEGER; + Integer[0..1] numberOfPages = ct_monograph.number_of_pages INTEGER; + String[0..1] edition = ct_monograph.edition = VARCHAR(512); + +} 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 index 0e62565de..bbd1c0527 100644 --- a/ccm-cms-types-publications/pdl/com/arsdigita/content-types/PublicationWithPublisher.pdl +++ b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/PublicationWithPublisher.pdl @@ -26,23 +26,10 @@ import com.arsdigita.cms.ContentPage; object type PublicationWithPublisher extends Publication { String[0..1] isbn = ct_publication_with_publisher.isbn VARCHAR(13); - + component Publisher[0..1] publisher = join ct_publication_with_publisher.publication_with_publisher_id + to ct_publisher.publisher_id; + 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/Publisher.pdl b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Publisher.pdl new file mode 100644 index 000000000..3cdd46947 --- /dev/null +++ b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Publisher.pdl @@ -0,0 +1,33 @@ +// +// 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.*; + +// PDL definition for a publisher +object type Publisher extends GenericOrganizationalUnit { + + String[0..1] place = ct_publisher.place VARCHAR(256) + + reference key (ct_publisher.publisher_id) +} + + diff --git a/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Review.pdl b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Review.pdl new file mode 100644 index 000000000..3095fab96 --- /dev/null +++ b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Review.pdl @@ -0,0 +1,39 @@ +// +// 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 InternetArticle publication +object type Review extends Publication { + + String[0..1] journal = ct_review.journal VARCHAR(512); + Integer[0..1] volume = ct_review.volume INTEGER; + String[0.1] issue = ct_review.issue VARCHAR(512); + Integer[0..1] pagesFrom = ct_review.pages_from INTEGER; + Integer[0..1] pagesto = ct_review.pages_to INTEGER; + String[0..1] issn = ct_review.issn VARCHAR(8); + String[0..1] url = ct_review.url VARCHAR(512); + Date[0..1] publicationDate = ct_review.publication_date Date; + + reference key (ct_review.review_id); + +} \ 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 index d39be7a37..73e8bd3d8 100644 --- a/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Series.pdl +++ b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/Series.pdl @@ -37,7 +37,7 @@ association { join ct_series_editship.series_id to ct_series.series_id; - GenericPerson[0..n] persons = join ct_series.series_id + GenericPerson[0..n] editors = join ct_series.series_id to ct_series_editship.series_id, join ct_series_editship.person_id to cms_persons.person_id; @@ -46,6 +46,9 @@ association { Date[0..1] from = ct_series_editship.from DATE Date[0..] to = ct_series_editship.to DATE + //Sorting is first done by the period defined by from and to, + //and secondly by the following order attribute + Integer[0..1] editor_order = ct_series_editship.order INTEGER; } //Assoication for the volumes in the series diff --git a/ccm-cms-types-publications/pdl/com/arsdigita/content-types/UnPublished.pdl b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/UnPublished.pdl new file mode 100644 index 000000000..cfa3bf68d --- /dev/null +++ b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/UnPublished.pdl @@ -0,0 +1,40 @@ +// +// 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 an unpublished publication (grey literature) +object type UnPublished extends Publication { + + String[0..1] place = ct_unpublished.place VARCHAR(256); + String[0..1] number = ct_unpublished.number VARCHAR(128); + Integer[0..1] numberOfPages = ct_unpublished.number_of_pages INTEGER; + + reference key (ct_unpublished.unpublished_id); +} + +assoication { + + GenericOrganizationalUnit[0..1] organization = join cms_organizationalunit.organizationalunit_id + to ct_internet_article.organization_id; + +} diff --git a/ccm-cms-types-publications/pdl/com/arsdigita/content-types/WorkingPages.pdl b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/WorkingPages.pdl new file mode 100644 index 000000000..3e192f7a0 --- /dev/null +++ b/ccm-cms-types-publications/pdl/com/arsdigita/content-types/WorkingPages.pdl @@ -0,0 +1,30 @@ +// +// 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 working paper +object type WorkingPaper extends UnPublished { + + reference key (ct_working_paper.working_paper_id); + +} \ No newline at end of file diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/ArticleInCollectedVolume.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/ArticleInCollectedVolume.java new file mode 100644 index 000000000..292db0568 --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/ArticleInCollectedVolume.java @@ -0,0 +1,87 @@ +/* + * 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; + +/** + * + * @author Jens Pelzetter + */ +public class ArticleInCollectedVolume extends PublicationWithPublisher { + + public final static String PAGES_FROM = "pagesFrom"; + public final static String PAGES_TO = "pagesTo"; + public final static String CHAPTER = "chapter"; + public final static String COLLECTED_VOLUME = "collectedVolume"; + + public final static String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.cms.contenttypes.ArticleInCollectedVolume"; + + public ArticleInCollectedVolume() { + this(BASE_DATA_OBJECT_TYPE); + } + + public ArticleInCollectedVolume(BigDecimal id) + throws DataObjectNotFoundException{ + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + + } + + public ArticleInCollectedVolume(OID oid) throws + DataObjectNotFoundException{ + super(oid); + } + + public ArticleInCollectedVolume(DataObject dataObject) { + super(dataObject); + } + + public ArticleInCollectedVolume(String type) { + super(type); + } + + public Integer getPagesFrom() { + return (Integer)get(PAGES_FROM); + } + + public void setPagesFrom(Integer pagesFrom) { + set(PAGES_FROM, pagesFrom); + } + + public Integer getPagesTo() { + return (Integer)get(PAGES_TO); + } + + public void setPagesTo(Integer pagesTo) { + set(PAGES_TO, pagesTo); + } + + public CollectedVolume getCollectedVolume() { + return (CollectedVolume) get(COLLECTED_VOLUME); + } + + public void setCollectedVolume(CollectedVolume collectedVolume) { + set(COLLECTED_VOLUME, collectedVolume); + } +} diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/ArticleInCollectedVolumeCollection.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/ArticleInCollectedVolumeCollection.java new file mode 100644 index 000000000..3d9bbc999 --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/ArticleInCollectedVolumeCollection.java @@ -0,0 +1,154 @@ +/* + * 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.DomainCollection; +import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.DataObject; +import org.apache.log4j.Logger; + +/** + * + * @author Jens Pelzetter + */ +public class ArticleInCollectedVolumeCollection extends DomainCollection { + + public static final String LINKORDER = "link.article_order"; + public static final String ORDER = "article_order"; + private static final Logger s_log = + Logger.getLogger( + ArticleInCollectedVolumeCollection.class); + + public ArticleInCollectedVolumeCollection(DataCollection dataCollection) { + super(dataCollection); + + m_dataCollection.addOrder(LINKORDER); + } + + public Integer getArticleOrder() { + return (Integer) m_dataCollection.get(LINKORDER); + } + + public void setArticleOrder(Integer order) { + DataObject link = (DataObject) this.get("link"); + + link.set(ORDER, order); + } + + public void swapWithNext(ArticleInCollectedVolume article) { + int currentPosition = 0; + int currentIndex = 0; + int nextIndex = 0; + + s_log.debug("Searching article..."); + this.rewind(); + while (this.next()) { + currentPosition = this.getPosition(); + currentIndex = this.getArticleOrder(); + s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, + currentIndex, this.size())); + s_log.debug(String.format("getArticleOrder(): %d", + getArticleOrder())); + if (this.getArticle().equals(article)) { + break; + } + } + + if (currentPosition == 0) { + throw new IllegalArgumentException( + String.format( + "The provided article is not " + + "part of this collection.")); + } + + if (this.next()) { + nextIndex = this.getArticleOrder(); + } else { + throw new IllegalArgumentException( + "The provided article is the last " + + "in the collection, so there is no next object " + + "to swap with."); + } + + this.rewind(); + + while (this.getPosition() != currentPosition) { + this.next(); + } + + this.setArticleOrder(nextIndex); + this.next(); + this.setArticleOrder(currentIndex); + this.rewind(); + } + + public void swapWithPrevious(ArticleInCollectedVolume article) { + int previousPosition = 0; + int previousIndex = 0; + int currentPosition = 0; + int currentIndex = 0; + + s_log.debug("Searching article..."); + this.rewind(); + while (this.next()) { + currentPosition = this.getPosition(); + currentIndex = this.getArticleOrder(); + s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, + currentIndex, this.size())); + s_log.debug(String.format("getArticleOrder(): %d", + getArticleOrder())); + if (this.getArticle().equals(article)) { + break; + } + + previousPosition = currentPosition; + previousIndex = currentIndex; + } + + if (currentPosition == 0) { + throw new IllegalArgumentException( + String.format( + "The provided article is not " + + "part of this collection.")); + } + + if (previousPosition == 0) { + throw new IllegalArgumentException( + String.format( + "The provided article is the first one in this " + + "collection, so there is no previous one to switch " + + "with.")); + } + + this.rewind(); + while (this.getPosition() != previousPosition) { + this.next(); + } + + this.setArticleOrder(currentIndex); + this.next(); + this.setArticleOrder(previousIndex); + this.rewind(); + } + + public ArticleInCollectedVolume getArticle() { + return new ArticleInCollectedVolume(m_dataCollection.getDataObject()); + } +} diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/AuthorshipCollection.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/AuthorshipCollection.java new file mode 100644 index 000000000..712918527 --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/AuthorshipCollection.java @@ -0,0 +1,161 @@ +/* + * 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.DomainCollection; +import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.DataObject; +import org.apache.log4j.Logger; + +/** + * + * @author Jens Pelzetter + */ +public class AuthorshipCollection extends DomainCollection { + + private final static Logger s_log = + Logger.getLogger(AuthorshipCollection.class); + public static final String ORDER = "authorship_order"; + public static final String LINKORDER = "link.authorship_order"; + public static final String EDITOR = "editor"; + public static final String LINKEDITOR = "link.editor"; + + public AuthorshipCollection( + DataCollection dataCollection) { + super(dataCollection); + } + + public Integer getAuthorshipOrder() { + return (Integer) m_dataCollection.get(LINKORDER); + } + + public void setAuthorshipOrder(Integer order) { + DataObject link = (DataObject) this.get("link"); + + link.set(ORDER, order); + } + + public Boolean isEditor() { + return (Boolean) m_dataCollection.get(LINKEDITOR); + } + + public void setEditor(Boolean editor) { + DataObject link = (DataObject) this.get("link"); + + link.set(EDITOR, editor); + } + + public void swapWithNext(GenericPerson author) { + int currentPos = 0; + int currentIndex = 0; + int nextIndex = 0; + + s_log.debug("Searching author..."); + this.rewind(); + while (this.next()) { + currentPos = this.getPosition(); + currentIndex = this.getAuthorshipOrder(); + s_log.debug(String.format("Position: %d(%d)/%d", currentPos, + currentIndex, this.size())); + s_log.debug(String.format("getAuthorshipOrder(): %d", + getAuthorshipOrder())); + if (this.getAuthor().equals(author)) { + break; + } + } + + if (currentPos == 0) { + throw new IllegalArgumentException( + String.format("The provided person is not an author " + + "of this publication.")); + } + + if (this.next()) { + nextIndex = this.getAuthorshipOrder(); + } else { + throw new IllegalArgumentException( + String.format( + "The provided person is the last in the" + + "collection, so threre is no next object to swap with.")); + } + + this.rewind(); + + while (this.getPosition() != currentPos) { + this.next(); + } + + this.setAuthorshipOrder(nextIndex); + this.next(); + this.setAuthorshipOrder(currentIndex); + this.rewind(); + } + + public void swapWithPrevious(GenericPerson author) { + int previousPos = 0; + int previousIndex = 0; + int currentPos = 0; + int currentIndex = 0; + + s_log.debug("Searching author..."); + this.rewind(); + while (this.next()) { + currentPos = this.getPosition(); + currentIndex = this.getAuthorshipOrder(); + s_log.debug(String.format("Position: %d(%d)/%d", currentPos, + currentIndex, this.size())); + s_log.debug(String.format("getAuthorshipOrder(): %d", + getAuthorshipOrder())); + if (this.getAuthor().equals(author)) { + break; + } + + previousPos = currentPos; + previousIndex = currentIndex; + } + + if (currentPos == 0) { + throw new IllegalArgumentException( + String.format("The provided person is not an author " + + "of this publication.")); + } + + if (previousPos == 0) { + throw new IllegalArgumentException( + String.format( + "The provided author is the first one in this " + + "collection, so there is no previous one to switch " + + "with.")); + } + + this.rewind(); + while (this.getPosition() != previousPos) { + this.next(); + } + + this.setAuthorshipOrder(currentIndex); + this.next(); + this.setAuthorshipOrder(previousIndex); + this.rewind(); + } + + public GenericPerson getAuthor() { + return new GenericPerson(m_dataCollection.getDataObject()); + } +} diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/CollectedVolume.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/CollectedVolume.java new file mode 100644 index 000000000..f83d9c32b --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/CollectedVolume.java @@ -0,0 +1,117 @@ +/* + * 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.DataCollection; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.OID; +import com.arsdigita.util.Assert; +import java.math.BigDecimal; + +/** + * + * @author Jens Pelzetter + */ +public class CollectedVolume extends PublicationWithPublisher { + + public static final String VOLUME = "volume"; + public static final String NUMBER_OF_VOLUMES = "numberOfVolumes"; + public static final String NUMBER_OF_PAGES = "numberOfPages"; + public static final String EDITION = "edition"; + public static final String ARTICLES = "articles"; + public static final String ARTICLE_ORDER = "articleOrder"; + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.cms.contenttypes.CollectedVolume"; + + public CollectedVolume() { + super(BASE_DATA_OBJECT_TYPE); + } + + public CollectedVolume(BigDecimal id) throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public CollectedVolume(OID oid) throws DataObjectNotFoundException { + super(oid); + } + + public CollectedVolume(DataObject dataObject) { + super(dataObject); + } + + public CollectedVolume(String type) { + super(type); + } + + public Integer getVolume() { + return (Integer) get(VOLUME); + } + + public void setVolume(Integer volume) { + set(VOLUME, volume); + } + + public Integer getNumberOfVolumes() { + return (Integer) get(NUMBER_OF_VOLUMES); + } + + public void setNumberOfVolumes(Integer numberOfVolumes) { + set(NUMBER_OF_VOLUMES, numberOfVolumes); + } + + public Integer getNumberOfPages() { + return (Integer) get(NUMBER_OF_PAGES); + } + + public void setNumberOfPages(Integer numberOfPages) { + set(NUMBER_OF_PAGES, numberOfPages); + } + + public String getEdition() { + return (String) get(EDITION); + } + + public void setEdition(String edition) { + set(EDITION, edition); + } + + public ArticleInCollectedVolumeCollection getArticles() { + return new ArticleInCollectedVolumeCollection( + (DataCollection) get(ARTICLES)); + } + + public void addArticle(ArticleInCollectedVolume article) { + Assert.exists(article, ArticleInCollectedVolume.class); + + DataObject link = add(ARTICLES, article); + + link.set(ARTICLE_ORDER, Integer.valueOf((int) getArticles().size())); + } + + public void removeArticle(ArticleInCollectedVolume article) { + Assert.exists(article, ArticleInCollectedVolume.class); + remove(ARTICLES, article); + } + + public boolean hasArticles() { + return !this.getArticles().isEmpty(); + } +} diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/EditshipCollection.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/EditshipCollection.java new file mode 100644 index 000000000..6a8d221fb --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/EditshipCollection.java @@ -0,0 +1,205 @@ +/* + * 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.DomainCollection; +import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.DataObject; +import java.util.Date; +import org.apache.log4j.Logger; + +/** + * + * @author Jens Pelzetter + */ +public class EditshipCollection extends DomainCollection { + + public static final String LINK_FROM = "link.from"; + public static final String LINK_TO = "link.to"; + public static final String FROM = "from"; + public static final String TO = "to"; + public static final String LINKORDER = "link.editor_order"; + public static final String ORDER = "editor_order"; + private final static Logger s_log = + Logger.getLogger(EditshipCollection.class); + + public EditshipCollection(DataCollection dataCollection) { + super(dataCollection); + + m_dataCollection.addOrder(LINKORDER); + } + + public Date getFrom() { + return (Date) m_dataCollection.get(LINK_FROM); + } + + public void setFrom(Date from) { + DataObject link = (DataObject) this.get("link"); + + link.set(FROM, from); + } + + public Date getTo() { + return (Date) m_dataCollection.get(LINK_TO); + } + + public void setTo(Date to) { + DataObject link = (DataObject) this.get("link"); + + link.set(TO, to); + } + + /** + * Gets the value of the order attribute for the current association. + * + * @return Order value of the current item. + */ + public Integer getEditorOrder() { + return (Integer) m_dataCollection.get(LINKORDER); + } + + /** + * Sets the value of the order attribute of the current association. + * + * @param order The new value for the order. + * + */ + public void setEditorOrder(Integer order) { + DataObject link = (DataObject) this.get("link"); + + link.set(ORDER, order); + } + + /** + * Swaps the item {@code child} with the next one in the collection. + * + * @param editor The item to swap with the next one. + * @throws IllegalArgumentException Thrown if the items provided is + * not part of this collection, or if the item is the last one in the + * collection. + */ + public void swapWithNext(GenericPerson editor) { + int currentPosition = 0; + int currentIndex = 0; + int nextIndex = 0; + + s_log.debug("Search editor..."); + this.rewind(); + while (this.next()) { + currentPosition = this.getPosition(); + currentIndex = this.getEditorOrder(); + s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, + currentIndex, this.size())); + s_log.debug(String.format("getEditorOrder(): %d", + getEditorOrder())); + if (this.getEditor().equals(editor)) { + break; + } + } + + if (currentPosition == 0) { + throw new IllegalArgumentException( + String.format( + "The provided person is not " + + "part of this collection.")); + } + + if (this.next()) { + nextIndex = this.getEditorOrder(); + } else { + throw new IllegalArgumentException( + "The provided person is the last " + + "in the collection, so there is no next object " + + "to swap with."); + } + + this.rewind(); + + while (this.getPosition() != currentPosition) { + this.next(); + } + + this.setEditorOrder(nextIndex); + this.next(); + this.setEditorOrder(currentIndex); + this.rewind(); + } + + /** + * Swaps the item {@code editor} with the previous one in the collection. + * + * @param editor The person to swap with the previous one. + * @throws IllegalArgumentException Thrown if the person provided is + * not part of this collection, or if the person is the first one in the + * collection. + */ + public void swapWithPrevious(GenericPerson editor) { + int previousPosition = 0; + int previousIndex = 0; + int currentPosition = 0; + int currentIndex = 0; + + s_log.debug("Searching editor..."); + this.rewind(); + while (this.next()) { + currentPosition = this.getPosition(); + currentIndex = this.getEditorOrder(); + s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, + currentIndex, this.size())); + s_log.debug(String.format("getEditorOrder(): %d", + getEditorOrder())); + if (this.getEditor().equals(editor)) { + break; + } + + previousPosition = currentPosition; + previousIndex = currentIndex; + } + + if (currentPosition == 0) { + throw new IllegalArgumentException( + String.format( + "The provided person is not " + + "part of this collection.")); + } + + if (previousPosition == 0) { + throw new IllegalArgumentException( + String.format( + "The provided person is the first one in this " + + "collection, so there is no previous one to switch " + + "with.")); + } + + this.rewind(); + while (this.getPosition() != previousPosition) { + this.next(); + } + + this.setEditorOrder(currentIndex); + this.next(); + this.setEditorOrder(previousIndex); + this.rewind(); + } + + public GenericPerson getEditor() { + return new GenericPerson(m_dataCollection.getDataObject()); + } +} diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Expertise.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Expertise.java new file mode 100644 index 000000000..34b9d649c --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Expertise.java @@ -0,0 +1,100 @@ +/* + * 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; + +/** + * + * @author Jens Pelzetter + */ +public class Expertise extends Publication { + + public static final String PLACE = "place"; + public static final String ORGANIZATION = "organization"; + public static final String NUMBER_OF_PAGES = "numberOfPages"; + public static final String URL = "url"; + public static final String ORDERER = "orderer"; + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.cms.contentttypes.Expertise"; + + public Expertise() { + this(BASE_DATA_OBJECT_TYPE); + } + + public Expertise(BigDecimal id) throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public Expertise(OID oid) throws DataObjectNotFoundException { + super(oid); + } + + public Expertise(DataObject dataObject) { + super(dataObject); + } + + public Expertise(String type) { + super(type); + } + + public String getPlace() { + return (String) get(PLACE); + } + + public void setPlace(String place) { + set(PLACE, place); + } + + public GenericOrganizationalUnit getOrganization() { + return (GenericOrganizationalUnit) get(ORGANIZATION); + } + + public void setOrganization(GenericOrganizationalUnit orga) { + set(ORGANIZATION, orga); + } + + public Integer getNumberOfPages() { + return (Integer) get(NUMBER_OF_PAGES); + } + + public void setNumberOfPages(Integer numberOfPages) { + set(NUMBER_OF_PAGES, numberOfPages); + } + + public String getUrl() { + return (String) get(URL); + } + + public void setUrl(String url) { + set(URL, url); + } + + public GenericOrganizationalUnit getOrderer() { + return (GenericOrganizationalUnit) get(ORDERER); + } + + public void setOrderer(GenericOrganizationalUnit orderer) { + set(ORDERER, orderer); + } +} diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/GreyLiterature.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/GreyLiterature.java new file mode 100644 index 000000000..602dce509 --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/GreyLiterature.java @@ -0,0 +1,82 @@ +/* + * 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; + +/** + * + * @author Jens Pelzetter + */ +public class GreyLiterature extends UnPublished { + + public static final String PAGES_FROM = "pagesFrom"; + public static final String PAGES_TO = "pagesTo"; + public static final String URL = "url"; + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.cms.contenttypes.GreyLiterature"; + + public GreyLiterature() { + this(BASE_DATA_OBJECT_TYPE); + } + + public GreyLiterature(BigDecimal id) throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public GreyLiterature(OID oid) throws DataObjectNotFoundException { + super(oid); + } + + public GreyLiterature(DataObject dataObject) { + super(dataObject); + } + + public GreyLiterature(String type) { + super(type); + } + + public Integer getPagesFrom() { + return (Integer) get(PAGES_FROM); + } + + public void setPagesFrom(Integer pagesFrom) { + set(PAGES_FROM, pagesFrom); + } + + public Integer getPagesTo() { + return (Integer) get(PAGES_TO); + } + + public void setPagesTo(Integer pagesTo) { + set(PAGES_TO, pagesTo); + } + + public String getUrl() { + return (String) get(URL); + } + + public void setUrl(String url) { + set(URL, url); + } +} diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/InProceedings.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/InProceedings.java new file mode 100644 index 000000000..00742b938 --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/InProceedings.java @@ -0,0 +1,141 @@ +/* + * 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; +import java.util.Date; + +/** + * + * @author Jens Pelzetter + */ +public class InProceedings extends PublicationWithPublisher { + + public static final String ORGANIZER_OF_CONFERENCE = + "organizerOfConference"; + public static final String NAME_OF_CONFERENCE = "nameOfConference"; + public static final String DATE_FROM_OF_CONFERENCE = "dateFromOfConference"; + public static final String DATE_TO_OF_CONFERENCE = "dateToOfConference"; + public static final String PLACE_OF_CONFERENCE = "placeOfConference"; + public static final String VOLUME = "volume"; + public static final String NUMBER_OF_VOLUMES = "numberOfVolumes"; + public static final String NUMBER_OF_PAGES = "numberOfPages"; + public static final String PAGES_FROM = "pagesFrom"; + public static final String PAGES_TO = "pagesFrom"; + + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.cms.contenttypes.InProceedings"; + + public InProceedings() { + super(BASE_DATA_OBJECT_TYPE); + } + + public InProceedings(BigDecimal id) throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public InProceedings(OID oid) throws DataObjectNotFoundException { + super(oid); + } + + public InProceedings(DataObject dataObject) { + super(dataObject); + } + + public InProceedings(String type) { + super(type); + } + + public String getOrganizerOfConference() { + return (String) get(ORGANIZER_OF_CONFERENCE); + } + + public void setOrganizerOfConference(String organizerOfConference) { + set(ORGANIZER_OF_CONFERENCE, organizerOfConference); + } + + public String getNameOfConference(String nameOfConference) { + return (String) get(NAME_OF_CONFERENCE); + } + + public void setNameOfConference(String nameOfConference) { + set(NAME_OF_CONFERENCE, nameOfConference); + } + + public Date getDateFromOfConference() { + return (Date) get(DATE_FROM_OF_CONFERENCE); + } + + public void setDateFromOfConference(Date dateFromOfConference) { + set(DATE_FROM_OF_CONFERENCE, dateFromOfConference); + } + + public Date getDateToOfConference() { + return (Date) get(DATE_TO_OF_CONFERENCE); + } + + public void setDateToOfConference(Date dateToOfConference) { + set(DATE_TO_OF_CONFERENCE, dateToOfConference); + } + + public Integer getVolume() { + return (Integer) get(VOLUME); + } + + public void setVolume(Integer volume) { + set(VOLUME, volume); + } + + public Integer getNumberOfVolumes() { + return (Integer) get(NUMBER_OF_VOLUMES); + } + + public void setNumberOfVolumes(Integer numberOfVolumes) { + set(NUMBER_OF_VOLUMES, numberOfVolumes); + } + + public Integer getNumberOfPages() { + return (Integer) get(NUMBER_OF_PAGES); + } + + public void setNumberOfPages(Integer numberOfPages) { + set(NUMBER_OF_PAGES, numberOfPages); + } + + public Integer getPagesFrom() { + return (Integer) get(PAGES_FROM); + } + + public void setPagesFrom(Integer pagesFrom) { + set(PAGES_FROM, pagesFrom); + } + + public Integer getPagesTo() { + return (Integer) get(PAGES_TO); + } + + public void setPagesTo(Integer pagesTo) { + set(PAGES_TO, pagesTo); + } + +} diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/InternetArticle.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/InternetArticle.java new file mode 100644 index 000000000..fcc68fa9e --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/InternetArticle.java @@ -0,0 +1,121 @@ +/* + * 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; +import java.util.Date; + +/** + * + * @author Jens Pelzetter + */ +public class InternetArticle extends Publication { + + public static final String PLACE = "place"; + public static final String ORGANIZATION = "organization"; + public static final String NUMBER = "number"; + public static final String NUMBER_OF_PAGES = "numberOfPages"; + public static final String EDITION = "edition"; + public static final String ISSN = "issn"; + public static final String PUBLICATION_DATE = "publicationDate"; + + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.cms.contenttypes.InternetArticle"; + + public InternetArticle() { + this(BASE_DATA_OBJECT_TYPE); + } + + public InternetArticle(BigDecimal id) throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public InternetArticle(OID oid) throws DataObjectNotFoundException { + super(oid); + } + + public InternetArticle(DataObject dataObject) { + super(dataObject); + } + + public InternetArticle(String type) { + super(type); + } + + public String getPlace() { + return (String) get(PLACE); + } + + public void setPlace(String place) { + set(PLACE, place); + } + + public GenericOrganizationalUnit getOrganization() { + return (GenericOrganizationalUnit) get(ORGANIZATION); + } + + public void setOrganziation(GenericOrganizationalUnit orga) { + set(ORGANIZATION, orga); + } + + public String getNumber() { + return (String) get(NUMBER); + } + + public void setNumber(String number) { + set(NUMBER, number); + } + + public Integer getNumberOfPages() { + return (Integer) get(NUMBER_OF_PAGES); + } + + public void setNumberOfPages(Integer numberOfPages) { + set(NUMBER_OF_PAGES, numberOfPages); + } + + public String getEdition() { + return (String) get(EDITION); + } + + public void setEdition(String edition) { + set(EDITION, edition); + } + + public String getISSN() { + return (String) get(ISSN); + } + + public void setISSN(String issn) { + set(ISSN, issn); + } + + public Date getPublicationDate() { + return (Date) get(PUBLICATION_DATE); + } + + public void setPublicationDate(Date pubDate) { + set(PUBLICATION_DATE, pubDate); + } + +} diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Monograph.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Monograph.java new file mode 100644 index 000000000..bf1d0e23f --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Monograph.java @@ -0,0 +1,91 @@ +/* + * 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; + +/** + * + * @author Jens Pelzetter + */ +public class Monograph extends PublicationWithPublisher { + + public static final String VOLUME = "volume"; + public static final String NUMBER_OF_VOLUMES = "numberOfVolumes"; + public static final String NUMBER_OF_PAGES = "numberOfPages"; + public static final String EDITION = "edition"; + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.cms.contenttypes.Monograph"; + + public Monograph() { + this(BASE_DATA_OBJECT_TYPE); + } + + public Monograph(BigDecimal id) throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public Monograph(OID oid) throws DataObjectNotFoundException { + super(oid); + } + + public Monograph(DataObject dataObject) { + super(dataObject); + } + + public Monograph(String type) { + super(type); + } + + public Integer getVolume() { + return (Integer) get(VOLUME); + } + + public void setVolume(Integer volume) { + set(VOLUME, volume); + } + + public Integer getNumberOfVolumes() { + return (Integer) get(NUMBER_OF_VOLUMES); + } + + public void setNumberOfVolumes(Integer numberOfVolumes) { + set(NUMBER_OF_VOLUMES, numberOfVolumes); + } + + public Integer getNumberOfPages() { + return (Integer) get(NUMBER_OF_PAGES); + } + + public void setNumberOfPages(Integer numberOfPages) { + set(NUMBER_OF_PAGES, numberOfPages); + } + + public String getEdition() { + return (String) get(EDITION); + } + + public void setEdition(String edition) { + set(EDITION, edition); + } +} diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Publication.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Publication.java new file mode 100644 index 000000000..1eacbfe56 --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Publication.java @@ -0,0 +1,111 @@ +/* + * 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.cms.ContentPage; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.OID; +import com.arsdigita.util.Assert; +import java.math.BigDecimal; + +/** + * + * @author Jens Pelzetter + */ +public abstract class Publication extends ContentPage { + + public final static String YEAR_OF_PUBLICATION = "yearOfPublication"; + public final static String ABSTRACT = "abstract"; + public final static String MISC = "misc"; + public final static String AUTHORS = "authors"; + public final static String EDITOR = "editor"; + public final static String AUTHOR_ORDER = "author_order"; + public final static String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.cms.contenttypes.Publication"; + + public Publication() { + this(BASE_DATA_OBJECT_TYPE); + } + + public Publication(BigDecimal id) throws + DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public Publication(OID oid) throws DataObjectNotFoundException { + super(oid); + } + + public Publication(DataObject obj) { + super(obj); + } + + public Publication(String type) { + super(type); + } + + public int getYearOfPublication() { + return (Integer) get(YEAR_OF_PUBLICATION); + } + + public void setYearOfPublication(int year) { + set(YEAR_OF_PUBLICATION, year); + } + + public String getAbstract() { + return (String) get(ABSTRACT); + } + + public void setAbstract(String theAbstract) { + set(ABSTRACT, + theAbstract); + } + + public String getMisc() { + return (String) get(MISC); + } + + public void setMisc(String misc) { + set(MISC, misc); + } + + public AuthorshipCollection getAuthors() { + return new AuthorshipCollection((DataCollection) get(AUTHORS)); + } + + public void addAuthor(GenericPerson author, Boolean editor) { + Assert.exists(author, GenericPerson.class); + + DataObject link = add(AUTHORS, author); + + link.set(EDITOR, editor); + link.set(AUTHOR_ORDER, Integer.valueOf((int) getAuthors().size())); + } + + public void removeAuthor(GenericPerson author) { + Assert.exists(author, GenericPerson.class); + remove(AUTHORS, author); + } + + public boolean hasAuthors() { + return !this.getAuthors().isEmpty(); + } +} diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/PublicationWithPublisher.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/PublicationWithPublisher.java new file mode 100644 index 000000000..d51a0a1c1 --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/PublicationWithPublisher.java @@ -0,0 +1,75 @@ +/* + * 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; + +/** + * + * @author Jens Pelzetter + */ +public class PublicationWithPublisher extends Publication { + + public final static String ISBN = "isbn"; + public final static String PUBLISHER = "publisher"; + public final static String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.cms.contenttypes.PublicationWithPublisher"; + + public PublicationWithPublisher() { + this(BASE_DATA_OBJECT_TYPE); + } + + public PublicationWithPublisher(BigDecimal id) + throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public PublicationWithPublisher(OID oid) + throws DataObjectNotFoundException { + super(oid); + } + + public PublicationWithPublisher(DataObject obj) { + super(obj); + } + + public PublicationWithPublisher(String type) { + super(type); + } + + public String getISBN() { + return (String) get(ISBN); + } + + public void setISBN(String isbn) { + set(ISBN, isbn); + } + + public Publisher getPublisher() { + return (Publisher) get(PUBLISHER); + } + + public void setPublisher(Publisher publisher) { + set(PUBLISHER, publisher); + } +} diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Publisher.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Publisher.java new file mode 100644 index 000000000..6bb3dd0b7 --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Publisher.java @@ -0,0 +1,65 @@ +/* + * 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; + +/** + * + * @author Jens Pelzetter + */ +public class Publisher extends GenericOrganizationalUnit { + + public static final String PLACE = "place"; + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.cms.contenttypes.Publisher"; + + public Publisher() { + this(BASE_DATA_OBJECT_TYPE); + } + + public Publisher(BigDecimal id) throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public Publisher(OID oid) throws DataObjectNotFoundException { + super(oid); + } + + public Publisher(DataObject dataObject) { + super(dataObject); + } + + public Publisher(String type) { + super(type); + } + + public String getPlace() { + return (String) get(PLACE); + } + + public void setPlace(String place) { + set(PLACE, place); + } + +} diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Review.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Review.java new file mode 100644 index 000000000..11f3619dd --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Review.java @@ -0,0 +1,131 @@ +/* + * 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; +import java.util.Date; + +/** + * + * @author Jens Pelzetter + */ +public class Review extends Publication { + + public static final String JOURNAL = "journal"; + public static final String VOLUME = "volume"; + public static final String ISSUE = "issue"; + public static final String PAGES_FROM = "pagesFrom"; + public static final String PAGES_TO = "pagesTo"; + public static final String ISSN = "issn"; + public static final String URL = "url"; + public static final String PUBLICATION_DATE = "publicationDate"; + + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.cms.contenttypes.Review"; + + public Review() { + this(BASE_DATA_OBJECT_TYPE); + } + + public Review(BigDecimal id) throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public Review(OID oid) throws DataObjectNotFoundException { + super(oid); + } + + public Review(DataObject dataObject) { + super(dataObject); + } + + public Review(String type) { + super(type); + } + + public String getJournal() { + return (String) get(JOURNAL); + } + + public void setJournal(String journal) { + set(JOURNAL, journal); + } + + public Integer getVolume() { + return (Integer) get(VOLUME); + } + + public void setInteger(Integer volume) { + set(VOLUME, volume); + } + + public String getIssue() { + return (String) get(ISSUE); + } + + public void setIssue(String issue) { + set(ISSUE, issue); + } + + public Integer getPagesFrom() { + return (Integer) get(PAGES_FROM); + } + + public void setPagesFrom(Integer pagesFrom) { + set(PAGES_FROM, pagesFrom); + } + + public Integer setPagesTo() { + return (Integer) get(PAGES_TO); + } + + public void setPagesTo(Integer pagesTo) { + set(PAGES_TO, pagesTo); + } + + public String getISSN() { + return (String) get(ISSN); + } + + public void setISSN(String issn) { + set(ISSN, issn); + } + + public String getUrl() { + return (String) get(URL); + } + + public void setUrl(String url) { + set(URL, url); + } + + + public Date getPublicationDate() { + return (Date) get(PUBLICATION_DATE); + } + + public void setPublicationDate(Date pubDate) { + set(PUBLICATION_DATE, pubDate); + } +} diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Series.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Series.java new file mode 100644 index 000000000..749495cb8 --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/Series.java @@ -0,0 +1,108 @@ +/* + * 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.cms.ContentPage; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.OID; +import com.arsdigita.util.Assert; +import java.math.BigDecimal; +import java.util.Date; + +/** + * + * @author Jens Pelzetter + */ +public class Series extends ContentPage { + + public static final String EDITORS = "editors"; + public static final String EDITOR_FROM = "from"; + public static final String EDITOR_TO = "to"; + public static final String EDITOR_ORDER = "editor_order"; + public static final String PUBLICATIONS = "publications"; + public static final String VOLUME_OF_SERIES = "volumeOfSeries"; + + public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Series"; + + public Series() { + this(BASE_DATA_OBJECT_TYPE); + } + + public Series(BigDecimal id) throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public Series(OID oid) throws DataObjectNotFoundException { + super(oid); + } + + public Series(DataObject obj ) { + super(obj); + } + + public Series(String type) { + super(type); + } + + public EditshipCollection getEditors() { + return new EditshipCollection((DataCollection) get(EDITORS)); + } + + public void addEditor(GenericPerson editor, Date from, Date to) { + Assert.exists(editor, GenericPerson.class); + + DataObject link = add(EDITORS, editor); + link.set(EDITOR_FROM, from); + link.set(EDITOR_TO, to); + link.set(EDITOR_ORDER, BigDecimal.valueOf(getEditors().size())); + } + + public void removeEditor(GenericPerson editor) { + Assert.exists(editor, GenericPerson.class); + remove(EDITORS, editor); + } + + public boolean hasEditors() { + return !this.getEditors().isEmpty(); + } + + public VolumeInSeriesCollection getVolumes() { + return new VolumeInSeriesCollection((DataCollection) get(PUBLICATIONS)); + } + + public void addVolume(Publication publication, Integer volume) { + Assert.exists(publication, Publication.class); + + DataObject link = add(PUBLICATIONS, publication); + + link.set(VOLUME_OF_SERIES, volume); + } + + public void removeVolume(Publication publication) { + Assert.exists(publication, Publication.class); + remove(PUBLICATIONS, publication); + } + + public boolean hasVolumes() { + return !this.getVolumes().isEmpty(); + } + +} diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/UnPublished.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/UnPublished.java new file mode 100644 index 000000000..0d3ad32ec --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/UnPublished.java @@ -0,0 +1,91 @@ +/* + * 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; + +/** + * + * @author Jens Pelzetter + */ +public abstract class UnPublished extends Publication { + + public static final String PLACE = "place"; + public static final String ORGANIZATION = "organization"; + public static final String NUMBER = "number"; + public static final String NUMBER_OF_PAGES = "numberOfPages"; + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.cms.contenttypes.UnPublished"; + + public UnPublished() { + this(BASE_DATA_OBJECT_TYPE); + } + + public UnPublished(BigDecimal id) throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public UnPublished(OID oid) throws DataObjectNotFoundException { + super(oid); + } + + public UnPublished(DataObject dataObject) { + super(dataObject); + } + + public UnPublished(String type) { + super(type); + } + + public String getPlace() { + return (String) get(PLACE); + } + + public void setPlace(String place) { + set(PLACE, place); + } + + public GenericOrganizationalUnit getOrganization() { + return (GenericOrganizationalUnit) get(ORGANIZATION); + } + + public void setOrganization(GenericOrganizationalUnit orga) { + set(ORGANIZATION, orga); + } + + public String getNumber() { + return (String) get(NUMBER); + } + + public void setNumber(String number) { + set(NUMBER, number); + } + + public Integer getNumberOfPages() { + return (Integer) get(NUMBER_OF_PAGES); + } + + public void setNumberOfPages(Integer numberOfPages) { + set(NUMBER_OF_PAGES, numberOfPages); + } +} diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/VolumeInSeriesCollection.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/VolumeInSeriesCollection.java new file mode 100644 index 000000000..4044c3cd2 --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/VolumeInSeriesCollection.java @@ -0,0 +1,66 @@ +/* + * 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.DomainCollection; +import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.DataObject; +import org.apache.log4j.Logger; + +/** + * + * @author Jens Pelzetter + */ +public class VolumeInSeriesCollection extends DomainCollection { + + public static final String LINK_VOLUME_OF_SERIES = "link.volumeOfSeries"; + public static final String VOLUME_OF_SERIES = "volumeOfSeries"; + public static final Logger s_log = + Logger.getLogger(VolumeInSeriesCollection.class); + + public VolumeInSeriesCollection(DataCollection dataCollection) { + super(dataCollection); + + m_dataCollection.addOrder(LINK_VOLUME_OF_SERIES); + } + + public Integer getVolumeOfSeries() { + return (Integer) m_dataCollection.get(LINK_VOLUME_OF_SERIES); + } + + public void setVolumeOfSeries(Integer volumeOfSeries) { + DataObject link = (DataObject) this.get("link"); + + link.set(VOLUME_OF_SERIES, volumeOfSeries); + } + + /** + * This method returns the current data object. Because the class + * {@link Publication} is abstract, it is not possible to create the + * real object here. The caller must check the type of the data object + * and create an real object from the returned data object. + * + * @return The current data object. + */ + public DataObject getPublication() { + return m_dataCollection.getDataObject(); + } + +} diff --git a/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/WorkingPaper.java b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/WorkingPaper.java new file mode 100644 index 000000000..c2002b026 --- /dev/null +++ b/ccm-cms-types-publications/src/com/arsdigita/cms/contenttypes/WorkingPaper.java @@ -0,0 +1,54 @@ +/* + * 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.persistence.DataObject; +import com.arsdigita.persistence.OID; +import java.math.BigDecimal; + +/** + * + * @author Jens Pelzetter + */ +public class WorkingPaper extends UnPublished { + + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.cms.contenttypes.WorkingPaper"; + + public WorkingPaper() { + this(BASE_DATA_OBJECT_TYPE); + } + + public WorkingPaper(BigDecimal id) { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public WorkingPaper(OID oid) { + super(oid); + } + + public WorkingPaper(DataObject dataObject) { + super(dataObject); + } + + public WorkingPaper(String type) { + super(type); + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java index b60d1b18e..6819c62bf 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java @@ -27,8 +27,8 @@ import com.arsdigita.util.Assert; import java.math.BigDecimal; /** - * This class provides a base type for building content types which represent organizations, - * departments, projects etc. + * This class provides a base type for building content types which represent + * organizations, departments, projects etc. * * An item of this content type can be linked with several other content types: * - Contact (0..n) @@ -63,7 +63,8 @@ public class GenericOrganizationalUnit extends ContentPage { this(new OID(BASE_DATA_OBJECT_TYPE, id)); } - public GenericOrganizationalUnit(OID oid) throws DataObjectNotFoundException { + public GenericOrganizationalUnit(OID oid) + throws DataObjectNotFoundException { super(oid); } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitChildrenCollection.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitChildrenCollection.java index 9737758a3..36d428655 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitChildrenCollection.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitChildrenCollection.java @@ -21,7 +21,6 @@ package com.arsdigita.cms.contenttypes; import com.arsdigita.domain.DomainCollection; import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.DataObject; -import com.arsdigita.persistence.OID; import org.apache.log4j.Logger; /** @@ -29,7 +28,8 @@ import org.apache.log4j.Logger; * * @author Jens Pelzetter */ -public class GenericOrganizationalUnitChildrenCollection extends DomainCollection { +public class GenericOrganizationalUnitChildrenCollection + extends DomainCollection { public static final String ORDER = "link.orgaunit_children_order"; public static final String CHILDREN_ORDER = "orgaunit_children_order"; diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitPersonCollection.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitPersonCollection.java index 9071c98ca..3713116c2 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitPersonCollection.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitPersonCollection.java @@ -28,10 +28,8 @@ import java.math.BigDecimal; * @author Jens Pelzetter */ public class GenericOrganizationalUnitPersonCollection extends DomainCollection { - - public static final String ORDER = "link.person_order asc"; - public static final String PERSON_ROLE = "link.role_name"; - public static final String PERSON_ORDER = "link.person_order"; + + public static final String PERSON_ROLE = "link.role_name"; public GenericOrganizationalUnitPersonCollection( DataCollection dataCollection) { @@ -45,17 +43,6 @@ public class GenericOrganizationalUnitPersonCollection extends DomainCollection return (String) m_dataCollection.get(PERSON_ROLE); } - public String getPersonOrder() { - String retVal = ((BigDecimal) m_dataCollection.get(PERSON_ORDER)). - toString(); - - if (retVal == null || retVal.isEmpty()) { - retVal = String.valueOf(this.getPosition()); - } - - return retVal; - } - public GenericPerson getPerson() { return new GenericPerson(m_dataCollection.getDataObject()); }