LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.app.behavior
Class LyImportBehavior

java.lang.Object
  extended by leon.app.behavior.LyBehavior
      extended by leon.app.behavior.LyActionBehavior
          extended by leon.app.behavior.LyImportBehavior
All Implemented Interfaces:
LyActionBehaviorInterface, LyBehaviorInterface, LyImportBehaviorInterface, LyGetSessionInterface

public class LyImportBehavior
extends LyActionBehavior
implements LyImportBehaviorInterface

This class implements the default behavior for actions that are controlled by an import controller.

See Also:
LyImportController

Field Summary
static java.lang.String __VERSION
          File version
 
Constructor Summary
LyImportBehavior()
           
 
Method Summary
 java.lang.String checkFields(LyImportController controller, LyInfoList<LyFieldInfo> fields)
          Checks if the import can be done with the given list of selected fields.
 java.lang.String checkImportedObjectField(LyImportTableController ctrl, LyObject importedObject, LyObject realObject, LyFieldInfo fieldInfo, LyValue fieldValue)
          This is called by the LyImportTableController at import time.
 java.lang.String getDefaultAttributeSep()
          Returns the default separator, as a String, of the separator to be used between attributes.
 java.lang.String getDefaultAttributeValSep()
          Returns the default separator, as a String, of the separator to be used between attribute values.
 java.lang.String getDefaultImportType()
          Returns the default export type.
 java.util.BitSet getDefaultOperations()
          Returns the default operations.
 java.lang.Integer getDefaultStartLineNumber()
          Returns the default start line number.
 LyImportContentController importContentFactory(LySession session, LyImportTableController parent, LyAction action, java.lang.String importType)
          this method may be overridden to provide a custom class for encode / decode File content in import.
 void importObjectsCommitted(LyImportTableController ctrl, int nSuccess)
          This is called by the LyImportTableController when import is committed.
 void importObjectsStarted(LyImportTableController ctrl, int nRequested)
          This is called by the LyImportTableController when import is started.
 void importObjectsTerminated(LyImportTableController ctrl, int nSuccess)
          This is called by the LyImportTableController when import is finished (and before commit is required).
 
Methods inherited from class leon.app.behavior.LyActionBehavior
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, getTitle, reset, startAction
 
Methods inherited from class leon.app.behavior.LyBehavior
free, getSession, handleDemand, init
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.app.behaviorinterface.LyActionBehaviorInterface
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, getTitle, reset, startAction
 
Methods inherited from interface leon.app.behaviorinterface.LyBehaviorInterface
free, handleDemand, init
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File version

See Also:
Constant Field Values
Constructor Detail

LyImportBehavior

public LyImportBehavior()
Method Detail

checkFields

public java.lang.String checkFields(LyImportController controller,
                                    LyInfoList<LyFieldInfo> fields)
Checks if the import can be done with the given list of selected fields.
The default implementation checks that for the controller class info fields, all fields with the mark ID are in the given list (if the controller import type is not LyImportController.SELECT_IMPORT_TYPE_SPREADSHEET).

Specified by:
checkFields in interface LyImportBehaviorInterface
Parameters:
controller - the current import controller
fields - the fields we want to check
Returns:
an error message if the import can not be done with the given selected files, null if everything is fine

checkImportedObjectField

public java.lang.String checkImportedObjectField(LyImportTableController ctrl,
                                                 LyObject importedObject,
                                                 LyObject realObject,
                                                 LyFieldInfo fieldInfo,
                                                 LyValue fieldValue)
This is called by the LyImportTableController at import time. Checks if the provided value for a fields is correct. Additional checks can be performed here, provided an imported field value. This generic behavior does nothing.

Parameters:
ctrl - the initiating LyImportTableController
importedObject - the imported object
realObject - the existing object if any, null otherwise
fieldInfo - the LyFieldInfo
fieldValue - the imported value to check
Returns:
the error message, or null if everything is fine.

importObjectsTerminated

public void importObjectsTerminated(LyImportTableController ctrl,
                                    int nSuccess)
This is called by the LyImportTableController when import is finished (and before commit is required). This is where additional messages can be displayed to the user. This generic behavior does nothing.

Parameters:
ctrl - the initiating LyImportTableController
nSuccess - the number of successfully imported objects

importObjectsStarted

public void importObjectsStarted(LyImportTableController ctrl,
                                 int nRequested)
This is called by the LyImportTableController when import is started. This generic behavior does nothing.

Parameters:
ctrl - the initiating LyImportTableController
nRequested - the number of objects to be imported

importObjectsCommitted

public void importObjectsCommitted(LyImportTableController ctrl,
                                   int nSuccess)
This is called by the LyImportTableController when import is committed. This is where additional messages can be displayed to the user. This generic behavior does nothing.

Parameters:
ctrl - the initiating LyImportTableController
nSuccess - the number of successfully committed objects

getDefaultAttributeSep

public java.lang.String getDefaultAttributeSep()
Returns the default separator, as a String, of the separator to be used between attributes. Used when the field is not available in the dialog.

Returns:
the default separator for attributes

getDefaultAttributeValSep

public java.lang.String getDefaultAttributeValSep()
Returns the default separator, as a String, of the separator to be used between attribute values. Used when the field is not available in the dialog.

Returns:
the default separator for attribute values

getDefaultImportType

public java.lang.String getDefaultImportType()
Returns the default export type. Used when the field is not available in the dialog.

Returns:
the default separator

getDefaultOperations

public java.util.BitSet getDefaultOperations()
Returns the default operations. Used when the field is not available in the dialog.

Returns:
the default operations

getDefaultStartLineNumber

public java.lang.Integer getDefaultStartLineNumber()
Returns the default start line number. Used when the field is not available in the dialog.

Returns:
the default start line number

importContentFactory

public LyImportContentController importContentFactory(LySession session,
                                                      LyImportTableController parent,
                                                      LyAction action,
                                                      java.lang.String importType)
this method may be overridden to provide a custom class for encode / decode File content in import. Default implementation returns null if type is not found.

Parameters:
session - user session
parent - table to display results
action - parent action
importType - type of import requested by user
Returns:
null if not supported type or the controller if available.

(c) January 2013 - W4 S.A.

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