org.kuali.student.lum.lu.ui.course.client.controllers
Class CourseAdminController

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 org.kuali.student.common.ui.client.mvc.Controller
                  extended by org.kuali.student.common.ui.client.configurable.mvc.LayoutController
                      extended by org.kuali.student.common.ui.client.configurable.mvc.layouts.MenuSectionController
                          extended by org.kuali.student.common.ui.client.configurable.mvc.layouts.MenuEditableSectionController
                              extended by org.kuali.student.lum.lu.ui.course.client.controllers.CourseProposalController
                                  extended by org.kuali.student.lum.lu.ui.course.client.controllers.CourseAdminController
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.IsWidget, ContentNavLayoutController, DocumentLayoutController, ViewLayoutController, BreadcrumbSupport, HistorySupport, View, ReportExport, RequiresAuthorization, WorkflowEnhancedNavController, HasRequirements
Direct Known Subclasses:
CourseAdminWithoutVersionController

public class CourseAdminController
extends CourseProposalController

Controller for create/modify course with proposal wrapper admin screens. This controller uses a different configurer for admin screens and attempts to reuse as much of the validation, save & retreive logic coded in the CourseProposalController. Also it reuses the menu from CourseProposalController and adds click handlers to button menu to navigate user b/w sections of the same view.

Author:
Will

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
protected  List<KSButton> cancelButtons
           
 
Fields inherited from class org.kuali.student.lum.lu.ui.course.client.controllers.CourseProposalController
cfg, cluProposalModel, cluProposalRpcServiceAsync, comparisonModel, courseServiceAsync, currentDocType, currentTitle, isNew, loadDataTask, proposalPath, reqDataModel, reqDataModelComp, workflowUtil
 
Fields inherited from class org.kuali.student.common.ui.client.configurable.mvc.layouts.MenuSectionController
leftPanel, menu, menuViewMap, rightPanel, topLevelMenuItems, viewMenuItemMap
 
Fields inherited from class org.kuali.student.common.ui.client.configurable.mvc.LayoutController
defaultView, name, startPopupView, startViewWindow, viewEnumMap, viewMap, viewType
 
Fields inherited from class org.kuali.student.common.ui.client.mvc.Controller
context, NO_OP_CALLBACK, parentController
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Fields inherited from interface org.kuali.student.common.ui.client.reporting.ReportExport
exportTemplateName
 
Constructor Summary
CourseAdminController()
           
 
Method Summary
 void addMenuItemSection(String parentMenu, String sectionName, String widgetId, com.google.gwt.user.client.ui.Widget widget)
          This is a special method for CourseAdminController, which adds a menu item to the navigation menu and navigates a user to a section within the view rather than a different view.
 void addPermissionAttributes(Map<String,String> attributes)
          This method adds any permission attributes required for checking admin permissions
protected  void configureScreens(DataModelDefinition modelDefinition, Callback<Boolean> onReadyCallback)
           
private  void doAdminSaveAction(SaveActionEvent saveActionEvent, String state)
          Fires the SaveActionEvent to be handled by the CourseProposalController.
 KSButton getApproveAndActivateButton()
           
 KSButton getCancelButton()
           
private  String getProposalTitle()
           
private  SaveActionEvent getSaveActionEvent(String state)
          Returns a SaveActionEvent with the appropriate ActionCompleteCallback, which will take additional admin actions once save is complete.
 KSButton getSaveButton()
          Override the getSaveButton to provide a new set of buttons for the admin screens
protected  void handleButtonClick(String state)
          Processes the save, approve, or approve and activate button clicks.
protected  void initializeController()
          Override the intitailzeController method to use CourseAdminConfigurer
protected  Callback<Boolean> previousEndTermConfigurationCallback(Callback<Boolean> onReadyCallback)
          This callback is used to configure the previous end term field after the screens have been configured.
protected  void progressiveEnableFields()
          Override CourseProposalController because end term should always be editable in admin screens.
 void scrollToSection(com.google.gwt.user.client.Element element)
           
protected  void setHeaderTitle()
          Override the setHeaderTitle to display proper header title for admin screens
 void setViewContext(ViewContext viewContext)
          Sets the view context.
 
Methods inherited from class org.kuali.student.lum.lu.ui.course.client.controllers.CourseProposalController
beforeShow, beforeViewChange, checkAuthorization, createNewCluProposalModel, doSaveAction, getCancelButton, getCluProposalFromProposalId, getCourseComparisonModelAndReqs, getCourseId, getCourseProposalConfigurer, getCourseProposalRpcService, getCourseState, getCurrentModel, getExportDataModel, getExportElementsFromView, getExportTemplateName, getMessage, getMetadataForFinalState, getReqDataModel, getReqDataModelComp, getStateforSaveAction, getWfUtilities, isAuthorizationRequired, isExportButtonActive, isNew, onHistoryEvent, registerModelsAndHandlers, requestModel, saveProposalClu, setAuthorizationRequired, setLastUpdated, setParentController, showDefaultView, showView, startSectionRequired
 
Methods inherited from class org.kuali.student.common.ui.client.configurable.mvc.layouts.MenuEditableSectionController
addCommonEditButton, addMenuItem, attachEditLink, generateEditLink, setEditable, setEditMode
 
Methods inherited from class org.kuali.student.common.ui.client.configurable.mvc.layouts.MenuSectionController
addButtonForView, addCommonButton, addCommonButton, addContentWidget, addInfoWidget, addMenu, addMenuItem, addSpecialMenuItem, addStartMenuItem, addStyleName, addTopButtonForView, hideView, removeMenuNavigation, renderView, revealMenuItems, setContentInfo, setContentTitle, setContentWarning, setSideBarWidget, showExport, showNextViewOnMenu, showPrint, updateModel
 
Methods inherited from class org.kuali.student.common.ui.client.configurable.mvc.LayoutController
addStartViewPopup, addView, asWidget, beforeHide, checkForErrors, clear, clearAllWarnings, collectBreadcrumbNames, findParentLayout, getController, getDefaultView, getName, getStartPopup, getStartPopupView, getView, getViewEnum, getViewEnumValue, isStartViewShowing, isValid, isValid, setController, setDefaultView, setName, setViewEnum, showFirstView, showStartPopup, showWarnings, updateModelFromCurrentView, updateModelFromView
 
Methods inherited from class org.kuali.student.common.ui.client.mvc.Controller
addApplicationEventHandler, collectHistory, doReportExport, findController, fireApplicationEvent, fireNavigationEvent, getCurrentView, getCurrentViewEnum, getDefaultModelId, getHistoryToken, getParentController, getView, getViewContext, registerModel, requestModel, requestModel, resetCurrentView, setCurrentViewEnum, setDefaultModelId, showView
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getWidget, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.kuali.student.common.ui.client.configurable.mvc.layouts.ContentNavLayoutController
addButtonForView, addCommonButton, addCommonButton, addMenu, addMenuItem, addSpecialMenuItem, removeMenuNavigation
 
Methods inherited from interface org.kuali.student.common.ui.client.configurable.mvc.layouts.DocumentLayoutController
addContentWidget, setContentInfo, setContentTitle
 
Methods inherited from interface org.kuali.student.common.ui.client.configurable.mvc.layouts.ViewLayoutController
addStartViewPopup, addView, setDefaultView, showView
 
Methods inherited from interface org.kuali.student.common.ui.client.mvc.history.HistorySupport
collectHistory
 

Field Detail

cancelButtons

protected List<KSButton> cancelButtons
Constructor Detail

CourseAdminController

public CourseAdminController()
Method Detail

initializeController

protected void initializeController()
Override the intitailzeController method to use CourseAdminConfigurer

Overrides:
initializeController in class CourseProposalController

getSaveButton

public KSButton getSaveButton()
Override the getSaveButton to provide a new set of buttons for the admin screens

Overrides:
getSaveButton in class CourseProposalController

getApproveAndActivateButton

public KSButton getApproveAndActivateButton()

getCancelButton

public KSButton getCancelButton()

handleButtonClick

protected void handleButtonClick(String state)
Processes the save, approve, or approve and activate button clicks. The action is determined by the value of the state parameter.

Parameters:
state - The state to set on the course when saving course data. DRAFT=Save, APPROVED=Approve, and ACTIVE=Approve & Activate

getSaveActionEvent

private SaveActionEvent getSaveActionEvent(String state)
Returns a SaveActionEvent with the appropriate ActionCompleteCallback, which will take additional admin actions once save is complete. The action (i.e. button clicked) is determined by the value of the state parameter

Parameters:
state - The state to set on the course when saving course data. DRAFT=Save, ACTIVE=Approve & Activate
Returns:
the save event that will be fired based on the button click

doAdminSaveAction

private void doAdminSaveAction(SaveActionEvent saveActionEvent,
                               String state)
Fires the SaveActionEvent to be handled by the CourseProposalController.

Parameters:
saveActionEvent - SaveActionEvent to fire
state - The state to set on the course when saving course data. DRAFT=Save, APPROVED=Approve, and ACTIVE=Approve & Activate
See Also:
CourseProposalController.registerModelsAndHandlers()

progressiveEnableFields

protected void progressiveEnableFields()
Override CourseProposalController because end term should always be editable in admin screens.

Overrides:
progressiveEnableFields in class CourseProposalController

setHeaderTitle

protected void setHeaderTitle()
Override the setHeaderTitle to display proper header title for admin screens

Overrides:
setHeaderTitle in class CourseProposalController

getProposalTitle

private String getProposalTitle()

addMenuItemSection

public void addMenuItemSection(String parentMenu,
                               String sectionName,
                               String widgetId,
                               com.google.gwt.user.client.ui.Widget widget)
This is a special method for CourseAdminController, which adds a menu item to the navigation menu and navigates a user to a section within the view rather than a different view.

Parameters:
parentMenu -
sectionName -
sectionId -
section -

scrollToSection

public void scrollToSection(com.google.gwt.user.client.Element element)

configureScreens

protected void configureScreens(DataModelDefinition modelDefinition,
                                Callback<Boolean> onReadyCallback)
Overrides:
configureScreens in class CourseProposalController

previousEndTermConfigurationCallback

protected Callback<Boolean> previousEndTermConfigurationCallback(Callback<Boolean> onReadyCallback)
This callback is used to configure the previous end term field after the screens have been configured.

Parameters:
onReadyCallback -
Returns:

setViewContext

public void setViewContext(ViewContext viewContext)
Description copied from class: Controller
Sets the view context. This is important for determining the permission for seeing views under this controllers scope, what the id and id type of the model the controller handles are defined here. Additional attributes that the controller and it's views need to know about are also defined in the viewContext.

Overrides:
setViewContext in class CourseProposalController

addPermissionAttributes

public void addPermissionAttributes(Map<String,String> attributes)
This method adds any permission attributes required for checking admin permissions

Overrides:
addPermissionAttributes in class CourseProposalController


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.