Skip to content

Commit

Permalink
Fix metadata storage and lifecycle stage on copy.
Browse files Browse the repository at this point in the history
  • Loading branch information
dewarim committed Jun 28, 2016
1 parent 05f63c1 commit 44a8697
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CinnamonDbGrailsPlugin.groovy
Expand Up @@ -2,7 +2,7 @@ import cinnamon.Session

class CinnamonDbGrailsPlugin {

def version = "3.6.38"
def version = "3.6.41"
def grailsVersion = "2.4 > *"
def dependsOn = [:]
def pluginExcludes = [
Expand Down
4 changes: 1 addition & 3 deletions grails-app/domain/cinnamon/Folder.groovy
Expand Up @@ -78,10 +78,8 @@ class Folder implements Ownable, Indexable, XmlConvertable, Serializable, IMetas
acl = that.acl;
}

// TODO: determine which constructors are really needed.
public Folder(String name, String metadata, Acl acl, Folder parent, UserAccount owner, FolderType type) {
public Folder(String name, Acl acl, Folder parent, UserAccount owner, FolderType type) {
this.name = name;
storeMetadata(metadata);
this.acl = acl;
this.parent = parent;
this.owner = owner;
Expand Down
16 changes: 9 additions & 7 deletions grails-app/domain/cinnamon/ObjectSystemData.groovy
Expand Up @@ -178,7 +178,7 @@ class ObjectSystemData implements Serializable, Ownable, Indexable, XmlConvertab
if (cmd.containsKey('summary')) {
summary = cmd.get('summary')
}

/*
* Set ObjectType:
* 1. by objtype_id
Expand Down Expand Up @@ -299,10 +299,10 @@ class ObjectSystemData implements Serializable, Ownable, Indexable, XmlConvertab
public ObjectSystemData(ObjectSystemData that, UserAccount user) {
acl = that.getAcl();
appName = that.getAppName();
created = Calendar.getInstance().getTime();
created = Calendar.instance.time
creator = user;
owner = user;
modified = Calendar.getInstance().getTime();
modified = Calendar.instance.time
modifier = user;
// format = that.getFormat();
language = that.getLanguage();
Expand All @@ -317,7 +317,8 @@ class ObjectSystemData implements Serializable, Ownable, Indexable, XmlConvertab
cmnVersion = "0";

if (that.getState() != null) {
state = that.getState().getLifeCycleStateForCopy();
state = that.state.lifeCycleStateForCopy
state.enterState(this, state)
}
}

Expand Down Expand Up @@ -468,6 +469,7 @@ class ObjectSystemData implements Serializable, Ownable, Indexable, XmlConvertab
public Element convert2domElement() {
return convert2domElement(false)
}

public Element convert2domElement(Boolean includeSummary) {
Element data = DocumentHelper.createElement("object");
data.addElement("id").addText(String.valueOf(getId()));
Expand Down Expand Up @@ -769,7 +771,7 @@ class ObjectSystemData implements Serializable, Ownable, Indexable, XmlConvertab
if (type != that.type) return false
if (cmnVersion != that.cmnVersion) return false
if (summary != that.summary) return false

return true
}

Expand All @@ -796,10 +798,10 @@ class ObjectSystemData implements Serializable, Ownable, Indexable, XmlConvertab
[root: this.root])
}

def Set<OsdMetaset> getMetasets(){
def Set<OsdMetaset> getMetasets() {
OsdMetaset.findAllByOsd(this)
}

/**
* @return the compiled metadata of this element (all metasets collected under one meta root element).
*/
Expand Down

0 comments on commit 44a8697

Please sign in to comment.