4A Server -  2.0
 All Classes Namespaces Files Functions Variables Enumerator
DrupAuthServerMain.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: DrupAuthServerMain.java
5  * Description: Backbean for page with administration of drupal authorization servers
6  */
7 
8 /**
9  * @file DrupAuthServerMain.java
10  *
11  * @brief Backbean for page with administration of drupal authorization 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 drupal authorization servers
26  *
27  * @brief Backbean for page with administration of drupal authorization servers
28  * @author Martin Petr (xpetrm05)
29  */
30 @ManagedBean
31 @SessionScoped
32 public class DrupAuthServerMain implements Serializable {
33 /**
34  * Table with drupal authorization servers
35  */
36  private HtmlDataTable listTable;
37  /**
38  * Drupal authorization server from table
39  */
41 
42  /**
43  * Constructor
44  */
45  public DrupAuthServerMain() {
46  }
47 
48  /**
49  * Gets table with drupal authorization servers
50  *
51  * @return Returns table with drupal authorization servers
52  */
53  public HtmlDataTable getListTable() {
54  return listTable;
55  }
56 
57  /**
58  * Sets table with drupal authorization servers
59  *
60  * @param listTable Table with drupal authorization servers
61  */
62  public void setListTable(HtmlDataTable listTable) {
63  this.listTable = listTable;
64  }
65 
66  /**
67  * Gets actual drupal authorization server
68  *
69  * @return Actual drupal authorization server
70  */
72  return actualServer;
73  }
74 
75  /**
76  * Sets actual drupal authorization server
77  *
78  * @param actualServer Actual drupal authorization server
79  */
81  this.actualServer = actualServer;
82  }
83 
84  /**
85  * Gets list of all existing drupal authorization servers
86  *
87  * @return Returns list of all existing drupal authorization servers
88  */
89  public List<DrupAuthServer> getServers(){
90  @SuppressWarnings("unchecked")
91  List<DrupAuthServer> retList = AppBean.getPersistenceManager().getEntitiesByName("DrupAuthServer");
92 
93  return retList;
94  }
95 
96  /**
97  * Action listener for edit drupal authorization 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 = (DrupAuthServer) listTable.getRowData();
104  // set actual server through the session
105  SessionManager.getSession().setActualDrupAuthServer(actualServer);
106  return "editDrupAuthServer";
107  }
108 
109  /**
110  * Action listener for delete drupal authorization 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 = (DrupAuthServer) listTable.getRowData();
117  // set actual server through the session
118  SessionManager.getSession().setActualDrupAuthServer(actualServer);
119  return "deleteDrupAuthServer";
120  }
121 }
Backbean for page with administration of drupal authorization servers.
Singleton for storing global variables.
Definition: AppBean.java:47
Class representing approved drupal authentization server.