Hello @nto,
I decided to answer to >this discussion< here, to make it easier on the other thread!
Once you have installed the SXSJavaUtils package, you can call the functions from the X-Query tab of the Interactive Interface.
It is not important which Collection you enter (you can use ino:collection, as that exists in every Tamino), but it is important that you enter a collection name!
(The functions do not access Tamino, so the collection is irrelevant, but a collection name is required to make a valid request to Tamino.)
Greetings,
Trevor.
The result of the loading of simple_name in collection TriggerLog is <?xml version="1.0" encoding="windows-1252" ?>
- <ino:response xmlns:ino=“http://namespaces.softwareag.com/tamino/response2” xmlns:xql=“XQL FAQ (XML Query Language - Frequently Asked Questions)”>
xql:query/TriggerLog</xql:query>
- <ino:message ino:returnvalue=“0”>
ino:messagelinefetching cursor</ino:messageline>
</ino:message>
- xql:result
-
Thu Feb 27 09:37:10 CET 2003
Java
onInsert
TriggerJ
Trigger
1
-
0002
-
Thu Feb 27 09:37:11 CET 2003
Java
onInsert
TriggerJ
Trigger
1
-
Schmidt
</xql:result>
- <ino:cursor ino:handle=“1”>
<ino:current ino:position=“1” ino:quantity=“2” />
</ino:cursor>
- <ino:message ino:returnvalue=“0”>
ino:messagelinecursor fetched</ino:messageline>
</ino:message>
</ino:response>
We have two ino:id 'cause in the TriggerJ_schema there’s the element key and the element name under the Root element Trigger, right?
@nto
Sorry for the smile before, it wasn’t in my intention…it was generated by ino: position
(: P without space).
In future i’ll attach xml files.
@nto
This is the file i obtained after inserting simple_name and simple_name_upd,
i dont’ understand the id 5,6 and why Hansen isn’t in the “new” tag of the id=4?
Untitled1.xml (2.41 KB)
Hello @nto,
I’m sorry, but I think that I am getting a bit lost!
The documents that you are trying to insert have the root node “Trigger”.
The query that you executed was on the document type “TriggerLog”.
The TriggerLog documents are [probably] created by the code of the SXSJTrigger Server Extension - before the regular Tamino processing takes place, not instead of the regular Tamino processing.
Stuart pointed out a potential problem with the ino:id in simple_name_upd.xml in >this posting<.
The correct value to assign to the ino:id attribute in this file is the ino:id of the document that you wish to update.
When a document is submitted to Tamino without an ino:id, one is generated and stored with the document. When a document is submitted with an ino:id, the document already stored in Tamino is updated.
So I would propose that you query for “/Trigger” in the “TriggerJ” collection. If the expected update has not been applied, choose the ino:id of one of the Trigger documents and use that in the simple_name_upd.xml file, then repeat the update and see what happens in both the TriggerLog and Trigger documents.
I hope that helps,
Trevor.
I have followed the Stuart’s advice and the update is correct, but i don’t understand the logic of the logging in the collection TriggerLog…i don’t understand why there are so many entries (ino_:id)in the log collection!
How call the init function?
Regards,
@nto
Hello @anto,
okay - this is good!
The reason that there are so many TriggerLog documents is that one is created per operation, regardless of what that operation is.
So whenever a new Trigger document is inserted, a new TriggerLog document is inserted too. Whenever a Trigger document is updated, a new TriggerLog document is inserted.
In the Java source code for the Server Extension you can see that the methods “onInsert” and “onUpdate” just call the method “writeLog”. The writeLog method calls Tamino to “process” an XML document that is constructed in the method.
(The operations performed by Tamino will be the same as those described earlier - if there is not an ino:id in the document, a new document is inserted; if there is an ino:id in the document then the corresponding document in Tamino is updated. You could modify the SXSJTrigger.java source so that an ino:id is inserted into the document constructed in the writeLog method, to see how that works.)
The init function is called before any other function, to perform some initialization steps.
In the Install.xml file that Stuart provided (in the SXP file), you will find the descriptor for the init function - which specifies the default values for the parameters.
I hope that helps,
Trevor.
package SXSJTrigger;
import com.softwareag.ino.sxs.*;
I didn’t find this include…in tamino directories tree structure…can you post it to me?
i need this include to compile my sxp file!
Thanks!
@nto
I have included all files in D:\Programs\Software AG\Tamino\Tamino 4.1.1.1\SDK\TaminoAPI4J\lib (except for files TaminoJCA_localTx.rar and TaminoJCA_noTx.rar)
but i get:
SXSJTrigger.java:16: cannot resolve symbol
symbol : class ASXJBase
location: class SXSJTrigger
public class SXSJTrigger extends ASXJBase {
SXSJTrigger.java:19: cannot resolve symbol
symbol : class SXSVersion
location: class SXSJTrigger
static final SXSVersion sxsVersion = new SXSVersion (1, 0);
…
What’s wrong?
Should i use necessarily X-Tension Builder (to create an .sxp package)or can i compile the sxpfile.java separately (how?) and put the .class with install.xml in a .zip file and then renaming it in .sxp (i try it and it works!) but my question is how to compile the sxp.java (read my previous post)
@nto
All you need to include to compile the server extension is the sxsrte.jar file which can be found in the Tamino 4.1.1.1\bin directory.
You can create the .sxp using the X-Tension tool.
Hope this helps.
Stuart Fyffe-Collins
Software AG (UK) Ltd.
this is my compiling script:
c:\j2sdk1.4.0\bin\javac -deprecation -classpath .;D:\myclass\sxsrte.jar;D:\sxbuilder.jar;D:\myclass\TaminoAPI4J.jar;D:\myclass\jdom.jar;D:\myclass\log4j.jar;D:\myclass\xercesImpl.jar;D:\myclass\TaminoJCA;D:\myclass\xmlParserAPIs d:\provatrigger\SXSJTrigger.java
i receive always the same error!!
Please help!
@nto
[This message was edited by @nto on 03 Mar 2003 at 13:30.]
Works for me! Is sxsrte.jar really in the d:\myclass directory? If you do the following command:
jar tvf d:\myclass\sxsrte.jar
you should see ASXJBase.class
Stuart Fyffe-Collins
Software AG (UK) Ltd.