Attachment: OFBIZ-10650_Allow-engines-to-access-their-parameters-directly.patch
> Allow service engines to directly access their parameters
> ---------------------------------------------------------
>
> Key: OFBIZ-10650
> URL:
https://issues.apache.org/jira/browse/OFBIZ-10650> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: Trunk
> Reporter: Mathieu Lirzin
> Priority: Major
> Fix For: Upcoming Branch
>
> Attachments: OFBIZ-10650_Allow-engines-to-access-their-parameters-directly.patch
>
>
> Currently service engines don't have a direct access to the parameters passed in engine XML definition, like in the following example:
> {code:xml}
> <engine name="foo" class="org.example.Foo">
> <parameter name="authUrl" value="..."/>
> <parameter name="apiServer" value="..."/>
> <parameter name="login" value="..."/>
> <parameter name="password" value="..."/>
> <parameter name="clientId" value="..."/>
> <parameter name="secretId" value="..."/>
> <parameter name="apiKey" value="..."/>
> </engine>
> {code}
> For example in the XML-RPC engine we can find code similar to the following snippet to retrieve the parameters:
> {code:java}
> String engine = modelService.engineName;
> try {
> url = ServiceConfigUtil.getEngineParameter(engine, "url");
> login = ServiceConfigUtil.getEngineParameter(engine, "login");
> password = ServiceConfigUtil.getEngineParameter(engine, "password");
> } catch (GenericConfigException e) {
> throw new GenericServiceException("Cannot invoke service : engine parameters are not correct");
> }
> {code}
> This is somewhat convoluted to pass via the service model to retrieve the engine name, and finally to get the parameter from the engine model.
> It would be nice if the parameters were directly accessible.