Hi Mona,<div><br></div><div><br></div><div>Whenever a file is uploaded, this callback line is fired in the UploadComponent:</div><div><br></div><div>Zend_Registry::get('notifier')->callback('CALLBACK_CORE_UPLOAD_FILE', array($item->toArray(), $itemRevisionDao->toArray()));</div>
<div><br></div><div>So if you register for this callback in your plugin, you can inspect the item and itemrevision in your callback method. </div><div><br></div><div><br></div><div><br></div><div><br></div><div>I can't remember if you have implemented callbacks before in your module, here is some documentation to get you started:</div>
<div><br></div><div><a href="http://www.kitware.com/midaswiki/index.php/Documentation/Latest/Developer/Modules#Callback_framework">http://www.kitware.com/midaswiki/index.php/Documentation/Latest/Developer/Modules#Callback_framework</a></div>
<div><br></div><div><br></div><div><br></div><div><br></div><div>I see that according to the docs, callbacks should pass their params as a keyed array, in this case the callback is just sending a list. I've opened a bug for this.</div>
<div><br></div><div><a href="http://public.kitware.com/MidasBT/view.php?id=886">http://public.kitware.com/MidasBT/view.php?id=886</a></div><div><br></div><div><br></div><div>Thanks,</div><div>Mike</div><div><br><div class="gmail_quote">
On Tue, Nov 20, 2012 at 7:12 PM, Mona Wong <span dir="ltr"><<a href="mailto:mona@sdsc.edu" target="_blank">mona@sdsc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hi:<br>
<br>
I need to create a plugin that will be fired when a user uploads a file of a certain type. What's a good place for me to look to get started?<br>
<br>
I looked at <a href="http://www.kitware.com/midaswiki/index.php/Documentation/3.2.8/Developer" target="_blank">http://www.kitware.com/midaswiki/index.php/Documentation/3.2.8/Developer</a> but didn't see anything that jumped out at me on how to do this...did I miss it? Is there another place to look or a module that does something similar which I can model after?<br>
<br>
thanks,<br>
Mona<br>
<br>
<br>
*********************************************<br>
Mona Wong<br>
Web & iPad Application Developer<br>
San Diego Supercomputer Center<br>
<br>
"Forgive everyone everything."<br>
-- Regina Brett<br>
*********************************************<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Midas mailing list<br>
<a href="mailto:Midas@public.kitware.com">Midas@public.kitware.com</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/midas" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/midas</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Thanks,<br>Michael Grauer<br>R & D Engineer<br>Kitware, Inc.<br>919 969 6990 x322<br><br><br><br>
</div>