Alfresco sublime text snippets

A collection of sublime text snippets useful for coding Alfresco webscripts, scripts, forms and content models.

Download as .zip Download as .tar.gz View on GitHub

Freemarker Template

A collection of sublime text snippets useful for coding Alfresco Freemarker Template


Main Triggers !

Trigger: var

Output:


${}
          

Trigger: simple result

Output:


<#if error??>{
  "error" : "${error?string}"
}
<#else>{
  "results" : "OK"
}
</#if>
          

Trigger: result

Output:


<#if error??>{
  "error" : "${error?string}"
}
<#else>{
  "results" : [<#list results as result>
    {
  <#-------------- UUID -------------->
    "uuid" : "${result.properties['sys:node-uuid']}",
  <#-------------- Content -------------->
    <#if result.properties['cm:content']??>
    "content" : "${result.properties['sys:node-uuid']}",
    <#else>
    "content" : null,
    </#if>
  <#-------------- Created -------------->
    <#if result.properties['cm:created']??>
    "created" : "${result.properties['cm:created']?string("dd-MM-yyyy")}"
    <#else>
    "created" : null
    </#if>  
    }<#if result_has_next>,</#if></#list>
  ]
}
</#if>
          

Author

GitHub: odtorres