File System Structure (JSON) |
Contents of the JSON file setup.config:
{ "SystemName": "ExactOnline"
, "Version": "1.0"
, "SupportsListing": "true"
, "ListSqlStatement": "select sdn.Code code, sdn.Label name, 'DIR' type from SystemDivisions sdn"
, "Folder":
{ "SupportsListing": "true"
, "ListSqlStatement": "select :code code, 'Accounts' name, 'DIR' type"
, "Folder":
{ "SupportsListing": "true"
, "ListSqlStatement": "use :code; select to_char(id) code, name, 'DIR' type, Division from ExactOnlineREST..Accounts"
, "Folder":
{ "SupportsListing": "true"
, "ListSqlStatement": "use :division; select /*+ http_disk_cache(false) http_memory_cache(false) */ to_char(dae.ID) code, dae.FileName name, dct.Created date_created, dct.Modified date_modified, dae.FileSize file_size, 'FILE' type, dct.Division Division from ExactOnlineREST.Documents.DocumentAttachmentsBulk dae join ExactOnlineREST.Documents.DocumentsBulk dct on dct.id = dae.Document and dct.Account = :code"
, "SupportsDownloading": "true"
, "DownloadSqlStatement": "use :division; select coalesce(dae.Attachment, dae.AttachmentFromUrl) file_contents from ExactOnlineREST.Documents.DocumentAttachmentFiles dae where dae.id = :code"
, "SupportsCreating": "true"
, "CreateSqlStatement": "use :division;\r\n\r\ndeclare\r\n l_dct_subject varchar2;\r\n l_dct_type pls_integer := 183; /* Attachment. */\r\n l_dct_category_name varchar2 := 'General';\r\n l_dct_date date;\r\n l_account varchar2 := :code;\r\nbegin\r\n l_dct_subject := :file_name || ' ' || to_char(sysdate, 'YYYYMMDDHH24MISS') || '-' || newid();\r\n l_dct_date := trunc(sysdate);\r\n --\r\n insert into exactonlinerest..documents\r\n ( division\r\n , account\r\n , body\r\n , category\r\n , contact\r\n , documentdate\r\n , financialtransactionentryid\r\n , opportunity\r\n , project\r\n , salesinvoicenumber\r\n , salesordernumber\r\n , shopordernumber\r\n , subject\r\n , type\r\n )\r\n select :division\r\n , l_account\r\n , 'Invantive Business Server' body\r\n , dcy.id\r\n , null\r\n , l_dct_date\r\n , null\r\n , null\r\n , null\r\n , null\r\n , null\r\n , null\r\n , l_dct_subject subject\r\n , l_dct_type type\r\n from DocumentCategories dcy\r\n where dcy.division = :division\r\n and dcy.description = l_dct_category_name\r\n ;\r\n --\r\n insert into exactonlinerest..documentattachmentfiles\r\n ( division\r\n , document\r\n , attachment\r\n , filename\r\n )\r\n select :division\r\n , dct.id\r\n , :file_contents\r\n , :file_name\r\n from exactonlinerest..documents dct\r\n where dct.division = :division\r\n and dct.subject = l_dct_subject\r\n and dct.documentdate = l_dct_date\r\n ;\r\nend;"
}
}
}
}