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 2014/05/11 00:12:30 UTC

[jira] [Updated] (OODT-686) AddProductTypeCliAction should prompt for ProductTypeId

     [ https://issues.apache.org/jira/browse/OODT-686?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rishi Verma updated OODT-686:
-----------------------------

    Attachment: OODT-686.rverma.05-08-2014.patch.txt

Patch to resolve OODT-686 and it's sub-task

> AddProductTypeCliAction should prompt for ProductTypeId
> -------------------------------------------------------
>
>                 Key: OODT-686
>                 URL: https://issues.apache.org/jira/browse/OODT-686
>             Project: OODT
>          Issue Type: Bug
>          Components: file manager
>    Affects Versions: 0.6
>         Environment: 0.7-SNAPSHOT
>            Reporter: Rishi Verma
>            Assignee: Rishi Verma
>             Fix For: 0.7
>
>         Attachments: OODT-686.rverma.05-08-2014.patch.txt
>
>
> Currently, the AddProductTypeCliAction [1] breaks (returns NullPointerException) when generating a new product type even when all required valid arguments are supplied. 
> Reproducible steps:
> 1. Navigate to filemgr/bin
> 2. Issue: ./filemgr-client -op -addPT -typeName TestProductType1 -repository "file:///usr/local/oodt/data/archive" -typeDesc "This is a test product type" -versionClass "gov.nasa.jpl.oodt.myproductversioner" -url http://localhost:9000
> 3. View failure message: "ERROR: Failed to add product type with name 'TestProductType1', description 'This is a test product type', repository 'file:///usr/local/oodt/data/archive, and versioner 'gov.nasa.jpl.oodt.myproductversioner' : null"
> After some investigation, I found that the underlying problem here is that the AddProductTypeCliAction does not generate a ProductType object that has a ProductTypeId field set. I'm not sure why AddProductTypeCliAction does not prompt the user for this like it does for other arguments, because the XmlRepositoryManager requires a ProductTypeId to be present in order for policy to be generated (see [2] addProductType method). If ProductTypeId is not present within the ProductType object generated by this CliAction, then the XmlRepositoryManager will issue an error. In fact, I'll bet future repository managers will need ProductTypeId as much as XmlRepositoryManager does, so fixing this CliAction will be beneficial.
> --
> [1] http://svn.apache.org/repos/asf/oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/cli/action/AddProductTypeCliAction.java
> [2] http://svn.apache.org/repos/asf/oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/repository/XMLRepositoryManager.java



--
This message was sent by Atlassian JIRA
(v6.2#6252)