LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.peer.xml
Class LyXmlExportRequestEncoder

java.lang.Object
  extended by leon.peer.LyRequestEncoder
      extended by leon.peer.file.LyFileRequestEncoder
          extended by leon.peer.xml.LyXmlRequestEncoder
              extended by leon.peer.xml.LyXmlExportRequestEncoder

public class LyXmlExportRequestEncoder
extends LyXmlRequestEncoder

This class is used to encode objects in the xml export format.

See Also:
LyRequestEncoder

Nested Class Summary
static class LyXmlExportRequestEncoder._LyClassInfoHandler
          Handler used to retrieve class infos contained in an XML file.
 
Field Summary
static java.lang.String __VERSION
           
static java.lang.String LOCAL_FIELD_IMPORT_EXTENSION
           
static boolean SUBDIR_FOR_SCHEMA
          Create a sub-directory for packages that contain classes.
 
Fields inherited from class leon.peer.xml.LyXmlRequestEncoder
TYPE_DEFAULT
 
Fields inherited from class leon.peer.file.LyFileRequestEncoder
_environment, _fieldSep, _valueSep, EMPTY_CHARSET, EXPORT_ENCODING, RAW_ENCODING, SPREADSHEET_ENCODING, TEXT_ENCODING, XML_EXPORT_ENCODING
 
Constructor Summary
LyXmlExportRequestEncoder(LyDataProvider provider, LyDataSource dataSource, java.lang.String fieldSep, java.lang.String valueSep)
          Constructor.
 
Method Summary
 org.xml.sax.helpers.DefaultHandler buildHandler()
          Return the default handler for this provider.
 org.xml.sax.InputSource convertSourceVersion(org.xml.sax.InputSource source)
          Deprecated. OLD_IMPORT : reported in LyImportContentXmlController
 java.util.Vector<java.lang.String> encodeClassInfo(LyClassInfo classInfo, java.util.Vector<LyFieldInfo> fields)
          Read a set of objects and return a set of lines for xml export encoding.
 java.util.Vector<java.lang.String> encodeValues(java.util.Vector<LyObject> objects, java.util.Vector<LyFieldInfo> fields)
          Read a set of objects and return a set of lines for xml export encoding.
 java.lang.Object fromString(LyField field, java.lang.String str)
           
static java.util.Vector<java.lang.String> getClassInfosNames(java.lang.String filePath)
          Return the list of class infos names from the given XML file.
static java.util.Vector<java.lang.String> getClassInfosNamesFromBuffer(java.lang.String xml)
          Return the list of class infos names from the given XML file.
 void skipFooter(boolean status)
          Skip root tag generation (only write XML content in the root tag).
 void skipHeader(boolean status)
          Skip root tag generation (only write XML content in the root tag).
 java.lang.String writeFooter()
          Write the footer of the export xml file.
 java.lang.String writeHeader()
          Write the header of the export xml file.
 
Methods inherited from class leon.peer.xml.LyXmlRequestEncoder
createObject, deleteObject, encodeValue, encodeValues, getObject, getObjects, getSize, getSize, init, saveObjects, setObject, setObjects, setResponse, writeToConnection, writeToConnection
 
Methods inherited from class leon.peer.file.LyFileRequestEncoder
asciiEncode, decodeHeader, decodeValue, decodeValues, decodeValues, encodeHeader, encodeValue, fromString, getEnvironment, getFieldSeparator, getValueSeparator, readFromConnection, setEnvironment, setHeaderMark
 
Methods inherited from class leon.peer.LyRequestEncoder
deleteObjects, getClassBinding, getDataClass, getProvider, getResponse, isSynchronous, loadObject, setClassBinding, setDataClass, toString, toString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

LOCAL_FIELD_IMPORT_EXTENSION

public static final java.lang.String LOCAL_FIELD_IMPORT_EXTENSION
See Also:
Constant Field Values

SUBDIR_FOR_SCHEMA

public static boolean SUBDIR_FOR_SCHEMA
Create a sub-directory for packages that contain classes.

Constructor Detail

LyXmlExportRequestEncoder

public LyXmlExportRequestEncoder(LyDataProvider provider,
                                 LyDataSource dataSource,
                                 java.lang.String fieldSep,
                                 java.lang.String valueSep)
Constructor.

Parameters:
provider - The data provider.
dataSource - The datasource.
fieldSep - Separator between fields.
valueSep - Separator between values.
Method Detail

getClassInfosNames

public static java.util.Vector<java.lang.String> getClassInfosNames(java.lang.String filePath)
Return the list of class infos names from the given XML file.

Parameters:
filePath -
Returns:

getClassInfosNamesFromBuffer

public static java.util.Vector<java.lang.String> getClassInfosNamesFromBuffer(java.lang.String xml)
Return the list of class infos names from the given XML file.

Parameters:
xml - content
Returns:

writeHeader

public java.lang.String writeHeader()
Write the header of the export xml file.

Returns:
the header of the export xml file.

writeFooter

public java.lang.String writeFooter()
Write the footer of the export xml file.

Returns:
the footer of the export xml file.

encodeClassInfo

public java.util.Vector<java.lang.String> encodeClassInfo(LyClassInfo classInfo,
                                                          java.util.Vector<LyFieldInfo> fields)
Read a set of objects and return a set of lines for xml export encoding.

Parameters:
classInfo - the classInfo of the objects to encode.
fields - FieldInfos to save (if null save all).
Returns:
the set of lines describing the objects.

encodeValues

public java.util.Vector<java.lang.String> encodeValues(java.util.Vector<LyObject> objects,
                                                       java.util.Vector<LyFieldInfo> fields)
Read a set of objects and return a set of lines for xml export encoding.

Parameters:
objects - the set of objects to encode.
fields - FieldInfos to save (if null save all).
Returns:
the set of lines describing the set of objects.

fromString

public java.lang.Object fromString(LyField field,
                                   java.lang.String str)
Overrides:
fromString in class LyFileRequestEncoder

buildHandler

public org.xml.sax.helpers.DefaultHandler buildHandler()
Return the default handler for this provider.

Overrides:
buildHandler in class LyXmlRequestEncoder
Returns:
The default handler.

convertSourceVersion

public org.xml.sax.InputSource convertSourceVersion(org.xml.sax.InputSource source)
Deprecated. OLD_IMPORT : reported in LyImportContentXmlController

Apply XSLT Stylesheets to convert the source version of the XML File to latest version.

Overrides:
convertSourceVersion in class LyXmlRequestEncoder
Parameters:
input - source for parsing (input version)
Returns:
source the nw source after parsing (output version)

skipHeader

public void skipHeader(boolean status)
Skip root tag generation (only write XML content in the root tag).

Parameters:
status -

skipFooter

public void skipFooter(boolean status)
Skip root tag generation (only write XML content in the root tag).

Parameters:
status -
status -

(c) January 2013 - W4 S.A.

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