From afc7c924da4906fe5f616c2bb348cebb80782477 Mon Sep 17 00:00:00 2001 From: tosmers Date: Wed, 4 Apr 2018 16:11:27 +0000 Subject: [PATCH] [TRUNK][FEATURE] - adds ng representation for contenttypes article, event, multipartarticle + section and news - adds missing java doc for construtors to classes in portation/modules/... git-svn-id: https://svn.libreccm.org/ccm/trunk@5363 8810af33-2d31-482b-a856-94f89814c4df --- .../portation/conversion/NgCmsCollection.java | 37 +++++ .../modules/contenttypes/Article.java | 57 +++++++ .../portation/conversion/NgCmsCollection.java | 37 +++++ .../portation/modules/contenttypes/Event.java | 150 ++++++++++++++++++ .../portation/conversion/NgCmsCollection.java | 42 +++++ .../contenttypes/MultiPartArticle.java | 73 +++++++++ .../contenttypes/MultiPartArticleSection.java | 97 +++++++++++ .../portation/conversion/NgCmsCollection.java | 37 +++++ .../portation/modules/contenttypes/News.java | 80 ++++++++++ .../modules/contentsection/Asset.java | 2 +- .../modules/contentsection/ContentItem.java | 2 +- .../contentsection/ContentSection.java | 7 +- .../modules/contentsection/ContentType.java | 8 +- .../modules/contentsection/Folder.java | 6 + .../modules/lifecycle/Lifecycle.java | 5 + .../lifecycle/LifecycleDefinition.java | 5 + .../portation/modules/lifecycle/Phase.java | 5 + .../modules/lifecycle/PhaseDefinition.java | 5 + .../modules/core/categorization/Domain.java | 2 +- 19 files changed, 652 insertions(+), 5 deletions(-) create mode 100644 ccm-cms-types-article/src/com/arsdigita/cms/portation/conversion/NgCmsCollection.java create mode 100644 ccm-cms-types-article/src/com/arsdigita/cms/portation/modules/contenttypes/Article.java create mode 100644 ccm-cms-types-event/src/com/arsdigita/cms/portation/conversion/NgCmsCollection.java create mode 100644 ccm-cms-types-event/src/com/arsdigita/cms/portation/modules/contenttypes/Event.java create mode 100644 ccm-cms-types-mparticle/src/com/arsdigita/cms/portation/conversion/NgCmsCollection.java create mode 100644 ccm-cms-types-mparticle/src/com/arsdigita/cms/portation/modules/contenttypes/MultiPartArticle.java create mode 100644 ccm-cms-types-mparticle/src/com/arsdigita/cms/portation/modules/contenttypes/MultiPartArticleSection.java create mode 100644 ccm-cms-types-newsitem/src/com/arsdigita/cms/portation/conversion/NgCmsCollection.java create mode 100644 ccm-cms-types-newsitem/src/com/arsdigita/cms/portation/modules/contenttypes/News.java diff --git a/ccm-cms-types-article/src/com/arsdigita/cms/portation/conversion/NgCmsCollection.java b/ccm-cms-types-article/src/com/arsdigita/cms/portation/conversion/NgCmsCollection.java new file mode 100644 index 000000000..9a766344c --- /dev/null +++ b/ccm-cms-types-article/src/com/arsdigita/cms/portation/conversion/NgCmsCollection.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2015 LibreCCM Foundation. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package com.arsdigita.cms.portation.conversion; + +import com.arsdigita.cms.portation.modules.contenttypes.Article; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author Tobias Osmers<\a> + * @version created the 4/3/18 + */ +public class Article extends ContentItem implements Portable { + private LocalizedString text; + + /** + * Constructor for the ng-object. + * + * @param trunkArticle the trunk object + */ + public Article(final com.arsdigita.cms.contenttypes.Article trunkArticle) { + super(trunkArticle); + + this.text = new LocalizedString(); + final Locale locale = Locale.getDefault(); + this.text.addValue(locale, trunkArticle.getTextAsset().getText()); + + NgCmsCollection.articles.put(this.getObjectId(), this); + } + + public LocalizedString getText() { + return text; + } + + public void setText(final LocalizedString text) { + this.text = text; + } +} diff --git a/ccm-cms-types-event/src/com/arsdigita/cms/portation/conversion/NgCmsCollection.java b/ccm-cms-types-event/src/com/arsdigita/cms/portation/conversion/NgCmsCollection.java new file mode 100644 index 000000000..529dbe566 --- /dev/null +++ b/ccm-cms-types-event/src/com/arsdigita/cms/portation/conversion/NgCmsCollection.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2015 LibreCCM Foundation. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package com.arsdigita.cms.portation.conversion; + +import com.arsdigita.cms.portation.modules.contenttypes.Event; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author Tobias Osmers<\a> + * @version created the 4/3/18 + */ +public class Event extends ContentItem implements Portable { + private LocalizedString text; + private Date startDate; + private Date endDate; + private LocalizedString eventDate; + private LocalizedString location; + private LocalizedString mainContributor; + private LocalizedString eventType; + private String mapLink; + private LocalizedString cost; + + /** + * Constructor for the ng-object. + * + * @param trunkEvent the trunk object + */ + public Event(final com.arsdigita.cms.contenttypes.Event trunkEvent) { + super(trunkEvent); + + final Locale locale = Locale.getDefault(); + this.text = new LocalizedString(); + this.text.addValue(locale, trunkEvent.getTextAsset().getText()); + + this.startDate = trunkEvent.getStartDate(); + this.endDate = trunkEvent.getEndDate(); + + this.eventDate = new LocalizedString(); + this.eventDate.addValue(locale, trunkEvent.getEventDate()); + + this.location = new LocalizedString(); + this.location.addValue(locale, trunkEvent.getLocation()); + + this.mainContributor = new LocalizedString(); + this.mainContributor.addValue(locale, trunkEvent.getMainContributor()); + + this.eventType = new LocalizedString(); + this.eventType.addValue(locale, trunkEvent.getEventType()); + + this.mapLink = trunkEvent.getMapLink(); + + this.cost = new LocalizedString(); + this.cost.addValue(locale, trunkEvent.getCost()); + + NgCmsCollection.events.put(this.getObjectId(), this); + } + + public LocalizedString getText() { + return text; + } + + public void setText(final LocalizedString text) { + this.text = text; + } + + public Date getStartDate() { + return startDate; + } + + public void setStartDate(final Date startDate) { + this.startDate = startDate; + } + + public Date getEndDate() { + return endDate; + } + + public void setEndDate(final Date endDate) { + this.endDate = endDate; + } + + public LocalizedString getEventDate() { + return eventDate; + } + + public void setEventDate(final LocalizedString eventDate) { + this.eventDate = eventDate; + } + + public LocalizedString getLocation() { + return location; + } + + public void setLocation(final LocalizedString location) { + this.location = location; + } + + public LocalizedString getMainContributor() { + return mainContributor; + } + + public void setMainContributor(final LocalizedString mainContributor) { + this.mainContributor = mainContributor; + } + + public LocalizedString getEventType() { + return eventType; + } + + public void setEventType(final LocalizedString eventType) { + this.eventType = eventType; + } + + public String getMapLink() { + return mapLink; + } + + public void setMapLink(final String mapLink) { + this.mapLink = mapLink; + } + + public LocalizedString getCost() { + return cost; + } + + public void setCost(final LocalizedString cost) { + this.cost = cost; + } +} diff --git a/ccm-cms-types-mparticle/src/com/arsdigita/cms/portation/conversion/NgCmsCollection.java b/ccm-cms-types-mparticle/src/com/arsdigita/cms/portation/conversion/NgCmsCollection.java new file mode 100644 index 000000000..b92d40866 --- /dev/null +++ b/ccm-cms-types-mparticle/src/com/arsdigita/cms/portation/conversion/NgCmsCollection.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2015 LibreCCM Foundation. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package com.arsdigita.cms.portation.conversion; + +import com.arsdigita.bebop.FormData; +import com.arsdigita.cms.portation.modules.contenttypes.MultiPartArticle; +import com.arsdigita.cms.portation.modules.contenttypes.MultiPartArticleSection; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author Tobias Osmers<\a> + * @version created the 4/3/18 + */ +public class MultiPartArticle extends ContentItem implements Portable { + private LocalizedString summary; + @JsonIdentityReference(alwaysAsId = true) + private List sections; + + /** + * Constructor for the ng-object. + * + * @param trunkMultiPartArticle the trunk object + */ + public MultiPartArticle(final com.arsdigita.cms.contenttypes + .MultiPartArticle trunkMultiPartArticle) { + super(trunkMultiPartArticle); + + final Locale locale = Locale.getDefault(); + this.summary = new LocalizedString(); + this.summary.addValue(locale, trunkMultiPartArticle.getSummary()); + + this.sections = new ArrayList<>(); + + NgCmsCollection.multiPartArticles.put(this.getObjectId(), this); + } + + public LocalizedString getSummary() { + return summary; + } + + public void setSummary(final LocalizedString summary) { + this.summary = summary; + } + + public List getSections() { + return sections; + } + + public void setSections(final List sections) { + this.sections = sections; + } +} diff --git a/ccm-cms-types-mparticle/src/com/arsdigita/cms/portation/modules/contenttypes/MultiPartArticleSection.java b/ccm-cms-types-mparticle/src/com/arsdigita/cms/portation/modules/contenttypes/MultiPartArticleSection.java new file mode 100644 index 000000000..83ab4d723 --- /dev/null +++ b/ccm-cms-types-mparticle/src/com/arsdigita/cms/portation/modules/contenttypes/MultiPartArticleSection.java @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2015 LibreCCM Foundation. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package com.arsdigita.cms.portation.modules.contenttypes; + +import com.arsdigita.cms.contenttypes.ArticleSection; +import com.arsdigita.cms.portation.conversion.NgCmsCollection; +import com.arsdigita.portation.Portable; +import com.arsdigita.portation.modules.core.l10n.LocalizedString; + +import java.util.Locale; + +/** + * @author Tobias Osmers<\a> + * @version created the 4/3/18 + */ +public class NgCmsCollection { + public static Map news = new HashMap<>(); + + /** + * Private constructor to prevent the instantiation of this class. + */ + private NgCmsCollection() {} +} diff --git a/ccm-cms-types-newsitem/src/com/arsdigita/cms/portation/modules/contenttypes/News.java b/ccm-cms-types-newsitem/src/com/arsdigita/cms/portation/modules/contenttypes/News.java new file mode 100644 index 000000000..039a82be5 --- /dev/null +++ b/ccm-cms-types-newsitem/src/com/arsdigita/cms/portation/modules/contenttypes/News.java @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2015 LibreCCM Foundation. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package com.arsdigita.cms.portation.modules.contenttypes; + +import com.arsdigita.cms.portation.conversion.NgCmsCollection; +import com.arsdigita.cms.portation.modules.contentsection.ContentItem; +import com.arsdigita.portation.Portable; +import com.arsdigita.portation.modules.core.l10n.LocalizedString; + +import java.util.Date; +import java.util.Locale; + +/** + * @author Tobias Osmers<\a> * @version created the 2/21/18 */ -public class Asset extends CcmObject implements Portable { +public class Asset extends CcmObject { @JsonIgnore private List> itemAttachments; private LocalizedString title; diff --git a/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentItem.java b/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentItem.java index 803f775ab..094131108 100644 --- a/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentItem.java +++ b/ccm-cms/src/com/arsdigita/cms/portation/modules/contentsection/ContentItem.java @@ -38,7 +38,7 @@ import java.util.UUID; * @author