Thread: [Xsltforms-support] Problem using submission
Brought to you by:
alain-couthures
From: Javier D. <jd...@ge...> - 2009-11-10 12:30:14
|
Hello, I have a xform with the following submission: <xf:submission id="s01" method="post" replace="all" action="*/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM*"> <xf:message level="modeless" ev:event="xforms-submit-error">Submit error.</xf:message> </xf:submission> That is get through the following url: https://tuerca:8080/nucleo?FILE=pruebas/javi/xforms/pai-ip.xml&GRM_RESPUESTA=xsltforms When I use the submit that triggers the action of above, I get that the page that is requested is: https://tuerca:8080/nucleo?FILE=pruebas/javi/xforms/*/nucleo?FILE=pruebas/entornoReq.xml&GEREMIAS_RESPUESTA=whitehtml&XML=XFORM *¿Is this a bug or a feature? If it is working correctly, ¿hoy can I force in "action" to get a relative link, without the server? (https://tuerca:8080/ in my case) Best regards, Javi |
From: COUTHURES A. <ala...@ag...> - 2009-11-10 14:12:12
|
Hello Javier, > Hello, > > I have a xform with the following submission: > > <xf:submission id="s01" method="post" replace="all" > action="*/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM*"> > <xf:message level="modeless" > ev:event="xforms-submit-error">Submit error.</xf:message> > </xf:submission> > > That is get through the following url: > > https://tuerca:8080/nucleo?FILE=pruebas/javi/xforms/pai-ip.xml&GRM_RESPUESTA=xsltforms > > When I use the submit that triggers the action of above, I get that > the page that is requested is: > > https://tuerca:8080/nucleo?FILE=pruebas/javi/xforms/*/nucleo?FILE=pruebas/entornoReq.xml&GEREMIAS_RESPUESTA=whitehtml&XML=XFORM > > *¿Is this a bug or a feature? This is clearly not yet supported to have an action attribute value starting with / ... Have a look at constructURI method of Core class to add this feature (this should not be difficult in fact!) and I will integrate your fix in XSLTForms. Thanks! -Alain |
From: Javier D. <jd...@ge...> - 2009-11-10 17:21:46
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Hello,<br> My answer, below.<br> <br> COUTHURES Alain escribió: <blockquote cite="mid:4AF...@ag..." type="cite"> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> Hello Javier, <blockquote cite="mid:4AF...@ge..." type="cite">Hello,<br> <br> I have a xform with the following submission:<br> <br> <tt><xf:submission id="s01" method="post" replace="all" action="<b>/nucleo?FILE=pruebas/entornoReq.xml&amp;GRM_RESPUESTA=whitehtml&amp;XML=XFORM</b>"><br> <xf:message level="modeless" ev:event="xforms-submit-error">Submit error.</xf:message><br> </xf:submission></tt><br> <br> That is get through the following url:<br> <br> <tt><a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://tuerca:8080/nucleo?FILE=pruebas/javi/xforms/pai-ip.xml&GRM_RESPUESTA=xsltforms">https://tuerca:8080/nucleo?FILE=pruebas/javi/xforms/pai-ip.xml&GRM_RESPUESTA=xsltforms</a><br> <br> </tt>When I use the submit that triggers the action of above, I get that the page that is requested is:<br> <br> <tt><a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://tuerca:8080/nucleo?FILE=pruebas/javi/xforms/">https://tuerca:8080/nucleo?FILE=pruebas/javi/xforms/</a><b>/nucleo?FILE=pruebas/entornoReq.xml&GEREMIAS_RESPUESTA=whitehtml&XML=XFORM<br> <br> </b></tt>¿Is this a bug or a feature?<br> </blockquote> This is clearly not yet supported to have an action attribute value starting with / ... Have a look at constructURI method of Core class to add this feature (this should not be difficult in fact!) and I will integrate your fix in XSLTForms.<br> </blockquote> Ok, I will investigate with constructURI.<br> <br> But I think the behaviour of the construction of the uri is also a bit strange in the case that action does not start with / and is a relative one. I mean, I you have an url like this:<br> <br> <tt><a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://tuerca:8080/nucleo?FILE=pruebas/javi/xforms/pai-ip.xml&GRM_RESPUESTA=xsltforms">https://tuerca:8080/nucleo?FILE=pruebas/javi/xforms/pai-ip.xml&GRM_RESPUESTA=xsltforms</a><br> <br> </tt>to construct the relative path to send a submit should be used taking out the query part of the url, in this case "<tt><a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://tuerca:8080/nucleo?FILE=pruebas/javi/xforms/pai-ip.xml&GRM_RESPUESTA=xsltforms">?FILE=pruebas/javi/xforms/pai-ip.xml&GRM_RESPUESTA=xsltforms</a></tt>", so the url constructed (without taking into account the initial /) should be, from: <br> <br> <tt>nucleo?FILE=pruebas/entornoReq.xml&amp;GRM_RESPUESTA=whitehtml&amp;XML=XFORM</tt><br> <br> the following:<br> <br> <tt><a class="moz-txt-link-freetext" href="https://tuerca:8080/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM">https://tuerca:8080/nucleo?FILE=pruebas/entornoReq.xml&amp;GRM_RESPUESTA=whitehtml&amp;XML=XFORM</a></tt><br> <br> or in case you have subdirectories, from <a class="moz-txt-link-rfc2396E" href="https://tuerca:8080/subdir1/subdir2/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM">"https://tuerca:8080/subdir1/subdir2/nucleo?FILE=pruebas/entornoReq.xml&amp;GRM_RESPUESTA=whitehtml&amp;XML=XFORM"</a>, the absolute uri of "nucleo?FILE=pruebas/entornoReq.xml&amp;GRM_RESPUESTA=whitehtml&amp;XML=XFORM" should be:<br> <br> <tt><a class="moz-txt-link-rfc2396E" href="https://tuerca:8080/subdir1/subdir2/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM">"https://tuerca:8080/subdir1/subdir2/nucleo?FILE=pruebas/entornoReq.xml&amp;GRM_RESPUESTA=whitehtml&amp;XML=XFORM"</a></tt><br> <u><br> </u>In this last example, if we had as relative uri "/nucleo?FILE=pruebas/entornoReq.xml&amp;GRM_RESPUESTA=whitehtml&amp;XML=XFORM", the absolute uri should be:<br> <tt><br> <a class="moz-txt-link-rfc2396E" href="https://tuerca:8080/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM">"https://tuerca:8080/nucleo?FILE=pruebas/entornoReq.xml&amp;GRM_RESPUESTA=whitehtml&amp;XML=XFORM"</a><br> <br> </tt>Am I missing something? I will try to change constructURI to have this behaviour, I suppose it fits better with <a href="http://tools.ietf.org/html/rfc3986">RFC 3986</a> (see section 5.2).<br> <br> Best Regards,<br> Javier<br> <blockquote cite="mid:4AF...@ag..." type="cite"><br> Thanks!<br> <br> -Alain<br> <br> </blockquote> </body> </html> |
From: Javier D. <jd...@ge...> - 2009-11-20 11:27:54
|
Hello, we have changed the constructURI javascript function to create relative uris correctly: constructURI : function(uri) { if (!uri.match(/:\/\//)) { var relativ = document.location.href; var pos = relativ.indexOf("?"); relativ = relativ.substring(0,pos); pos = 0; if (uri.indexOf("/")==0) { for (i=0;i<3;++i){ pos = relativ.indexOf("\/",pos); ++pos; } uri = relativ.substring(0,--pos)+uri; }else { uri = relativ.replace(/[^\/]+$/,"") + uri; } } return uri; } If uri starts with /, we generate the url with the "protocol://host:port/" + uri, and if not, we do the same you were doing but taking out the query part of the uri. I hope it may be useful for anybody. Best Regards, Javier Javier Díaz escribió: > Hello, > My answer, below. > > COUTHURES Alain escribió: >> Hello Javier, >>> Hello, >>> >>> I have a xform with the following submission: >>> >>> <xf:submission id="s01" method="post" replace="all" >>> action="*/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM*"> >>> <xf:message level="modeless" >>> ev:event="xforms-submit-error">Submit error.</xf:message> >>> </xf:submission> >>> >>> That is get through the following url: >>> >>> https://tuerca:8080/nucleo?FILE=pruebas/javi/xforms/pai-ip.xml&GRM_RESPUESTA=xsltforms >>> >>> When I use the submit that triggers the action of above, I get that >>> the page that is requested is: >>> >>> https://tuerca:8080/nucleo?FILE=pruebas/javi/xforms/*/nucleo?FILE=pruebas/entornoReq.xml&GEREMIAS_RESPUESTA=whitehtml&XML=XFORM >>> >>> *¿Is this a bug or a feature? >> This is clearly not yet supported to have an action attribute value >> starting with / ... Have a look at constructURI method of Core class >> to add this feature (this should not be difficult in fact!) and I >> will integrate your fix in XSLTForms. > Ok, I will investigate with constructURI. > > But I think the behaviour of the construction of the uri is also a bit > strange in the case that action does not start with / and is a > relative one. I mean, I you have an url like this: > > https://tuerca:8080/nucleo?FILE=pruebas/javi/xforms/pai-ip.xml&GRM_RESPUESTA=xsltforms > > to construct the relative path to send a submit should be used taking > out the query part of the url, in this case > "?FILE=pruebas/javi/xforms/pai-ip.xml&GRM_RESPUESTA=xsltforms", so the > url constructed (without taking into account the initial /) should be, > from: > > nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM > > the following: > > https://tuerca:8080/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM > > or in case you have subdirectories, from > "https://tuerca:8080/subdir1/subdir2/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM", > the absolute uri of > "nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM" > should be: > > "https://tuerca:8080/subdir1/subdir2/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM" > _ > _In this last example, if we had as relative uri > "/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM", > the absolute uri should be: > > "https://tuerca:8080/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM" > > Am I missing something? I will try to change constructURI to have this > behaviour, I suppose it fits better with RFC 3986 > <http://tools.ietf.org/html/rfc3986> (see section 5.2). > > Best Regards, > Javier >> >> Thanks! >> >> -Alain >> > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > ------------------------------------------------------------------------ > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > |
From: COUTHURES A. <ala...@ag...> - 2009-11-23 20:56:52
|
Hello, > we have changed the constructURI javascript function to create > relative uris correctly This javascript function was already modified but the query string was not removed. Thank you for pointing at this! I have just fixed this in the last SVN commit. Best regards, -Alain |