Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagegroovy
linenumberstrue
router.POST('topics/{id}') {
   strategy(DOCUMENT_BY_UNID) {
      keyVariableName("id")
      formName("TopicMainTopic")
 }
   mapJson "id", json:'id', type:'STRING', isformula:true, formula:'@DocumentUniqueId', readonly:true
   mapJson "Subject", json:'topic', type:'STRING'
   mapJson "body", json:'content', type:'MIME'
   mapJson 'categories', json:'categories', type:'ARRAY_OF_STRING', writeonly:true
   mapJson "date", json:'date', type:'DATETIME', isformula:true, formula:'@Created', readonly:true
   mapJson "author", json:'author', type:'STRING', isformula:true, formula:'@Name([CN]; From)', readonly:true
   
   events PRE_SAVE_DOCUMENT: {
      context, document ->
      nsfHelp = context.getNSFHelper()
      nsfHelp.computeWithForm(document)
   }
}

...