moai.server
The Server module contains implementations
of IServer and IFeedConfig.
-
class moai.server.Server(base_url, db)
This is the default implementation of the
IServer interface.
Developers might want to subclass this, to provide custom
asset handling in their implementation.
-
add_config(config)
- Add a feedconfig object to this server
Each config will generate an OAI Feed at a
seperate url.
-
allow_download(url, config)
Returns a boolean indicating if it is okay to download an
asset or not.
By examining the url, the id of the oai record can be found, and
thus the metadata can be accessed. This metadata could have settings
to indicate that the asset is private and should not be downloaded
-
download_asset(req, url, config)
- Download an asset
-
get_config(id)
- Returns an object implementing IFeedConfig
-
handle_request(req)
-
is_asset_url(url, config)
- Returns a boolean indicating if this is a url
for downloading an asset or not
-
class moai.server.FeedConfig(id, repository_name, base_url, log, admin_emails=[], metadata_prefixes=[, 'oai_dc'], batch_size=100, content_type=None, sets_allowed=[], sets_disallowed=[], filter_sets=[], delay=0, base_asset_path=None)
The feedconfig object contains all the settings for a specific
feed. It implements the IFeedConfig interface.
-
get_asset_path(internal_id, asset)
-
get_internal_id(oai_id)
-
get_internal_set_id(oai_setspec_id)
-
get_oai_id(internal_id)
-
get_setspec_id(internal_set_id)