not XML, it ends up failing. "init.rb" has a hook adding RedmineDmsf::NoParse into Rails middleware a step before content parsing occurs, and will rewrite content type on put method, within specified target area (identified in init.rb). Controller has been added to override options function (maybe removed later on).
98 lines
4.6 KiB
Ruby
98 lines
4.6 KiB
Ruby
# Redmine plugin for Document Management System "Features"
|
|
#
|
|
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
|
|
#
|
|
# 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.
|
|
|
|
RedmineApp::Application.routes.draw do
|
|
|
|
#
|
|
# dmsf controller
|
|
# /projects/<project>/dmsf
|
|
# [As this controller also processes 'folders' it maybe better to branch into a folder route rather than leaving it as is]
|
|
##
|
|
post '/projects/:id/dmsf/create', :controller => 'dmsf', :action => 'create'
|
|
post '/projects/:id/dmsf/notify/activate', :controller => 'dmsf', :action => 'notify_activate'
|
|
post '/projects/:id/dmsf/notify/deactivate', :controller => 'dmsf', :action => 'notify_deactivate'
|
|
post '/projects/:id/dmsf/delete', :controller => 'dmsf', :action => 'delete'
|
|
post '/projects/:id/dmsf/save', :controller => 'dmsf', :action => 'save'
|
|
post '/projects/:id/dmsf/save/root', :controller => 'dmsf', :action => 'save_root'
|
|
post '/projects/:id/dmsf/entries', :controller => 'dmsf', :action => 'entries_operation'
|
|
post '/projects/:id/dmsf/entries/delete', :controller => 'dmsf', :action => 'delete_entries'
|
|
post '/projects/:id/dmsf/entries/email', :controller => 'dmsf', :action => 'entries_email'
|
|
get '/projects/:id/dmsf/', :controller => 'dmsf', :action => 'show'
|
|
get '/projects/:id/dmsf/new', :controller => 'dmsf', :action => 'new'
|
|
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
|
|
##
|
|
post '/projects/:id/dmsf/state', :controller => 'dmsf_state', :action => 'user_pref_save'
|
|
|
|
|
|
#
|
|
# dmsf_upload controller
|
|
# /projects/<project>/dmsf/upload - dmsf_upload controller
|
|
##
|
|
|
|
post '/projects/:id/dmsf/upload/files', :controller => 'dmsf_upload', :action => 'upload_files'
|
|
post '/projects/:id/dmsf/upload/file', :controller => 'dmsf_upload', :action => 'upload_file'
|
|
post '/projects/:id/dmsf/upload/commit', :controller => 'dmsf_upload', :action => 'commit_files'
|
|
|
|
#
|
|
# dmsf_files controller
|
|
# /dmsf/files/<file id>
|
|
##
|
|
post '/dmsf/files/:id/notify/activate', :controller => 'dmsf_files', :action => 'notify_activate'
|
|
post '/dmsf/files/:id/notify/deactivate', :controller => 'dmsf_files', :action => 'notify_deactivate'
|
|
post '/dmsf/files/:id/lock', :controller => 'dmsf_files', :action => 'lock'
|
|
post '/dmsf/files/:id/unlock', :controller => 'dmsf_files', :action => 'unlock'
|
|
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
|
|
##
|
|
post '/dmsf/files/:id/copy/create', :controller => 'dmsf_files_copy', :action => 'create'
|
|
post '/dmsf/files/:id/copy/move', :controller => 'dmsf_files_copy', :action => 'move'
|
|
get '/dmsf/files/:id/copy', :controller => 'dmsf_files_copy', :action => 'new'
|
|
|
|
#
|
|
# folders_copy controller
|
|
# /dmsf/folders/<folder id>/copy
|
|
##
|
|
#verify :method => :post, :only => [:copy_to], :render => { :nothing => true, :status => :method_not_allowed }
|
|
post '/dmsf/folders/:id/copy/to', :controller => 'dmsf_folders_copy', :action => 'copy_to'
|
|
get '/dmsf/folders/:id/copy', :controller => 'dmsf_folders_copy', :action => 'new'
|
|
|
|
mount DAV4Rack::Handler.new(
|
|
# :root => Rails.root.to_s,
|
|
:root_uri_path => "/dmsf/webdav",
|
|
:resource_class => RedmineDmsf::Webdav::ResourceProxy,
|
|
:controller_class => RedmineDmsf::Webdav::Controller
|
|
), :at => "/dmsf/webdav"
|
|
end
|