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

Alfresco Web Client Forms

A collection of sublime text snippets useful for coding Alfresco Web Client Forms


Main Triggers !

Trigger: alfresco config

Output:


<alfresco-config>
  
</alfresco-config>
          

Trigger: config actions

Output:


<config evaluator="string-compare" condition="DocLibActions">
    <actions>
      <!-- type="javascript" -->
      <action id="add-note" icon="add-note" type="javascript" label="label.action.add-note">
        <param name="function">onActionFormDialog</param>
        <param name="itemKind">action</param>
        <param name="itemId">add-note</param>
        <param name="mode">create</param>
        <param name="destination">{node.nodeRef}</param>
        <param name="successMessage">message.add-note.success</param>
        <param name="failureMessage">message.add-note.failure</param>
      </action>
      <!--  type="pagelink"  -->
      <action id="manage-notes" type="pagelink" icon="manage-notes" label="label.actions.manage-notes">
              <param name="page">manage-notes?nodeRef={node.nodeRef}</param>
      </action>
           <!--  type="link"  -->
      <action id="manage-notes" type="link" icon="manage-notes" label="label.actions.manage-notes">
              <param name="page">manage-notes?nodeRef={node.nodeRef}</param>
      </action>
    </actions>
    <actionGroups>
      <actionGroup id="document-browse">
        <action index="110" id="add-note"/>
        <action index="110" id="manage-notes"/>
        </actionGroup>
      <actionGroup id="document-details">
        <action index="110" id="add-note"/>
        <action index="110" id="manage-notes"/>
      </actionGroup>
      <actionGroup id="folder-browse">
        <action index="102" id="add-note"/>
        <action index="125" id="manage-notes"/>
      </actionGroup>
      <actionGroup id="folder-details">
        <action index="102" id="add-note"/>
        <action index="125" id="manage-notes"/>
      </actionGroup>
    </actionGroups>
</config>
          

Trigger: config forms

Output:


<config evaluator="node-type" condition="$1:$2">
    <forms>
      <!-- Edit Note Properties Form (Popup) -->
      <form id="doclib-simple-metadata">
        <field-visibility>
          <show id="$1:$3"/>                    
        </field-visibility>
        <appearance>
          <field id="$1:$3" label-id="$4" >
            <control template="/org/alfresco/components/form/controls/date.ftl">
              <control-param name="style">width:380px</control-param>
            </control>
          </field>
        </appearance>
      </form>
    </forms>
</config>
          

Trigger: config aspects

Output:


<config evaluator="string-compare" condition="DocumentLibrary">
  <aspects>   
   <visible>
       <aspect name="$1:$2" />       
   </visible>

   <addable>
   </addable>
   
   <removeable>
   </removeable>
  </aspects>
</config>
          

Trigger: config types

Output:


<config evaluator="string-compare" condition="DocumentLibrary">
  <types>
     <type name="cm:content">
         <subtype name="$1:$2" />         
     </type>     
 </types>
</config>
          

Trigger: field date

Output:


<field id="$1" label-id="$2" >
  <control template="/org/alfresco/components/form/controls/date.ftl">
    <control-param name="style">width:380px</control-param>
  </control>
</field>
          

Trigger: field mimetype

Output:


<field id="$1" label-id="$2" >
  <control template="/org/alfresco/components/form/controls/mimetype.ftl" />
</field>
          

Trigger: field selectone

Output:


<field id="$1" label-id="$2" >
  <control template="/org/alfresco/components/form/controls/selectone.ftl">
    <control-param name="options">
      Value1|{$2},
      Value2|{$2},
      Value3|{$2}
    </control-param>
    <control-param name="style">width:380px</control-param>
  </control>
</field>
          

Trigger: field size

Output:


<field id="$1" label-id="$2" >
  <control template="/org/alfresco/components/form/controls/size.ftl" />
</field>
          

Trigger: field textarea

Output:


<field id="$1" label-id="$2" >
  <control template="/org/alfresco/components/form/controls/textarea.ftl">    
  </control>
</field>
          

Trigger: field textfield

Output:


<field id="$1" label-id="$2" >
  <control template="/org/alfresco/components/form/controls/textfield.ftl" />
</field>
          

Trigger: field

Output:


<field id="$1" label-id="$2" />
          

Author

GitHub: odtorres