Hi Ryan,
The ServiceContext parameter is added by the Transformation.ext. Therefore
you don't see anything in the templates.
Since you are working on the flex support I don't think you need to involve
SpecialCases.xpt. You can do this directly in the templates, Service.xpt.
This is how I would do it (not complete). This will create an interface
without the service context parameter in the methods.
In Service.xpt add the following
«DEFINE service FOR Service»
«EXPAND serviceInterface»
«EXPAND clientServiceInterface»
...
«DEFINE clientServiceInterface FOR Service»
«FILE javaFileName(getServiceapiPackage() + "." + name + "Client")»
package «getServiceapiPackage()»;
«IF formatJavaDoc() == "" -»
/**
* Generated client interface for the Service «name».
*/
«ELSE -»
«formatJavaDoc()»
«ENDIF -»
public interface «name»Client {
«EXPAND clientInterfaceMethod FOREACH operations.select(op |
op.isPublicVisibility())»
}
«ENDFILE»
«ENDDEFINE»
«DEFINE clientInterfaceMethod FOR ServiceOperation»
«formatJavaDoc()»
public «getTypeName()» «name»(«EXPAND paramTypeAndName FOREACH
parametersWithoutServiceContext() SEPARATOR ","») «
EXPAND Exception::throws»;
«ENDDEFINE»
In helper.ext add the following:
List[Parameter] parametersWithoutServiceContext(ServiceOperation operation)
:
isServiceContextToBeGenerated() ?
operation.parameters.reject(p | p.type ==
getProperty("framework.serviceContextClass")) :
operation.parameters;
In the web client we use a servlet filter and then when invoking the
services we just do ServiceContextStore.get() to fetch the ServiceContext
instance. I agree that the more this can be hidden by AOP the better. We
might change to your design in the web client also.
/Patrik
--
View this message in context:
http://www.nabble.com/Remote-service-calls-%28help-with-a-special-cases.xpt--%29-tp18513907s17564p18522942.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fornax-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fornax-developer