Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package it.inaf.oats.ia2.tapschemamanager.webapp;
import it.inaf.oats.ia2.tapschemamanager.businesslayer.TapSchema;
import java.io.Serializable;
import javax.annotation.PostConstruct;
import javax.enterprise.context.Conversation;
import javax.enterprise.context.ConversationScoped;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named;
import javax.servlet.ServletContext;
/**
*
* @author Sonia Zorba <zorba at oats.inaf.it>
*/
@Named("tapSchemaEditing")
@ConversationScoped
public class TapSchemaEditingBean implements Serializable {
@Inject
private Conversation conversation;
@Inject
SchemaSelectionBean schemaSelection;
private TapSchema tapSchema;
private EditTapSchemaPageModel previousModel;
private SearchUCDDialog searchUCDDialog;
@PostConstruct
public void init() {
searchUCDDialog = new SearchUCDDialog();
}
public TapSchema getTapSchema() {
return tapSchema;
}
public void setTapSchema(TapSchema tapSchema) {
this.tapSchema = tapSchema;
previousModel = new EditTapSchemaPageModel(tapSchema);
}
public void setPreviousModel(EditTapSchemaPageModel pageModel) {
this.previousModel = pageModel;
}
public EditTapSchemaPageModel getPreviousModel() {
return previousModel;
}
public SearchUCDDialog getSearchUCDDialog() {
return searchUCDDialog;
}
public String getConversationId() {
return conversation.getId();
}
public String getRESTPath() {
ServletContext ctx = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();
return ctx.getContextPath() + "/rest/tapschema/";
}
public String back() {
return "schemaSelection.xhtml?faces-redirect=true";
}
public String logout() {
conversation.end();
return "index.xhtml?faces-redirect=true";
}
}