How to query data from another schema

Hello All,
I want to query data from a schema in Tamino.
I wrote the following code to do this.
I dont see anything wrong but it doesnt work :((
Can somebody help me please.


ServletContext context;
context = pageContext.getServletContext();

String url=context.getInitParameter(“TAMINO_URL”);
String userId = context.getInitParameter(“USER_ID”);
String password = context.getInitParameter(“PASSWORD”);
String propertyCollection = “Ortopedi”;
String propertySchema = “son”;
TaminoStore store=new TaminoStore(url, userId, password);
store.registerDoctypeCollection(propertySchema, propertyCollection);
businessDocumentWorkspace = new BusinessDocumentWorkspace(store);
QueryContainer container=new QueryContainer();
container.setDoctype(“son”); //I want to make a query on the schema son
container.add(new QueryElement("*","")); //I dont give any criteria so that it brings all data
String cursorName = “son”;
int PageSize = 10;
Cursor cursor=businessDocumentWorkspace.query(cursorName,container,PageSize); //I run the query
//here cursor.count() returns 0 although I have data.
BusinessDocument bd = businessDocumentWorkspace.lookup(“son”);

// Here the bd returns NULL although I have data in the schema son

X-Application Version: 3.1.1
Tamino Version : 3.1.1
Platform : Win2k
WebContainer : Tomcat 3.2
JDK Version : 1.3.1

[This message was edited by Harald Wolf on 27 Feb 2002 at 16:51.]

Hello,

for querying documents to be displayed by a browse tag there is a simpler solution: Use the directcommand with type=‘query’.

The “JSP Simple Examples” of X-Application (look into the directory %XAPPLICATION_HOME%\examples\jsp\simple) contain directcommand to query Property documents.

In your case the following should work:

<bdm:module id=“yourId”>
<bdm:form module=“yourId”>
<bdm:directcommand type=“query” document=“sonList” schema=“son” queryparm="@ino:id>=1" />
</bdm:form>


<bdm:browse module=“bdProp” document=“sonList” pagesize=“1000”>

use display tag to show the content of your documents

</bdm:browse>


</bdm:module>

Remark: Edit the web.xml file of your Web application. Add the registration of the doctype and collection here
e.g.


TAMINO_COLLECTION2Ortopedi


TAMINO_DOCTYPE2son

If your queries are not to complex, direct commands should satisfy your requirements. If the access to the underlying business document workspace is required, send a reply. But I would propose to work with the jsp tag as long as possible.

Bye,
Christian.

Hello,

could you give more background about the kind of application you build?
Do you use the JSP Tag library at all?
Do you use JSP tags together with other servlets?
Do you want to combine instances from multiple schemas (as the title of your post implies)?

For now, try the following:

code:
container.add(new QueryElement(".", "", “~=”));


This should execute a query s.a
code:
"/son[.~=’’]"

Regards, Harald

Dear Mr Harold,
First of all thanks for your answer,
I have tried something like this and it worked :slight_smile:

container.add(new QueryElement("/son/FormTipi",“Tip3*”,"~="));

But this is not enough for my application since I need many different business logic in my application.

One of the most important thing I need is the usage of ANY node type.
Xapplication does not support this type of node :frowning:
I have studied a little about the source code of the Xapplication and it does not seem very hard to implement it.
I wonder when it is going to be implemented I need it very much and I have to do it by myself if it is not by Xapplication.

Another thing I need is to have a combo box from another schema than the one I am working on so that the data I am going to update can be retrieved as a combo box from another schema.
I hope I could explain my problems clear enough.
I will be glad if you could give me some ideas about those subjects.
Sincerely Yours
Server AYAYDIN

Yes I am using the JSP Tag Library in my project.
But the tags are not enough for me so I add some Tags and change some by extending them.
I use other jsp but not servlet at the moment I might also use servlets if needed in the future.

Hello,

we learn from your and others feedback that supporting ANY is of high importance for you.
What exactly is what you would expect from ANY support?
What is the idea you have to implement it?
If you have a “quick” solution, please post it to the Contribution forum and share it with others.

Regards, Harald

[This message was edited by Harald Wolf on 05 Feb 2002 at 17:32.]

Hello,

I´ve prototyped a little with the Property Demo using two Schemas.
I´ve modified the page InstanceDemoModify.jsp.
My use-case was to fill the zip-code element of the property instance with a value that matches the logID element of the PropCustomer instances.

<bdm:edit select="/Property/Address/Zip">
<bdm:fillselect module=“bdProp”
schema=“PropCustomer”
value="/PropCustomer/logID"
text="/PropCustomer/logID"
distinct=“true”>


</bdm:fillselect>
</bdm:edit>

It worked out of the box with the current development version of X-Application.
Unfortunately it did not work with X-Application 3.1.1 because the replacement for the fillselect tag is not wellformed xml in that version. This is a prerequisite for the surrounding bdm:input tag to augment the enclosed XHTML code.
The class responsible for that non-xml output is the HTMLSerializer class of xerces. It is used in the class com.softwareag.xtools.xapplication.jsptaglib.util.HtmlStringParser.

You have two alternatives:
- try to serialize it to wellformed xml at the above location.
- wait for the next version of X-Application.

Regards, Harald

It is now possible to use a fillselect tag inside an edit tag. This enables applications to fill the set of values in modify/create pages.
See discusstion thread for more information.

Regards, Harald