From 92b42bbe7d856654b8b9b068978c450856c0ea80 Mon Sep 17 00:00:00 2001 From: konermann Date: Tue, 3 Nov 2015 13:22:22 +0000 Subject: [PATCH] CCM NG: Added Content type agenda git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3715 8810af33-2d31-482b-a856-94f89814c4df --- ccm-cms-types-agenda/pom.xml | 326 ++++++++++++++++++ .../librecms/contenttypes/agenda/Agenda.java | 160 +++++++++ .../contenttypes/agenda/AgendaConstants.java | 28 ++ .../contenttypes/agenda/AgendaModule.java | 54 +++ .../contenttypes/agenda/Resources.properties | 12 + .../agenda/Resources_de.properties | 12 + .../services/org.libreccm.modules.CcmModule | 1 + ...g.librecms.ccm-cms-types-agenda.properties | 4 + .../librecms/contenttypes/agenda/AppTest.java | 38 ++ pom.xml | 2 + 10 files changed, 637 insertions(+) create mode 100644 ccm-cms-types-agenda/pom.xml create mode 100644 ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/Agenda.java create mode 100644 ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/AgendaConstants.java create mode 100644 ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/AgendaModule.java create mode 100755 ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/Resources.properties create mode 100755 ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/Resources_de.properties create mode 100644 ccm-cms-types-agenda/src/main/resources/META-INF/services/org.libreccm.modules.CcmModule create mode 100644 ccm-cms-types-agenda/src/main/resources/module-info/org.librecms.ccm-cms-types-agenda.properties create mode 100644 ccm-cms-types-agenda/src/test/java/org/librecms/contenttypes/agenda/AppTest.java diff --git a/ccm-cms-types-agenda/pom.xml b/ccm-cms-types-agenda/pom.xml new file mode 100644 index 000000000..d3aac8967 --- /dev/null +++ b/ccm-cms-types-agenda/pom.xml @@ -0,0 +1,326 @@ + + + + 4.0.0 + + + libreccm-parent + org.libreccm + 7.0.0-SNAPSHOT + + + + UTF-8 + ${maven.build.timestamp} + yyyy-MM-dd'T'HH:mm:ss'Z'Z + + + + org.librecms + ccm-cms-types-agenda + 7.0.0-SNAPSHOT + + ccm-cms-types-agenda + + + + javax + javaee-api + jar + provided + + + + org.libreccm + ccm-core + ${project.parent.version} + provided + + + + org.librecms + ccm-cms + ${project.parent.version} + provided + + + + org.hibernate + hibernate-entitymanager + + + + org.hibernate + hibernate-validator + + + + junit + junit + test + + + + org.hamcrest + hamcrest-core + test + + + org.hamcrest + hamcrest-library + test + + + + org.libreccm + ccm-testutils + ${project.parent.version} + test + + + + nl.jqno.equalsverifier + equalsverifier + test + + + + org.jboss.arquillian.junit + arquillian-junit-container + test + + + org.jboss.arquillian.extension + arquillian-persistence-dbunit + test + + + org.jboss.arquillian.extension + arquillian-transaction-impl-base + test + + + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-impl-maven + test + + + + com.h2database + h2 + test + + + + + + ccm-cms-types-agenda + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.3 + + 1.7 + 1.7 + true + true + ${project.build.sourceEncoding} + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.18.1 + + org.libreccm.tests.categories.UnitTest + + + + + org.jacoco + jacoco-maven-plugin + 0.7.5.201505241946 + + + default-prepare-agent + + prepare-agent + + + + default-report + prepare-package + + report + + + + default-check + + check + + + + + BUNDLE + + + COMPLEXITY + COVEREDRATIO + 0.60 + + + + + + + + + + + de.jpdigital + hibernate4-ddl-maven-plugin + + + h2 + mysql5_innodb + oracle10g + postgresql9 + + + org.libreccm + + true + + + + + gen-ddl + + process-classes + + + + + + + + src/main/resources + true + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.3 + + true + true + + http://docs.oracle.com/javase/7/docs/api/ + http://docs.oracle.com/javaee/7/api/ + http://docs.jboss.org/hibernate/orm/4.3/javadocs/ + + private + true + UTF-8 + UTF-8 + UTF-8 + true + true + true + true + false + org.jboss.apiviz.APIviz + + org.jboss.apiviz + apiviz + 1.3.2.GA + + true + -sourceclasspath ${project.build.outputDirectory} + + + + + org.apache.maven.plugins + maven-jxr-plugin + 2.5 + + + org.apache.maven.plugins + maven-surefire-report-plugin + 2.18.1 + + + org.jacoco + jacoco-maven-plugin + 0.7.5.201505241946 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.1 + + + + org.apache.maven.plugins + maven-pmd-plugin + 3.4 + + true + utf-8 + 1.7 + + /rulesets/java/basic.xml + /rulesets/java/braces.xml + /rulesets/java/clone.xml + /rulesets/java/codesize.xml + /rulesets/java/design.xml + /rulesets/java/empty.xml + /rulesets/java/finalizers.xml + /rulesets/java/imports.xml + /rulesets/java/javabeans.xml + /rulesets/java/junit.xml + /rulesets/java/naming.xml + /rulesets/java/optimizations.xml + /rulesets/java/strictexception.xml + /rulesets/java/strings.xml + /rulesets/java/sunsecure.xml + /rulesets/java/typeresolution.xml + /rulesets/java/unnecessary.xml + /rulesets/java/unusedcode.xml + + + + + org.codehaus.mojo + javancss-maven-plugin + 2.1 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 2.8 + + + + dependencies + license + + + + + false + + + + + diff --git a/ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/Agenda.java b/ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/Agenda.java new file mode 100644 index 000000000..ce2807505 --- /dev/null +++ b/ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/Agenda.java @@ -0,0 +1,160 @@ +/* + * 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 org.librecms.contenttypes.agenda; + +import static org.librecms.contenttypes.agenda.AgendaConstants.*; + +import org.hibernate.envers.Audited; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Column; + +import javax.persistence.Entity; +import javax.persistence.Table; +import javax.persistence.Temporal; +import org.libreccm.l10n.LocalizedString; +import org.librecms.contentsection.ContentItem; + +/** + * This content type represents an agenda data abject. + * + * This class extends ContentItem with additional attributes specific to an + * agenda: + *
+ *
summary
optional, standard text field, short description, used + * as lead text
+ *
agendaDate
mandatory, date/time when it will happen
+ *
location
optional, standard text field, (short) description of + * location, usable in a list
+ *
attendees
optional, standard text field
+ *
subjectItems
optional, standard text field
+ *
contactInfo
optional, standard text field
+ *
creationDate
automatic
+ *
+ * + * @author Alexander Konermann + * @version 24/10/2015 + */ +@Entity +@Audited +@Table(name = "AGENDA", schema = DB_SCHEMA) +public class Agenda extends ContentItem implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * The date and time for the agenda + */ + @Column(name = "AGENDADATE") + @Temporal(javax.persistence.TemporalType.DATE) + private Date agendaDate; + + /** + * The location for the agenda + */ + @Column(name = "LOCATION") + private LocalizedString location; + /** + * The attendees for the agenda + */ + @Column(name = "ATTENDEES") + private LocalizedString attendees; + /** + * The subject items for the agenda + */ + @Column(name = "SUBJECTITEMS") + private LocalizedString subjectItems; + /** + * Contact information for the agenda + */ + @Column(name = "CONTACTINFO") + private LocalizedString contactInfo; + /** + * The summary of the agenda + */ + @Column(name = "SUMMARY") + private LocalizedString summary; + + /** + * The date the agenda was created + */ + @Column(name = "CREATIONDATE") + @Temporal(javax.persistence.TemporalType.DATE) + private Date creationDate; + + + //getter and setter: + + public Date getAgendaDate() { + return agendaDate; + } + + public void setAgendaDate(Date agendaDate) { + this.agendaDate = agendaDate; + } + + public LocalizedString getLocation() { + return location; + } + + public void setLocation(LocalizedString location) { + this.location = location; + } + + public LocalizedString getAttendees() { + return attendees; + } + + public void setAttendees(LocalizedString attendees) { + this.attendees = attendees; + } + + public LocalizedString getSubjectItems() { + return subjectItems; + } + + public void setSubjectItems(LocalizedString subjectItems) { + this.subjectItems = subjectItems; + } + + public LocalizedString getContactInfo() { + return contactInfo; + } + + public void setContactInfo(LocalizedString contactInfo) { + this.contactInfo = contactInfo; + } + + public LocalizedString getSummary() { + return summary; + } + + public void setSummary(LocalizedString summary) { + this.summary = summary; + } + + public Date getCreationDate() { + return creationDate; + } + + public void setCreationDate(Date creationDate) { + this.creationDate = creationDate; + } +} diff --git a/ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/AgendaConstants.java b/ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/AgendaConstants.java new file mode 100644 index 000000000..8c360272b --- /dev/null +++ b/ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/AgendaConstants.java @@ -0,0 +1,28 @@ +package org.librecms.contenttypes.agenda; +/* + * 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 + */ +public class AgendaConstants { + + public static final String DB_SCHEMA = "cms_types_agenda"; + + private AgendaConstants() { + //Nothing + } + +} diff --git a/ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/AgendaModule.java b/ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/AgendaModule.java new file mode 100644 index 000000000..07c9c0a6d --- /dev/null +++ b/ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/AgendaModule.java @@ -0,0 +1,54 @@ +/* + * 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 org.librecms.contenttypes.agenda; + +import org.libreccm.modules.CcmModule; +import org.libreccm.modules.InitEvent; +import org.libreccm.modules.InstallEvent; +import org.libreccm.modules.Module; +import org.libreccm.modules.RequiredModule; +import org.libreccm.modules.ShutdownEvent; +import org.libreccm.modules.UnInstallEvent; + +@Module(packageName="org.librecms.contenttypes.agenda", + requiredModules = {@RequiredModule(module = org.libreccm.core.CcmCore.class)}) +public class AgendaModule implements CcmModule { + + @Override + public void install(final InstallEvent event) { + //ToDo Create initial data for the module if neccessary + } + + @Override + public void init(final InitEvent event) { + //ToDo Add initialisation logic necessary for your module + } + + @Override + public void shutdown(final ShutdownEvent event) { + //ToDo Add shutdown logic if necessary + } + + @Override + public void uninstall(final UnInstallEvent event) { + //ToDo Remove module data + } + + +} diff --git a/ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/Resources.properties b/ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/Resources.properties new file mode 100755 index 000000000..2374210ab --- /dev/null +++ b/ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/Resources.properties @@ -0,0 +1,12 @@ +agenda.authoring.basic_properties.title=Agenda Properties +agenda.authoring.basic_properties.description=Edit the basic address properties +agenda.authoring.categories.title=Assign categories +agenda.authoring.categories.description=Assign categories +cms.contenttypes.ui.agenda.agenda_date=Date: +cms.contenttypes.ui.agenda.location=Location: +cms.contenttypes.ui.agenda.attendees=Attendees: +cms.contenttypes.ui.agenda.subject_items=Subject Items: +cms.contenttypes.ui.agenda.contact_info=Contact Information: +cms.contenttypes.ui.agenda.creation_date=Creation Date: +#Fixed, defined by class ContentType +cms.contenttypes.agenda.type_label=Agenda diff --git a/ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/Resources_de.properties b/ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/Resources_de.properties new file mode 100755 index 000000000..a90cf1945 --- /dev/null +++ b/ccm-cms-types-agenda/src/main/java/org/librecms/contenttypes/agenda/Resources_de.properties @@ -0,0 +1,12 @@ +agenda.authoring.basic_properties.title=Eigenschaften von Agenda +agenda.authoring.basic_properties.description=Editieren der grundlegenden Agenda Eigenschaften +agenda.authoring.categories.title=Kategorien zuweisen +agenda.authoring.categories.description=Zuweisen von Kategorien +cms.contenttypes.ui.agenda.agenda_date=Datum: +cms.contenttypes.ui.agenda.location=Ort: +cms.contenttypes.ui.agenda.attendees=Teilnehmer: +cms.contenttypes.ui.agenda.subject_items=Themen: +cms.contenttypes.ui.agenda.contact_info=Kontakt Information: +cms.contenttypes.ui.agenda.creation_date=Erstellungsdatum: +#Fixed, defined by class ContentType +cms.contenttypes.agenda.type_label=Ablaufplan diff --git a/ccm-cms-types-agenda/src/main/resources/META-INF/services/org.libreccm.modules.CcmModule b/ccm-cms-types-agenda/src/main/resources/META-INF/services/org.libreccm.modules.CcmModule new file mode 100644 index 000000000..68b1b1fd7 --- /dev/null +++ b/ccm-cms-types-agenda/src/main/resources/META-INF/services/org.libreccm.modules.CcmModule @@ -0,0 +1 @@ +org.librecms.contenttypes.agenda.Agenda diff --git a/ccm-cms-types-agenda/src/main/resources/module-info/org.librecms.ccm-cms-types-agenda.properties b/ccm-cms-types-agenda/src/main/resources/module-info/org.librecms.ccm-cms-types-agenda.properties new file mode 100644 index 000000000..b9f3b36c8 --- /dev/null +++ b/ccm-cms-types-agenda/src/main/resources/module-info/org.librecms.ccm-cms-types-agenda.properties @@ -0,0 +1,4 @@ +groupId=${project.groupId} +artifactId=${project.artifactId} +version=${project.version} +build.date=${timestamp} diff --git a/ccm-cms-types-agenda/src/test/java/org/librecms/contenttypes/agenda/AppTest.java b/ccm-cms-types-agenda/src/test/java/org/librecms/contenttypes/agenda/AppTest.java new file mode 100644 index 000000000..25b511a36 --- /dev/null +++ b/ccm-cms-types-agenda/src/test/java/org/librecms/contenttypes/agenda/AppTest.java @@ -0,0 +1,38 @@ +package $org.libreccm.cms; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/pom.xml b/pom.xml index d5de7e756..a6961d4dc 100644 --- a/pom.xml +++ b/pom.xml @@ -48,6 +48,8 @@ ccm-cms ccm-cms-archetype-contenttype ccm-cms-types-article + ccm-cms-types-agenda + ccm-cms-types-decisiontree