- Corrected some typos in the Archetype for content types
- Changed group ids of cms related stuff to org.librecms
- Some more base entities for content items
- Entities and base structure for ccm-cms-types-article


git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3698 8810af33-2d31-482b-a856-94f89814c4df
pull/2/head
jensp 2015-10-19 13:13:45 +00:00
parent b395f787e2
commit 488d0b5b38
16 changed files with 588 additions and 55 deletions

View File

@ -4,17 +4,16 @@
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.libreccm</groupId>
<artifactId>libreccm-parent</artifactId>
<version>7.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.libreccm</groupId>
<artifactId>libreccm-parent</artifactId>
<version>7.0.0-SNAPSHOT</version>
</parent>
<groupId>org.libreccm.cms</groupId>
<artifactId>ccm-cms-archetype-contenttype</artifactId>
<version>7.0.0-SNAPSHOT</version>
<name>LibreCCM CMS Archetype for Contenttypes</name>
<groupId>org.librecms</groupId>
<artifactId>ccm-cms-archetype-contenttype</artifactId>
<name>LibreCCM CMS Archetype for Contenttypes</name>
<url>http://cms.libreccm.org</url>
<url>http://cms.libreccm.org</url>
</project>

View File

@ -32,6 +32,13 @@
<version>${project.parent.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.librecms</groupId>
<artifactId>ccm-cms</artifactId>
<version>${project.parent.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
@ -314,5 +321,4 @@
</plugin>
</plugins>
</reporting>
<
</project>
</project>

View File

@ -1,6 +1,6 @@
package ${package};
public ${typeName}Constants {
public class ${typeName}Constants {
public static final String DB_SCHEMA = "${schemaName}";

View File

@ -13,7 +13,7 @@ import org.libreccm.modules.UnInstallEvent;
@Module(packageName="${package}",
requiredModules = {@RequiredModule(module = org.libreccm.core.CcmCore)})
public class ${moduleClass} implements CcmModule {
public class ${typeName}Module implements CcmModule {
@Override
public void install(final InstallEvent event) {

View File

@ -0,0 +1,325 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>libreccm-parent</artifactId>
<groupId>org.libreccm</groupId>
<version>7.0.0-SNAPSHOT</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'Z</maven.build.timestamp.format>
</properties>
<groupId>org.librecms</groupId>
<artifactId>ccm-cms-types-article</artifactId>
<name>LibreCMS Contenttype Article</name>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.libreccm</groupId>
<artifactId>ccm-core</artifactId>
<version>${project.parent.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.librecms</groupId>
<artifactId>ccm-cms</artifactId>
<version>${project.parent.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.libreccm</groupId>
<artifactId>ccm-testutils</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-persistence-dbunit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-transaction-impl-base</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>ccm-cms-types-article</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<optimize>true</optimize>
<debug>true</debug>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<groups>org.libreccm.tests.categories.UnitTest</groups>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>COMPLEXITY</counter>
<value>COVEREDRATIO</value>
<minimum>0.60</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>de.jpdigital</groupId>
<artifactId>hibernate4-ddl-maven-plugin</artifactId>
<configuration>
<dialects>
<param>h2</param>
<param>mysql5_innodb</param>
<param>oracle10g</param>
<param>postgresql9</param>
</dialects>
<packages>
<param>org.libreccm</param>
</packages>
<useEnvers>true</useEnvers>
</configuration>
<executions>
<execution>
<goals>
<goal>gen-ddl</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<configuration>
<detectLinks>true</detectLinks>
<detectJavaApiLinks>true</detectJavaApiLinks>
<links>
<link>http://docs.oracle.com/javase/7/docs/api/</link>
<link>http://docs.oracle.com/javaee/7/api/</link>
<link>http://docs.jboss.org/hibernate/orm/4.3/javadocs/</link>
</links>
<show>private</show>
<docfilessubdirs>true</docfilessubdirs>
<charset>UTF-8</charset>
<encoding>UTF-8</encoding>
<docencoding>UTF-8</docencoding>
<breakiterator>true</breakiterator>
<version>true</version>
<author>true</author>
<keywords>true</keywords>
<failOnError>false</failOnError>
<doclet>org.jboss.apiviz.APIviz</doclet>
<docletArtifact>
<groupId>org.jboss.apiviz</groupId>
<artifactId>apiviz</artifactId>
<version>1.3.2.GA</version>
</docletArtifact>
<useStandardDocletOptions>true</useStandardDocletOptions>
<additionalparam>-sourceclasspath ${project.build.outputDirectory}</additionalparam>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.18.1</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.4</version>
<configuration>
<linkXref>true</linkXref>
<sourceEncoding>utf-8</sourceEncoding>
<targetJdk>1.7</targetJdk>
<rulesets>
<ruleset>/rulesets/java/basic.xml</ruleset>
<ruleset>/rulesets/java/braces.xml</ruleset>
<ruleset>/rulesets/java/clone.xml</ruleset>
<ruleset>/rulesets/java/codesize.xml</ruleset>
<ruleset>/rulesets/java/design.xml</ruleset>
<ruleset>/rulesets/java/empty.xml</ruleset>
<ruleset>/rulesets/java/finalizers.xml</ruleset>
<ruleset>/rulesets/java/imports.xml</ruleset>
<ruleset>/rulesets/java/javabeans.xml</ruleset>
<ruleset>/rulesets/java/junit.xml</ruleset>
<ruleset>/rulesets/java/naming.xml</ruleset>
<ruleset>/rulesets/java/optimizations.xml</ruleset>
<ruleset>/rulesets/java/strictexception.xml</ruleset>
<ruleset>/rulesets/java/strings.xml</ruleset>
<ruleset>/rulesets/java/sunsecure.xml</ruleset>
<ruleset>/rulesets/java/typeresolution.xml</ruleset>
<ruleset>/rulesets/java/unnecessary.xml</ruleset>
<ruleset>/rulesets/java/unusedcode.xml</ruleset>
</rulesets>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>javancss-maven-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.8</version>
<reportSets>
<reportSet>
<reports>
<report>dependencies</report>
<report>license</report>
</reports>
</reportSet>
</reportSets>
<configuration>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
</configuration>
</plugin>
</plugins>
</reporting>
</project>

View File

@ -0,0 +1,46 @@
/*
* 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.article;
import static org.librecms.article.ArticleConstants.*;
import org.hibernate.envers.Audited;
import org.libreccm.cms.contentsection.ContentItem;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.libreccm.cms.contenttypes.GenericArticle;
/**
* This type simply exposes the {@link GenericArticle} type from the
* @code{ccm-cms} module.
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@Entity
@Audited
@Table(name = "${type_name}", schema = DB_SCHEMA)
public class Article extends ContentItem implements Serializable {
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,29 @@
/*
* 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.article;
public final class ArticleConstants {
public static final String DB_SCHEMA = "cms_article";
private ArticleConstants() {
//Nothing
}
}

View File

@ -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.article;
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.article",
requiredModules = {@RequiredModule(module = org.libreccm.core.CcmCore.class)})
public class ArticleModule 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
}
}

View File

@ -0,0 +1 @@
org.librecms.article.Article

View File

@ -0,0 +1,4 @@
groupId=${project.groupId}
artifactId=${project.artifactId}
version=${project.version}
build.date=${timestamp}

View File

@ -0,0 +1,38 @@
package org.librecms.article;
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 );
}
}

View File

@ -15,11 +15,10 @@
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'Z</maven.build.timestamp.format>
</properties>
<groupId>org.libreccm</groupId>
<groupId>org.librecms</groupId>
<artifactId>ccm-cms</artifactId>
<version>7.0.0-SNAPSHOT</version>
<name>LibreCCM CMS</name>
<name>LibreCMS</name>
<dependencies>
<dependency>

View File

@ -43,6 +43,7 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
* Base type for all content item types. Specifies some common properties.
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -53,45 +54,70 @@ public class ContentItem extends CcmObject implements Serializable {
private static final long serialVersionUID = 5897287630227129653L;
/**
* The name of the content item which is used to generate the URL of the
* content item. We are using a {@link LocalizedString} here to make it
* possible to generate localised URLs. Therefore only characters allowed in
* URLs should be used here.
*/
@Embedded
@AssociationOverride(
name = "VALUES",
joinTable = @JoinTable(name = "CONTENT_ITEM_NAMES",
schema = DB_SCHEMA,
joinColumns = {
@JoinColumn(name = "OBJECT_ID")}
))
name = "VALUES",
joinTable = @JoinTable(name = "CONTENT_ITEM_NAMES",
schema = DB_SCHEMA,
joinColumns = {
@JoinColumn(name = "OBJECT_ID")}
))
private LocalizedString name;
/**
* The content type associated with the content item.
*/
@OneToOne
private ContentType contentType;
/**
* The human readable title of the content item.
*/
@Embedded
@AssociationOverride(
name = "VALUES",
joinTable = @JoinTable(name = "CONTENT_ITEM_TITLES",
schema = DB_SCHEMA,
joinColumns = {
@JoinColumn(name = "OBJECT_ID")}
))
name = "VALUES",
joinTable = @JoinTable(name = "CONTENT_ITEM_TITLES",
schema = DB_SCHEMA,
joinColumns = {
@JoinColumn(name = "OBJECT_ID")}
))
private LocalizedString title;
/**
* A short text which describes the content of the content item.
*/
@Embedded
@AssociationOverride(
name = "VALUES",
joinTable = @JoinTable(name = "CONTENT_ITEM_DESCRIPTIONS",
schema = DB_SCHEMA,
joinColumns = {
@JoinColumn(name = "OBJECT_ID")}
))
name = "VALUES",
joinTable = @JoinTable(name = "CONTENT_ITEM_DESCRIPTIONS",
schema = DB_SCHEMA,
joinColumns = {
@JoinColumn(name = "OBJECT_ID")}
))
private LocalizedString description;
/**
* The version/publishing state of the content item.
*/
@Enumerated(EnumType.STRING)
private ContentItemVersion version;
/**
* The launch date of the content item (date when the item is made public)
*/
@Temporal(TemporalType.DATE)
private Date launchDate;
/**
* String with the IDs (separated by slashes) of the ancestors of the
* content item (aka the path of the content item).
*/
@Column(name = "ancestors", length = 1024)
private String ancestors;
@ -211,10 +237,10 @@ public class ContentItem extends CcmObject implements Serializable {
@Override
public String toString(final String data) {
return String.format(", name = {}, "
+ "contentType = {}, "
+ "title = {}, "
+ "version = %s,"
+ "launchDate = %s%s",
+ "contentType = {}, "
+ "title = {}, "
+ "version = %s,"
+ "launchDate = %s%s",
Objects.toString(name),
Objects.toString(contentType),
Objects.toString(description),

View File

@ -34,7 +34,10 @@ import org.libreccm.cms.contentsection.ContentItem;
import org.libreccm.l10n.LocalizedString;
/**
*
* Base class for article like content items. These items usually contain a
* short introduction text (the description) and a longer text containing
* the more detailed content.
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@Entity

View File

@ -64,20 +64,22 @@ class UserAdministrationTab extends LayoutPanel {
setLeft(sections);
final UserBrowsePane browsePane = new UserBrowsePane();
// final UserSummarySection summarySection = new UserSummarySection(this, browsePane);
// final UserSearchSection searchSection = new UserSearchSection(this, browsePane);
// final UserCreateSection createSection = new UserCreateSection(this);
//
// browsePane.setTabbedPane(parent);
// browsePane.setGroupAdministrationTab(groupAdminTab);
//
// final BoxPanel body = new BoxPanel();
// addSection(USER_TAB_SUMMARY, summarySection, body);
// addSection(USER_TAB_BROWSE, browsePane, body);
// addSection(USER_TAB_SEARCH, searchSection, body);
// addSection(USER_TAB_CREATE_USER, createSection, body);
//
// setBody(body);
final UserSummarySection summarySection = new UserSummarySection(
this, browsePane);
final UserSearchSection searchSection = new UserSearchSection(
this, browsePane);
final UserCreateSection createSection = new UserCreateSection(this);
browsePane.setTabbedPane(parent);
browsePane.setGroupAdministrationTab(groupAdminTab);
final BoxPanel body = new BoxPanel();
addSection(USER_TAB_SUMMARY, summarySection, body);
addSection(USER_TAB_BROWSE, browsePane, body);
addSection(USER_TAB_SEARCH, searchSection, body);
addSection(USER_TAB_CREATE_USER, createSection, body);
setBody(body);
}
/**

View File

@ -47,6 +47,7 @@
<module>ccm-archetype-module</module>
<module>ccm-cms</module>
<module>ccm-cms-archetype-contenttype</module>
<module>ccm-cms-types-article</module>
</modules>
<!--<repositories>