Skip to content

Conversation

@neo-garaix
Copy link
Collaborator

This work will help the future revamp of the WPS module.

  • New form to indicate the WPS and Map servers URL.
  • OGC API in PHP based on the WPS Server URL
    • Processes
    • Jobs
  • Playwright CI to test API
  • ESLint CI
  • Based on Lizmap 3.9.0-rc.3 to use the api.php entrypoint
  • Added tests folder to eslint and removed wps.js from it because it is like a legacy with some problems. ( wps.js will be replaced on future PRs )

@neo-garaix neo-garaix changed the title Implementation of OGC WPS API Implementation of OGC WPS API (backend PHP) Jun 17, 2025
@neo-garaix neo-garaix force-pushed the add-ogc-wps-api-on-php branch from d2eac49 to 06dd0f2 Compare July 16, 2025 13:40
@neo-garaix
Copy link
Collaborator Author

Added 2a363f3 commit to improve the way ?map=... is implemented. We need the JS code to pass the path of the project to the WPS server. So we use the project and repository vars found in LizMap to retrieve the path in PHP without giving it to the user in JS.

@neo-garaix neo-garaix force-pushed the add-ogc-wps-api-on-php branch from 146b076 to 03b3ba5 Compare July 17, 2025 10:14
@neo-garaix neo-garaix force-pushed the add-ogc-wps-api-on-php branch from ab96438 to 3bcd208 Compare July 28, 2025 10:32
@neo-garaix neo-garaix force-pushed the add-ogc-wps-api-on-php branch from 3bcd208 to 257602d Compare July 28, 2025 10:35
@neo-garaix neo-garaix force-pushed the add-ogc-wps-api-on-php branch from 813fd59 to 00b096d Compare July 31, 2025 13:22
@neo-garaix
Copy link
Collaborator Author

neo-garaix commented Aug 27, 2025

Added filtering on "links" : ... and "map" : ... so front-end doesn't receive anymore those information. links could contain information such as server adress :

Before .../api.php/wps/processes

{
    "links": [
        {
            "href": "http://tests-wps-1:8080/processes",
            "rel": "self",
            "type": "application/json"
        }
    ],
    "processes": [
        {
            "description": "This is a test function that does stuff",
            "id": "script:testalgfactory",
            "jobControlOptions": [
                "sync-execute",
                "async-execute",
                "dismiss"
            ],
            "keywords": [],
            "links": [
                {
                    "href": "http://tests-wps-1:8080/processes/script:testalgfactory",
                    "rel": "self",
                    "title": "Process description",
                    "type": "application/json"
                }
            ],
            "metadata": [],
            "title": "test 2",
            "version": "1.0generic"
        }
    ]
}

After .../api.php/wps/processes

{
    "links": null,
    "processes": [
        {
            "description": "This is a test function that does stuff",
            "id": "script:testalgfactory",
            "jobControlOptions": [
                "sync-execute",
                "async-execute",
                "dismiss"
            ],
            "keywords": [],
            "links": null,
            "metadata": [],
            "title": "test 2",
            "version": "1.0generic"
        }
    ]
}

And map could bring the path :

Before .../api.php/wps/jobs/c19f0b00-8331-11f0-837a-010a29cfef82

{
    "created": "2025-08-27T10:36:57Z",
    "expire": "2025-08-28T10:36:59Z",
    "finished": "2025-08-27T10:36:59Z",
    "jobID": "c19f0b00-8331-11f0-837a-010a29cfef82",
    "links": [
        {
            "href": "http://tests-wps-1:8080/jobs/c19f0b00-8331-11f0-837a-010a29cfef82",
            "rel": "self",
            "title": "This document",
            "type": "application/json"
        },
        {
            "href": "http://tests-wps-1:8080/jobs/c19f0b00-8331-11f0-837a-010a29cfef82.html",
            "rel": "alternate",
            "type": "text/html"
        },
        {
            "href": "http://tests-wps-1:8080/jobs/c19f0b00-8331-11f0-837a-010a29cfef82/results",
            "rel": "http://www.opengis.net/def/rel/ogc/1.0/results",
            "title": "Job results",
            "type": "application/json"
        }
    ],
    "map": "test_france_parts/france_parts.qgs",
    "message": "Task finished",
    "processID": "model:centroides",
    "progress": 100,
    "started": "2025-08-27T10:36:59Z",
    "status": "successful",
    "type": "process",
    "updated": "2025-08-27T10:36:59Z"
}

After .../api.php/wps/jobs/c19f0b00-8331-11f0-837a-010a29cfef82

{
    "created": "2025-08-27T10:36:57Z",
    "expire": "2025-08-28T10:36:59Z",
    "finished": "2025-08-27T10:36:59Z",
    "jobID": "c19f0b00-8331-11f0-837a-010a29cfef82",
    "links": null,
    "map": null,
    "message": "Task finished",
    "processID": "model:centroides",
    "progress": 100,
    "started": "2025-08-27T10:36:59Z",
    "status": "successful",
    "type": "process",
    "updated": "2025-08-27T10:36:59Z"
}

@neo-garaix
Copy link
Collaborator Author

When a process that involves File output was executed, results were built like this :

"OUTPUT_JSON_FILE": {
        "href": "http://tests-wps:8080/jobs/e899681c-8413-11f0-b645-b5c85e486dd4/files/plot.json",
        "type": "application/json"
    }

So front-end would receive the WPS Server address. handleTypes($json) now removes this part so we can obtain JSONs like this :

"OUTPUT_JSON_FILE": {
        "href": "files/plot.json",
        "type": "application/json"
    }

Front-end doesn't receive the WPS Server address anymore. It can prepare a request to a future controller that will handle files transmitting.

@mdouchin mdouchin requested a review from rldhont August 28, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants