diff --git a/.DS_Store b/.DS_Store index e9ecb34..94a2e95 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/config/application.cfg b/config/application.cfg index 7bb891b..5c95f3e 100644 --- a/config/application.cfg +++ b/config/application.cfg @@ -3,14 +3,14 @@ # blank line above dataMapTemplatePath=/data/dataloader/templates appID=RussetAlbatross -appName=ͲҽʍքӀąէҽժ ↻օժҽ Ɠҽղҽɾąէօɾ +appName=ͲҽʍքӀąէҽ ↻օժҽ Ɠҽղҽɾąէօɾ pollingInterval=1 port=5050 responseformat=json maxtextboxrows=10 releaseID=cryptoidCalcium -releaseLevel=0 -releaseNumber=21.11.01 +releaseLevel=3 +releaseNumber=21.12.04 licName=Unlicense licLink=https://unlicense.org credentialslife=365 diff --git a/data/in/account.cfg b/data/in/account.cfg index e5bcfc5..b99ba59 100644 --- a/data/in/account.cfg +++ b/data/in/account.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Accounts +FriendlyName=Account objectname=Account endpointroot= querystring=AccountNo @@ -30,7 +30,7 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaAccount sqlSearchID=SienaReference diff --git a/data/in/accountladder.cfg b/data/in/accountladder.cfg new file mode 100644 index 0000000..4886ce3 --- /dev/null +++ b/data/in/accountladder.cfg @@ -0,0 +1,39 @@ +# What to generate +create_application=y +create_dao=y +create_datamodel=y +create_job=n +create_menu=y +create_html=y +create_adaptor=y +# actions - view/list are mandatory +can_edit=n +can_new=n +can_delete=n +can_list=y +can_save=n +can_view=y +can_export=y +# use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) +use=db +# COmmon application properties +FriendlyName=Account Ladder +objectname=AccountLadder +endpointroot= +querystring=AccountNo +queryfield=SienaReference +objectglyph=fas fa-landmark +projectrepo=github.com/mt1976/mwt-go-dev +propertiesOverride=Siena +# If automatic generation of the application is true, then the following values are used +server=eb-ldn-pc105 +port=1433 +user=rob +password=rob123 +database=ReportingDb_sal_prd_demo_sys-3 +schema=SRS +sqlTableName=sienaAccountLadder +sqlSearchID=SienaReference +#ReverseLookup=CashBalance +hasEnrichments=n +isSpecial=n \ No newline at end of file diff --git a/data/in/accounttransactions.cfg b/data/in/accounttransactions.cfg index 6a16aab..679c527 100644 --- a/data/in/accounttransactions.cfg +++ b/data/in/accounttransactions.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Account Transactions +FriendlyName=Account Transaction objectname=AccountTransaction endpointroot= querystring=AccountNo @@ -30,7 +30,7 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaAccountTransactions sqlSearchID=SienaReference diff --git a/data/in/book.cfg b/data/in/book.cfg index 91a407d..6c494df 100644 --- a/data/in/book.cfg +++ b/data/in/book.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Books +FriendlyName=Book objectname=Book endpointroot= querystring=Book @@ -30,7 +30,7 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaBook sqlSearchID=BookName diff --git a/data/in/broker.cfg b/data/in/broker.cfg index 4e8833a..0141e58 100644 --- a/data/in/broker.cfg +++ b/data/in/broker.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Brokers +FriendlyName=Broker objectname=Broker endpointroot= querystring=Code @@ -30,7 +30,7 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaBroker sqlSearchID=Code diff --git a/data/in/cacheStore.cfg b/data/in/cacheStore.cfg index 602bc3a..bf45bc7 100644 --- a/data/in/cacheStore.cfg +++ b/data/in/cacheStore.cfg @@ -16,7 +16,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Cache Contents +FriendlyName=Cache Content objectname=Cache endpointroot= querystring=ID diff --git a/data/in/centre.cfg b/data/in/centre.cfg index 0756f86..0daac16 100644 --- a/data/in/centre.cfg +++ b/data/in/centre.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Centres +FriendlyName=Centre objectname=Centre endpointroot= querystring=Code @@ -30,10 +30,13 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaCentre sqlSearchID=Code #Does this File Have Enrichments - Include Additional Columns to the LIst & Record Views hasEnrichments=y ReverseLookup=Name +offersLookup=y +LookUpID=Code +LookUpName=Name \ No newline at end of file diff --git a/data/in/cmnotes.cfg b/data/in/cmnotes.cfg index 2ee4747..a40c07f 100644 --- a/data/in/cmnotes.cfg +++ b/data/in/cmnotes.cfg @@ -17,11 +17,11 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Customer Notes +FriendlyName=Customer Note objectname=CMNotes endpointroot= querystring=ID -queryfield=noteId +queryfield=NoteId objectglyph=fas fa-poo textclass="" projectrepo=github.com/mt1976/mwt-go-dev diff --git a/data/in/counterparty.cfg b/data/in/counterparty.cfg new file mode 100644 index 0000000..3082a07 --- /dev/null +++ b/data/in/counterparty.cfg @@ -0,0 +1,40 @@ +# What to generate +create_application=y +create_dao=y +create_datamodel=y +create_job=n +create_menu=y +create_html=y +create_adaptor=y +# actions - view/list are mandatory +can_edit=y +can_new=n +can_delete=y +can_list=y +can_save=y +can_view=y +can_export=y +# use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) +use=db +# COmmon application properties +FriendlyName=Counterparty +objectname=Counterparty +endpointroot= +querystring=ID +queryfield=CompID +objectglyph=fas fa-user +projectrepo=github.com/mt1976/mwt-go-dev +propertiesOverride=Siena +# If automatic generation of the application is true, then the following values are used +server=eb-ldn-pc105 +port=1433 +user=rob +password=rob123 +database=ReportingDb_sal_prd_demo_sys-3 +schema=SRS +sqlTableName=sienaCounterparty +sqlSearchID=CompID +ReverseLookup= +offersLookup=n +LookUpID=Name +LookUpName=Name \ No newline at end of file diff --git a/data/in/counterpartyaddress.cfg b/data/in/counterpartyaddress.cfg new file mode 100644 index 0000000..20c58e3 --- /dev/null +++ b/data/in/counterpartyaddress.cfg @@ -0,0 +1,40 @@ +# What to generate +create_application=y +create_dao=y +create_datamodel=y +create_job=n +create_menu=y +create_html=y +create_adaptor=y +# actions - view/list are mandatory +can_edit=y +can_new=y +can_delete=y +can_list=y +can_save=y +can_view=y +can_export=y +# use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) +use=db +# COmmon application properties +FriendlyName=Counterparty Address +objectname=CounterpartyAddress +endpointroot= +querystring=ID +queryfield=CompID +objectglyph=fas fa-passport +projectrepo=github.com/mt1976/mwt-go-dev +propertiesOverride=Siena +# If automatic generation of the application is true, then the following values are used +server=eb-ldn-pc105 +port=1433 +user=rob +password=rob123 +database=ReportingDb_sal_prd_demo_sys-3 +schema=SRS +sqlTableName=sienaCounterpartyAddress +sqlSearchID=CompID +ReverseLookup= +offersLookup=n +LookUpID=Name +LookUpName=Name \ No newline at end of file diff --git a/data/in/counterpartycreditrating.cfg b/data/in/counterpartycreditrating.cfg new file mode 100644 index 0000000..71a480c --- /dev/null +++ b/data/in/counterpartycreditrating.cfg @@ -0,0 +1,40 @@ +# What to generate +create_application=y +create_dao=y +create_datamodel=y +create_job=n +create_menu=y +create_html=y +create_adaptor=y +# actions - view/list are mandatory +can_edit=y +can_new=y +can_delete=y +can_list=y +can_save=y +can_view=y +can_export=y +# use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) +use=db +# COmmon application properties +FriendlyName=Counterparty Credit Rating +objectname=CounterpartyCreditRating +endpointroot= +querystring=ID +queryfield=CompID +objectglyph=fas fa-passport +projectrepo=github.com/mt1976/mwt-go-dev +propertiesOverride=Siena +# If automatic generation of the application is true, then the following values are used +server=eb-ldn-pc105 +port=1433 +user=rob +password=rob123 +database=ReportingDb_sal_prd_demo_sys-3 +schema=SRS +sqlTableName=sienaCounterpartyCreditRating +sqlSearchID=CompID +ReverseLookup= +offersLookup=n +LookUpID=Name +LookUpName=Name \ No newline at end of file diff --git a/data/in/counterpartyextensions.cfg b/data/in/counterpartyextensions.cfg new file mode 100644 index 0000000..0eb0218 --- /dev/null +++ b/data/in/counterpartyextensions.cfg @@ -0,0 +1,40 @@ +# What to generate +create_application=y +create_dao=y +create_datamodel=y +create_job=n +create_menu=y +create_html=y +create_adaptor=y +# actions - view/list are mandatory +can_edit=y +can_new=y +can_delete=y +can_list=y +can_save=y +can_view=y +can_export=y +# use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) +use=db +# COmmon application properties +FriendlyName=Counterparty Extension +objectname=CounterpartyExtensions +endpointroot= +querystring=ID +queryfield=CompID +objectglyph=fas fa-passport +projectrepo=github.com/mt1976/mwt-go-dev +propertiesOverride=Siena +# If automatic generation of the application is true, then the following values are used +server=eb-ldn-pc105 +port=1433 +user=rob +password=rob123 +database=ReportingDb_sal_prd_demo_sys-3 +schema=SRS +sqlTableName=sienaCounterpartyExtensions +sqlSearchID=CompID +ReverseLookup= +offersLookup=n +LookUpID=Name +LookUpName=Name \ No newline at end of file diff --git a/data/in/counterpartygroup.cfg b/data/in/counterpartygroup.cfg index 5e7ef89..018a25c 100644 --- a/data/in/counterpartygroup.cfg +++ b/data/in/counterpartygroup.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Counterparty Groups +FriendlyName=Counterparty Group objectname=CounterpartyGroup endpointroot= querystring=Group @@ -30,7 +30,7 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaCounterpartyGroup sqlSearchID=Name diff --git a/data/in/counterpartyimport.cfg b/data/in/counterpartyimport.cfg new file mode 100644 index 0000000..94e1f09 --- /dev/null +++ b/data/in/counterpartyimport.cfg @@ -0,0 +1,40 @@ +# What to generate +create_application=y +create_dao=y +create_datamodel=y +create_job=n +create_menu=y +create_html=y +create_adaptor=y +# actions - view/list are mandatory +can_edit=y +can_new=y +can_delete=y +can_list=y +can_save=y +can_view=y +can_export=y +# use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) +use=db +# COmmon application properties +FriendlyName=Counterparty Import +objectname=CounterpartyImport +endpointroot= +querystring=ID +queryfield=CompID +objectglyph=fas fa-passport +projectrepo=github.com/mt1976/mwt-go-dev +propertiesOverride=Siena +# If automatic generation of the application is true, then the following values are used +server=eb-ldn-pc105 +port=1433 +user=rob +password=rob123 +database=ReportingDb_sal_prd_demo_sys-3 +schema=SRS +sqlTableName=sienaCounterpartyImportID +sqlSearchID=CompID +ReverseLookup= +offersLookup=n +LookUpID=Name +LookUpName=Name \ No newline at end of file diff --git a/data/in/counterpartynamelookup.cfg b/data/in/counterpartynamelookup.cfg new file mode 100644 index 0000000..311b049 --- /dev/null +++ b/data/in/counterpartynamelookup.cfg @@ -0,0 +1,40 @@ +# What to generate +create_application=y +create_dao=y +create_datamodel=y +create_job=n +create_menu=y +create_html=y +create_adaptor=n +# actions - view/list are mandatory +can_edit=n +can_new=n +can_delete=n +can_list=y +can_save=n +can_view=y +can_export=y +# use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) +use=db +# COmmon application properties +FriendlyName=Counterparty Name +objectname=CounterpartyName +endpointroot= +querystring=ID +queryfield=CompID +objectglyph=fas fa-passport +projectrepo=github.com/mt1976/mwt-go-dev +propertiesOverride=Siena +# If automatic generation of the application is true, then the following values are used +server=eb-ldn-pc105 +port=1433 +user=rob +password=rob123 +database=ReportingDb_sal_prd_demo_sys-3 +schema=SRS +sqlTableName=sienaCounterpartyNameLookup +sqlSearchID=CompID +ReverseLookup= +offersLookup=n +LookUpID=FullName +LookUpName=Name \ No newline at end of file diff --git a/data/in/country.cfg b/data/in/country.cfg index 162c093..d18dc58 100644 --- a/data/in/country.cfg +++ b/data/in/country.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Countries +FriendlyName=Country objectname=Country endpointroot= querystring=Code @@ -30,8 +30,11 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaCountry sqlSearchID=Code ReverseLookup=Name +offersLookup=y +LookUpID=Code +LookUpName=Name \ No newline at end of file diff --git a/data/in/credentials.cfg b/data/in/credentials.cfg index 174fdc4..6e7364e 100644 --- a/data/in/credentials.cfg +++ b/data/in/credentials.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Credentials +FriendlyName=Credential objectname=Credentials endpointroot= querystring=Id diff --git a/data/in/currency.cfg b/data/in/currency.cfg index c5107fb..567d796 100644 --- a/data/in/currency.cfg +++ b/data/in/currency.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Currencies +FriendlyName=Currency objectname=Currency endpointroot= querystring=Code @@ -30,8 +30,11 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaCurrency sqlSearchID=Code -ReverseLookup=Name \ No newline at end of file +ReverseLookup=Name +offersLookup=Y +LookUpID=Code +LookUpName=Name \ No newline at end of file diff --git a/data/in/currencypair.cfg b/data/in/currencypair.cfg index fffd4f2..d3a3033 100644 --- a/data/in/currencypair.cfg +++ b/data/in/currencypair.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Currency Pairs +FriendlyName=Currency Pair objectname=CurrencyPair endpointroot= querystring=Code @@ -30,7 +30,7 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaCurrencyPair sqlSearchID=Code diff --git a/data/in/dataLoader.cfg b/data/in/dataLoader.cfg new file mode 100644 index 0000000..769c86e --- /dev/null +++ b/data/in/dataLoader.cfg @@ -0,0 +1,38 @@ +# What to generate +create_application=y +create_dao=y +create_datamodel=y +create_job=n +create_menu=y +create_html=y +create_adaptor=n +# actions - view/list are mandatory +can_edit=y +can_new=n +can_delete=n +can_list=y +can_save=y +can_view=y +can_export=yloade +# use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) +use=db +# COmmon application properties +FriendlyName=Data Loader +objectname=DataLoader +endpointroot= +querystring=Id +queryfield=Id +objectglyph=fas fa-city +projectrepo=github.com/mt1976/mwt-go-dev +propertiesOverride= +# If automatic generation of the application is true, then the following values are used +server=eb-ldn-pc105 +port=1433 +user=rob +password=rob123 +database=SRS +schema=dbo +sqlTableName=loaderStore +sqlSearchID=Id +#Does this File Have Enrichments - Include Additional Columns to the LIst & Record Views +hasEnrichments=n \ No newline at end of file diff --git a/data/in/dataLoaderData.cfg b/data/in/dataLoaderData.cfg new file mode 100644 index 0000000..96a018c --- /dev/null +++ b/data/in/dataLoaderData.cfg @@ -0,0 +1,38 @@ +# What to generate +create_application=y +create_dao=y +create_datamodel=y +create_job=n +create_menu=y +create_html=y +create_adaptor=n +# actions - view/list are mandatory +can_edit=y +can_new=n +can_delete=n +can_list=y +can_save=y +can_view=y +can_export=y +# use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) +use=db +# COmmon application properties +FriendlyName=Data Loader Data +objectname=DataLoaderData +endpointroot= +querystring=Id +queryfield=Id +objectglyph=fas fa-city +projectrepo=github.com/mt1976/mwt-go-dev +propertiesOverride= +# If automatic generation of the application is true, then the following values are used +server=eb-ldn-pc105 +port=1433 +user=rob +password=rob123 +database=SRS +schema=dbo +sqlTableName=loaderDataStore +sqlSearchID=Id +#Does this File Have Enrichments - Include Additional Columns to the LIst & Record Views +hasEnrichments=y \ No newline at end of file diff --git a/data/in/dataLoaderData.enri b/data/in/dataLoaderData.enri new file mode 100644 index 0000000..d4a08ca --- /dev/null +++ b/data/in/dataLoaderData.enri @@ -0,0 +1,4 @@ +Type,Field,Object,Lookup,Return,Inputtable,Mandatory,Default,LkCodeKey +Lookup,Loader,DataLoader,Loader,Name,true,false,,Id +Lookup,LoaderDescription,DataLoader,Loader,Description,false,false,,Id +Lookup,LoaderType,DataLoader,Loader,Type,false,false,,Id \ No newline at end of file diff --git a/data/in/dataLoaderMap.cfg b/data/in/dataLoaderMap.cfg new file mode 100644 index 0000000..2dc53c2 --- /dev/null +++ b/data/in/dataLoaderMap.cfg @@ -0,0 +1,38 @@ +# What to generate +create_application=y +create_dao=y +create_datamodel=y +create_job=n +create_menu=y +create_html=y +create_adaptor=n +# actions - view/list are mandatory +can_edit=y +can_new=n +can_delete=n +can_list=y +can_save=y +can_view=y +can_export=y +# use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) +use=db +# COmmon application properties +FriendlyName=Data Loader Data Map +objectname=DataLoaderMap +endpointroot= +querystring=Id +queryfield=Id +objectglyph=fas fa-city +projectrepo=github.com/mt1976/mwt-go-dev +propertiesOverride= +# If automatic generation of the application is true, then the following values are used +server=eb-ldn-pc105 +port=1433 +user=rob +password=rob123 +database=SRS +schema=dbo +sqlTableName=loaderMapStore +sqlSearchID=Id +#Does this File Have Enrichments - Include Additional Columns to the LIst & Record Views +hasEnrichments=y \ No newline at end of file diff --git a/data/in/dataLoaderMap.enri b/data/in/dataLoaderMap.enri new file mode 100644 index 0000000..78f6e8d --- /dev/null +++ b/data/in/dataLoaderMap.enri @@ -0,0 +1,4 @@ +Type,Field,Object,Lookup,Return,Inputtable,Mandatory,Default,Key +Lookup,Loader,DataLoader,Loader,Name,false,false,,Loader +Lookup,LoaderDescription,DataLoader,Loader,Description,false,false,,Loader +Lookup,LoaderType,DataLoader,Loader,Type,false,false,,Loader \ No newline at end of file diff --git a/data/in/dealConversation.cfg b/data/in/dealConversation.cfg index 25ab317..2724bda 100644 --- a/data/in/dealConversation.cfg +++ b/data/in/dealConversation.cfg @@ -16,7 +16,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Deal Conversation Contents +FriendlyName=Deal Conversation objectname=DealConversation endpointroot= querystring=ID diff --git a/data/in/dealinginterface.cfg b/data/in/dealinginterface.cfg index 5cb90e3..a6d6027 100644 --- a/data/in/dealinginterface.cfg +++ b/data/in/dealinginterface.cfg @@ -30,7 +30,7 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaDealingInterface sqlSearchID=Name \ No newline at end of file diff --git a/data/in/deals.cfg b/data/in/deals.cfg new file mode 100644 index 0000000..f52e7c1 --- /dev/null +++ b/data/in/deals.cfg @@ -0,0 +1,36 @@ +# What to generate +create_application=y +create_dao=y +create_datamodel=y +create_job=n +create_menu=y +create_html=y +create_adaptor=y +# actions - view/list are mandatory +can_edit=n +can_new=n +can_delete=n +can_list=y +can_save=n +can_view=y +can_export=y +# use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) +use=db +# COmmon application properties +FriendlyName=Transaction +objectname=Transaction +endpointroot= +querystring=Ref +queryfield=SienaReference +objectglyph=far fa-handshake +projectrepo=github.com/mt1976/mwt-go-dev +propertiesOverride=Siena +# If automatic generation of the application is true, then the following values are used +server=eb-ldn-pc105 +port=1433 +user=rob +password=rob123 +database=ReportingDb_sal_prd_demo_sys-3 +schema=SRS +sqlTableName=sienaDealList +sqlSearchID=SienaReference \ No newline at end of file diff --git a/data/in/dealtype.cfg b/data/in/dealtype.cfg index 056e0ae..65da039 100644 --- a/data/in/dealtype.cfg +++ b/data/in/dealtype.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Deal Types +FriendlyName=Deal Type objectname=DealType endpointroot= querystring=DealTypeKey @@ -30,7 +30,7 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaDealType sqlSearchID=DealTypeKey \ No newline at end of file diff --git a/data/in/dealtypefundamentals.cfg b/data/in/dealtypefundamentals.cfg index 7e247fb..cd3930c 100644 --- a/data/in/dealtypefundamentals.cfg +++ b/data/in/dealtypefundamentals.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Deal Type Fundamentals +FriendlyName=Deal Type Fundamental objectname=DealTypeFundamental endpointroot= querystring=DealTypeKey @@ -30,7 +30,7 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaDealTypeFundamentals sqlSearchID=DealTypeKey \ No newline at end of file diff --git a/data/in/firm.cfg b/data/in/firm.cfg index 970ef96..91daaa5 100644 --- a/data/in/firm.cfg +++ b/data/in/firm.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Firms +FriendlyName=Firm objectname=Firm endpointroot= querystring=FirmName @@ -30,7 +30,7 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaFirm sqlSearchID=FirmName diff --git a/data/in/instruments.cfg b/data/in/instruments.cfg index 9f84407..d72eaad 100644 --- a/data/in/instruments.cfg +++ b/data/in/instruments.cfg @@ -16,7 +16,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Negotiable Instruments +FriendlyName=Negotiable Instrument objectname=NegotiableInstrument endpointroot= querystring=ID diff --git a/data/in/mandate.cfg b/data/in/mandate.cfg index 0d335c4..c674ccc 100644 --- a/data/in/mandate.cfg +++ b/data/in/mandate.cfg @@ -9,7 +9,7 @@ create_adaptor=y # actions - view/list are mandatory can_edit=y can_new=y -can_delete=y +can_delete=n can_list=y can_save=y can_view=y @@ -17,11 +17,11 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Mandates +FriendlyName=Mandate objectname=Mandate endpointroot= querystring=Mandate -queryfield=FirmName +queryfield=CompID objectglyph=fas fa-city projectrepo=github.com/mt1976/mwt-go-dev propertiesOverride=Siena @@ -30,10 +30,10 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaMandatedUser -sqlSearchID=FirmName +sqlSearchID=CompID #Does this File Have Enrichments - Include Additional Columns to the LIst & Record Views hasEnrichments=y isSpecial=y \ No newline at end of file diff --git a/data/in/mandate.enri b/data/in/mandate.enri index de44900..cff70dc 100644 --- a/data/in/mandate.enri +++ b/data/in/mandate.enri @@ -1,4 +1,4 @@ Type,Field,Object,Lookup,Return,Inputtable,Mandatory,Default,Key Lookup,Country,Country,Country,Name,false,,,Code Lookup,Firm,Firm,MandatedUserKeyCounterpartyFirm,FullName,false,false,,FirmName -Lookup,Centre,Centre,MandatedUserKeyCounterpartyCentre,Name,false,false,,Code +Lookup,Centre,Centre,MandatedUserKeyCounterpartyCentre,Name,false,false,,Code \ No newline at end of file diff --git a/data/in/message.cfg b/data/in/message.cfg index ffbc564..a5bee1c 100644 --- a/data/in/message.cfg +++ b/data/in/message.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=System Messages +FriendlyName=System Message objectname=Message endpointroot= querystring=Message diff --git a/data/in/owner.cfg b/data/in/owner.cfg new file mode 100644 index 0000000..4178f35 --- /dev/null +++ b/data/in/owner.cfg @@ -0,0 +1,40 @@ +# What to generate +create_application=y +create_dao=y +create_datamodel=y +create_job=n +create_menu=n +create_html=n +create_adaptor=n +# actions - view/list are mandatory +can_edit=n +can_new=n +can_delete=n +can_list=n +can_save=n +can_view=n +can_export=n +# use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) +use=db +# COmmon application properties +FriendlyName=Owner +objectname=Owner +endpointroot= +querystring=Owner +queryfield=UserName +objectglyph=fas fa-industry +projectrepo=github.com/mt1976/mwt-go-dev +propertiesOverride=Siena +# If automatic generation of the application is true, then the following values are used +server=eb-ldn-pc105 +port=1433 +user=rob +password=rob123 +database=ReportingDb_sal_prd_demo_sys-3 +schema=SRS +sqlTableName=sienaOwner +sqlSearchID=UserName +ReverseLookup=FullName +offersLookup=y +LookUpID=UserName +LookUpName=FullName \ No newline at end of file diff --git a/data/in/payee.cfg b/data/in/payee.cfg index 9cf2d94..41194ab 100644 --- a/data/in/payee.cfg +++ b/data/in/payee.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Payees +FriendlyName=Payee objectname=Payee endpointroot= querystring=ID @@ -31,7 +31,7 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaCounterpartyPayee sqlSearchID=KeyCounterpartyFirm diff --git a/data/in/portfolio.cfg b/data/in/portfolio.cfg index 83700b2..f976313 100644 --- a/data/in/portfolio.cfg +++ b/data/in/portfolio.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Bank Porfolios +FriendlyName=Bank Porfolio objectname=Portfolio endpointroot= querystring=Code @@ -30,7 +30,7 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaPortfolio sqlSearchID=Code diff --git a/data/in/product.cfg b/data/in/product.cfg index 311ca44..a083f80 100644 --- a/data/in/product.cfg +++ b/data/in/product.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Product Groups +FriendlyName=Product Group objectname=Product endpointroot= querystring=Code @@ -30,7 +30,7 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaProduct sqlSearchID=Code diff --git a/data/in/rateStore.cfg b/data/in/rateStore.cfg index 3ca65af..cb90f61 100644 --- a/data/in/rateStore.cfg +++ b/data/in/rateStore.cfg @@ -16,7 +16,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Rates Store Contents +FriendlyName=Rates Store Content objectname=MarketRates endpointroot= querystring=ID diff --git a/data/in/salesdesk.cfg b/data/in/salesdesk.cfg new file mode 100644 index 0000000..1776fce --- /dev/null +++ b/data/in/salesdesk.cfg @@ -0,0 +1,40 @@ +# What to generate +create_application=y +create_dao=y +create_datamodel=y +create_job=n +create_menu=n +create_html=n +create_adaptor=n +# actions - view/list are mandatory +can_edit=n +can_new=n +can_delete=n +can_list=n +can_save=n +can_view=n +can_export=n +# use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) +use=db +# COmmon application properties +FriendlyName=Sales Desk +objectname=SalesDesk +endpointroot= +querystring=Desk +queryfield=Name +objectglyph=fas fa-industry +projectrepo=github.com/mt1976/mwt-go-dev +propertiesOverride=Siena +# If automatic generation of the application is true, then the following values are used +server=eb-ldn-pc105 +port=1433 +user=rob +password=rob123 +database=ReportingDb_sal_prd_demo_sys-3 +schema=SRS +sqlTableName=sienaSalesDesk +sqlSearchID=Name +ReverseLookup=Name +offersLookup=y +LookUpID=Name +LookUpName=Name \ No newline at end of file diff --git a/data/in/sector.cfg b/data/in/sector.cfg index 6650237..ed96e96 100644 --- a/data/in/sector.cfg +++ b/data/in/sector.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Sectors +FriendlyName=Sector objectname=Sector endpointroot= querystring=Sector @@ -30,8 +30,11 @@ server=eb-ldn-pc105 port=1433 user=rob password=rob123 -database=bnk6rgsys4 +database=ReportingDb_sal_prd_demo_sys-3 schema=SRS sqlTableName=sienaSector sqlSearchID=Code ReverseLookup=Name +offersLookup=y +LookUpID=Code +LookUpName=Name \ No newline at end of file diff --git a/data/in/session.cfg b/data/in/session.cfg index ee70f9f..923412a 100644 --- a/data/in/session.cfg +++ b/data/in/session.cfg @@ -11,13 +11,13 @@ can_edit=n can_new=n can_delete=n can_list=y -can_save=n +can_save=y can_view=y can_export=n # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Sessions +FriendlyName=Session objectname=Session endpointroot= querystring=SessionID diff --git a/data/in/systems.cfg b/data/in/systems.cfg index 327a4fa..52d3dc1 100644 --- a/data/in/systems.cfg +++ b/data/in/systems.cfg @@ -17,7 +17,7 @@ can_export=y # use values can be db or list (db will attempt to connect to a db and extract data from the table to get the fields list) use=db # COmmon application properties -FriendlyName=Connected Systems +FriendlyName=Connected System objectname=Systems endpointroot= querystring=ID diff --git a/data/out/design/catalog/country.nfo b/data/out/design/catalog/country.nfo index f211fe8..3ad6f32 100644 --- a/data/out/design/catalog/country.nfo +++ b/data/out/design/catalog/country.nfo @@ -7,7 +7,7 @@ Endpoint : Country (Code) For Project : github.com/mt1976/mwt-go-dev/ ---------------------------------------------------------------- Template Generator : cryptoidCalcium [r0-21.11.01] -Date & Time : 20/11/2021 at 16:24:20 +Date & Time : 28/11/2021 at 20:53:19 Who & Where : matttownsend on silicon.local ---------------------------------------------------------------- Database Information diff --git a/data/out/design/catalog/currency.nfo b/data/out/design/catalog/currency.nfo index ca11ae0..9423b3f 100644 --- a/data/out/design/catalog/currency.nfo +++ b/data/out/design/catalog/currency.nfo @@ -7,7 +7,7 @@ Endpoint : Currency (Code) For Project : github.com/mt1976/mwt-go-dev/ ---------------------------------------------------------------- Template Generator : cryptoidCalcium [r0-21.11.01] -Date & Time : 20/11/2021 at 16:24:20 +Date & Time : 28/11/2021 at 20:57:13 Who & Where : matttownsend on silicon.local ---------------------------------------------------------------- Database Information diff --git a/data/out/design/catalog/sector.nfo b/data/out/design/catalog/sector.nfo index 94b8c18..1c35ef4 100644 --- a/data/out/design/catalog/sector.nfo +++ b/data/out/design/catalog/sector.nfo @@ -7,7 +7,7 @@ Endpoint : Sector (Sector) For Project : github.com/mt1976/mwt-go-dev/ ---------------------------------------------------------------- Template Generator : cryptoidCalcium [r0-21.11.01] -Date & Time : 20/11/2021 at 16:24:21 +Date & Time : 28/11/2021 at 20:54:16 Who & Where : matttownsend on silicon.local ---------------------------------------------------------------- Database Information diff --git a/exec/.DS_Store b/exec/.DS_Store deleted file mode 100644 index f10e71c..0000000 Binary files a/exec/.DS_Store and /dev/null differ diff --git a/exec/darwin/.DS_Store b/exec/darwin/.DS_Store deleted file mode 100644 index 155388f..0000000 Binary files a/exec/darwin/.DS_Store and /dev/null differ diff --git a/exec/darwin/amd64/main.go-darwin-amd64 b/exec/darwin/amd64/main.go-darwin-amd64 deleted file mode 100755 index 642a5f0..0000000 Binary files a/exec/darwin/amd64/main.go-darwin-amd64 and /dev/null differ diff --git a/exec/darwin/arm64/main.go-darwin-arm64 b/exec/darwin/arm64/main.go-darwin-arm64 deleted file mode 100755 index 9f267db..0000000 Binary files a/exec/darwin/arm64/main.go-darwin-arm64 and /dev/null differ diff --git a/exec/linux/.DS_Store b/exec/linux/.DS_Store deleted file mode 100644 index d279312..0000000 Binary files a/exec/linux/.DS_Store and /dev/null differ diff --git a/exec/linux/386/main.go-linux-386 b/exec/linux/386/main.go-linux-386 deleted file mode 100755 index e5ac817..0000000 Binary files a/exec/linux/386/main.go-linux-386 and /dev/null differ diff --git a/exec/linux/amd64/main.go-linux-amd64 b/exec/linux/amd64/main.go-linux-amd64 deleted file mode 100755 index 96f5003..0000000 Binary files a/exec/linux/amd64/main.go-linux-amd64 and /dev/null differ diff --git a/exec/linux/arm/main.go-linux-arm b/exec/linux/arm/main.go-linux-arm deleted file mode 100755 index 51efe99..0000000 Binary files a/exec/linux/arm/main.go-linux-arm and /dev/null differ diff --git a/exec/linux/arm64/main.go-linux-arm64 b/exec/linux/arm64/main.go-linux-arm64 deleted file mode 100755 index 0dc700b..0000000 Binary files a/exec/linux/arm64/main.go-linux-arm64 and /dev/null differ diff --git a/go-exe-build.sh b/go-exe-build.sh deleted file mode 100755 index 0ea0f17..0000000 --- a/go-exe-build.sh +++ /dev/null @@ -1,54 +0,0 @@ -#Before we can use the script, we have to make it executable with the chmod command: -#chmod +x ./go-executable-build.sh -#then we can use it ./go-executable-build.sh yourpackage -#!/usr/bin/env bash - -package=$1 -if [[ -z "$package" ]]; then - echo "usage: $0 " - exit 1 -fi -package_name=$package - -#the full list of the platforms: https://golang.org/doc/install/source#environment -platforms=( -#"darwin/386" -"darwin/amd64" -#"darwin/arm" -"darwin/arm64" -#"dragonfly/amd64" -#"freebsd/386" -#"freebsd/amd64" -#"freebsd/arm" -"linux/386" -"linux/amd64" -"linux/arm" -"linux/arm64" -#"netbsd/386" -#"netbsd/amd64" -#"netbsd/arm" -#"openbsd/386" -#"openbsd/amd64" -#"openbsd/arm" -#"plan9/386" -#"plan9/amd64" -#"solaris/amd64" -#ß"windows/amd64" -"windows/386" ) - -for platform in "${platforms[@]}" -do - platform_split=(${platform//\// }) - GOOS=${platform_split[0]} - GOARCH=${platform_split[1]} - output_name=$package_name'-'$GOOS'-'$GOARCH - if [ $GOOS = "windows" ]; then - output_name+='.exe' - fi - - env GOOS=$GOOS GOARCH=$GOARCH go build -o ./exec/$platform/$output_name $package - if [ $? -ne 0 ]; then - echo 'An error has occurred! Aborting the script execution...' - exit 1 - fi -done diff --git a/main.go b/main.go index 20a75ff..8546d46 100755 --- a/main.go +++ b/main.go @@ -74,6 +74,12 @@ type enrichments struct { HasReverseLookup bool ReverseLookup string IsSpecial bool + OffersLookup bool + LookupID string + LookupName string + TemplateHeader string + TemplateFooter string + TemplateScripts string } type fields struct { @@ -194,6 +200,8 @@ func processTableDefinition(configFile string) { csvPath := getPWD() + data_in() + "/" + e.ObjectName + ".csv" enriPath := getPWD() + data_in() + "/" + e.ObjectName + ".enri" + logs.Information("CSV Path", csvPath) + logs.Information("Enri Path", enriPath) if props["use"] == "db" { // Do nothing for now @@ -385,7 +393,11 @@ func getFieldDefinitions_CSV(filePath string, e enrichments) enrichments { if record[3] == "true" { colMand = true } - e.FieldsList = addField(e, record[0], record[1], record[2], colMand) + noInput := false + if record[4] == "true" { + noInput = true + } + e.FieldsList = addField(e, record[0], record[1], record[2], colMand, noInput) } logs.Break() @@ -453,7 +465,7 @@ func getFieldDefinitions_DB(e enrichments, p map[string]string) enrichments { colType = "String" colDefault = "" } - e.FieldsList = addField(e, colName, colType, colDefault, colMand) + e.FieldsList = addField(e, colName, colType, colDefault, colMand, false) } return e } @@ -494,9 +506,9 @@ func displayTableHeader(in string) { logs.Break() } -func addField(en enrichments, fn string, tp string, df string, mand bool) []fields { +func addField(en enrichments, fn string, tp string, df string, mand bool, noInput bool) []fields { - en.FieldsList = addComplexField(en, fn, tp, df, mand, true, false, "", "", "", "") + en.FieldsList = addComplexField(en, fn, tp, df, mand, true, false, "", "", "", "", noInput) return en.FieldsList } @@ -561,6 +573,17 @@ func setupEnrichment(props map[string]string) enrichments { e.IsSpecial = true } + e.OffersLookup = false + if strings.ToUpper(props["offerslookup"]) == "Y" { + e.OffersLookup = true + e.LookupID = props["lookupid"] + e.LookupName = props["lookupname"] + } + + e.TemplateHeader = wrapTemplate("header") + e.TemplateFooter = wrapTemplate("footer") + e.TemplateScripts = wrapTemplate("scripts") + return e } @@ -625,6 +648,14 @@ func wrap(in string) string { return "{{." + in + "}}" } +func wrapTemplate(in string) string { + return "{{template " + enquote(in) + " .}}" +} + +func enquote(in string) string { + return "\"" + in + "\"" +} + func getUsername() string { usr, err := user.Current() if err != nil { @@ -711,19 +742,24 @@ func getEnrichmentFields_CSV(filePath string, en enrichments) enrichments { lkKeyField = record[3] lkValueField = record[4] lkCodeField = record[8] - lkRange = fmt.Sprintf("{{range .%s}}{{end}}", record[1]+"_Imple_List", wrap(lkCodeField), wrap(lkValueField)) + lkRange = fmt.Sprintf("{{range .%s}}{{end}}", record[1]+"_Impl_List", wrap(lkCodeField), wrap(lkValueField)) } - - //fmt.Printf("record: %v\n", record) + noInput := true + if record[5] == "true" { + noInput = false + } + fmt.Printf("record: %v\n", record) + fmt.Printf("record[5]: %v\n", record[5]) + fmt.Printf("noInput: %v\n", noInput) //fmt.Printf("colMand: %v\n", colMand) - en.FieldsList = addComplexField(en, record[1]+"_Impl", "String", record[7], colMand, false, isLookup, lkObject, lkKeyField, lkValueField, lkRange) + en.FieldsList = addComplexField(en, record[1]+"_Impl", "String", record[7], colMand, false, isLookup, lkObject, lkKeyField, lkValueField, lkRange, noInput) } } logs.Break() return en } -func addComplexField(en enrichments, fn string, tp string, df string, mand bool, baseField bool, isLookup bool, lkObject string, lkKeyField string, lkValueField string, lkRange string) []fields { +func addComplexField(en enrichments, fn string, tp string, df string, mand bool, baseField bool, isLookup bool, lkObject string, lkKeyField string, lkValueField string, lkRange string, noinp bool) []fields { origfn := fn @@ -743,6 +779,10 @@ func addComplexField(en enrichments, fn string, tp string, df string, mand bool, hidden = "hidden" userField = false } + + if noinp { + noinput = "disabled" + } fn = strings.ToUpper(fn[:1]) + fn[1:] info := fmt.Sprintf(tableContentLayout, fn, tp, df, mand, baseField, isLookup, lkObject, lkKeyField, lkValueField) diff --git a/templates/adaptor.go_template b/templates/adaptor.go_template index 8829751..83092d6 100644 --- a/templates/adaptor.go_template +++ b/templates/adaptor.go_template @@ -40,7 +40,7 @@ func {{.ObjectName}}_Delete(id string) error { func {{.ObjectName}}_Update(item dm.{{.ObjectName}}) error { var er error - message:= "Implement {{.ObjectName}}_Update: " + item.{{.SQLSearchID}} + message:= "Implement {{.ObjectName}}_Update: " + item.{{.QueryFieldID}} // Implement {{.ObjectName}}_Update_Impl in {{.ObjectNameLower}}_Impl.go // Uncomment the line below to use the implementation diff --git a/templates/application.go_template b/templates/application.go_template index a6cac5d..dc67be2 100644 --- a/templates/application.go_template +++ b/templates/application.go_template @@ -13,7 +13,7 @@ package application // ---------------------------------------------------------------- import ( - "html/template" + "net/http" core "{{.ProjectRepo}}core" @@ -38,7 +38,6 @@ type {{.ObjectName}}_Page struct { UserRole string Title string PageTitle string - AppInternalID string // Automatically generated {{.Date}} by {{.Who}} on {{.Host}} - START {{range .FieldsList}} {{.FieldName}} string {{end}} @@ -67,15 +66,14 @@ func {{.ObjectName}}_Publish(mux http.ServeMux) { // {{.ObjectNameLower}}_PublishImpl(mux http.ServeMux) {...} // TODO - this is a temporary hack to get the special case working // Add to main.go >>> {{.ObjectNameLower}}_PublishImpl(mux) - {{end}} } //{{.ObjectName}}_HandlerList is the handler for the list page func {{.ObjectName}}_HandlerList(w http.ResponseWriter, r *http.Request) { // Mandatory Security Validation - if !(core.SessionValidate(w, r)) { - core.LogoutHandler(w, r) + if !(Session_Validate(w, r)) { + core.Logout(w, r) return } @@ -86,25 +84,24 @@ func {{.ObjectName}}_HandlerList(w http.ResponseWriter, r *http.Request) { var returnList []dm.{{.ObjectName}} noItems, returnList, _ := dao.{{.ObjectName}}_GetList() - pageDetail := {{.ObjectName}}_PageList{ Title: core.ApplicationProperties["appname"], PageTitle: PageTitle(dm.{{.ObjectName}}_Title, core.Action_List), ItemsOnPage: noItems, ItemList: returnList, UserMenu: UserMenu_Get(r), - UserRole: core.GetUserRole(r), + UserRole: Session_GetUserRole(r), } - t, _ := template.ParseFiles(core.GetTemplateID(dm.{{.ObjectName}}_TemplateList, core.GetUserRole(r))) - t.Execute(w, pageDetail) + ExecuteTemplate(dm.{{.ObjectName}}_TemplateList, w, r, pageDetail) + } //{{.ObjectName}}_HandlerView is the handler used to View a page func {{.ObjectName}}_HandlerView(w http.ResponseWriter, r *http.Request) { // Mandatory Security Validation - if !(core.SessionValidate(w, r)) { - core.LogoutHandler(w, r) + if !(Session_Validate(w, r)) { + core.Logout(w, r) return } // Code Continues Below @@ -119,16 +116,15 @@ func {{.ObjectName}}_HandlerView(w http.ResponseWriter, r *http.Request) { Title: core.ApplicationProperties["appname"], PageTitle: PageTitle(dm.{{.ObjectName}}_Title, core.Action_View), UserMenu: UserMenu_Get(r), - UserRole: core.GetUserRole(r), - AppInternalID: rD.AppInternalID, + UserRole: Session_GetUserRole(r), } // // Automatically generated {{.Date}} by {{.Who}} on {{.Host}} - START {{range .FieldsList}}{{if .IsBaseField}}pageDetail.{{.FieldName}} = rD.{{.FieldName}} {{end}}{{end}}// Automatically generated {{.Date}} by {{.Who}} on {{.Host}} - Enrichment Fields Below -{{range .FieldsList}}{{if not .IsBaseField}}{{if .IsLookup}}_,{{.LookupField}}_Lookup,_:= dao.{{.LookupObject}}_GetByID(rD.{{.LookupField}}) -pageDetail.{{.FieldName}} = {{.LookupField}}_Lookup.{{.LookupValue}} +{{range .FieldsList}}{{if not .IsBaseField}}{{if .IsLookup}}_,{{.LookupField}}_Lookup_{{.LookupValue}},_:= dao.{{.LookupObject}}_GetByID(rD.{{.LookupField}}) +pageDetail.{{.FieldName}} = {{.LookupField}}_Lookup_{{.LookupValue}}.{{.LookupValue}} {{end}}{{end}}{{end}}// Automatically generated {{.Date}} by {{.Who}} on {{.Host}} - END // @@ -142,16 +138,16 @@ pageDetail.{{.FieldName}} = {{.LookupField}}_Lookup.{{.LookupValue}} // Automatically generated {{.Date}} by {{.Who}} on {{.Host}} - END - t, _ := template.ParseFiles(core.GetTemplateID(dm.{{.ObjectName}}_TemplateView, core.GetUserRole(r))) - t.Execute(w, pageDetail) + ExecuteTemplate(dm.{{.ObjectName}}_TemplateView, w, r, pageDetail) + } //{{.ObjectName}}_HandlerEdit is the handler used generate the Edit page func {{.ObjectName}}_HandlerEdit(w http.ResponseWriter, r *http.Request) { // Mandatory Security Validation - if !(core.SessionValidate(w, r)) { - core.LogoutHandler(w, r) + if !(Session_Validate(w, r)) { + core.Logout(w, r) return } // Code Continues Below @@ -166,16 +162,15 @@ func {{.ObjectName}}_HandlerEdit(w http.ResponseWriter, r *http.Request) { Title: core.ApplicationProperties["appname"], PageTitle: PageTitle(dm.{{.ObjectName}}_Title, core.Action_Edit), UserMenu: UserMenu_Get(r), - UserRole: core.GetUserRole(r), - AppInternalID: rD.AppInternalID, + UserRole: Session_GetUserRole(r), } // // Automatically generated {{.Date}} by {{.Who}} on {{.Host}} - START {{range .FieldsList}}{{if .IsBaseField}}pageDetail.{{.FieldName}} = rD.{{.FieldName}} {{end}}{{end}}// Automatically generated {{.Date}} by {{.Who}} on {{.Host}} - Enrichment Fields Below -{{range .FieldsList}}{{if not .IsBaseField}}{{if .IsLookup}}_,{{.LookupField}}_Lookup,_:= dao.{{.LookupObject}}_GetByID(rD.{{.LookupField}}) -pageDetail.{{.FieldName}} = {{.LookupField}}_Lookup.{{.LookupValue}} +{{range .FieldsList}}{{if not .IsBaseField}}{{if .IsLookup}}_,{{.LookupField}}_Lookup_{{.LookupValue}},_:= dao.{{.LookupObject}}_GetByID(rD.{{.LookupField}}) +pageDetail.{{.FieldName}} = {{.LookupField}}_Lookup_{{.LookupValue}}.{{.LookupValue}} _,pageDetail.{{.FieldName}}_List,_ = dao.{{.LookupObject}}_GetList() {{end}}{{end}}{{end}}// Automatically generated {{.Date}} by {{.Who}} on {{.Host}} - END // @@ -188,16 +183,16 @@ _,pageDetail.{{.FieldName}}_List,_ = dao.{{.LookupObject}}_GetList() {{end}} // Automatically generated {{.Date}} by {{.Who}} on {{.Host}} - END - t, _ := template.ParseFiles(core.GetTemplateID(dm.{{.ObjectName}}_TemplateEdit, core.GetUserRole(r))) - t.Execute(w, pageDetail) + ExecuteTemplate(dm.{{.ObjectName}}_TemplateEdit, w, r, pageDetail) + } //{{.ObjectName}}_HandlerSave is the handler used process the saving of an {{.ObjectName}} func {{.ObjectName}}_HandlerSave(w http.ResponseWriter, r *http.Request) { // Mandatory Security Validation - if !(core.SessionValidate(w, r)) { - core.LogoutHandler(w, r) + if !(Session_Validate(w, r)) { + core.Logout(w, r) return } // Code Continues Below @@ -206,8 +201,6 @@ func {{.ObjectName}}_HandlerSave(w http.ResponseWriter, r *http.Request) { logs.Servicing(r.URL.Path+r.FormValue("{{.QueryFieldID}}")) var item dm.{{.ObjectName}} - - //item.AppInternalID = r.FormValue("AppInternalID") // Automatically generated {{.Date}} by {{.Who}} on {{.Host}} - START {{range .FieldsList}} item.{{.FieldName}} = r.FormValue(dm.{{$.ObjectName}}_{{.FieldName}}) {{end}} @@ -229,8 +222,8 @@ func {{.ObjectName}}_HandlerSave(w http.ResponseWriter, r *http.Request) { //{{.ObjectName}}_HandlerNew is the handler used process the creation of an {{.ObjectName}} func {{.ObjectName}}_HandlerNew(w http.ResponseWriter, r *http.Request) { // Mandatory Security Validation - if !(core.SessionValidate(w, r)) { - core.LogoutHandler(w, r) + if !(Session_Validate(w, r)) { + core.Logout(w, r) return } // Code Continues Below @@ -243,8 +236,7 @@ func {{.ObjectName}}_HandlerNew(w http.ResponseWriter, r *http.Request) { Title: core.ApplicationProperties["appname"], PageTitle: PageTitle(dm.{{.ObjectName}}_Title, core.Action_New), UserMenu: UserMenu_Get(r), - UserRole: core.GetUserRole(r), - AppInternalID: "NEW", + UserRole: Session_GetUserRole(r), } // @@ -256,16 +248,15 @@ _,pageDetail.{{.FieldName}}_List,_ = dao.{{.LookupObject}}_GetList() {{end}}{{end}}{{end}}// Automatically generated {{.Date}} by {{.Who}} on {{.Host}} - END // - t, _ := template.ParseFiles(core.GetTemplateID(dm.{{.ObjectName}}_TemplateNew, core.GetUserRole(r))) - t.Execute(w, pageDetail) + ExecuteTemplate(dm.{{.ObjectName}}_TemplateNew, w, r, pageDetail) } //{{.ObjectName}}_HandlerDelete is the handler used process the deletion of an {{.ObjectName}} func {{.ObjectName}}_HandlerDelete(w http.ResponseWriter, r *http.Request) { // Mandatory Security Validation - if !(core.SessionValidate(w, r)) { - core.LogoutHandler(w, r) + if !(Session_Validate(w, r)) { + core.Logout(w, r) return } // Code Continues Below diff --git a/templates/dao.go_template b/templates/dao.go_template index f359153..da538e9 100644 --- a/templates/dao.go_template +++ b/templates/dao.go_template @@ -21,7 +21,7 @@ import ( das "{{.ProjectRepo}}das" dm "{{.ProjectRepo}}datamodel" logs "{{.ProjectRepo}}logs" - {{if .UsesAdaptor}} adaptor "{{.ProjectRepo}}adaptor"{{end}} + {{if .UsesAdaptor}}{{if .CanSave}} adaptor "{{.ProjectRepo}}adaptor"{{end}}{{end}} ) // {{.ObjectName}}_GetList() returns a list of all {{.ObjectName}} records @@ -32,6 +32,19 @@ func {{.ObjectName}}_GetList() (int, []dm.{{.ObjectName}}, error) { return count, {{.ObjectNameLower}}List, nil } +{{if .OffersLookup}} +// {{.ObjectName}}_GetLookup() returns a lookup list of all {{.ObjectName}} items in lookup format +func {{.ObjectName}}_GetLookup() []dm.Lookup_Item { + + var returnList []dm.Lookup_Item + count, {{.ObjectNameLower}}List, _ := {{.ObjectName}}_GetList() + for i := 0; i < count; i++ { + returnList = append(returnList, dm.Lookup_Item{ID: {{.ObjectNameLower}}List[i].{{.LookupID}}, Name: {{.ObjectNameLower}}List[i].{{.LookupName}}}) + } + return returnList +} +{{end}} + // {{.ObjectName}}_GetByID() returns a single {{.ObjectName}} record func {{.ObjectName}}_GetByID(id string) (int, dm.{{.ObjectName}}, error) { @@ -63,11 +76,12 @@ func {{.ObjectName}}_Delete(id string) { das.Execute(tsql) } + // {{.ObjectName}}_Store() saves/stores a {{.ObjectName}} record to the database func {{.ObjectName}}_Store(r dm.{{.ObjectName}}) error { logs.Storing("{{.ObjectName}}",fmt.Sprintf("%s", r)) - +{{if .CanSave}} if len(r.{{.QueryFieldID}}) == 0 { r.{{.QueryFieldID}} = {{.ObjectName}}_NewID(r) } @@ -102,8 +116,10 @@ func {{.ObjectName}}_Store(r dm.{{.ObjectName}}) error { {{.ObjectName}}_Delete(r.{{.QueryFieldID}}) das.Execute(tsql) +{{end}} {{end}} return nil + } // {{.ObjectNameLower}}_Fetch read all employees @@ -121,7 +137,6 @@ func {{.ObjectNameLower}}_Fetch(tsql string) (int, []dm.{{.ObjectName}}, dm.{{.O rec := returnList[i] // Automatically generated {{.Date}} by {{.Who}} on {{.Host}} - START - recItem.AppInternalID = get_String(rec, dm.{{$.ObjectName}}_{{.QueryFieldID}},"") {{range .FieldsList}}{{if .IsBaseField}} recItem.{{.FieldName}} = get_{{.Type}}(rec, dm.{{$.ObjectName}}_{{.FieldName}}, "{{.Default}}"){{end}} {{end}}// Automatically generated {{.Date}} by {{.Who}} on {{.Host}} - END //Add to the list diff --git a/templates/datamodel.go_template b/templates/datamodel.go_template index b34c0e3..c77c443 100644 --- a/templates/datamodel.go_template +++ b/templates/datamodel.go_template @@ -15,7 +15,7 @@ package datamodel //Centre is cheese type {{.ObjectName}} struct { - AppInternalID string // Special field for internal use only + {{range .FieldsList}}{{.FieldName}} string {{end}} } diff --git a/templates/edit.html_template b/templates/edit.html_template index 9b26530..1c363c4 100644 --- a/templates/edit.html_template +++ b/templates/edit.html_template @@ -1,56 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{.PageTitle}} - +{{.TemplateHeader}} - - - -
- - × - {{.RangeUserMenuStart}} - -
-
- -
-
{{.MenuText}}
-
-
- {{.RangeEnd}} -
- -
@@ -62,10 +11,10 @@
{{if .CanSave}} - + {{end}} - - + +
@@ -81,7 +30,7 @@ {{range .FieldsList}}{{if not .IsBaseField}}
- {{if .IsLookup}}{{else}} + {{if .IsLookup}}{{else}} {{end}}
diff --git a/templates/list.html_template b/templates/list.html_template index 322b2bc..051a71a 100644 --- a/templates/list.html_template +++ b/templates/list.html_template @@ -1,60 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{.PageTitle}} - - +{{.TemplateHeader}} - - - - -
- - × - {{.RangeUserMenuStart}} - -
-
- -
-
{{.MenuText}}
-
-
- {{.RangeEnd}} -
- -
@@ -71,15 +17,15 @@
{{if .CanNew}} - {{end}} {{if .CanExport}} - + {{end}} - - + +
@@ -107,17 +53,17 @@
{{if .CanView}} - {{end}} {{if .CanEdit}} - {{end}} {{if .CanDelete}} - {{end}} diff --git a/templates/new.html_template b/templates/new.html_template index a4a34b5..1f0bc29 100644 --- a/templates/new.html_template +++ b/templates/new.html_template @@ -1,56 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{.PageTitle}} - +{{.TemplateHeader}} - - - -
- - × - {{.RangeUserMenuStart}} - -
-
- -
-
{{.MenuText}}
-
-
- {{.RangeEnd}} -
- -
@@ -62,10 +11,10 @@
{{if .CanSave}} - + {{end}} - - + +
@@ -81,7 +30,7 @@ {{range .FieldsList}}{{if not .IsBaseField}}
- {{if .IsLookup}}{{else}} + {{if .IsLookup}}{{else}} {{end}}
diff --git a/templates/view.html_template b/templates/view.html_template index 662b09c..397b2dd 100644 --- a/templates/view.html_template +++ b/templates/view.html_template @@ -1,56 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{.PageTitle}} - +{{.TemplateHeader}} - - - -
- - × - {{.RangeUserMenuStart}} - -
-
- -
-
{{.MenuText}}
-
-
- {{.RangeEnd}} -
- -
@@ -62,10 +11,10 @@
{{if .CanEdit}} - + {{end}} - - + +