Mercurial > hg > ismi-richfaces
comparison src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentAliasBean.java @ 125:eee2e0ca4032
updated entry beans to use EditIntents.
author | casties |
---|---|
date | Tue, 31 Jan 2017 18:09:54 +0100 |
parents | 28a0c2726466 |
children |
comparison
equal
deleted
inserted
replaced
124:28a0c2726466 | 125:eee2e0ca4032 |
---|---|
3 import java.io.Serializable; | 3 import java.io.Serializable; |
4 | 4 |
5 import org.apache.log4j.Logger; | 5 import org.apache.log4j.Logger; |
6 import org.mpi.openmind.repository.bo.Entity; | 6 import org.mpi.openmind.repository.bo.Entity; |
7 import org.mpi.openmind.repository.bo.Node; | 7 import org.mpi.openmind.repository.bo.Node; |
8 import org.mpi.openmind.repository.services.utils.EditIntent; | |
8 | 9 |
9 | 10 |
10 public class CurrentAliasBean extends AbstractISMIBean implements Serializable{ | 11 public class CurrentAliasBean extends AbstractISMIBean implements Serializable{ |
11 private static final long serialVersionUID = 3420778447263527153L; | 12 private static final long serialVersionUID = 3420778447263527153L; |
12 | 13 |
13 private static Logger logger = Logger.getLogger(CurrentAliasBean.class); | 14 private static Logger logger = Logger.getLogger(CurrentAliasBean.class); |
15 | |
16 /** intent to edit all attributes and relations in the form */ | |
17 public static EditIntent editAliasIntent = new EditIntent( | |
18 AbstractISMIBean.ALIAS, | |
19 // attributes | |
20 new String[]{"alias", "alias_translit"}, | |
21 // source relations | |
22 new String[]{}, | |
23 // target relations | |
24 new String[]{}); | |
14 | 25 |
15 public CurrentAliasBean(){ | 26 public CurrentAliasBean(){ |
16 this.entity = new Entity(Node.TYPE_ABOX, ALIAS, false); | 27 this.entity = new Entity(Node.TYPE_ABOX, ALIAS, false); |
17 setDefObjectClass(ALIAS); | 28 setDefObjectClass(ALIAS); |
18 } | 29 } |
29 @Override | 40 @Override |
30 public String save(){ | 41 public String save(){ |
31 super.save(); | 42 super.save(); |
32 try { | 43 try { |
33 this.entity = updateEntityAttributes(this.entity); | 44 this.entity = updateEntityAttributes(this.entity); |
34 this.entity = getWrapper().saveEntity(this.entity, getSessionUser().getEmail(), null); | 45 this.entity = getWrapper().saveEntity(this.entity, getSessionUser().getEmail(), editAliasIntent); |
35 getAppBean().getSimpleSearchCache().setMapDirty(true); | 46 getAppBean().getSimpleSearchCache().setMapDirty(true); |
36 | 47 |
37 logger.info("Entity saved - Time = " + (System.currentTimeMillis() - start) + ", " + entity); | 48 logger.info("Entity saved - Time = " + (System.currentTimeMillis() - start) + ", " + entity); |
38 this.printSuccessSavingEntity(); | 49 this.printSuccessSavingEntity(); |
39 | 50 |
40 } catch (Exception e) { | 51 } catch (Exception e) { |
41 logger.error(e.getMessage(), e); | 52 logger.error(e.getMessage(), e); |
42 e.printStackTrace(); | |
43 this.printInternalError(e); | 53 this.printInternalError(e); |
44 } | 54 } |
45 saveEnd(); | 55 saveEnd(); |
46 return PAGE_EDITOR; | 56 return PAGE_EDITOR; |
47 } | 57 } |