LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.app.behavior
Class LyExportBehavior

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

public class LyExportBehavior
extends LyActionBehavior
implements LyExportBehaviorInterface

Default implementation of the export behavior.

See Also:
LyExportController

Field Summary
static java.lang.String __VERSION
          File version
 
Constructor Summary
LyExportBehavior()
           
 
Method Summary
 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 getDefaultExportType()
          Returns the default export type.
 java.util.Vector<java.lang.String> getExportLines(LyExportController controller, java.util.Iterator<LyObject> objects, java.util.Vector<LyFieldInfo> fields, java.lang.String fieldSep, java.lang.String valueSep, java.lang.String exportType)
          Return the lines that will be written in the export file.
 java.lang.String getHeaderMark(LyExportController controller)
          Returns the header mark, as a String, to be used at the beginning of header line
.
 boolean isFormDisplayed(LyExportController controller)
          Indicates if the export form is displayed.
 boolean saveFile(LyExportController controller, java.io.File file, java.util.Vector<java.lang.String> lines)
          Saves lines from the given list into the given file.
 void showExportedFileWindow(LyExportController controller, java.lang.String fileName)
          This method is called at the end of the export action.
 
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

LyExportBehavior

public LyExportBehavior()
Method Detail

getExportLines

public java.util.Vector<java.lang.String> getExportLines(LyExportController controller,
                                                         java.util.Iterator<LyObject> objects,
                                                         java.util.Vector<LyFieldInfo> fields,
                                                         java.lang.String fieldSep,
                                                         java.lang.String valueSep,
                                                         java.lang.String exportType)
Return the lines that will be written in the export file.

Specified by:
getExportLines in interface LyExportBehaviorInterface
Parameters:
controller - the current export controller
objects - objects to export.
fields - list of fieldInfos that should be exported to the file.
fieldSep - separator between fields (columns)
valueSep - separator between multiple values
exportType - type of data to export : Possible values are SELECT_EXPORT_TYPE_TEXT (.txt), SELECT_EXPORT_TYPE_RAW (.res) or SELECT_EXPORT_TYPE_SPREADSHEET (.csv).
Returns:
the lines that will be written in the export file, null for standard export.

saveFile

public boolean saveFile(LyExportController controller,
                        java.io.File file,
                        java.util.Vector<java.lang.String> lines)
Saves lines from the given list into the given file.

Specified by:
saveFile in interface LyExportBehaviorInterface
Parameters:
controller - the current export controller
file - the file where data must be saved
lines - the list of lines to save
Returns:
true if file is save, false otherwise

getHeaderMark

public java.lang.String getHeaderMark(LyExportController controller)
Returns the header mark, as a String, to be used at the beginning of header line
. Default implementation returns the LyString.EXPORT_HEADER_MARK constant.

Specified by:
getHeaderMark in interface LyExportBehaviorInterface
Parameters:
controller - the export controller
Returns:
the header mark

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

getDefaultExportType

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

Returns:
the default separator

showExportedFileWindow

public void showExportedFileWindow(LyExportController controller,
                                   java.lang.String fileName)
This method is called at the end of the export action. In the web mode, it displays a new window from which the resulting exported file can be downloaded.

Parameters:
controller - The current export controller
fileName - The neame of the exported file name

isFormDisplayed

public boolean isFormDisplayed(LyExportController controller)
Indicates if the export form is displayed.
Export form should not be displayed if all the fields values are given as parameters of the export action.

Specified by:
isFormDisplayed in interface LyExportBehaviorInterface
Parameters:
controller - the export controller
Returns:
true if form is displayed, false otherwise.

(c) January 2013 - W4 S.A.

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