OXF Resource resolving

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

OXF Resource resolving

Rene Single
Hi All,

This is probably something obvious I'm missing here.

I want to add some config value for use with the oxf:execute-processor
into the properties.xml of my webapp like this

    <property as="xs:string"  name="executable"  
value="oxf:/DoSomething.bat"/>

Now in order for this to work with the oxf:execute-processor I would
need to resolve the oxf:/ to the corresponding path in the filesystem,
as just passing the read value from the properties.xml won't work.

So my question is how do I resolve the read value "oxf:/DoSomething.bat"
into the corresponding filepath (i.e.
"D:\tomcat\webapps\appname\WEB-INF\resources\DoSomething.bat") ?


kind regards

René


--
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: OXF Resource resolving

Hank Ratzesberger
René,

There was a discussion about how to get the servlet application
context, but can't find/recall how that was resolved.

How about trying the url-generator, which has a request-path
and translated-path elements.  You can subtract one
string from the other.  I have not tried this....

http://www.orbeon.com/ops/doc/processors-generators-request

--Hank

On Sep 24, 2008, at 6:21 AM, Rene Single wrote:

> Hi All,
>
> This is probably something obvious I'm missing here.
>
> I want to add some config value for use with the oxf:execute-
> processor into the properties.xml of my webapp like this
>
>    <property as="xs:string"  name="executable"  value="oxf:/
> DoSomething.bat"/>
>
> Now in order for this to work with the oxf:execute-processor I  
> would need to resolve the oxf:/ to the corresponding path in the  
> filesystem, as just passing the read value from the properties.xml  
> won't work.
>
> So my question is how do I resolve the read value "oxf:/
> DoSomething.bat" into the corresponding filepath (i.e. "D:\tomcat
> \webapps\appname\WEB-INF\resources\DoSomething.bat") ?
>
>
> kind regards
>
> René
>
> --
> 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
Institute for Crustal Studies,
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: OXF Resource resolving

Alessandro Vernet
Administrator
René,

>> This is probably something obvious I'm missing here.
>>
>> I want to add some config value for use with the oxf:execute-processor
>> into the properties.xml of my webapp like this
>>
>>   <property as="xs:string"  name="executable"
>>  value="oxf:/DoSomething.bat"/>

I may be taking this out of context, but what are you trying to do with
the oxf:execute-processor? Are you changing the code and would like to
read an additional configuration parameter and use it in your Java code?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet


--
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: OXF Resource resolving

Rene Single

Alessandro,

Alessandro Vernet schrieb:

> René,
>
>>> This is probably something obvious I'm missing here.
>>>
>>> I want to add some config value for use with the oxf:execute-processor
>>> into the properties.xml of my webapp like this
>>>
>>>   <property as="xs:string"  name="executable"
>>>  value="oxf:/DoSomething.bat"/>
>
> I may be taking this out of context, but what are you trying to do
> with the oxf:execute-processor? Are you changing the code and would
> like to read an additional configuration parameter and use it in your
> Java code?
I have some external Executable I need to run from within the pipeline
and depending on the result of this executable need to branch within the
pipeline.
I want to store the Information about the path to the executable within
the properties.xml to have one central location for the config values of
my App.
The main reason I wanted to use oxf:/ for it was to have no path
dependency on the executable, so it can be deployed on any kind of
Installation without the need to configure this according to the
Installation.
For now I'm doing the following:
- I just store the name of the App in the properties.xml (i.e. <property
as="xs:string"  name="executable"  value="DoSomething.bat"/> )
- I install the executable getting called in a folder that is part of
the PATH environment
- I use the executeProcessor with
<exec executable="VALUE_FROM_PROPERTIES.XML" resolveexecutable="true"
searchpath="true">
    <arg line="PARAM1 PARAM2"/>
</exec>

and this seems to work for now , but I really would love to get this to
work with "oxf:/"...


regards

René


--
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: OXF Resource resolving

Rene Single
In reply to this post by Hank Ratzesberger
Hank,

Hank Ratzesberger schrieb:
> René,
>
> There was a discussion about how to get the servlet application
> context, but can't find/recall how that was resolved.
>
> How about trying the url-generator, which has     a request-path
> and translated-path elements.  You can subtract one
> string from the other.  I have not tried this....
>
My understanding of the url-generator is that it will return the data
pointed to by the given url, so in my case it would return the content
of the Executable.
Can you maybe go into more detail what you had in mind ?
I  imagine youe meant:

<p:processor name="oxf:url-generator">
    <p:input name="config">
        <config>
          <url>oxf:/DoSomething.bat</url>
          <content-type>application/octet-stream</content-type>
        </config>
    </p:input>
    <p:output name="data" id="exe-data"/>
</p:processor>

But then what ?

I don't see how the request-generator comes into play here ?

regards

René

> http://www.orbeon.com/ops/doc/processors-generators-request
>
> --Hank
>
> On Sep 24, 2008, at 6:21 AM, Rene Single wrote:
>
>> Hi All,
>>
>> This is probably something obvious I'm missing here.
>>
>> I want to add some config value for use with the
>> oxf:execute-processor into the properties.xml of my webapp like this
>>
>>    <property as="xs:string"  name="executable"  
>> value="oxf:/DoSomething.bat"/>
>>
>> Now in order for this to work with the oxf:execute-processor I would
>> need to resolve the oxf:/ to the corresponding path in the
>> filesystem, as just passing the read value from the properties.xml
>> won't work.
>>
>> So my question is how do I resolve the read value
>> "oxf:/DoSomething.bat" into the corresponding filepath (i.e.
>> "D:\tomcat\webapps\appname\WEB-INF\resources\DoSomething.bat") ?
>>
>>
>> kind regards
>>
>> René
>>
>> --
>> 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
> Institute for Crustal Studies,
> University of California, Santa Barbara
> 805-893-8042
>
>
>
>
>

--
----------------------------------------------------
TANNER AG
René Single
Kemptener Straße 99
D-88131 Lindau
Germany

tel +49 8382 272-199
fax +49 8382 272-900
mailto:[hidden email]
http://www.tanner.de

Vorsitzender des Aufsichtsrats: Helmut Tanner
Vorstand: Stefan Kuegel (Vorsitzender), Georg-Friedrich Blocher
Aktiengesellschaft, Lindau (B)
Registergericht Kempten, HRB 7199
----------------------------------------------------

Die TANNER AG ist Träger des Bayerischen Qualitätspreises 2008!



--
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: OXF Resource resolving

Hank Ratzesberger

Hi René,

I was passing along an idea, I admit I have not
tested it.

The idea is that <path-translated> is equivalent to
the servlet API's ServletContext.GetRealPath()

It appears to be this.  OK, I just looked for it in the
code and that is what it is.

So, regardless of what the request is, you can find the
absolute directory in your file system.  You will need to
remove the request-path from the path-translated to have
the root directory of your deployment -- I think.....

I hope that works, seemed like not to hard to test.

Cheers,
Hank

On Sep 25, 2008, at 11:23 PM, Rene Single wrote:

> Hank,
>
> Hank Ratzesberger schrieb:
>> René,
>>
>> There was a discussion about how to get the servlet application
>> context, but can't find/recall how that was resolved.
>>
>> How about trying the url-generator, which has     a request-path
>> and translated-path elements.  You can subtract one
>> string from the other.  I have not tried this....
>>
> My understanding of the url-generator is that it will return the  
> data pointed to by the given url, so in my case it would return the  
> content of the Executable.
> Can you maybe go into more detail what you had in mind ?
> I  imagine youe meant:
>
> <p:processor name="oxf:url-generator">
>    <p:input name="config">
>        <config>
>          <url>oxf:/DoSomething.bat</url>
>          <content-type>application/octet-stream</content-type>
>        </config>
>    </p:input>
>    <p:output name="data" id="exe-data"/>
> </p:processor>
>
> But then what ?
>
> I don't see how the request-generator comes into play here ?
>
> regards
>
> René
>
>> http://www.orbeon.com/ops/doc/processors-generators-request
>>
>> --Hank
>>
>> On Sep 24, 2008, at 6:21 AM, Rene Single wrote:
>>
>>> Hi All,
>>>
>>> This is probably something obvious I'm missing here.
>>>
>>> I want to add some config value for use with the oxf:execute-
>>> processor into the properties.xml of my webapp like this
>>>
>>>    <property as="xs:string"  name="executable"  value="oxf:/
>>> DoSomething.bat"/>
>>>
>>> Now in order for this to work with the oxf:execute-processor I  
>>> would need to resolve the oxf:/ to the corresponding path in the  
>>> filesystem, as just passing the read value from the  
>>> properties.xml won't work.
>>>
>>> So my question is how do I resolve the read value "oxf:/
>>> DoSomething.bat" into the corresponding filepath (i.e. "D:\tomcat
>>> \webapps\appname\WEB-INF\resources\DoSomething.bat") ?
>>>
>>>
>>> kind regards
>>>
>>> René
>>>
>>> --
>>> 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
>> Institute for Crustal Studies,
>> University of California, Santa Barbara
>> 805-893-8042
>>
>>
>>
>>
>>
>
>
> --
> ----------------------------------------------------
> TANNER AG
> René Single
> Kemptener Straße 99
> D-88131 Lindau
> Germany
>
> tel +49 8382 272-199
> fax +49 8382 272-900
> mailto:[hidden email]
> http://www.tanner.de
>
> Vorsitzender des Aufsichtsrats: Helmut Tanner
> Vorstand: Stefan Kuegel (Vorsitzender), Georg-Friedrich Blocher
> Aktiengesellschaft, Lindau (B)
> Registergericht Kempten, HRB 7199
> ----------------------------------------------------
>
> Die TANNER AG ist Träger des Bayerischen Qualitätspreises 2008!
>
>
> --
> 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
Institute for Crustal Studies,
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
F_L
Reply | Threaded
Open this post in threaded view
|

Re: OXF Resource resolving

F_L
In reply to this post by Rene Single
Rene Single a écrit :

> Hi All,
>
> This is probably something obvious I'm missing here.
>
> I want to add some config value for use with the oxf:execute-processor
> into the properties.xml of my webapp like this
>
>    <property as="xs:string"  name="executable"  
> value="oxf:/DoSomething.bat"/>
>
> Now in order for this to work with the oxf:execute-processor I would
> need to resolve the oxf:/ to the corresponding path in the filesystem,
> as just passing the read value from the properties.xml won't work.
>
> So my question is how do I resolve the read value "oxf:/DoSomething.bat"
> into the corresponding filepath (i.e.
> "D:\tomcat\webapps\appname\WEB-INF\resources\DoSomething.bat") ?
Hi,

I'm just new to Orbeon and I have a (as far as I understand) similar
question.

I'm trying to use a custom css file in my form in order to have all my
css in an external file instead of in a <style> tag.

I added

<link rel="stylesheet" type="text/css" href="/myApp/myCss.css" />

in my view.xhtml

and

<files path-info="*.css"/>

in my page-flow.xml.


I tried using different combination of relative or absolute path, but it
seems the css file is never found.

Is there something I misinterpreted ?  Where am I suppose to put my
resource files such as myCss.css in order for orbeon to be able to
resolve them ?


Thanks for your help.


--
Florian



--
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: OXF Resource resolving

Einar Moos
On Fri, Sep 26, 2008 at 5:55 PM, Florian LACOSTE
<[hidden email]> wrote:

> Rene Single a écrit :
>>
>> Hi All,
>>
>> This is probably something obvious I'm missing here.
>>
>> I want to add some config value for use with the oxf:execute-processor
>> into the properties.xml of my webapp like this
>>
>>   <property as="xs:string"  name="executable"
>>  value="oxf:/DoSomething.bat"/>
>>
>> Now in order for this to work with the oxf:execute-processor I would need
>> to resolve the oxf:/ to the corresponding path in the filesystem, as just
>> passing the read value from the properties.xml won't work.
>>
>> So my question is how do I resolve the read value "oxf:/DoSomething.bat"
>> into the corresponding filepath (i.e.
>> "D:\tomcat\webapps\appname\WEB-INF\resources\DoSomething.bat") ?
>
> Hi,
>
> I'm just new to Orbeon and I have a (as far as I understand) similar
> question.
>
> I'm trying to use a custom css file in my form in order to have all my css
> in an external file instead of in a <style> tag.
>
> I added
>
> <link rel="stylesheet" type="text/css" href="/myApp/myCss.css" />
>
> in my view.xhtml
>
> and
>
> <files path-info="*.css"/>
>
> in my page-flow.xml.
>
>
> I tried using different combination of relative or absolute path, but it
> seems the css file is never found.
>
> Is there something I misinterpreted ?  Where am I suppose to put my resource
> files such as myCss.css in order for orbeon to be able to resolve them ?
>
>
> Thanks for your help.
>
>
> --
> Florian
>
>
>
> --
> 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
>
>
Florian,

css files should be at the root of the application, next to page-flow.xml

-- einar


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

Re: Re: Re: OXF Resource resolving

F_L
Einar Moos a écrit :

> On Fri, Sep 26, 2008 at 5:55 PM, Florian LACOSTE
> <[hidden email]> wrote:
>> Hi,
>>
>> I'm just new to Orbeon and I have a (as far as I understand) similar
>> question.
>>
>> I'm trying to use a custom css file in my form in order to have all my css
>> in an external file instead of in a <style> tag.
>>
>> I added
>>
>> <link rel="stylesheet" type="text/css" href="/myApp/myCss.css" />
>>
>> in my view.xhtml
>>
>> and
>>
>> <files path-info="*.css"/>
>>
>> in my page-flow.xml.
>>
>>
>> I tried using different combination of relative or absolute path, but it
>> seems the css file is never found.
>>
>> Is there something I misinterpreted ?  Where am I suppose to put my resource
>> files such as myCss.css in order for orbeon to be able to resolve them ?
>>
>>
>> Thanks for your help.
>>

> Florian,
>
> css files should be at the root of the application, next to page-flow.xml
>
> -- einar
>

That's where they are. And I tried to use
href="/orbeon/myApp/myCss.css", "/myApp/myCss.css" "myApp/myCss.css"
"myCss.css", etc as well as the absolute path in my file system. The
application never finds it and the css is not applied to the view.

It is if i put all the css code in a <style> tag in the view.

--
Florian



--
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: OXF Resource resolving

Erik Bruchez
Administrator
In reply to this post by F_L
In theory you can put them pretty much anywhere you want under your  
resources, provided you:

1. have the proper rule in page-flow.xml
2. store the file in the proper place
3. refer to it using the proper path

By default, the top-level page-flow.xml has this definition:

<files path-info="(?!/([^/]+)/service/).+\.(gif|css|pdf|json|js|png|
jpg|xsd|htc|ico|swf)" matcher="oxf:perl5-matcher"/>

This just serves a whole bunch of files, including CSS files, provided  
they don't have the sub-path "/service/" in them. Now for example,  
Form Builder handles a form-builder.css file as follows:

1. stored under RESOURCES/forms/orbeon/builder/form-builder.css
2. referred to as:

    <xhtml:link rel="stylesheet" href="/forms/orbeon/builder/form-
builder.css" type="text/css"/>

And it works;-)

-Erik

On Sep 26, 2008, at 8:55 AM, Florian LACOSTE wrote:

> Rene Single a écrit :
>> Hi All,
>> This is probably something obvious I'm missing here.
>> I want to add some config value for use with the oxf:execute-
>> processor into the properties.xml of my webapp like this
>>   <property as="xs:string"  name="executable"  value="oxf:/
>> DoSomething.bat"/>
>> Now in order for this to work with the oxf:execute-processor I  
>> would need to resolve the oxf:/ to the corresponding path in the  
>> filesystem, as just passing the read value from the properties.xml  
>> won't work.
>> So my question is how do I resolve the read value "oxf:/
>> DoSomething.bat" into the corresponding filepath (i.e. "D:\tomcat
>> \webapps\appname\WEB-INF\resources\DoSomething.bat") ?
>
> Hi,
>
> I'm just new to Orbeon and I have a (as far as I understand) similar  
> question.
>
> I'm trying to use a custom css file in my form in order to have all  
> my css in an external file instead of in a <style> tag.
>
> I added
>
> <link rel="stylesheet" type="text/css" href="/myApp/myCss.css" />
>
> in my view.xhtml
>
> and
>
> <files path-info="*.css"/>
>
> in my page-flow.xml.
>
>
> I tried using different combination of relative or absolute path,  
> but it seems the css file is never found.
>
> Is there something I misinterpreted ?  Where am I suppose to put my  
> resource files such as myCss.css in order for orbeon to be able to  
> resolve them ?
>
>
> Thanks for your help.
>
>
> --
> Florian
>
>
> --
> 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
--
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
OW2 mailing lists service home page: http://www.ow2.org/wws