Skip to content

Instantly share code, notes, and snippets.

@howellcc
Forked from muracms/file.cfm
Created June 6, 2016 14:36
Show Gist options
  • Save howellcc/d33f59a43bfc09a974240e6b1d0e45c1 to your computer and use it in GitHub Desktop.
Save howellcc/d33f59a43bfc09a974240e6b1d0e45c1 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