class Tilia::Dav::ServerPlugin

The baseclass for all server plugins.

Plugins can modify or extend the servers behaviour.

Public Instance Methods

features() click to toggle source

This method should return a list of server-features.

This is for example 'versioning' and is added to the DAV: header in an OPTIONS response.

@return array

# File lib/tilia/dav/server_plugin.rb, line 25
def features
  []
end
http_methods(_path) click to toggle source

Use this method to tell the server this plugin defines additional HTTP methods.

This method is passed a uri. It should only return HTTP methods that are available for the specified uri.

@param string path @return array

# File lib/tilia/dav/server_plugin.rb, line 37
def http_methods(_path)
  []
end
plugin_info() click to toggle source

Returns a bunch of meta-data about the plugin.

Providing this information is optional, and is mainly displayed by the Browser plugin.

The description key in the returned array may contain html and will not be sanitized.

@return array

# File lib/tilia/dav/server_plugin.rb, line 72
def plugin_info
  {
    'name' => plugin_name,
    'description' => nil,
    'link' => nil
  }
end
plugin_name() click to toggle source

Returns a plugin name.

Using this name other plugins will be able to access other plugins using SabreDAVServer::getPlugin

@return string

# File lib/tilia/dav/server_plugin.rb, line 47
def plugin_name
  self.class.to_s
end
setup(server) click to toggle source

This initializes the plugin.

This function is called by SabreDAVServer, after addPlugin is called.

This method should set up the required event subscriptions.

@param Server server @return void

# File lib/tilia/dav/server_plugin.rb, line 16
def setup(server)
end
supported_report_set(_uri) click to toggle source

Returns a list of reports this plugin supports.

This will be used in the {DAV:}supported-report-set property. Note that you still need to subscribe to the 'report' event to actually implement them

@param string uri @return array

# File lib/tilia/dav/server_plugin.rb, line 59
def supported_report_set(_uri)
  []
end