Preparing for 1.4.1

This commit is contained in:
Daniel Munn 2012-06-15 08:09:59 +01:00
parent c76556c507
commit 493fac024e
19 changed files with 327 additions and 83 deletions

View File

@ -4,6 +4,8 @@ Redmine DMSF is Document Management System Features plugin for Redmine issue tra
It is aimed to replace current Redmine's Documents module.
Redmine DMSF now comes bundled with Webdav functionality, if switched on within administrative console - will be accessible from /dmsf/webdav.
Initial development was for Kontron AG R&D department and it is released as open source thanks to their generosity.
Project home: http://code.google.com/p/redmine-dmsf/
@ -14,10 +16,11 @@ Further information about the GPL license can be found at http://www.gnu.org/lic
== Dependencies
As of version 1.4.0 of this plugin:
As of version 1.4.1 of this plugin:
* Redmine 2.0.x
* Rails 2.3.x (Inline with Redmine installation requirement)
* Zip (Gem)
* DAV4Rack (Github Gem)
=== Fulltext search (optional)
@ -134,3 +137,12 @@ After these steps re-start your instance of Redmine.
If youve added something, why not share it. Fork the repository (github.com/danmunn/redmine_dmsf), make the changes and send a pull request to the maintainers.
Changes with tests, and full documentation are preferred.
==History
1.4.1: not yet released
New: DAV4Rack requirement added (Gemfile makes reference to github repository for latest release).
New: Webdav functionality included, additional administrative settings added
Fixed: Issue #2 - extended xapian search fixed with Rails 3 compatible code.
1.4.0: 2012-06-06
New: Redmine 2.0 or higher is required

View File

@ -1,6 +1,7 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright © 2012 Daniel Munn <dan.munn@munnster.co.uk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -37,8 +38,6 @@ RedmineApp::Application.routes.draw do
get '/projects/:id/dmsf/edit', :controller=> 'dmsf', :action => 'edit'
get '/projects/:id/dmsf/edit/root', :controller=> 'dmsf', :action => 'edit_root'
#
# dmsf_state controller
# /projects/<project>/dmsf/state
@ -66,12 +65,10 @@ RedmineApp::Application.routes.draw do
post '/dmsf/files/:id/delete', :controller => 'dmsf_files', :action => 'delete'
post '/dmsf/files/:id/revision/create', :controller => 'dmsf_files', :action => 'create_revision'
post '/dmsf/files/:id/revision/delete', :controller => 'dmsf_files', :action => 'delete_revision'
get '/dmsf/files/:id/download', :controller => 'dmsf_files', :action => 'show', :download => '' #Otherwise will not route nil download param
get '/dmsf/files/:id/download/:download', :controller => 'dmsf_files', :action => 'show'
get '/dmsf/files/:id', :controller => 'dmsf_files', :action => 'show'
#
# files_copy controller
# /dmsf/files/<file id>/copy
@ -88,8 +85,10 @@ RedmineApp::Application.routes.draw do
post '/dmsf/folders/:id/copy/to', :controller => 'dmsf_folders_copy', :action => 'copy_to'
get '/dmsf/folders/:id/copy', :controller => 'dmsf_folders_copy', :action => 'new'
#
# DAV4Rack implementation of Webdav [note: if changing path you'll need to update lib/redmine_dmsf/webdav/no_parse.rb also]
# /dmsf/webdav
mount DAV4Rack::Handler.new(
# :root => Rails.root.to_s,
:root_uri_path => "/dmsf/webdav",
:resource_class => RedmineDmsf::Webdav::ResourceProxy,
:controller_class => RedmineDmsf::Webdav::Controller

35
init.rb
View File

@ -1,6 +1,7 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -19,36 +20,13 @@
require 'redmine'
require 'redmine_dmsf'
#
# This may need to be configurable
#
Rails.configuration.middleware.insert_before(ActionDispatch::ParamsParser,
RedmineDmsf::NoParse, :urls => ['/dmsf/webdav'])
Rails.configuration.to_prepare do
unless ProjectsHelper.included_modules.include?(ProjectTabsExtended)
ProjectsHelper.send(:include, ProjectTabsExtended)
end
unless CustomFieldsHelper.included_modules.include?(CustomFieldsHelper)
CustomFieldsHelper.send(:include, RedmineDmsf::Patches::CustomFieldsHelper)
end
Project.send(:include, RedmineDmsf::Patches::ProjectPatch)
#ActiveSupport::XmlMini.backend = 'Nokogiri'
end
Redmine::Plugin.register :redmine_dmsf do
name "DMSF"
author "Vit Jonas"
author "Vit Jonas / Daniel Munn"
description "Document Management System Features"
version "1.4.0 devel"
url "http://code.google.com/p/redmine-dmsf/"
author_url "mailto:vit.jonas@gmail.com"
version "1.4.1 devel"
url "https://github.com/danmunn/redmine_dmsf"
author_url "https://code.google.com/p/redmine-dmsf/"
requires_redmine :version_or_higher => '2.0.0'
@ -57,7 +35,7 @@ Redmine::Plugin.register :redmine_dmsf do
"dmsf_max_file_upload" => "0",
"dmsf_max_file_download" => "0",
"dmsf_max_email_filesize" => "0",
"dmsf_storage_directory" => Rails.root.join('files/dmsf').to_s, #{RAILS_ROOT}/files/dmsf",
"dmsf_storage_directory" => Rails.root.join('files/dmsf').to_s,
"dmsf_zip_encoding" => "utf-8",
"dmsf_index_database" => Rails.root.join("files/dmsf_index").to_s,
"dmsf_stemming_lang" => "english",
@ -65,7 +43,6 @@ Redmine::Plugin.register :redmine_dmsf do
}
menu :project_menu, :dmsf, { :controller => "dmsf", :action => "show" }, :caption => :menu_dmsf, :before => :documents, :param => :id
#delete_menu_item :project_menu, :documents
activity_provider :dmsf_files, :class_name => "DmsfFileRevision", :default => true

View File

@ -1,8 +1,5 @@
require 'redmine_dmsf/patches/custom_fields_helper'
require 'redmine_dmsf/patches/acts_as_customizable'
require 'redmine_dmsf/patches/project_patch'
require 'redmine_dmsf/webdav'
require 'redmine_dmsf/no_parse'
reqiire 'redmine_dmsf/patches' #plugin patches
require 'redmine_dmsf/webdav' #DAV4Rack implementation
module RedmineDmsf
end

View File

@ -1,25 +0,0 @@
module RedmineDmsf
class NoParse
def initialize(app, options={})
@app = app
@urls = options[:urls]
end
def call(env)
if env['REQUEST_METHOD'] == "PUT" && env.has_key?('CONTENT_TYPE') then
if (@urls.dup.delete_if {|x| !env['PATH_INFO'].starts_with? x}.length > 0) then
logger "RedmineDmsf::NoParse prevented mime parsing for PUT #{env['PATH_INFO']}"
env['CONTENT_TYPE'] = 'text/plain'
end
end
@app.call(env)
end
private
def logger(env)
env['action_dispatch.logger'] || Logger.new($stdout)
end
end
end

View File

@ -0,0 +1,23 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
require 'redmine_dmsf/patches/custom_fields_helper'
require 'redmine_dmsf/patches/acts_as_customizable'
require 'redmine_dmsf/patches/project_patch'
require 'redmine_dmsf/patches/project_tabs_extended'

View File

@ -1,3 +1,22 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module Redmine
module Acts
module Customizable

View File

@ -14,3 +14,10 @@ module RedmineDmsf
end
end
end
#Apply patch
Rails.configuration.to_prepare do
unless CustomFieldsHelper.included_modules.include?(CustomFieldsHelper)
CustomFieldsHelper.send(:include, RedmineDmsf::Patches::CustomFieldsHelper)
end
end

View File

@ -1,3 +1,22 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require_dependency 'project'
module RedmineDmsf
module Patches
@ -19,3 +38,10 @@ module RedmineDmsf
end
end
end
#Apply patch
Rails.configuration.to_prepare do
unless Projects.included_modules.include?(RedmineDmsf::Patches::ProjectPatch)
Project.send(:include, RedmineDmsf::Patches::ProjectPatch)
end
end

View File

@ -1,6 +1,7 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -18,7 +19,9 @@
require_dependency 'projects_helper'
module ProjectTabsExtended
module RedmineDmsf
module Patches
module ProjectTabsExtended
def self.included(base)
base.extend(ClassMethods)
@ -44,4 +47,13 @@ module ProjectTabsExtended
end
end
end
end
#Apply patch
Rails.configuration.to_prepare do
unless ProjectsHelper.included_modules.include?(RedmineDmsf::Patches::ProjectTabsExtended)
ProjectsHelper.send(:include, RedmineDmsf::Patches::ProjectTabsExtended)
end
end

View File

@ -1,7 +1,28 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Load up classes that make up our webdav solution ontop
# of DAV4Rack
require 'redmine_dmsf/webdav/resource_proxy'
require 'redmine_dmsf/webdav/no_parse'
require 'redmine_dmsf/webdav/base_resource'
require 'redmine_dmsf/webdav/controller'
require 'redmine_dmsf/webdav/dmsf_resource'
require 'redmine_dmsf/webdav/download'
require 'redmine_dmsf/webdav/index_resource'
require 'redmine_dmsf/webdav/project_resource'
require 'redmine_dmsf/webdav/dmsf_resource'
require 'redmine_dmsf/webdav/resource_proxy'

View File

@ -1,3 +1,21 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module RedmineDmsf
module Webdav
class BaseResource < DAV4Rack::Resource

View File

@ -1,3 +1,21 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module RedmineDmsf
module Webdav
class Controller < DAV4Rack::Controller

View File

@ -1,3 +1,21 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'uuidtools'
module RedmineDmsf

View File

@ -1,3 +1,21 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'time'
require 'rack/utils'
require 'rack/mime'

View File

@ -1,3 +1,21 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module RedmineDmsf
module Webdav
class IndexResource < BaseResource

View File

@ -0,0 +1,50 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module RedmineDmsf
class NoParse
def initialize(app, options={})
@app = app
@urls = options[:urls]
end
def call(env)
if env['REQUEST_METHOD'] == "PUT" && env.has_key?('CONTENT_TYPE') then
if (@urls.dup.delete_if {|x| !env['PATH_INFO'].starts_with? x}.length > 0) then
logger "RedmineDmsf::NoParse prevented mime parsing for PUT #{env['PATH_INFO']}"
env['CONTENT_TYPE'] = 'text/plain'
end
end
@app.call(env)
end
private
def logger(env)
env['action_dispatch.logger'] || Logger.new($stdout)
end
end
end
# Todo:
# This should probably be configurable somehow or better have the module hunt for the correct pathing
# automatically without the need to add a "/dmsf/webdav" configuration to it, as if the route is changed
# the functonality of this patch will effectively break.
Rails.configuration.middleware.insert_before(ActionDispatch::ParamsParser,
RedmineDmsf::NoParse, :urls => ['/dmsf/webdav'])

View File

@ -1,3 +1,21 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module RedmineDmsf
module Webdav
class ProjectResource < BaseResource

View File

@ -1,3 +1,21 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module RedmineDmsf
module Webdav