Reading request-path from XForms/XPath

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Reading request-path from XForms/XPath

Gunzenreiner Simon
Reading request-path from XForms/XPath

Hi all

I would like to make the resource of a submission dependent on (the last part) of the requested resource. So, instead of using a request parameter and accessing it via {xxforms:get-request-parameter('id')}, I would like to evaluate the last part of my url, e.g. /orbeon/myapp/myresource/12345. Since there does not seem to be an XPath extension function in Orbeon that provides the request path, does anybody have an idea how to access the request path?

I know that from XSL, I could do "doc('input:request')/*/request-path", but have no idea how to access the information provided by the request generator processor .

Thanks a lot,

Simon



--
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
Reply | Threaded
Open this post in threaded view
|

Re: Reading request-path from XForms/XPath

Hank Ratzesberger-2

Hi Simon,

the xxforms:get-request-parameter is an xpath function to get request parameters, but 
otherwise, you can create a model attribute for the path (in page-flow.xml) and pass
along the whole request.  Then it is available as instance('input:instance')/...

Cheers,
Hank

On Aug 16, 2010, at 2:22 AM, Gunzenreiner Simon wrote:

Hi all

I would like to make the resource of a submission dependent on (the last part) of the requested resource. So, instead of using a request parameter and accessing it via {xxforms:get-request-parameter('id')}, I would like to evaluate the last part of my url, e.g. /orbeon/myapp/myresource/12345. Since there does not seem to be an XPath extension function in Orbeon that provides the request path, does anybody have an idea how to access the request path?

I know that from XSL, I could do "doc('input:request')/*/request-path", but have no idea how to access the information provided by the request generator processor .

Thanks a lot,

Simon




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

Hank Ratzesberger
NEES@UCSB
Earth Research Institute
University of California, Santa Barbara
805-893-8042








--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Reading request-path from XForms/XPath

Erik Bruchez
Administrator
Simon,

It would be good to implement such a function. I entered an RFE:

http://forge.ow2.org/tracker/index.php?func=detail&aid=315334&group_id=168&atid=350207

Maybe you could give it a shot, it should be easy based on other
functions, like this one:

http://github.com/orbeon/orbeon-forms/blob/master/src/java/org/orbeon/oxf/xforms/function/xxforms/XXFormsGetRequestParameter.java

-Erik

On Wed, Aug 18, 2010 at 8:25 AM, Hank Ratzesberger <[hidden email]> wrote:

>
> Hi Simon,
> the xxforms:get-request-parameter is an xpath function to get request
> parameters, but
> otherwise, you can create a model attribute for the path (in page-flow.xml)
> and pass
> along the whole request.  Then it is available as
> instance('input:instance')/...
> Cheers,
> Hank
> On Aug 16, 2010, at 2:22 AM, Gunzenreiner Simon wrote:
>
> Hi all
>
> I would like to make the resource of a submission dependent on (the last
> part) of the requested resource. So, instead of using a request parameter
> and accessing it via {xxforms:get-request-parameter('id')}, I would like to
> evaluate the last part of my url, e.g. /orbeon/myapp/myresource/12345. Since
> there does not seem to be an XPath extension function in Orbeon that
> provides the request path, does anybody have an idea how to access the
> request path?
>
> I know that from XSL, I could do "doc('input:request')/*/request-path", but
> have no idea how to access the information provided by the request generator
> processor ….
>
> Thanks a lot,
>
> Simon
>
>
> --
> 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
>
> Hank Ratzesberger
> NEES@UCSB
> Earth Research Institute
> University of California, Santa Barbara
> 805-893-8042
>
>
>
>
>
>
>
> --
> 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
>
>


--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Reading request-path from XForms/XPath

Erik Bruchez
Administrator
FYI this was easy to implement so we now have an xxforms:get-request-path() function in the latest nightly builds.

-Erik

On Fri, Aug 20, 2010 at 6:17 PM, Erik Bruchez <[hidden email]> wrote:
Simon,

It would be good to implement such a function. I entered an RFE:

http://forge.ow2.org/tracker/index.php?func=detail&aid=315334&group_id=168&atid=350207

Maybe you could give it a shot, it should be easy based on other
functions, like this one:

http://github.com/orbeon/orbeon-forms/blob/master/src/java/org/orbeon/oxf/xforms/function/xxforms/XXFormsGetRequestParameter.java

-Erik

On Wed, Aug 18, 2010 at 8:25 AM, Hank Ratzesberger <[hidden email]> wrote:
>
> Hi Simon,
> the xxforms:get-request-parameter is an xpath function to get request
> parameters, but
> otherwise, you can create a model attribute for the path (in page-flow.xml)
> and pass
> along the whole request.  Then it is available as
> instance('input:instance')/...
> Cheers,
> Hank
> On Aug 16, 2010, at 2:22 AM, Gunzenreiner Simon wrote:
>
> Hi all
>
> I would like to make the resource of a submission dependent on (the last
> part) of the requested resource. So, instead of using a request parameter
> and accessing it via {xxforms:get-request-parameter('id')}, I would like to
> evaluate the last part of my url, e.g. /orbeon/myapp/myresource/12345. Since
> there does not seem to be an XPath extension function in Orbeon that
> provides the request path, does anybody have an idea how to access the
> request path?
>
> I know that from XSL, I could do "doc('input:request')/*/request-path", but
> have no idea how to access the information provided by the request generator
> processor ….
>
> Thanks a lot,
>
> Simon
>
>
> --
> 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
>
> Hank Ratzesberger
> NEES@UCSB
> Earth Research Institute
> University of California, Santa Barbara
> 805-893-8042
>
>
>
>
>
>
>
> --
> 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
>
>



--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Reading request-path from XForms/XPath

jyothi sree
Hai all,
I am very much new to Orbeon ,Inface 2 days old . i have started off with the bookcasting example provoded in the documentation ,

this is my view.xhtml

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xhtml="http://www.w3.org/1999/xhtml"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
<head>
    <xforms:model>

        <xforms:instance id="books-instance">
        <books xmlns="">
            <book>   <title/>
            <author/>
            <language/>
            <link/>
            <rating/>
            <notes/>
            </book>
        </books>
        </xforms:instance>
<xforms:instance id="languages-instance">
<
languages xmlns="">
<language><name>English</name><value>en</value></language><language><name>French</name><value>fr</value></language><language><name>Spanish</name><value>es</value></language></languages>
</xforms:instance>

 
        <xforms:bind nodeset="/books/book"><xforms:bind nodeset="title" required="true()"/><xforms:bind nodeset="author" required="true()"/></xforms:bind>
    </xforms:model>
     
     
</head>
 
<body>
    <xforms:group ref="book">
        <xforms:input ref="title">
            <xforms:label>Title</xforms:label>
        </xforms:input>
        <br/>
        <xforms:input ref="author">
            <xforms:label>Author</xforms:label>
        </xforms:input>
 
     <xforms:select1 ref="language"><xforms:label>Language</xforms:label><xforms:item><xforms:label>Choose One...</xforms:label><xforms:value/></xforms:item><xforms:itemset nodeset="instance('languages-instance')/language"><xforms:label ref="name"/><xforms:value ref="value"/></xforms:itemset></xforms:select1>
    </xforms:group>
     
     
 
</body>
</html>

Till here its working fine ,but when i add language-instance instance in the model then i am not getting the view , what is the mistake i am
doing

Thanks





--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Reading request-path from XForms/XPath

Hank Ratzesberger-2
Hello Jyothi,

If you don't have a specific bind element, then use the instance() function in your group ref:

<xforms:group ref="instance('books-instance')/books/book">

  <xforms:input ref="title"/> 

The above will hopefully work, but I think everyone has to debug the first attempt.

The "single node binding" requirement is "tricky" and not just at first.  Every instance requires
a single top-level node, but that node isn't referenced in XPath functions.

Cheers,
Hank

On Sep 7, 2010, at 5:50 AM, jyothi sree wrote:

Hai all,
I am very much new to Orbeon ,Inface 2 days old . i have started off with the bookcasting example provoded in the documentation ,

this is my view.xhtml

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xhtml="http://www.w3.org/1999/xhtml"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
<head>
    <xforms:model>

        <xforms:instance id="books-instance">
        <books xmlns="">
            <book>   <title/>
            <author/>
            <language/>
            <link/>
            <rating/>
            <notes/>
            </book>
        </books>
        </xforms:instance>
<xforms:instance id="languages-instance">
<
languages xmlns="">
<language><name>English</name><value>en</value></language><language><name>French</name><value>fr</value></language><language><name>Spanish</name><value>es</value></language></languages>
</xforms:instance>

 
        <xforms:bind nodeset="/books/book"><xforms:bind nodeset="title" required="true()"/><xforms:bind nodeset="author" required="true()"/></xforms:bind>
    </xforms:model>
     
     
</head>
 
<body>
    <xforms:group ref="book">
        <xforms:input ref="title">
            <xforms:label>Title</xforms:label>
        </xforms:input>
        <br/>
        <xforms:input ref="author">
            <xforms:label>Author</xforms:label>
        </xforms:input>
 
     <xforms:select1 ref="language"><xforms:label>Language</xforms:label><xforms:item><xforms:label>Choose One...</xforms:label><xforms:value/></xforms:item><xforms:itemset nodeset="instance('languages-instance')/language"><xforms:label ref="name"/><xforms:value ref="value"/></xforms:itemset></xforms:select1>
    </xforms:group>
     
     
 
</body>
</html>

Till here its working fine ,but when i add language-instance instance in the model then i am not getting the view , what is the mistake i am
doing

Thanks




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

Hank Ratzesberger
NEES@UCSB
Earth Research Institute
University of California, Santa Barbara
805-893-8042








--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Reading request-path from XForms/XPath

Hank Ratzesberger-2
In reply to this post by Hank Ratzesberger-2

Simon, you may have noticed that there is a new xpath function:


Cheers,
Hank

On Aug 18, 2010, at 8:25 AM, Hank Ratzesberger wrote:


Hi Simon,

the xxforms:get-request-parameter is an xpath function to get request parameters, but 
otherwise, you can create a model attribute for the path (in page-flow.xml) and pass
along the whole request.  Then it is available as instance('input:instance')/...

Cheers,
Hank

On Aug 16, 2010, at 2:22 AM, Gunzenreiner Simon wrote:

Hi all

I would like to make the resource of a submission dependent on (the last part) of the requested resource. So, instead of using a request parameter and accessing it via {xxforms:get-request-parameter('id')}, I would like to evaluate the last part of my url, e.g. /orbeon/myapp/myresource/12345. Since there does not seem to be an XPath extension function in Orbeon that provides the request path, does anybody have an idea how to access the request path?

I know that from XSL, I could do "doc('input:request')/*/request-path", but have no idea how to access the information provided by the request generator processor .

Thanks a lot,

Simon




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

Hank Ratzesberger
NEES@UCSB
Earth Research Institute
University of California, Santa Barbara
805-893-8042







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

Hank Ratzesberger
NEES@UCSB
Earth Research Institute
University of California, Santa Barbara
805-893-8042








--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Reading request-path from XForms/XPath

jyothi sree
In reply to this post by Hank Ratzesberger-2

Hai
I have developed a form using the FormBuilder ,now how and where do i use this form


Thanks


--
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
Reply | Threaded
Open this post in threaded view
|

RE: Re: Re: Re: Re: Re: Reading request-path from XForms/XPath

Reinhardt Willy, Bedag

Hi,

 

By using an url with format like : <a href="http://%7bhost%7d:%7bport%7d/orbeon/%7bform">http://{host}:{port}/orbeon/{form application name}/{form name}/new

 

Sample:

http://localhost:8080/orbeon/myapp/test/new

 

Regards

 


Willy Reinhardt

 

De : jyothi sree [mailto:[hidden email]]
Envoyé : mercredi 8 septembre 2010 13:21
À : [hidden email]
Objet : [ops-users] Re: Re: Re: Re: Re: Reading request-path from XForms/XPath

 


Hai
I have developed a form using the FormBuilder ,now how and where do i use this form


Thanks



--
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
Reply | Threaded
Open this post in threaded view
|

Re: RE: Re: Re: Re: Re: Re: Reading request-path from XForms/XPath

jyothi sree
Hai ,
What would this url format give me ,
It is showing me the the Requested page is not found .

On Wed, Sep 8, 2010 at 5:09 PM, Reinhardt Willy, Bedag <[hidden email]> wrote:

Hi,

 

By using an url with format like : <a href="http://%7bhost%7d:%7bport%7d/orbeon/%7bform" target="_blank">http://{host}:{port}/orbeon/{form application name}/{form name}/new

 

Sample:

http://localhost:8080/orbeon/myapp/test/new

 

Regards

 


Willy Reinhardt

 

De : jyothi sree [mailto:[hidden email]]
Envoyé : mercredi 8 septembre 2010 13:21
À : [hidden email]
Objet : [ops-users] Re: Re: Re: Re: Re: Reading request-path from XForms/XPath

 


Hai
I have developed a form using the FormBuilder ,now how and where do i use this form


Thanks



--
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




--
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
Reply | Threaded
Open this post in threaded view
|

AW: Re: Re: Reading request-path from XForms/XPath

Gunzenreiner Simon
In reply to this post by Hank Ratzesberger-2

Hi Hank

 

Thanks a lot for pointing this out.

 

Best regards

Simon

 

Von: Hank Ratzesberger [mailto:[hidden email]]
Gesendet: Dienstag, 7. September 2010 22:41
An: [hidden email]
Betreff: [ops-users] Re: Re: Reading request-path from XForms/XPath

 

 

Simon, you may have noticed that there is a new xpath function:

 

 

Cheers,

Hank

 

On Aug 18, 2010, at 8:25 AM, Hank Ratzesberger wrote:



 

Hi Simon,

 

the xxforms:get-request-parameter is an xpath function to get request parameters, but 

otherwise, you can create a model attribute for the path (in page-flow.xml) and pass

along the whole request.  Then it is available as instance('input:instance')/...

 

Cheers,

Hank

 

On Aug 16, 2010, at 2:22 AM, Gunzenreiner Simon wrote:



Hi all

I would like to make the resource of a submission dependent on (the last part) of the requested resource. So, instead of using a request parameter and accessing it via {xxforms:get-request-parameter('id')}, I would like to evaluate the last part of my url, e.g. /orbeon/myapp/myresource/12345. Since there does not seem to be an XPath extension function in Orbeon that provides the request path, does anybody have an idea how to access the request path?

I know that from XSL, I could do "doc('input:request')/*/request-path", but have no idea how to access the information provided by the request generator processor ….

Thanks a lot,

Simon

 

 


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

 

Hank Ratzesberger

NEES@UCSB

Earth Research Institute

University of California, Santa Barbara

805-893-8042

 

 

 

 

 


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

 

Hank Ratzesberger

NEES@UCSB

Earth Research Institute

University of California, Santa Barbara

805-893-8042

 

 

 



 



--
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