CCM NG: Current status
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3464 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
4deb944d04
commit
61e6971152
284
ccm-core/pom.xml
284
ccm-core/pom.xml
|
|
@ -70,6 +70,34 @@
|
||||||
<artifactId>equalsverifier</artifactId>
|
<artifactId>equalsverifier</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</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>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
@ -111,7 +139,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.jacoco</groupId>
|
<groupId>org.jacoco</groupId>
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
<version>0.7.4.201502262128</version>
|
<version>0.7.5.201505241946</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>default-prepare-agent</id>
|
<id>default-prepare-agent</id>
|
||||||
|
|
@ -180,7 +208,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>2.10.2</version>
|
<version>2.10.3</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<detectLinks>true</detectLinks>
|
<detectLinks>true</detectLinks>
|
||||||
<detectJavaApiLinks>true</detectJavaApiLinks>
|
<detectJavaApiLinks>true</detectJavaApiLinks>
|
||||||
|
|
@ -225,7 +253,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.jacoco</groupId>
|
<groupId>org.jacoco</groupId>
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
<version>0.7.4.201502262128</version>
|
<version>0.7.5.201505241946</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
|
@ -288,4 +316,254 @@
|
||||||
</plugins>
|
</plugins>
|
||||||
</reporting>
|
</reporting>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>tomee-embedded</id>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.openejb</groupId>
|
||||||
|
<artifactId>arquillian-tomee-embedded</artifactId>
|
||||||
|
<version>1.7.2</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.openejb</groupId>
|
||||||
|
<artifactId>tomee-embedded</artifactId>
|
||||||
|
<version>1.7.2</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.bval</groupId>
|
||||||
|
<artifactId>bval-core</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.bval</groupId>
|
||||||
|
<artifactId>bval-jsr303</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.openjpa</groupId>
|
||||||
|
<artifactId>openjpa-persistence</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.openjpa</groupId>
|
||||||
|
<artifactId>openjpa-kernel</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.openjpa</groupId>
|
||||||
|
<artifactId>openjpa-lib</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.openjpa</groupId>
|
||||||
|
<artifactId>openjpa-parent</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jboss.logmanager</groupId>
|
||||||
|
<artifactId>jboss-logmanager</artifactId>
|
||||||
|
<version>1.5.4.Final</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<!--Required for WebServices and RESTful WebServices-->
|
||||||
|
<!--<dependency>
|
||||||
|
<groupId>org.apache.openejb</groupId>
|
||||||
|
<artifactId>tomee-webservices</artifactId>
|
||||||
|
<version>1.7.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.openejb</groupId>
|
||||||
|
<artifactId>tomee-jaxrs</artifactId>
|
||||||
|
<version>1.7.1</version>
|
||||||
|
</dependency>-->
|
||||||
|
<!--<dependency>
|
||||||
|
<groupId>com.h2database</groupId>
|
||||||
|
<artifactId>h2</artifactId>
|
||||||
|
<version>1.4.187</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>-->
|
||||||
|
<!--<dependency>
|
||||||
|
<groupId>org.jacoco</groupId>
|
||||||
|
<artifactId>org.jacoco.core</artifactId>
|
||||||
|
<version>0.7.4.201502262128</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>-->
|
||||||
|
<!--<dependency>
|
||||||
|
<groupId>org.jboss.arquillian.extension</groupId>
|
||||||
|
<artifactId>arquillian-jacoco</artifactId>
|
||||||
|
<version>1.0.0.Alpha7</version>
|
||||||
|
</dependency>-->
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<testResources>
|
||||||
|
<testResource>
|
||||||
|
<directory>src/test/resources</directory>
|
||||||
|
</testResource>
|
||||||
|
<testResource>
|
||||||
|
<directory>src/test/resources-tomee-embedded</directory>
|
||||||
|
</testResource>
|
||||||
|
</testResources>
|
||||||
|
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>de.jpdigital</groupId>
|
||||||
|
<artifactId>hibernate4-ddl-maven-plugin</artifactId>
|
||||||
|
<version>1.0.0-alpha.1</version>
|
||||||
|
<configuration>
|
||||||
|
<dialects>
|
||||||
|
<param>h2</param>
|
||||||
|
<param>mysql5_innodb</param>
|
||||||
|
<param>postgresql9</param>
|
||||||
|
</dialects>
|
||||||
|
<packages>
|
||||||
|
<param>de.jpdigital.research.accessibilitystudy</param>
|
||||||
|
</packages>
|
||||||
|
<useEnvers>true</useEnvers>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>gen-ddl</goal>
|
||||||
|
</goals>
|
||||||
|
<phase>process-classes</phase>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.18.1</version>
|
||||||
|
<configuration>
|
||||||
|
<forkMode>always</forkMode>
|
||||||
|
<forkCount>999</forkCount>
|
||||||
|
<reuseForks>true</reuseForks>
|
||||||
|
<systemPropertyVariables>
|
||||||
|
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
||||||
|
<jboss.home>${project.basedir}/target/wildfly-8.2.0.Final</jboss.home>
|
||||||
|
<module.path>${project.basedir}/target/wildfly-8.2.0.Final/modules</module.path>
|
||||||
|
</systemPropertyVariables>
|
||||||
|
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
||||||
|
<groups>
|
||||||
|
org.libreccm.tests.categories.UnitTests,
|
||||||
|
org.libreccm.tests.categories.IntegrationTest
|
||||||
|
</groups>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<profile>
|
||||||
|
<id>wildfly8-embedded</id>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.wildfly</groupId>
|
||||||
|
<artifactId>wildfly-arquillian-container-embedded</artifactId>
|
||||||
|
<version>8.2.0.Final</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.wildfly</groupId>
|
||||||
|
<artifactId>wildfly-embedded</artifactId>
|
||||||
|
<version>8.2.0.Final</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jacoco</groupId>
|
||||||
|
<artifactId>org.jacoco.core</artifactId>
|
||||||
|
<version>0.7.5.201505241946</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<!--<dependency>
|
||||||
|
<groupId>org.jboss.arquillian.extension</groupId>
|
||||||
|
<artifactId>arquillian-jacoco</artifactId>
|
||||||
|
<version>1.0.0.Alpha8</version>
|
||||||
|
</dependency>-->
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<testResources>
|
||||||
|
<testResource>
|
||||||
|
<directory>src/test/resources</directory>
|
||||||
|
</testResource>
|
||||||
|
<testResource>
|
||||||
|
<directory>src/test/resources-wildfly8-embedded</directory>
|
||||||
|
</testResource>
|
||||||
|
</testResources>
|
||||||
|
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>de.jpdigital</groupId>
|
||||||
|
<artifactId>hibernate4-ddl-maven-plugin</artifactId>
|
||||||
|
<version>1.0.0-alpha.1</version>
|
||||||
|
<configuration>
|
||||||
|
<dialects>
|
||||||
|
<param>h2</param>
|
||||||
|
<param>mysql5_innodb</param>
|
||||||
|
<param>postgresql9</param>
|
||||||
|
</dialects>
|
||||||
|
<packages>
|
||||||
|
<param>de.jpdigital.research.accessibilitystudy</param>
|
||||||
|
</packages>
|
||||||
|
<useEnvers>true</useEnvers>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>gen-ddl</goal>
|
||||||
|
</goals>
|
||||||
|
<phase>process-classes</phase>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<version>2.10</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>unpack</id>
|
||||||
|
<phase>process-test-classes</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>unpack</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<artifactItems>
|
||||||
|
<artifactItem>
|
||||||
|
<groupId>org.wildfly</groupId>
|
||||||
|
<artifactId>wildfly-dist</artifactId>
|
||||||
|
<version>8.2.0.Final</version>
|
||||||
|
<type>zip</type>
|
||||||
|
<overWrite>false</overWrite>
|
||||||
|
<outputDirectory>target</outputDirectory>
|
||||||
|
</artifactItem>
|
||||||
|
</artifactItems>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.18.1</version>
|
||||||
|
<configuration>
|
||||||
|
<forkMode>always</forkMode>
|
||||||
|
<forkCount>999</forkCount>
|
||||||
|
<reuseForks>true</reuseForks>
|
||||||
|
<systemPropertyVariables>
|
||||||
|
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
||||||
|
<jboss.home>${project.basedir}/target/wildfly-8.2.0.Final</jboss.home>
|
||||||
|
<module.path>${project.basedir}/target/wildfly-8.2.0.Final/modules</module.path>
|
||||||
|
</systemPropertyVariables>
|
||||||
|
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
||||||
|
<groups>
|
||||||
|
org.libreccm.tests.categories.UnitTest,
|
||||||
|
org.libreccm.tests.categories.IntegrationTest
|
||||||
|
</groups>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
@ -21,7 +21,7 @@ package org.libreccm.categorization;
|
||||||
import org.hibernate.validator.constraints.NotBlank;
|
import org.hibernate.validator.constraints.NotBlank;
|
||||||
import org.hibernate.validator.constraints.URL;
|
import org.hibernate.validator.constraints.URL;
|
||||||
import org.libreccm.core.CcmObject;
|
import org.libreccm.core.CcmObject;
|
||||||
import org.libreccm.jpautils.UriConverter;
|
import org.libreccm.jpa.utils.UriConverter;
|
||||||
import org.libreccm.l10n.LocalizedString;
|
import org.libreccm.l10n.LocalizedString;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
@ -45,6 +45,7 @@ import javax.persistence.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
import javax.validation.constraints.Pattern;
|
import javax.validation.constraints.Pattern;
|
||||||
|
|
||||||
import org.omg.CORBA.DomainManager;
|
import org.omg.CORBA.DomainManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -6,26 +6,52 @@
|
||||||
package org.libreccm.core;
|
package org.libreccm.core;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
|
import javax.persistence.TypedQuery;
|
||||||
|
import javax.persistence.criteria.CriteriaBuilder;
|
||||||
|
import javax.persistence.criteria.CriteriaQuery;
|
||||||
|
import javax.persistence.criteria.Root;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
* @param <K>
|
||||||
|
* @param <E>
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractEntityRepository<K, E> {
|
public abstract class AbstractEntityRepository<K, E> {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private transient EntityManager entityManager;
|
private transient EntityManager entityManager;
|
||||||
|
|
||||||
protected EntityManager getEntityManager() {
|
protected EntityManager getEntityManager() {
|
||||||
return entityManager;
|
return entityManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract Class<E> getEntityClass();
|
public abstract Class<E> getEntityClass();
|
||||||
|
|
||||||
|
public E findById(final K entityId) {
|
||||||
|
return entityManager.find(getEntityClass(), entityId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<E> findAll() {
|
||||||
|
// We are using the Critiera API here because otherwise we can't
|
||||||
|
// pass the type of the entity dynmacially.
|
||||||
|
final CriteriaBuilder criteriaBuilder = entityManager
|
||||||
|
.getCriteriaBuilder();
|
||||||
|
final CriteriaQuery<E> criteriaQuery = criteriaBuilder.createQuery(
|
||||||
|
getEntityClass());
|
||||||
|
final Root<E> root = criteriaQuery.from(getEntityClass());
|
||||||
|
criteriaQuery.select(root);
|
||||||
|
|
||||||
|
final TypedQuery<E> query = entityManager.createQuery(criteriaQuery);
|
||||||
|
|
||||||
|
return query.getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
public abstract boolean isNew(final E entity);
|
public abstract boolean isNew(final E entity);
|
||||||
|
|
||||||
public void save(final E entity) {
|
public void save(final E entity) {
|
||||||
if (isNew(entity)) {
|
if (isNew(entity)) {
|
||||||
entityManager.persist(entity);
|
entityManager.persist(entity);
|
||||||
|
|
@ -33,10 +59,12 @@ public abstract class AbstractEntityRepository<K, E> {
|
||||||
entityManager.merge(entity);
|
entityManager.merge(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public E findById(final K entityId) {
|
public void delete(final E entity) {
|
||||||
return entityManager.find(getEntityClass(), entityId);
|
if (entity == null) {
|
||||||
|
throw new IllegalArgumentException("Can't delete a null entity.");
|
||||||
|
}
|
||||||
|
|
||||||
|
entityManager.remove(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract List<E> findAll();
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,9 @@ import static org.libreccm.core.CoreConstants.*;
|
||||||
|
|
||||||
import org.libreccm.categorization.Categorization;
|
import org.libreccm.categorization.Categorization;
|
||||||
import org.libreccm.categorization.Category;
|
import org.libreccm.categorization.Category;
|
||||||
|
import org.libreccm.categorization.Domain;
|
||||||
import org.libreccm.categorization.DomainOwnership;
|
import org.libreccm.categorization.DomainOwnership;
|
||||||
|
import org.omg.CORBA.DomainManager;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -63,7 +65,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "ccm_objects")
|
@Table(name = "ccm_objects")
|
||||||
@Inheritance(strategy = InheritanceType.JOINED)
|
@Inheritance(strategy = InheritanceType.JOINED)
|
||||||
@XmlRootElement(name = "ccm-object", namespace = XML_NS)
|
@XmlRootElement(name = "ccm-object", namespace = CORE_XML_NS)
|
||||||
//False warning (?). Because this class has been migrated from the old PDL style
|
//False warning (?). Because this class has been migrated from the old PDL style
|
||||||
//persistence system we can't yet refactor it to make PMD happy. Also I think
|
//persistence system we can't yet refactor it to make PMD happy. Also I think
|
||||||
//this is a false warning.
|
//this is a false warning.
|
||||||
|
|
@ -80,35 +82,35 @@ public class CcmObject implements Serializable {
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "object_id")
|
@Column(name = "object_id")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
@XmlElement(name = "object-id", namespace = XML_NS)
|
@XmlElement(name = "object-id", namespace = CORE_XML_NS)
|
||||||
private long objectId;
|
private long objectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A human readable name identifying this {@code CcmObject}
|
* A human readable name identifying this {@code CcmObject}
|
||||||
*/
|
*/
|
||||||
@Column(name = "display_name")
|
@Column(name = "display_name")
|
||||||
@XmlElement(name = "display-name", namespace = XML_NS)
|
@XmlElement(name = "display-name", namespace = CORE_XML_NS)
|
||||||
private String displayName;
|
private String displayName;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "object")
|
@OneToMany(mappedBy = "object")
|
||||||
@XmlElementWrapper(name = "permissions", namespace = XML_NS)
|
@XmlElementWrapper(name = "permissions", namespace = CORE_XML_NS)
|
||||||
@XmlElement(name = "permission", namespace = XML_NS)
|
@XmlElement(name = "permission", namespace = CORE_XML_NS)
|
||||||
private List<Permission> permissions;
|
private List<Permission> permissions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Category Domains owned by this {@code CcmObject}.
|
* Category Domains owned by this {@code CcmObject}.
|
||||||
*/
|
*/
|
||||||
@OneToMany(mappedBy = "owner")
|
@OneToMany(mappedBy = "owner")
|
||||||
@XmlElementWrapper(name = "domains", namespace = XML_NS)
|
@XmlElementWrapper(name = "domains", namespace = CORE_XML_NS)
|
||||||
@XmlElement(name = "domain", namespace = XML_NS)
|
@XmlElement(name = "domain", namespace = CORE_XML_NS)
|
||||||
private List<DomainOwnership> domains;
|
private List<DomainOwnership> domains;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Categories which have been assigned to this {@code CcmObject}.
|
* Categories which have been assigned to this {@code CcmObject}.
|
||||||
*/
|
*/
|
||||||
@OneToMany(mappedBy = "categorizedObject")
|
@OneToMany(mappedBy = "categorizedObject")
|
||||||
@XmlElementWrapper(name = "categories", namespace = XML_NS)
|
@XmlElementWrapper(name = "categories", namespace = CORE_XML_NS)
|
||||||
@XmlElement(name = "category", namespace = XML_NS)
|
@XmlElement(name = "category", namespace = CORE_XML_NS)
|
||||||
private List<Categorization> categories;
|
private List<Categorization> categories;
|
||||||
|
|
||||||
public CcmObject() {
|
public CcmObject() {
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,10 @@ package org.libreccm.core;
|
||||||
*/
|
*/
|
||||||
public final class CoreConstants {
|
public final class CoreConstants {
|
||||||
|
|
||||||
|
public static final String CORE_XML_NS = "http://core.libreccm.org";
|
||||||
|
|
||||||
private CoreConstants() {
|
private CoreConstants() {
|
||||||
//Nothing
|
//Nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final String XML_NS = "http://core.libreccm.org";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,23 +45,23 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Embeddable
|
@Embeddable
|
||||||
@XmlRootElement(name = "email-address", namespace = XML_NS)
|
@XmlRootElement(name = "email-address", namespace = CORE_XML_NS)
|
||||||
public class EmailAddress implements Serializable {
|
public class EmailAddress implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4076089589412432766L;
|
private static final long serialVersionUID = -4076089589412432766L;
|
||||||
|
|
||||||
@Column(name = "email_address", length = 512, nullable = false)
|
@Column(name = "email_address", length = 512, nullable = false)
|
||||||
@XmlElement(name = "address", namespace = XML_NS, required = true)
|
@XmlElement(name = "address", namespace = CORE_XML_NS, required = true)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Email
|
@Email
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
@Column(name = "bouncing")
|
@Column(name = "bouncing")
|
||||||
@XmlElement(name = "bouncing", namespace = XML_NS)
|
@XmlElement(name = "bouncing", namespace = CORE_XML_NS)
|
||||||
private boolean bouncing;
|
private boolean bouncing;
|
||||||
|
|
||||||
@Column(name = "verified")
|
@Column(name = "verified")
|
||||||
@XmlElement(name = "verified", namespace = XML_NS)
|
@XmlElement(name = "verified", namespace = CORE_XML_NS)
|
||||||
private boolean verified;
|
private boolean verified;
|
||||||
|
|
||||||
public String getAddress() {
|
public String getAddress() {
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ import javax.xml.bind.annotation.XmlTransient;
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "group_memberships")
|
@Table(name = "group_memberships")
|
||||||
@XmlRootElement(name = "group-membership",
|
@XmlRootElement(name = "group-membership",
|
||||||
namespace = XML_NS)
|
namespace = CORE_XML_NS)
|
||||||
public class GroupMembership implements Serializable {
|
public class GroupMembership implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1897274442468035089L;
|
private static final long serialVersionUID = 1897274442468035089L;
|
||||||
|
|
@ -50,7 +50,7 @@ public class GroupMembership implements Serializable {
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "membership_id")
|
@Column(name = "membership_id")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
@XmlElement(name = "membership-id", namespace = XML_NS)
|
@XmlElement(name = "membership-id", namespace = CORE_XML_NS)
|
||||||
private long membershipId;
|
private long membershipId;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "parties")
|
@Table(name = "parties")
|
||||||
@XmlRootElement(name = "party", namespace = XML_NS)
|
@XmlRootElement(name = "party", namespace = CORE_XML_NS)
|
||||||
public class Party extends CcmObject implements Serializable {
|
public class Party extends CcmObject implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6303836654273293979L;
|
private static final long serialVersionUID = 6303836654273293979L;
|
||||||
|
|
@ -55,15 +55,15 @@ public class Party extends CcmObject implements Serializable {
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "party_id")})
|
@JoinColumn(name = "party_id")})
|
||||||
@Size(min = 1)
|
@Size(min = 1)
|
||||||
@XmlElementWrapper(name = "email-addresses", namespace = XML_NS)
|
@XmlElementWrapper(name = "email-addresses", namespace = CORE_XML_NS)
|
||||||
@XmlElement(name = "email-address", namespace = XML_NS)
|
@XmlElement(name = "email-address", namespace = CORE_XML_NS)
|
||||||
private List<EmailAddress> emailAddresses;
|
private List<EmailAddress> emailAddresses;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "grantee")
|
@OneToMany(mappedBy = "grantee")
|
||||||
//Can't shorten this variable name without reducing descriptiveness
|
//Can't shorten this variable name without reducing descriptiveness
|
||||||
@SuppressWarnings("PMD.LongVariable")
|
@SuppressWarnings("PMD.LongVariable")
|
||||||
@XmlElementWrapper(name = "granted-permissions", namespace = XML_NS)
|
@XmlElementWrapper(name = "granted-permissions", namespace = CORE_XML_NS)
|
||||||
@XmlElement(name = "granted-permission", namespace = XML_NS)
|
@XmlElement(name = "granted-permission", namespace = CORE_XML_NS)
|
||||||
private List<Permission> grantedPermissions;
|
private List<Permission> grantedPermissions;
|
||||||
|
|
||||||
public Party() {
|
public Party() {
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlTransient;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -49,7 +48,7 @@ import javax.xml.bind.annotation.XmlTransient;
|
||||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
"PMD.StdCyclomaticComplexity",
|
"PMD.StdCyclomaticComplexity",
|
||||||
"PMD.ModifiedCyclomaticComplexity"})
|
"PMD.ModifiedCyclomaticComplexity"})
|
||||||
@XmlRootElement(name = "permission", namespace = XML_NS)
|
@XmlRootElement(name = "permission", namespace = CORE_XML_NS)
|
||||||
public class Permission implements Serializable {
|
public class Permission implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -2368935232499907547L;
|
private static final long serialVersionUID = -2368935232499907547L;
|
||||||
|
|
@ -57,7 +56,7 @@ public class Permission implements Serializable {
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "permission_id")
|
@Column(name = "permission_id")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
@XmlElement(name = "permission-id", namespace = XML_NS)
|
@XmlElement(name = "permission-id", namespace = CORE_XML_NS)
|
||||||
private long permissionId;
|
private long permissionId;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
|
@ -66,7 +65,7 @@ public class Permission implements Serializable {
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "granted_privilege_id")
|
@JoinColumn(name = "granted_privilege_id")
|
||||||
@XmlElement(name = "privilege", namespace = XML_NS)
|
@XmlElement(name = "privilege", namespace = CORE_XML_NS)
|
||||||
private Privilege grantedPrivilege;
|
private Privilege grantedPrivilege;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
|
@ -75,16 +74,16 @@ public class Permission implements Serializable {
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "creation_user_id")
|
@JoinColumn(name = "creation_user_id")
|
||||||
@XmlElement(name = "creation-user", namespace = XML_NS)
|
@XmlElement(name = "creation-user", namespace = CORE_XML_NS)
|
||||||
private User creationUser;
|
private User creationUser;
|
||||||
|
|
||||||
@Column(name = "creation_date")
|
@Column(name = "creation_date")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
@XmlElement(name = "creation-date", namespace = XML_NS)
|
@XmlElement(name = "creation-date", namespace = CORE_XML_NS)
|
||||||
private Date creationDate;
|
private Date creationDate;
|
||||||
|
|
||||||
@Column(name = "creation_ip")
|
@Column(name = "creation_ip")
|
||||||
@XmlElement(name = "creation-ip", namespace = XML_NS)
|
@XmlElement(name = "creation-ip", namespace = CORE_XML_NS)
|
||||||
private String creationIp;
|
private String creationIp;
|
||||||
|
|
||||||
public long getPermissionId() {
|
public long getPermissionId() {
|
||||||
|
|
|
||||||
|
|
@ -36,31 +36,31 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Embeddable
|
@Embeddable
|
||||||
@XmlRootElement(name = "person-name", namespace = XML_NS)
|
@XmlRootElement(name = "person-name", namespace = CORE_XML_NS)
|
||||||
public class PersonName implements Serializable {
|
public class PersonName implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -5805626320605809172L;
|
private static final long serialVersionUID = -5805626320605809172L;
|
||||||
|
|
||||||
@Column(name = "title_pre", length = 512)
|
@Column(name = "title_pre", length = 512)
|
||||||
@XmlElement(name = "title-pre", namespace = XML_NS)
|
@XmlElement(name = "title-pre", namespace = CORE_XML_NS)
|
||||||
private String titlePre;
|
private String titlePre;
|
||||||
|
|
||||||
@Column(name = "given_name", length = 512)
|
@Column(name = "given_name", length = 512)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@XmlElement(name = "given-name", namespace = XML_NS)
|
@XmlElement(name = "given-name", namespace = CORE_XML_NS)
|
||||||
private String givenName;
|
private String givenName;
|
||||||
|
|
||||||
@Column(name = "middle_name", length = 512)
|
@Column(name = "middle_name", length = 512)
|
||||||
@XmlElement(name = "middle-name", namespace = XML_NS)
|
@XmlElement(name = "middle-name", namespace = CORE_XML_NS)
|
||||||
private String middleName;
|
private String middleName;
|
||||||
|
|
||||||
@Column(name = "family_name", length = 512)
|
@Column(name = "family_name", length = 512)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@XmlElement(name = "family-name", namespace = XML_NS)
|
@XmlElement(name = "family-name", namespace = CORE_XML_NS)
|
||||||
private String familyName;
|
private String familyName;
|
||||||
|
|
||||||
@Column(name = "title_post", length = 512)
|
@Column(name = "title_post", length = 512)
|
||||||
@XmlElement(name = "title-post", namespace = XML_NS)
|
@XmlElement(name = "title-post", namespace = CORE_XML_NS)
|
||||||
private String titlePost;
|
private String titlePost;
|
||||||
|
|
||||||
public String getTitlePre() {
|
public String getTitlePre() {
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "ccm_privileges")
|
@Table(name = "ccm_privileges")
|
||||||
@XmlRootElement(name = "privilege", namespace = XML_NS)
|
@XmlRootElement(name = "privilege", namespace = CORE_XML_NS)
|
||||||
public class Privilege implements Serializable {
|
public class Privilege implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -3986038536996049440L;
|
private static final long serialVersionUID = -3986038536996049440L;
|
||||||
|
|
@ -46,13 +46,13 @@ public class Privilege implements Serializable {
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "privilege_id")
|
@Column(name = "privilege_id")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
@XmlElement(name = "privilege-id", namespace = XML_NS)
|
@XmlElement(name = "privilege-id", namespace = CORE_XML_NS)
|
||||||
private long privilegeId;
|
private long privilegeId;
|
||||||
|
|
||||||
@Column(name = "privilege", length = 255, nullable = false)
|
@Column(name = "privilege", length = 255, nullable = false)
|
||||||
//Field is named like this in the old PDL class, don't want to change it now
|
//Field is named like this in the old PDL class, don't want to change it now
|
||||||
@SuppressWarnings("PMD.AvoidFieldNameMatchingTypeName")
|
@SuppressWarnings("PMD.AvoidFieldNameMatchingTypeName")
|
||||||
@XmlElement(name = "privilege", namespace = XML_NS)
|
@XmlElement(name = "privilege", namespace = CORE_XML_NS)
|
||||||
private String privilege;
|
private String privilege;
|
||||||
|
|
||||||
public long getPrivilegeId() {
|
public long getPrivilegeId() {
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ import javax.xml.bind.annotation.XmlTransient;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "users")
|
@Table(name = "users")
|
||||||
@XmlRootElement(name = "user", namespace = XML_NS)
|
@XmlRootElement(name = "user", namespace = CORE_XML_NS)
|
||||||
//Supressing a few warnings from PMD because they misleading here.
|
//Supressing a few warnings from PMD because they misleading here.
|
||||||
//User is perfectly fine class name, and the complexity is not to high...
|
//User is perfectly fine class name, and the complexity is not to high...
|
||||||
@SuppressWarnings({"PMD.ShortClassName",
|
@SuppressWarnings({"PMD.ShortClassName",
|
||||||
|
|
@ -67,20 +67,20 @@ public class User extends Party implements Serializable {
|
||||||
joinTable = @JoinTable(name = "user_names",
|
joinTable = @JoinTable(name = "user_names",
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = " user_id")}))
|
@JoinColumn(name = " user_id")}))
|
||||||
@XmlElement(name = "person-name", namespace = XML_NS)
|
@XmlElement(name = "person-name", namespace = CORE_XML_NS)
|
||||||
private PersonName name;
|
private PersonName name;
|
||||||
|
|
||||||
@Column(name = "screen_name", length = 255, nullable = false)
|
@Column(name = "screen_name", length = 255, nullable = false)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@XmlElement(name = "screen-name", namespace = XML_NS)
|
@XmlElement(name = "screen-name", namespace = CORE_XML_NS)
|
||||||
private String screenName;
|
private String screenName;
|
||||||
|
|
||||||
@Column(name = "banned")
|
@Column(name = "banned")
|
||||||
@XmlElement(name = "banned", namespace = XML_NS)
|
@XmlElement(name = "banned", namespace = CORE_XML_NS)
|
||||||
private boolean banned;
|
private boolean banned;
|
||||||
|
|
||||||
@Column(name = "sso_login", length = 512)
|
@Column(name = "sso_login", length = 512)
|
||||||
@XmlElement(name = "sso-login", namespace = XML_NS)
|
@XmlElement(name = "sso-login", namespace = CORE_XML_NS)
|
||||||
private String ssoLogin;
|
private String ssoLogin;
|
||||||
|
|
||||||
@Column(name = "password", length = 2048)
|
@Column(name = "password", length = 2048)
|
||||||
|
|
@ -92,16 +92,16 @@ public class User extends Party implements Serializable {
|
||||||
private String salt;
|
private String salt;
|
||||||
|
|
||||||
@Column(name = "password_question", length = 2048)
|
@Column(name = "password_question", length = 2048)
|
||||||
@XmlElement(name = "password-question", namespace = XML_NS)
|
@XmlElement(name = "password-question", namespace = CORE_XML_NS)
|
||||||
private String passwordQuestion;
|
private String passwordQuestion;
|
||||||
|
|
||||||
@Column(name = "password_answer", length = 2048)
|
@Column(name = "password_answer", length = 2048)
|
||||||
@XmlElement(name = "password-answer", namespace = XML_NS)
|
@XmlElement(name = "password-answer", namespace = CORE_XML_NS)
|
||||||
private String passwordAnswer;
|
private String passwordAnswer;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "user")
|
@OneToMany(mappedBy = "user")
|
||||||
@XmlElementWrapper(name = "group-memberships")
|
@XmlElementWrapper(name = "group-memberships")
|
||||||
@XmlElement(name = "group-membership", namespace = XML_NS)
|
@XmlElement(name = "group-membership", namespace = CORE_XML_NS)
|
||||||
private List<GroupMembership> groupMemberships;
|
private List<GroupMembership> groupMemberships;
|
||||||
|
|
||||||
public User() {
|
public User() {
|
||||||
|
|
|
||||||
|
|
@ -44,24 +44,24 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "user_groups")
|
@Table(name = "user_groups")
|
||||||
@XmlRootElement(name = "user-group", namespace = XML_NS)
|
@XmlRootElement(name = "user-group", namespace = CORE_XML_NS)
|
||||||
public class UserGroup extends Party implements Serializable {
|
public class UserGroup extends Party implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -5555063356689597270L;
|
private static final long serialVersionUID = -5555063356689597270L;
|
||||||
|
|
||||||
@Column(name = "name", length = 512, nullable = false)
|
@Column(name = "name", length = 512, nullable = false)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@XmlElement(name = "name", namespace = XML_NS)
|
@XmlElement(name = "name", namespace = CORE_XML_NS)
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "sourceGroup")
|
@OneToMany(mappedBy = "sourceGroup")
|
||||||
@XmlElementWrapper(name = "roles", namespace = XML_NS)
|
@XmlElementWrapper(name = "roles", namespace = CORE_XML_NS)
|
||||||
@XmlElement(name ="role", namespace = XML_NS)
|
@XmlElement(name ="role", namespace = CORE_XML_NS)
|
||||||
private List<Role> roles;
|
private List<Role> roles;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "group")
|
@OneToMany(mappedBy = "group")
|
||||||
@XmlElementWrapper(name = "group-memberships", namespace = XML_NS)
|
@XmlElementWrapper(name = "group-memberships", namespace = CORE_XML_NS)
|
||||||
@XmlElement(name = "group-membership", namespace = XML_NS)
|
@XmlElement(name = "group-membership", namespace = CORE_XML_NS)
|
||||||
private List<GroupMembership> members;
|
private List<GroupMembership> members;
|
||||||
|
|
||||||
public UserGroup() {
|
public UserGroup() {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package org.libreccm.jpautils;
|
package org.libreccm.jpa;
|
||||||
|
|
||||||
import javax.enterprise.context.ApplicationScoped;
|
import javax.enterprise.context.ApplicationScoped;
|
||||||
|
import javax.enterprise.inject.Produces;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.PersistenceContext;
|
import javax.persistence.PersistenceContext;
|
||||||
|
|
||||||
|
|
@ -9,8 +10,10 @@ import javax.persistence.PersistenceContext;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
|
@SuppressWarnings("PMD.UnusedPrivateField")
|
||||||
public class EntityManagerProducer {
|
public class EntityManagerProducer {
|
||||||
|
|
||||||
|
@Produces
|
||||||
@PersistenceContext(name = "LibreCCM")
|
@PersistenceContext(name = "LibreCCM")
|
||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
* MA 02110-1301 USA
|
* MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
package org.libreccm.jpautils;
|
package org.libreccm.jpa.utils;
|
||||||
|
|
||||||
|
|
||||||
import javax.activation.MimeType;
|
import javax.activation.MimeType;
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
* MA 02110-1301 USA
|
* MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
package org.libreccm.jpautils;
|
package org.libreccm.jpa.utils;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.messaging;
|
package org.libreccm.messaging;
|
||||||
|
|
||||||
import org.libreccm.jpautils.MimeTypeConverter;
|
import org.libreccm.jpa.utils.MimeTypeConverter;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ package org.libreccm.messaging;
|
||||||
|
|
||||||
import org.libreccm.core.CcmObject;
|
import org.libreccm.core.CcmObject;
|
||||||
import org.libreccm.core.Party;
|
import org.libreccm.core.Party;
|
||||||
import org.libreccm.jpautils.MimeTypeConverter;
|
import org.libreccm.jpa.utils.MimeTypeConverter;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ package org.libreccm.web;
|
||||||
|
|
||||||
import org.libreccm.core.Resource;
|
import org.libreccm.core.Resource;
|
||||||
import org.libreccm.core.UserGroup;
|
import org.libreccm.core.UserGroup;
|
||||||
import org.libreccm.jpautils.UriConverter;
|
import org.libreccm.jpa.utils.UriConverter;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,210 @@
|
||||||
|
/*
|
||||||
|
* 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.libreccm.core;
|
||||||
|
|
||||||
|
import org.dbunit.util.fileloader.DataFileLoader;
|
||||||
|
|
||||||
|
import static org.hamcrest.CoreMatchers.*;
|
||||||
|
|
||||||
|
import org.jboss.arquillian.container.test.api.Deployment;
|
||||||
|
import org.jboss.arquillian.container.test.api.ShouldThrowException;
|
||||||
|
import org.jboss.arquillian.junit.Arquillian;
|
||||||
|
import org.jboss.arquillian.junit.InSequence;
|
||||||
|
import org.jboss.arquillian.persistence.PersistenceTest;
|
||||||
|
import org.jboss.arquillian.persistence.ShouldMatchDataSet;
|
||||||
|
import org.jboss.arquillian.persistence.UsingDataSet;
|
||||||
|
import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
|
||||||
|
import org.jboss.arquillian.transaction.api.annotation.Transactional;
|
||||||
|
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
||||||
|
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
|
||||||
|
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
||||||
|
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
|
||||||
|
import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage;
|
||||||
|
import org.junit.After;
|
||||||
|
import org.junit.AfterClass;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.BeforeClass;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.experimental.categories.Category;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.libreccm.tests.categories.IntegrationTest;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.ejb.EJBTransactionRolledbackException;
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@Category(IntegrationTest.class)
|
||||||
|
@RunWith(Arquillian.class)
|
||||||
|
@PersistenceTest
|
||||||
|
@Transactional(TransactionMode.COMMIT)
|
||||||
|
public class CcmObjectRepositoryTest {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private transient CcmObjectRepository ccmObjectRepository;
|
||||||
|
|
||||||
|
public CcmObjectRepositoryTest() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeClass
|
||||||
|
public static void setUpClass() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void tearDownClass() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@After
|
||||||
|
public void tearDown() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deployment
|
||||||
|
public static WebArchive createDeployment() {
|
||||||
|
final PomEquippedResolveStage pom = Maven
|
||||||
|
.resolver()
|
||||||
|
.loadPomFromFile("pom.xml");
|
||||||
|
final PomEquippedResolveStage dependencies = pom
|
||||||
|
.importCompileAndRuntimeDependencies();
|
||||||
|
final File[] libs = dependencies.resolve().withTransitivity().asFile();
|
||||||
|
|
||||||
|
for (File lib : libs) {
|
||||||
|
System.err.printf("Adding file '%s' to test archive...\n",
|
||||||
|
lib.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
return ShrinkWrap
|
||||||
|
.create(WebArchive.class,
|
||||||
|
"LibreCCM-org.libreccm.core.CcmObjectRepositoryTest.war")
|
||||||
|
.addPackage(CcmObject.class.getPackage())
|
||||||
|
.addPackage(org.libreccm.categorization.Category.class.getPackage())
|
||||||
|
.addPackage(org.libreccm.l10n.LocalizedString.class.getPackage())
|
||||||
|
.addPackage(org.libreccm.jpa.EntityManagerProducer.class
|
||||||
|
.getPackage())
|
||||||
|
.addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class
|
||||||
|
.getPackage())
|
||||||
|
.addPackage(org.libreccm.testutils.EqualsVerifier.class.getPackage())
|
||||||
|
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
||||||
|
.getPackage())
|
||||||
|
.addAsLibraries(libs)
|
||||||
|
.addAsResource("test-persistence.xml", "META-INF/persistence.xml")
|
||||||
|
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@UsingDataSet(
|
||||||
|
"datasets/org/libreccm/core/CcmObjectRepositoryTest/data.json")
|
||||||
|
@InSequence(10)
|
||||||
|
public void findCcmObjectById() {
|
||||||
|
final CcmObject obj1 = ccmObjectRepository.findById(-10L);
|
||||||
|
final CcmObject obj2 = ccmObjectRepository.findById(-20L);
|
||||||
|
final CcmObject obj3 = ccmObjectRepository.findById(-30L);
|
||||||
|
final CcmObject none = ccmObjectRepository.findById(-999L);
|
||||||
|
|
||||||
|
assertThat(obj1, is(not(nullValue())));
|
||||||
|
assertThat(obj1.getObjectId(), is(-10L));
|
||||||
|
assertThat(obj1.getDisplayName(), is(equalTo("Test Object 1")));
|
||||||
|
|
||||||
|
assertThat(obj2, is(not(nullValue())));
|
||||||
|
assertThat(obj2.getObjectId(), is(-20L));
|
||||||
|
assertThat(obj2.getDisplayName(), is(equalTo("Test Object 2")));
|
||||||
|
|
||||||
|
assertThat(obj3, is(not(nullValue())));
|
||||||
|
assertThat(obj3.getObjectId(), is(-30L));
|
||||||
|
assertThat(obj3.getDisplayName(), is(equalTo("Test Object 3")));
|
||||||
|
|
||||||
|
assertThat(none, is(nullValue()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@UsingDataSet(
|
||||||
|
"datasets/org/libreccm/core/CcmObjectRepositoryTest/data.json")
|
||||||
|
@InSequence(10)
|
||||||
|
public void findAllCcmObjects() {
|
||||||
|
final List<CcmObject> objects = ccmObjectRepository.findAll();
|
||||||
|
|
||||||
|
assertThat(objects.size(), is(3));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@UsingDataSet(
|
||||||
|
"datasets/org/libreccm/core/CcmObjectRepositoryTest/data.json")
|
||||||
|
@ShouldMatchDataSet(value
|
||||||
|
= "datasets/org/libreccm/core/CcmObjectRepositoryTest/after-save-new.json",
|
||||||
|
excludeColumns = {"object_id"})
|
||||||
|
@InSequence(300)
|
||||||
|
public void saveNewCcmObject() {
|
||||||
|
final CcmObject obj = new CcmObject();
|
||||||
|
obj.setDisplayName("Test Object 4");
|
||||||
|
|
||||||
|
ccmObjectRepository.save(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@UsingDataSet(
|
||||||
|
"datasets/org/libreccm/core/CcmObjectRepositoryTest/data.json")
|
||||||
|
@ShouldMatchDataSet(value
|
||||||
|
= "datasets/org/libreccm/core/CcmObjectRepositoryTest/after-save-changed.json",
|
||||||
|
excludeColumns = {"object_id"})
|
||||||
|
@InSequence(400)
|
||||||
|
public void saveChangedCcmObject() {
|
||||||
|
final CcmObject obj = ccmObjectRepository.findById(-20L);
|
||||||
|
obj.setDisplayName("Second Test Object");
|
||||||
|
|
||||||
|
ccmObjectRepository.save(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(expected = EJBTransactionRolledbackException.class)
|
||||||
|
@ShouldThrowException(IllegalArgumentException.class)
|
||||||
|
@InSequence(500)
|
||||||
|
public void saveNullValue() {
|
||||||
|
ccmObjectRepository.save(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@UsingDataSet(
|
||||||
|
"datasets/org/libreccm/core/CcmObjectRepositoryTest/data.json")
|
||||||
|
@ShouldMatchDataSet(value
|
||||||
|
= "datasets/org/libreccm/core/CcmObjectRepositoryTest/after-delete.json",
|
||||||
|
excludeColumns = {"object_id"})
|
||||||
|
@InSequence(600)
|
||||||
|
public void deleteCcmObject() {
|
||||||
|
final CcmObject obj = ccmObjectRepository.findById(-20L);
|
||||||
|
|
||||||
|
ccmObjectRepository.delete(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(expected = EJBTransactionRolledbackException.class)
|
||||||
|
@ShouldThrowException(IllegalArgumentException.class)
|
||||||
|
@InSequence(700)
|
||||||
|
public void deleteNullValue() {
|
||||||
|
ccmObjectRepository.delete(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.jpautils;
|
package org.libreccm.jpautils;
|
||||||
|
|
||||||
|
import org.libreccm.jpa.utils.MimeTypeConverter;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.jpautils;
|
package org.libreccm.jpautils;
|
||||||
|
|
||||||
|
import org.libreccm.jpa.utils.UriConverter;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
* 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.libreccm.tests.categories;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public interface IntegrationTest {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<arquillian xmlns="http://jboss.org/schema/arquillian"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://jboss.org/schema/arquillian
|
||||||
|
http://jboss.org/schema/arquillian/arquillian_1_0.xsd" >
|
||||||
|
|
||||||
|
<engine>
|
||||||
|
<property name="deploymentExportPath">target/deployments</property>
|
||||||
|
</engine>
|
||||||
|
|
||||||
|
<extension qualifier="persistence">
|
||||||
|
<property name="defaultDataSource">testdb</property>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Disable automatic cleanup, does not work because of referential
|
||||||
|
integrity constrains.
|
||||||
|
-->
|
||||||
|
<property name="defaultCleanupPhase">NONE</property>
|
||||||
|
|
||||||
|
<property name="dumpData">true</property>
|
||||||
|
<property name="dumpDirectory">target</property>
|
||||||
|
</extension>
|
||||||
|
|
||||||
|
<extension qualifier="persistence-dbunit">
|
||||||
|
<property name="defaultDataSetFormat">json</property>
|
||||||
|
<property name="datatypeFactory">org.dbunit.ext.h2.H2DataTypeFactory</property>
|
||||||
|
<property name="excludePoi">true</property>
|
||||||
|
</extension>
|
||||||
|
|
||||||
|
<extension qualifier="persistence-script">
|
||||||
|
<property name="scriptsToExecuteAfterTest">scripts/h2-cleanup.sql</property>
|
||||||
|
</extension>
|
||||||
|
|
||||||
|
|
||||||
|
</arquillian>
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
# Test database
|
||||||
|
testdatabase = new://Resource?type=DataSource
|
||||||
|
testdatabase.JdbcDriver = org.h2.Driver
|
||||||
|
testdatabase.JdbcUrl = jdbc:h2:mem:testdatabase
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
author: Jens Pelzetter
|
||||||
|
-->
|
||||||
|
|
||||||
|
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
|
||||||
|
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
|
||||||
|
version="2.1">
|
||||||
|
|
||||||
|
<persistence-unit name="LibreCCM" transaction-type="JTA">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Enforce JPA provider
|
||||||
|
Not really necessary here because we don't use any Hibernate
|
||||||
|
specific features, but makes it easier to manage to database
|
||||||
|
creation scripts.
|
||||||
|
-->
|
||||||
|
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
||||||
|
|
||||||
|
<jta-data-source>testdb</jta-data-source>
|
||||||
|
<properties>
|
||||||
|
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
|
||||||
|
<property name="hibernate.show_sql" value="true"/>
|
||||||
|
<property name="hibernate.id.new_generator_mappings" value="true"/>
|
||||||
|
<property name="hibernate.connection.autocommit" value="false" />
|
||||||
|
</properties>
|
||||||
|
</persistence-unit>
|
||||||
|
|
||||||
|
</persistence>
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<arquillian xmlns="http://jboss.org/schema/arquillian"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://jboss.org/schema/arquillian
|
||||||
|
http://jboss.org/schema/arquillian/arquillian_1_0.xsd" >
|
||||||
|
|
||||||
|
<engine>
|
||||||
|
<property name="deploymentExportPath">target/deployments</property>
|
||||||
|
</engine>
|
||||||
|
|
||||||
|
<extension qualifier="persistence">
|
||||||
|
<property name="defaultDataSource">java:/jboss/datasources/ExampleDS</property>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Disable automatic cleanup, does not work because of referential
|
||||||
|
integrity constrains.
|
||||||
|
-->
|
||||||
|
<property name="defaultCleanupPhase">NONE</property>
|
||||||
|
|
||||||
|
<property name="dumpData">true</property>
|
||||||
|
<property name="dumpDirectory">target</property>
|
||||||
|
</extension>
|
||||||
|
|
||||||
|
<extension qualifier="persistence-dbunit">
|
||||||
|
<property name="defaultDataSetFormat">json</property>
|
||||||
|
<property name="datatypeFactory">org.dbunit.ext.h2.H2DataTypeFactory</property>
|
||||||
|
<property name="excludePoi">true</property>
|
||||||
|
</extension>
|
||||||
|
|
||||||
|
<extension qualifier="persistence-script">
|
||||||
|
<property name="scriptsToExecuteAfterTest">scripts/h2-cleanup.sql</property>
|
||||||
|
</extension>
|
||||||
|
|
||||||
|
|
||||||
|
</arquillian>
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
author: Jens Pelzetter
|
||||||
|
-->
|
||||||
|
|
||||||
|
<persistence
|
||||||
|
xmlns="http://xmlns.jcp.org/xml/ns/persistence"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
|
||||||
|
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
|
||||||
|
version="2.1">
|
||||||
|
|
||||||
|
<persistence-unit name="LibreCCM" transaction-type="JTA">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Enforce JPA provider
|
||||||
|
Not really necessary here because we don't use any Hibernate
|
||||||
|
specific features, but makes it easier to manage to database
|
||||||
|
creation scripts.
|
||||||
|
-->
|
||||||
|
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
||||||
|
|
||||||
|
<jta-data-source>java:/jboss/datasources/ExampleDS</jta-data-source>
|
||||||
|
<properties>
|
||||||
|
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
|
||||||
|
<property name="hibernate.show_sql" value="true"/>
|
||||||
|
<property name="hibernate.id.new_generator_mappings" value="true"/>
|
||||||
|
<property name="hibernate.connection.autocommit" value="false" />
|
||||||
|
</properties>
|
||||||
|
</persistence-unit>
|
||||||
|
|
||||||
|
</persistence>
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"ccm_objects":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"object_id": -10,
|
||||||
|
"display_name": "Test Object 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"object_id": -30,
|
||||||
|
"display_name": "Test Object 3"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"ccm_objects":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"object_id": -10,
|
||||||
|
"display_name": "Test Object 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"object_id": -20,
|
||||||
|
"display_name": "Second Test Object"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"object_id": -30,
|
||||||
|
"display_name": "Test Object 3"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"ccm_objects":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"object_id": -10,
|
||||||
|
"display_name": "Test Object 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"object_id": -20,
|
||||||
|
"display_name": "Test Object 2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"object_id": -30,
|
||||||
|
"display_name": "Test Object 3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"object_id": -40,
|
||||||
|
"display_name": "Test Object 4"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"ccm_objects":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"object_id": -10,
|
||||||
|
"display_name": "Test Object 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"object_id": -20,
|
||||||
|
"display_name": "Test Object 2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"object_id": -30,
|
||||||
|
"display_name": "Test Object 3"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
DELETE FROM ccm_objects;
|
||||||
Loading…
Reference in New Issue