PDA

View Full Version : servlet context issues w/php


liamr
02-09-2010, 06:20 PM
I'm not sure if this is a Resin issue, or a Quercus issue.

We're trying to use Quercus in it's role as a JSR-223 compatible scripting language (as opposed to using it for hosting PHP applications within Java).

Specifically, we're trying to use Quercus to allow us to script the creation of Shibboleth attributes, as described at..

https://spaces.internet2.edu/display/SHIB2/ResolverScriptAttributeDefinition

I'm not really a java guy, so I don't have a great grasp of what's going on, but, the shib developers said..

The JSR-223 APIs have you pass in a processing context in to the script execution engine. This context contains a map where the keys are the attribute IDs and the values are the created objects. The keys then get changed in to variables within the script.

I can create the object just fine. My code can access other objects passed into it.. but when the code is finished executing, the objects that I've modified don't get passed back out to the application that invoked them.


<?php
import edu.internet2.middleware.shibboleth.common.attribu te.provider.BasicAt
tribute;
$myString = $givenName->getValues()->get(0) . "'s value";
$phpAttr = new BasicAttribute("phpAttr");
$phpAttr->getValues()->add($myString);
?>


I'm not sure if this is a bug in Quercus, or perhaps a configurable option.
It works as expected w/ ECMAScript, JRuby and Jython (the modified values are available back in shibboleth when the scripts in those other languages finish executing).

any help would be greatly appreciated
Liam