Plugin in 5 step

ColdFusion FileManager is a web application extensible  with plugin.

You can develop plugin for extend your fileManager installation. First step is create a folder into /fileManager/plugin/ path, for examples ( /fileManager/plugin/myFirstPlugin).

Create a Plugin.cfc file with extends attribute set to fileManager.util.AbsPlugin.

Create a CFC with your server-side action for your plug-in. For this tutorial I've create a ImageResize.cfc for resize image after drop action.

Now, create a Plugin.xml file and edit it.

<plugin id="it.millemultimedia.fileManager.plugins.ImageResize"
      name="ImageResize"
      version="1.0.0"
      provider="www.millemultimedia.it"
      class="fileManager.plugin.imageResize.Plugin"
      type="class">

   
   <services>
      
      <!-- map methods to remote facade generator -->
      <remote type="facade" name="imageresize" use-service="ImageResize" map-to-class="fileManager.plugin.imageResize.ImageResize">
         <method name="resize" />
      </remote>
      
   </services>
      
   <display-objects>
      
      <import>
         <script src="plugin/imageResize/assets/js/imageResize.js" />
         <icon src="plugin/imageResize/assets/ico/ImageResize.png" message="Drop Image file for resize it." />
      </import>
      
      <event>
         <listener target="imageresize" event="onDrop" plugin="fileManager.plugin.ImageResize.handler.resize" ddGroup="gridDDGroup" />
      </event>
      
   </display-objects>
   
</plugin>

The Plugin.xml file, map your CFC to Javascript and create dynamic proxy. (Next Post write the Plugin.xml reference)

Create an other folder called assets/js and assets/ico. On ico folder, save your icon with 64x64 px of dimensions. In js folder create a Javascript file for manager the handlers.

Ext.namespace('fileManager.plugin.ImageResize.handler');

fileManager.plugin.ImageResize.handler.resize = function(dd, e, data){
         Ext.Msg.show({
            title: 'Resize Image ' + data.selections[0].data.name,
            msg: 'Are you sure?',
            width: 300,
            height: 200,
            buttons: {
               yes: true,
               no: true,
               cancel: false
            },
            fn: function(btn){
               switch (btn) {
                  case 'yes':

                     Ext.Ajax.request({
                        url: services.imageresize.resize,
                        method: 'post',
                        params: {
                           source: "/" + data.selections[0].data.relativepath
                        },
                        waitMsg: 'Resize image',
                        sync:true,
                        success:function( response, options ){
                           var res = Ext.util.JSON.decode(response.responseText);
                           var log1 = document.getElementById("logArea").value;
                           if( res.success == true ){
                              document.getElementById("logArea").value = getCurrentTime()+' | Image '+data.selections[0].data.name+' resized\n' + log1;
                              
                              _FileGridPanel.store.reload({});
                           }else{
                              errorLogHandler( res );
                           }
                        }
                     });

                     break;
                  case 'no':
                     
                     break;
               }
            }
         });
   return true;
}

Zip your plugin folder and upload with FileManager, so you make possible install it .

Your plugin is ready.

Comments
burberry outlet's Gravatar Well, this is my first visit to your blog! We are a group of volunteers and starting a new initiative in a community in the same niche. Your blog provided us valuable information to work on. You have done a marvelous job!
# Posted By burberry outlet | 4/15/11 10:08 PM
ghd hair straighteners australia's Gravatar This brand also has an awesome collection of <a href="://www.paulsmithcheapsales.co.uk/">paul smith shop</a> most of which feature a bold embroidered design with rich colors and rhinestone embellishments that make unique. The famous tattoo inspired tiger prints with decorative studding on the <a href="://www.paulsmithcheapsales.co.uk/">paul smith bags</a> add a stunning look. While some of the belts feature tattoo inspired skull screens with contrasting <a href="://www.tommy-hilfiger-uk.co.uk">hilfiger sale uk</a> embroidery and rhinestone detailing, others are studded with crystals to give a cool feminine touch. It goes without saying that the perfect <a href="://www.tommy-hilfiger-uk.co.uk">tommy hilfiger sale uk</a> needs the perfect jewellery to complement it and there is nothing to <a href="://www.rolexhots.com/Bell-&-Ross-c-89.html"><font color="#00FF00" size="4" face="Courier New"><strong>bell & ross replica</strong></font></a> is incredibly popular, and the collectable nature of these beautiful pieces of means that many people are searching for them online.
Whether it is <a href="://www.rolexhots.com/Bell-&-Ross-c-89.html"><font color="#0000FF" size="4" face="Georgia"><strong>bell & ross watches</strong></font></a> or fashion accessories all means a lot for modern society of today.
They are most iconic and can provide you with a new feeling and enhance confidence.
The quality of <a href="://www.rolexhots.com/Cartier-c-152.html"><font color="#33CC99" face="Verdana"><strong>replica cartier watches</strong></font></a> is just superior to what you have dreamt of.
If you are still unsure about whether or not the site is genuine, you could always visit the genuine <a href="://www.lyhandbags.com/dior.html"><font color="#0000FF" size="4" face="Georgia"><strong>replica dior</strong></font></a> website and do a store search for the online retailer.
# Posted By ghd hair straighteners australia | 1/9/12 9:17 PM
Microsoft Office 2010's Gravatar Such workout like coach outlet for the reason that allows keep the feet
# Posted By Microsoft Office 2010 | 1/16/12 11:38 PM
jimmy choo uk's Gravatar In this modern and fashionable society, people are pursuing for <a href="://www.jewelleryuksale.com">tiffany and co</a> cool, unique, stylish and innovative. Whether it is <a href="://www.jewelleryuksale.com">tiffany co jewellery</a> or fashion accessories all means a lot for modern society of today. Same is the case with trendy looking <a href="://www.tiffanyjewellerycouk.org.uk">tiffany jewellery</a>. When these are <a href="://www.tiffanyjewellerycouk.org.uk">tiffany uk</a>, the excitement just gets doubled. Most chic looking <a href="://www.tiffanyjewellerycouk.org.uk">tiffany jewellery uk</a> are in fashion now. These are one of the favorite fashion accessories for men and women long time ago. If you have not yet tried <a href="://www.ukjimmychooshoes.org.uk">jimmy choo uk</a>, it's time to own one and feel the difference it can make to your personality. These are just brilliant and fabulous <a href="://www.ukjimmychooshoes.org.uk">jimmy choo sale</a>. They are most iconic and can provide you with a new feeling and enhance confidence.
# Posted By jimmy choo uk | 2/23/12 6:30 PM
soccershoewow's Gravatar In the office at the end of the ceremony is about to, <a href="://www.soccershoeswow.com">Soccer Shoes</a>mercurial talaria a peripheral guard suddenly rush rush in, people not to sound to ring out: "newspaper, a new task order." "You like what kind of guarded? Haven’t seen what is this occasion, hurry to get it down." See the guard is a face of nervously appearance, black wind evil spirit immediately scold a way, then it up that roll order material look at, suddenly he also become some ugly face up.AC Milan famous crazy commentator Lu Daili recently participated in the Italy Friday prime-time broadcast<a href="://www.soccershoeswow.com">Nike CTR360</a> , Soccer cleats in the program, a senior AC Milan fans, discovered a lot of secrets, including Berlusconi and Guardiola have Soccer shop a relatively frequent contact.

The <a href="://www.soccershoeswow.com/nike-cleats-nike-tiempo-soccer-cleats-c-25_36.html">Nike Tiempo Soccer Cleats</a> are one of the most consistent boots you will currently find on the market. They offer pretty much the complete package for any player who fits the playmaker mold, or any player that aspires to be a playmaker. On field, they offer great performance and work out exactly as you would expect – and better! While <a href="://www.soccershoeswow.com/">Adidas Football</a> dribbling, you are able to keep the ball closer to your feet by using the dampening pods up around the front of the boot. <a href="://www.soccershoeswow.com">Adidas F50</a> are raised slightly off the boot and are basically padded regions that allow for a softer touch on the ball. The side pass and control pads and the control region serves a <a href="://www.soccershoeswow.com/adidas-cleats-adidas-predator-soccer-cleats-c-80_93.html">Adidas Predator Soccer Cleats</a> valid purpose.
# Posted By soccershoewow | 5/14/12 6:03 PM
cheapsoccershoes's Gravatar In order to allow the player threw himself into the game, Nike CTR360 to provide them with a unique ball boots customized services, to ensure maximum wearing comfort and high performance.
# Posted By cheapsoccershoes | 5/14/12 6:17 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.5.006. | Protected by Akismet | Blog with WordPress