Uploaded image for project: 'OODT'
  1. OODT
  2. OODT-686

AddProductTypeCliAction should prompt for ProductTypeId

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.6
    • 0.10
    • file manager
    • None
    • 0.7-SNAPSHOT

    • Don't Know (Unsure) - The default level

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              chrismattmann Chris A. Mattmann
              riverma Rishi Verma
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: