Project

General

Profile

Writing plugins or altering source code???

Added by Andy Hazlewood over 15 years ago

Hi there,

I am looking for some advice, I have recently installed Redmine on a development server at work and have nearly persuade management to start using Redmine for all our project tracking. One feature that is lacking is the ability to view a summary of all issues from all projects or view a summary for custom queries. I have noticed this has been requested http://www.redmine.org/issues/2529 but the request is still new. I have highlighted what I think is the controller that generates the summary however, I am a Java programmer and have no Ruby experience. Is writing a plugin to provide this functionality a bit ambitious for a newbie?? And is it advised to write a plugin or alter the source code?

Many thanks in advance

Andy


Replies (7)

RE: Writing plugins or altering source code??? - Added by Andrew Chaika over 15 years ago

For first time you can try alter source code to learn ruby and get some expirience, but when you understand that core could be changed in every next revision you will come yourself to an idea of wrapping all your modifications into plugins.
Read Wiki about plugins and check implementations of others. Ruby is amazing language and I think you will enjoy learning it.

RE: Writing plugins or altering source code??? - Added by Andy Hazlewood over 15 years ago

Andrew,

Thanks for your prompt response. I have had a quick mess about with Ruby and it looks like a pretty good language. Very different syntax to Java but still an OOP.

On a slightly different note (and probably breaking forum rules!!) I was just looking at the latest release of your Group plugin and I am really keen to explore the new functionality you have added as I think I may be able to get away with custom queries and grouping them to win over my boss. However, when I try and migrate plugins I am getting the following error:-


C:\redmine-0.8.3>rake db:migrate_plugins RAILS_ENV=production
(in C:/redmine-0.8.3)
rake aborted!
undefined local variable or method `acts_as_customizable' for #<Class:0x6fd01a0>

(See full trace by running task with --trace)

Any ideas? Is this something to do with rails, I am only guessing as I am not really sure how rails fits in to Redmine I just downloaded it because the wiki said I should :-)

Andy

RE: Writing plugins or altering source code??? - Added by Andrew Chaika over 15 years ago

It seems that acts_as_customizable plugin is missing from your Redmine installation.
Check \vendor\plugins\acts_as_customizable\lib\acts_as_customizable.rb file.
If it's there run migration (rake task) with --trace switch and it will explain when the exception is thrown.

RE: Writing plugins or altering source code??? - Added by Andy Hazlewood over 15 years ago

Andrew,

Tried that but not really sure what the output means:-

C:\redmine-0.8.3>rake db:migrate_plugins RAILS_ENV=production --trace
(in C:/redmine-0.8.3)
** Invoke db:migrate_plugins (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined local variable or method `acts_as_customizable' for #<Class:0x6e8e1d4>

C:/redmine-0.8.3/vendor/rails/activerecord/lib/active_record/base.rb:1672:in `me
thod_missing'
C:/redmine-0.8.3/app/models/user.rb:48
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_re
quire'
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:5
10:in `require'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:3
55:in `new_constants_in'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:5
10:in `require'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
02:in `require_or_load'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:2
61:in `load_missing_constant'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
68:in `const_missing'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
80:in `const_missing'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
86:in `send'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
86:in `const_missing'
C:/redmine-0.8.3/app/models/project.rb:23
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_re
quire'
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:5
10:in `require'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:3
55:in `new_constants_in'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:5
10:in `require'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
02:in `require_or_load'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:2
61:in `load_missing_constant'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
68:in `const_missing'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
80:in `const_missing'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
86:in `send'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
86:in `const_missing'
C:/redmine-0.8.3/app/models/query.rb:96
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_re
quire'
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:5
10:in `require'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:3
55:in `new_constants_in'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:5
10:in `require'
C:/redmine-0.8.3/vendor/plugins/Ubik-redmine_issues_group/init.rb:2:in `evaluate
_init_rb'
C:/redmine-0.8.3/vendor/rails/railties/lib/rails/plugin.rb:95:in `evaluate_init_
rb'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/core_ext/kernel/r
eporting.rb:11:in `silence_warnings'
C:/redmine-0.8.3/vendor/rails/railties/lib/rails/plugin.rb:91:in `evaluate_init_
rb'
C:/redmine-0.8.3/vendor/rails/railties/lib/rails/plugin.rb:44:in `load'
C:/redmine-0.8.3/config/../vendor/plugins/engines/lib/engines/plugin.rb:77:in `l
oad'
C:/redmine-0.8.3/vendor/rails/railties/lib/rails/plugin/loader.rb:33:in `load_pl
ugins'
C:/redmine-0.8.3/vendor/rails/railties/lib/rails/plugin/loader.rb:32:in `each'
C:/redmine-0.8.3/vendor/rails/railties/lib/rails/plugin/loader.rb:32:in `load_pl
ugins'
C:/redmine-0.8.3/vendor/rails/railties/lib/initializer.rb:292:in `load_plugins'
C:/redmine-0.8.3/vendor/rails/railties/lib/initializer.rb:142:in `process'
C:/redmine-0.8.3/vendor/rails/railties/lib/initializer.rb:97:in `send'
C:/redmine-0.8.3/vendor/rails/railties/lib/initializer.rb:97:in `run'
C:/redmine-0.8.3/config/environment.rb:20
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_re
quire'
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:5
10:in `require'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:3
55:in `new_constants_in'
C:/redmine-0.8.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:5
10:in `require'
C:/redmine-0.8.3/vendor/rails/railties/lib/tasks/misc.rake:3
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in `invoke_with_call_c
hain'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_c
hain'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:518:in `invoke_prerequisit
es'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `send'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:515:in `invoke_prerequisit
es'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:507:in `invoke_with_call_c
hain'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_c
hain'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in `invoke_task'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exceptio
n_handling'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in `top_level'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exceptio
n_handling'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31
C:/Ruby/bin/rake:19:in `load'
C:/Ruby/bin/rake:19

Does this mean anything to you?

Many thanks

Andy

RE: Writing plugins or altering source code??? - Added by Patrick Desmarais over 15 years ago

Hey Andy,

For the Summary of all issues, are you talking about a list of ALL issues for ALL projects?

If so, you can access /issues from the root of redmine to see that list

eg: http://www.redmine.org/issues

Hope this helps!

RE: Writing plugins or altering source code??? - Added by Andy Hazlewood over 15 years ago

Patrick,

Thanks for the reply, I was referring to a summary of all issues from all projects in the form of a summary similar to what you get with individual projects eg:-

http://www.redmine.org/projects/redmine/issues/report

We have set up Redmine with several main projects and a number of sub projects, when viewing the summary report for one of the main projects it doesn't show the issues of the sub projects (except in the sub project list)

Thanks for your advice anyway

Andy

RE: Writing plugins or altering source code??? - Added by Eric Davis over 15 years ago

Andy Hazlewood wrote:

Is writing a plugin to provide this functionality a bit ambitious for a newbie?? And is it advised to write a plugin or alter the source code?

A good way to start is to just change the core source code. Once you have that working, you can convert those modifications to a plugin. As the author of a couple dozen plugins, I can say that you can do just about anything and everything in a plugin (given enough time).

Eric

    (1-7/7)