CCM NG:
- Some work on the module system, especially on install and init - Removed some hardcoded strings (replaced with constants) git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3603 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
551c8c398d
commit
ee8e0e52df
|
|
@ -21,6 +21,8 @@ package org.libreccm.auditing;
|
|||
import org.hibernate.envers.DefaultRevisionEntity;
|
||||
import org.hibernate.envers.RevisionEntity;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.persistence.Column;
|
||||
|
|
@ -36,7 +38,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "ccm_revisions", schema = "ccm_core")
|
||||
@Table(name = "ccm_revisions", schema = DB_SCHEMA)
|
||||
@RevisionEntity()
|
||||
public class CcmRevision extends DefaultRevisionEntity {
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ import javax.persistence.Table;
|
|||
|
||||
import org.libreccm.core.CcmObject;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.persistence.JoinColumn;
|
||||
|
|
@ -44,7 +46,7 @@ import javax.persistence.JoinColumn;
|
|||
* @apiviz.has org.libreccm.core.CcmObject
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "categorizations", schema = "ccm_core")
|
||||
@Table(name = "categorizations", schema = DB_SCHEMA)
|
||||
public class Categorization implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 201504301320L;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ package org.libreccm.categorization;
|
|||
import org.hibernate.validator.constraints.NotBlank;
|
||||
import org.libreccm.core.CcmObject;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -59,7 +61,7 @@ import javax.validation.constraints.Pattern;
|
|||
* @apiviz.composedOf org.libreccm.categorization.Categorization
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "categories", schema = "ccm_core")
|
||||
@Table(name = "categories", schema = DB_SCHEMA)
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "topLevelCategories",
|
||||
query = "SELECT c FROM Category c WHERE c.parentCategory IS NULL")
|
||||
|
|
@ -91,7 +93,7 @@ public class Category extends CcmObject implements Serializable {
|
|||
@AssociationOverride(
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "category_titles",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "object_id")}
|
||||
))
|
||||
|
|
@ -104,7 +106,7 @@ public class Category extends CcmObject implements Serializable {
|
|||
@AssociationOverride(
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "category_descriptions",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "object_id")}
|
||||
))
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ import org.hibernate.validator.constraints.URL;
|
|||
import static org.libreccm.categorization.CategorizationConstants.*;
|
||||
|
||||
import org.libreccm.core.CcmObject;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.jpa.utils.UriConverter;
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
import org.libreccm.web.Application;
|
||||
|
|
@ -70,7 +73,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "category_domains", schema = "ccm_core")
|
||||
@Table(name = "category_domains", schema = DB_SCHEMA)
|
||||
@XmlRootElement(name = "domain", namespace = CAT_XML_NS)
|
||||
public class Domain extends CcmObject implements Serializable {
|
||||
|
||||
|
|
@ -114,7 +117,7 @@ public class Domain extends CcmObject implements Serializable {
|
|||
@AssociationOverride(
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "domain_titles",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "object_id")}))
|
||||
@XmlElement(name = "title", namespace = CAT_XML_NS)
|
||||
|
|
@ -127,7 +130,7 @@ public class Domain extends CcmObject implements Serializable {
|
|||
@AssociationOverride(
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "domain_descriptions",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "object_id")}))
|
||||
@XmlElement(name = "description", namespace = CAT_XML_NS)
|
||||
|
|
|
|||
|
|
@ -30,8 +30,12 @@ import javax.persistence.ManyToOne;
|
|||
import javax.persistence.Table;
|
||||
|
||||
import org.libreccm.core.CcmObject;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.web.Application;
|
||||
|
||||
|
||||
/**
|
||||
* Association class for the association between a {@link Domain} and a
|
||||
* {@link CcmObject}. Instances of this class should not be created manually.
|
||||
|
|
@ -41,7 +45,7 @@ import org.libreccm.web.Application;
|
|||
* @author <a href="jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "domain_ownerships", schema = "ccm_core")
|
||||
@Table(name = "domain_ownerships", schema = DB_SCHEMA)
|
||||
public class DomainOwnership implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 201504301305L;
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||
*
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "ccm_objects", schema = "ccm_core")
|
||||
@Table(name = "ccm_objects", schema = DB_SCHEMA)
|
||||
@Inheritance(strategy = InheritanceType.JOINED)
|
||||
@XmlRootElement(name = "ccm-object", namespace = CORE_XML_NS)
|
||||
//False warning (?). Because this class has been migrated from the old PDL style
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ public final class CoreConstants {
|
|||
|
||||
public static final String DB_SCHEMA = "ccm_core";
|
||||
|
||||
public static final String SEQUENCE_GENERATOR = "core_core_sequence";
|
||||
|
||||
private CoreConstants() {
|
||||
//Nothing
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "ccm_groups", schema = "ccm_core")
|
||||
@Table(name = "ccm_groups", schema = DB_SCHEMA)
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "findGroupByName",
|
||||
query = "SELECT g FROM Group g WHERE g.name = :groupName")
|
||||
|
|
|
|||
|
|
@ -40,9 +40,8 @@ import javax.xml.bind.annotation.XmlTransient;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "group_memberships", schema = "ccm_core")
|
||||
@XmlRootElement(name = "group-membership",
|
||||
namespace = CORE_XML_NS)
|
||||
@Table(name = "group_memberships", schema = DB_SCHEMA)
|
||||
@XmlRootElement(name = "group-membership", namespace = CORE_XML_NS)
|
||||
public class GroupMembership implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1897274442468035089L;
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "permissions", schema = "ccm_core")
|
||||
@Table(name = "permissions", schema = DB_SCHEMA)
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "findPermissionsForSubject",
|
||||
query = "SELECT p FROM Permission p WHERE p.grantee = :subject"),
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "ccm_privileges", schema = "ccm_core")
|
||||
@Table(name = "ccm_privileges", schema = DB_SCHEMA)
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "findPrivilegeByName",
|
||||
query = "SELECT p FROM Privilege p "
|
||||
|
|
|
|||
|
|
@ -18,7 +18,10 @@
|
|||
*/
|
||||
package org.libreccm.core;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
import org.libreccm.web.Application;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
|
|
@ -53,7 +56,7 @@ import javax.persistence.TemporalType;
|
|||
*
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "resources", schema = "ccm_core")
|
||||
@Table(name = "resources", schema = DB_SCHEMA)
|
||||
public class Resource extends CcmObject implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 7345482620613842781L;
|
||||
|
|
@ -65,7 +68,7 @@ public class Resource extends CcmObject implements Serializable {
|
|||
@AssociationOverride(
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "resource_titles",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "object_id")}))
|
||||
private LocalizedString title;
|
||||
|
|
@ -77,7 +80,7 @@ public class Resource extends CcmObject implements Serializable {
|
|||
@AssociationOverride(
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "resource_descriptions",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "object_id")}))
|
||||
private LocalizedString description;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,11 @@
|
|||
*/
|
||||
package org.libreccm.core;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.persistence.AssociationOverride;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embedded;
|
||||
|
|
@ -30,6 +33,7 @@ import javax.persistence.InheritanceType;
|
|||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.JoinTable;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
|
||||
/**
|
||||
|
|
@ -37,7 +41,7 @@ import org.libreccm.l10n.LocalizedString;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "resource_types", schema = "ccm_core")
|
||||
@Table(name = "resource_types", schema = DB_SCHEMA)
|
||||
@Inheritance(strategy = InheritanceType.JOINED)
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
|
|
@ -59,7 +63,7 @@ public class ResourceType implements Serializable {
|
|||
@AssociationOverride(
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "resource_type_descriptions",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "resource_type_id")}))
|
||||
private LocalizedString description;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ import javax.persistence.Table;
|
|||
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
|
|
@ -47,7 +49,7 @@ import javax.persistence.NamedQuery;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "ccm_roles", schema = "ccm_core")
|
||||
@Table(name = "ccm_roles", schema = DB_SCHEMA)
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "findRolesForName",
|
||||
query = "SELECT r FROM Role r "
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "subjects", schema = "ccm_core")
|
||||
@Table(name = "subjects", schema = DB_SCHEMA)
|
||||
@Inheritance(strategy = InheritanceType.JOINED)
|
||||
@XmlRootElement(name = "subject", namespace = CORE_XML_NS)
|
||||
public class Subject implements Serializable {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ import javax.xml.bind.annotation.XmlTransient;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "ccm_users", schema = "ccm_core")
|
||||
@Table(name = "ccm_users", schema = DB_SCHEMA)
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "findUserByScreenName",
|
||||
query = "SELECT u FROM User u WHERE u.screenName = :screenname"),
|
||||
|
|
@ -83,7 +83,7 @@ public class User extends Subject implements Serializable {
|
|||
@AssociationOverride(
|
||||
name = "user_names",
|
||||
joinTable = @JoinTable(name = "user_names",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = " user_id")}))
|
||||
@XmlElement(name = "person-name", namespace = CORE_XML_NS)
|
||||
|
|
@ -103,7 +103,7 @@ public class User extends Subject implements Serializable {
|
|||
|
||||
@ElementCollection(fetch = FetchType.EAGER)
|
||||
@CollectionTable(name = "user_email_addresses",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "user_id")})
|
||||
@Size(min = 1)
|
||||
|
|
|
|||
|
|
@ -73,6 +73,16 @@ public class CcmIntegrator implements Integrator {
|
|||
getProperties().get("javax.persistence.jtaDataSource");
|
||||
connection = dataSource.getConnection();
|
||||
|
||||
//Migrate tables and sequences which don't belong to a module
|
||||
//for instance hibernate_sequence
|
||||
final Flyway flyway = new Flyway();
|
||||
flyway.setDataSource(dataSource);
|
||||
final StringBuffer buffer = new StringBuffer(
|
||||
"db/migrations/org/libreccm/base");
|
||||
appendDbLocation(buffer, connection);
|
||||
flyway.setLocations(buffer.toString());
|
||||
flyway.migrate();
|
||||
|
||||
for (final TreeNode node : orderedNodes) {
|
||||
migrateModule(node.getModule().getClass(), dataSource);
|
||||
|
||||
|
|
@ -81,6 +91,8 @@ public class CcmIntegrator implements Integrator {
|
|||
}
|
||||
}
|
||||
|
||||
configuration.buildMappings();
|
||||
|
||||
} catch (DependencyException | SQLException ex) {
|
||||
throw new IntegrationException("Failed to integrate modules", ex);
|
||||
} finally {
|
||||
|
|
@ -94,12 +106,10 @@ public class CcmIntegrator implements Integrator {
|
|||
return moduleInfo.getModuleName().toLowerCase().replace("-", "_");
|
||||
}
|
||||
|
||||
private String getLocation(final ModuleInfo moduleInfo,
|
||||
final Connection connection) throws SQLException {
|
||||
final StringBuffer buffer = new StringBuffer(
|
||||
"classpath:/db/migrations/");
|
||||
//buffer.append(ModuleUtil.getModulePackageName(module));
|
||||
buffer.append(moduleInfo.getModuleDataPackage());
|
||||
private void appendDbLocation(final StringBuffer buffer,
|
||||
final Connection connection)
|
||||
throws SQLException {
|
||||
|
||||
switch (connection.getMetaData().getDatabaseProductName()) {
|
||||
case "MySQL":
|
||||
buffer.append("/mysql");
|
||||
|
|
@ -113,6 +123,30 @@ public class CcmIntegrator implements Integrator {
|
|||
connection.getMetaData().
|
||||
getDatabaseProductName()));
|
||||
}
|
||||
}
|
||||
|
||||
private String getLocation(final ModuleInfo moduleInfo,
|
||||
final Connection connection)
|
||||
throws SQLException {
|
||||
|
||||
final StringBuffer buffer = new StringBuffer(
|
||||
"classpath:/db/migrations/");
|
||||
//buffer.append(ModuleUtil.getModulePackageName(module));
|
||||
buffer.append(moduleInfo.getModuleDataPackage());
|
||||
// switch (connection.getMetaData().getDatabaseProductName()) {
|
||||
// case "MySQL":
|
||||
// buffer.append("/mysql");
|
||||
// break;
|
||||
// case "PostgreSQL":
|
||||
// buffer.append("/pgsql");
|
||||
// break;
|
||||
// default:
|
||||
// throw new IntegrationException(String.format(
|
||||
// "Integration failed. Database \"%s\" is not supported yet.",
|
||||
// connection.getMetaData().
|
||||
// getDatabaseProductName()));
|
||||
// }
|
||||
appendDbLocation(buffer, connection);
|
||||
|
||||
return buffer.toString();
|
||||
}
|
||||
|
|
@ -222,12 +256,19 @@ public class CcmIntegrator implements Integrator {
|
|||
ex.printStackTrace(System.err);
|
||||
System.err.println();
|
||||
SQLException next = ex.getNextException();
|
||||
while(next != null) {
|
||||
while (next != null) {
|
||||
next.printStackTrace(System.err);
|
||||
System.err.println();
|
||||
next = next.getNextException();
|
||||
}
|
||||
throw new IntegrationException("Failed to desintegrate.", next);
|
||||
|
||||
if (next == null) {
|
||||
throw new IntegrationException(
|
||||
"Failed to desintegrate. No root cause.");
|
||||
} else {
|
||||
throw new IntegrationException(
|
||||
"Failed to desintegrate. No root cause.");
|
||||
}
|
||||
} finally {
|
||||
JdbcUtils.closeConnection(connection);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@
|
|||
package org.libreccm.formbuilder;
|
||||
|
||||
import org.libreccm.core.CcmObject;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -41,7 +44,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_components", schema = "ccm_core")
|
||||
@Table(name = "formbuilder_components", schema = DB_SCHEMA)
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
|
|
@ -57,7 +60,7 @@ public class Component extends CcmObject implements Serializable {
|
|||
@AssociationOverride(
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "formbuilder_component_descriptions",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "component_id")}))
|
||||
private LocalizedString description;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.libreccm.formbuilder;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
@ -30,7 +32,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_data_driven_selects", schema = "ccm_core")
|
||||
@Table(name = "formbuilder_data_driven_selects", schema = DB_SCHEMA)
|
||||
public class DataDrivenSelect extends Widget implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4477753441663454661L;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.libreccm.formbuilder;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
|
@ -34,7 +36,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_formsections", schema = "ccm_core")
|
||||
@Table(name = "formbuilder_formsections", schema = DB_SCHEMA)
|
||||
public class FormSection extends Component implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3195157282292906945L;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ package org.libreccm.formbuilder;
|
|||
|
||||
import org.libreccm.core.CcmObject;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
@ -33,7 +35,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_listeners", schema = "ccm_core")
|
||||
@Table(name = "formbuilder_listeners", schema = DB_SCHEMA)
|
||||
public class Listener extends CcmObject implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 9030104813240364500L;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ package org.libreccm.formbuilder;
|
|||
|
||||
import org.libreccm.core.CcmObject;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
@ -32,7 +34,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_metaobjects", schema = "ccm_core")
|
||||
@Table(name = "formbuilder_metaobjects", schema = DB_SCHEMA)
|
||||
public class MetaObject extends CcmObject implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3770682858640493776L;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ package org.libreccm.formbuilder;
|
|||
|
||||
import org.libreccm.core.CcmObject;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
@ -32,7 +34,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_object_types", schema = "ccm_core")
|
||||
@Table(name = "formbuilder_object_types", schema = DB_SCHEMA)
|
||||
public class ObjectType extends CcmObject implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 5236718507025096569L;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.libreccm.formbuilder;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -35,7 +37,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_options", schema = "ccm_core")
|
||||
@Table(name = "formbuilder_options", schema = DB_SCHEMA)
|
||||
public class Option extends Component implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -7528058391772415511L;
|
||||
|
|
@ -46,7 +48,7 @@ public class Option extends Component implements Serializable {
|
|||
@AssociationOverride(
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "formbuilder_option_labels",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "option_id")}))
|
||||
private LocalizedString label;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@
|
|||
package org.libreccm.formbuilder;
|
||||
|
||||
import org.libreccm.core.CcmObject;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -36,7 +39,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_data_queries", schema = "ccm_core")
|
||||
@Table(name = "formbuilder_data_queries", schema = DB_SCHEMA)
|
||||
public class PersistentDataQuery extends CcmObject implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -7344153915501267752L;
|
||||
|
|
@ -48,7 +51,7 @@ public class PersistentDataQuery extends CcmObject implements Serializable {
|
|||
name = "values",
|
||||
joinTable = @JoinTable(
|
||||
name = "formbuilder_data_query_names",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "data_query_id")}))
|
||||
private LocalizedString name;
|
||||
|
|
@ -57,7 +60,7 @@ public class PersistentDataQuery extends CcmObject implements Serializable {
|
|||
name = "values",
|
||||
joinTable = @JoinTable(
|
||||
name = "formbuilder_data_query_descriptions",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "data_query_id")}))
|
||||
private LocalizedString description;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@
|
|||
package org.libreccm.formbuilder;
|
||||
|
||||
import org.libreccm.core.CcmObject;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -37,7 +40,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_process_listeners", schema = "ccm_core")
|
||||
@Table(name = "formbuilder_process_listeners", schema = DB_SCHEMA)
|
||||
public class ProcessListener extends CcmObject implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3029184333026605708L;
|
||||
|
|
@ -46,7 +49,7 @@ public class ProcessListener extends CcmObject implements Serializable {
|
|||
name = "values",
|
||||
joinTable = @JoinTable(
|
||||
name = "formbuilder_process_listener_names",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "process_listener_id")}))
|
||||
private LocalizedString name;
|
||||
|
|
@ -55,7 +58,7 @@ public class ProcessListener extends CcmObject implements Serializable {
|
|||
name = "values",
|
||||
joinTable = @JoinTable(
|
||||
name = "formbuilder_process_listener_descriptions",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "process_listener_id")}))
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.libreccm.formbuilder;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
|
@ -34,7 +36,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_widgets", schema = "ccm_core")
|
||||
@Table(name = "formbuilder_widgets", schema = DB_SCHEMA)
|
||||
public class Widget extends Component implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1057792450655098288L;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@
|
|||
package org.libreccm.formbuilder;
|
||||
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
@ -31,7 +33,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_widget_labels", schema = "ccm_core")
|
||||
@Table(name = "formbuilder_widget_labels", schema = DB_SCHEMA)
|
||||
public class WidgetLabel extends Component implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2939505715812565159L;
|
||||
|
|
|
|||
|
|
@ -5,12 +5,16 @@
|
|||
*/
|
||||
package org.libreccm.formbuilder.actions;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.libreccm.formbuilder.ProcessListener;
|
||||
|
||||
/**
|
||||
|
|
@ -18,7 +22,7 @@ import org.libreccm.formbuilder.ProcessListener;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_confirm_email_listener", schema = "ccm_core")
|
||||
@Table(name = "formbuilder_confirm_email_listener", schema = DB_SCHEMA)
|
||||
public class ConfirmEmailListener
|
||||
extends ProcessListener
|
||||
implements Serializable {
|
||||
|
|
|
|||
|
|
@ -5,11 +5,15 @@
|
|||
*/
|
||||
package org.libreccm.formbuilder.actions;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.libreccm.formbuilder.ProcessListener;
|
||||
|
||||
/**
|
||||
|
|
@ -17,7 +21,7 @@ import org.libreccm.formbuilder.ProcessListener;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_confirm_redirect_listeners", schema = "ccm_core")
|
||||
@Table(name = "formbuilder_confirm_redirect_listeners", schema = DB_SCHEMA)
|
||||
public class ConfirmRedirectListener
|
||||
extends ProcessListener
|
||||
implements Serializable {
|
||||
|
|
|
|||
|
|
@ -5,10 +5,14 @@
|
|||
*/
|
||||
package org.libreccm.formbuilder.actions;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.libreccm.formbuilder.ProcessListener;
|
||||
|
||||
/**
|
||||
|
|
@ -16,7 +20,7 @@ import org.libreccm.formbuilder.ProcessListener;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_remote_server_post_listener", schema = "ccm_core")
|
||||
@Table(name = "formbuilder_remote_server_post_listener", schema = DB_SCHEMA)
|
||||
public class RemoteServerPostListener
|
||||
extends ProcessListener
|
||||
implements Serializable {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
*/
|
||||
package org.libreccm.formbuilder.actions;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Column;
|
||||
|
|
@ -20,7 +22,7 @@ import java.util.Objects;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_simple_email_listeners", schema = "ccm_core")
|
||||
@Table(name = "formbuilder_simple_email_listeners", schema = DB_SCHEMA)
|
||||
public class SimpleEmailListener
|
||||
extends ProcessListener
|
||||
implements Serializable {
|
||||
|
|
|
|||
|
|
@ -5,12 +5,16 @@
|
|||
*/
|
||||
package org.libreccm.formbuilder.actions;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.libreccm.formbuilder.ProcessListener;
|
||||
|
||||
/**
|
||||
|
|
@ -18,7 +22,7 @@ import org.libreccm.formbuilder.ProcessListener;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_template_email_listeners", schema = "ccm_core")
|
||||
@Table(name = "formbuilder_template_email_listeners", schema = DB_SCHEMA)
|
||||
public class TemplateEmailListener
|
||||
extends ProcessListener
|
||||
implements Serializable {
|
||||
|
|
|
|||
|
|
@ -5,11 +5,15 @@
|
|||
*/
|
||||
package org.libreccm.formbuilder.actions;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.libreccm.formbuilder.ProcessListener;
|
||||
|
||||
/**
|
||||
|
|
@ -17,7 +21,7 @@ import org.libreccm.formbuilder.ProcessListener;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_xml_email_listeners", schema = "ccm_core")
|
||||
@Table(name = "formbuilder_xml_email_listeners", schema = DB_SCHEMA)
|
||||
public class XmlEmailListener extends ProcessListener implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4607965414018004925L;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.libreccm.messaging;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.jpa.utils.MimeTypeConverter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -41,7 +43,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "attachments", schema = "ccm_core")
|
||||
@Table(name = "attachments", schema = DB_SCHEMA)
|
||||
public class Attachment implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 2063934721452863106L;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@
|
|||
package org.libreccm.messaging;
|
||||
|
||||
import org.libreccm.core.CcmObject;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.core.Subject;
|
||||
import org.libreccm.jpa.utils.MimeTypeConverter;
|
||||
|
||||
|
|
@ -45,7 +48,7 @@ import javax.persistence.TemporalType;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "messages", schema = "ccm_core")
|
||||
@Table(name = "messages", schema = DB_SCHEMA)
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ package org.libreccm.messaging;
|
|||
|
||||
import org.libreccm.core.CcmObject;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
@ -33,7 +35,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "threads", schema = "ccm_core")
|
||||
@Table(name = "threads", schema = DB_SCHEMA)
|
||||
public class MessageThread extends CcmObject implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -395123286904985770L;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@
|
|||
package org.libreccm.notification;
|
||||
|
||||
import org.libreccm.core.CcmObject;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.core.Subject;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -46,7 +49,7 @@ import javax.persistence.TemporalType;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "digests", schema = "ccm_core")
|
||||
@Table(name = "digests", schema = DB_SCHEMA)
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@
|
|||
package org.libreccm.notification;
|
||||
|
||||
import org.libreccm.core.CcmObject;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.core.Subject;
|
||||
import org.libreccm.messaging.Message;
|
||||
|
||||
|
|
@ -67,7 +70,7 @@ import javax.persistence.TemporalType;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "notifications", schema = "ccm_core")
|
||||
@Table(name = "notifications", schema = DB_SCHEMA)
|
||||
//Can't reduce complexity yet. Not sure what to do about the God class warning.
|
||||
//Maybe we have to put some of the properties into an extra class.
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.libreccm.notification;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.core.Subject;
|
||||
import org.libreccm.messaging.Message;
|
||||
|
||||
|
|
@ -44,7 +46,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "queue_items", schema = "ccm_core")
|
||||
@Table(name = "queue_items", schema = DB_SCHEMA)
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.libreccm.portal;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.core.Resource;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -35,7 +37,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "portals", schema = "ccm_core")
|
||||
@Table(name = "portals", schema = DB_SCHEMA)
|
||||
public class Portal extends Resource implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5492307663469206053L;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.libreccm.portal;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.core.Resource;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -35,7 +37,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "portlets", schema = "ccm_core")
|
||||
@Table(name = "portlets", schema = DB_SCHEMA)
|
||||
public class Portlet extends Resource implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5718126018588744104L;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.libreccm.runtime;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
|
@ -39,7 +41,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "inits", schema = "ccm_core")
|
||||
@Table(name = "inits", schema = DB_SCHEMA)
|
||||
public class Initalizer implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 9150623897315380159L;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.libreccm.search.lucene;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.core.Subject;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -41,7 +43,7 @@ import javax.persistence.TemporalType;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "lucene_documents", schema = "ccm_core")
|
||||
@Table(name = "lucene_documents", schema = DB_SCHEMA)
|
||||
//Can't reduce complexity yet. Not sure what to do about the God class warning.
|
||||
//Maybe we have to put some of the properties into an extra class.
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.libreccm.search.lucene;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.web.Host;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -37,7 +39,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "lucene_indexes", schema = "ccm_core")
|
||||
@Table(name = "lucene_indexes", schema = DB_SCHEMA)
|
||||
public class Index implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 3197625173477366719L;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,11 @@ package org.libreccm.web;
|
|||
import static org.libreccm.web.WebConstants.*;
|
||||
|
||||
import org.libreccm.categorization.Domain;
|
||||
import org.libreccm.categorization.DomainManager;
|
||||
import org.libreccm.categorization.DomainOwnership;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.core.Resource;
|
||||
import org.libreccm.core.Group;
|
||||
import org.libreccm.jpa.utils.UriConverter;
|
||||
|
|
@ -49,7 +53,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "applications", schema = "ccm_core")
|
||||
@Table(name = "applications", schema = DB_SCHEMA)
|
||||
@XmlRootElement(name = "application", namespace = WEB_XML_NS)
|
||||
public class Application extends Resource implements Serializable {
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.libreccm.web;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
|
@ -39,7 +41,7 @@ import org.libreccm.core.ResourceType;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "application_types", schema = "ccm_core")
|
||||
@Table(name = "application_types", schema = DB_SCHEMA)
|
||||
@SuppressWarnings("PMD.LongVariable")
|
||||
public class ApplicationType extends ResourceType implements Serializable {
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.libreccm.web;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
@ -34,7 +36,7 @@ import javax.persistence.UniqueConstraint;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "hosts", schema = "ccm_core",
|
||||
@Table(name = "hosts", schema = DB_SCHEMA,
|
||||
uniqueConstraints = {
|
||||
@UniqueConstraint(columnNames = {"server_name", "server_port"})})
|
||||
@SuppressWarnings("PMD.ShortClassName") //Host is perfectly fine as class name...
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.libreccm.workflow;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -48,7 +50,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "workflow_tasks", schema = "ccm_core")
|
||||
@Table(name = "workflow_tasks", schema = DB_SCHEMA)
|
||||
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
|
||||
//Can't reduce complexity yet, Task is a fine name
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
|
|
@ -70,7 +72,7 @@ public class Task implements Serializable {
|
|||
@AssociationOverride(
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "workflow_task_labels",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "task_id")}))
|
||||
private LocalizedString label;
|
||||
|
|
@ -79,7 +81,7 @@ public class Task implements Serializable {
|
|||
@AssociationOverride(
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "workflow_tasks_descriptions",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "task_id")}))
|
||||
private LocalizedString description;
|
||||
|
|
@ -99,7 +101,7 @@ public class Task implements Serializable {
|
|||
|
||||
@ManyToMany
|
||||
@JoinTable(name = "workflow_task_dependencies",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "depends_on_task_id")},
|
||||
inverseJoinColumns = {
|
||||
|
|
@ -108,7 +110,7 @@ public class Task implements Serializable {
|
|||
|
||||
@ElementCollection
|
||||
@JoinTable(name = "workflow_task_comments",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "task_id")})
|
||||
@Column(name = "comment")
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.libreccm.workflow;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.core.User;
|
||||
import org.libreccm.core.Group;
|
||||
|
||||
|
|
@ -43,7 +45,7 @@ import javax.persistence.TemporalType;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "workflow_user_tasks", schema = "ccm_core")
|
||||
@Table(name = "workflow_user_tasks", schema = DB_SCHEMA)
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
|
|
@ -77,7 +79,7 @@ public class UserTask extends Task implements Serializable {
|
|||
|
||||
@OneToMany
|
||||
@JoinTable(name = "workflow_user_task_assigned_users",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "user_task_id")},
|
||||
inverseJoinColumns = {
|
||||
|
|
@ -86,7 +88,7 @@ public class UserTask extends Task implements Serializable {
|
|||
|
||||
@OneToMany
|
||||
@JoinTable(name = "workflow_user_task_assigned_groups",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "user_task_id")},
|
||||
inverseJoinColumns = {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.libreccm.workflow;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -43,7 +45,7 @@ import javax.persistence.Table;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "workflows", schema = "ccm_core")
|
||||
@Table(name = "workflows", schema = DB_SCHEMA)
|
||||
public class Workflow implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4322500264543325829L;
|
||||
|
|
@ -57,7 +59,7 @@ public class Workflow implements Serializable {
|
|||
@AssociationOverride(
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "workflow_names",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "workflow_id")}))
|
||||
private LocalizedString name;
|
||||
|
|
@ -66,7 +68,7 @@ public class Workflow implements Serializable {
|
|||
@AssociationOverride(
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "workflow_descriptions",
|
||||
schema = "ccm_core",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "workflow_id")
|
||||
}))
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
create sequence hibernate_sequence start 1 increment 1;
|
||||
|
|
@ -1073,4 +1073,3 @@
|
|||
foreign key (workflow_id)
|
||||
references ccm_core.workflows;
|
||||
|
||||
create sequence hibernate_sequence start 1 increment 1;
|
||||
|
|
@ -17,11 +17,11 @@
|
|||
</parent>
|
||||
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-test-bundle</artifactId>
|
||||
<artifactId>ccm-test-bundle-wildfly8</artifactId>
|
||||
<!--<version>1.0.0-SNAPSHOT</version>-->
|
||||
<packaging>war</packaging>
|
||||
|
||||
<name>LibreCCM Test Bundle</name>
|
||||
<name>LibreCCM Test Bundle Wildfly8</name>
|
||||
<url>http://www.libreccm.org/test-bundle</url>
|
||||
|
||||
<dependencies>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
--------------
|
||||
Overview
|
||||
--------------
|
||||
Jens Pelzetter
|
||||
--------------
|
||||
2015-06-29
|
||||
--------------
|
||||
|
||||
LibreCCM Test Bundle for Wildfly 8
|
||||
|
||||
This bundle/WAR module is used to test the module system of LibreCCM with
|
||||
Wildfly 8.
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project xmlns="http://maven.apache.org/DECORATION/1.3.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.3.0
|
||||
http://maven.apache.org/xsd/decoration-1.3.0.xsd">
|
||||
|
||||
<body>
|
||||
<menu name="Parent project">
|
||||
<item name="LibreCCM" href="../index.html"/>
|
||||
</menu>
|
||||
|
||||
<menu ref="reports"/>
|
||||
</body>
|
||||
</project>
|
||||
|
|
@ -35,7 +35,6 @@ import static org.hamcrest.CoreMatchers.*;
|
|||
import org.jboss.arquillian.container.test.api.Deployment;
|
||||
import org.jboss.arquillian.junit.Arquillian;
|
||||
import org.jboss.arquillian.persistence.CleanupUsingScript;
|
||||
import org.jboss.arquillian.persistence.CreateSchema;
|
||||
import org.jboss.arquillian.persistence.PersistenceTest;
|
||||
import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
|
||||
import org.jboss.arquillian.transaction.api.annotation.Transactional;
|
||||
|
|
@ -55,9 +54,12 @@ import org.junit.Test;
|
|||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.libreccm.core.CcmCore;
|
||||
import org.libreccm.core.User;
|
||||
import org.libreccm.core.modules.ModuleStatus;
|
||||
import org.libreccm.tests.categories.IntegrationTest;
|
||||
|
||||
import javax.persistence.TypedQuery;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
|
|
@ -112,7 +114,6 @@ public class CcmModulesTest {
|
|||
.addAsLibraries(libs)
|
||||
.addPackage(IntegrationTest.class.getPackage())
|
||||
.setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))
|
||||
//.addAsWebInfResource("test-persistence.xml", "persistence.xml")
|
||||
.addAsResource("test-persistence.xml", "META-INF/persistence.xml")
|
||||
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
|
||||
}
|
||||
|
|
@ -120,6 +121,8 @@ public class CcmModulesTest {
|
|||
@Test
|
||||
@CleanupUsingScript("clean_schema.sql")
|
||||
public void verifyModules() throws SQLException {
|
||||
|
||||
//Extract JDBC connnection from EntityManager
|
||||
final Object dataSourceObj = entityManager.getEntityManagerFactory()
|
||||
.getProperties().get("javax.persistence.jtaDataSource");
|
||||
assertThat(dataSourceObj, is(instanceOf(DataSource.class)));
|
||||
|
|
@ -128,6 +131,7 @@ public class CcmModulesTest {
|
|||
final Connection connection = dataSource.getConnection();
|
||||
assertThat(connection, is(instanceOf(Connection.class)));
|
||||
|
||||
//Check if the ccm_core.ccm_modules table exists.
|
||||
final ResultSet ccmObjectTable = connection.getMetaData()
|
||||
.getTables(null, "ccm_core", "ccm_objects", null);
|
||||
if (!ccmObjectTable.next()) {
|
||||
|
|
@ -135,6 +139,7 @@ public class CcmModulesTest {
|
|||
+ "Table does not exist?");
|
||||
}
|
||||
|
||||
//Check of the ccm_core.installed_modules exists
|
||||
final ResultSet installedModulesTable = connection.getMetaData()
|
||||
.getTables(null, "ccm_core", "installed_modules", null);
|
||||
if (!installedModulesTable.next()) {
|
||||
|
|
@ -142,6 +147,8 @@ public class CcmModulesTest {
|
|||
+ "Table does not exist?");
|
||||
}
|
||||
|
||||
//Check if the ccm-core module is registered in the
|
||||
//ccm_core.installed_modules table
|
||||
final Statement statement = connection.createStatement();
|
||||
final ResultSet installedModules = statement.executeQuery(
|
||||
"SELECT module_id, module_class_name, status "
|
||||
|
|
@ -161,6 +168,23 @@ public class CcmModulesTest {
|
|||
is(equalTo(CcmCore.class.getName())));
|
||||
assertThat(modulesData.get(0).getStatus(),
|
||||
is(equalTo(ModuleStatus.INSTALLED.toString())));
|
||||
|
||||
//Check if the public user is registed.
|
||||
final TypedQuery<User> userQuery = entityManager.createQuery(
|
||||
"SELECT u FROM User u WHERE u.screenName = 'public-user'",
|
||||
User.class);
|
||||
final List<User> users = userQuery.getResultList();
|
||||
|
||||
assertThat(users.size(), is(1));
|
||||
assertThat(users.get(0).getScreenName(), is(equalTo("public-user")));
|
||||
assertThat(users.get(0).getName(), is(not(nullValue())));
|
||||
assertThat(users.get(0).getName().getFamilyName(), is(equalTo("ccm")));
|
||||
assertThat(users.get(0).getName().getGivenName(),
|
||||
is(equalTo("public user")));
|
||||
assertThat(users.get(0).getEmailAddresses().size(), is(1));
|
||||
assertThat(users.get(0).getEmailAddresses().get(0).getAddress(),
|
||||
is(equalTo("public-user@localhost")));
|
||||
|
||||
}
|
||||
|
||||
private void createInstalledModuleListEntry(
|
||||
|
|
@ -3,4 +3,6 @@
|
|||
|
||||
DROP SCHEMA IF EXISTS ccm_core CASCADE;
|
||||
|
||||
DROP SEQUENCE IF EXISTS hibernate_sequence;
|
||||
DROP SEQUENCE IF EXISTS hibernate_sequence;
|
||||
|
||||
DROP TABLE IF EXISTS schema_version;
|
||||
6
pom.xml
6
pom.xml
|
|
@ -39,8 +39,8 @@
|
|||
<module>ccm-shortcuts</module>
|
||||
<module>ccm-testutils</module>
|
||||
<module>ccm-docrepo</module>
|
||||
<module>ccm-test-bundle</module>
|
||||
</modules>
|
||||
<module>ccm-test-bundle-wildfly8</module>
|
||||
</modules>
|
||||
|
||||
<!--<repositories>
|
||||
<repository>
|
||||
|
|
@ -153,7 +153,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-pmd-plugin</artifactId>
|
||||
<version>3.4</version>
|
||||
<version>3.5</version>
|
||||
<configuration>
|
||||
<linkXref>true</linkXref>
|
||||
<sourceEncoding>utf-8</sourceEncoding>
|
||||
|
|
|
|||
Loading…
Reference in New Issue