Uploaded image for project: 'Repository'
  1. Repository
  2. REPOSITORY-402

Missing a ModelAwareDataHolder#getValue method with a default value

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 4.2.0
    • 4.2.0
    • None
    • None
    • 4.2 M9

      Before data model refactoring we can call for example zoneItem.getServiceParameters().getString(paramName, defaultValue)

      With a new API of ModelAwareDataHolder we do not have the equivalent anymore.

      Futhermore, the former API throws a UnknowMetadataException when the data does not exist. The new API returns null.
      And the javadoc says nothing about this !!
       

          [REPOSITORY-402] Missing a ModelAwareDataHolder#getValue method with a default value

          should be a 3 args method like in the Config

          Raphaël Franchet added a comment - should be a 3 args method like in the Config

          See // FIXME REPOSITORY-402 Missing a ModelAwareDataHolder#getValue method with a default value in code.

          Look for all uses of ModelAwareDataHolder.getValue(dataPath), some should use the method with a default value.

          For example :

          • org.ametys.plugins.blog.InitializeBlogSiteObserver.initializeDefaultZone(ModifiablePage)
          • org.ametys.plugins.blog.repository.PostListZoneFactory.getAmetysObjectById(String)
          • org.ametys.plugins.blog.repository.PostListZoneItemFactory.getAmetysObjectById(String)
          • org.ametys.plugins.blog.repository.VirtualTagPage.getDefaultZone()
          • org.ametys.plugins.blog.repository.VirtualYearPage.getDefaultZone()
          • org.ametys.plugins.survey.dao.SurveyDAO.sendInvitations(String, String, String)

          Laurence Aumeunier added a comment - See // FIXME REPOSITORY-402 Missing a ModelAwareDataHolder#getValue method with a default value in code. Look for all uses of ModelAwareDataHolder.getValue(dataPath) , some should use the method with a default value. For example : org.ametys.plugins.blog.InitializeBlogSiteObserver.initializeDefaultZone(ModifiablePage) org.ametys.plugins.blog.repository.PostListZoneFactory.getAmetysObjectById(String) org.ametys.plugins.blog.repository.PostListZoneItemFactory.getAmetysObjectById(String) org.ametys.plugins.blog.repository.VirtualTagPage.getDefaultZone() org.ametys.plugins.blog.repository.VirtualYearPage.getDefaultZone() org.ametys.plugins.survey.dao.SurveyDAO.sendInvitations(String, String, String)

            raphael Raphaël Franchet
            laurence Laurence Aumeunier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: