In order to update a document template in ROFS, a developer can follow these instructions:
Retrieve current letter template to edit
Remove protection on document. In order to edit a document you must click ‘Stop Protection’
Make any necessary edits to the document template
One you are done making edits, add protection back to the document. Leave the password field blank
Convert word file to bytes.
Upload document to DMS.
Update GUID ID in ROFS.
...
Environment | Document API Swagger Page |
---|---|
DEV | https://ncddocumentservicesapp01.azurewebsites.net/swagger/index.html |
QA |
...
...
...
...
...
...
...
Retrieve a download link to the current letter template to edit by using accessing the document API swagger page and using the GET /api/v1/document/downloadlink/{id} endpoint. You can get the current template GUID from the Rofs code base in DocumentTemplate.cs.
Remove protection on document. In order to edit a document you must click navigate to Developer > Restrict Editing and then click Stop Protection
Make any necessary edits to the document template.
One you are done making edits, add protection back to the document with the setting in the screenshot. After clicking ‘Yes, Start Enforcing Protection’, leave the password field blank , and click OK
Convert the updated word file to bytes by using the following tool:
https://cloudmersive.com/convert-file-to-json-byte-array-tool
...
This will be used to upload the document in JSON format
Upload document to DMS by using the POST /api/v1/documents endpoint with the following request body, depending on your language. Replace the parameters in between {} with your request specific values.
English:{
"userName": "
...
{YourEmail
...
}",
"fileBytes": "
...
{FileBytesFromStep5}",
"fileName": "NotificationLetter.docx",
"fileContentType": "application/msword",
"submissionMethod": "004",
"fileLanguage": "english"
}French:
{
"userName": "
...
{YourEmail
...
}",
"fileBytes": "
...
{FileBytesFromStep5}",
"fileName": "LetterDeNotification.docx",
"fileContentType": "application/msword",
"submissionMethod": "004",
"fileLanguage": "french"
}Get the document id from the response generated in step 6 and update the DocID in Rofs DocumentTemplate.cs.
Make sure to upload the updated template to the upper environments as well , by repeating steps 6-7.