[Resin-interest] Extending Quercus by providing new classes

2009-03-09 Thread Michael Ludwig
The Quercus documentation explains how to extend PHP with new functions
by subclassing AbstractQuercusModule and registering the derived class
as an extension provider by adding its name to the service information
file classes/META-INF/services/com.caucho.quercus.QuercusModule.

I was wondering if it was also possible to extend PHP with new classes
that could be manipulated just as in PHP?

What I had in mind was to map a subset of the functionality provided
by the DOM and Xsl extensions for PHP, which are based on LibXML2 and
LibXSLT, to Quercus. Code like the following could then run in Quercus:

   $doc = new DOMDocument();
   $xsl = new XSLTProcessor();

   $doc-load($xsl_filename);
   $xsl-importStyleSheet($doc);

   $doc-load($xml_filename);
   echo $xsl-transformToXML($doc);

What would I have to do in order to get there?

(Meanwhile I've seen that an upcoming release of Quercus will include
the DOM module. That still leaves the XSL module to do, which would
allow PHP code to tap into XSLT 2.0 by plugging Saxon into the JAXP
interface. Pretty cool.)

I tried to post this question to the quercus-interest list, but that
wasn't working. Instead, I got an answer off-list by one of the Caucho
engineers, which I'd like to share for everyone to benefit.

The solution is easy, but as far as I can see, it has not been
documented so far. In order to register a new class with Quercus,
simply add the fully qualified class name to the service information
file classes/META-INF/services/com.caucho.quercus.QuercusClass.

So this is what you have to do:

15:57:19,07 C:\MILU\Server\Tomcat60\webapps\quercus\WEB-INF\classes
# type META-INF\services\com.caucho.quercus.QuercusClass
milu.DOMDocument


15:58:03,89 C:\MILU\Server\Tomcat60\webapps\quercus\WEB-INF\classes
# type milu\DOMDocument.java
package milu;

import com.caucho.quercus.module.AbstractQuercusModule;

public class DOMDocument extends AbstractQuercusModule {
 public String saveXML() {
 return Urmel/;
 }
}

And then in PHP:

$dom = new DOMDocument();
# load some content, do some work
echo $dom-saveXML();

Michael Ludwig


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Problems finding jar files in orbeon web application

2009-03-09 Thread Emil Ong
Hi Alex,

It sounds like your app-default.xml is not getting included in your
resin.conf, which has those classloaders by default.  You can either
import it as is done in the default resin.conf (which is probably best)
or add the class loaders to a web-app-default in resin.conf.

Take care,
Emil

On Sun, Mar 08, 2009 at 02:20:58PM -, Alex Sharaz wrote:
 
 I've been running orbeon xforms for a while now on one of my resin servers.
 while I haven't had any problems with it, ther's a bit of configuration that i
 have to do every time i install a new release and i'd really like to avoid
 doing it.
 
 when the orbeon war is unpacked you end up with
 
 web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/
 2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
 http://j
 ava.sun.com/xml/ns/j2ee/web-app_2_4.xsd version=2.4 --
display-nameOrbeon Forms
3.7.0beta1+.200902170313/display-name
description
Orbeon Forms is an open source forms solution that handles the
 complexity of forms typical of the
enterprise or government. It is delivered to standard web
 browsers (including Internet Explorer,
Firefox, Safari and Opera) thanks to XForms and Ajax 
 technology,
 with no need for client-side software
or plugins. Orbeon Forms allows you to build fully interactive
 forms with features that include
as-you-type validation, optional and repeated sections, always
 up-to-date error summaries, PDF output,
full internationalization, and controls like auto-completion,
 tabs, dialogs, trees and menus.
/description
 
 
 
 
 Now if i try and access the orbeon xforms applications i get error messages
 about not finding any of the orbeon classes located in WEB-INF/lib/*.jar and
 WEB-INF/lib/private/*.jar
 
 The solution is to do:-
 
 web-app
 !-- web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://
 www.w3.org/2001/XMLSchema-instance 
 xsi:schemaLocation=http://java.sun.com/xml
 /ns/j2ee http://j
 ava.sun.com/xml/ns/j2ee/web-app_2_4.xsd version=2.4 --
display-nameOrbeon Forms
3.7.0beta1+.200902170313/display-name
description
Orbeon Forms is an open source forms solution that handles the
 complexity of forms typical of the
enterprise or government. It is delivered to standard web
 browsers (including Internet Explorer,
Firefox, Safari and Opera) thanks to XForms and Ajax 
 technology,
 with no need for client-side software
or plugins. Orbeon Forms allows you to build fully interactive
 forms with features that include
as-you-type validation, optional and repeated sections, always
 up-to-date error summaries, PDF output,
full internationalization, and controls like auto-completion,
 tabs, dialogs, trees and menus.
/description
 
 class-loader
library-loader path='WEB-INF/lib'/
library-loader path='WEB-INF/lib/private'/
library-loader path='/var/web/ext-webapp'/
compiling-loader path='WEB-INF/classes'/
  /class-loader
 
  .. rest of war file
 
 So I know i can't use the class-loader statement if I've got version=2.4
 web-app argument. Silly question, how do in persuade orbeon that its jar
 files are in WEB-INF/lib etc?
 
 Alex
 

 *
 To view the terms under which this email is distributed, please go to 
 http://www.hull.ac.uk/legal/email_disclaimer.html
 *
 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest



Emil Ong
Chief Evangelist
Caucho Technology, Inc.
Tel. (858) 456-0300
mailto:e...@caucho.com
http://blog.caucho.com/

Caucho: Reliable Open Source
-- Resin: application server
-- Quercus: PHP in Java
-- Java CanDI: contexts and dependency injection


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Problems finding jar files in orbeonweb application

2009-03-09 Thread Alex Sharaz
Thanks
For this,
I could have sworn that the app-default.xml was in there. Then again
maybe it slipped out when i moved over to using a watchdog configuration
supporting multiple VMS
I'll check
alex

-Original Message-
From: resin-interest-boun...@caucho.com
[mailto:resin-interest-boun...@caucho.com] On Behalf Of Emil Ong
Sent: 09 March 2009 17:19
To: General Discussion for the Resin application server
Subject: Re: [Resin-interest] Problems finding jar files in orbeonweb
application

Hi Alex,

It sounds like your app-default.xml is not getting included in your
resin.conf, which has those classloaders by default.  You can either
import it as is done in the default resin.conf (which is probably best)
or add the class loaders to a web-app-default in resin.conf.

Take care,
Emil

On Sun, Mar 08, 2009 at 02:20:58PM -, Alex Sharaz wrote:
 
 I've been running orbeon xforms for a while now on one of my resin
servers.
 while I haven't had any problems with it, ther's a bit of
configuration that i
 have to do every time i install a new release and i'd really like to
avoid
 doing it.
 
 when the orbeon war is unpacked you end up with
 
 web-app xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=http://www.w3.org/
 2001/XMLSchema-instance
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
 http://j
 ava.sun.com/xml/ns/j2ee/web-app_2_4.xsd version=2.4 --
display-nameOrbeon Forms
3.7.0beta1+.200902170313/display-name
description
Orbeon Forms is an open source forms solution that
handles the
 complexity of forms typical of the
enterprise or government. It is delivered to standard
web
 browsers (including Internet Explorer,
Firefox, Safari and Opera) thanks to XForms and Ajax
technology,
 with no need for client-side software
or plugins. Orbeon Forms allows you to build fully
interactive
 forms with features that include
as-you-type validation, optional and repeated sections,
always
 up-to-date error summaries, PDF output,
full internationalization, and controls like
auto-completion,
 tabs, dialogs, trees and menus.
/description
 
 
 
 
 Now if i try and access the orbeon xforms applications i get error
messages
 about not finding any of the orbeon classes located in
WEB-INF/lib/*.jar and
 WEB-INF/lib/private/*.jar
 
 The solution is to do:-
 
 web-app
 !-- web-app xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=http://
 www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation=http://java.sun.com/xml
 /ns/j2ee http://j
 ava.sun.com/xml/ns/j2ee/web-app_2_4.xsd version=2.4 --
display-nameOrbeon Forms
3.7.0beta1+.200902170313/display-name
description
Orbeon Forms is an open source forms solution that
handles the
 complexity of forms typical of the
enterprise or government. It is delivered to standard
web
 browsers (including Internet Explorer,
Firefox, Safari and Opera) thanks to XForms and Ajax
technology,
 with no need for client-side software
or plugins. Orbeon Forms allows you to build fully
interactive
 forms with features that include
as-you-type validation, optional and repeated sections,
always
 up-to-date error summaries, PDF output,
full internationalization, and controls like
auto-completion,
 tabs, dialogs, trees and menus.
/description
 
 class-loader
library-loader path='WEB-INF/lib'/
library-loader path='WEB-INF/lib/private'/
library-loader path='/var/web/ext-webapp'/
compiling-loader path='WEB-INF/classes'/
  /class-loader
 
  .. rest of war file
 
 So I know i can't use the class-loader statement if I've got
version=2.4
 web-app argument. Silly question, how do in persuade orbeon that its
jar
 files are in WEB-INF/lib etc?
 
 Alex
 



*
 To view the terms under which this email is distributed, please go to
http://www.hull.ac.uk/legal/email_disclaimer.html


*
 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest



Emil Ong
Chief Evangelist
Caucho Technology, Inc.
Tel. (858) 456-0300
mailto:e...@caucho.com
http://blog.caucho.com/

Caucho: Reliable Open Source
-- Resin: application server
-- Quercus: PHP in Java
-- Java CanDI: contexts and dependency injection


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest*
To view the terms under which this 

[Resin-interest] ip and auth constraint

2009-03-09 Thread gwen brandt
hi.

is it possible to use multiple security-constraint to accomplish this? like
if i want to give access w/o authentication to trusted IPs listed in an
ip-constraint and then redirecting all others to an auth-constraint?

thanks!
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest