diff --git a/lib/redmine_dmsf/webdav.rb b/lib/redmine_dmsf/webdav.rb
index 26598dac..05984b5b 100644
--- a/lib/redmine_dmsf/webdav.rb
+++ b/lib/redmine_dmsf/webdav.rb
@@ -3,3 +3,5 @@ require 'redmine_dmsf/webdav/resource_proxy'
require 'redmine_dmsf/webdav/base_resource'
require 'redmine_dmsf/webdav/index_resource'
+require 'redmine_dmsf/webdav/project_resource'
+require 'redmine_dmsf/webdav/dmsf_resource'
diff --git a/lib/redmine_dmsf/webdav/base_resource.rb b/lib/redmine_dmsf/webdav/base_resource.rb
index bdfb3215..94a6748c 100644
--- a/lib/redmine_dmsf/webdav/base_resource.rb
+++ b/lib/redmine_dmsf/webdav/base_resource.rb
@@ -1,42 +1,34 @@
module RedmineDmsf
module Webdav
-
class BaseResource < DAV4Rack::Resource
DIR_FILE = "
| %s | %s | %s | %s |
"
def initialize(public_path, path, request, response, options)
super(public_path, path, request, response, options)
- pinfo = path.split('/').drop(1)
- if pinfo.length > 0
- @project = Project.find(pinfo.first)
- end
end
def accessor=(klass)
@__proxy = klass
end
- def name
- nil
- end
-
def long_name
nil
end
+ def special_type
+ nil
+ end
def html_display
@response.body = ""
- #@response.body << "HELLO WORLD
"
Confict unless collection?
- entities = children.map{|child| DIR_FILE % [child.public_path.html_safe, child.long_name || child.name, "-", child.content_type, child.last_modified]} * "\n"
- page = index_page % [ path.empty? ? "/" : path, path.empty? ? "/" : path , entities ]
- page.each_line{|l| @response.body << l}
+ entities = children.map{|child| DIR_FILE % [child.public_path.html_safe, child.long_name || child.name, "-", child.special_type || child.content_type, child.last_modified]} * "\n"
+ @response.body << index_page % [ path.empty? ? "/" : path, path.empty? ? "/" : path , entities ]
end
- def child(name)
+ def child(name, options = nil)
@__proxy.child(name)
end
@@ -68,6 +60,18 @@ table { width:100%%; }