Page-Flow Problem

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

RE: Page-Flow Problem

Ryan Puddephatt
Alex,
        Thanks, I think I understand how to use action & result a little
better now. I've got this working

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: [hidden email] [mailto:[hidden email]] On Behalf
>Of Alessandro Vernet
>Sent: 25 July 2006 03:45
>To: [hidden email]
>Subject: Re: [ops-users] Page-Flow Problem
>
>On 7/24/06, Ryan Puddephatt <[hidden email]> wrote:
>> The result is the content of user-level-sub.xml, which is incorrect
>> because it should be the output of the original model. Any
>ideas how to do this?
>
>Hi Ryan,
>
>If you want to pass an instance from the first page to the
>second one, it looks to me like you are missing something that
>copies the instance in the <result> element. For instance:
>
><result page="ARCCView">
>    <xu:update select="/">
>        <xu:copy-of select="doc('input:instance')/*"/>
>    </xu:update>
></result>
>
>Also the redirection happens before the model is executed. If
>you want to run XPL before the redirection, it needs to be in
>an action.xpl.
>You can then access in XUpdate or XSLT inside the <result>
>element the output from the action ('data' output) with
>doc('input:action').
>
>Alex
>--
>Blog (XML, Web apps, Open Source):
>http://www.orbeon.com/blog/
>
>



--
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: Redirect with dynamic URL parameters ... was "Page-Flow Problem"

Alessandro  Vernet
Administrator
In reply to this post by Larry T. Chen
Larry,

I would have expected something like this to work:

<page path-info="/a">
    <action>
        <result page="b">
            <xu:update select="/id">42</xu:update>
        </result>
    </action>
</page>

<page path-info="/b" default-submission="gaga.xml"
view="return-instance.xml" id="b">
    <setvalue ref="/id" parameter="id"/>
</page>

return-instance.xml just displays the instance (attached) and
instance.xml contains <id>1</id>.

But when going to /a, I am redirected to /b?%24instance=XXX&id=. Am I
missing something here? Erik, can you fill us on this one?

Alex

On 7/24/06, Larry T. Chen <[hidden email]> wrote:

>
>  Thanks Erik,
>
>  What I'm really trying to do is simply redirect to a page while passing a
> parameter on the URL line.  For example,
>  /Customer/edit?id=300    where ?id=300 is generated dynamically based on
> data from the prior XML submission.
>
>  After reading some of your prior responses to other threads ... I'm
> thinking it may be possible to use the redirect processor
>  by transforming the input to the redirect processor using XSLT first to
> supply the dynamic URL parameter.
>  I was hoping there was an easier way to do it.  Seems like a lot of code
> just to do a simple redirect to a URL with dynamic parameters.
>  In JSP, PHP, or other similar server-side scripting languages, something
> like this would only take one line of code.
>
>  Larry T. Chen
>  Software Engineer
>  Intelenet Communications, Inc.
>
>
>
>  Erik Bruchez wrote:
> The issue may simply be that the URL is too long. That's typical with
> passing data on URLs, as browsers severely limit their length (2K or 4K,
> IIRC).
>
>  -Erik
>
>  Larry T. Chen wrote:
>
> I'm trying to use instance-passing="redirect" in my page-flow as well.  I
> have
>
>          <action>
>               <result page="view" transform="oxf:xslt"
> instance-passing="redirect">
>                    <parameters xsl:version="2.0">
>                        <xsl:attribute name="id"
> select="doc('input:instance')/*/@id"/>
>                    </parameters>
>               </result>
>          </action>
>
>  However, when I post to this page, OPS gives me an error:
>
>  Malformed URL:
> %24instance=X2y6DZ%2F6qm2DXU6OpIpogkzazGNNNk1n6DAU5XAQSwdmuAVGld%
> .....
>
>  I'm basically trying to redirect to another page while passing a parameter
> (id) on the URL.  Is there another way to do this?
>
>  Larry T. Chen
>  Software Engineer
>  Intelenet Communications, Inc.
>
>  Ryan Puddephatt wrote:
>
> Hi all,
>      After reading more into the documentation I now know I can use
>  c:config/@instance-passing="redirect" in my page-flow to do this
>
>  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: Ryan Puddephatt [mailto:[hidden email]] Sent: 19 July 2006
> 10:52
>  To: [hidden email]
>  Subject: RE: [ops-users] Page-Flow Problem
>
>  Hi all,
>      I think I might have overcome my little problem with the page flow,
>  I can now get it to forward on and set the urls as required. One thing I
>  notice is that the url doesn't physically change in the browser. Is there
> an
>  easy way to do this in the page-flow or am I looking at an XPL?
>
>  Thanks
>
>  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: Ryan Puddephatt [mailto:[hidden email]]
>  Sent: 17 July 2006 15:09
>  To: [hidden email]
>  Subject: RE: [ops-users] Page-Flow Problem
>
>  Erik,
>  It was a typo, but I've added the setvalue and it doesn't work
>
>      <page id="referIndexUserLevelPage"
> path-info="/(dev|admin|user)/"
>          matcher="oxf:perl5-matcher"
> default-submission="oxf:/xml/user-level-sub.xml">
>          <setvalue ref="/form/user-level" matcher-group="1"/>
>          <action>
>              <result page="indexUserLevelPage"/>
>          </action>
>      </page>
>      <page id="indexUserLevelPage"
> path-info="/(dev|admin|user)/index"
>          model="oxf:/pages/model.xpl"
>          view="oxf:/pages/index.xsl"
>          matcher="oxf:perl5-matcher"
>          default-submission="oxf:/xml/user-level-sub.xml">
>          <setvalue ref="/form/user-level" matcher-group="1"/>
>      </page>
>
>  The user-level-sub.xml has
>
>  <form>
>      <user-level>user</user-level>
>  </form>
>
>  Any ideas?
>  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: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
>  Sent: 17 July 2006 14:35
>  To: [hidden email]
>  Subject: Re: [ops-users] Page-Flow Problem
>
>  This is probably a typo:
>
>  <result page="indexPage"/>
>
>  I assume it is:
>
>  <result page="indexUserLevelPage"/>
>
>  This said, you destination page must have a default-submission and
>  <setvalue> as well.
>
>  -Erik
>
>  Ryan Puddephatt wrote:
>
> Erik,
>      I have tried this, but it still isn't working as I would expect. In my
> page-flow I have
>
>      <page id="referIndexUserLevelPage"
> path-info="/(dev|admin|user)/"
>          matcher="oxf:perl5-matcher"
> default-submission="oxf:/xml/user-level-sub.xml">
>          <setvalue ref="/form/user-level" matcher-group="1"/>
>          <action>
>              <result page="indexPage"/>
>          </action>
>      </page>
>      <page id="indexUserLevelPage"
> path-info="/(dev|admin|user)/index"
>          model="oxf:/pages/model.xpl"
>          view="oxf:/pages/index.xsl"
>          matcher="oxf:perl5-matcher"/>
>
>  When I call the first /dev/ I want /dev/index this is not the case and it
> gives me 404
>
>  I can see the redirection carried out, but it doesn't seem to apply a match
> or anything
>
>  Any ideas how to get around this?
>
>  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: Ryan Puddephatt [mailto:[hidden email]]
>  Sent: 09 July 2006 17:13
>  To: [hidden email]
>  Subject: RE: [ops-users] Page-Flow Problem
>
>  Thanks Erik,
>      I'll try changing my page flow to suit this
>
>  Ryan
>
>  Ryan Puddephatt
>  Software Engineer
>  TFX Group - IT UK
>  1 Michaelson Square
>  Livingston
>  West Lothian
>  Scotand
>  EH54 7DP
>
>  * [hidden email]
>  ( 01506 407 110
>  7  01506 407 108
>
>
>
> -----Original Message-----
>  From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
>  Sent: 09 July 2006 16:15
>  To: [hidden email]
>  Subject: Re: [ops-users] Page-Flow Problem
>
>  Ryan,
>
>  The Logic for redirection paths when you use matchers requires you to use
> <setvalue> and a submission. This is documented here:
>
> http://www.orbeon.com/ops/doc/reference-page-flow#navigating-to-match
>  er
>  s-
>  pages
>
>  Best,
>
>  -Erik
>
>  Ryan Puddephatt wrote:
>
> Hi,
>
>  I'm having a problem using the page-flow with regexp. I have a page /index
> which uses /page/action/result/@page to forward to a page with a regexp.
> When it does this the page-flow takes /(dev|admin)/problem and creates a url
> which ends up as
> http://localhost:8080/peaUtilities/(dev|admin)/problem
> <http://localhost:8080/peaUtilities/(dev%7Cadmin)/problem>.
> This doesn't match anything. I'm not good with regexp or using the page-flow
> to achieve what I need, attached is a sample of what I
>          require.
>
>
> Is anyone able to help with this?
>
>
>
>  Thanks
>
>
>
>  Ryan
>
>
>
>  *Ryan Puddephatt*
>
>  Software Engineer
>
>  TFX Group - IT UK
>
>  1 Michaelson Square
>
>  Livingston
>
>  West Lothian
>
>  Scotand
>
>  EH54 7DP
>
>
>
>  * [hidden email]
>
>  ( 01506 407 110
>
>  7  01506 407 108
>
>
>
>
>
>
> --------------------------------------------------------------------
>  ----
>
>  <config xmlns="http://www.orbeon.com/oxf/controller"
>          xmlns:xu="http://www.xmldb.org/xupdate"
>          xmlns:oxf="http://www.orbeon.com/oxf/processors">
>
>      <!-- Files to serve directly -->
>      <files path-info="*.gif"/>
>      <files path-info="*.css"/>
>      <files path-info="*.pdf"/>
>      <files path-info="*.js"/>
>      <files path-info="*.png"/>
>      <files path-info="*.jpg"/>
>      <files path-info="*.xsd"/>
>      <files path-info="*.xml" mime-type="application/xml"/>
>      <files path-info="*.html" mime-type="text/html"/>
>      <files path-info="*.java" mime-type="text/plain"/>
>      <files path-info="*.txt" mime-type="text/plain"/>
>      <files path-info="*.xq" mime-type="text/plain"/>
>
>      <page id="test1" path-info="/index">
>          <action>
>              <result page="problempage"/>
>          </action>
>      </page>
>
>      <page id="test2" path-info="/(dev|admin)/index">
>          <action>
>              <result page="problempage"/>
>          </action>
>      </page>
>
>      <page id="problempage"
> path-info="/(dev|admin)/problem"
>          matcher="oxf:perl5-matcher" view="oxf:/xml/settings.xml"/>
>
> </config>
>          --
>  Orbeon - XForms Everywhere:
>  http://www.orbeon.com/blog/
>
>
>
>
> ----------------------------------------------------------------------
>  --
>
>
>  --
>  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
>
>
>  --
>  Orbeon - XForms Everywhere:
>  http://www.orbeon.com/blog/
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
>
>  --
>  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
>
>
>  ________________________________
>
>
> --
> 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
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/


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

return-instance.xml (654 bytes) Download Attachment
instance.xml (18 bytes) Download Attachment
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Redirect with dynamic URL parameters ... was "Page-Flow Problem"

Erik Bruchez
Administrator
Alessandro Vernet wrote:

> Larry,
>
> I would have expected something like this to work:
>
> <page path-info="/a">
>    <action>
>        <result page="b">
>            <xu:update select="/id">42</xu:update>
>        </result>
>    </action>
> </page>
>
> <page path-info="/b" default-submission="gaga.xml"
> view="return-instance.xml" id="b">
>    <setvalue ref="/id" parameter="id"/>
> </page>
>
> return-instance.xml just displays the instance (attached) and
> instance.xml contains <id>1</id>.
>
> But when going to /a, I am redirected to /b?%24instance=XXX&id=. Am I
> missing something here? Erik, can you fill us on this one?
In the source page, you have to actually _create_ an XML document to
submit to the destination page. You can do this with XSLT (well in your
example the document to submit is static, but XSLT allows you to
dynamically build a document):

<result page="b" transform="oxf:xslt>
   <!-- This is the XML document that will be submitted -->
   <id xsl:version="2.0">42</id>
</result>

Then you dont heed a @default-submission attribute or a <setvalue> on
page "b" (unless you need those constructs for other purposes):

<page id="b" path-info="/b" view="return-instance.xml"/>

-Erik

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
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: Redirect with dynamic URL parameters ... was "Page-Flow Problem"

Alessandro  Vernet
Administrator
On 7/27/06, Erik Bruchez <[hidden email]> wrote:
> In the source page, you have to actually _create_ an XML document to
> submit to the destination page. You can do this with XSLT (well in your
> example the document to submit is static, but XSLT allows you to
> dynamically build a document):
>
> <result page="b" transform="oxf:xslt>
>    <!-- This is the XML document that will be submitted -->
>    <id xsl:version="2.0">42</id>
> </result>

Silly me. I intended but forgot to add a
default-submission="instance.xml" on page 'a' in my example. Using
XSLT to create the document of course works as well.

So Larry, the bottom line is that you can do what you are looking for
directly in the page flow. For this, there is no need to invoke an
external XPL that would use the redirect processor.

Alex
--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
12