Hello Amit,
sorting as described in the documentation is only possible for query pages, not for directcommand.
But it is not difficult to add sorting to directcommand query.
Let me try to outline a possible solution:
- add an attribute “sortby” to the xapplication.tld file in the web-inf directory of your application. This could be done similar to the “queryparm” attribute.
- open the class DirectCommandTag.java in directory src\com\softwareag\xtools\xapplication\jsp\taglib
- add an import statement:
import com.softwareag.xtools.xapplication.businessdocument.QuerySort;
- add a setter methodcode:
private String sortby = null;
public void setSortby(String sortby) {
this.sortby = sortby;
}
- change method processaction() to add a new sort object:code:
else if (type.equals(“query”)) {
QueryContainer qc=new QueryContainer(schema);
qc.add(new QueryFilter(queryParm));
if (sortby != null) qc.add(new QuerySort(sortby));
sessionContext.setQuery(requestContext, getDocument(),qc);
}
- you might like to add the parameter to the traceInfo, method endDumpDiagnosis()
- rebuild X-Application:
- build.cmd in x-application root directory.
- copy lib\debug\xapplication.jar into your-web-app-dir\web-inf\lib
- restart tomcat
- test the new attribute:
<bdm:directcommand type=“query” schema=“yourSchema” queryparm=“yourFilter” sortby=“./@Category”
If you succeed, you could post the solution (new class plus tld file) into the community Contribution Forum to share this with others.
Regards, Harald
[This message was edited by Harald Wolf on 05 Apr 2002 at 18:03.]
#API-Management#webMethods#Tamino