commit
0a3f85d58e
|
|
@ -0,0 +1,314 @@
|
|||
|
||||
<?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-profile</artifactId>
|
||||
<version>7.0.0-SNAPSHOT</version>
|
||||
|
||||
<name>LibreCMS Profile site</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-core</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-envers</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-search-orm</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-validator-cdi</artifactId>
|
||||
<scope>provided</scope>
|
||||
</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.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-profile</finalName>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</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>
|
||||
<configuration>
|
||||
<groups>org.libreccm.tests.categories.UnitTest</groups>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<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>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>de.jpdigital</groupId>
|
||||
<artifactId>hibernate53-ddl-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<dialects>
|
||||
<param>h2</param>
|
||||
<param>oracle12c</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>
|
||||
<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>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-report-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-pmd-plugin</artifactId>
|
||||
<configuration>
|
||||
<linkXref>true</linkXref>
|
||||
<sourceEncoding>utf-8</sourceEncoding>
|
||||
<targetJdk>1.8</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/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.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<reportSets>
|
||||
<reportSet>
|
||||
<reports>
|
||||
<report>dependencies</report>
|
||||
<report>licenses</report>
|
||||
</reports>
|
||||
</reportSet>
|
||||
</reportSets>
|
||||
<configuration>
|
||||
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
||||
</project>
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.librecms.profilesite;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public class ProfileSiteConstants {
|
||||
|
||||
public static final String DB_SCHEMA = "cms_profile";
|
||||
|
||||
private ProfileSiteConstants() {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,157 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.librecms.profilesite;
|
||||
|
||||
import org.hibernate.annotations.Type;
|
||||
import org.librecms.assets.Person;
|
||||
import org.librecms.contentsection.ContentItem;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import static org.librecms.profilesite.ProfileSiteConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "PROFILE_SITES", schema = DB_SCHEMA)
|
||||
public class ProfileSiteItem extends ContentItem {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@OneToOne
|
||||
@JoinColumn(name = "OWNER_ID")
|
||||
private Person owner;
|
||||
|
||||
@Column(name = "POSITION")
|
||||
@Basic
|
||||
@Lob
|
||||
@Type(type = "org.hibernate.type.TextType")
|
||||
private String position;
|
||||
|
||||
@Column(name = "INTERESTS")
|
||||
@Basic
|
||||
@Lob
|
||||
@Type(type = "org.hibernate.type.TextType")
|
||||
private String interests;
|
||||
|
||||
@Column(name = "MISC")
|
||||
@Basic
|
||||
@Lob
|
||||
@Type(type = "org.hibernate.type.TextType")
|
||||
private String misc;
|
||||
|
||||
public Person getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(final Person owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public String getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(final String position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public String getInterests() {
|
||||
return interests;
|
||||
}
|
||||
|
||||
public void setInterests(final String interests) {
|
||||
this.interests = interests;
|
||||
}
|
||||
|
||||
public String getMisc() {
|
||||
return misc;
|
||||
}
|
||||
|
||||
public void setMisc(final String misc) {
|
||||
this.misc = misc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = super.hashCode();
|
||||
if (owner != null) {
|
||||
hash = 37 * hash + Objects.hashCode(owner.getUuid());
|
||||
}
|
||||
hash = 37 * hash + Objects.hashCode(position);
|
||||
hash = 37 * hash + Objects.hashCode(interests);
|
||||
hash = 37 * hash + Objects.hashCode(misc);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (!(obj instanceof ProfileSiteItem)) {
|
||||
return false;
|
||||
}
|
||||
final ProfileSiteItem other = (ProfileSiteItem) obj;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
if (owner != null
|
||||
&& other.getOwner() != null
|
||||
&& !Objects.equals(
|
||||
owner.getUuid(), other.getOwner().getUuid()
|
||||
)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(position, other.getPosition())) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(interests, other.getInterests())) {
|
||||
return false;
|
||||
}
|
||||
return Objects.equals(misc, other.getMisc());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEqual(final Object obj) {
|
||||
return obj instanceof ProfileSiteItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(final String data) {
|
||||
return super.toString(
|
||||
String.format(
|
||||
", owner = %s, "
|
||||
+ "position = \"%s\", "
|
||||
+ "interests = \"%s\", "
|
||||
+ "misc = \"%s\"%s",
|
||||
Objects.toString(owner),
|
||||
position,
|
||||
interests,
|
||||
misc,
|
||||
data
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -66,8 +66,8 @@ import static org.librecms.CmsConstants.*;
|
|||
descriptionBundle = CmsConstants.CMS_BUNDLE,
|
||||
descriptionKey = "cms.contenttypes.shared.basic_properties"
|
||||
+ ".description",
|
||||
order = 1)
|
||||
,
|
||||
order = 1
|
||||
),
|
||||
@AuthoringStep(
|
||||
component = EventTextBody.class,
|
||||
labelBundle = CmsConstants.CMS_BUNDLE,
|
||||
|
|
@ -177,7 +177,7 @@ public class Event extends ContentItem implements Serializable {
|
|||
eventType = new LocalizedString();
|
||||
cost = new LocalizedString();
|
||||
}
|
||||
|
||||
|
||||
public LocalizedString getText() {
|
||||
return text;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,12 +41,11 @@ public class ArticleRenderer extends AbstractContentItemRenderer {
|
|||
|
||||
@Inject
|
||||
private AssetRenderers assetRenderers;
|
||||
|
||||
|
||||
// @Inject
|
||||
// public ArticleRenderer(final AssetRenderers assetRenderers) {
|
||||
// super(assetRenderers);
|
||||
// }
|
||||
|
||||
/**
|
||||
* Render the provided {@link Article}. The following values are put into
|
||||
* the map:
|
||||
|
|
@ -62,10 +61,11 @@ public class ArticleRenderer extends AbstractContentItemRenderer {
|
|||
* @param result The map into which the result is placed.
|
||||
*/
|
||||
@Override
|
||||
protected void renderItem(final ContentItem item,
|
||||
final Locale language,
|
||||
final Map<String, Object> result) {
|
||||
|
||||
protected void renderItem(
|
||||
final ContentItem item,
|
||||
final Locale language,
|
||||
final Map<String, Object> result
|
||||
) {
|
||||
final Article article;
|
||||
if (item instanceof Article) {
|
||||
article = (Article) item;
|
||||
|
|
@ -75,7 +75,7 @@ public class ArticleRenderer extends AbstractContentItemRenderer {
|
|||
|
||||
result.put("text", article.getText().getValue(language));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AssetRenderers getAssetRenderers() {
|
||||
return assetRenderers;
|
||||
|
|
|
|||
Loading…
Reference in New Issue