hybrid document mapped to SQL database with no INO:ID

X-Application Version: 3.1.2
Tamino Version :
Platform : NT
WebContainer : Tomcat 3.3, TOMCAT 4.0.3
JDK Version : 1.3.1

problem: a tamino doc is mapped to sql database. as long as no data are insert via tamino, no INO:ID is generated.

now using X-application the list/search function works fine, but if i try to get detailed information by executing the b><bdm:action type=“read”><bdm:display select=“$POS”/></bdm:action>
i get the execption
ApplicationException: 999: Application Error! Please contact the X-Application-Team.
parameter ‘docId’ must not be null,
which is correct as this doc does not have a INO:ID(docId).

any way possible to overcome this issue.




did you try the suggestion posted by Christian on your previous request (see topic X_Application and hybrid XML_Documents)?

Regards, Harald


i haven’t tried this one. i have to be honest:
1. i don’t know how to do.
2. this application was generated using the X-application generator, so i don’t know if this will work or solve this issue.




The suggestion of Christian is the key to find a solution.

Imagine. Each document contains an unique identifier not equal to ino:id, e.g. the primary key (pk) of your relational data source.
This table will be the RDBMS data source:

PK |Name |First name | City |Zip | State
1 | Schmitt | Michael |Mannheim |68000 | Germany
2 | Meier | Klaus |Kaiserslautern|67655 | Germany
3 | Schmitt | Heike |Mainz |55130 |Germany

A possible transformation to XML could look like (For each record set one document):

<BR><person pk=?1?><BR>	<name>Schmitt</name><BR>	<firstname>Michael</firstname><BR>	<city>Mannheim</city><BR>	<zip>68000</zip><BR>	<state>Germany><BR></person><BR><person pk=?2?><BR>	<name>Meier</name><BR>	<firstname>Klaus</firstname><BR>	<city>Kaiserslauten</city><BR>	<zip>67655</zip><BR>	<state>Germany><BR></person><BR><person pk=?3?><BR>	<name>Schmitt</name><BR>	<firstname>Heike</firstname><BR>	<city>Mainz</city><BR>	<zip>55130</zip><BR>	<state>Germany><BR></person><BR>?<BR></pre><BR><BR>Back to the suggestion:<BR>Now, you have to use ?pk? instead of ?ino:id? in order to reference the documents correctly. Therefore you need to modify the to methods of the class TaminoStore.java (see: <yourXapplicationFolder/ src\com\softwareag\xtools\xapplication\store\TaminoStore.java) as Christian suggested:<BR><BR><pre class="ip-ubbcode-code-pre"><BR>    public String getIdQuery(Element elem) {<BR>        String id = getId(elem);<BR>        if (id != null) {<BR>            // replace the original line with your adapted code<BR>//ORIGINAL:  return "/" + elem.getName() + "[@ino:id='" + id + "']";<BR>//a suggestion for the former example:<BR>return ?/person[@pk=?? + id + ??]?;<BR>        }<BR>        return null;<BR>    }<BR>    <BR>    public String getId(Element elem) {<BR>            // replace the original line with your adapted code<BR>        	//ORIGINAL: Attribute attr = elem.getAttribute(ID, INO_NS);<BR>       	Attribute attr = elem.getAttribute(?pk?);<BR>        if (attr != null) {<BR>            return attr.getValue();<BR>        }<BR>        return null;<BR>    }<BR>

After finishing the modifications you need to build a new xapplication.jar file.
Go to your xapplication folder on command line and call ?build quick?.
Then copy the file /lib/debug/xapplication.jar to the place of your generated application, e.g.: /WEB-INF/lib.

Now it should be possible to use the modifications.

Bye Thorsten