Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
protogrid:json_api_database_views [2021-12-02 13:52] – [Views of Dedicated Search Dialog Boxes] druprotogrid:json_api_database_views [2023-01-10 23:16] (current) – [Standard Views Decommissioned With Version 2.6.0] dru
Line 6: Line 6:
 { {
   "errors": [],   "errors": [],
-  "protogrid_environment_version": "1.4.10", 
   "result": {   "result": {
     "rows": [     "rows": [
Line 55: Line 54:
 { {
   "errors": [],   "errors": [],
-  "protogrid_environment_version": "1.4.10", 
   "result": {   "result": {
     "next_card_key": [     "next_card_key": [
Line 87: Line 85:
 { {
     "errors": [],     "errors": [],
-    "protogrid_environment_version": "1.4.14", 
     "result": {     "result": {
         "next_card_key": [         "next_card_key": [
Line 201: Line 198:
  
 === by_sortstring_and_id === === by_sortstring_and_id ===
- 
-=== by_search_term_and_sortstring_and_id === 
-This view contains Cards for a certain search term by id. The key is composed of the search term, the Card sorting string and the Card key. Search term means a specific string, for which you want to find all Cards containing this string in the values. You may not find Cards having this string only in the labels of the fields. Example: 
-<code javascript > 
-["behavior", "ScriptLibrary:Server-ScriptLibrary Next Steps", "1475e62a-47d7-4a29-98c2-c89f50edd497"] 
-</code> 
-The value is null. 
- 
-**Be aware**: The search only goes over values stored in this Card. This may differ from the visual representation Card. For example when Card A references another Card, you see the Shortname of the referenced Card (say "wishes an offer") in the corresponding relation field. Nevertheless, the Card only stores the Card key of the related Card (say "c18bc1c2-5499-49cc-90e0-f06b4af1474f"), therefore you will not find Card A when searching for Cards containing "wishes". 
- 
-Example request to find all cards containing the word "behavior": 
-<code> 
-https://example.protogrid.com/api/v2/apps/produktekatalog/views/by_search_term_and_sortstring_and_id?start_key=["behavior", null, null]&end_key=["behavior", {}, {}] 
-</code> 
- 
-Example response: 
-<code javascript > 
-{ 
-    "errors": [], 
-    "protogrid_environment_version": "1.4.14", 
-    "result": { 
-        "next_card_key": [ 
-            "behavior", 
-            "ScriptLibrary:Server-ScriptLibrary Products", 
-            "ba9859e1-68ad-4004-b8e0-c4f0812edf20" 
-        ], 
-        "rows": [ 
-            { 
-                "key": [ 
-                    "behavior", 
-                    "ScriptLibrary:Server-ScriptLibrary Next Steps", 
-                    "1475e62a-47d7-4a29-98c2-c89f50edd497" 
-                ], 
-                "value": null 
-            }, 
-            { 
-                "key": [ 
-                    "behavior", 
-                    "ScriptLibrary:Server-ScriptLibrary Next Steps", 
-                    "1475e62a-47d7-4a29-98c2-c89f50edd497" 
-                ], 
-                "value": null 
-            }, 
-            { 
-                "key": [ 
-                    "behavior", 
-                    "ScriptLibrary:Server-ScriptLibrary Products", 
-                    "ba9859e1-68ad-4004-b8e0-c4f0812edf20" 
-                ], 
-                "value": null 
-            }, 
-            ... 
-        ] 
-    } 
-} 
-</code> 
- 
-You might have duplicates in the code due to several occurrences of the same search term on the same Card. 
  
 === by_design_element_and_sortstring_and_id === === by_design_element_and_sortstring_and_id ===
Line 271: Line 210:
 Example request to get all Cards, where the name (in my example having with fieldkey "816950eb-1b70-41e2-89f5-5400f9636345") starts with "n" or "o": Example request to get all Cards, where the name (in my example having with fieldkey "816950eb-1b70-41e2-89f5-5400f9636345") starts with "n" or "o":
 <code> <code>
-https://example.protogrid.com/api/v2/apps/produktekatalog/views/by_design_element_and_value_and_sortstring_and_id?start_key=["816950eb-1b70-41e2-89f5-5400f9636345", "n", null, null]&end_key=["816950eb-1b70-41e2-89f5-5400f9636345", "m", {}, {}]+https://example.protogrid.com/api/v2/apps/produktekatalog/views/by_design_element_and_value_and_sortstring_and_id?start_key=["816950eb-1b70-41e2-89f5-5400f9636345","n",null,null]&end_key=["816950eb-1b70-41e2-89f5-5400f9636345","m",{},{}]
 </code> </code>
  
Line 278: Line 217:
 { {
     "errors": [],     "errors": [],
-    "protogrid_environment_version": "1.4.14", 
     "result": {     "result": {
         "rows": [         "rows": [
Line 311: Line 249:
 Example Request to get all Cards belonging to the Proto with key "12532072-0d76-4457-8cf8-7847d0470738": Example Request to get all Cards belonging to the Proto with key "12532072-0d76-4457-8cf8-7847d0470738":
 <code> <code>
-https://example.protogrid.com/api/v2/apps/produktekatalog/views/by_proto_and_sortstring_and_id?start_key=["12532072-0d76-4457-8cf8-7847d0470738", null, null]&end_key=["12532072-0d76-4457-8cf8-7847d0470738", {}, {}]+https://example.protogrid.com/api/v2/apps/produktekatalog/views/by_proto_and_sortstring_and_id?start_key=["12532072-0d76-4457-8cf8-7847d0470738",null,null]&end_key=["12532072-0d76-4457-8cf8-7847d0470738",{},{}]
 </code> </code>
  
Line 320: Line 258:
 { {
     "errors": [],     "errors": [],
-    "protogrid_environment_version": "1.4.14", 
     "result": {     "result": {
         "rows": [         "rows": [
Line 336: Line 273:
 } }
 </code> </code>
- 
-=== by_proto_and_search_term_and_sortstring_and_id === 
-This view contains all non-deleted and non-hidden Cards by proto and searchterm (see also [[#by_search_term_and_sortstring_and_id|by_search_term_and_sortstring_and_id]]. Therefore the key is composed of the Proto key, the searchterm, the Card sorting string and the Card key. Example: 
-<code> 
-["9c2bdd7d-05bd-4d16-8339-11116e737b3a", "wants", "Priscilla Molesworth - wishes an offer - Luxor 600t", "21f28df9-b0fd-431d-a773-5c6f58ff94a2"] 
-</code> 
- 
-Example Request to get all Cards of Proto "9c2bdd7d-05bd-4d16-8339-11116e737b3a" containing the string "wants": 
-<code> 
-https://example.protogrid.com/api/v2/apps/produktekatalog/views/by_proto_and_search_term_and_sortstring_and_id?start_key=["9c2bdd7d-05bd-4d16-8339-11116e737b3a", "wants", null, null]&end_key=["9c2bdd7d-05bd-4d16-8339-11116e737b3a", "wants", {}, {}] 
-</code> 
- 
-Example response: 
-<code javascript > 
-{ 
-    "errors": [], 
-    "protogrid_environment_version": "1.4.14", 
-    "result": { 
-        "rows": [ 
-            { 
-                "key": [ 
-                    "9c2bdd7d-05bd-4d16-8339-11116e737b3a", 
-                    "wants", 
-                    "Priscilla Molesworth - wishes an offer - Luxor 600t", 
-                    "21f28df9-b0fd-431d-a773-5c6f58ff94a2" 
-                ], 
-                "value": null 
-            }, 
-            ... 
-        ] 
-    } 
-} 
-</code> 
- 
  
 === by_proto_and_design_element_and_sortstring_and_id === === by_proto_and_design_element_and_sortstring_and_id ===
Line 382: Line 285:
 Example Request to find all Cards based on Proto "12532072-0d76-4457-8cf8-7847d0470738" whos price ("ed2c109d-a825-4b97-a0bb-31c13185408d") lies between 400 and 500: Example Request to find all Cards based on Proto "12532072-0d76-4457-8cf8-7847d0470738" whos price ("ed2c109d-a825-4b97-a0bb-31c13185408d") lies between 400 and 500:
 <code> <code>
-https://example.protogrid.com/api/v2/apps/produktekatalog/views/by_proto_and_design_element_and_value_and_sortstring_and_id?start_key=["12532072-0d76-4457-8cf8-7847d0470738","ed2c109d-a825-4b97-a0bb-31c13185408d", "400", null, null]&end_key=["12532072-0d76-4457-8cf8-7847d0470738", "ed2c109d-a825-4b97-a0bb-31c13185408d", "500", {}, {}]+https://example.protogrid.com/api/v2/apps/produktekatalog/views/by_proto_and_design_element_and_value_and_sortstring_and_id?start_key=["12532072-0d76-4457-8cf8-7847d0470738","ed2c109d-a825-4b97-a0bb-31c13185408d","400",null,null]&end_key=["12532072-0d76-4457-8cf8-7847d0470738","ed2c109d-a825-4b97-a0bb-31c13185408d","500",{},{}]
 </code> </code>
  
Line 389: Line 292:
 { {
     "errors": [],     "errors": [],
-    "protogrid_environment_version": "2.0beta7", 
     "result": {     "result": {
         "rows": [         "rows": [
Line 421: Line 323:
 === deleted_by_sortstring_and_id === === deleted_by_sortstring_and_id ===
 This view contains the IDs of all the deleted Cards as keys. The value is null. The request and response are analog to view [[#by_sortstring_and_id|"by_sortstring_and_id"]]. This view contains the IDs of all the deleted Cards as keys. The value is null. The request and response are analog to view [[#by_sortstring_and_id|"by_sortstring_and_id"]].
- 
-=== deleted_by_search_term_and_sortstring_and_id === 
-This view contains all deleted Cards for a certain search term by id. The value is null. The request and response are analog to view [[#by_search_term_and_sortstring_and_id|"by_search_term_and_sortstring_and_id"]]. 
  
 === deleted_by_design_element_and_sortstring_and_id === === deleted_by_design_element_and_sortstring_and_id ===
Line 445: Line 344:
 { {
     "errors": [],     "errors": [],
-    "protogrid_environment_version": "1.4.15", 
     "result": {     "result": {
         "rows": [         "rows": [
Line 501: Line 399:
 Example request to find all Cards relating to the (Related) Card with key "626f04f7-179d-40d7-99f0-9e54343abf98": Example request to find all Cards relating to the (Related) Card with key "626f04f7-179d-40d7-99f0-9e54343abf98":
 <code> <code>
-https://example.protogrid.com/api/v2/apps/produktekatalog/views/relating_cards_by_related_key_and_id?start_key=["626f04f7-179d-40d7-99f0-9e54343abf98", null]&end_key=["626f04f7-179d-40d7-99f0-9e54343abf98", {}]+https://example.protogrid.com/api/v2/apps/produktekatalog/views/relating_cards_by_related_key_and_id?start_key=["626f04f7-179d-40d7-99f0-9e54343abf98",null]&end_key=["626f04f7-179d-40d7-99f0-9e54343abf98",{}]
 </code> </code>
  
Line 508: Line 406:
 { {
     "errors": [],     "errors": [],
-    "protogrid_environment_version": "1.4.15", 
     "result": {     "result": {
         "rows": [         "rows": [
Line 565: Line 462:
 { {
     "errors": [],     "errors": [],
-    "protogrid_environment_version": "1.4.15", 
     "result": {     "result": {
         "rows": [         "rows": [
Line 611: Line 507:
 } }
 </code> </code>
- 
  
 === shortname_objects_by_id === === shortname_objects_by_id ===
Line 625: Line 520:
 { {
     "errors": [],     "errors": [],
-    "protogrid_environment_version": "1.4.15", 
     "result": {     "result": {
         "rows": [         "rows": [
Line 642: Line 536:
 </code> </code>
  
 +===== Views of Dedicated Search Dialog Boxes =====
 +It is also possible to access the views of dedicated [[protogrid:TableView#Search Dialog Boxes|Search Dialog Box]] from the JSON API. Just use the Card ID of the Search Dialog Box as view name.
 +
 +Hint: For straight forward API usage in most cases it is recommended to use Search Dialog Boxes in "Simple Keys in JSON API only" display mode.
 +
 +Please note that Datetime Fields in Dedicated Search Boxes are indexed slightly differently than in normal views: If the date-time value is configured as a fixed filter field, the time component will always be set to 0 (example: "2021-11-11T00:00:00.000Z"). If the date-time value is configured as a sort field or filter field with range (greater/less than option enabled), the time portion is left as it is (example: "2021-11-11T22:22:00.000Z").
 +
 +Example Request:
 +<code>
 +https://example.protogrid.com/api/v2/apps/produktekatalog/views/869a18bf-2fb6-4d6d-afe4-3b6283f35ba3
 +</code>
 +
 +The key depends on the individually configured Filter Fields for the acessed Search Dialog Box.
 +
 +===== Change Log =====
 ==== Standard Views Decommissioned With Version 2.1.5 ==== ==== Standard Views Decommissioned With Version 2.1.5 ====
   * by_id_and_value   * by_id_and_value
Line 682: Line 591:
   * all_connectors_by_url_name   * all_connectors_by_url_name
  
 +==== Adjustments to Views With Version 2.2.2 ====
 +  - All views: If a view is requested with the "descending" parameter set to true "start_key" and "end_key" must now be exchanged.
 +  - All views: All string values as well as sortstrings are now cut off after 300 characters.
 +  - All views: The separator between human readable values and keys is now "\u0009" instead of "\u9999".
 +  - All views: The second last column "sortstring" is now indexed in a shorter manner: "<SORTSTRING>" instead of "<PROTO KEY>\u9999<SORTSTRING>\u9999<CARD KEY>"
 +  - Dedicated Search Boxes: Now all filters must be set. An empty filter field in a Search Dialog Boxes now means a filter for those Cards where the target field is also empty.
 +  - Dedicated Search Boxes: Datetime Fields in Dedicated Search Boxes are now indexed slightly differently than in normal views: If the date-time value is configured as a fixed filter field, the time component will always be set to 0 (example: “2021-11-11T00:00:00.000Z”). If the date-time value is configured as a sort field or filter field with range (greater/less than option enabled), the time portion is left as it is (example: “2021-11-11T22:22:00.000Z”).
 +  - Dedicated Search Boxes with "sortable" display mode: Columns are now indexed in a shorter manner:
 +    * For Relation/Tag Field values: "< SORTSTRING >\u0009<KEY>" instead of "<SORTSTRING>\u9999<KEY>\u9999<KEY>"
 +    * For other field values: "<VALUE>" instead of "\u9999<VALUE>\u9999<VALUE>"
 +    * Note: It is anyway recommended to use Search Dialog Boxes with display mode “Simple Keys in JSON API only” (i. e. non-sortable).
 +  - In views "by_design_element_and_sortstring_and_id", "by_proto_and_design_element_and_sortstring_and_id" and "deleted_by_design_element_and_sortstring_and_id" the design element's sortstrings are now indexed in a shorter manner:
 +    * For Relation/Tag Field values: "< SORTSTRING >\u0009<KEY>" instead of "<SORTSTRING>\u9999<KEY>\u9999<KEY>"
 +    * For other field values: "<VALUE>" instead of "\u9999<VALUE>\u9999<VALUE>"
 +    * Note: If you don't explicitly need sorting by design element value is anyway recommended to use the views "by_design_element_and_value_and_sortstring_and_id", by_proto_and_design_element_and_value_and_sortstring_and_id"" or "deleted_by_design_element_and_value_and_sortstring_and_id".
 +  - In views "by_design_element_and_sortstring_and_id", "by_proto_and_design_element_and_sortstring_and_id" and "deleted_by_design_element_and_sortstring_and_id" there is a new column for the Card's sortstring after the design element's sortstring. Example:
 +    * View columns of "by_design_element_and_sortstring_and_id" before: ["816950eb-1b70-41e2-89f5-5400f9636345", "nightTable 2.0", "9a5f37ab-30a7-4c91-b99f-f573a1c7d1b9"]
 +    * View columns of by_design_element_and_sortstring_and_id"" now: ["816950eb-1b70-41e2-89f5-5400f9636345", "nightTable 2.0", "nightTable 2.0 - furniture", "9a5f37ab-30a7-4c91-b99f-f573a1c7d1b9"]
  
-====Views of Dedicated Search Dialog Boxes ===== +==== Standard Views Decommissioned With Version 2.6.0 ==== 
-It is also possible to access the views of dedicated [[protogrid:TableView#Search Dialog Boxes|Search Dialog Box]] from the JSON API. Just use the Card ID of the Search Dialog Box as view name. +  * by_search_term_and_sortstring_and_id 
- +  * by_proto_and_search_term_and_sortstring_and_id 
-Hint: For straight forward API usage in most cases it is recommended to use Search Dialog Boxes in "Simple Keys in JSON API only" display mode. +  * deleted_by_search_term_and_sortstring_and_id 
- +  * navroot_candidates_by_sortstring_and_id 
-Please note that Datetime Fields in Dedicated Search Boxes are indexed slightly differently than in normal views: If the date-time value is configured as a filter field, the time component will always be set to 0 (example: "2021-11-11T00:00:00.000Z"). If the date-time value is configured as a sort field, the time portion is left as it is (example: "2021-11-11T22:22:00.000Z"). +  * navroot_candidates_by_search_term_and_sortstring_and_id 
- +  * data_protos_by_sortstring_and_id 
-Example Request: +  * data_protos_by_search_term_and_sortstring_and_id
-<code> +
-https://example.protogrid.com/api/v2/apps/produktekatalog/views/869a18bf-2fb6-4d6d-afe4-3b6283f35ba3 +
-</code> +
- +
-The key depends on the individually configured Filter Fields for the acessed Search Dialog Box.+
Print/export