Expanding Search and query capability

X-Application Version: 3.1.2, 3.1.1
Tamino Version : 3.1.1
Platform : NT, Win2k, Solaris, …
WebContainer : Tomcat 3.3
JDK Version : 1.3.1

Hi every body;

I developed a parallel query structure for my project by using multithread environment. :wink: At the final I got results as Document(Jdom) from threads :smiley: . Now trying to use result of other queries in my regular list.jsp(Borwse tag). How can implement a post selection method. Ist possible to implement at ModuleTag and How :confused: .

Brgs

Hello,

just one question before:

(A) Do you need to combine the document set of your different threads to one result set or

(B) Is it possible to display the result within different lists?

For (A), I had an idea which is difficult to be explained and more difficult to be implemented.

For (B), my propose is to modify the ModuleTag:

Each thread could register its result set in form of a BusinessDocumentPage into the SessionContext object of your application (see sessionContext.setPage). Look for synchronization problems!

On the page list.jsp you would have a browse tag for each thread.

<browse document=“thread1” …>


<browse document=“thread2” …>




The name of the attribute ‘document’ must be the same as the BusinessDocumentPage representing the result of a thread is registered within the SessionContext.

For the next version of X-Application, you will be able to implement your query handling via plugin mechanism. Then, it becomes easier to extend X-Application.

Is it possible, that you can post your query-thread code (JSP/Java Source) to the community? I could check if our plugin concept covers your use case. I could give you some hints when the new version is ready for download.

If it’s not possible to send the code (project restrictions), it would be also helpful, to have a more details about your use case.

Many thanks,
bye Christian.

Dear Christian,

I have two threads that will give me two result set. Then i will use result sets for post selection only. So at the end i will have only the businessDocument of my regular query.

So it means, by using two result set i will decide to Reject/Accept BusinessDocument that comes from regular query.

For example result set keeps Country code US , DE (From another shema search result containing “Dam* Was* Muc*” on city names) ,
my regular query is “accounts that ROI more than 0.75” now i want to accept accounts
thats only have country codes US, DE in regular query result.

But i will have only Accounts Doctype as result.

Thanks for your help
Brgs

Hello,

it looks as you need a solution for (A). Have a look at the class DirectCommandTag. Here, actions on documents are defined which have to be executed when the tag is evaluated. Extend the set of accepted actions (currently commit, abandon, create, …) by your command (e.g. ?twoThreadQuery?).
Within the DirectCommandTag invoke your threads with the queries (e.g. by using the workspace object of X-Application sessionContext.getWorkspace() or by programming against the Tamino API for Java).

Evaluate the two queries:
- If the result is just one document, you can register this document by a name within the workspace (workspace.map(?aName?, doc)). After the invocation of the directcommand within your JSP page (<bdm:directcommand type=?twoThreadQuery? …/> ), you can select the values of this document by using a form tag <bdm:form document=?aName?>…</bdm:form>.
- If the result is a set of documents, you must provide a derived class of Page, which handles your result set. Have a look the class BusinessDocumentPage of the X-Application Java API. It is able to handle one document cursor. You need a Page object which can deal with at least two cursors. Register the resulting Page object within the sessionContext (sessionContext.setPage(?aName?, page)). After the invocation of the directcommand within your JSP page (<bdm:directcommand type=?twoThreadQuery? …>, you can browse the values of this documents by using a browse tag <bdm:browse document=?aName?>…</bdm:browse>.

For our next version of X-Application 3.1.3, the extension of directcommand will be possible by using a new feature X-Application, the Plugin mechanism. Then you don?t have to change the code of the tag class, but can just plugin your new action ?twoThreadQuery? and implement it within your own class.

If the approach with the directcommand is ok for you, I think it will be easy for you to switch to the new version when it comes and to reuse the code you added to the DirectCommandTag.java file for the Plugin implementation.

I hope, I could help you.

Bye,
Christian.