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;
|
|
8
|
|
9
|
|
10 public class CurrentAliasBean extends AbstractISMIBean implements Serializable{
|
|
11 private static final long serialVersionUID = 3420778447263527153L;
|
|
12
|
|
13 private static Logger logger = Logger.getLogger(CurrentAliasBean.class);
|
|
14
|
|
15 public CurrentAliasBean(){
|
|
16 this.entity = new Entity(Node.TYPE_ABOX, ALIAS, false);
|
|
17 setDefObjectClass(ALIAS);
|
|
18 }
|
|
19
|
|
20 @Override
|
|
21 public void setEntity(Entity alias) {
|
|
22 this.entity = alias;
|
|
23 if(this.entity.isLightweight()){
|
|
24 this.entity = getWrapper().getEntityContent(this.entity);
|
|
25 }
|
|
26 this.loadAttributes(this.entity);
|
|
27 }
|
|
28
|
|
29 @Override
|
|
30 public String save(){
|
|
31 super.save();
|
|
32 try {
|
|
33 this.entity = updateEntityAttributes(this.entity);
|
|
34 this.entity = getWrapper().saveEntity(this.entity, getSessionUser().getEmail());
|
|
35 getAppBean().getSimpleSearchCache().setMapDirty(true);
|
|
36
|
|
37 logger.info("Entity saved - Time = " + (System.currentTimeMillis() - start) + ", " + entity);
|
|
38 this.printSuccessSavingEntity();
|
|
39
|
|
40 } catch (Exception e) {
|
|
41 logger.error(e.getMessage(), e);
|
|
42 e.printStackTrace();
|
|
43 this.printInternalError(e);
|
|
44 }
|
|
45 saveEnd();
|
|
46 return PAGE_EDITOR;
|
|
47 }
|
|
48 }
|