|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object | +--intradoc.data.DataBinder
| Field Summary | |
static int |
CONTENT_ERROR
|
static java.lang.String[] |
DATA_TYPES
List of allowable section keyword tags of the form @keyword tag. |
static int |
DOWNLOAD_FORMAT
|
static int |
HDA_FORMAT
|
java.util.Stack |
m_activeResultSets
|
IdcDateFormat |
m_blDateFormat
|
java.util.Properties |
m_blFieldTypes
|
java.lang.String |
m_boundary
|
byte[] |
m_boundaryBytes
|
java.io.BufferedReader |
m_bufReader
|
boolean |
m_checkLocalLocalization
|
boolean |
m_checkResultSetLocalization
|
java.lang.String |
m_clientEncoding
Indicates client encoding. |
java.lang.String |
m_contentType
|
boolean |
m_convertDatabaseDateFormats
|
ResultSet |
m_currentResultSet
|
java.lang.String |
m_currentSetName
|
boolean |
m_determinedDataDateFormat
|
boolean |
m_determinedEncoding
Indicates if encoding has been determined. |
java.util.Properties |
m_environment
|
static long |
m_fileCounter
|
boolean |
m_hasAttachedFiles
This flag is set to true internally during a file upload or externally to true if this binder is to be used for a multipart upload. |
java.io.BufferedInputStream |
m_inStream
|
boolean |
m_ioLocalOnly
Set to true if result sets should not be serialized along with the local data. |
boolean |
m_isCgi
Set to true to indicate that the stream being parsed should be assumed to have come from a Intradoc HTML page post using the CGI encoding of characters. |
boolean |
m_isExternalRequest
Used to indicate whether this object was parsed from an external source (such as an HTTP request through a web server. |
boolean |
m_isGet
Set to true if the DataBinder was parsed from a client request that emulated a browser request put did not have any post data, i.e. |
boolean |
m_isJava
Used to indicate whether this object should be sent back to the browser as an HTML page or a raw data to an applet. |
boolean |
m_isNonStandardResponse
Indicates we are using a non-standard response. |
boolean |
m_isSkipFile
By default, this is set to true and is used only during a multipart upload, i.e. |
boolean |
m_isSuspended
If true, indicates that the input stream has been suspended. |
java.lang.String |
m_javaEncoding
Indicates what java encoding to use. |
java.util.Properties |
m_localData
|
IdcDateFormat |
m_localeDateFormat
|
java.util.Properties |
m_localizedFields
|
java.util.Hashtable |
m_localizedResultSets
|
java.util.Hashtable |
m_optionLists
|
java.util.Vector |
m_optListSuggestedOrder
|
java.lang.String |
m_overrideTempDir
|
byte[] |
m_postDataBuf
|
ReportProgress |
m_progress
|
java.util.Vector |
m_rawData
|
byte[] |
m_rawPostData
|
long |
m_remainingLength
Indicates the content length still to be read from a multipart input stream. |
java.util.Hashtable |
m_resultSets
|
java.util.Vector |
m_rsetSuggestedOrder
|
java.lang.String |
m_suspendedFileKey
Indicates the file at which the multipart post was suspended. |
byte[] |
m_tempByteBuf
|
static java.lang.String |
m_tempDir
|
java.util.Vector |
m_tempFiles
|
char[] |
m_tmpCharArray
|
java.util.Vector |
m_unstructuredData
|
static int |
MULTIPART_CONTENT
|
static int |
UNKNOWN_FORMAT
|
static int |
UPLOAD_FORMAT
|
static int |
URLENCODED_CONTENT
|
| Constructor Summary | |
DataBinder()
Default constructor. |
|
DataBinder(boolean isJava)
|
|
DataBinder(java.util.Properties env)
Constructor with the environment data being assigned as a parameter. |
|
| Method Summary | |
void |
addLocaleFields(ResultSet rset)
Retrieves information about columns in a result set and uses them to enhance the 'type' information for local data. |
void |
addOptionList(java.lang.String name,
java.util.Vector options)
Adds a Vector array of strings to be used as an option list. |
ResultSet |
addResultSet(java.lang.String name,
ResultSet rset)
Adds a result set to this object. |
void |
addTempFile(java.lang.String name)
Adds a name to the list of temp files |
boolean |
attemptRawSynchronizeLocale(ResultSet rset)
Attempts to see if the result set is either already has a matching locale information or whether it can easilty be coerced. |
void |
cleanUpTempFiles()
Delete all the temporary files. |
void |
clearResultSets()
Wipes out all current result sets cached in the DataBinder. |
java.lang.String |
convertToSystem(java.lang.String key,
java.lang.String value)
Takes a value in standard format (ex: standard date format) and converts it to a system format (ex: date format becomes JDBC format). |
void |
copyLocalDataStateShallow(DataBinder binder)
|
void |
copyResultSetStateShallow(DataBinder binder)
|
DataBinder |
createShallowCopy()
Creates a shallow copy of the DataBinder so that the DataBinder will share pointers to all the data objects (such as the name value pairs and result sets) but not the other attributes (such the encoding/decoding rules for serialization or the current active Reader or Writer objects). |
DataBinder |
createShallowCopyCloneResultSets()
Does shallow copy but makes clone copy of hashtable containing result sets. |
java.lang.String |
decode(java.lang.String in)
Implements the DataDecode interface. |
void |
determineLocaleChecks()
Determines what type of fixup this DataBinder will require. |
java.lang.String |
displayProperties(java.util.Properties props)
Turns a Properties object into an HTML displayable format. |
java.lang.String |
displayResultSet(java.lang.String name,
ResultSet rset)
Creates an HTML displayable format of a result set. |
java.lang.String |
encode(java.lang.String in)
Encodes a string using hda style encoding for a value. |
java.lang.String |
get(java.lang.String key)
This calls getEx(key, false, true, true, true). |
java.lang.String |
get(java.lang.String key,
boolean isActive)
This calls getEx(key, isActive, true, !isActive, true). |
java.lang.String |
getActiveAllowMissing(java.lang.String key)
This calls getEx(key, true, true, false, false). |
ResultSet |
getActiveSet(java.lang.String name)
Searches through the stack of active result sets and tries to find the one with the particular key. |
java.lang.String |
getActiveValue(java.lang.String key)
This calls getEx(key, true, true, false, true). |
java.lang.String |
getActiveValueSearchAll(java.lang.String key)
This calls getEx(key, true, true, true, true). |
java.lang.String |
getAllowMissing(java.lang.String key)
This calls getEx(key, true, true, true, false). |
java.lang.String |
getContentType()
Gets the current HTTP header strings for describing the content of the file or page being returned. |
ResultSet |
getCurrentActiveResultSet()
Returns the result set that is considered to be the most recently made active. |
java.util.Properties |
getEnvironment()
Returns the Properties object that holds the environment values for this object. |
java.lang.String |
getEnvironmentValue(java.lang.String key)
Gets an environment value. |
java.lang.String |
getEx(java.lang.String key,
boolean fromActiveSets,
boolean fromLocal,
boolean fromAllSets,
boolean mustExist)
Searches through all the data in this object. |
java.lang.String |
getFromSets(java.lang.String key)
This calls getEx(key, true, false, true, true). |
java.lang.String |
getLocal(java.lang.String key)
Gets a value from local data. |
java.util.Properties |
getLocalData()
Returns the Properties object that holds the local data. |
static long |
getNextFileCounter()
|
java.util.Vector |
getOptionList(java.lang.String name)
Gets a Vector array of strings. |
java.util.Enumeration |
getOptionLists()
Returns an Enumeration of all the lookup keys for the option lists. |
ResultSet |
getResultSet(java.lang.String name)
Gets the result set using the lookup key. |
java.util.Enumeration |
getResultSetList()
Gets an enumeration list of lookup keys for all the result sets in this object. |
java.lang.String |
getResultSetValue(ResultSet rset,
java.lang.String key)
Gets a value out of a result set. |
protected java.lang.String |
getResultSetValueWithFieldInfo(ResultSet rset,
FieldInfo info)
|
java.lang.String |
getSearchAllAllowMissing(java.lang.String key)
This calls getEx(key, false, true, true, false). |
java.lang.String |
getSystem(java.lang.String key)
This method is equivalent to get(key) except that dates are put into the ODBC format for direct use in SQL queries. |
java.util.Vector |
getTempFiles()
|
static java.lang.String |
getTemporaryDirectory()
Get the directory for temporary files created on upload. |
static java.lang.String |
header()
A suggested HTTP response header string. |
static java.lang.String |
htmlBottom()
Standard HTML page end. |
static java.lang.String |
htmlTop(java.lang.String title)
Standard HTML page start. |
java.lang.String |
localizeLocal(java.lang.String key,
java.lang.String value)
Localizes value from internal DataBinder locale values to destination locale values (except for message strings). |
void |
merge(DataBinder newData)
Merges data from one DataBinder into another DataBinder. |
static void |
mergeHashTables(java.util.Hashtable current,
java.util.Hashtable newData)
Merges the contents of one Hashtable into another. |
void |
mergeHashTablesInternal(java.util.Hashtable current,
java.util.Hashtable newData,
DataBinder binder,
boolean isResultSets)
Merges the contents of one Hashtable into another. |
void |
mergeResultSetRowIntoLocalData(ResultSet rset)
Merges data from a result set into local data properties of a DataBinder. |
static void |
mergeVectors(java.util.Vector current,
java.util.Vector newData)
Merges the contents of one Vector into another. |
java.lang.String |
myBaseURL()
If this object was filled from a browser based GET or POST, this method returns the base URL for the web server that is handling the GET or POST. |
boolean |
nextRow(java.lang.String setName)
Advances the named result set to the next row. |
java.util.Date |
parseDate(java.lang.String key,
java.lang.String date)
|
void |
parseLocalParameters(java.lang.String params,
java.lang.String delimiter)
Deprecated. Use DataSerializeUtils.parseLocalParameters() |
ResultSet |
popActiveResultSet()
Removes the currently active result set from the stack of active result sets. |
void |
pushActiveResultSet(java.lang.String name,
ResultSet aSet)
Pushes a result set onto the stack of active result sets. |
java.lang.String |
putLocal(java.lang.String key,
java.lang.String value)
Puts a value into local data. |
java.lang.String |
putLocalDate(java.lang.String key,
java.util.Date value)
|
void |
receive(java.io.BufferedReader reader)
Calls receiveEx with the isHeaderOnly parameter set to false. |
void |
receiveEx(java.io.BufferedReader reader,
boolean isHeaderOnly)
Parses a stream and loads it into attributes of this object. |
void |
removeLocal(java.lang.String key)
Removes a value from local data. |
ResultSet |
removeResultSet(java.lang.String name)
Removes the result set from this object. |
void |
reportProgress(java.lang.String filename,
long amtDone)
|
void |
send(java.io.Writer writer)
Writes out the header, local data, and result sets in hda format (see documentation on basic component architecture for a description of this format). |
byte[] |
sendBytes(java.lang.String javaEncoding,
ExecutionContext cxt)
Similar to sendEx, except it uses a byte array to write the data binder values. |
void |
sendEx(java.io.Writer writer,
boolean sendHeader)
Writes out the local data and result sets in hda format (see documentation on basic component architecture for a description of this format). |
void |
sendWithEncoding(java.io.Writer writer,
java.lang.String javaEncoding)
Writes out data binder in a chosen encoding. |
void |
setContentType(java.lang.String type)
Sets a HTTP header style content type string. |
void |
setEncodeFlags(boolean cgiFlag,
boolean javaFlag)
Sets the encoding flags for parsing data that is received from a stream. |
void |
setEnvironment(java.util.Properties env)
Sets the Properties object that holds the environment values for this object. |
void |
setEnvironmentValue(java.lang.String key,
java.lang.String value)
Sets an enviroment value. |
void |
setFieldType(java.lang.String name,
java.lang.String type)
Explicitly sets a variable to be of a particular field type. |
static void |
setFileCounterStart()
|
void |
setLocalData(java.util.Properties localData)
Sets the Properties object that holds the local data. |
void |
setOverrideTemporaryDirectory(java.lang.String dir)
|
void |
setReportProgress(ReportProgress rp)
|
static void |
setTemporaryDirectory(java.lang.String dir)
Set the directory for temporary files created on upload. |
java.lang.String |
toString()
Debug dump of this object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public java.util.Properties m_environment
public java.util.Properties m_localData
public java.util.Hashtable m_optionLists
public java.util.Vector m_rawData
public byte[] m_rawPostData
public byte[] m_postDataBuf
public java.util.Hashtable m_resultSets
public java.util.Stack m_activeResultSets
public ResultSet m_currentResultSet
public java.lang.String m_currentSetName
public java.util.Vector m_unstructuredData
public boolean m_checkLocalLocalization
public boolean m_checkResultSetLocalization
public boolean m_determinedDataDateFormat
public boolean m_convertDatabaseDateFormats
public IdcDateFormat m_blDateFormat
public java.util.Properties m_blFieldTypes
public IdcDateFormat m_localeDateFormat
public java.util.Properties m_localizedFields
public java.util.Hashtable m_localizedResultSets
public java.util.Vector m_rsetSuggestedOrder
public java.util.Vector m_optListSuggestedOrder
public java.util.Vector m_tempFiles
public static java.lang.String m_tempDir
public java.lang.String m_overrideTempDir
public java.io.BufferedInputStream m_inStream
public byte[] m_tempByteBuf
public char[] m_tmpCharArray
public java.io.BufferedReader m_bufReader
public static long m_fileCounter
public static final int CONTENT_ERROR
public static final int URLENCODED_CONTENT
public static final int MULTIPART_CONTENT
public java.lang.String m_contentType
public static final int UNKNOWN_FORMAT
public static final int HDA_FORMAT
public static final int UPLOAD_FORMAT
public static final int DOWNLOAD_FORMAT
public boolean m_isExternalRequest
public boolean m_isJava
public boolean m_isCgi
decode(java.lang.String),
receive(java.io.BufferedReader),
#parseRequest,
send(java.io.Writer)public boolean m_isGet
public boolean m_ioLocalOnly
#parseRequestpublic static final java.lang.String[] DATA_TYPES
receive(java.io.BufferedReader),
decode(java.lang.String),
#parseRequest,
send(java.io.Writer)public long m_remainingLength
public boolean m_hasAttachedFiles
public boolean m_isSuspended
#parseRequestpublic boolean m_isSkipFile
#parseRequestpublic java.lang.String m_suspendedFileKey
public java.lang.String m_boundary
public byte[] m_boundaryBytes
public ReportProgress m_progress
public java.lang.String m_javaEncoding
public java.lang.String m_clientEncoding
public boolean m_determinedEncoding
public boolean m_isNonStandardResponse
| Constructor Detail |
public DataBinder()
public DataBinder(boolean isJava)
public DataBinder(java.util.Properties env)
env - Environment data to be used by this object.setEnvironment(java.util.Properties)| Method Detail |
public void clearResultSets()
public DataBinder createShallowCopy()
m_isJava,
m_isCgipublic DataBinder createShallowCopyCloneResultSets()
public void copyResultSetStateShallow(DataBinder binder)
public void copyLocalDataStateShallow(DataBinder binder)
public void merge(DataBinder newData)
newData - Source DataBinder object.public void mergeResultSetRowIntoLocalData(ResultSet rset)
public void mergeHashTablesInternal(java.util.Hashtable current,
java.util.Hashtable newData,
DataBinder binder,
boolean isResultSets)
mergeHashTables(java.util.Hashtable, java.util.Hashtable)
public static void mergeHashTables(java.util.Hashtable current,
java.util.Hashtable newData)
current - Target hashtable.newData - Source hastable.merge(intradoc.data.DataBinder)
public static void mergeVectors(java.util.Vector current,
java.util.Vector newData)
current - Target vector.newData - Source vector.merge(intradoc.data.DataBinder)
public java.util.Date parseDate(java.lang.String key,
java.lang.String date)
throws DataException
DataException
public java.lang.String getActiveValue(java.lang.String key)
throws DataException
key - Look up key.
DataException - If the key is not found.getEx
public java.lang.String getActiveValueSearchAll(java.lang.String key)
throws DataException
key - Look up key.
DataException - If the key is not found.getEx
public java.lang.String get(java.lang.String key)
throws DataException
get in interface Parameterskey - Look up key.
DataException - if the key is not foundgetEx
public java.lang.String getSystem(java.lang.String key)
throws DataException
getSystem in interface Parameterskey - Look up key.
DataException - if the key is not foundget
public java.lang.String get(java.lang.String key,
boolean isActive)
throws DataException
key - Look up key.isActive - Whether or not to search active result.
DataException - if the key is not foundgetExpublic java.lang.String getSearchAllAllowMissing(java.lang.String key)
key - Look up key.
getExpublic java.lang.String getAllowMissing(java.lang.String key)
key - Look up key.
getExpublic java.lang.String getActiveAllowMissing(java.lang.String key)
key - Look up key.
getEx
public java.lang.String getFromSets(java.lang.String key)
throws DataException
key - Look up key.
DataException - If the key is not found.getEx
public java.lang.String getEx(java.lang.String key,
boolean fromActiveSets,
boolean fromLocal,
boolean fromAllSets,
boolean mustExist)
throws DataException
key - Look up key.fromActiveSets - Whether or not to search result sets that are currently being
looped on. The active results sets are searched before any other result sets are searched.fromLocal - Whether or not to search local data (the name value pairs that are
available for this calling thread only).fromAllSets - Whether or not to search all result sets regardless of whether
they are active or not.mustExist - Whether or not to throw a DataException if 'key' is not found.
DataException - If the key is not found and mustExist is true, getEx will
throw a DataException, otherwise it will return null.getLocal(java.lang.String),
getEnvironmentValue(java.lang.String)
public java.lang.String getResultSetValue(ResultSet rset,
java.lang.String key)
protected java.lang.String getResultSetValueWithFieldInfo(ResultSet rset,
FieldInfo info)
public java.lang.String putLocal(java.lang.String key,
java.lang.String value)
key - Lookup key.value - Value to be assigned to key. Cannot be null.
public java.lang.String putLocalDate(java.lang.String key,
java.util.Date value)
public java.lang.String getLocal(java.lang.String key)
key - Lookup key.
public java.lang.String convertToSystem(java.lang.String key,
java.lang.String value)
public java.lang.String localizeLocal(java.lang.String key,
java.lang.String value)
key - Lookup key.value - Current value directory from local properties object.
public void removeLocal(java.lang.String key)
key - Lookup key.public java.util.Properties getLocalData()
Propertiespublic void setLocalData(java.util.Properties localData)
localData - The object that will now hold local data for this object.public java.util.Properties getEnvironment()
getLocalData()public void setEnvironment(java.util.Properties env)
env - Environment data to be searched by the 'getXXX(...)' functions. The
environment data is searched as a last resort for finding name value pairs. Generally
the environment data contains global variables and/or variables (such as REMOTE_USER)
set by the web browser on a CGI call.
Data in the environment variables is always trusted and nevers needs an authenticated
user to authorize the usage of the data. The environment data is not serialized to or
from files nor is it received by or sent to browser applets.getEnvironment(),
setLocalData(java.util.Properties)public java.lang.String getEnvironmentValue(java.lang.String key)
key - A lookup key.
getLocal(java.lang.String)
public void setEnvironmentValue(java.lang.String key,
java.lang.String value)
key - A lookup key.value - A environment value assigned to the key.public ResultSet getCurrentActiveResultSet()
public void addOptionList(java.lang.String name,
java.util.Vector options)
name - The lookup key to use for this option list.options - A Vector of strings holding the option list.public java.util.Vector getOptionList(java.lang.String name)
name - The lookup key for the option list.
addOptionList(java.lang.String, java.util.Vector)public java.util.Enumeration getOptionLists()
public boolean nextRow(java.lang.String setName)
throws java.io.IOException
setName - The name of result set being advanced.
java.io.IOException - Thrown if error while advancing result set.public ResultSet popActiveResultSet()
nextRow(java.lang.String)
public void pushActiveResultSet(java.lang.String name,
ResultSet aSet)
name - The lookup key for the result set.aSet - The result set to push on the stack.popActiveResultSet(),
nextRow(java.lang.String)public ResultSet getActiveSet(java.lang.String name)
name - The lookup key for the active result set.
public java.util.Enumeration getResultSetList()
public ResultSet getResultSet(java.lang.String name)
name - The lookup key for the result set.
public ResultSet addResultSet(java.lang.String name,
ResultSet rset)
name - The lookup key to use for retrieving this result set.rset - The result set being added to this object.
public ResultSet removeResultSet(java.lang.String name)
public void setFieldType(java.lang.String name,
java.lang.String type)
public void addLocaleFields(ResultSet rset)
public boolean attemptRawSynchronizeLocale(ResultSet rset)
public void determineLocaleChecks()
public void send(java.io.Writer writer)
throws java.io.IOException
java.io.IOException
public void sendWithEncoding(java.io.Writer writer,
java.lang.String javaEncoding)
throws java.io.IOException
java.io.IOException
public void sendEx(java.io.Writer writer,
boolean sendHeader)
throws java.io.IOException
java.io.IOException
public byte[] sendBytes(java.lang.String javaEncoding,
ExecutionContext cxt)
throws java.io.IOException
java.io.IOException
public void receive(java.io.BufferedReader reader)
throws java.io.IOException
reader - The stream being parsed.
java.io.IOException - Thrown if there is an error reading from the stream.
DataException - Thrown if there is a data integrity error.receiveEx(java.io.BufferedReader, boolean),
send(java.io.Writer)
public void receiveEx(java.io.BufferedReader reader,
boolean isHeaderOnly)
throws java.io.IOException
reader - The stream being parsed. Note: this method assumes that 'reader'
will provide a clean termination point for consumption. This method does
not provide for partial reads based on expected response length
or for issues such as persisting connections (i.e. keep alive logic). Such complex
issues must be negotiated by the underlying input source (for example, the input
stream from a response to an Http request using the java.net.HttpUrlConnection
object has a built in termination point created from the Content-Length HTTP response
header).isHeaderOnly - If set to true, then only the local data and the field names
of the first result set are read in. This allows sampling of a very large hda
file.
java.io.IOException - Thrown if there is an error reading from the stream.
DataException - Thrown if there is a data integrity error.m_isCgi,
#parseRequest,
receive(java.io.BufferedReader),
send(java.io.Writer)
public void parseLocalParameters(java.lang.String params,
java.lang.String delimiter)
public void setEncodeFlags(boolean cgiFlag,
boolean javaFlag)
cgiFlag - New value of m_isCgi.javaFlag - New value of m_isJavam_isCgi,
m_isJavapublic java.lang.String decode(java.lang.String in)
decode in interface DataDecodein - The string to decode.
DataDecode,
encode(java.lang.String),
m_isCgipublic java.lang.String encode(java.lang.String in)
| \ -> \\ |
| cr -> \r |
| lf -> \n |
| @ -> \@ |
in - The string to encode.
decode(java.lang.String)public java.util.Vector getTempFiles()
public void addTempFile(java.lang.String name)
name - The name of the file, including local pathpublic void cleanUpTempFiles()
public static void setTemporaryDirectory(java.lang.String dir)
public static java.lang.String getTemporaryDirectory()
public static void setFileCounterStart()
public static long getNextFileCounter()
public void setOverrideTemporaryDirectory(java.lang.String dir)
public void setReportProgress(ReportProgress rp)
public void reportProgress(java.lang.String filename,
long amtDone)
public static java.lang.String header()
toStringpublic void setContentType(java.lang.String type)
type - HTTP header style string describing content being returned.getContentType()public java.lang.String getContentType()
setContentType(java.lang.String)public static java.lang.String htmlTop(java.lang.String title)
title - The title of the HTML page.
toString()public static java.lang.String htmlBottom()
htmlTop(java.lang.String),
toString()public java.lang.String myBaseURL()
toString()public java.lang.String displayProperties(java.util.Properties props)
props - Properties object to present.
toString()
public java.lang.String displayResultSet(java.lang.String name,
ResultSet rset)
name - The lookup key for the result set.rset - The result set.
toString()public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
(c) 1996-2005 All rights reserved. Stellent, Inc. |