diff --git a/_c8oProject/mobilePages/BrowseTables.yaml b/_c8oProject/mobilePages/BrowseTables.yaml index cf01e43..99c2dbe 100644 --- a/_c8oProject/mobilePages/BrowseTables.yaml +++ b/_c8oProject/mobilePages/BrowseTables.yaml @@ -473,7 +473,7 @@ title: First page directiveSource: - xmlizable: - ↑classname: com.twinsoft.convertigo.beans.ngx.components.MobileSmartSourceType - - MobileSmartSourceType: source:{"filter":"Sequence","project":"lib_BaseRow","input":"","model":{"data":[{"sequence":"lib_BaseRow.forms_ApplicationsList","marker":""}],"path":"","prefix":"","suffix":"?.array","custom":"","useCustom":false}} + - MobileSmartSourceType: source:{"filter":"Sequence","project":"lib_BaseRow","input":"","model":{"data":[{"sequence":"lib_BaseRow.formscommon_ApplicationsList","marker":""}],"path":"","prefix":"","suffix":"?.array","custom":"","useCustom":false}} ↓Accordion [ngx.components.UIDynamicElement-1667634603474]: beanData: '{"ionBean":"Accordion","Value":"source:{\"filter\":\"Iteration\",\"project\":\"lib_BaseRow\",\"input\":\"\",\"model\":{\"data\":[{\"priority\":1667635335398}],\"path\":\"?.id\",\"prefix\":\"\",\"suffix\":\"\",\"custom\":\"\",\"useCustom\":false}}"}' tagName: ion-accordion @@ -1428,7 +1428,7 @@ title: First page directiveSource: - xmlizable: - ↑classname: com.twinsoft.convertigo.beans.ngx.components.MobileSmartSourceType - - MobileSmartSourceType: source:{"filter":"Sequence","project":"lib_BaseRow","input":"","model":{"data":[{"sequence":"lib_BaseRow.FieldsList","marker":""}],"path":"?.array","prefix":"","suffix":"","custom":"","useCustom":false}} + - MobileSmartSourceType: source:{"filter":"Sequence","project":"lib_BaseRow","input":"","model":{"data":[{"sequence":"lib_BaseRow.formscommon_FieldsList","marker":""}],"path":"?.array","prefix":"","suffix":"","custom":"","useCustom":false}} ↓SelectOption [ngx.components.UIDynamicElement-1680695974741]: beanData: '{"ionBean":"SelectOption","Value":"script:column.name"}' tagName: ion-select-option @@ -1693,7 +1693,7 @@ title: First page directiveSource: - xmlizable: - ↑classname: com.twinsoft.convertigo.beans.ngx.components.MobileSmartSourceType - - MobileSmartSourceType: source:{"filter":"Sequence","project":"lib_BaseRow","input":"","model":{"data":[{"sequence":"lib_BaseRow.FieldsList","marker":""}],"path":"?.array","prefix":"","suffix":"","custom":"","useCustom":false}} + - MobileSmartSourceType: source:{"filter":"Sequence","project":"lib_BaseRow","input":"","model":{"data":[{"sequence":"lib_BaseRow.formscommon_FieldsList","marker":""}],"path":"?.array","prefix":"","suffix":"","custom":"","useCustom":false}} ↓SelectOption [ngx.components.UIDynamicElement-1680696113217]: beanData: '{"ionBean":"SelectOption","Value":"script:JSON.stringify(column)"}' tagName: ion-select-option @@ -1877,7 +1877,7 @@ title: First page directiveSource: - xmlizable: - ↑classname: com.twinsoft.convertigo.beans.ngx.components.MobileSmartSourceType - - MobileSmartSourceType: source:{"filter":"Sequence","project":"lib_BaseRow","input":"","model":{"data":[{"sequence":"lib_BaseRow.FieldsList","marker":""}],"path":"?.array","prefix":"","suffix":"","custom":"","useCustom":false}} + - MobileSmartSourceType: source:{"filter":"Sequence","project":"lib_BaseRow","input":"","model":{"data":[{"sequence":"lib_BaseRow.formscommon_FieldsList","marker":""}],"path":"?.array","prefix":"","suffix":"","custom":"","useCustom":false}} ↓tag [ngx.components.UIControlDirective-1680704190924]: directiveName: If directiveSource: @@ -2974,7 +2974,7 @@ title: First page ↓PageEvent [ngx.components.UIPageEvent-1667634909158]: viewEvent: onWillLoad ↓CallSequence [ngx.components.UIDynamicAction-1667634917133]: - beanData: '{"ionBean":"CallSequenceAction","requestable":"plain:lib_BaseRow.forms_ApplicationsList"}' + beanData: '{"ionBean":"CallSequenceAction","requestable":"plain:lib_BaseRow.formscommon_ApplicationsList"}' ↓ReadConfiguration [ngx.components.UICustomAsyncAction-1729087057370]: actionValue: - xmlizable: @@ -2986,7 +2986,9 @@ title: First page let result: any = await page.callParentFunction("getConfigurationData"); page.c8o.log.debug(''[MB] getConfigurationData: '' + result); - return JSON.parse(result); + let output = JSON.parse(result); + output.forms_config = result; + return output; } catch (e) { } @@ -3038,11 +3040,11 @@ title: First page ↓InvokeSharedAction [ngx.components.UIDynamicInvoke-1729087093168]: beanData: '{"ionBean":"InvokeAction"}' stack: lib_BaseRow.Application.NgxApp.DisplayTableColumns - ↓tableId [ngx.components.UIControlVariable-1729087093171]: + ↓forms_config [ngx.components.UIControlVariable-1729516307947]: varValue: - xmlizable: - ↑classname: com.twinsoft.convertigo.beans.ngx.components.MobileSmartSourceType - - MobileSmartSourceType: source:{"filter":"Action","project":"lib_BaseRow","input":"","model":{"data":[{"priority":1729087057370,"rootEvent":false,"pageLocals":false},{"priority":1667634909158,"rootEvent":true,"pageLocals":false},{"priority":1667634917133,"rootEvent":false,"pageLocals":false}],"path":"?.out","prefix":"","suffix":"?.table_id_int","custom":"","useCustom":false}} + - MobileSmartSourceType: source:{"filter":"Action","project":"lib_BaseRow","input":"","model":{"data":[{"priority":1729087057370,"rootEvent":false,"pageLocals":false},{"priority":1667634909158,"rootEvent":true,"pageLocals":false},{"priority":1667634917133,"rootEvent":false,"pageLocals":false}],"path":"?.out","prefix":"","suffix":"?.forms_config","custom":"","useCustom":false}} ↓SetLocal [ngx.components.UIDynamicAction-1729087093174]: beanData: | '{ diff --git a/_c8oProject/mobileSharedActions/DisplayTableColumns.yaml b/_c8oProject/mobileSharedActions/DisplayTableColumns.yaml index b548dd9..090e1c1 100644 --- a/_c8oProject/mobileSharedActions/DisplayTableColumns.yaml +++ b/_c8oProject/mobileSharedActions/DisplayTableColumns.yaml @@ -1,11 +1,5 @@ ↓CallSequence [ngx.components.UIDynamicAction-1727686162011]: - beanData: '{"ionBean":"CallSequenceAction","requestable":"plain:lib_BaseRow.FieldsList"}' - ↓table_id [ngx.components.UIControlVariable-1727686162014]: - comment: table_id - varValue: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.ngx.components.MobileSmartSourceType - - MobileSmartSourceType: script:params.tableId + beanData: '{"ionBean":"CallSequenceAction","requestable":"plain:lib_BaseRow.formscommon_FieldsList"}' ↓SelectAllColumnsAfterInit [ngx.components.UICustomAction-1727686162038]: actionValue: - xmlizable: @@ -127,5 +121,11 @@ varValue: - xmlizable: - ↑classname: com.twinsoft.convertigo.beans.ngx.components.MobileSmartSourceType - - MobileSmartSourceType: source:{"filter":"Sequence","project":"lib_BaseRow","input":"","model":{"data":[{"sequence":"lib_BaseRow.FieldsList","marker":""}],"path":"?.array","prefix":"","suffix":"","custom":"","useCustom":false}} -↓tableId [ngx.components.UIStackVariable-1727686198206]: \ No newline at end of file + - MobileSmartSourceType: source:{"filter":"Sequence","project":"lib_BaseRow","input":"","model":{"data":[{"sequence":"lib_BaseRow.formscommon_FieldsList","marker":""}],"path":"?.array","prefix":"","suffix":"","custom":"","useCustom":false}} + ↓forms_config [ngx.components.UIControlVariable-1729516246665]: + comment: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables + varValue: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.ngx.components.MobileSmartSourceType + - MobileSmartSourceType: script:params.forms_config +↓forms_config [ngx.components.UIStackVariable-1727686198206]: \ No newline at end of file diff --git a/_c8oProject/sequences/FieldsList.yaml b/_c8oProject/sequences/FieldsList.yaml index ff623bb..13e065b 100644 --- a/_c8oProject/sequences/FieldsList.yaml +++ b/_c8oProject/sequences/FieldsList.yaml @@ -1,4 +1,4 @@ -accessibility: Hidden +accessibility: Private comment: Lists all the fields in a baserow table responseExpiryDate: absolute,60 ↓Call_Sequence [steps.SequenceStep-1667802514338]: diff --git a/_c8oProject/sequences/TokenGetOrRefresh.yaml b/_c8oProject/sequences/TokenGetOrRefresh.yaml index 92d3f38..04ec9b0 100644 --- a/_c8oProject/sequences/TokenGetOrRefresh.yaml +++ b/_c8oProject/sequences/TokenGetOrRefresh.yaml @@ -5,24 +5,39 @@ comment: Gets a token or refresh it if the token is expired the Token will be pl 'email += ""; password += ""; + var token_owner = context.httpSession.getAttribute("token_owner"); + if (token_owner == null) { + token_owner = "owner"; + } else { + token_owner += ""; + } + if (password || email) { owner = "" + org.apache.commons.codec.digest.DigestUtils.md5Hex("owner:" + email + ":" + password); + if (token_owner != owner) { + context.httpSession.setAttribute("token_for_" + token_owner, context.httpSession.getAttribute("token")); + context.httpSession.setAttribute("token_timestamp_for_" + token_owner, context.httpSession.getAttribute("token_timestamp")); + var exToken = context.httpSession.getAttribute("token_for_" + owner); + if (exToken != null) { + var exTokenTS = context.httpSession.getAttribute("token_timestamp_for_" + owner); + context.httpSession.setAttribute("token_owner", owner); + context.httpSession.setAttribute("token", exToken); + context.httpSession.setAttribute("token_timestamp", exTokenTS); + token_owner = owner; + log.info("swap token for this account: " + email); + } else { + log.info("no previous token for this account: " + email); + } + } else { + log.info("reuse token for this account: " + email); + } } else { owner = "owner"; - }' -↓GetTokenOwnerFromSession [steps.SessionGetStep-1729093387316]: - key: token_owner - output: false -↓IfExistSameOwner [steps.IfExistStep-1729093461696]: - condition: IfExistSameOwner - sourceDefinition: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - - com.twinsoft.convertigo.beans.common.XMLVector: - - java.lang.String: - - ↑value: 1729093387316 - - java.lang.String: - - ↑value: ./expression[. = '{{{ owner }}}' or 'owner' = '{{{ owner }}}'] + log.info("use previous token"); + } + ' +↓jIf [steps.IfStep-1729518676568]: + condition: token_owner == owner || owner == "owner" ↓GetTokenFromSession [steps.SessionGetStep-1666701028415]: key: token output: false diff --git a/_c8oProject/sequences/forms_ApplicationsList.yaml b/_c8oProject/sequences/formscommon_ApplicationsList.yaml similarity index 100% rename from _c8oProject/sequences/forms_ApplicationsList.yaml rename to _c8oProject/sequences/formscommon_ApplicationsList.yaml diff --git a/_c8oProject/sequences/formscommon_FieldsList.yaml b/_c8oProject/sequences/formscommon_FieldsList.yaml new file mode 100644 index 0000000..2b90214 --- /dev/null +++ b/_c8oProject/sequences/formscommon_FieldsList.yaml @@ -0,0 +1,70 @@ +accessibility: Hidden +↓Call_Sequence2 [steps.SequenceStep-1729516092076]: + sourceSequence: lib_BaseRow.formscommon_CheckConfig + ↓forms_config [variables.StepVariable-1729516092079]: + description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables + required: true +↓IfError [steps.IfExistStep-1729516092082]: + condition: IfError + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1729516092076 + - java.lang.String: + - ↑value: ./document/error + ↓Copy [steps.XMLCopyStep-1729516092085]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1729516092076 + - java.lang.String: + - ↑value: ./document/error + ↓Return [steps.ReturnStep-1729516092088]: +↓ParseConfig [steps.SimpleStep-1729516153011]: + expression: | + jConfig = JSON.parse(forms_config); + table_id = jConfig.table_id; + +↓Call_Sequence [steps.SequenceStep-1729515103812]: + sourceSequence: lib_BaseRow.FieldsList + ↓table_id [variables.StepVariable-1729515103814]: + comment: Returns only the fields of the table related to the provided value. + description: table_id + required: true + value: +↓Copy [steps.XMLCopyStep-1729515122166]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1729515103812 + - java.lang.String: + - ↑value: ./document/* +↓forms_config [variables.RequestableVariable-1729516077599]: + comment: | + '{ + "en": { + "comment": "Choose a table in Baserow", + "displayName": "Configuration" + }, + "fr": { + "comment": "Choisissez une table dans Baserow", + "displayName": "Configuration" + }, + "es": { + "comment": "Elija una tabla en Baserow", + "displayName": "Configuración" + }, + "it": { + "comment": "Scegli una tabella in Baserow", + "displayName": "Configurazione" + } + }' + description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables + required: true + value: \ No newline at end of file diff --git a/c8oProject.yaml b/c8oProject.yaml index 0614be6..660d4a8 100644 --- a/c8oProject.yaml +++ b/c8oProject.yaml @@ -14,7 +14,7 @@ contextTimeout: ${lib_baserow.context_timout=3600} corsOrigin: =Origin httpSessionTimeout: ${lib_baserow.session_timout=3600} - version: 1.1.0-beta3 + version: 1.1.0-beta5 ↓Baserow_API_spec [connectors.HttpConnector]: 🗏 connectors/Baserow_API_spec.yaml ↓MediaConnector [connectors.HttpConnector]: 🗏 connectors/MediaConnector.yaml ↓AdminLogin [sequences.GenericSequence]: 🗏 sequences/AdminLogin.yaml @@ -28,9 +28,10 @@ ↓FieldsList [sequences.GenericSequence]: 🗏 sequences/FieldsList.yaml ↓FieldsListApiKey [sequences.GenericSequence]: 🗏 sequences/FieldsListApiKey.yaml ↓forms_AddRow [sequences.GenericSequence]: 🗏 sequences/forms_AddRow.yaml - ↓forms_ApplicationsList [sequences.GenericSequence]: 🗏 sequences/forms_ApplicationsList.yaml ↓forms_DeleteRow [sequences.GenericSequence]: 🗏 sequences/forms_DeleteRow.yaml + ↓formscommon_ApplicationsList [sequences.GenericSequence]: 🗏 sequences/formscommon_ApplicationsList.yaml ↓formscommon_CheckConfig [sequences.GenericSequence-1729157158814]: 🗏 sequences/formscommon_CheckConfig.yaml + ↓formscommon_FieldsList [sequences.GenericSequence-1729515070603]: 🗏 sequences/formscommon_FieldsList.yaml ↓formssource_GetFieldValues [sequences.GenericSequence]: 🗏 sequences/formssource_GetFieldValues.yaml ↓formssource_GetSelectData [sequences.GenericSequence]: 🗏 sequences/formssource_GetSelectData.yaml ↓formssource_GetTableData [sequences.GenericSequence]: 🗏 sequences/formssource_GetTableData.yaml diff --git a/project.md b/project.md index 46ef2b5..1e4cb88 100644 --- a/project.md +++ b/project.md @@ -14831,14 +14831,6 @@ The Identifier of the row to update. If not set, the action will add a row. If s
-- - -##  forms_ApplicationsList - -Lists all applications (databases) in baserow -
@@ -14893,6 +14885,14 @@ The Identifier of the row to delete
+ + +##  formscommon_ApplicationsList + +Lists all applications (databases) in baserow +
@@ -14923,6 +14923,36 @@ Fills the select component from data with a given configuration. The first colum
+ + +##  formscommon_FieldsList + + + +Variables + +
+
+ ++ ++name + ++comment + ++ ++ +forms_config +
+Choose a table in Baserow + +
@@ -16459,7 +16489,7 @@ comment
-### forms_ApplicationsList - -Lists all applications (databases) in baserow - ### forms_DeleteRow Deletes a data row from a Baserow table @@ -288,6 +285,10 @@ Deletes a data row from a Baserow table +### formscommon_ApplicationsList + +Lists all applications (databases) in baserow + ### formscommon_CheckConfig **variables** @@ -301,6 +302,19 @@ Deletes a data row from a Baserow table +### formscommon_FieldsList + +**variables** + + - tableId +
forms_config
diff --git a/readme.md b/readme.md index b66c57e..90dcc36 100644 --- a/readme.md +++ b/readme.md @@ -31,9 +31,10 @@ For more technical informations : [documentation](./project.md) - [FieldsList](#fieldslist) - [FieldsListApiKey](#fieldslistapikey) - [forms_AddRow](#forms_addrow) - - [forms_ApplicationsList](#forms_applicationslist) - [forms_DeleteRow](#forms_deleterow) + - [formscommon_ApplicationsList](#formscommon_applicationslist) - [formscommon_CheckConfig](#formscommon_checkconfig) + - [formscommon_FieldsList](#formscommon_fieldslist) - [formssource_GetFieldValues](#formssource_getfieldvalues) - [formssource_GetSelectData](#formssource_getselectdata) - [formssource_GetTableData](#formssource_gettabledata) @@ -260,10 +261,6 @@ Add or update a row to a Baserow table. Each column of the table must have the s +
+ ### formssource_GetFieldValues Get all possible values for a given field to feed a Select @@ -1052,7 +1066,7 @@ Describes the mobile application global properties+ +name comment ++ +forms_config Choose a table in Baserow +name comment - tableId + forms_config