|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.enterprise.tabularresults.BaseQueryService
This class will be used to define the minimally required behavior of a class that is to retrieve a queryresult and have it presented in an HTML table. It is assumed, but not required, that the HTML table will be generated via the utilities in the Package wt.enterprise.tabularquery. A call to the method printTable in TableFormatService is the specific call that is expect, but not necessary.
The classes that subclass off of this class will need to implement two methods.
Currently BaseQueryService implements NetFactor.
The purpose of this is that all of the children of BaseQueryService
can be found via introspection. Thus, when a new extension of BaseQueryService
is created there is a method to locate this subclass other than hardcoding
the name or the reference in the code. An example of this currently is
the use of QueryServiceProvider
finding the desired subclass of BaseQueryService based on the name of
the class without the full path. Thus, the name of the query can
be passed in as a parameter in the URL used to request the HTML page
presenting the table. In ChangeViewProcessor
the value of the HTTP GET parameter action is used to find the
proper subclass to generate the QueryResults. Here is some sample code
performing this.
QueryServiceProvider query_service_provider = new QueryServiceProvider();
BaseQueryService base_query_service = query_service_provider.getqueryService(query_service_name);
queryResults = (Object[])base_query_service.getQuery( getContextObj(),
parameters, locale);
Supported API: true
Extendable: false
QueryServiceProvider
,
Serialized FormField Summary | |
private static String |
CLASSNAME
|
static long |
EXTERNALIZATION_VERSION_UID
|
protected static long |
OLD_FORMAT_VERSION_UID
|
private static String |
RESOURCE
|
(package private) static long |
serialVersionUID
|
Constructor Summary | |
BaseQueryService()
|
Method Summary | |
ClassInfo |
getClassInfo()
Returns the ClassInfo object for this class. |
abstract String[] |
getColumnNames()
Gets the value of the attribute: columnNames; The instance variable is used to hold an array of the default or initial columns that will be presented in the table of results. |
abstract String |
getDataFormatName()
Gets the value of the attribute: dataFormatName; This instance variable can be used to provide a the name, full class path for example, of the subclass of Supported API: false |
abstract Object |
getQuery(Object context_obj,
Properties parameters,
Locale locale)
A call to getQuery should sent the object that is to be queried against to build a QueryResult. |
abstract String |
getTableFormatName()
Gets the value of the attribute: tableFormatName; This instance variable can be used to provide a the name, full class path for example, of the subclass of Supported API: false |
void |
readExternal(ObjectInput input)
Reads the non-transient fields of this class from an external source. |
private boolean |
readOldVersion(ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source, which is not the current version. |
protected boolean |
readVersion(BaseQueryService thisObject,
ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source. |
abstract void |
setColumnNames(String[] a_ColumnNames)
Sets the value of the attribute: columnNames; The instance variable is used to hold an array of the default or initial columns that will be presented in the table of results. |
abstract void |
setDataFormatName(String a_DataFormatName)
Sets the value of the attribute: dataFormatName; This instance variable can be used to provide a the name, full class path for example, of the subclass of Supported API: false |
abstract void |
setTableFormatName(String a_TableFormatName)
Sets the value of the attribute: tableFormatName; This instance variable can be used to provide a the name, full class path for example, of the subclass of Supported API: false |
String |
toString()
Returns the conceptual (modeled) name for the class. |
void |
writeExternal(ObjectOutput output)
Writes the non-transient fields of this class to an external source. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface wt.fc.NetFactor |
getConceptualClassname |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
static final long serialVersionUID
public static final long EXTERNALIZATION_VERSION_UID
protected static final long OLD_FORMAT_VERSION_UID
Constructor Detail |
public BaseQueryService()
Method Detail |
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
output
-
IOException
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
input
-
IOException
ClassNotFoundException
protected boolean readVersion(BaseQueryService thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
thisObject
- input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
private boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
public String toString()
public ClassInfo getClassInfo() throws WTIntrospectionException
getClassInfo
in interface NetFactor
WTIntrospectionException
public abstract String getTableFormatName()
that the query generated by a call to
,
wants to use to build the table for presenting the results of the
query.
public abstract void setTableFormatName(String a_TableFormatName) throws WTPropertyVetoException
a_TableFormatName
-
WTPropertyVetoException
that the query generated by a call to
,
wants to use to build the table for presenting the results of the
query.
public abstract String getDataFormatName()
that the query generated by a call to
,
wants to use to format the individual table enties for presenting
the results of the query.
public abstract void setDataFormatName(String a_DataFormatName) throws WTPropertyVetoException
a_DataFormatName
-
WTPropertyVetoException
that the query generated by a call to
,
wants to use to format the individual table enties for presenting
the results of the query.
public abstract String[] getColumnNames()
should implement
,
to initialize this class.
public abstract void setColumnNames(String[] a_ColumnNames) throws WTPropertyVetoException
a_ColumnNames
-
WTPropertyVetoException
should implement
,
to initialize this class.
public abstract Object getQuery(Object context_obj, Properties parameters, Locale locale) throws WTException
qr = ChangeHelper.service.getAddressingChangeOrders(change_request);
if (qr == null)
{
return null;
}
String sorting_attribute = "number";
QueryCollationKeyFactory key = new QueryCollationKeyFactory(locale,
sorting_attribute);
SortedEnumeration enum = new SortedEnumeration(qr.getEnumeration(),
key);
results = new Vector();
while (enum.hasMoreElements())
{
ChangeOrder current_element = (ChangeOrder)enum.nextElement();
System.out.println("ChangeOrder -> " + current_element);
results.addElement(current_element);
}
context_obj
- parameters
- locale
-
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |