From 8536e1ed4fb30b204a19a5c064b4a0be21752b07 Mon Sep 17 00:00:00 2001 From: Francis Charette Migneault Date: Mon, 29 Apr 2024 14:47:49 -0400 Subject: [PATCH] add html alternate link to process description (relates to https://github.com/crim-ca/weaver/issues/622) --- weaver/datatype.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/weaver/datatype.py b/weaver/datatype.py index 4971f6ee2..c812cb137 100644 --- a/weaver/datatype.py +++ b/weaver/datatype.py @@ -2405,6 +2405,13 @@ def links(self, container=None): {"href": proc_self, "rel": "self", "title": "Current process description."}, {"href": f"{proc_desc}?f=xml", "rel": "alternate", "title": "Alternate process description.", "type": ContentType.APP_XML}, + ] + if self.service: + links.append( + {"href": f"{proc_desc}?f=html", "rel": "alternate", + "title": "Alternate process description.", "type": ContentType.TEXT_HTML} + ) + links.extend([ {"href": proc_desc, "rel": "process-meta", "title": "Process definition."}, {"href": proc_exec, "rel": "http://www.opengis.net/def/rel/ogc/1.0/execute", "title": "Process execution endpoint for job submission."}, @@ -2413,7 +2420,7 @@ def links(self, container=None): {"href": jobs_list, "rel": "http://www.opengis.net/def/rel/ogc/1.0/job-list", "title": "List of job executions corresponding to this process."}, {"href": proc_list, "rel": "up", "title": "List of processes registered under the service."}, - ] + ]) if self.version: proc_tag = f"{proc_list}/{self.tag}" proc_hist = f"{proc_list}?detail=false&revisions=true&process={self.id}"