roadmap icon indicating copy to clipboard operation
roadmap copied to clipboard

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

Open dsisu opened this issue 3 years ago • 6 comments

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 avatar Jun 07 '21 21:06 dsisu

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

dsisu avatar Jun 07 '21 21:06 dsisu

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...

pherterich avatar Jun 23 '22 15:06 pherterich

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?

briri avatar Jun 23 '22 15:06 briri

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...

pherterich avatar Jun 23 '22 15:06 pherterich

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"
                    ]
                  }
              ]  
            }
          ] 
        }
      ]
    }
  } 
}

briri avatar Jun 23 '22 15:06 briri

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...

pherterich avatar Jun 23 '22 15:06 pherterich