Re: url-generator

Posted by Ryan Puddephatt on
URL: https://discuss.orbeon.com/url-generator-tp32999p33004.html

Naman,
    Try taking the generated xforms:submission, taking out the namespace declarations and seeing if that works, I think the spaces and dots in the url are causing a problem

if it is the xmlns then add exclude-result-prefixes="#all" to the xsl:stylesheet element

Ryan

Naman Joshi wrote:
Hi Joseph,
 
I tried:
 
    <p:processor name="oxf:xslt">
        <p:input name="config">
            <xsl:stylesheet version="2.0">
                            <xsl:template match="/">
                                         <xsl:variable name="txid" select="/request/txid"/>
                                        <xforms:submission id="save-submission" method="put" action="http://isd192.macbank:8070/exist/rest/db/mweb/requests/{$txid}.xml"/>
                             </xsl:template>
            </xsl:stylesheet>
        </p:input>
        <p:input name="data" href="#mweb-request"/>
        <p:output name="data" id="submission" debug="true"/>
    </p:processor>
 
    <p:processor name="oxf:xforms-submission">
        <p:input name="submission" href="#submission"/>
        <p:input name="request" href="#mweb-request" />
        <p:output name="response" ref="data"/>
    </p:processor>
 
I had to add the stylesheet and template or else the submission instance would be empty. I also had to add #web-request or else it wouldn't compile. Unfortunately this way did not work, looking at the log I got "Error code received when submitting instance: 500". I think the cause of this is what the xslt processor is passing on:
 
<xforms:submission xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:p="http://www.orbeon.com/oxf/pipeline" id="save-submission" method="put" action="http://isd192.macbank:8070/exist/rest/db/mweb/requests/liferay.com.1_05-03-2007_23:00:24.xml"></xforms:submission>
 
I think all that xmlns stuff is getting in the way. The database is fine because if I do a simple submission like this.....it works:
 
<p:processor name="oxf:xforms-submission">
             <p:input name="submission">
                      <xforms:submission ref="#mweb-request" id="save-submission" method="put" action="http://isd192.macbank:8070/exist/rest/db/mweb/requests/test.xml"/>
             </p:input>
             <p:input name="request" href="#mweb-request"/>
             <p:output name="response" ref="data"/>
</p:processor>
 
What do you guys think?
 
Naman



From: Joseph Lawrence [[hidden email]]
Sent: Monday, 5 March 2007 4:12 PM
To: [hidden email]
Subject: RE: [ops-users] url-generator

Hi Naman,
    Did you try something like:

    <p:processor name="oxf:xslt">
        <p:input name="config">
            <xforms:submission ref="#mweb-request/status" id="save-submission" method="put" action="<a class="moz-txt-link-freetext" href="http://isd192.macbank:8070/exist/rest/db/mweb/requests/{xml-filename-from">http://isd192.macbank:8070/exist/rest/db/mweb/requests/{xml-filename-from-mweb-request}.xml/>
        </p:input>
        <p:input name="data" href="#mweb-request"/>
        <p:output name="data" id="submission"/>
    </p:processor>
    <p:processor name="oxf:xforms-submission">
        <p:input name="submission" href="#submission"/>
        <p:input name="request"><dummy/></p:input>
        <p:output name="response" id="data"/>
    </p:processor>

Thanks
Joseph Lawrence
Stabilix Solutions


Naman Joshi [hidden email] wrote:
Hi Joesph,
 
Can something similar be done for a submission URL. For example in the code below I want to make a XML file in the exist database where the file name is an element in mweb-request. What is the correct syntax to do this?
 
<p:processor name="oxf:xforms-submission">
             <p:input name="submission">
                      <xforms:submission ref="#mweb-request/status" id="save-submission" method="put" action="http://isd192.macbank:8070/exist/rest/db/mweb/requests/??.xml"/>
             </p:input>
             <p:input name="request" href="#mweb-request"/>
             <p:output name="response" ref="data"/>
</p:processor>
Cheers,
Naman

From: Joseph Lawrence [[hidden email]]
Sent: Monday, 5 March 2007 3:24 PM
To: [hidden email]
Subject: Re: [ops-users] url-generator

Hi Ryan,
    I think the URL generator, unless otherwise specified, uses the oxf as context. Hence I think using something like below might work. But if you can't use absolute URL, I not sure of how to accomplish this.

    <p:processor name="oxf:xhtml-rewrite">
        <p:input name="rewrite-in"><xhtml:a href="/services/db/get"/></p:input>
        <p:output name="rewrite-out" id="rewritten-url">
    </p:processor>

    <p:processor name="oxf:xslt">
        <p:input name="data" href="#rewritten-url"/>
        <p:input name="config">
            <config xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                <url>https://localhost:8888<xsl:value-of select="//@href"/></url>
                <content-type>application/xml</content-type>
            </config>
        </p:input>
        <p:output name="data" id="url-generator-config"/>
    </p:processor>

    <p:processor name="oxf:url-generator">
        <p:input name="config" href="#url-generator-config"/>
        <p:output name="data" ref="data"/>
    </p:processor>

Thanks
Joseph Lawrence
Stabilix Solutions

Ryan Puddephatt [hidden email] wrote:
Hi,
I'm trying to use the url-generator to return a relative url within
the same context such as /services/db/get

But it keeps returning Cannot load "/contracts/services/db/get" with
webapp loader

There isn't anything in the documentation about context relative urls,
is this possible? I can't use an absolute url because of SSL and
authentication on the server

Ryan

Ryan Puddephatt
Software Engineer

Teleflex Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotland
EH54 7DP

e> [hidden email]
t> +44(0)1506 407 110
f> +44(0)1506 407 108
w> www.teleflex.com



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws


We won't tell. Get more on shows you hate to love
(and love to hate): Yahoo! TV's Guilty Pleasures list.
NOTICE
This e-mail and any attachments are confidential and may contain copyright material of Macquarie Bank or third parties. If you are not the intended recipient of this email you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. Macquarie Bank does not guarantee the integrity of any emails or any attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of Macquarie Bank.

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws


Get your own web address.
Have a HUGE year through Yahoo! Small Business.

-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--

Ryan Puddephatt
Software Engineer
 
Teleflex Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotland
EH54 7DP
 
e> [hidden email]
t> +44(0)1506 407 110
f> +44(0)1506 407 108
w> www.teleflex.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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws