diff src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentTextBean.java @ 124:28a0c2726466

changed saveEntity() to use new EditIntent. Set up EditIntent for TEXT, PERSON, REFERENCE.
author casties
date Mon, 30 Jan 2017 20:35:36 +0100
parents ca36b24a22f7
children 8ae989269f51
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentTextBean.java	Thu Jan 26 19:35:49 2017 +0100
+++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentTextBean.java	Mon Jan 30 20:35:36 2017 +0100
@@ -17,6 +17,7 @@
 import org.mpi.openmind.repository.bo.Entity;
 import org.mpi.openmind.repository.bo.Node;
 import org.mpi.openmind.repository.bo.Relation;
+import org.mpi.openmind.repository.services.utils.EditIntent;
 import org.mpi.openmind.repository.utils.NormalizerUtils;
 import org.mpi.openmind.repository.utils.RomanizationLoC;
 import org.mpi.openmind.repository.utils.TransliterationUtil;
@@ -107,6 +108,19 @@
 
 	private transient MisattributionTable misattTable;
 	
+	/** intent to edit all attributes and relations in the form */
+	public static EditIntent editTextIntent = new EditIntent(
+			TEXT,
+			// attributes
+			new String[]{"full_title", "full_title_translit", "incipit", "excplicit", "dedication", "language", 
+					"notes", "notes_old", "table_of_contents", "text_arrangement", "text_type", "creation_date"},
+			// source relations
+			new String[]{"has_subject", "was_created_by", "has_author_misattribution", "was_created_in", "was_created_in_as",
+					"was_dedicated_to", "is_commentary_on", "is_translation_of", "is_version_of"},
+			// target relations
+			new String[]{"is_prime_alias_title_of", "is_alias_title_of", "is_alias_incipit_of", "is_alias_explicit_of",
+					"is_reference_of", "is_exemplar_of"});
+	
 	public CurrentTextBean() {
 		this.reset();
 	}
@@ -569,12 +583,12 @@
 					//1)create  alias, 2) update value of alias3) save alias, and 4) add to this text.
 					shortTitleAlias = new Entity(Node.TYPE_ABOX, ALIAS, false);
 					shortTitleAlias.addAttribute(new Attribute("alias", "text", this.valueShortTitle));
-					getWrapper().saveEntity(shortTitleAlias, getUserName());					
+					getWrapper().saveEntity(shortTitleAlias, getUserName(), null);					
 				} else {
 					//1) update value, 2) re-save alias
 					this.shortTitleAlias.getAttributeByName("alias").setOwnValue(this.valueShortTitle);
 					this.shortTitleAlias.removeAllSourceRelations("is_prime_alias_title_of", TEXT);
-					getWrapper().saveEntity(shortTitleAlias, getUserName());
+					getWrapper().saveEntity(shortTitleAlias, getUserName(), null);
 				}
 				new Relation(shortTitleAlias, this.entity, "is_prime_alias_title_of");
 			}
@@ -617,7 +631,7 @@
 			/*
 			 * save entity
 			 */
-			this.entity = getWrapper().saveEntity(this.entity, user.getEmail());
+			this.entity = getWrapper().saveEntity(this.entity, user.getEmail(), CurrentTextBean.editTextIntent);
 			this.getAppBean().setAllTextsAsDirty();
 			getAppBean().getSimpleSearchCache().setMapDirty(true);