You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by "Rishi Verma (JIRA)" <ji...@apache.org> on 2013/08/01 00:03:50 UTC

[jira] [Commented] (OODT-649) Add PathUtils.replaceEnvVariables() wrapper around retrieved context parameters

    [ https://issues.apache.org/jira/browse/OODT-649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13725764#comment-13725764 ] 

Rishi Verma commented on OODT-649:
----------------------------------

Hey Ross,

One more thing - I just took another look at your patch and wanted to make two suggestions:
1. Within ProductResource, DatasetResource etc., objects like XmlRpcFileMgrClient seem to be instantiated every time a REST end-point is first invoked and before a Responder gets passed data. Could this type of code be placed in an initializer or constructor instead? If you have a specific reason for instantiating an XmlRpcFileMgrClient every time an end-point gets invoked, please do share. 
2. I think the code that instantiates the XmlRpcFileMgrClient and sets the working path directory should have some validation associated with it (think URL instantiation exceptions, File.exists() for working dir). The original Data servlets did this to some degree, see [1]. I think adding some server-side validation related logging would be especially helpful, since it can greatly help devs fix malformed fields within configuration files (IMO the #1 reason OODT sometimes does not work as expected).

Great work as always Ross, thanks!
rishi

--
[1] http://svn.apache.org/repos/asf/oodt/tags/0.6/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DataDeliveryServlet.java
                
> Add PathUtils.replaceEnvVariables() wrapper around retrieved context parameters
> -------------------------------------------------------------------------------
>
>                 Key: OODT-649
>                 URL: https://issues.apache.org/jira/browse/OODT-649
>             Project: OODT
>          Issue Type: Sub-task
>          Components: product server
>    Affects Versions: 0.7
>            Reporter: Ross Laidlaw
>            Assignee: Ross Laidlaw
>            Priority: Minor
>              Labels: gsoc
>             Fix For: 0.7
>
>         Attachments: OODT-649.rlaidlaw.2013-07-27.patch.txt
>
>
> Methods in several classes in the cas.product.service.resources package retrieve parameters from the servlet context using the context.getInitParameter(String parameterName) method call, for example as follows:
> {code}
> setWorkingDirPath(context.getInitParameter("filemgr.working.dir"));
> {code}
> But these parameters may contain environment variables such as [HOME] or [FMPROD_HOME], etc.  Currently, these aren't processed properly and the getInitParameter call needs to be wrapped in a call to PathUtils.replaceEnvVariables() (from the cas-metadata module) to process the environment variables, for example as follows:
> {code}
> setWorkingDirPath(PathUtils.replaceEnvVariables(
>   context.getInitParameter("filemgr.working.dir")));
> {code}
> This is already done in the original Data, RDF and RSS servlets but was accidentally omitted from the new resource classes in the cas.product.service.resources package.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira