DMPRoadmap / roadmap

DCC/UC3 collaboration for a data management planning tool
MIT License
104 stars 110 forks source link

Preview of API output (JSON or XML) with different template answer options #2939

Open dsisu opened 3 years ago

dsisu commented 3 years ago

Please complete the following fields as applicable:

What version of the DMPRoadmap code are you running? (e.g. v2.2.0) v3.0.2

Expected behaviour: Preview of API output (JSON or XML) with different template answer options

Actual behaviour: unsure

Steps to reproduce: unsure

dsisu commented 3 years ago

This issue came out of the DMPonline Usability Exercise carried out in 2020

pherterich commented 2 years ago

I think the addition of json as an export format might address this issue already but @briri can clarify as I have vague memories of the json just providing API v1 output and not v0...

briri commented 2 years ago

I'm unsure what the issue is about. The JSON is just the common standard format and so doesn't include the narrative. Is this a request to add the narrative to it?

pherterich commented 2 years ago

Yes, I think the idea is that institutional admins would like to understand how a template will look like in the full text API, at least that's how I understand it. Not sure how we would create a JSON mashup easily though...

briri commented 2 years ago

Ok. Perhaps there's a way to add it to both but we'll need to discuss. We just had a PR to DMPTool to allow the templates from our API v2 to include all of the phase/section/question content: https://github.com/CDLUC3/dmptool/pull/356

Perhaps we could add something like the following to v1:

{
  "dmp": {
    "dmproadmap_narrative": {
      "phases": [ 
        {
          "order": 1,
          "title": "Write Plan",
          "description": "lorem ipsum",
          "sections": [
            {
              "order": 1,
              "title": "Preservation",
              "description": "lorem ipsum",
              "questions": [
                {
                  "order": 1,
                  "text": "What are your plans? (example of a free text question)",
                  "response": {
                    "text": "We are going to preserve it for a long time."
                  }
                }, {
                  "order": 2,
                  "text": "What are your favorite colors? (example of a question with predefined options)",
                  "response": {
                    "text": [
                      "blue",
                      "green"
                    ]
                  }
              ]  
            }
          ] 
        }
      ]
    }
  } 
}
pherterich commented 2 years ago

Just noted that this is asking for things on a template level, we don't currently have a way to export a template (I think, other than using the link sharing or PDF link) or would one need to publish it and then just query the API? Hmm, not sure how this one would work...