4A Server -  2.0
 All Classes Namespaces Files Functions Variables Enumerator
CloneServerMain.java
Go to the documentation of this file.
1 /*
2  * Project: Server for annotations sharing
3  * Author: Ing. Jaroslav Dytrych idytrych@fit.vutbr.cz
4  * File: CloneServerMain.java
5  * Description: Backbean for page with administration of document cloner approved servers
6  */
7 
8 /**
9  * @file CloneServerMain.java
10  *
11  * @brief Backbean for page with administration of document cloner approved servers
12  */
13 
14 package cz.vutbr.fit.knot.annotations.web;
15 
18 import java.io.Serializable;
19 import java.util.List;
20 import javax.faces.bean.ManagedBean;
21 import javax.faces.bean.SessionScoped;
22 import javax.faces.component.html.HtmlDataTable;
23 
24 /**
25  * Backbean for page with administration of document cloner approved servers
26  *
27  * @brief Backbean for page with administration of document cloner approved servers
28  * @author Martin Petr (xpetrm05)
29  */
30 @ManagedBean
31 @SessionScoped
32 public class CloneServerMain implements Serializable {
33  /**
34  * Table with servers
35  */
36  private HtmlDataTable listTable;
37  /**
38  * Document cloner approved server from table
39  */
41 
42  /**
43  * Constructor
44  */
45  public CloneServerMain() {
46  }
47 
48  /**
49  * Gets table with document cloner authorization servers
50  *
51  * @return Returns table with document cloner authorization servers
52  */
53  public HtmlDataTable getListTable() {
54  return listTable;
55  }
56 
57  /**
58  * Sets table with document cloner authorization servers
59  *
60  * @param listTable Table with document cloner authorization servers
61  */
62  public void setListTable(HtmlDataTable listTable) {
63  this.listTable = listTable;
64  }
65 
66  /**
67  * Gets actual document cloner authorization server
68  *
69  * @return Actual document cloner authorization server
70  */
72  return actualServer;
73  }
74 
75  /**
76  * Sets actual document cloner authorization server
77  *
78  * @param actualServer Actual document cloner authorization server
79  */
81  this.actualServer = actualServer;
82  }
83 
84  /**
85  * Gets list of all existing document cloner servers
86  *
87  * @return Returns list of all document cloner servers
88  */
89  public List<DocClonerServer> getServers(){
90  @SuppressWarnings("unchecked")
91  List<DocClonerServer> retList = AppBean.getPersistenceManager().getEntitiesByName("DocClonerServer");
92 
93  return retList;
94  }
95 
96  /**
97  * Action listener for edit document cloner server in table
98  *
99  * @return Returns page outcome to go to editing page
100  */
101  public String actionEdit(){
102  // get selected row from table
103  actualServer = (DocClonerServer) listTable.getRowData();
104  // set actual server through the session
105  SessionManager.getSession().setActualClonerServer(actualServer);
106  return "editCloneServer";
107  }
108 
109  /**
110  * Action listener for delete document cloner server in table
111  *
112  * @return Returns page outcome to go to deleting page
113  */
114  public String actionDelete(){
115  // get selected row from table
116  actualServer = (DocClonerServer) listTable.getRowData();
117  // set actual server through the session
118  SessionManager.getSession().setActualClonerServer(actualServer);
119  return "deleteCloneServer";
120  }
121 }
Singleton for storing global variables.
Definition: AppBean.java:47
Backbean for page with administration of document cloner approved servers.
void setActualServer(DocClonerServer actualServer)
Class representing approved document clone server.