Interface Plugin


  • public interface Plugin

    The Plugin interface may be implemented by beaTlets that wish to provide a PluginDescriptor to better control requirements and provide information about themselves, like copyright, license, etc.

    beaTlets are classes defined in an object-oriented scripting language like Groovy. You may install them by simply placing them into beaTunes' plugin directory (OSX: /Users/[username]/Library/Application Support/beaTunes/Plug-Ins, Windows Vista or later: c:\Users\[username]\AppData\Local\tagtraum industries\beaTunes\plugins). It may often be advantageous to also implement the interface ApplicationComponent, in order to receive lifecycle method calls. If your plugin is an Action, you might want to extend ApplicationAction as it allows you to anchor the action somewhere in the UI via its ApplicationAction.getActionLocations() method.

    To give you a starting point on how to implement this interface in various scripting languages, here some examples.

    Example Jython:

     
     from com.tagtraum.core.app import Plugin, PluginDescriptor, Version
    
     class PluginDescriptorDemo(Plugin):
         def getPluginDescriptor(self):
             pd = PluginDescriptor()
             pd.setId("com.yourdomain.someid.py")
             pd.setName("Our pretty cool Jython beaTlet")
             pd.setDescription("And here we describe what it does ...")
             pd.setLicenseName("LGPL")
             pd.setVersion(Version("1.0.0"))
             pd.setMinBeaTunesVersion(Version("4.0.0"))
             pd.setMaxBeaTunesVersion(Version("5.9.9"))
             # etc.
             return pd
     
     

    Example Groovy:

     
     import com.tagtraum.core.app.*
    
     class PluginDescriptorDemo implements Plugin {
    
         def PluginDescriptor getPluginDescriptor() {
             PluginDescriptor pd = new PluginDescriptor()
             pd.setId("com.yourdomain.someid.groovy")
             pd.setName("Our pretty cool Groovy beaTlet")
             pd.setDescription("And here we describe what it does ...")
             pd.setLicenseName("LGPL")
             pd.setVersion(new Version("1.0.0"))
             pd.setMinBeaTunesVersion(new Version("4.0.0"))
             pd.setMaxBeaTunesVersion(new Version("5.9.9"))
             // etc.
             return pd
         }
     }
     
     

    Example JRuby:

     
     require 'java'
    
     java_import com.tagtraum.core.app.Plugin
     java_import com.tagtraum.core.app.PluginDescriptor
     java_import com.tagtraum.core.app.Version
    
     class PluginDescriptorDemo
    
         include Java::com.tagtraum.core.app.Plugin
    
         def getPluginDescriptor()
             pd = PluginDescriptor.new()
             pd.setId("com.yourdomain.someid.rb")
             pd.setName("Our pretty cool JRuby beaTlet")
             pd.setDescription("And here we describe what it does ...")
             pd.setLicenseName("LGPL")
             pd.setVersion(Version.new("1.0.0"))
             pd.setMinBeaTunesVersion(Version.new("3.0.0"))
             pd.setMaxBeaTunesVersion(Version.new("4.9.9"))
             # etc.
             return pd
         end
     end
     
     

    Example JavaScript:

     
     var Plugin = Java.type("com.tagtraum.core.app.Plugin");
     var PluginDescriptor = Java.type("com.tagtraum.core.app.PluginDescriptor");
     var Version = Java.type("com.tagtraum.core.app.Version");
    
     var beatlet = new Plugin() {
         getPluginDescriptor: function() {
             var pd = new PluginDescriptor();
             pd.setId("com.yourdomain.someid.rb");
             pd.setName("Our pretty cool JavaScript beaTlet");
             pd.setDescription("And here we describe what it does ...");
             pd.setLicenseName("LGPL");
             pd.setVersion(new Version("1.0.0"));
             pd.setMinBeaTunesVersion(new Version("5.0.0"));
             pd.setMaxBeaTunesVersion(new Version("5.9.9"));
             // etc.
             return pd;
         }
     }
    
     beatlet;
     
     
    Author:
    Hendrik Schreiber
    See Also:
    ApplicationComponent, PluginManager, Knowledge Base Article: How to install a plugin
    • Method Detail

      • getPluginDescriptor

        PluginDescriptor getPluginDescriptor()
        Programmatic description of this plugin.
        Returns:
        descriptor