GWTApplication.client
Class ManageSystem

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by GWTApplication.client.FaultDBForm
                  extended by GWTApplication.client.ManageSystem
All Implemented Interfaces:
com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.ClickListener

 class ManageSystem
extends FaultDBForm
implements com.google.gwt.user.client.ui.ClickListener

This class will be used to add to a tab panel, a form which may be used by a privileged use it to administer the fault management system. It will allow the user to Update for example the list of uses of the system, reset passwords and add new components into the list which represents data within the systems.

The user in order to perform this role, must authenticate himself against the system before any changes that he makes will be accepted by the system.

Version:
$Id: ManageSystem.java,v 1.7 2008/01/15 11:08:15 cb Exp $
Author:
Craige Bevil

Nested Class Summary
(package private)  class ManageSystem.InterfaceInputField
          This will be used for collating together all of the information associated with an input field in the form
 
Field Summary
private  com.google.gwt.user.client.ui.Button CreateNewUserButton
          This is the button which will be pressed to generate a new user
(package private) static int DUTYTECHNICIANIDX
           
(package private) static int INSTRUMENTIDX
           
(package private)  ManageSystem.InterfaceInputField[] InterfaceInputFields
           
private  com.google.gwt.user.client.ui.TextBox MailAddressOfNewUser
          This is the text box which the user will use to enter the email address of the new user to the system
private  com.google.gwt.user.client.ui.HorizontalPanel mainPanel
          This is the main panel into which we pack up all of the Widgets which comprise this form.
private  com.google.gwt.user.client.ui.TextBox NameOfNewUser
          This is the text box which the user will use to enter the name of the new user to the system
private  com.google.gwt.user.client.ui.PasswordTextBox PasswordConfirmField
          This is the field into which the user will use to confirm the password
private  com.google.gwt.user.client.ui.PasswordTextBox PasswordField
          This is the field into which the user will enter the details of the new password for a user
private  com.google.gwt.user.client.ui.Button ResetPasswordButton
          This is the button which is to be used for resetting the password of a user
(package private) static int SUPPORTASTRONOMERIDX
           
private  com.google.gwt.user.client.ui.TextBox SurnameOfNewUser
          This is the text box which the user will use to enter the surname of the new user to the system
(package private) static int SYSTEMIDX
           
(package private) static int TELESCOPEOPERATORIDX
           
private  com.google.gwt.user.client.ui.ListBox UserToChangePwdList
          This is the list of users from which the user can select the name of the person who he wants to change the password for.
 
Fields inherited from class GWTApplication.client.FaultDBForm
busyIndicator, internationalizationConstants, NOLENGTHCHECK, PrinterList, svc, UserAuthentication
 
Constructor Summary
ManageSystem(com.google.gwt.user.client.ui.TabPanel MainTabPanel, FaultServiceAsync svc, AuthenticationDetails UserAuthentication)
          This is used to create the panel which will be used by the manager of the system to manage the data
 
Method Summary
private  void addNewInstrumentToSystem()
          Creates a new instrument in the system after first ensuring that the user has filled in the field correctly.
private  void addNewSystemToSystem()
          Creates a new system in the system after first ensuring that the user has filled in the field correctly.
private  void createNewRoleForUser(int WidgetIndex, java.lang.Integer Role, java.lang.String RoleDescription)
          Creates a new role for a user.
private  void createNewUser()
          This will add a new user to the system.
 void onClick(com.google.gwt.user.client.ui.Widget sender)
          Called when the user presses one of the buttons on the interface and requests the business associated with that button to be performed.
private  void resetPasswordForUser()
          This is a callback which is attached to the reset password button which will permit the manager to reset the password of a user
private  void setupDropDownList(java.lang.Integer GroupToExclude, com.google.gwt.user.client.ui.ListBox listBox)
          Used to fill the drop down menu which contains a list of all of the people who are not in the group which is specified in the GroupToExclude parameter
 
Methods inherited from class GWTApplication.client.FaultDBForm
createEmailLink, fillListBoxWithCurrentInstruments, fillListBoxWithDutyTechnicians, fillListBoxWithFaultType, fillListBoxWithInstruments, fillListBoxWithSeverity, fillListBoxWithSites, fillListBoxWithStaffMembers, fillListBoxWithStates, fillListBoxWithSupportAstronomers, fillListBoxWithSystems, fillListBoxWithTelescopeOperators, getCurrentDate, getCurrentTime, getFullUserNameFromEmailAddress, selectDefaultListOption, setSelectedItemInListbox, stringContainsText, verifyDateFormat, verifyDateNotInFuture, verifyText, verifyTimeFormat
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getElement, getWidget, initWidget, isAttached, onAttach, onDetach, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
doAttachChildren, doDetachChildren, getParent, onBrowserEvent, onLoad, onUnload, removeFromParent, setElement
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSTRUMENTIDX

static final int INSTRUMENTIDX
See Also:
Constant Field Values

TELESCOPEOPERATORIDX

static final int TELESCOPEOPERATORIDX
See Also:
Constant Field Values

DUTYTECHNICIANIDX

static final int DUTYTECHNICIANIDX
See Also:
Constant Field Values

SUPPORTASTRONOMERIDX

static final int SUPPORTASTRONOMERIDX
See Also:
Constant Field Values

SYSTEMIDX

static final int SYSTEMIDX
See Also:
Constant Field Values

InterfaceInputFields

final ManageSystem.InterfaceInputField[] InterfaceInputFields

ResetPasswordButton

private com.google.gwt.user.client.ui.Button ResetPasswordButton
This is the button which is to be used for resetting the password of a user


PasswordField

private final com.google.gwt.user.client.ui.PasswordTextBox PasswordField
This is the field into which the user will enter the details of the new password for a user


PasswordConfirmField

private final com.google.gwt.user.client.ui.PasswordTextBox PasswordConfirmField
This is the field into which the user will use to confirm the password


UserToChangePwdList

private final com.google.gwt.user.client.ui.ListBox UserToChangePwdList
This is the list of users from which the user can select the name of the person who he wants to change the password for.


CreateNewUserButton

private com.google.gwt.user.client.ui.Button CreateNewUserButton
This is the button which will be pressed to generate a new user


NameOfNewUser

private final com.google.gwt.user.client.ui.TextBox NameOfNewUser
This is the text box which the user will use to enter the name of the new user to the system


SurnameOfNewUser

private final com.google.gwt.user.client.ui.TextBox SurnameOfNewUser
This is the text box which the user will use to enter the surname of the new user to the system


MailAddressOfNewUser

private com.google.gwt.user.client.ui.TextBox MailAddressOfNewUser
This is the text box which the user will use to enter the email address of the new user to the system


mainPanel

private final com.google.gwt.user.client.ui.HorizontalPanel mainPanel
This is the main panel into which we pack up all of the Widgets which comprise this form.

Constructor Detail

ManageSystem

ManageSystem(com.google.gwt.user.client.ui.TabPanel MainTabPanel,
             FaultServiceAsync svc,
             AuthenticationDetails UserAuthentication)
This is used to create the panel which will be used by the manager of the system to manage the data

Method Detail

setupDropDownList

private void setupDropDownList(java.lang.Integer GroupToExclude,
                               com.google.gwt.user.client.ui.ListBox listBox)
Used to fill the drop down menu which contains a list of all of the people who are not in the group which is specified in the GroupToExclude parameter

Parameters:
listBox - This is the list into which we should put the staff members

onClick

public void onClick(com.google.gwt.user.client.ui.Widget sender)
Called when the user presses one of the buttons on the interface and requests the business associated with that button to be performed.

Specified by:
onClick in interface com.google.gwt.user.client.ui.ClickListener
Parameters:
sender - This is the widget which is reponsible for the click event and we will use this to establish exactly what the user was trying to do with the interface.

resetPasswordForUser

private void resetPasswordForUser()
This is a callback which is attached to the reset password button which will permit the manager to reset the password of a user


createNewUser

private void createNewUser()
This will add a new user to the system. The user must have filled in the name, surname and email fields in the form for this to happen.


addNewInstrumentToSystem

private void addNewInstrumentToSystem()
Creates a new instrument in the system after first ensuring that the user has filled in the field correctly.


addNewSystemToSystem

private void addNewSystemToSystem()
Creates a new system in the system after first ensuring that the user has filled in the field correctly.


createNewRoleForUser

private void createNewRoleForUser(int WidgetIndex,
                                  java.lang.Integer Role,
                                  java.lang.String RoleDescription)
Creates a new role for a user. This will be used to add the use to the list of support astronomers, TOs etc. Calls the servlet which will add the user to the role.

Parameters:
WidgetIndex - This is the index into the array which contains the drop down listboxes with the names of the potential members of the roles.
Role - This is the role into which he will be placed i.e. Support astronomer, TO etc.
RoleDescription - This is the description of the role in natural language expressed in the language of the current locale.