* Fixed ContentSectionSetup (now sets UUIDs for Workflow and LifecycleDefinition)
* Added UUID to Lifecycle and LifecycleDefinition * All setUuid method are now public
parent
5476f3bcc2
commit
6a60575b75
|
|
@ -268,9 +268,11 @@ public class ContentSectionSetup extends AbstractCcmApplicationSetup {
|
|||
section.addRole(contentReader);
|
||||
|
||||
final LifecycleDefinition lifecycleDefinition = new LifecycleDefinition();
|
||||
lifecycleDefinition.setUuid(UUID.randomUUID().toString());
|
||||
lifecycleDefinition.getLabel().addValue(Locale.ENGLISH, "Standard");
|
||||
|
||||
final Workflow workflow = new Workflow();
|
||||
workflow.setUuid(UUID.randomUUID().toString());
|
||||
workflow.setAbstractWorkflow(true);
|
||||
workflow.getName().addValue(Locale.ENGLISH, "Standard");
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@
|
|||
*/
|
||||
package org.librecms.lifecycle;
|
||||
|
||||
import org.hibernate.search.annotations.Field;
|
||||
import org.libreccm.core.Identifiable;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
|
@ -36,6 +39,8 @@ import javax.persistence.OneToOne;
|
|||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
|
||||
import static org.librecms.CmsConstants.*;
|
||||
|
||||
|
|
@ -45,7 +50,7 @@ import static org.librecms.CmsConstants.*;
|
|||
*/
|
||||
@Entity
|
||||
@Table(name = "LIFECYCLES", schema = DB_SCHEMA)
|
||||
public class Lifecycle implements Serializable {
|
||||
public class Lifecycle implements Identifiable, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 184357562249530038L;
|
||||
|
||||
|
|
@ -54,6 +59,15 @@ public class Lifecycle implements Serializable {
|
|||
@Column(name = "LIFECYCLE_ID")
|
||||
private long lifecycleId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Column(name = "UUID", unique = true)
|
||||
@NotNull
|
||||
@Field
|
||||
@XmlElement(name = "uuid")
|
||||
private String uuid;
|
||||
|
||||
@Column(name = "START_DATE_TIME")
|
||||
@Temporal(TemporalType.DATE)
|
||||
private Date startDateTime;
|
||||
|
|
@ -90,6 +104,15 @@ public class Lifecycle implements Serializable {
|
|||
this.lifecycleId = lifecycleId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public Date getStartDateTime() {
|
||||
return new Date(startDateTime.getTime());
|
||||
}
|
||||
|
|
@ -232,4 +255,5 @@ public class Lifecycle implements Serializable {
|
|||
Objects.toString(definition),
|
||||
data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.librecms.lifecycle;
|
||||
|
||||
import org.hibernate.search.annotations.Field;
|
||||
import org.libreccm.core.Identifiable;
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -37,6 +39,8 @@ import javax.persistence.JoinColumn;
|
|||
import javax.persistence.JoinTable;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
|
||||
import static org.librecms.CmsConstants.*;
|
||||
|
||||
|
|
@ -46,7 +50,7 @@ import static org.librecms.CmsConstants.*;
|
|||
*/
|
||||
@Entity
|
||||
@Table(name = "LIFECYLE_DEFINITIONS", schema = DB_SCHEMA)
|
||||
public class LifecycleDefinition implements Serializable {
|
||||
public class LifecycleDefinition implements Identifiable, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1291162870555527717L;
|
||||
|
||||
|
|
@ -55,6 +59,12 @@ public class LifecycleDefinition implements Serializable {
|
|||
@Column(name = "LIFECYCLE_DEFINITION_ID")
|
||||
private long definitionId;
|
||||
|
||||
@Column(name = "UUID", unique = true)
|
||||
@NotNull
|
||||
@Field
|
||||
@XmlElement(name = "uuid")
|
||||
private String uuid;
|
||||
|
||||
@Embedded
|
||||
@AssociationOverride(
|
||||
name = "values",
|
||||
|
|
@ -96,6 +106,15 @@ public class LifecycleDefinition implements Serializable {
|
|||
this.definitionId = definitionId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public LocalizedString getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ package org.librecms.lifecycle;
|
|||
|
||||
import org.libreccm.core.AbstractEntityRepository;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
|
||||
/**
|
||||
|
|
@ -52,4 +54,12 @@ public class LifecycleDefinitionRepository
|
|||
return lifecycleDefinition.getDefinitionId() == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initNewEntity(final LifecycleDefinition entity) {
|
||||
super.initNewEntity(entity);
|
||||
entity.setUuid(UUID.randomUUID().toString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ package org.librecms.lifecycle;
|
|||
|
||||
import org.libreccm.core.AbstractEntityRepository;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
|
||||
/**
|
||||
|
|
@ -30,6 +32,8 @@ import javax.enterprise.context.RequestScoped;
|
|||
public class LifecycleRepository
|
||||
extends AbstractEntityRepository<Long, Lifecycle> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public Class<Lifecycle> getEntityClass() {
|
||||
return Lifecycle.class;
|
||||
|
|
@ -50,4 +54,10 @@ public class LifecycleRepository
|
|||
return lifecycle.getLifecycleId() == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initNewEntity(final Lifecycle entity) {
|
||||
super.initNewEntity(entity);
|
||||
entity.setUuid(UUID.randomUUID().toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ public class Categorization implements Serializable, Relation, Exportable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ public class DomainOwnership implements Serializable, Exportable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public class ResourceType implements Serializable, Exportable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ public class ComponentModel implements Serializable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ public class ContainerModel implements Serializable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ public class PageModel implements Serializable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ public class GroupMembership implements Serializable, Exportable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ public class Party implements Serializable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ public class Permission implements Serializable, Exportable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ public class Role implements Serializable, Exportable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ public class RoleMembership implements Serializable, Exportable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ public class Theme implements Serializable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public class ThemeFile implements Serializable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ public class Task implements Identifiable, Serializable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ public class TaskAssignment implements Serializable, Exportable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ public class TaskComment implements Identifiable, Serializable, Exportable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public class TaskDependency implements Serializable, Exportable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ public class Workflow implements Identifiable, Serializable, Exportable {
|
|||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
public void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue