|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.spardat.xma.datasource.RessourceBundleProviderServer
Provides tabular data from a RessourceBundle. The specification of these kind of data sources must follow the syntax
type=rsc,bundle=at.spardat. ... .MyBundlei.e., the type must be the reserverd word rsc and a second attribute named bundle indicates the name of the ressource bundle where the values are extracted from.
The most typical usage are properties-files to implement ressource bundles. The following
paragraph defines how properties files are mapped to TabularData objects, which
are used from the XMA application to programmatically access the tabular data. We start
with an example. Suppose our table should have the following columns:
column name column type ---------------------------------------- lastName String datBirth Date ynMarried Boolean betIncome Numericthen a properties file providing the actual data looks like:
COLS = lastName,datBirth,ynMarried,betIncome 10 = "Huber",D19720101,BY,N100000.23 20 = "Maier",D19661110,BN,N20000.00 50 = "Lilly",D20030101,B ,NThere must be one line with the key COLS that provides the name of the columns. The remaining lines must have a numeric key that indicates the order of the lines (since the lines in property files are unordered).
Each value (the part after the equal sign) contains the cells of the table rows, separated
by comma. String types are delimited with quotes. If the string value should contain a
quote, praefix it with double backslash (i.e., \\"). Date values start with a D and a date
followed in the ISO-format, i.e., YYYYMMDD. Booleans start with a B as type
sign, followed by Y or N. Numeric values start with N, followed
by a numeric string as defined by Double.parseDouble(java.lang.String).
Empty Strings must be specified via double quotes, i.e., quotes with no text in between. All other empty types must start with the type character without following text, e.g., N with no trailing text denotes an empty numeric.
If the provided table holds domain data, a property file must look like this:
COLS = COD_KEY,SHORT_VALUE,LONG_VALUE,VALID_FROM,VALID_TO 10 = "ab", "ab", "abgetreten",D20030101,D20030720 20 = "we", "we", "weggetreten",D20030101,D20030719
| Constructor Summary | |
RessourceBundleProviderServer()
|
|
| Method Summary | |
int |
getExpireDurationClientSecs(java.lang.String type)
Returns 30 days, which de facto means never. |
int |
getExpireDurationServerSecs(java.lang.String type)
Returns 30 days, which de facto means never. |
ProviderResultServer |
provideTable(XMASession session,
TableSpec spec,
long lastModified)
This method is requested to provide a table in the form of a ITabularData.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RessourceBundleProviderServer()
| Method Detail |
public ProviderResultServer provideTable(XMASession session,
TableSpec spec,
long lastModified)
ITableProviderITabularData.
If lastModified is not specified (if it is ITabularDataSource.UNKNOWN_TIMESTAMP),
the callee must return the table.
If lastModified is defined, the callee must provide a table if and only
if the modification time changed. If the time of the last modification is still
lastModified, the returned table in the result data may be null.
The latter form has the semantics of an HTTP conditional get where the ressource
is unchanged. This method is intended to be overwritten (extended) by XMA projects that must handle their own types of data sources.
provideTable in interface ITableProvidersession - the active XMASessionspec - a table specification as defined in ITabularDataSource.
The following properties are always contained in spec:
XMAContext
and are included because they are needed as keys in any cache.lastModified - may be either UNKNOWN_TIMESTAMP to unconditionally request the data or
a timestamp which indicates a lastModified timestamp which
has been delivered (presumably some time ago) and the callee is requested
to provide the table if it has changed since that time.
The units are number of milliseconds since 1.1.1970 UTC.
XMATabularDataSourceServer.UNKNOWN_TIMESTAMP,
the returned object must not be null. Otherwise
null may be returned which indicates that the table did not change
with respect to lastModified. If the callee returns
a table, the value objects last modified timestamp may be set
or not, depending on whether the callee is able to compute a
last modified timestamp.ITableProvider.provideTable(at.spardat.xma.session.XMASession, at.spardat.xma.datasource.TableSpec, long)public int getExpireDurationClientSecs(java.lang.String type)
getExpireDurationClientSecs in interface ITableProviderITableProvider.getExpireDurationClientSecs(java.lang.String)public int getExpireDurationServerSecs(java.lang.String type)
getExpireDurationServerSecs in interface ITableProviderITableProvider.getExpireDurationServerSecs(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||