Skip to content

Instantly share code, notes, and snippets.

@muracms
Last active June 6, 2016 14:36
Show Gist options
  • Save muracms/434a28d07c8d8446dd37 to your computer and use it in GitHub Desktop.
Save muracms/434a28d07c8d8446dd37 to your computer and use it in GitHub Desktop.
<cfscript>
var APIUtility = getBean('settingsManager').getSite({siteid}).getAPI('json', 'v1');
APIUtility.registerMethod(methodName='applyProperty', method=applyProperty);
public any function applyProperty() {
// do something
}
</cfscript>
<cfscript>
var APIUtility=getBean('settingsManager').getSite({siteid}).getApi('json','v1');
APIUtility.registerLinkMethod(method=myCustomLinkMethod);
public any function myCustomLinkMethod(entity,links){
if ( entity.getEntityName()=='targetEntity' ) {
arguments.links['runs']='#getEndPoint()#?method=myCustomMethod&siteid=#arguments.entity.getValue('siteid')#';
}
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment