com.sri.emo.controller
Class ImportExportModel

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by com.jcorporate.expresso.core.controller.Controller
          extended by com.jcorporate.expresso.core.controller.DBController
              extended by com.sri.common.controller.AbstractDBController
                  extended by com.sri.emo.controller.ImportExportModel
All Implemented Interfaces:
Serializable

public class ImportExportModel
extends AbstractDBController

Allows import and export of Entities and their related nodes.

A controller is a rough model of a finite state machine for a web application. Each state provides user interaction elements that can be rendered in a web page or other medium such as a command line app.

See Also:
Serialized Form
To Do:
Transactionize the import.

Field Summary
static String STATE_EXPORTMODEL
          Constant for access to state: Export an Entire Model with Nodes
static String STATE_IMPORTMODEL
          Constant for access to state: Import an Entire Model With Nodes
static String STATE_PROMPT
          Constant for access to state: Prompt
static String STATE_PROMPT_EXPORT
          Constant for access to state: Prompt Export Model
static String STATE_PROMPT_IMPORTMODEL
          Constant for access to state: Prompt Import
 
Fields inherited from class com.sri.common.controller.AbstractDBController
COLUMN, COMMON_FOOTER_HANDLER, COMMON_HEADER_HANDLER, DELIMIT, EDIT_GROUP_DISPLAY, EMBEDDED_MODE, FOOTER, MAX_CHARS_OUTPUT, MAX_TEXTAREA_LENGTH, MULTIPLE_TEXTAREA_NUM_LINES, REQUEST_CONTAINER, ROW, ROW_BLOCK, SESSION_CONTAINER, SINGLE_TEXTAREA_NUM_LINES, TEXTAREA_NUM_COLS, WARNING_LIST
 
Fields inherited from class com.jcorporate.expresso.core.controller.DBController
CACHE_NAME
 
Fields inherited from class com.jcorporate.expresso.core.controller.Controller
CONTROLLER_PARAM_KEY, CTL_SUCC_CTL, CTL_SUCC_STATE, CTL_SUCC_TRAN, mLog, NEWSTATE_EXCEPTION_KEY, ORIGINAL_URL_KEY, REQUEST_KEY, RESPONSE_KEY, RETURN_TO_SENDER_TRAN, STATE_ERR_CTL, STATE_ERR_STATE, STATE_ERR_TRAN, STATE_PARAM_KEY, STATE_SUCC_CTL, STATE_SUCC_STATE, STATE_SUCC_TRAN
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
ImportExportModel()
          Creates an instance of ImportExportModel.
 
Method Summary
 String getTitle()
          Override of Controller.getTitle() to provide a meaningful name to this controller.
protected  String getXmlData(ExpressoRequest request, ErrorCollection ec)
          Parse the XML data from either the data parameter or the file parameter.
protected  org.dom4j.Element parseXmlDataString(String data)
          Returns an element from the given data.
protected  void runExportModelState(ExpressoRequest request, ExpressoResponse response)
          Runs the Export an Entire Model with Nodes state
protected  void runImportModelState(ExpressoRequest request, ExpressoResponse response)
          Runs the Import an Entire Model With Nodes state
protected  void runPromptExportModelState(ExpressoRequest request, ExpressoResponse response)
          Runs the Prompt Export.
protected  void runPromptImportModelState(ExpressoRequest request, ExpressoResponse response)
          Prompts for input.
protected  void runPromptState(ExpressoRequest request, ExpressoResponse response)
          Runs the Prompt state.
 
Methods inherited from class com.sri.common.controller.AbstractDBController
addEmbeddedParameter, addWarning, addWarningList, getActionForwarding, getCheckbox, getPermsTrans, getPrettyXML, getTextArea, getTextArea, getWarningList, isEmbeddedMode, isValidAndPopulated, outputXML, populateDBObject, postPerform, prePerform, stateAllowed, str, strTrunc, trimAllTextFields
 
Methods inherited from class com.jcorporate.expresso.core.controller.DBController
getString, isAllowed
 
Methods inherited from class com.jcorporate.expresso.core.controller.Controller
addFinalState, addPromptTransitions, addRegDomainParamtoSession, addRequestedURLtoSession, addState, addStatePairing, endTimer, execute, findControllerForm, generateToken, getActionForward, getControllerChainingTransition, getControllerSecurityTransition, getFinalState, getInitialState, getLogger, getParamValues, getRequestURL, getSchema, getSchemaHierarchy, getSchemaInstance, getSchemaStack, getState, getStates, getString, getString, handleException, instantiate, isFinalState, isHandleState, isPromptState, isTokenValid, loadStateForm, newExpressoState, newState, nextHandleState, nextPromptState, populateStateForm, postPerform, prePerform, previousPromptState, processRequestTransitions, processTransitions, redirectRequest, redirectRequest, remapFromExtension, resetToken, saveToken, setControllerChainingTransition, setControllerSecurityTransition, setCurrentState, setInitialState, setSchema, setSchema, setupDefaultValues, setupReturnToSender, setupSubclassLog, transition, transition, transition, unloadStateForm
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_PROMPT

public static final String STATE_PROMPT
Constant for access to state: Prompt

See Also:
Constant Field Values

STATE_PROMPT_EXPORT

public static final String STATE_PROMPT_EXPORT
Constant for access to state: Prompt Export Model

See Also:
Constant Field Values

STATE_EXPORTMODEL

public static final String STATE_EXPORTMODEL
Constant for access to state: Export an Entire Model with Nodes

See Also:
Constant Field Values

STATE_IMPORTMODEL

public static final String STATE_IMPORTMODEL
Constant for access to state: Import an Entire Model With Nodes

See Also:
Constant Field Values

STATE_PROMPT_IMPORTMODEL

public static final String STATE_PROMPT_IMPORTMODEL
Constant for access to state: Prompt Import

See Also:
Constant Field Values
Constructor Detail

ImportExportModel

public ImportExportModel()
Creates an instance of ImportExportModel. The Controller constructor also defines what states and parameters are officially defined by the Controller.

Method Detail

runPromptState

protected void runPromptState(ExpressoRequest request,
                              ExpressoResponse response)
                       throws ControllerException,
                              NonHandleableException
Runs the Prompt state.

Parameters:
request - The ExpressoRequest object handed to us by the framework. The ExpressoRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ExpressoResponse object handed to us by the framework. The ExpressoResponse will be populated with the Inputs/Outputs /Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error

runPromptExportModelState

protected void runPromptExportModelState(ExpressoRequest request,
                                         ExpressoResponse response)
                                  throws ControllerException,
                                         NonHandleableException
Runs the Prompt Export.

Parameters:
request - The ExpressoRequest object handed to us by the framework. The ExpressoRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ExpressoResponse object handed to us by the framework. The ExpressoResponse will be populated with the Inputs/Outputs /Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error

runExportModelState

protected void runExportModelState(ExpressoRequest request,
                                   ExpressoResponse response)
                            throws ControllerException,
                                   NonHandleableException,
                                   IOException
Runs the Export an Entire Model with Nodes state

Parameters:
request - The ExpressoRequest object handed to us by the framework. The ExpressoRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ExpressoResponse object handed to us by the framework. The ExpressoResponse will be populated with the Inputs/Outputs Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error
IOException - upon error writing the XML data.

runImportModelState

protected void runImportModelState(ExpressoRequest request,
                                   ExpressoResponse response)
                            throws ControllerException,
                                   NonHandleableException
Runs the Import an Entire Model With Nodes state

Parameters:
request - The ExpressoRequest object handed to us by the framework. The ExpressoRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ExpressoResponse object handed to us by the framework. The ExpressoResponse will be populated with the Inputs/Outputs/Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error

getXmlData

protected String getXmlData(ExpressoRequest request,
                            ErrorCollection ec)
Parse the XML data from either the data parameter or the file parameter.

Parameters:
request - ExpressoRequest The ExpressoRequest object
ec - ErrorCollection the ErrorCollection
Returns:
String the resulting data.

parseXmlDataString

protected org.dom4j.Element parseXmlDataString(String data)
                                        throws org.dom4j.DocumentException
Returns an element from the given data.

Parameters:
data - String the actual data to parse.
Returns:
Element Dom4j Element
Throws:
org.dom4j.DocumentException - upon parsing error.

runPromptImportModelState

protected void runPromptImportModelState(ExpressoRequest request,
                                         ExpressoResponse response)
                                  throws ControllerException,
                                         NonHandleableException
Prompts for input.

Parameters:
request - The ExpressoRequest object handed to us by the framework. The ExpressoRequest contains all the parameters such as web parameters, user security credentials and user locale
response - The ExpressoResponse object handed to us by the framework. The ExpressoResponse will be populated with the Inputs/Outputs /Transitions/Blocks for ths sytem.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error

getTitle

public String getTitle()
Override of Controller.getTitle() to provide a meaningful name to this controller.

Overrides:
getTitle in class Controller
Returns:
java.lang.String


Copyright © 2004-2006 Codeguild, Inc.. All Rights Reserved.