1
|
1 package de.mpiwg.itgroup.ismi.entry.beans;
|
|
2
|
|
3 import java.io.Serializable;
|
|
4
|
|
5 import org.apache.log4j.Logger;
|
|
6 import org.mpi.openmind.repository.bo.Entity;
|
|
7 import org.mpi.openmind.repository.bo.Node;
|
125
|
8 import org.mpi.openmind.repository.services.utils.EditIntent;
|
1
|
9
|
|
10
|
|
11 public class CurrentAliasBean extends AbstractISMIBean implements Serializable{
|
|
12 private static final long serialVersionUID = 3420778447263527153L;
|
|
13
|
|
14 private static Logger logger = Logger.getLogger(CurrentAliasBean.class);
|
|
15
|
125
|
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[]{});
|
|
25
|
1
|
26 public CurrentAliasBean(){
|
|
27 this.entity = new Entity(Node.TYPE_ABOX, ALIAS, false);
|
|
28 setDefObjectClass(ALIAS);
|
|
29 }
|
|
30
|
|
31 @Override
|
|
32 public void setEntity(Entity alias) {
|
|
33 this.entity = alias;
|
|
34 if(this.entity.isLightweight()){
|
|
35 this.entity = getWrapper().getEntityContent(this.entity);
|
|
36 }
|
|
37 this.loadAttributes(this.entity);
|
|
38 }
|
|
39
|
|
40 @Override
|
|
41 public String save(){
|
|
42 super.save();
|
|
43 try {
|
|
44 this.entity = updateEntityAttributes(this.entity);
|
125
|
45 this.entity = getWrapper().saveEntity(this.entity, getSessionUser().getEmail(), editAliasIntent);
|
1
|
46 getAppBean().getSimpleSearchCache().setMapDirty(true);
|
|
47
|
|
48 logger.info("Entity saved - Time = " + (System.currentTimeMillis() - start) + ", " + entity);
|
|
49 this.printSuccessSavingEntity();
|
|
50
|
|
51 } catch (Exception e) {
|
|
52 logger.error(e.getMessage(), e);
|
|
53 this.printInternalError(e);
|
|
54 }
|
|
55 saveEnd();
|
|
56 return PAGE_EDITOR;
|
|
57 }
|
|
58 }
|