Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-31052

Make Directory.SuggestEntries return parent with obsolete children if the parameter canSelectParent is set to true

    XMLWordPrintable

    Details

    • Release Notes Summary:
      A parent directory entry of which all children are obsolete is now returned if 'canSelectParent' is true
    • Backlog priority:
      650
    • Sprint:
      nxplatform #83
    • Story Points:
      3

      Description

      Steps to reproduce :

      1. define a hierarchical vocabulary with this content
        "id","label","parent","obsolete"
        "veg","Végétale","","0"
        "palm","Huile de palme","veg","1"
        "ani","Animale","","0"
        "porc","Porc","ani","0"
        "boeuf","Boeuf","ani","0"
        "autre","Autre","",0
        
      2. run this query
        curl -u Administrator:Administrator 'http://localhost:8080/nuxeo/api/v1/automation/Directory.SuggestEntries'   -H 'Accept: application/json' -H 'Content-type: application/json'  -H 'X-NXRepository: default'   -H 'properties: *'  --data-raw '{"params":{"directoryName":"myvoc","dbl10n":false,"localize":true,"lang":"fr","searchTerm":"","canSelectParent":true},"context":{}}'
        
      3. observe that the parent "veg" is not returned because its only children "palm" is obsolete
        [
           {
              "absoluteLabel" : "Animale",
              "children" : [
                 {
                    "absoluteLabel" : "Animale/Boeuf",
                    "computedId" : "ani/boeuf",
                    "directoryName" : "myvoc",
                    "displayLabel" : "Boeuf",
                    "entity-type" : "directoryEntry",
                    "id" : "boeuf",
                    "label" : "Boeuf",
                    "obsolete" : 0,
                    "ordering" : 10000000,
                    "parent" : "ani",
                    "properties" : {
                       "id" : "boeuf",
                       "label" : "Boeuf",
                       "obsolete" : 0,
                       "ordering" : 10000000,
                       "parent" : "ani"
                    }
                 },
                 {
                    "absoluteLabel" : "Animale/Porc",
                    "computedId" : "ani/porc",
                    "directoryName" : "myvoc",
                    "displayLabel" : "Porc",
                    "entity-type" : "directoryEntry",
                    "id" : "porc",
                    "label" : "Porc",
                    "obsolete" : 0,
                    "ordering" : 10000000,
                    "parent" : "ani",
                    "properties" : {
                       "id" : "porc",
                       "label" : "Porc",
                       "obsolete" : 0,
                       "ordering" : 10000000,
                       "parent" : "ani"
                    }
                 }
              ],
              "computedId" : "ani",
              "directoryName" : "myvoc",
              "displayLabel" : "Animale",
              "entity-type" : "directoryEntry",
              "id" : "ani",
              "label" : "Animale",
              "obsolete" : 0,
              "ordering" : 10000000,
              "parent" : "",
              "properties" : {
                 "id" : "ani",
                 "label" : "Animale",
                 "obsolete" : 0,
                 "ordering" : 10000000,
                 "parent" : ""
              }
           },
           {
              "absoluteLabel" : "Autre",
              "computedId" : "autre",
              "directoryName" : "myvoc",
              "displayLabel" : "Autre",
              "entity-type" : "directoryEntry",
              "id" : "autre",
              "label" : "Autre",
              "obsolete" : 0,
              "ordering" : 10000000,
              "properties" : {
                 "id" : "autre",
                 "label" : "Autre",
                 "obsolete" : 0,
                 "ordering" : 10000000
              }
           }
        ]
        

         

      It makes sense not to return a parent with all obsolete children when the parent cannot be selected. But if one can choose a parent, it should be return in this case.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: