The documentation from version 39.5.17 of PLANTA project can be found in the new PLANTA Online Help.

General Information on Web Interfaces

Information
  • A web interface defines the endpoint at which you can interact with PLANTA.
    • Web interfaces can be created and edited in the Web Interfaces module.
  • You can store an implementation and a web entity for each method (GET, PUT, POST, DELETE).
    • The implementation defines the behavior of the interface when it is opened.
    • A web entity
      • describes the object which interacts with the web interfaces (e.g. the values returned by a GET request).
      • has a name and points to a data table.
      • has n web attributes, each pointing to a data item from the data table.
        • Web attributes have a name and optionally a transformer class which transforms the respective value.
      • can be created and edited in the Web Entities module.

See also: Web Interface Library

Notes

From DB 39.5.14

  • In order to be able to use the interface, the PLANTA link web services must be activated and configured in the web.conf:
  • If the web services are not activated, the buttons for the execution of different actions for which the web services are required, are not displayed at some positions.
  • NEW Web interfaces use the Fully Qualified Domain Name (FQDN) as an address by default. If it is not available, the host name of the machine is used. If it is not available, the IP of the machine is used. You can define an explicit host name with the planta_link_hostname global setting.

Please pay attention to upper and lower case spelling in all fields in the web interface modules!

From DB 39.5.11

  • In order to be able to use the interface, the PLANTA link web services must be activated and configured in the web.conf:
  • If the web services are not activated, the buttons for the execution of different actions for which the web services are required, are not displayed at some positions.

Please pay attention to upper and lower case spelling in all fields in the web interface modules!

Up to DB 39.5.11

  • In order to be able to use the interface, the PLANTA link web services must be activated and configured:
  • If the web services are not activated, the buttons for the execution of different actions for which the web services are required, are not displayed at some positions.

Please pay attention to upper and lower case spelling in all fields in the web interface modules!

Methods

From DB 39.5.16

Behavior of the DefaultServiceImplementation class:
  • GET
    • Data is retrieved from the database based on the configured web entity.
    • You can restrict the selection by using a URL filter.
    • If data is found, the request is answered with status code 200 (Response). This answer contains a json formatted list of return values in its body.
    • If no data is found, the request is answered with status code 404.
  • PUT
    • Expects a json encoded dictionary in the body of the HTTP request the key of which matches the assigned web entity.
      • If an attribute is declared as a NEW Mandatory field PUT and is missing in the request, the request fails with status code 400.
      • If there is an additional attribute in the request which does not exist in the web entity as an attribute, the request fails with status code 400.
    • If the correct attributes are specified, the interface loads all lines from the data table of the web entity, restricted by the optional URL filter.
    • The respective data is updated with the transferred attributes.
    • If everything has worked out, the response is returned with status code 200.
  • POST
    • Expects a json encoded dictionary in the body of the HTTP request the key of which matches the assigned web entity.
      • If an attribute is declared as a NEW Mandatory field POST and is missing in the request, the request fails with status code 400.
      • If there is an additional attribute in the request which does not exist in the web entity as an attribute, the request fails with status code 400.
    • If you have specified the correct attributes, the interface creates a new record in the data table of the web entity.
    • The auto number DIs are filled automatically, regardless of whether they are specified as attributes in the web entity.
    • The transferred values are written in the respective columns.
    • If everything has worked out, the response is returned with status code 200.
    • In the body of the response, there is a json encoded dictionary which contains the Python IDs of the auto numbers as a key and their generated value as a value.
  • DELETE
    • Deletes all data from the table of the web entity, restricted by the optional URL filter.
    • If at least one line has been deleted, the response has status code 200.
    • If no data has been deleted, the response has status code 404.

Up to DB 39.5.16

Behavior of the DefaultServiceImplementation class:
  • GET
    • Data is retrieved from the database based on the configured web entity.
    • You can restrict the selection by using a URL filter.
    • If data is found, the request is answered with status code 200 (Response). This answer contains a json formatted list of return values in its body.
    • If no data is found, the request is answered with status code 404.
  • PUT
    • Expects a json encoded dictionary in the body of the HTTP request the key of which matches the assigned web entity.
      • If an attribute is declared as a mandatory field and is missing in the request, the request with status code 500 fails.
      • If there is an additional attribute in the request which does not exist in the web entity as an attribute, the request fails with status code 500.
    • If the correct attributes are specified, the interface loads all lines from the data table of the web entity, restricted by the optional URL filter.
    • The respective data is updated with the transferred attributes.
    • If everything has worked out, the response is returned with status code 200.
  • POST
    • Expects a json encoded dictionary in the body of the HTTP request the key of which matches the assigned web entity.
      • If an attribute is declared as a mandatory field and is missing in the request, the request with status code 500 fails.
      • If there is an additional attribute in the request which does not exist in the web entity as an attribute, the request fails with status code 500.
    • If you have specified the correct attributes, the interface creates a new record in the data table of the web entity.
    • The auto number DIs are filled automatically, regardless of whether they are specified as attributes in the web entity.
    • The transferred values are written in the respective columns.
    • If everything has worked out, the response is returned with status code 200.
    • In the body of the response, there is a json encoded dictionary which contains the Python IDs of the auto numbers as a key and their generated value as a value.
  • DELETE
    • Deletes all data from the table of the web entity, restricted by the optional URL filter.
    • If at least one line has been deleted, the response has status code 200.
    • If no data has been deleted, the response has status code 404.

See also: Web Interface Workflows: GET, PUT, POST, DELETE

         PLANTA project









 
  • Suche in Topic-Namen

  • Suche in Topic-Inhalten
This site is powered by the TWiki collaboration platform Powered by Perl