|
jacquard 1.12.0 by The Web Engineering Factory and Toolworks | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.co.weft.htform.ResourceConsumerImpl
uk.co.weft.htform.ResultFormatter
A ResultFormatter is just a wrapper around a ResultSet that knows how to lay itself out in a Context. This functionality will probably change: (i) ResultFormatter possibly should be a subclass of ResultSet; (2) in any case the whole functionality should probably be replaced by some form of DataTable class embedded in a Form in the same way that an Auxilliary is.
| Field Summary | |
protected java.util.Vector |
actionColumns
my action columns - columns of links which can be clicked on to do something with the rows |
boolean |
clickToOrder
should those headers be clickable to reorder the result? Normally they should. |
static int |
DEFAULTACTIONINDEX
the index within the actionColumns of the one which is default |
static java.lang.String |
DEFAULTACTIONLABEL
the default label on my action column, if none other is supplied |
RE |
emailRegExp
How do I recognise an email address? Less than perfect but will do for now. |
RE |
imageRegExp
How do I recognise an image? |
protected java.util.Vector |
inspectPassthroughTokens
a vector of tokens whose values should be passed through on inspects |
protected java.lang.String |
qbeButtonLabel
the label of the query-by-example submit widget |
protected int |
qbeWidgetMaxLength
the maximum length of a query-by-example widget input |
protected int |
qbeWidgetVisibleSize
the visible length of a query-by-example widget input |
boolean |
queryByExample
should I allow query by example? default is I should |
boolean |
recogniseLinks
Should I use my URLs to find and make clickable things which may sensibly be links? |
protected java.util.Vector |
reorderPassthroughTokens
a vector of tokens whose values should be passed through on reorders. |
java.lang.String |
searchToken
the token to search for in results - so that I can pass it on in reorder headers |
boolean |
showHeaders
should I show the field names as column headers? Normally yes |
boolean |
showId
should I show the id field? Normally yes. |
protected java.util.Hashtable |
suppressFields
a vector of names of fields to suppress in the display |
RE |
urlRegExp
How do I recognise a URL? Less than perfect but will do for now. |
| Fields inherited from class uk.co.weft.htform.ResourceConsumerImpl |
resourceBundleName |
| Fields inherited from interface uk.co.weft.htform.ResourceConsumer |
RESOURCEBUNDLEMAGICTOKEN |
| Constructor Summary | |
ResultFormatter()
The 'no arguments' constructor, used where the result formatter is to be pluggable, as in List from version 1.14 onwards. |
|
ResultFormatter(Contexts rs,
java.util.Calendar cal)
Deprecated. not thread-safe. Use zero-arg constructor with init(). |
|
ResultFormatter(Contexts rs,
java.util.Calendar cal,
java.lang.String selectAction,
java.lang.String selectField)
Deprecated. not thread-safe. Use zero-arg constructor with init(). |
|
ResultFormatter(Contexts rs,
java.util.Calendar cal,
java.lang.String selectAction,
java.lang.String idCol,
java.lang.String linkCol)
Deprecated. not thread-safe. Use zero-arg constructor with init(). |
|
ResultFormatter(java.sql.ResultSet rs,
java.util.Calendar cal)
Deprecated. not thread-safe. Use zero-arg constructor with init(). |
|
ResultFormatter(java.sql.ResultSet rs,
java.util.Calendar cal,
java.lang.String selectAction,
java.lang.String selectField)
Deprecated. not thread-safe. Use zero-arg constructor with init(). |
|
ResultFormatter(java.sql.ResultSet rs,
java.util.Calendar cal,
java.lang.String selectAction,
java.lang.String idCol,
java.lang.String linkCol)
Deprecated. not thread-safe. Use zero-arg constructor with init(). |
|
| Method Summary | |
void |
addActionColumn(ActionColumn col)
append this action column to my list of action columns |
void |
addActionColumn(java.lang.String label,
java.lang.String urlStub,
java.util.Vector passThroughs)
append an action column with this label and this URL stub, which will be extended by passing through the values of these passthrough tokens |
void |
addSuppressField(java.lang.String fieldToSuppress)
add the fields whose name is passed to the set of fieldnames which I will suppress (i.e. |
void |
addSuppressFields(java.util.Vector fieldsToSuppress)
add the fields whose names are listed in this vector to the set of fieldnames which I will suppress (i.e. |
protected java.lang.String |
composeActionURL(Context row)
Deprecated. use composeActionURL( Context, Context) |
protected java.lang.String |
composeActionURL(Context context,
Context row)
construct the default action URL with the correct embedded arguments for this row |
protected java.lang.String |
composeAllRowsURL(Context context,
Context showfields)
compose a (possibly relative) URL to pull all rows |
protected java.lang.String |
composePrevNextURL(Context context,
Context showfields,
int index)
compose a (possibly relative) URL to pull the next or previous page |
protected java.lang.String |
composeReorderURL(java.lang.String fieldName,
Context showfields,
Context context)
compose a (possibly relative) URL to reorder the list on this field |
void |
init(java.util.Calendar cal,
java.lang.String selectAction,
java.lang.String idCol,
java.lang.String linkCol)
Initialiser, to be called only if the no-arguments constructor is used (for example, where ResultFormatters are pluggable at run time). |
void |
layout(Context context)
Deprecated. not thread safe. Use layout( data, context). |
void |
layout(Contexts data,
Context context)
Lay me out in this context. |
void |
layout(java.sql.ResultSet data,
Context context)
Lay me out in this context. |
protected void |
layoutDataCell(int colNum,
int actionCol,
int urlCol,
Context context,
java.lang.String name,
Context row)
lay out a single data cell in the result. |
void |
layoutFirst(Context context)
Deprecated. no non-deprecated replacement at present. |
protected void |
layoutQueryWidget(Context context,
java.lang.String fieldname)
Layout a query-by-example widget for a column |
protected void |
layoutSubmitWidget(Context context)
layout the query-by-example 'match' button |
protected void |
maybeLayoutNavLinks(Contexts data,
Context context,
Context showfields,
javax.servlet.ServletOutputStream out)
if we have a maximum number of rows, print 'previous' and 'next' links as required |
void |
setActionLabel(java.lang.String label)
set my action label to this. |
void |
setInspectPassthroughTokens(java.util.Vector tokens)
|
boolean |
setRecogniseLinks(boolean val)
set whether or not I recognise (and make clickable) links. |
void |
setReorderPassthroughTokens(java.util.Vector tokens)
pass through the values of these tokens when reordering the list. |
void |
setShowId(boolean val)
set whether or not I show the id field |
| Methods inherited from class uk.co.weft.htform.ResourceConsumerImpl |
getContextOrResource, getResource, getResourceOrContext, getResourceString, grs, grs, init |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String DEFAULTACTIONLABEL
public static final int DEFAULTACTIONINDEX
public RE emailRegExp
public RE imageRegExp
public RE urlRegExp
public java.lang.String searchToken
public boolean clickToOrder
public boolean queryByExample
public boolean recogniseLinks
public boolean showHeaders
public boolean showId
protected java.util.Hashtable suppressFields
protected java.lang.String qbeButtonLabel
protected java.util.Vector actionColumns
protected java.util.Vector inspectPassthroughTokens
protected java.util.Vector reorderPassthroughTokens
protected int qbeWidgetMaxLength
protected int qbeWidgetVisibleSize
| Constructor Detail |
public ResultFormatter()
init(java.util.Calendar, java.lang.String, java.lang.String, java.lang.String),
List
public ResultFormatter(Contexts rs,
java.util.Calendar cal)
Page
public ResultFormatter(Contexts rs,
java.util.Calendar cal,
java.lang.String selectAction,
java.lang.String selectField)
public ResultFormatter(Contexts rs,
java.util.Calendar cal,
java.lang.String selectAction,
java.lang.String idCol,
java.lang.String linkCol)
public ResultFormatter(java.sql.ResultSet rs,
java.util.Calendar cal)
throws DataStoreException
Page
public ResultFormatter(java.sql.ResultSet rs,
java.util.Calendar cal,
java.lang.String selectAction,
java.lang.String selectField)
throws DataStoreException
public ResultFormatter(java.sql.ResultSet rs,
java.util.Calendar cal,
java.lang.String selectAction,
java.lang.String idCol,
java.lang.String linkCol)
throws DataStoreException
| Method Detail |
public void setActionLabel(java.lang.String label)
label - the new value for my action label.public void setInspectPassthroughTokens(java.util.Vector tokens)
tokens - a vector of tokens which should be passed through on
inspectpublic boolean setRecogniseLinks(boolean val)
val - the value to set
public void setReorderPassthroughTokens(java.util.Vector tokens)
tokens - the tokens (a Vector of Strings) which should be passed
through.public void setShowId(boolean val)
public void addActionColumn(ActionColumn col)
public void addActionColumn(java.lang.String label,
java.lang.String urlStub,
java.util.Vector passThroughs)
label - the label for the columnurlStub - the stub URLpassThroughs - a vector of tokens whose values from the context
and row should be appended as token=value pairs to the
urlStub. Values from the row will over-ride those from the
context if both are present.public void addSuppressField(java.lang.String fieldToSuppress)
public void addSuppressFields(java.util.Vector fieldsToSuppress)
public void init(java.util.Calendar cal,
java.lang.String selectAction,
java.lang.String idCol,
java.lang.String linkCol)
cal - a calendar to use to format datesselectAction - the URL to follow if a link is selectedidCol - the name of the column in the results which holds the
value to append to the selectAction URL for each recordlinkCol - the name of the column in the results which holds the
item which should form the link for each record (if any, else
null)
public void layout(Context context)
throws java.lang.Exception
context - the context in which to lay me out
java.lang.Exception
public void layout(java.sql.ResultSet data,
Context context)
throws java.lang.Exception
data - the ResultSet representing the data to lay outcontext - the context in which to lay it out
java.lang.Exception
public void layout(Contexts data,
Context context)
throws java.lang.Exception
data - the contexts representing the data to lay outcontext - the context in which to lay it out
java.lang.Exception
public void layoutFirst(Context context)
throws java.sql.SQLException,
java.io.IOException,
javax.servlet.ServletException
java.sql.SQLException
java.io.IOException
javax.servlet.ServletExceptionprotected java.lang.String composeActionURL(Context row)
row - a Context containing the fields of this row.
protected java.lang.String composeActionURL(Context context,
Context row)
context - the context for this service.row - a Context containing the fields of this row.
protected java.lang.String composeAllRowsURL(Context context,
Context showfields)
context - the context of the service
protected java.lang.String composePrevNextURL(Context context,
Context showfields,
int index)
throws java.lang.Exception
context - the context of the serviceindex - the offset from which to start the new page
java.lang.Exception
protected java.lang.String composeReorderURL(java.lang.String fieldName,
Context showfields,
Context context)
throws java.lang.Exception
fieldName - name of the field to reorder onshowfields - a context containing the fields to showcontext - the context of the service
java.lang.Exception
protected void layoutDataCell(int colNum,
int actionCol,
int urlCol,
Context context,
java.lang.String name,
Context row)
throws java.lang.Exception
colNum - the index of this cell in its rowactionCol - the index of the action field in the rowurlCol - the index of a field expected to contain URLs (dodgy,
don't use in conjunction with recogniseLinks)context - the context in which this datacell is being printedname - the name of the field this column representsrow - the context in which values may be found
throws - any exception encountered up the chain for handling
java.lang.Exception
protected void layoutQueryWidget(Context context,
java.lang.String fieldname)
throws java.io.IOException
context - the service contextfieldname - the name of the column
java.io.IOException - probably doesn't
protected void layoutSubmitWidget(Context context)
throws java.io.IOException
context - the service context
java.io.IOException - actually doesn't
protected void maybeLayoutNavLinks(Contexts data,
Context context,
Context showfields,
javax.servlet.ServletOutputStream out)
throws java.lang.Exception
data - the dataset being layed outcontext - the context in which it's being layed outout - the stream on which it's being layed out
java.lang.Exception
|
jacquard 1.12.0 by The Web Engineering Factory and Toolworks | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||