page view mime-type

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

page view mime-type

John Russell-2
Hi,

We store documents in a database without a suffix but can specify the  
mime-type.

We found this simple and matcher method works if the document 12345 is  
set as mime-type text/xml

<page path-info="/12345" view="http://localhost/doc/12345"/>

<page path-info="/frm/([^/]+)" matcher="oxf:perl5-matcher" view="http://localhost/doc/$ 
{1}"/>


Ideally I would like to just pass through the whole url but I suspect  
the matcher has no access
to the parameters of the url. This would be great if it was possible ..

user get request
/frm/12345?url=/db/v7%63p1=abcd%38p2=efgh
to make  view result as ..
view=http://localhost/doc/12345?url=/db/v7%63p1=abcd%38p2=efgh

perhaps with something like

<page path-info="/frm/([^/]+)\?([^/])" matcher="oxf:perl5-matcher"  
view="http://localhost/doc/${1}?${2}"/>

If it is not possible there is still scope with xsl where http://localhost/doc/12345 
  is an xsl document eg

<page path-info="/frm/([^/]+)" matcher="oxf:perl5-matcher" view="http://localhost/doc/$ 
{1}" default-submission="url.xml">
     <setvalue ref="/get/url" parameter="url"/>
   </page>

<!-- file: url.xml -->
<get>
   <url/>
</get>

However the problem I've encountered is that a mime-type of 'text/xsl'  
is not sufficient to tell PFC http://localhost/doc/12345 is an xsl  
document.

Any suggestions greatly appreciated.
Thank you,
John Russell.




--
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: page view mime-type

John Russell-2
This works fine with text/xml
Please ignore.
John.

On Jun 25, 2009, at 4:38 PM, John Russell wrote:

> Hi,
>
> We store documents in a database without a suffix but can specify  
> the mime-type.
>
> We found this simple and matcher method works if the document 12345  
> is set as mime-type text/xml
>
> <page path-info="/12345" view="http://localhost/doc/12345"/>
>
> <page path-info="/frm/([^/]+)" matcher="oxf:perl5-matcher" view="http://localhost/doc/$ 
> {1}"/>
>
>
> Ideally I would like to just pass through the whole url but I  
> suspect the matcher has no access
> to the parameters of the url. This would be great if it was  
> possible ..
>
> user get request
> /frm/12345?url=/db/v7%63p1=abcd%38p2=efgh
> to make  view result as ..
> view=http://localhost/doc/12345?url=/db/v7%63p1=abcd%38p2=efgh
>
> perhaps with something like
>
> <page path-info="/frm/([^/]+)\?([^/])" matcher="oxf:perl5-matcher"  
> view="http://localhost/doc/${1}?${2}"/>
>
> If it is not possible there is still scope with xsl where http://localhost/doc/12345 
>  is an xsl document eg
>
> <page path-info="/frm/([^/]+)" matcher="oxf:perl5-matcher" view="http://localhost/doc/$ 
> {1}" default-submission="url.xml">
>    <setvalue ref="/get/url" parameter="url"/>
>  </page>
>
> <!-- file: url.xml -->
> <get>
>  <url/>
> </get>
>
> However the problem I've encountered is that a mime-type of 'text/
> xsl' is not sufficient to tell PFC http://localhost/doc/12345 is an  
> xsl document.
>
> Any suggestions greatly appreciated.
> Thank you,
> John Russell.
>
>


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

GET parameter

John Russell-2
Hi,

I wish to map a GET request to obtain an external document

eg

<page path-info="/frm/([^/]+)" matcher="oxf:perl5-matcher" view="http://localhost/doc/${1}"/>

The external document server can substitute a parameter for the instance so if the query-string
could be relayed my problem would be solved.

with something like

<page path-info="/frm/([^/]+)" query-string="([^/]+)" matcher="oxf:perl5-matcher" view="http://localhost/doc/${1}?${2}"/>


ASSUMING ABOVE NOT POSSIBLE ..

If passing parameters needs to be done (per reference-page-flow documentation) and transformed the view
represents a stylesheet to generate the xhtml, can you advise how this should be configured and whether an
XPL file is necessary. Is the transformation understood or does it need to be explicitly declared?

Sample GET might be
/orbeon/frm/12345?url=/db/v7%3Fp1=abcd%26p2=efgh


Insufficient .. not working ..

<page path-info="/frm/([^/]+)" matcher="oxf:perl5-matcher" view="http://localhost/doc/${1}" default-submission="url.xml">
  <setvalue ref="/get/url" parameter="url"/>
</page>

<!-- file: url.xml -->
<get>
<url/>
</get>

XSL document contains
<xforms:instance id="instance" src="{concat('http://localhost',  /get/url)}"/>

What is missing from this configuration to populate url.xml and get the transform to operate?
Is the XSL correct? Is a document() function required in the XSL? Documentation says this
is all that's necessary...
Hello<xsl:value-of select="/employee/name"/>!


Errors:
Got invalid return code while loading URI: http://localhost, 403


Thanks in advance,
John Russell


--
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: GET parameter

Alessandro Vernet
Administrator
John,

John Russell-2 wrote
<page path-info="/frm/([^/]+)" matcher="oxf:perl5-matcher" view="http://localhost/doc/${1}"/>
Which one is it that you are aiming for:

* The request to be proxied to that other URL (the server gets what is at http://localhost/doc/${1} and returns that to the browser)?
* The browser to be redirected to that URL? (Because you put localhost, maybe this is not what you intended.)
* The document at http://localhost/doc/${1} to be retrieved and to be retrieved and interpreted as XForms, just as if it was loaded from disk?

Alex
Reply | Threaded
Open this post in threaded view
|

Re: GET parameter

John Russell-2
Alex,
thank you for your reply,

our objective is for
* the document at http://localhost/doc/${1} to be retrieved
  and interpreted as XForms (or XForms xslt stylesheet), just
  as if it was loaded from disk?

This seems to work it the content type is text/xml

Possible Method 1
=================
however if we are able to supply a parameter to this url eg
http://localhost/doc/12345?url=/db/v7%3Fp1=abcd%26p2=efgh
then our application (/doc/) would use a placeholder in the document
<xforms:instance resource="http://localhost$$url$$"/>
to form the correct instance request resulting in this content
which makes it very easy for us.
This could potentially be easily mapped from
https://host.domain.com/orbeon/frm/12345?url=/db/v7%3Fp1=abcd%26p2=efgh
hence the enquiry whether access to the query_string was available with
page-flow configuration.

Possible Method 2
=================
If forming such a view url from the get request to Orbeon cant be done
as above then the document (http://localhost/doc/12345) can be an xslt
stylesheet which we have so far successfully attempted eg

<page path-info="/frm/([^/]+)" matcher="oxf:perl5-matcher" view="http://localhost/doc/${1}" default-submission="url.xml">
  <setvalue ref="/get/url" parameter="url"/>
</page>

<!-- file: url.xml -->
<get>
<url/>
</get>

However we found the xhtml/xform document was correctly formed from the apparent transform
but technique didn't yield any data with
<xforms:instance id="instance" src="{concat('http://localhost',  /get/url)}"/>
producing the error
Got invalid return code while loading URI: http://localhost, 403


John.


On Jul 2, 2009, at 12:07 PM, Alessandro Vernet wrote:
<page path-info="/frm/([^/]+)" matcher="oxf:perl5-matcher"
view="http://localhost/doc/${1}"/>

Which one is it that you are aiming for:

* The request to be proxied to that other URL (the server gets what is at
http://localhost/doc/${1} and returns that to the browser)?
* The browser to be redirected to that URL? (Because you put localhost,
maybe this is not what you intended.)
* The document at http://localhost/doc/${1} to be retrieved and to be
retrieved and interpreted as XForms, just as if it was loaded from disk?

Alex


On Jun 29, 2009, at 7:24 PM, John Russell wrote:

Hi,

I wish to map a GET request to obtain an external document

eg

<page path-info="/frm/([^/]+)" matcher="oxf:perl5-matcher" view="http://localhost/doc/${1}"/>

The external document server can substitute a parameter for the instance so if the query-string
could be relayed my problem would be solved.

with something like

<page path-info="/frm/([^/]+)" query-string="([^/]+)" matcher="oxf:perl5-matcher" view="http://localhost/doc/${1}?${2}"/>


ASSUMING ABOVE NOT POSSIBLE ..

If passing parameters needs to be done (per reference-page-flow documentation) and transformed the view
represents a stylesheet to generate the xhtml, can you advise how this should be configured and whether an
XPL file is necessary. Is the transformation understood or does it need to be explicitly declared?

Sample GET might be
/orbeon/frm/12345?url=/db/v7%3Fp1=abcd%26p2=efgh


Insufficient .. not working ..

<page path-info="/frm/([^/]+)" matcher="oxf:perl5-matcher" view="http://localhost/doc/${1}" default-submission="url.xml">
  <setvalue ref="/get/url" parameter="url"/>
</page>

<!-- file: url.xml -->
<get>
<url/>
</get>

XSL document contains
<xforms:instance id="instance" src="{concat('http://localhost',  /get/url)}"/>

What is missing from this configuration to populate url.xml and get the transform to operate?
Is the XSL correct? Is a document() function required in the XSL? Documentation says this
is all that's necessary...
Hello<xsl:value-of select="/employee/name"/>!


Errors:
Got invalid return code while loading URI: http://localhost, 403


Thanks in advance,
John Russell



--
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: GET parameter

Alessandro Vernet
Administrator
John,

John Russell-2 wrote
our objective is for
* the document at http://localhost/doc/${1} to be retrieved
   and interpreted as XForms (or XForms xslt stylesheet), just
   as if it was loaded from disk?
OK. Then I'd use a view="proxy.xpl" in the page flow. Then in proxy.xpl, use the request generator to get the request parameters, generate a config for the URL generator (http://www.orbeon.com/ops/doc/processors-generators-url), and pipe the result of the URL generator into the "data" output of the pipeline.

John Russell-2 wrote
however if we are able to supply a parameter to this url eg
http://localhost/doc/12345?url=/db/v7%3Fp1=abcd%26p2=efgh
then our application (/doc/) would use a placeholder in the document
<xforms:instance resource="http://localhost$$url$$"/>
Here it looks like you have something a bit different: you are loading an instance (not the XForms) based on a request parameter. You can do this with a submission on xforms-model-construct-done, using the xxforms:get-request-parameter() to get the value of the parameter "url".

Alex