org.sakaiproject.tool.preferences
Class AdminPrefsTool

java.lang.Object
  extended byorg.sakaiproject.tool.preferences.AdminPrefsTool

public class AdminPrefsTool
extends Object

AdminPrefsTool is a Sakai Admin tool to view and edit anyone's preferences.

Version:
$Revision: 2371 $
Author:
University of Michigan, Sakai Software Development Team

Nested Class Summary
 class AdminPrefsTool.KeyNameValue
          Represents a name value pair in a keyed preferences set.
 
Field Summary
protected  PreferencesEdit m_edit
          The PreferencesEdit being worked on.
protected  PreferencesService m_preferencesService
          Preferences service (injected dependency)
protected  SessionManager m_sessionManager
          Session manager (injected dependency)
protected  Collection m_stuff
          The PreferencesEdit in KeyNameValue collection form.
protected  String m_userId
          The user id (from the end user) to edit.
 
Constructor Summary
AdminPrefsTool()
          no-arg constructor.
 
Method Summary
protected  void cancelEdit()
          Cancel the edit and cleanup.
 Collection getPreferences()
          Access the prefs being edited, in KeyNameValue collection form.
 String getUserId()
          Access the user id of the preferences being edited.
 String processActionAdd()
          Process the add command from the edit view.
 String processActionCancel()
          Process the cancel command from the edit view.
 String processActionEdit()
          Process the edit command.
 String processActionSave()
          Process the save command from the edit view.
protected  void saveEdit()
          Save any changed values from the edit and cleanup.
 void setPreferencesService(PreferencesService mgr)
          Set the preferences service.
 void setSessionManager(SessionManager mgr)
          Set the session manager.
protected  void setupEdit()
          If we have not yet setup our m_stuff edit buffer, do so.
 void setUserId(String id)
          Set the user id to edit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_edit

protected PreferencesEdit m_edit
The PreferencesEdit being worked on.


m_preferencesService

protected PreferencesService m_preferencesService
Preferences service (injected dependency)


m_sessionManager

protected SessionManager m_sessionManager
Session manager (injected dependency)


m_stuff

protected Collection m_stuff
The PreferencesEdit in KeyNameValue collection form.


m_userId

protected String m_userId
The user id (from the end user) to edit.

Constructor Detail

AdminPrefsTool

public AdminPrefsTool()
no-arg constructor.

Method Detail

cancelEdit

protected void cancelEdit()
Cancel the edit and cleanup.


getPreferences

public Collection getPreferences()
Access the prefs being edited, in KeyNameValue collection form.

Returns:
a collection of name,value options for the current configuration.

getUserId

public String getUserId()
Access the user id of the preferences being edited.

Returns:
The user id of the preferences being edited.

processActionAdd

public String processActionAdd()
Process the add command from the edit view.

Returns:
navigation outcome:

processActionCancel

public String processActionCancel()
Process the cancel command from the edit view.

Returns:
navigation outcome:

processActionEdit

public String processActionEdit()
Process the edit command.

Returns:
navigation outcome:

processActionSave

public String processActionSave()
Process the save command from the edit view.

Returns:
navigation outcome:

saveEdit

protected void saveEdit()
Save any changed values from the edit and cleanup.


setPreferencesService

public void setPreferencesService(PreferencesService mgr)
Set the preferences service.

Parameters:
mgr - The preferences service.

setSessionManager

public void setSessionManager(SessionManager mgr)
Set the session manager.

Parameters:
mgr - The session manager.

setupEdit

protected void setupEdit()
If we have not yet setup our m_stuff edit buffer, do so.


setUserId

public void setUserId(String id)
Set the user id to edit.

Parameters:
id - The user id to edit.