call-xpl for a model?

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

call-xpl for a model?

Mike Leary

Is it possible to make a model out of a pipeline like this, or some
other way?

<xhtml:head>

<xforms:model id="security">
  <xforms:instance id="acegi">
    <monkey xmlns=""/>
  </xforms:instance>
  <xforms:bind
    nodeset="instance('acegi')/monkey"
    calculate="xxforms:call-xpl( 'oxf:/apps/nexus/acegi.xpl', (), (), 'data')"/>
</xforms:model>

</xhtml:head>


I can't (sic!) get any errors with this (e.g. putting a bad path in the
first arg), and it doesn't seem to work either.

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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: call-xpl for a model?

Ryan Puddephatt
Mike,
        This won't work because the model has to be built for a bind to be
actioned, hence no error. What is it your trying to achieve? A dynamic model
from an XPL?

Why not create a URL that returns this XPL and use

<xi:include href="/some/service/for/model" xxi:omit-xml-base="true"/>

in the xhtml:head, this will be processed at the server and then the page
will be created.

Hope this helps

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

 

>-----Original Message-----
>From: Mike Leary [mailto:[hidden email]]
>Sent: 24 January 2007 01:05
>To: [hidden email]
>Subject: [ops-users] call-xpl for a model?
>
>
>Is it possible to make a model out of a pipeline like this, or
>some other way?
>
><xhtml:head>
>
><xforms:model id="security">
>  <xforms:instance id="acegi">
>    <monkey xmlns=""/>
>  </xforms:instance>
>  <xforms:bind
>    nodeset="instance('acegi')/monkey"
>    calculate="xxforms:call-xpl( 'oxf:/apps/nexus/acegi.xpl',
>(), (), 'data')"/> </xforms:model>
>
></xhtml:head>
>
>
>I can't (sic!) get any errors with this (e.g. putting a bad
>path in the first arg), and it doesn't seem to work either.
>
>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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: call-xpl for a model?

Mike Leary

Ah, the pipeline returns secure user data, so URLs are right out. :/

I could make them secure URLS, but I'd much rather keep it all tucked
away.

On Wed, Jan 24, 2007 at 01:27:46AM +0000, Ryan Puddephatt wrote:
> Why not create a URL that returns this XPL and use
>
> <xi:include href="/some/service/for/model" xxi:omit-xml-base="true"/>


--



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

RE: call-xpl for a model?

Ryan Puddephatt
Mike,
        Why not use the @model in your page-flow entry to use that secure
XPL this will be accessable on

<xi:include href="input:data" xxi:omit-xml-base="true"/>

That keeps it tucked away :-)

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

 

>-----Original Message-----
>From: Mike Leary [mailto:[hidden email]]
>Sent: 24 January 2007 05:06
>To: [hidden email]
>Subject: Re: [ops-users] call-xpl for a model?
>
>
>Ah, the pipeline returns secure user data, so URLs are right out. :/
>
>I could make them secure URLS, but I'd much rather keep it all
>tucked away.
>
>On Wed, Jan 24, 2007 at 01:27:46AM +0000, Ryan Puddephatt wrote:
>> Why not create a URL that returns this XPL and use
>>
>> <xi:include href="/some/service/for/model" xxi:omit-xml-base="true"/>
>
>
>--
>
>



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

Re: call-xpl for a model?

Mike Leary

I guess the next question is: what about multiple pipelines?

I tried the following, but apparently value is an invalid attribute for
setvalue....?


The following error has occurred: Error Message
Error unexpected attribute "value"(schema:
http://www.orbeon.com/oxf/controller)


page-flow:

<page id="info"
  path-info="/secure/info"
  view="secure/info.xhtml"
  model="secure/info.xml">
  <setvalue ref="/parameters/acegi"
    value="{{xxforms:call-xpl('acegi.xpl', (), (), 'data')}}"/>
  <setvalue ref="/parameters/request"
    value="{{xxforms:call-xpl('request.xpl', (), (), 'data')}}"/>
</page>


view.xhtml:

<xforms:instance id="parameters-instance">
  <xi:include href="input:instance" xxi:omit-xml-base="true"/>
</xforms:instance>


info.xml:

<parameters>
  <acegi/>
  <request/>
  <document-id/>
  <readonly/>
</parameters>





On Wed, Jan 24, 2007 at 12:19:20PM +0000, Ryan Puddephatt wrote:

> Mike,
> Why not use the @model in your page-flow entry to use that secure
> XPL this will be accessable on
>
> <xi:include href="input:data" xxi:omit-xml-base="true"/>
>
> That keeps it tucked away :-)
>
> 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
>
>  
>
> >-----Original Message-----
> >From: Mike Leary [mailto:[hidden email]]
> >Sent: 24 January 2007 05:06
> >To: [hidden email]
> >Subject: Re: [ops-users] call-xpl for a model?
> >
> >
> >Ah, the pipeline returns secure user data, so URLs are right out. :/
> >
> >I could make them secure URLS, but I'd much rather keep it all
> >tucked away.
> >
> >On Wed, Jan 24, 2007 at 01:27:46AM +0000, Ryan Puddephatt wrote:
> >> Why not create a URL that returns this XPL and use
> >>
> >> <xi:include href="/some/service/for/model" xxi:omit-xml-base="true"/>
> >
> >
> >--
> >
> >
>
>

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


--



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

RE: call-xpl for a model?

Ryan Puddephatt
Ok, use the an XPL in the @model to create this,

You could use two oxf::pipeline processors to run each of your other XPLs.

Then you could merge them using XSLT, or you could return one on a data
output and one on an instance output.

The reason the setvalue doesn't work is because you cannot use
xxforms:xpl-call anywhere but a xforms:bind, and setvalue only takes
@parameter or @matcher

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

 

>-----Original Message-----
>From: Mike Leary [mailto:[hidden email]]
>Sent: 24 January 2007 19:19
>To: [hidden email]
>Subject: Re: [ops-users] call-xpl for a model?
>
>
>I guess the next question is: what about multiple pipelines?
>
>I tried the following, but apparently value is an invalid
>attribute for setvalue....?
>
>
>The following error has occurred: Error Message Error
>unexpected attribute "value"(schema:
>http://www.orbeon.com/oxf/controller)
>
>
>page-flow:
>
><page id="info"
>  path-info="/secure/info"
>  view="secure/info.xhtml"
>  model="secure/info.xml">
>  <setvalue ref="/parameters/acegi"
>    value="{{xxforms:call-xpl('acegi.xpl', (), (), 'data')}}"/>
>  <setvalue ref="/parameters/request"
>    value="{{xxforms:call-xpl('request.xpl', (), (),
>'data')}}"/> </page>
>
>
>view.xhtml:
>
><xforms:instance id="parameters-instance">
>  <xi:include href="input:instance" xxi:omit-xml-base="true"/>
></xforms:instance>
>
>
>info.xml:
>
><parameters>
>  <acegi/>
>  <request/>
>  <document-id/>
>  <readonly/>
></parameters>
>
>
>
>
>
>On Wed, Jan 24, 2007 at 12:19:20PM +0000, Ryan Puddephatt wrote:
>> Mike,
>> Why not use the @model in your page-flow entry to use
>that secure XPL
>> this will be accessable on
>>
>> <xi:include href="input:data" xxi:omit-xml-base="true"/>
>>
>> That keeps it tucked away :-)
>>
>> 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
>>
>>  
>>
>> >-----Original Message-----
>> >From: Mike Leary [mailto:[hidden email]]
>> >Sent: 24 January 2007 05:06
>> >To: [hidden email]
>> >Subject: Re: [ops-users] call-xpl for a model?
>> >
>> >
>> >Ah, the pipeline returns secure user data, so URLs are right out. :/
>> >
>> >I could make them secure URLS, but I'd much rather keep it
>all tucked
>> >away.
>> >
>> >On Wed, Jan 24, 2007 at 01:27:46AM +0000, Ryan Puddephatt wrote:
>> >> Why not create a URL that returns this XPL and use
>> >>
>> >> <xi:include href="/some/service/for/model"
>> >> xxi:omit-xml-base="true"/>
>> >
>> >
>> >--
>> >
>> >
>>
>>
>
>>
>> --
>> 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
>
>
>--
>
>



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

Re: call-xpl for a model?

Mike Leary
On Wed, Jan 24, 2007 at 07:26:53PM +0000, Ryan Puddephatt wrote:
> Ok, use the an XPL in the @model to create this,
>
> You could use two oxf::pipeline processors to run each of your other XPLs.

Right, I guess that's 'obvious'. :-/  I'd have thought that multiple
pipelines flowing into multiple models/instances would be a natural
idiom ... is that really not possible?

> The reason the setvalue doesn't work is because you cannot use
> xxforms:xpl-call anywhere but a xforms:bind, and setvalue only takes
> @parameter or @matcher

Something to be added to the docs for those.

OK, so in a <page> I can use either ...

model="some.xpl" and that will be available to an xpl view as input:data
or as the default doc to an xsl/xhtml view.  Can I select a different
instance for xsl in the view?
  <xsl:for-each select="instance('foo')/..." > ...
What about a different model?

default-submission="some.xpl" and that will be available as
input:instance in the xhtml/xsl/xpl view

And if I was going to be accepting submissions from users to this page,
I'd use the model variant, so as not to trample my utility data with
user data.  That is, there's no way to mix a default-submission with a
real submission that isn't compatible.  Yes?



--



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

Re: call-xpl for a model?

Erik Bruchez
Administrator
Mike Leary wrote:

> On Wed, Jan 24, 2007 at 07:26:53PM +0000, Ryan Puddephatt wrote:
>> Ok, use the an XPL in the @model to create this,
>>
>> You could use two oxf::pipeline processors to run each of your other XPLs.
>
> Right, I guess that's 'obvious'. :-/  I'd have thought that multiple
> pipelines flowing into multiple models/instances would be a natural
> idiom ... is that really not possible?
>
>> The reason the setvalue doesn't work is because you cannot use
>> xxforms:xpl-call anywhere but a xforms:bind, and setvalue only takes
>> @parameter or @matcher
>
> Something to be added to the docs for those.
Well xxforms:call-xpl() *should* work within any XPath expression. If it
doesn't, that's a bug ;-)

> OK, so in a <page> I can use either ...
>
> model="some.xpl" and that will be available to an xpl view as input:data
> or as the default doc to an xsl/xhtml view.  Can I select a different
> instance for xsl in the view?
>   <xsl:for-each select="instance('foo')/..." > ...

The instance() function is an XForms function. You don't have access to
that function from XSLT.

Remember that an XSLT page view is just a preprocessing step that occurs
*before* the page is processed by the XForms engine.

> And if I was going to be accepting submissions from users to this page,
> I'd use the model variant, so as not to trample my utility data with
> user data.  That is, there's no way to mix a default-submission with a
> real submission that isn't compatible.  Yes?

The submission is just an XML document. If there is an actual submission
on a certain page, the default submission is not used at all. Whether
you accept "incompatible" submissions is up to you!

-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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: call-xpl for a model?

Mike Leary
In reply to this post by Mike Leary

Ok, now I've got something that *ought* to work, afaik, but also
does not.


page-flow.xml:

<page id="info"
  path-info="/secure/info"
  view="secure/info.xhtml"
  default-submission="secure/info.xml"/>


secure/info.xhtml:

<xforms:instance id="parameters-instance">
  <xi:include href="input:instance" xxi:omit-xml-base="true"/>
</xforms:instance>

<xforms:bind nodeset="instance('parameters-instance')">
  <xforms:bind
    nodeset="acegi"
    calculate="xxforms:call-xpl('oxf:/apps/nexus/acegi.xpl',(),(),'data')/*"/>
  <xforms:bind
    nodeset="request"
    calculate="xxforms:call-xpl('oxf:/apps/nexus/request.xpl',(),(),'data')/*"/>
</xforms:bind>


Do I have the null parameters there?  I get no errors whether I use (),
'', or nothing at all.


secure/info.xml:

<parameters>
  <document-id/>
  <readonly/>
  <acegi/>
  <request/>
  <test>testing</test>
</parameters>


I can output the <test> value, but nothing seems to be available in
<acegi> or <request>.

Those pipelines produce at least:

<security>
  <userDetails>
    <username/>
  </userDetails>
</security>

<request>
  <remote-user/>
<request>


Silly question:

If this did work, is the xpath to get to remote-user just
instance('parameters-instance')/request/remote-user, where the root
nodes "collapse upward"?


--



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

Re: call-xpl for a model?

Erik Bruchez
Administrator
Mike Leary wrote:

> Those pipelines produce at least:
>
> <security>
>   <userDetails>
>     <username/>
>   </userDetails>
> </security>
>
> <request>
>   <remote-user/>
> <request>
Are they actually empty, or do they have values, for example under
<username>? If they are empty, the result of the @calculate attribute
will be a blank string. (The result of @calculate is always a string.)

> Silly question:
>
> If this did work, is the xpath to get to remote-user just
> instance('parameters-instance')/request/remote-user, where the root
> nodes "collapse upward"?

I am not sure I understand the question, but this seems to hint that you
want to insert XML into an instance with @calculate. This is not
possible because the result of @calculate is always a string. If you
want to insert XML, you can use the xforms:insert action. You could
write something like this:

   <xforms:insert context="request" origin="xxforms:call-xpl(...)/*">

-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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws