Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
protogrid:json_api_database_views [2017-12-15 11:29] – 46.140.51.3 | protogrid:json_api_database_views [2023-01-10 23:16] (current) – [Standard Views Decommissioned With Version 2.6.0] dru | ||
---|---|---|---|
Line 3: | Line 3: | ||
A Database View can be seen as a table with two columns. The first column is called ' | A Database View can be seen as a table with two columns. The first column is called ' | ||
- | < | + | < |
{ | { | ||
" | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 14: | Line 13: | ||
" | " | ||
], | ], | ||
- | " | ||
" | " | ||
}, | }, | ||
Line 22: | Line 20: | ||
" | " | ||
], | ], | ||
- | " | ||
" | " | ||
}, | }, | ||
Line 30: | Line 27: | ||
" | " | ||
], | ], | ||
- | " | ||
" | " | ||
} | } | ||
Line 40: | Line 36: | ||
For details about listings / views and how to request it, please see section about view [[protogrid: | For details about listings / views and how to request it, please see section about view [[protogrid: | ||
- | ===== all_by_id | + | For newcomers: In 90% of use cases, the [[# |
+ | |||
+ | ===== Protogrid Standard Views ===== | ||
+ | |||
+ | ==== Simple Overall Views ==== | ||
+ | |||
+ | === all_by_id | ||
This view basically lists all the ids of all the Cards. The row values are null (i.e. unused). The result is paged, which means that you might need several requests to load all the ids. To load the next page, you can use the " | This view basically lists all the ids of all the Cards. The row values are null (i.e. unused). The result is paged, which means that you might need several requests to load all the ids. To load the next page, you can use the " | ||
Line 49: | Line 51: | ||
Example respond: | Example respond: | ||
- | < | + | < |
{ | { | ||
" | " | ||
- | " | ||
" | " | ||
" | " | ||
- | | + | |
], | ], | ||
" | " | ||
- | | + | |
- | " | + | " |
- | " | + | " |
- | ], | + | ], |
- | " | + | " |
- | | + | |
}, | }, | ||
... | ... | ||
- | | + | |
- | } | + | |
} | } | ||
+ | } | ||
</ | </ | ||
+ | |||
+ | === by_id === | ||
+ | This View contains all non-deleted and non-hidden Card IDs as keys. The value is null. This gives you fast access to all the Card IDs in your Application. This can be useful for example when doing some kind of synchronization and checking for new documents. | ||
- | + | Example request to get all IDs with the Cards content | |
- | ===== by_id_and_value ===== | + | |
- | This view contains | + | |
- | + | ||
- | **Be aware**: This is one of the very few views, where the key is **NOT** surrounded by "[ ... ]"! | + | |
- | + | ||
- | Example Request to get the cards with the IDs "4bcbdb7f-89c3-4640-b04e-3bd468df7c57", | + | |
< | < | ||
- | https:// | + | https:// |
</ | </ | ||
- | Example respond: | + | Please note that the " |
- | < | + | |
+ | Example respond | ||
+ | < | ||
{ | { | ||
" | " | ||
- | " | ||
" | " | ||
+ | " | ||
+ | "&& | ||
+ | ], | ||
" | " | ||
{ | { | ||
- | "key": | + | "doc": |
- | "shortname": "CWH ONE", | + | "_id": "&& |
- | " | + | "_rev": "36-511c0128517aac0c5f4d3dbc22d6451a", |
- | "_id": "4bcbdb7f-89c3-4640-b04e-3bd468df7c57", | + | "definition_type": "Menu", |
- | "_rev": "7-a9637cc70544647e5c3b62135b70800f", | + | |
" | " | ||
- | "12532072-0d76-4457-8cf8-7847d0470738": { | + | "&& |
" | " | ||
- | | + | " |
- | | + | |
}, | }, | ||
" | " | ||
- | "de": "Proto:Produkt", | + | "en": "Menu:Administration" |
- | " | + | } |
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
} | } | ||
}, | }, | ||
Line 111: | Line 118: | ||
" | " | ||
{ | { | ||
- | "definition_key": "d518ee80-49b7-49bb-b6c8-fe8ced9c57f6", | + | "disable_label": |
- | " | + | |
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
}, | }, | ||
- | | + | |
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | "&& | ||
+ | "&& | ||
+ | "&& | ||
+ | "&& | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | " | ||
+ | } | ||
], | ], | ||
" | " | ||
- | " | + | |
+ | | ||
" | " | ||
{ | { | ||
- | " | + | " |
" | " | ||
}, | }, | ||
... | ... | ||
], | ], | ||
- | " | ||
" | " | ||
- | " | + | " |
- | } | + | " |
+ | " | ||
+ | }, | ||
+ | " | ||
+ | "&& | ||
+ | ], | ||
+ | " | ||
}, | }, | ||
- | { | + | ... |
- | " | + | |
- | ... | + | |
- | }, | + | |
- | { | + | |
- | " | + | |
- | | + | |
- | }, | + | |
- | { | + | |
- | " | + | |
- | ... | + | |
- | } | + | |
] | ] | ||
} | } | ||
Line 147: | Line 195: | ||
</ | </ | ||
+ | ==== Overall Views With Filtering/ | ||
+ | === by_sortstring_and_id === | ||
- | ===== all_protos_by_id | + | === by_design_element_and_sortstring_and_id |
- | This view contains all Protos by id. The value contains shortname and a list of design_elements. | + | |
- | Example request to get the first 5 protos: | + | === by_design_element_and_value_and_sortstring_and_id === |
+ | This view contains all non-deleted and non-hidden Cards by design_element, | ||
< | < | ||
- | https:// | + | [" |
</ | </ | ||
+ | The value is null. | ||
- | Example | + | Example |
- | < | + | <code> |
+ | https:// | ||
+ | </ | ||
+ | |||
+ | Example response: | ||
+ | <code javascript | ||
{ | { | ||
" | " | ||
- | " | ||
" | " | ||
- | " | ||
" | " | ||
{ | { | ||
- | " | + | " |
- | "shortname": | + | "816950eb-1b70-41e2-89f5-5400f9636345", |
- | " | + | "night knight PRO", |
- | "design_elements": | + | "night knight PRO", |
- | "name", | + | "9a5f37ab-30a7-4c91-b99f-f573a1c7d1b9" |
- | "plural_name", | + | ], |
- | "theme_color", | + | "value": |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | | + | |
- | "shortname": | + | |
- | " | + | |
- | } | + | |
- | } | + | |
}, | }, | ||
- | ... | + | |
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | " | ||
+ | } | ||
] | ] | ||
} | } | ||
} | } | ||
</ | </ | ||
- | |||
- | ===== by_id ===== | ||
- | This View contains all non-deleted and non-hidden Card IDs as keys. The value is null. | ||
- | $$$ usecase | + | ==== Proto Specific Views ==== |
- | $$$ example based on usecase | + | |
+ | === by_proto_and_sortstring_and_id ==== | ||
+ | This view contains all non-deleted and non-hidden Cards with corresponding Proto by id. The key is composed of the Proto key, the Card sorting string and the Card key. The value is null. This view can be used to get all Cards belonging to a special Proto given the Proto key. | ||
- | ===== by_id_and_value ===== | + | Example Request to get all Cards belonging |
- | This view contains | + | |
- | + | ||
- | **Be aware**: This is one of the very few views, where the key is **NOT** surrounded by "[ ... ]"! | + | |
- | + | ||
- | Example request to get the Cards whose ID is within the range " | + | |
< | < | ||
- | https:// | + | https:// |
</ | </ | ||
- | Example respond | + | We use " |
- | < | + | |
+ | Example respond: | ||
+ | < | ||
{ | { | ||
" | " | ||
- | " | ||
" | " | ||
" | " | ||
{ | { | ||
- | " | + | " |
- | " | + | "12532072-0d76-4457-8cf8-7847d0470738", |
- | " | + | "CWH ONE", |
- | "_id": " | + | "4bcbdb7f-89c3-4640-b04e-3bd468df7c57" |
- | "_rev": " | + | ], |
- | "denormalized": | + | " |
- | "&& | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | }, | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | }, | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | } | + | |
- | } | + | |
- | }, | + | |
- | " | + | |
- | { | + | |
- | " | + | |
- | | + | |
- | }, | + | |
- | { | + | |
- | " | + | |
- | " | + | |
- | } | + | |
- | ], | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | { | + | |
- | " | + | |
- | " | + | |
- | }, | + | |
- | { | + | |
- | " | + | |
- | " | + | |
- | }, | + | |
- | { | + | |
- | " | + | |
- | " | + | |
- | }, | + | |
- | { | + | |
- | " | + | |
- | " | + | |
- | } | + | |
- | ], | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | } | + | |
}, | }, | ||
- | | + | ... |
- | " | + | |
- | | + | |
- | } | + | |
] | ] | ||
} | } | ||
Line 295: | Line 274: | ||
</ | </ | ||
- | ===== deleted_by_id | + | === by_proto_and_design_element_and_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_proto_and_id ===== | + | === by_proto_and_design_element_and_value_and_sortstring_and_id |
- | $$$ All or non-deleted? All Cards with corresponding Proto by id. The key is composed of the Proto key and the Card key. The value is null. This view can be used to get all Cards belonging to a special Proto given the Proto key. | + | This view contains all non-deleted |
+ | < | ||
+ | [" | ||
+ | </ | ||
+ | The value is null. You typically want to use this view to query on system fields such as "&& | ||
- | Example Request to get all Cards belonging to the Proto with key " | + | Example Request to find all Cards based on Proto " |
< | < | ||
- | https:// | + | https:// |
</ | </ | ||
- | We use " | + | Example |
- | + | < | |
- | Example | + | |
- | < | + | |
{ | { | ||
" | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 318: | Line 297: | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
+ | "CWH ONE - toilet", | ||
" | " | ||
], | ], | ||
- | " | ||
" | " | ||
}, | }, | ||
- | | + | |
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | " | ||
+ | } | ||
] | ] | ||
} | } | ||
Line 329: | Line 319: | ||
</ | </ | ||
- | Out of this, you now know the Card keys of all Cards based on this Proto. To get the content of the Cards, you need to get the second part of every key, read it into an array and the request all Cards within the array using the view [[# | + | ==== Views for Deleted |
- | ===== by_proto_and_shortname_and_id ===== | + | === deleted_by_sortstring_and_id |
- | This View contains all Cards with corresponding Proto and shortname by id. This means the key is composed of the Proto key, the shortname | + | This view contains |
- | <code json> | + | |
- | ["12532072-0d76-4457-8cf8-7847d0470738", | + | |
- | </ | + | |
- | The value is null. | + | === deleted_by_design_element_and_sortstring_and_id === |
+ | This view contains all deleted Cards sorted by a certain design element. | ||
+ | === deleted_by_design_element_and_value_and_sortstring_and_id === | ||
+ | This view contains all deleted Cards by a certain Proto, design_element, | ||
+ | ==== Views for Navigation in Relational Tree (Up / Down) ==== | ||
+ | === related_keys_by_id === | ||
+ | This view contains all Cards by id. The value contains the related keys. | ||
- | ===== by_search_term_and_id ===== | + | Example request to find all Cards related to the Card " |
- | All Cards for a certain serach term by id. Value is null. | + | < |
+ | https:// | ||
+ | </ | ||
- | ===== deleted_by_search_term_and_id ===== | + | Example response: |
- | All deleted Cards for a certain serach term by id. Value is null. | + | <code javascript > |
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | " | ||
+ | [ | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | [ | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | [ | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | [ | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | [ | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | [ | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | [ | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | [ | ||
+ | " | ||
+ | "" | ||
+ | ], | ||
+ | [ | ||
+ | " | ||
+ | "" | ||
+ | ] | ||
+ | ] | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | } | ||
+ | </ | ||
- | ===== by_proto_and_search_term_and_id ===== | + | === relating_cards_by_related_key_and_id |
- | All Protos for a certain search term by id. Value is null. | + | This view contains all Relating Cards of the (Related) Card specified |
- | ===== by_design_element_and_value_and_id ===== | + | Example request to find all Cards relating to the (Related) Card with key " |
- | All Cards by design_element, | + | < |
+ | https:// | ||
+ | </ | ||
- | ===== deleted_by_design_element_and_value_and_id===== | + | Example response: |
- | All deleted Cards by design_element, date and id. Value is null. | + | <code javascript > |
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | } | ||
+ | </ | ||
- | ===== by_proto_and_design_element_and_value_and_id | + | ==== Views for Direct Human Readable Presentation |
- | All Cards by underlying Proto, design_element, | + | |
- | ===== relational_definitions_by_id_and_related_proto ===== | + | === tableview_data_by_id |
- | All relational definitions | + | This view contains all Cards contained in a tableview |
- | ===== data_protos_by_id ===== | + | Example request to get card with key " |
- | All data Protos by id. Value is null. | + | < |
+ | https:// | ||
+ | </ | ||
- | ===== data_protos_by_search_term_and_id ===== | + | Example response: |
- | All data Protos for a certain search term and by id. Value is null. | + | <code javascript > |
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | " | ||
+ | "#": | ||
+ | " | ||
+ | ], | ||
+ | "&& | ||
+ | " | ||
+ | ], | ||
+ | "&& | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | "&& | ||
+ | " | ||
+ | ], | ||
+ | "&& | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | "&& | ||
+ | "&& | ||
+ | ], | ||
+ | "&& | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | "" | ||
+ | ], | ||
+ | " | ||
+ | "" | ||
+ | ] | ||
+ | } | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | } | ||
+ | </ | ||
- | ===== datetime_field_definitions_by_id ===== | + | === shortname_objects_by_id |
- | All datetime field definitions | + | This view contains all Cards which contain shortname data by id. The value contains the shortnames by language. |
- | ===== datetime_field_definitions_by_search_term_and_id ===== | + | Example request to get the shortnames of the Card with key " |
- | All datetime field_definitions for a certain search term by id. Value is null. | + | < |
+ | https:// | ||
+ | </ | ||
- | ===== related_keys_by_id ===== | + | Example response: |
- | All Cards with related keys by id. Value contains the related keys. | + | <code javascript > |
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | } | ||
+ | </ | ||
- | ===== by_relating_key | + | ===== Views of Dedicated Search Dialog Boxes ===== |
- | All Cards with the related key by id. Value is null. | + | It is also possible to access |
- | ===== tableview_data_by_id ===== | + | Hint: For straight forward API usage in most cases it is recommended to use Search Dialog Boxes in " |
- | All Cards contained | + | |
+ | Please note that Datetime Fields | ||
+ | |||
+ | Example Request: | ||
+ | < | ||
+ | https:// | ||
+ | </ | ||
- | ===== shortname_by_language_objects_by_id ===== | + | The key depends on the individually configured Filter Fields for the acessed Search Dialog Box. |
- | All Cards which contains shortname data by id. Value contains | + | |
- | ===== sums_by_proto_and_design_element | + | ===== Change Log ===== |
- | Sums over the values of a field for all Cards of a Proto. Depending on the field type, this uses the following functions: | + | ==== Standard Views Decommissioned With Version 2.1.5 ==== |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
+ | * data_protos_by_search_term_and_id | ||
+ | * datetime_field_definitions_by_id | ||
+ | * datetime_field_definitions_by_search_term_and_id | ||
+ | * deleted_by_design_element_and_value_and_id | ||
+ | * deleted_by_id | ||
+ | * deleted_by_search_term_and_id | ||
+ | * logs_by_time_and_id | ||
+ | * navroot_candidates_by_design_element_and_value_and_id | ||
+ | * navroot_candidates_by_id | ||
+ | * navroot_candidates_by_search_term_and_id | ||
+ | * number_field_definitions_by_id | ||
+ | * number_field_definitions_by_search_term_and_id | ||
+ | * relational_definitions_by_id_and_related_proto | ||
+ | * text_field_definitions_by_id | ||
+ | * text_field_definitions_by_search_term_and_id | ||
- | ===== sums_by_proto_and_design_element_and_condition ===== | + | ==== Standard Views Decommissioned With Version 2.2.1 ==== |
- | Sums over the values of a field for all Cards of a Proto given a condition from another field. This key requires query keys with four components: | + | * by_design_element_and_value_and_id |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | Example: What is the sum over all values in the “Total” field in the Proto “Invoice”, | + | * navroot_candidates_by_design_element_and_value_and_sortstring_and_id |
+ | * sums_by_proto_and_design_element | ||
+ | * sums_by_proto_and_design_element_and_condition | ||
+ | * datetime_field_definitions_by_sortstring_and_id | ||
+ | * datetime_field_definitions_by_search_term_and_sortstring_and_id | ||
+ | * text_field_definitions_by_sortstring_and_id | ||
+ | * text_field_definitions_by_search_term_and_sortstring_and_id | ||
+ | * number_field_definitions_by_sortstring_and_id | ||
+ | * number_field_definitions_by_search_term_and_sortstring_and_id | ||
+ | * all_protos_by_id | ||
+ | * all_agents_by_id | ||
+ | * all_connectors_by_url_name | ||
- | Depending on the field type, this uses the following functions: | + | ==== Adjustments to Views With Version 2.2.2 ==== |
- | - For number fields it produces the sum of values | + | - All views: If a view is requested with the " |
- | - For text fields it produces | + | - All views: All string values as well as sortstrings are now cut off after 300 characters. |
- | - For relation fields it produces the number | + | - All views: The separator between human readable |
- | - For date/time fields it produces the number | + | - All views: The second last column " |
+ | - 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 | ||
+ | - 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: | ||
+ | - Dedicated Search Boxes with " | ||
+ | * For Relation/ | ||
+ | * For other field values: "< | ||
+ | * 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 " | ||
+ | * For Relation/Tag Field values: "< SORTSTRING > | ||
+ | * For other field values: "< | ||
+ | * Note: If you don't explicitly need sorting by design element value is anyway recommended to use the views " | ||
+ | - In views " | ||
+ | * View columns of " | ||
+ | * View columns of by_design_element_and_sortstring_and_id"" | ||
+ | ==== Standard Views Decommissioned With Version 2.6.0 ==== | ||
+ | * by_search_term_and_sortstring_and_id | ||
+ | * by_proto_and_search_term_and_sortstring_and_id | ||
+ | * deleted_by_search_term_and_sortstring_and_id | ||
+ | * navroot_candidates_by_sortstring_and_id | ||
+ | * navroot_candidates_by_search_term_and_sortstring_and_id | ||
+ | * data_protos_by_sortstring_and_id | ||
+ | * data_protos_by_search_term_and_sortstring_and_id |