public abstract class ProgramController extends MenuSectionController
Modifier and Type | Field and Description |
---|---|
protected AbstractProgramConfigurer |
configurer |
protected com.google.gwt.event.shared.HandlerManager |
eventBus |
protected boolean |
initialized |
protected ProgramStatus |
lastLoadedStatus |
protected boolean |
processBeforeShow |
protected DataModel |
programModel |
protected MajorDisciplineRpcServiceAsync |
programRemoteService |
protected boolean |
reloadMetadata |
protected ProgramSideBar |
sideBar |
protected com.google.gwt.user.client.ui.Label |
statusLabel |
leftPanel, menu, menuViewMap, rightPanel, topLevelMenuItems, viewMenuItemMap
defaultView, name, startPopupView, startViewWindow, viewEnumMap, viewMap, viewType
context, NO_OP_CALLBACK, parentController
exportTemplateName
Constructor and Description |
---|
ProgramController(String name,
DataModel programModel,
ViewContext viewContext,
com.google.gwt.event.shared.HandlerManager eventBus)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
afterMetadataLoaded(Callback<Boolean> onReadyCallback)
Called when metadata is loaded.
|
void |
beforeShow(Callback<Boolean> onReadyCallback)
Got invoked by framework before showing the view of the controller.
|
void |
beforeViewChange(Enum<?> viewChangingTo,
Callback<Boolean> okToChange)
This particular implementation of beforeViewChange checks to see if all its view contains a Controller
and if it does checks with that controller to see if it is ok to change the view.
|
protected void |
configureView() |
protected com.google.gwt.user.client.ui.Widget |
createCommentPanel() |
protected MajorDisciplineRpcServiceAsync |
createProgramRemoteService()
Create a ProgramRpcServiceAsync appropriate for this Controller
|
protected void |
doSave() |
protected void |
fireUpdateEvent(Callback<Boolean> okToChange) |
protected Data |
getDataProperty(String key) |
List<ExportElement> |
getExportElementsFromView()
This method returns array of ExportElements which represent the elements on the view that must be exported
|
String |
getExportTemplateName()
This overridden method only needs to be implemented if the Generic Export reports has to be
overwritten for a particular COntroller.
|
protected String |
getLabel(String messageKey) |
protected String |
getLabel(String messageKey,
String parameter) |
DataModel |
getProgramModel() |
String |
getProgramName() |
protected String |
getStringProperty(String key) |
boolean |
isExportButtonActive()
This method needs to be implemented only on views that want the export button to display.
|
protected void |
loadMetadata(Callback<Boolean> onReadyCallback)
Loads metadata from the server.
|
protected boolean |
loadMetadataCondition()
We should only load metadata if the status of model is changed.
|
protected void |
loadModel(ModelRequestCallback<DataModel> callback)
Loads data model from the server.
|
void |
onModelLoadedEvent() |
void |
refreshModelAndView(DataSaveResult result)
This method will refresh the model and view with the data sent back from
the server.
|
void |
requestModel(Class modelType,
ModelRequestCallback callback)
Called by child views and controllers to request a model reference.
|
protected void |
resetFieldInteractionFlag() |
protected void |
resetModel() |
protected void |
setHeaderTitle() |
protected void |
setStatus() |
void |
setViewContext(ViewContext viewContext)
Sets the view context.
|
protected void |
updateState(String state,
Callback<Boolean> okCallback)
Update the state of the program and all of its statements.
|
addButtonForView, addCommonButton, addCommonButton, addContentWidget, addInfoWidget, addMenu, addMenuItem, addSpecialMenuItem, addStartMenuItem, addStyleName, addTopButtonForView, hideView, removeMenuNavigation, renderView, revealMenuItems, setContentInfo, setContentTitle, setContentWarning, setSideBarWidget, showExport, showNextViewOnMenu, showPrint, updateModel
addStartViewPopup, addView, asWidget, beforeHide, checkForErrors, clear, clearAllWarnings, collectBreadcrumbNames, findParentLayout, getController, getDefaultView, getName, getStartPopup, getStartPopupView, getView, getViewEnum, getViewEnumValue, isStartViewShowing, isValid, isValid, setController, setDefaultView, setName, setViewEnum, showDefaultView, showFirstView, showStartPopup, showWarnings, updateModelFromCurrentView, updateModelFromView
addApplicationEventHandler, beginShowView, collectHistory, doReportExport, finalizeShowView, findController, fireApplicationEvent, fireNavigationEvent, getCurrentView, getCurrentViewEnum, getDefaultModelId, getExportDataModel, getHistoryToken, getParentController, getView, getViewContext, onHistoryEvent, registerModel, requestModel, requestModel, resetCurrentView, setCurrentViewEnum, setDefaultModelId, setParentController, showView, showView
getWidget, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addStartViewPopup, addView, setDefaultView, showView
collectHistory, onHistoryEvent
protected MajorDisciplineRpcServiceAsync programRemoteService
protected boolean initialized
protected DataModel programModel
protected AbstractProgramConfigurer configurer
protected com.google.gwt.event.shared.HandlerManager eventBus
protected com.google.gwt.user.client.ui.Label statusLabel
protected ProgramSideBar sideBar
protected ProgramStatus lastLoadedStatus
protected boolean reloadMetadata
protected boolean processBeforeShow
public ProgramController(String name, DataModel programModel, ViewContext viewContext, com.google.gwt.event.shared.HandlerManager eventBus)
programModel
- protected MajorDisciplineRpcServiceAsync createProgramRemoteService()
public void beforeViewChange(Enum<?> viewChangingTo, Callback<Boolean> okToChange)
LayoutController
beforeViewChange
in class LayoutController
Controller.beforeViewChange(java.lang.Enum, org.kuali.student.common.ui.client.mvc.Callback)
protected void fireUpdateEvent(Callback<Boolean> okToChange)
protected void resetModel()
protected void resetFieldInteractionFlag()
public void requestModel(Class modelType, ModelRequestCallback callback)
Controller
requestModel
in class Controller
protected void loadModel(ModelRequestCallback<DataModel> callback)
callback
- we have to invoke this callback when model is loaded or failed.protected void setStatus()
public String getProgramName()
public void beforeShow(Callback<Boolean> onReadyCallback)
beforeShow
in interface View
beforeShow
in class LayoutController
onReadyCallback
- View.beforeShow(org.kuali.student.common.ui.client.mvc.Callback)
protected boolean loadMetadataCondition()
protected void loadMetadata(Callback<Boolean> onReadyCallback)
onReadyCallback
- protected void configureView()
public void setViewContext(ViewContext viewContext)
Controller
setViewContext
in class Controller
protected void afterMetadataLoaded(Callback<Boolean> onReadyCallback)
onReadyCallback
- protected void setHeaderTitle()
protected com.google.gwt.user.client.ui.Widget createCommentPanel()
protected void doSave()
protected void updateState(String state, Callback<Boolean> okCallback)
This is only called when the state change event fires.
There are several types of programs (majorDiscipline, core, credential). The state of each program changes when buttons are pressed. For example, pressing the activate button may change the state of the program from draft to active.
This method is triggered when the state changes. It will pass the new state to the controller servlet, which will then use it to update the state by calling the web services.
Note that state and status are different.
It is placed in ProgramController so core, credential, etc all have access it.
state
- the state we changed tookCallback
- will return true if update succeededpublic void refreshModelAndView(DataSaveResult result)
public DataModel getProgramModel()
public void onModelLoadedEvent()
protected String getStringProperty(String key)
protected Data getDataProperty(String key)
public boolean isExportButtonActive()
View
isExportButtonActive
in interface View
isExportButtonActive
in class LayoutController
public String getExportTemplateName()
ReportExport
getExportTemplateName
in interface ReportExport
getExportTemplateName
in class Controller
ReportExport.getExportTemplateName()
public List<ExportElement> getExportElementsFromView()
ReportExport
getExportElementsFromView
in interface ReportExport
getExportElementsFromView
in class MenuSectionController
Copyright © 2004-2013 The Kuali Foundation. All Rights Reserved.