Hi,
I'm having trouble getting my xform to submit properly. I'm a beginner, so hopefully my mistake is something stupid and obvious. I have Orbeon 3.6 on Tomcat 6 on Windows. I have my own webapp, deployed seperately, with a static .xhtml in /xforms-jsp - all that's working ok. But the submissions aren't working. First I tried to submit to the built-in eXist database in the way the bookcast example does, then I gave up and made a simple servlet to accept the xml in a http post. I can't get either to work. My eXist submission (copied off bookcast example, but do I need to create the eXists 'tw' collection first?): <xforms:submission id="save-submission" ref="instance('message-instance')" action="/exist/rest/db/orbeon/tw/message.xml" method="put" replace="none"> <xforms:message ev:event="xforms-submit-error" level="modal" value="event('body')"/> <xforms:message ev:event="xforms-submit-done" level="modal">Saved!</xforms:message> </xforms:submission> My servlet submission: <xforms:submission id="save-submission" ref="instance('message-instance')" action="/TW/ReceiveMessageXML" method="post" replace="all"> <xforms:message ev:event="xforms-submit-error" level="modal" value="event('body')"/> <xforms:message ev:event="xforms-submit-done" level="modal">Saved!</xforms:message> </xforms:submission> doPost method of servlet: protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ServletOutputStream out = response.getOutputStream(); ServletInputStream in = request.getInputStream(); byte[] buffer = new byte[1024]; int len = 1024; int off = 0; int result = 0; response.setContentType("text/html"); out.print("<html><body><pre>"); while (result >= 0) { result = in.read(buffer, off, len); off += result; out.write(buffer, off, result); } out.print("</pre></body></html>"); } } I've tried to enable Orbeon logging by uncommenting everything in RESOURCES/config/log4j.xml, reploying Orbeon and restarting Tomcat - but I can't find a log file. Where is it created? I've tried using tcpmon as a proxy server, and I can see the http put when I run the bookcast example, but not when running my xform. I just get a DOMFocusIn, DOMActivate http post for the save button. Perhaps this means Orbeon thinks my xml instance is not valid - but there are no !s next to input fields, and the event('body') is null. How would I check if this were the case? Thanks, Malcolm. |
I got Orbeon to perform my submissions by adding @validate="false".
1) So this means that Orbeon thinks my form data is invalid. There is no visual clue (ie no !s) that my instance is invalid, and I've triple checked it by eye using the Orbeon Forms XForms Instance Inspector - but can't see the problem. How would I go about debugging this to see exactly where the problem is? 2) When I perform my submission to my servlet, it does the POST, but my browser gets redirected to /opt/xforms-server-submit and there I get the error: Path http://localhost:8000/TW/ReceiveMessageXML does not start with a "/" character And ideas why I would be getting this? Or course it doesn't start with a "/"!? Is this due to POSTing to a servlet in a separate webapp? 3) When I perform my submission to eXist, it does the PUT, but I get an HTTP 403 Forbidden. This suggests that it's an authorisation problem. But the bookcast example provides no username/password and works, so why should my form?
|
Administrator
|
> I got Orbeon to perform my submissions by adding @validate="false".
An "invalid" instance for submission purposes is one with either or
> > 1) So this means that Orbeon thinks my form data is invalid. There > is no > visual clue (ie no !s) that my instance is invalid, and I've triple > checked > it by eye using the Orbeon Forms XForms Instance Inspector - but > can't see > the problem. How would I go about debugging this to see exactly > where the > problem is? both of: * Actual invalid elements or attributes in the instance * "Required but empty" elements or attributes Did you enable XForms logging? You may see some interesting information there: http://www.orbeon.com/ops/doc/reference-xforms-2#xforms-logging > 2) When I perform my submission to my servlet, it does the POST, but > my > browser gets redirected to /opt/xforms-server-submit and there I get > the > error: > > Path http://localhost:8000/TW/ReceiveMessageXML does not start with > a "/" > character > > And ideas why I would be getting this? Or course it doesn't start > with a > "/"!? Is this due to POSTing to a servlet in a separate webapp? <property as="xs:boolean" name="oxf.xforms.optimize-local-submission" value="false"/> > 3) When I perform my submission to eXist, it does the PUT, but I get > an HTTP > 403 Forbidden. This suggests that it's an authorisation problem. > But the > bookcast example provides no username/password and works, so why > should my > form? By default, eXist supports a "guest" mode. Maybe your separately deployed eXist (if that's what you are using) doesn't? -Erik -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Thanks Eric.
Yes, I've uncommented those bits from config/log4j.xml and restarted Tomcat. Now where is this logging supposed to spew out to? Thanks - that works (after I fixed the deliberate error in my servlet ;-). What are the side effects of making this setting? I want all my submissions as optimised as possible! I'm trying to use the eXist built-in with Orbeon. That's why I don't why the bookcast example works with no authentication, yet my xform doesn't. Malcolm |
Administrator
|
> Yes, I've uncommented those bits from config/log4j.xml and restarted
> Tomcat. > Now where is this logging supposed to spew out to? That too is configured in log4j.xml. You can try the console appender and / or the file appender. > Thanks - that works (after I fixed the deliberate error in my > servlet ;-). > What are the side effects of making this setting? I want all my > submissions > as optimised as possible! What the "optimized" version does is, in some cases, skip the actual HTTP step. But it seems that this can cause some issues. > I'm trying to use the eXist built-in with Orbeon. That's why I > don't why > the bookcast example works with no authentication, yet my xform > doesn't. It should though! Maybe you can use something like tcpmon to figure out what's happening on the wire. -Erik -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Thanks. I was an idiot. By default it logs using SingleFileAppender to ../logs/ops.log, which is relative to Tomcat directory. I was searching from Tomcat directory down, so didn't find it. I used the logs to find the problem with my submission. I was using a * in the nodeset of a <xforms:bind> which was including more nodes than it should. Does the XForms specification specify what should happen when the a node of an XML instance are in more than one <xforms:bind>? Using tcpmon I can see the XML in the HTTP PUT. The reply is 403 Not authorised with the HTML for the standard Tomcat error page. I don't get this error if I run my XForm in the Orbeon sandbox thing - only when running as a seperate webapp. Is there further configuration I must do to allow my separate webapp to use the eXists database built in to Orbeon? Thanks, Malcolm. |
Administrator
|
> Thanks. I was an idiot. By default it logs using
Yes, as per 1.0/1.1 it should throw an exception. But Orbeon Forms
> SingleFileAppender to > ../logs/ops.log, which is relative to Tomcat directory. I was > searching > from Tomcat directory down, so didn't find it. > > I used the logs to find the problem with my submission. I was using > a * in > the nodeset of a <xforms:bind> which was including more nodes than it > should. > > Does the XForms specification specify what should happen when the a > node of > an XML instance are in more than one <xforms:bind>? does not enforce this rule. There has been some debate recently in the Forms Working Group as to whether we should change this in the future anyway, as it clearly makes sense, for example to have multiple constraints on a single node, expressed with multiple xforms:bind statements. The question is how do the MIPs combine (easy for validation, but the behavior of readonly, required, etc. must be determined). > Using tcpmon I can see the XML in the HTTP PUT. The reply is 403 Not > authorised with the HTML for the standard Tomcat error page. > > I don't get this error if I run my XForm in the Orbeon sandbox thing > - only > when running as a seperate webapp. > > Is there further configuration I must do to allow my separate webapp > to use > the eXists database built in to Orbeon? using xxforms:username and xxforms:password on xforms:submission? -Erik -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
In reply to this post by Erik Bruchez
Hi, Iam new to orbeon can anyone help me out in this I have an input field where iam giving my code <td align="left" valign="middle" nowrap="true" colspan="3"> <xforms:textarea ref="instance('main-instance')//mectxmmcomments" incremental="true" xxforms:maxlength="70" xxforms:rows="1" xxforms:cols="120"> </xforms:textarea> how can i keep max length for this as iam giving xxforms:maxlength but it doesnt work for xforms:textarea Thanks and Regards, K Gopikrishna Reddy This e-mail (and any attachments), is confidential and may be privileged. It may be read, copied and used only by intended recipients. Unauthorized access to this e-mail (or attachments) and disclosure or copying of its contents or any action taken in reliance on it is unlawful. Unintended recipients must notify the sender immediately by e-mail/phone & delete it from their system without making any copies or disclosing it to a third person. -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws winmail.dat (5K) Download Attachment |
Hi Gopikrishna
> how can i keep max length for this as iam giving xxforms:maxlength but it doesnt work for xforms:textarea you could try to restrict the length of the content using a binding and xpath: constraint="string-length lt 71" Info about the xpath string-length function: http://www.w3.org/TR/xpath-functions/#func-string-length HTH florian -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Hi,
Thanks for ur help Can u tell me is there any way to do this without binding the
node.
Thanks and Regards,
K Gopikrishna Reddy
From: Florian Schmitt
[mailto:[hidden email]]
Sent: Tue 5/13/2008 1:42 PM To: [hidden email] Subject: [ops-users] Re: xxforms:maxlength not working inside xforms:textarea Hi Gopikrishna This e-mail (and any attachments), is confidential and may be privileged. It may be read, copied and used only by intended recipients. Unauthorized access to this e-mail (or attachments) and disclosure or copying of its contents or any action taken in reliance on it is unlawful. Unintended recipients must notify the sender immediately by e-mail/phone & delete it from their system without making any copies or disclosing it to a third person. |
Administrator
|
At the moment, I don't think so.
The HTML <textarea> element doesn't support a maxlength attribute, I believe, so you can't. HTML 5 will likely add this attribute. Does anybody know if it is actually already supported in some browsers? -Erik On May 13, 2008, at 6:01 AM, Reddy, Gopikrishna wrote: > Hi, > Thanks for ur help > Can u tell me is there any way to do this without binding the node. > > > Thanks and Regards, > K Gopikrishna Reddy > From: Florian Schmitt [mailto:[hidden email]] > Sent: Tue 5/13/2008 1:42 PM > To: [hidden email] > Subject: [ops-users] Re: xxforms:maxlength not working inside > xforms:textarea > > Hi Gopikrishna > > > how can i keep max length for this as iam giving xxforms:maxlength > but it doesnt work for xforms:textarea > > you could try to restrict the length of the content using a binding > and > xpath: > > constraint="string-length lt 71" > > Info about the xpath string-length function: > http://www.w3.org/TR/xpath-functions/#func-string-length > > > HTH > florian > > > > This e-mail (and any attachments), is confidential and may be > privileged. It may be read, copied and used only > by intended recipients. Unauthorized access to this e-mail (or > attachments) and disclosure or copying of its > contents or any action taken in reliance on it is unlawful. > Unintended recipients must notify the sender immediately > by e-mail/phone & delete it from their system without making any > copies or disclosing it to a third person. > > <message-footer.txt> > -- > You receive this message as a subscriber of the [hidden email] > mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |