Usage of :pos and :goto parameters

Hi all,
I will first explain my application and then tell about my problem.

I have a big tamino schema and many ocuurence nodes under this schema.

Schema is something like this :

Patient(Root Node)
—>Problem (Multiple sequence)
--------->Examination(Multiple sequence)
--------->Surgery(Multiple sequence)

I want to point to a specific Surgery or Examination of a specific Problem of the patient with just one link. By setting the pagesize attribute of the new jsp file to 1.

To do this I first tried to use a link like this :

: pos=/Patient/Problem,0,/Patient/Problem/Examination,1

from this link I suppose it to open the second Examination of the first Problem of this patient.
But it doesnt work :frowning:
I have tried many different alternatives and at last a link like this seems to work right :

:goto(/Patient/Problem)=1&:pos=/Patient/Problem/Examination,1

In this link :goto and : pos work different.
1 in :goto parameter indicates the first ocurence
while
1 in : pos indicates the second occurence.

So this link refers to the second Examination of the first problem.


Now I am telling the problem with this link.

It doesnt work when you click it for the first time :frowning:
In first opening of the page it always brings the first Examination of First Problem :frowning:

When I reload the page it starts to point to the right cursor.

This is probably because the loop has not been initialized. I added the code of the loop to the page where I compose the links wishing it will solve the problem but it did not.

Can someone help me about this?
(Sorry if I have written so long. I wish you will understand my problem)
(There is space between : and pos in the parameter : pos because I dont like it seem like :pos )
X-Application Version: 3.1.2
Tamino Version : 3.1.1
Platform : Win2k Proffessional
WebContainer : Tomcat 3.3
JDK Version : 1.3.1

[This message was edited by MehmetServer on 28 Mar 2002 at 09:26.]

Hi,

we had a first short look on a it, but it seems that it is a little more complicated and that we need a little bit more time …

We will look on it next week again and hope to give you a helpful answer for your problem.

Bye

Thorsten

Hello,

before explaining the use of the :pos parameter I would like to ask you whether working with loops or / nested loops and using an elementaction tag with type ?select? would solve your problem?

(Have a look to the simple examples ?LoopInLoop? and LoopInsDel?)

If you don?t want to use a page which shows the multiplicities, my proposal is to use a dummy loop construct and the position parameter. The first page could look like this:




<a href=?selectedExamination.jsp?:pos=problems,,examinations,?>examination


<a href=?selectedSurgery.jsp?:pos=problems,,examinations,?>surgery

The index values <index of …> of the :pos parameter have to be integers starting at Zero. To set the position of the examination list to the first examination of the 5th problem, the link would look like this:

selectedExamination.jsp?:pos=problems,4,examinations,0

On the next page ? for instance selectedExamination.jsp ? you should use not only the inner most loop (examinations) but also the enclosing loop (problems). It is important to use the same names for the attribute targetbase.






I hope I could help you. However, this is only a proposal. I didn?t try out this solution by myself. If it does not meat your requirements, could you send us your schema and JSP pages?

Bye,
Christian.

PS: Currently, the :goto parameter can not be used in combination with loop tags (multiplicities). It is only applicable to browse tags (set of documents).

Hello,
Thanks for your help
But I have tried just the method you have explained but it does not work :frowning:
I will attach the schema and jsp to the message as soon as I can.

Hello,
In my application I need to show oe occurene of a node in one jsp page.
To do this I set the pagesize attribute of the loop to one and position the cursor to this occurence.

When working without the pagesize attribute the elementaction:delete works fine and when I check its link it contains something like this “.elements[‘:elementaction’].value=‘remove(/Hasta/Vaka,0,/Hasta/Vaka/Kontrol,0;2)’”

When I use pagesize attribute in my link and try to delete the same occurence the link of the elementaction:delete is something like this “.elements[‘:elementaction’].value=‘remove(/Hasta/Vaka,0,/Hasta/Vaka/Kontrol,2;0)’” and it causes an exception.
Although it causes an exception it also deletes the node.
Can somebody tell me why this doesnt work please ?

ps: My schema and some of jsp files are attached to the message.

Hello,
In my application I need to show oe occurene of a node in one jsp page.
To do this I set the pagesize attribute of the loop to one and position the cursor to this occurence.

When working without the pagesize attribute the elementaction:delete works fine and when I check its link it contains something like this “.elements[‘:elementaction’].value=‘remove(/Hasta/Vaka,0,/Hasta/Vaka/Kontrol,0;2)’”

When I use pagesize attribute in my link and try to delete the same occurence the link of the elementaction:delete is something like this “.elements[‘:elementaction’].value=‘remove(/Hasta/Vaka,0,/Hasta/Vaka/Kontrol,2;0)’” and it causes an application exception. (stacktrace of the exception is in the end of the message)
Although it causes an exception it also deletes the node.
Can somebody tell me why this doesnt work please ?

ps: My schema and some of jsp files are attached to the message.

ApplicationException: 999: Application Error! Please contact the X-Application-Team.
com.softwareag.xtools.xapplication.common.PreconditionViolation
the node of class com.softwareag.xtools.xapplication.businessdocument.OccurrenceNode was deleted
at com.softwareag.xtools.xapplication.businessdocument.BusinessNodeImpl.getChildCount(BusinessNodeImpl.java:161)
at com.softwareag.xtools.xapplication.businessdocument.BusinessNodePage.getPageCapacity(BusinessNodePage.java:73)
at com.softwareag.xtools.xapplication.businessdocument.BusinessNodePage.getLastNodeIndex(BusinessNodePage.java:257)
at com.softwareag.xtools.xapplication.jsp.taglib.ElementActionTag.getNodeIndex(ElementActionTag.java:194)
at com.softwareag.xtools.xapplication.jsp.taglib.ElementActionTag.getPositionVector(ElementActionTag.java:156)
at com.softwareag.xtools.xapplication.jsp.taglib.ElementActionTag.createArguments(ElementActionTag.java:143)
at com.softwareag.xtools.xapplication.jsp.taglib.ElementActionTag.processAction(ElementActionTag.java:130)
at com.softwareag.xtools.xapplication.jsp.taglib.CommandTag.doAfterBodyCore(CommandTag.java:118)
at com.softwareag.xtools.xapplication.jsp.JspTag.doAfterBody(JspTag.java:169)
at mKontrol_1._jspService(mKontrol_1.java:1795)
at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source)
at org.apache.tomcat.core.Handler.invoke(Unknown Source)
at org.apache.tomcat.core.Handler.service(Unknown Source)
at org.apache.tomcat.facade.ServletHandler.service(Unknown Source)
at org.apache.tomcat.core.ContextManager.internalService(Unknown Source)
at org.apache.tomcat.core.ContextManager.service(Unknown Source)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Unknown Source)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Unknown Source)
at java.lang.Thread.run(Thread.java:484)
Hasta.tsd (11.1 KB)

jsp that includes pagesize and elementaction:delete
mKontrol.jsp (6.03 KB)

Hello,

after your mail where you reported still problems with the positioning, I had a closer look at the source code. The topic is not trivial since it concerns internal structures of the HTTP request handling. Therefore, I modified one of our simple examples to explain the addressing of sub-nodes and the use of action requests. I post these pages as attached zip file. The example focus on action ?select?, but I hope that understanding the example you will be able also to use ?insert? and ?remove?.

Remark: The addressing of sub-nodes is not part of the X-Application API. It may be that we have to change the syntax for the action requests when we support plug-ins. Did you check our Plug-In proposal. Perhaps, the functionality you require currently could be implemented via plug-in. This would be a better solution than using internal features of X-Application which may change in future versions.

To install the example, the following step are necessary:


  • extract the zip file “SubNodesExamples.zip” into the same directory where you installed X-Application
  • load the document %XAPPLICATION_HOME%\testsuite\xmlfiles\patient\mickymouse.xml via Tamino Interactive Interface to Tamino (use the collection you defined within your env.cmd file)
  • start Tomcat
  • invoke http://localhost:8080/simple/PositionExpr.jsp

SubNodesExamples.zip (1.21 KB)