Project

General

Profile

Actions

Feature #783

closed

Real Plugin-System

Added by Martin Herr about 16 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
High
Assignee:
-
Category:
-
Target version:
Start date:
2008-03-04
Due date:
% Done:

100%

Estimated time:
Resolution:

Description

I think it would be extremely useful to have a "real plugin-system" integrated into redmine core. Based on this, it should be possible to modify routing,controllers,models,views,helpers and even core functions.

At the moment it's hard to build extensions without patching the core and even the engines-plugin is just an unstable workaround for me :(

I'm one of the developers of forge.typo3.org and would like to contribute my redmine modifications - but I can't do this by contributing hundreds of patches. There should be a clean way for everyone to extend redmine by developing plugins.

Maybe it makes sense to look at the mephisto guys and how they implemented their plugin-system:
http://mephistoblog.com/
http://jamescrisp.blogspot.com/2007/04/tips-for-developing-mephisto-plugins.html

Any other ideas?


Related issues

Related to Redmine - Feature #1143: Hooks for pluginsClosed2008-04-29

Actions
Related to Redmine - Patch #1677: Plugin hook APIClosed2008-07-24

Actions
Actions #1

Updated by Eric Davis about 16 years ago

Actually Mephisto is in the process of throwing their plugin system away and using Engines instead. You should be able to create a Redmine or Rails plugin to override anything in Redmine without changing the core.

Actions #2

Updated by Martin Herr about 16 years ago

Hey Eric,

I really tried to overload existing redmine-views and -controllers with engines for several days - but couldn't get it to work.. :(

Will try it again :)

@Jean-Philippe: Would it be possible that I could get write access to http://www.redmine.org/wiki/redmine/Plugins that I can add some documentation about my experiences writing redmine plugins?

Actions #3

Updated by Rocco Stanzione about 16 years ago

+1. As the Engines docs say, you can't really clobber models with a plugin - you'd have to copy the whole existing model into the plugin, which kind of defeats the purpose. I was able to get it to work for one page load with some evil hackery, but at the end Rails insists on loading the original plugin.

Actions #4

Updated by Brian Palmer about 16 years ago

-1.

I have to disagree. I'm working on a Redmine plugin and the engines system has worked very well, I think a "real" plugin system would require a huge amount of effort to even reach the same level. Models can be a problem, true, but it's not difficult to inject code into existing models in the plugin initialization code. I added a new has_many association to projects in this way. Some problems can occur in development mode because of reloading, but they can be worked around.

Actions #5

Updated by Jean-Philippe Lang about 16 years ago

Martin Liu: you should be able to edit the wiki now.

Actions #6

Updated by Chaoqun Zou almost 16 years ago

Hi, Brian.
Could you tell us how to do this? "I added a new has_many association to projects in this way."
Thanks.

Actions #7

Updated by Eric Davis over 15 years ago

chaoqun zou wrote:

Hi, Brian.
Could you tell us how to do this? "I added a new has_many association to projects in this way."

This code is working great for me. As you can see in the ClassMethods and InstanceMethods modules, you can easily add or override methods in the Redmine core.

# init.rb
require_dependency 'issue_patch'
# issue_patch.rb
require_dependency 'issue'

module IssuePatch
  def self.included(base) # :nodoc:
    base.extend(ClassMethods)

    base.send(:include, InstanceMethods)

    # Same as typing in the class 
    base.class_eval do
      belongs_to :my_plugin_class
    end

  end

  module ClassMethods   
    # Methods to add to the Issue class
  end

  module InstanceMethods
    # Methods to add to specific issue objects
  end
end

# Add module to Issue
Issue.send(:include, IssuePatch)

Actions #8

Updated by Eric Davis over 15 years ago

  • Status changed from New to Closed
  • Assignee deleted (Jean-Philippe Lang)
  • Target version set to 0.8
  • % Done changed from 0 to 100

I'm going to close this issue. #1677 added some plugin hooks so plugins can start to add in their own HTML or controller logic. r1723 lets any plugin override a view by creating the same named view file.

If any more hooks are needed; open a issue describing where you would like it, what data you would like, and assign it to me.

Thanks.

Actions #9

Updated by Thiyagarajan Thulasi about 9 years ago

Hi,
In my redmine application i added some plugins while overriding a same patch in different plugin but it take priority with the top level i unable to run my bottom plugin patch.

For Example:

Plugin 'A'   Am writing patch for issues controller and issue before_save callBack
plugin 'B' Am overriding same issue controller patch and model before_save callBack

The above scenario Plugin 'A' patch's only running plugin 'B' code does't run

Any one have any solution for this?

Actions #10

Updated by Toshi MARUYAMA about 9 years ago

Thiyagarajan Thulasi wrote:

(snip)

FTR: #19019.

Actions

Also available in: Atom PDF