输出模式插件¶
视图¶
pycsw 使输出架构达到核心标准。输出架构允许客户端请求特定格式的元数据 (ISO, Dublin Core, FGDC, NASA DIF Atom、GM03是默认设置)。
所有输出架构必须都放在 pycsw/plugins/outputschemas ) 目录中。
要求¶
pycsw/
plugins/
__init__.py # empty
outputschemas/
__init__.py # __all__ is a list of all provided outputschemas
atom.py # default
dif.py # default
fgdc.py # default
gm03.py # default
实施新的输出架构¶
创建文件 pycsw/plugins/outputschemas
,其中定义了以下内容 ︰
NAMESPACE
: the default namespace of the outputschema which will be advertisedNAMESPACE
: dict of all applicable namespaces to outputschemaXPATH_MAPPINGS
: dict of pycsw core queryables mapped to the equivalent XPath of the outputschemawrite_record
: 返回记录为lxml.etree.Element
对象记录的功能
将文件名添加到 __init__.py:__all__
。 新的输出架构就在 pycsw中。