Hi guys,
This is related my previous question How to get the assetID and Customfields on a plugin hook.
I have found some sample code to scaffolding a new plugin under global/plugins
. I copied the plugin’s folder global/plugins/metaform
and placed it on the same directory. I further modified the copy to trigger on on_file_remove
and it to call console.log("Hello World");
on the view, i.e. cfm
file. Further I restarted Razuna (that is, I restarted the Tomcat) and removed a image, but nothing came out in the Javascript console.
This led my to the question: how do I deploy a Plugin on a running Razuna? Is add_action
all I have to do to active my plugin? Is my code under plugins
rightly place?
here is my code:
global/plugins/ltur/cfc/main.cfc :
<cfcomponent output="false" extends="global.cfc.api"> <cfset this.myID = getMyID("ltur")> <cffunction name="load" returntype="void"> <cfset add_action(pid="#this.myID#", action="on_file_remove", comp="notify", func="notifyremove")> </cffunction> </cfcomponent>
global/plugins/ltur/cfc/notify.cfc :
<cfcomponent output="false" extends="global.cfc.api"> <cffunction name="notifyremove" access="public" output="false"> <cfreturn now() /> </cffunction> </cfcomponent>
global/plugins/ltur/view/notify.cfm
<cfoutput> <script language="JavaScript" type="text/javascript"> console.log("Hello World"); </script> </cfoutput>
Here is my metadata:
Self-hosted
Razuna 1.6.2
Chrome Version 32.0.1700.77
MySQL 5.5.29
SUSE Linux
Thanks a bunch!