Thread: Plugins disappearing?

Created on: 02/25/11 10:25 AM

New topic Reply    Page: 1  

Replies: 2

JohnDonut's Gravatar
Joined: 01/26/11
Posts: 19

02/25/11 10:25 AM

Hi, me again.

Help! :)

I have just finished a new plugin that was supposed to add a few links on the Admin overview page.

However, when I add the plugin into the plugins folder, ALL of my plugins disappear from my plugins page. The only thing on the page is the "URL of plugin to download" field.

When I remove this new plugin folder, everything else re-appears.

What did I do wrong??

------------ Handler.cfc -------

   <cffunction name="init" access="public" output="false" returntype="any">
      <cfargument name="mainManager" type="any" required="true" />
      <cfargument name="preferences" type="any" required="true" />   
      <cfset variables.manager = arguments.mainManager />
      <cfset variables.preferences = arguments.preferences />
      <cfreturn this/>

   <cffunction name="setup" hint="This is run when a plugin is activated" access="public" output="false" returntype="any">
      <cfreturn "Add Documentation plug-in activated. <br />You will now see a list of training documentation in the Admin section." />
   <cffunction name="unsetup" hint="This is run when a plugin is de-activated" access="public" output="false" returntype="any">
      <!--- TODO: Implement Method --->
      <cfreturn />
   <cffunction name="getName" access="public" output="false" returntype="string">
      <cfreturn />

   <cffunction name="setName" access="public" output="false" returntype="void">
      <cfargument name="name" type="string" required="true" />
      <cfset = />
      <cfreturn />

   <cffunction name="getId" access="public" output="false" returntype="any">
      <cfreturn />
   <cffunction name="setId" access="public" output="false" returntype="void">
      <cfargument name="id" type="any" required="true" />
      <cfset = />
      <cfreturn />

   <cffunction name="handleEvent" hint="Asynchronous event handling" access="public" output="false" returntype="any">
      <cfargument name="event" type="any" required="true" />      
      <cfreturn />

   <cffunction name="processEvent" hint="Synchronous event handling" access="public" output="false" returntype="any">
      <cfargument name="event" type="any" required="true" />

         <cfset var js = "" />
         <cfset var outputData = "" />
         <cfset var link = "" />
         <cfset var page = "" />
         <cfset var data = ""/>
         <cfset var path = "" />
         <cfset var admin = "" />
         <cfset var eventName = />
         <cfif eventName EQ "dashboardPod" AND variables.manager.isCurrentUserLoggedIn()>      
            <cfsavecontent variable="outputData">
            <cfoutput><p>Here is a list of the User Documents available to help you update this site</p>
                  <li><a href="/myblog/assets/content/docs/To Add a Link to a Post.docx">To Add a Link to a Post</a></li>
                  <li><a href="/myblog/assets/content/docs/To Add a New Author.docx">To Add a New Author</a></li>
                  <li><a href="/myblog/assets/content/docs/To Add a New Post.docx">To Add a New Post</a></li>
                  <li><a href="/myblog/assets/content/docs/To Edit a Post.docx">To Edit a Post</a></li>
                  <li><a href="/myblog/assets/content/docs/To Upload an MP3.docx">To Upload an MP3</a></li>
                  <li><a href="/myblog/assets/content/docs/To Upload and Display a Video.docx">To Upload and Display a Video</a></li>
            <cfset arguments.event.setOutputData(outputData) />      
      <cfreturn arguments.event />


--------- plugin.xml ----------

<?xml version="1.0" encoding="UTF-8"?>
<plugin id="" name="Add Documentation" version="1.0" provider-name="asfusion"

<description>Adds training documenation to the Admin section</description>

<requiresVersion match="greaterOrEqual">1.0</requiresVersion>

   <event name="dashboardPod" type="synch" priority="5" />

Link | Top | Bottom

Laura's Gravatar
Joined: 01/29/05
Posts: 1534

02/28/11 9:47 AM

Hi John,

First check if there is anything in the logs. Best is to install the logViewer plugin.

Second I would extend from org.mangoblog.plugins.BasePlugin. That will ensure you have all the required methods and other things. Then only override processEvent. (see best practices )
Lastly, in the plugin.xml, use <listens>, listensAdmin has been deprecated.
Link | Top | Bottom

JohnDonut's Gravatar
Joined: 01/26/11
Posts: 19

02/28/11 10:24 AM

It was the <listens> vs. <istensAdmin> that fixed it for me. Thanks!
Link | Top | Bottom

New Post

Please login to post a response.