进程配置文件注册表

属于同一服务提供者的WPS服务通常共享相同的输入和输出。在这种情况下,每 ZCFG 文件将包含相同的元数据信息,这可能会浪费时间将它们全部写入。

ZOO-Kernel 能够处理来自的元数据继承 rev. 607 这就解决了用相同的输入和输出编写多个ZCFG的问题。注册表可以由zoo内核加载(在任何其他zcfg文件之前),并根据以下规则包含按层次结构级别组织的一组进程配置文件:

  • 概念 :层次结构中的较高级别。 概念 是包含WPS服务抽象描述的基本文本文件(请参见 the OGC definition 了解更多详细信息)。

  • 通用的 答: 通用的 配置文件可以引用 概念 .它定义没有数据格式或最大大小限制的输入和输出(参见 the OGC definition 了解更多详细信息)。

  • 实施 :一个 实施 配置文件可以从通用配置文件继承并引用概念(请参见 the OGC definition 了解更多详细信息)。它包含有关特定WPS服务的所有元数据信息(请参见 ZCFG reference 更多信息)。

两个 通用的实施 流程配置文件创建自 ZCFG 文件并根据其级别存储在注册表子目录中( 概念通用的实施

要激活注册表,必须添加 registry 关键 [main] 你的部分 main.cfg 文件,并将其值设置为用于存储配置文件zcfg文件的目录路径。请看 安装注册表浏览器 有关所需其他服务和参数的详细信息。

备注

即使概要文件注册表最初是在WPS 2.0.0中引入的,它也可以以同样的方式用于WPS 1.0.0服务。

通用流程配置文件

通用流程配置文件是位于 generic sub-directory, it defines main metadata information ,输入和输出名称,基本元数据和多重性。它可以通过定义 concept key in the main metadata information 部分。

你可以在下面找到 GO.zcfg 文件是一个典型的通用地理操作的通用过程配置文件,它采用一个inputPolygon输入参数并返回一个名为result的结果,它引用了 GOC 概念:

 1[GO]
 2 Title = Geographic Operation
 3 Abstract = Geographic Operation on exactly one input, returning one output
 4 concept = GOC
 5 level = generic
 6 statusSupported = true
 7 storeSupported = true
 8 <DataInputs>
 9  [InputPolygon]
10   Title = the geographic data
11   Abstract = the geographic data to run geographipc operation
12   minOccurs = 1
13   maxOccurs = 1
14 </DataInputs>
15 <DataOutputs>
16  [Result]
17   Title = the resulting data
18   Abstract = the resulting data after processing the operation
19 </DataOutputs>

备注

如果需要引用多个概念,应使用逗号(即concept=go,gb)分隔它们的名称。

流程实施概要

流程实现概要类似于 ZCFG file 位于 implementation sub-directory, it defines (or inherit from its parent) all the properties of a Generic Process Profile 并指定 Data Format 对于输入和输出。它可以通过定义 concept key in the main metadata information 部分。

你可以在下面找到 VectorOperation.zcfg file, a typical Process Implementation Profile for Vector Geographic Operation, it inherit from the GP generic profile

 1[VectorOperation]
 2 Title = Vector Geographic Operation
 3 Abstract = Apply a Vector Geographic Operation on a features collection and return the resulting features collection
 4 extend = GO
 5 level = profile
 6 <DataInputs>
 7  [InputPolygon]
 8   Title = the vector data
 9   Abstract = the vector data to run geographic operation
10   <ComplexData>
11    <Default>
12     mimeType = text/xml
13     encoding = UTF-8
14     schema = http://fooa/gml/3.1.0/polygon.xsd
15    </Default>
16    <Supported>
17     mimeType = application/json
18     encoding = UTF-8
19     extension = js
20    </Supported>
21 </DataInputs>
22 <DataOutputs>
23  [Result]
24   Title = the resulting data
25   Abstract = the resulting geographic data after processing the operation
26   <ComplexData>
27    <Default>
28     mimeType = text/xml
29     encoding = UTF-8
30     schema = http://fooa/gml/3.1.0/polygon.xsd
31    </Default>
32    <Supported>
33     mimeType = application/json
34     encoding = UTF-8
35     extension = js
36    </Supported>
37   </ComplexData>
38 </DataOutputs>

ZCG继承

对于服务级别的zcfg文件,可以从注册表中可用的流程实现概要文件继承元数据。和以前一样,只需添加 extend 引用要从中继承的zcfg的键和 level 取钥匙 ìmplementation `对主要元数据信息的价值。

例如,原始的 ConvexHull.zcfg 可改写为:

1[ConvexHull]
2 Title = Compute convex hull.
3 Abstract = Return a feature collection that represents the convex hull of each geometry from the input collection.
4 serviceProvider = ogr_service.zo
5 serviceType = C
6 extend = VectorOperation
7 level = implementation

现在,假设您的服务能够以kml格式返回结果,那么您可以编写以下内容:

 1[ConvexHull]
 2 Title = Compute convex hull.
 3 Abstract = Return a feature collection that represents the convex hull of each geometry from the input collection.
 4 serviceProvider = ogr_service.zo
 5 serviceType = C
 6 extend = VectorOperation
 7 level = implementation
 8 <DataOutputs>
 9  [Result]
10     <Supported>
11      mimeType = application/vnd.google-earth.kml+xml
12      encoding = utf-8
13     </Supported>
14 </DataOutputs>

安装注册表浏览器

zoo-project/zoo-services/utils/registry 您可以找到源代码和 Makefile 需要生成注册表浏览器服务提供程序。要构建和安装此服务,请使用以下命令:

cd zoo-project/zoo-services/utils/registry
make
cp cgi-env/* /usr/lib/cgi-bin

有效 href in the metadata children of a wps:Process, you have to define the registryUrl to point to the path to browse the registry. For this you have two different options, the first one is to install the GetFromRegistry ZOO-Service and to use a WPS 1.0.0 Execute request as registryUrl to dynamically generate Process ConceptGeneric Process ProfileProcess Implementation Profile .您还必须添加 registryUrl[main] 部分通知Zoo内核,它应该使用注册表浏览器创建元数据节点的href属性。因此,通过添加以下行:

registryUrl = http://localhost/cgi-bin/zoo_loader.cgi?request=Execute&service=WPS&version=1.0.0&Identifier=GetFromRegistry&RawDataOutput=Result&DataInputs=id=

第二个选项是通过运行shell命令预先生成层次结构的每个级别,然后设置 registryUrl 到URL以浏览生成的文件。在这种情况下,您还必须定义 registryExt 并将其设置为用于生成注册表缓存的文件扩展名。

在中生成缓存 /opt/zoo/registry/ ,使用以下命令:

cd /usr/lib/cgi-bin
mkdir /opt/zoo/regcache/{concept,generic,implementation}
for i in $(find /opt/zoo/registry/ -name "*.*") ;
do
    j=$(echo $i | sed "s:../registry//::g;s:.zcfg::g;s:.txt::g") ;
   if [ -z "$(echo $j | grep concept)" ];
   then
       ext="xml" ;
   else
       ext="txt";
   fi
    ./zoo_loader.cgi "request=Execute&service=wps&version=1.0.0&Identifier=GetFromRegistry&RawDataOutput=Result&DataInputs=id=$j" | grep "<" > /opt/zoo/regcache/$j.$ext;
done