LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.control
Class LyImportController

java.lang.Object
  extended by leon.control.LyController
      extended by leon.control.LyAreaController
          extended by leon.control.LyImportController
All Implemented Interfaces:
LyGetSessionInterface, LyContextInterface, LyGetActionInterface, LySelectFileListenerInterface, LyGuiListener, LyInfoListener, LyEvaluator, LyDemandListener

public class LyImportController
extends LyAreaController

This class implements the import edition form. The user may specify import parameters :

The data file is usually created from an export controller : LyExportController or an application such as MS Excel. This class only implements the import form : the import process is done in a LyImportTableController instance. This controller is associated with a behaviorInterface (LyImportBehaviorInterface). Usually, this behavior is an instance of LyImportBehavior

See Also:
LyExportController, LyImportTableController, LyImportBehaviorInterface, LyImportBehavior

Field Summary
static java.lang.String __VERSION
          File Version
static java.lang.String FIELD_SEP
          Default field separator in imports.
static java.lang.String PREFERENCE_PREFIX
          Prefix used for the name of the preferences saved for import actions.
static java.lang.String SELECT_FIELD_SEP
          Form field identifier : select field separator (default is FIELD_SEP).
static java.lang.String SELECT_FIELDINFOS
          Form field identifier : List of fields for import.
static java.lang.String SELECT_FILE
          Form field identifier : select input file path.
static java.lang.String SELECT_IMPORT_TYPE
          Form field identifier : import type, either SELECT_IMPORT_TYPE_RAW or SELECT_IMPORT_TYPE_XML or SELECT_IMPORT_TYPE_SPREADSHEET.
static java.lang.String SELECT_IMPORT_TYPE_RAW
          Form field value identifier : import raw data.
static java.lang.String SELECT_IMPORT_TYPE_SPREADSHEET
          Form field value identifier : import spreadsheet data.
static java.lang.String SELECT_IMPORT_TYPE_XML
          Form field value identifier : import XML data.
static java.lang.String SELECT_OPERATIONS
          Form field identifier : operations to be executed.
static int SELECT_OPERATIONS_CONSULTATION
          Form field value identifier : consultation operation.
static int SELECT_OPERATIONS_CREATION
          Form field value identifier : creation operation.
static int SELECT_OPERATIONS_DELETION
          Form field value identifier : deletion operation.
static int SELECT_OPERATIONS_MODIFICATION
          Form field value identifier : creation operation.
static java.lang.String SELECT_START_LINE_NUMBER
          Form field identifier : select input start line number.
static java.lang.String SELECT_VALUE_SEP
          Form field identifier : select value separator (default is VALUE_SEP).
static java.lang.String SPREADSHEET_FIELD_SEP
          Default field separator in imports.
static java.lang.String SPREADSHEET_VALUE_SEP
          Default multiple value separator in imports.
static java.lang.String VALUE_SEP
          Default multiple value separator in imports.
 
Fields inherited from class leon.control.LyAreaController
DEFAULT_MENU_ITEM_IMAGE_SIZE, DEMAND_APPLY, DEMAND_CANCEL, DEMAND_CLOSE, DEMAND_CREATE_CHART, DEMAND_DELETE_CHART, DEMAND_DELETE_OBJECTINFOS, DEMAND_DELETE_PREFERENCE, DEMAND_UPDATE_VIEW, DEMAND_VALIDATE
 
Fields inherited from class leon.control.LyController
_nbControllers, _nextId, CONTROLLER_ID_SEP, DEFAULT_IMAGE_FORMAT, DEMAND_HELP, ID_SEP
 
Constructor Summary
LyImportController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo, LyObjectList objects)
          Constructor.
 
Method Summary
 void actionDemand(LyActionDemand demand)
          Invoked when an action notification is sent to this listener.
 java.lang.Class<?> getBehaviorInterface()
          Method that gives the interface that must be implemented by the behavior associated to this controller.
 LyClassInfo getClassInfo()
          Accessor to the classinfo Application class associated to the import action.
 java.util.BitSet getImportOperations()
          Accessor to the import operations.
 java.lang.String getImportType()
          Accessor to the import type.
 java.lang.Object getParameterValue(java.lang.String parameterName)
          Returns the value of a given parameter set on current import action.
 int getStartLineNumber()
          Accessor to the start line number.
 boolean isSilent()
          Checks if this import is in silent mode.
 boolean isViewResizable()
          Indicates if the view for this import controller is resizable.
 void showView()
          Overridden to ensure that export form is displayed.
 
Methods inherited from class leon.control.LyAreaController
canClose, canFree, clearViewCache, completeMenuBar, completeMessages, free, free, getAction, getAreaStackController, getBehavior, getBuilder, getContent, getContext, getContextClient, getContextTitle, getDefaultAction, getEnvironment, getFastEditionAction, getHelpFile, getImage, getImageTooltip, getInfoLabel, getInfoLabel, getKeyValue, getLabel, getLastModified, getMenuItemImage, getName, getParameter, getParameter, getParameterMarks, getParent, getParent, getParentAreaController, getRefreshTime, getSelection, getShortLabel, getTarget, getTitle, getViewController, getViewController, hasMark, hasNotMark, hasViewController, hideView, infoEvent, initialize, isInitialized, isOutlined, menuDemand, reset, reset, selectFileDemand, setContext, setContext, setContextClient, setIdle, setPreference, setViewController, showView, testParameter, toString, update, updateTitleBar
 
Methods inherited from class leon.control.LyController
activateViewDemand, demandPerformed, dragDropDemand, getApplication, getClassInfo, getComponent, getId, getImage, getImage, getImage, getImage, getImageFromPrefix, getImageFromPrefix, getImageFromPrefix, getName, getObjectId, getSession, getUserData, getView, getViewManager, helpDemand, hideView, isFreed, isIdle, selectionDemand, setBuilder, setBuilderClass, setLastModified, setName, setUserData, showError, showError, showWarning, updateViewFromValues
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File Version

See Also:
Constant Field Values

SELECT_FIELDINFOS

public static final java.lang.String SELECT_FIELDINFOS
Form field identifier : List of fields for import.

See Also:
Constant Field Values

SELECT_FIELD_SEP

public static final java.lang.String SELECT_FIELD_SEP
Form field identifier : select field separator (default is FIELD_SEP).

See Also:
Constant Field Values

SELECT_VALUE_SEP

public static final java.lang.String SELECT_VALUE_SEP
Form field identifier : select value separator (default is VALUE_SEP).

See Also:
Constant Field Values

SELECT_FILE

public static final java.lang.String SELECT_FILE
Form field identifier : select input file path.

See Also:
Constant Field Values

SELECT_START_LINE_NUMBER

public static final java.lang.String SELECT_START_LINE_NUMBER
Form field identifier : select input start line number.

See Also:
Constant Field Values

FIELD_SEP

public static java.lang.String FIELD_SEP
Default field separator in imports.


VALUE_SEP

public static java.lang.String VALUE_SEP
Default multiple value separator in imports.


SPREADSHEET_FIELD_SEP

public static java.lang.String SPREADSHEET_FIELD_SEP
Default field separator in imports.


SPREADSHEET_VALUE_SEP

public static java.lang.String SPREADSHEET_VALUE_SEP
Default multiple value separator in imports.


SELECT_IMPORT_TYPE

public static final java.lang.String SELECT_IMPORT_TYPE
Form field identifier : import type, either SELECT_IMPORT_TYPE_RAW or SELECT_IMPORT_TYPE_XML or SELECT_IMPORT_TYPE_SPREADSHEET.


SELECT_IMPORT_TYPE_RAW

public static final java.lang.String SELECT_IMPORT_TYPE_RAW
Form field value identifier : import raw data.


SELECT_IMPORT_TYPE_XML

public static final java.lang.String SELECT_IMPORT_TYPE_XML
Form field value identifier : import XML data.


SELECT_IMPORT_TYPE_SPREADSHEET

public static final java.lang.String SELECT_IMPORT_TYPE_SPREADSHEET
Form field value identifier : import spreadsheet data.


SELECT_OPERATIONS

public static final java.lang.String SELECT_OPERATIONS
Form field identifier : operations to be executed.

See Also:
Constant Field Values

SELECT_OPERATIONS_CREATION

public static final int SELECT_OPERATIONS_CREATION
Form field value identifier : creation operation.

See Also:
Constant Field Values

SELECT_OPERATIONS_MODIFICATION

public static final int SELECT_OPERATIONS_MODIFICATION
Form field value identifier : creation operation.

See Also:
Constant Field Values

SELECT_OPERATIONS_DELETION

public static final int SELECT_OPERATIONS_DELETION
Form field value identifier : deletion operation.

See Also:
Constant Field Values

SELECT_OPERATIONS_CONSULTATION

public static final int SELECT_OPERATIONS_CONSULTATION
Form field value identifier : consultation operation.

See Also:
Constant Field Values

PREFERENCE_PREFIX

public static final java.lang.String PREFERENCE_PREFIX
Prefix used for the name of the preferences saved for import actions.

Constructor Detail

LyImportController

public LyImportController(LySession session,
                          LyController parent,
                          LyAction action,
                          LyClassInfo classInfo,
                          LyObjectList objects)
Constructor.

Parameters:
session - current session associated to the controller. The controller automatically registers on the specified session.
parent - parent controller (or null for 'root' controller).
action - related action.
classInfo - classInfo which indicates which kind of objects we expect in import
objects - current context
Method Detail

getBehaviorInterface

public java.lang.Class<?> getBehaviorInterface()
Method that gives the interface that must be implemented by the behavior associated to this controller.

Overrides:
getBehaviorInterface in class LyAreaController
Returns:
Class representing the behavior interface of this controller.

showView

public void showView()
Overridden to ensure that export form is displayed.

Overrides:
showView in class LyAreaController

actionDemand

public void actionDemand(LyActionDemand demand)
Invoked when an action notification is sent to this listener.

This method is called by demandPerformed.

At this level, the implementation handles demands of type LyActionDemand.TYPE_ACTION : LyFormController.DEMAND_VALIDATE, and LyExportController.DEMAND_CANCEL

Overrides:
actionDemand in class LyAreaController
Parameters:
demand - demand parameters sent by the view component.
See Also:
LyController.demandPerformed(leon.view.event.LyDemand)

getParameterValue

public java.lang.Object getParameterValue(java.lang.String parameterName)
Returns the value of a given parameter set on current import action.
The type of the returned value depends on the parameter.

Parameters:
parameterName - the name of the parameter which value must be retrieved.
Returns:
the value of a given parameter set on current import action or null if the parameter is not set on the import action.

getClassInfo

public LyClassInfo getClassInfo()
Accessor to the classinfo Application class associated to the import action.

Overrides:
getClassInfo in class LyAreaController
Returns:
the classInfo associated to the import form

isViewResizable

public boolean isViewResizable()
Indicates if the view for this import controller is resizable.

Overrides:
isViewResizable in class LyAreaController
Returns:
true if the view is resizable, false otherwise.

getImportType

public java.lang.String getImportType()
Accessor to the import type.

Returns:
the import type selected in the form. The result is one of the following:

getImportOperations

public java.util.BitSet getImportOperations()
Accessor to the import operations.

Returns:
a bitset containing selected operations. Operations may be one of the following:

getStartLineNumber

public int getStartLineNumber()
Accessor to the start line number.

Returns:
the index of the first line of the imported file containing real data.

isSilent

public boolean isSilent()
Checks if this import is in silent mode.

Returns:
true if in silent mode

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com