<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;p&gt;We need to execute any code that plugins will need to hook into before the Rails initialize block in config/environment.rb (at the top of the file).&lt;/p&gt;
&lt;p&gt;Ansuz::PluginManager will have an attr_accessor :plugins, and each Ansuz plugin will need to register itself.&lt;/p&gt;
&lt;p&gt;A plugin will provide modules.  Each Frontend module will need an associated Backend module.  For instance, a ContentSection will have a base Frontend module that just renders the ContentSection on the page, and an associated Backend module that allows one to modify the content.&lt;/p&gt;
&lt;p&gt;A plugin&amp;#8217;s registration in init.rb could look something like this:&lt;/p&gt;
&lt;pre&gt;
  &lt;code&gt;
    # this registers a page_plugin, not a great method name
    Ansuz::PluginManager.register_plugin(Ansuz::Plugins::JAdams::ContentSection) 

    # this registers a nav entry in the user-facing ansuz menu.  This will change, to
    # registering a potential 'special' entry in the ansuz menu system.
    Ansuz::PluginManagerInstance.register_plugin_nav('Blog', '/articles') 

    # this registers an entry in the 'Content' menu in the admin, to handle the blog 
    # administration
    Ansuz::PluginManagerInstance.register_admin_menu_entry(
        'Content', 
        'Blog &amp;gt; All Posts', 
        '/admin/blog_posts'
    ) 

    # this adds an entry to create a new post from the admin menu
    Ansuz::PluginManagerInstance.register_admin_menu_entry(
        'Content', 
        'Blog &amp;gt; New Post', 
        '/admin/blog_posts/new'
    ) 
  &lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&amp;#8230;where Ansuz::Plugins::JAdams::ContentSection defines its Frontend modules and their related Backend modules.&lt;/p&gt;</body>
  <created-at type="datetime">2008-08-24T09:05:55-07:00</created-at>
  <id type="integer">48519</id>
  <permalink>pluginarchitecture</permalink>
  <repository-id type="integer">44155</repository-id>
  <title>PluginArchitecture</title>
  <updated-at type="datetime">2008-11-13T18:32:03-08:00</updated-at>
  <user-id type="integer">3829</user-id>
</wiki>
