|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.control.LyController
leon.control.LyAreaController
leon.control.LyExportController
public class LyExportController
This class implements the simple export edition area. The export area is used to create a export of the data into a CSV like text file. This is an ASCII file with separators, one object per line close to the save format of Microsoft Excel. (Excel uses commas or semicolons), as the controller let the user choose these parameters.
Default separators are : FIELD_SEP (for columns) and VALUE_SEP (multiple values) Data may be saved to an ascii file, then retreived with an import controller or an application such as MS Excel
LyImportController
Field Summary | |
---|---|
static java.lang.String |
__VERSION
File Version |
static java.lang.String |
CHARSET
Form field identifier : select output file path. |
static java.lang.String |
DEMAND_OVERWRITE_FILE
Application end. |
static java.lang.String |
DEMAND_PREVIEW
User demand identifier : show preview of saved data. |
static java.lang.String |
EXPORT_SELECTION
Form field identifier : Checkbox only selected values (default is unchecked). |
static java.lang.String |
FIELD_SEP
Default field separator in saves. |
static java.lang.String |
PREVIEW_AREA
Id of the preview area. |
static int |
PREVIEW_HEIGHT
Preview area height. |
static int |
PREVIEW_WIDTH
Preview area width. |
static java.lang.String |
SELECT_EXPORT_TYPE
Form field identifier : export type, either SELECT_EXPORT_TYPE_SPREADSHHET or SELECT_EXPORT_TYPE_TEXT or SELECT_EXPORT_TYPE_RAW or SELECT_EXPORT_TYPE_XML. |
static java.lang.String |
SELECT_EXPORT_TYPE_RAW
Form field value identifier : export text formated value. |
static java.lang.String |
SELECT_EXPORT_TYPE_SPREADSHEET
Form field value identifier : export text formated value. |
static java.lang.String |
SELECT_EXPORT_TYPE_TEXT
Form field value identifier : export text formated value. |
static java.lang.String |
SELECT_EXPORT_TYPE_XML
Form field value identifier : export text formated value. |
static java.lang.String |
SELECT_FIELD_PREFIX
Form field identifier |
static java.lang.String |
SELECT_FIELD_RENAME_EXTENSION
Form field identifier |
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 that should be saved. |
static java.lang.String |
SELECT_FILE
Form field identifier : select output file path. |
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 saves. |
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 | |
---|---|
LyExportController(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. |
void |
export(java.lang.String filePath,
java.util.Vector<LyFieldInfo> fields,
java.lang.String fieldSep,
java.lang.String valueSep,
java.lang.String exportType)
Save the objects to the file. |
java.lang.String |
exportAsString(java.util.Vector<LyFieldInfo> fields,
java.lang.String fieldSep,
java.lang.String valueSep,
java.lang.String exportType)
Export the objects as a single string. |
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 associated to this form. |
LyObjectList |
getContent()
Get content of the chart. |
java.lang.String |
getExportCharset()
Accessor to the export charset. |
java.lang.String |
getExportType()
Accessor to the export type selected in the GUI. |
java.io.File |
getFile()
Accessor to the file. |
java.lang.Object |
getParameterValue(java.lang.String parameterName)
Returns the value of a given parameter set on current export action. |
java.lang.String |
getTemporaryFileName(java.lang.String exportType)
Access to a temporary file path to store content. |
java.lang.String |
getTemporaryFileName(java.lang.String exportType,
java.lang.String prefix,
java.lang.String extension)
Access to a temporary file path to store content. |
boolean |
isSilent()
Checks if this export is in silent mode. |
boolean |
isViewResizable()
Indicates if the view for this import controller is resizable. |
void |
preview(java.util.Vector<LyFieldInfo> fields,
java.lang.String fieldSep,
java.lang.String valueSep)
Preview the exported data. |
void |
questionAnswer(boolean result,
java.lang.Object clientData)
Answer to a askQuestion request. |
void |
setFile(java.io.File f)
Accessor to the file. |
void |
showExportForm()
Shows the export form. |
void |
showView()
Overridden to ensure that export form is displayed. |
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 |
---|
public static final java.lang.String __VERSION
public static final java.lang.String DEMAND_OVERWRITE_FILE
public static final java.lang.String DEMAND_PREVIEW
public static final java.lang.String PREVIEW_AREA
public static final int PREVIEW_WIDTH
public static final int PREVIEW_HEIGHT
public static final java.lang.String SELECT_FIELDINFOS
public static final java.lang.String SELECT_EXPORT_TYPE
public static final java.lang.String SELECT_EXPORT_TYPE_TEXT
public static final java.lang.String SELECT_EXPORT_TYPE_SPREADSHEET
public static final java.lang.String SELECT_EXPORT_TYPE_RAW
public static final java.lang.String SELECT_EXPORT_TYPE_XML
public static final java.lang.String SELECT_FIELD_SEP
public static final java.lang.String SELECT_VALUE_SEP
public static final java.lang.String SELECT_FIELD_PREFIX
public static final java.lang.String SELECT_FIELD_RENAME_EXTENSION
public static final java.lang.String EXPORT_SELECTION
public static final java.lang.String SELECT_FILE
public static final java.lang.String CHARSET
public static java.lang.String FIELD_SEP
public static java.lang.String VALUE_SEP
public static java.lang.String SPREADSHEET_FIELD_SEP
public static java.lang.String SPREADSHEET_VALUE_SEP
Constructor Detail |
---|
public LyExportController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo, LyObjectList objects)
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. If an action is specified, the controller uses action
parameters (action name, action specific XML view description ...)classInfo
- This parameter is used when the objects list contains objects of different
classes to known which class is exported.objects
- list of objects that should be saved.Method Detail |
---|
public void showView()
showView
in class LyAreaController
public java.lang.Class<?> getBehaviorInterface()
getBehaviorInterface
in class LyAreaController
public void actionDemand(LyActionDemand demand)
This method is called by demandPerformed.
At this level, the implementation handles demands of type LyActionDemand.TYPE_ACTION : LyFormController.DEMAND_VALIDATE, LyExportController.DEMAND_PREVIEW, and LyExportController.DEMAND_CANCEL
actionDemand
in class LyAreaController
demand
- demand parameters sent by the view component.LyController.demandPerformed(leon.view.event.LyDemand)
public java.lang.Object getParameterValue(java.lang.String parameterName)
parameterName
- the name of the parameter which value must be retrieved.
public java.lang.String getTemporaryFileName(java.lang.String exportType)
exportType
- an export type
public java.lang.String getTemporaryFileName(java.lang.String exportType, java.lang.String prefix, java.lang.String extension)
exportType
- the export typeprefix
- a prefixextension
- an extension
public java.lang.String exportAsString(java.util.Vector<LyFieldInfo> fields, java.lang.String fieldSep, java.lang.String valueSep, java.lang.String exportType)
fields
- list of fieldInfos that should be saveed to the file.fieldSep
- separator between fields (columns)valueSep
- separator between multiple valuesexportType
- type of data to export : Possible values are SELECT_EXPORT_TYPE_TEXT
(.txt), SELECT_EXPORT_TYPE_RAW (.res), SELECT_EXPORT_TYPE_SPREADSHEET
(.csv) or SELECT_EXPORT_TYPE_XML (.xml).
public void export(java.lang.String filePath, java.util.Vector<LyFieldInfo> fields, java.lang.String fieldSep, java.lang.String valueSep, java.lang.String exportType)
filePath
- path of the save filefields
- list of fieldInfos that should be saveed to the file.fieldSep
- separator between fields (columns)valueSep
- separator between multiple valuesexportType
- type of data to export : Possible values are SELECT_EXPORT_TYPE_TEXT
(.txt), SELECT_EXPORT_TYPE_RAW (.res), SELECT_EXPORT_TYPE_SPREADSHEET
(.csv) or SELECT_EXPORT_TYPE_XML (.xml).public void questionAnswer(boolean result, java.lang.Object clientData)
questionAnswer
in interface LyQuestionAnswerInterface
result
- true if the user has clicked on Yes or OkclientData
- data specified in the askQuestion methodLyQuestionAnswerInterface
public void preview(java.util.Vector<LyFieldInfo> fields, java.lang.String fieldSep, java.lang.String valueSep)
fields
- list of fieldInfos that should be exported to the file.fieldSep
- separator between fields (columns)valueSep
- separator between multiple valuespublic void showExportForm()
public LyObjectList getContent()
getContent
in class LyAreaController
public LyClassInfo getClassInfo()
getClassInfo
in class LyAreaController
public boolean isViewResizable()
isViewResizable
in class LyAreaController
public java.lang.String getExportType()
public java.lang.String getExportCharset()
public java.io.File getFile()
public void setFile(java.io.File f)
f
- file to savepublic boolean isSilent()
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |