Trace:
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
jvx:common:util:rest [2020/06/29 13:38] cduncan |
jvx:common:util:rest [2020/07/24 23:39] admin |
||
---|---|---|---|
Line 40: | Line 40: | ||
* [[#test_authentication|Test authentication]] | * [[#test_authentication|Test authentication]] | ||
* [[#change_password|Change password]] | * [[#change_password|Change password]] | ||
+ | * [[#check_database|Check database]] | ||
=== Test Authentication === | === Test Authentication === | ||
Line 87: | Line 88: | ||
If the password has been changed, no response is generated and the status code is 204 (SUCCESS_NO_CONTENT). | If the password has been changed, no response is generated and the status code is 204 (SUCCESS_NO_CONTENT). | ||
+ | |||
+ | === Check database === | ||
+ | |||
+ | Test URL:\\ | ||
+ | ''<nowiki>http://server:port/webapp/services/rest/</nowiki>**<fc #BF0000>APPLICATION_NAME</fc>**/_admin/**<fc #BF0000>testAuthentication</fc>**'' | ||
+ | |||
+ | == GET-Response == | ||
+ | |||
+ | If the check was successful, no response is generated and the status code is 204 (SUCCESS_NO_CONTENT). If database is not available, status code 500 (SERVER_ERROR_INTERNAL) will be returned. It's also possible that the configuration can't be found. In this case, status code 503 (SERVER_ERROR_SERVICE_UNAVAILABLE) will be returned. | ||
=== Custom Services === | === Custom Services === | ||
Line 111: | Line 121: | ||
* [[#put-request_update|Update]] | * [[#put-request_update|Update]] | ||
* [[#delete-request_delete|Delete]] | * [[#delete-request_delete|Delete]] | ||
- | * [[#options-request_meta_data|Meta Data]] | + | * [[#options-request_meta_data|Metadata]] |
==GET-Request (Select)== | ==GET-Request (Select)== | ||
Line 126: | Line 136: | ||
The query parameters can also be used to perform filtering with columns that are not PK columns. | The query parameters can also be used to perform filtering with columns that are not PK columns. | ||
- | Read more about [[https://blog.sibvisions.com/2017/10/30/jvx-rest-interface-update/|complex query parameters]]? | + | Read more about [[https://blog.sibvisions.com/2017/10/30/jvx-rest-interface-update/|complex query parameters]]. |
==GET-Response== | ==GET-Response== | ||
Line 190: | Line 200: | ||
== PUT-Request (Update) == | == PUT-Request (Update) == | ||
- | Update a requord with Primary Key: | + | Update a record with Primary Key: |
''<nowiki>http://server:port/webapp/services/rest/</nowiki>**<fc #BF0000>APPLICATION_NAME</fc>**/**<fc #BF0000>LIFECYCLE_CLASS</fc>**/data/**<fc #BF0000>STORAGE_NAME</fc>**/**<fc #BF0000>PRIMARY_KEY</fc>**'' | ''<nowiki>http://server:port/webapp/services/rest/</nowiki>**<fc #BF0000>APPLICATION_NAME</fc>**/**<fc #BF0000>LIFECYCLE_CLASS</fc>**/data/**<fc #BF0000>STORAGE_NAME</fc>**/**<fc #BF0000>PRIMARY_KEY</fc>**'' | ||
- | If the PK is composed of several columns or if the records are not to be identified via the PK, the query parameters must be used: | + | If the PK is composed of several columns, or if the records are not to be identified via the PK, the query parameters must be used: |
''<nowiki>http://server:port/webapp/services/rest/</nowiki>**<fc #BF0000>APPLICATION_NAME</fc>**/**<fc #BF0000>LIFECYCLE_CLASS</fc>**/data/**<fc #BF0000>STORAGE_NAME</fc>**?**<fc #BF0000>COLUMN=VALUE</fc>**&**<fc #BF0000>COLUMN2=VALUE2</fc>**'' | ''<nowiki>http://server:port/webapp/services/rest/</nowiki>**<fc #BF0000>APPLICATION_NAME</fc>**/**<fc #BF0000>LIFECYCLE_CLASS</fc>**/data/**<fc #BF0000>STORAGE_NAME</fc>**?**<fc #BF0000>COLUMN=VALUE</fc>**&**<fc #BF0000>COLUMN2=VALUE2</fc>**'' | ||
Line 242: | Line 252: | ||
</file> | </file> | ||
- | ==OPTIONS-Request (Meta Data)== | + | ==OPTIONS-Request (Metadata)== |
- | Request Meta Data: | + | Request Metadata: |
''<nowiki>http://server:port/webapp/services/rest/</nowiki>**<fc #BF0000>APPLICATION_NAME</fc>**/**<fc #BF0000>LIFECYCLE_CLASS</fc>**/data/**<fc #BF0000>STORAGE_NAME</fc>**'' | ''<nowiki>http://server:port/webapp/services/rest/</nowiki>**<fc #BF0000>APPLICATION_NAME</fc>**/**<fc #BF0000>LIFECYCLE_CLASS</fc>**/data/**<fc #BF0000>STORAGE_NAME</fc>**'' | ||
==OPTIONS-Response== | ==OPTIONS-Response== | ||
- | The response returns the meta data in JSON format: | + | The response returns the metadata in JSON format: |
<file json> | <file json> | ||
Line 397: | Line 407: | ||
==== Call Actions ==== | ==== Call Actions ==== | ||
- | The [[jvx:communication:calling_server_action|server-side actions]] can be called directly from the life-cycle object as well as from available business objects. It's also possible to use parameters. | + | The [[jvx:communication:calling_server_action|server-side actions]] can be called directly from the life cycle object as well as from available business objects. It's also possible to use parameters. |
* [[#get-request|Action without parameter]] | * [[#get-request|Action without parameter]] | ||
Line 510: | Line 520: | ||
For action calls, the correct data types must be used! In general, it is best to dispense with primitive data types, as parameters, and instead of using arrays, the List Interface should be used. It is also recommended to use Number for all numerical values. This avoids problems due to JSON serialization. | For action calls, the correct data types must be used! In general, it is best to dispense with primitive data types, as parameters, and instead of using arrays, the List Interface should be used. It is also recommended to use Number for all numerical values. This avoids problems due to JSON serialization. | ||
- | The life-cycle name should be the fully qualified class name, with package. If only the simple class name is used, JVx will try to find a matching class. If several classes are considered, then no class is used. You can optionally define a search path in the config.xml of the application: | + | The life cycle name should be the fully qualified class name, with package. If only the simple class name is used, JVx will try to find a matching class. If several classes are considered, then no class is used. You can optionally define a search path in the config.xml of the application: |
<file xml> | <file xml> |