diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/beans/VClass.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/beans/VClass.java index 128161cb5..2a6b0844b 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/beans/VClass.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/beans/VClass.java @@ -137,26 +137,32 @@ public class VClass extends BaseResourceBean implements Comparable /** * Constructs the VClass as a deep copy of an existing VClass. */ - public VClass( VClass vc) { - this.URI = vc.URI; - this.namespace = vc.namespace; - this.localName = vc.localName; - this.myName = vc.myName; - this.myExample = vc.myExample; - this.myDescription = vc.myDescription; - this.myShortDefinition = vc.myShortDefinition; - this.myEntityCount = vc.myEntityCount; - this.displayLimit = vc.displayLimit; - this.displayRank = vc.displayRank; - this.quickEditJsp = vc.quickEditJsp; - this.groupURI = vc.groupURI; - this.group = (vc.group == null) ? null : new VClassGroup(vc.group); - this.customEntryForm = vc.customEntryForm; - this.customDisplayView = vc.customDisplayView; - this.customShortView = vc.customShortView; - this.customSearchView = vc.customSearchView; + public VClass copy() { + VClass that = new VClass(); + copyFields(that); + return that; } + protected void copyFields(VClass that) { + that.myName = this.myName; + that.namespace = this.namespace; + that.localName = this.localName; + that.URI = this.URI; + that.myExample = this.myExample; + that.myDescription = this.myDescription; + that.myShortDefinition = this.myShortDefinition; + that.myEntityCount = this.myEntityCount; + that.displayLimit = this.displayLimit; + that.displayRank = this.displayRank; + that.quickEditJsp = this.quickEditJsp; + that.groupURI = this.groupURI; + that.group = this.group; + that.customEntryForm = this.customEntryForm; + that.customDisplayView = this.customDisplayView; + that.customShortView = this.customShortView; + that.customSearchView = this.customSearchView; + } + /** * Sorts alphabetically by name */ diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/VClassGroupsForRequest.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/VClassGroupsForRequest.java index 753e695e0..20484b00b 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/VClassGroupsForRequest.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/VClassGroupsForRequest.java @@ -37,8 +37,8 @@ public class VClassGroupsForRequest { } if (log.isDebugEnabled()) { - log.debug("groups: " + groupMap); - log.debug("classes: " + classMap); + log.debug("groups: " + groupMap.values()); + log.debug("classes: " + classMap.values()); } } @@ -59,7 +59,7 @@ public class VClassGroupsForRequest { } private void loadClass(VClass vc, VClassGroup newVcg) { - VClass newVc = new VClass(vc); + VClass newVc = vc.copy(); newVc.setName(getNameForVClass(vc)); newVc.setGroup(newVcg); newVcg.add(newVc); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/VClassJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/VClassJena.java index cd62ab469..5f6b9aee3 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/VClassJena.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/VClassJena.java @@ -47,6 +47,16 @@ public class VClassJena extends VClass { this.webappDaoFactory = wadf; } + /** + * Constructs the VClassJena as a deep copy of an existing VClassJena. + */ + @Override + public VClassJena copy() { + VClassJena that = new VClassJena(this.cls, this.webappDaoFactory); + copyFields(that); + return that; + } + /** * What this VClass is called */