com.jalios.jcms.stat
Class RawDataExportHandler

java.lang.Object
  extended by com.jalios.jcms.stat.RawDataExportHandler
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
CSVExportRawDataHandler, XmlRawDataExportHandler

public abstract class RawDataExportHandler
extends Object
implements Cloneable

Abstract class of all Raw data export handler

Since:
JCMS 6.3
Author:
Ludovic SMADJA

Field Summary
protected  String key
           
protected  OutputStream out
           
protected  OutputStream realOutput
           
static String REVISION
           
protected  boolean useCompressStream
           
protected  String userLang
           
 
Constructor Summary
RawDataExportHandler()
           
 
Method Summary
 Object clone()
           
abstract  String convertField(String name, Class<?> clazz, Set<?> valueSet, String extraFieldName, String userLang)
          convert field to handler data
abstract  List<String> duplicateHeader(String string, Class<?> clazz)
          indicate if a field have other representation (like member have id and also a name)
abstract  void end(OutputStream out)
          Process end of export (after any write)
abstract  void exportFooter(OutputStream out, String[] columnNames)
          export footer of data
abstract  void exportHeader(OutputStream out, String[] columnNames)
          Export header of data
abstract  void exportLine(OutputStream out, String[] data)
          Export a line of data
abstract  String getConfigurationFragmentPath()
          indicates the path of the jsp fragment with driver configuration fields
abstract  String getContentType()
           
abstract  String getFileExtension()
           
 String getKey()
           
 OutputStream getOut()
           
 String getUserLang()
           
abstract  void init(OutputStream out)
          Initialise the handler (before any write)
 boolean isUseCompressStream()
           
 void setKey(String key)
           
 void setOut(OutputStream out)
           
 void setParameters(JcmsContext context)
          update handler from parameters form
 void setUseCompressStream(boolean useCompressStream)
           
 void setUserLang(String userLang)
           
 boolean validateParameters(JcmsContext context)
          validate current parameter.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values

out

protected OutputStream out

realOutput

protected OutputStream realOutput

useCompressStream

protected boolean useCompressStream

key

protected String key

userLang

protected String userLang
Constructor Detail

RawDataExportHandler

public RawDataExportHandler()
Method Detail

getUserLang

public String getUserLang()

setUserLang

public void setUserLang(String userLang)

getOut

public OutputStream getOut()

setOut

public void setOut(OutputStream out)

isUseCompressStream

public boolean isUseCompressStream()

setUseCompressStream

public void setUseCompressStream(boolean useCompressStream)

getKey

public String getKey()

setKey

public void setKey(String key)

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

setParameters

public void setParameters(JcmsContext context)
update handler from parameters form

Parameters:
context - the current JcmsContext

validateParameters

public boolean validateParameters(JcmsContext context)
validate current parameter.

Parameters:
context - the JcmsContext
Returns:
true if parameters are valid, false otherwise

getConfigurationFragmentPath

public abstract String getConfigurationFragmentPath()
indicates the path of the jsp fragment with driver configuration fields

Returns:
the fragment path

exportLine

public abstract void exportLine(OutputStream out,
                                String[] data)
                         throws IOException
Export a line of data

Parameters:
out - outputstream associated to this handler
data - the data array
Throws:
IOException

exportHeader

public abstract void exportHeader(OutputStream out,
                                  String[] columnNames)
                           throws IOException
Export header of data

Parameters:
out - outputstream associated to this handler
columnNames - the names of columns
Throws:
IOException

exportFooter

public abstract void exportFooter(OutputStream out,
                                  String[] columnNames)
                           throws IOException
export footer of data

Parameters:
out - outputstream associated to this handler
columnNames - footer data
Throws:
IOException

init

public abstract void init(OutputStream out)
                   throws IOException
Initialise the handler (before any write)

Parameters:
out - outputstream associated to this handler
Throws:
IOException

end

public abstract void end(OutputStream out)
                  throws IOException
Process end of export (after any write)

Parameters:
out - outputstream associated to this handler
Throws:
IOException

convertField

public abstract String convertField(String name,
                                    Class<?> clazz,
                                    Set<?> valueSet,
                                    String extraFieldName,
                                    String userLang)
convert field to handler data

Parameters:
name - the name of the field (see StatEntry.STAT_FIELDS)
clazz - the class of the field (see StatEntry.STAT_FIELDS_CLASS)
valueSet - the Set of value
extraFieldName - the duplicate field name if used
userLang - the current language
Returns:
the converted value to export

duplicateHeader

public abstract List<String> duplicateHeader(String string,
                                             Class<?> clazz)
indicate if a field have other representation (like member have id and also a name)

Parameters:
string - the name of the field (see StatEntry.STAT_FIELDS)
clazz - the class of the field (see StatEntry.STAT_FIELDS_CLASS)
Returns:
the List of other representation name

getFileExtension

public abstract String getFileExtension()
Returns:
the file extension of generated file

getContentType

public abstract String getContentType()
Returns:
the content type of the generated file


Copyright © 2001-2010 Jalios SA. All Rights Reserved.