diff --git a/README.md b/README.md index bda4011..8325e14 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ SelectEntries|Multiple lines of text ShowEntries|Multiple lines of text SortEntries|Multiple lines of text Query|Multiple lines of text +BatchSize|Number (0 decimal) ## Install the Package @@ -48,47 +49,13 @@ It is a file that set global JavaScript variables, used by the main library, so ### Set the SharePoint Site URL -Variable `_URL` must be set to the root addess of the SharePoint site that contains your data. +Variable `_SPR_URL` must be set to the root addess of the SharePoint site that contains your data. ### Set the SharePoint List Name where to store Reports -Variable `_REPORT_LIST` must contains the Name/Title of the SharePoint List where reports are saved. - ---- - -**dconf.js** - -```JavaScript -/** - * Configuration File - */ - -// SharePoint Site URL -var _URL = "https://123.sharepoint.com/sites/Mysite"; - -// List for saving Reports -var _REPORT_LIST = "Reports"; - -// Allow reporting on Libraries. -var _ALLOW_LIBRARY = false; - -// Allow reporting on Hidden Libraries -var _ALLOW_LIBRARY_HIDDEN = false; - -// Allow reporting on Lists. -var _ALLOW_LIST = true; - -// Allow reporting on Hidden Lists -var _ALLOW_LIST_HIDDEN = false; - -// Always-available Fields (columns) -> Array of "Name" -var _ALLOW_FIELDS_ALWAYS = ["ID"]; - -var _SPREPORTIFY_BUILDER_PAGE = "dbr.aspx"; -var _SPREPORTIFY_RUNNER_PAGE = "drr.aspx"; -``` - - +To tell spReportify where to read/write report definitions, you must fill the following variables: +- Variable `_SPR_REPORTLISTTYPE`: must contains `title` or `guid`, depending on if you want to refer the list using it's Title or it's GUID. +- Variable `_SPR_REPORTLISTREF`: set the List Title or GUID according to the value you have set in `_SPR_REPORTLISTTYPE`. ## Download diff --git a/bin/dconf.template.js b/bin/dconf.template.js index e14f45d..f863422 100644 --- a/bin/dconf.template.js +++ b/bin/dconf.template.js @@ -2,26 +2,121 @@ * Configuration File */ -// SharePoint Site URL -var _URL = "https://123.sharepoint.com/sites/Mysite"; -// List for saving Reports -var _REPORT_LIST = "Reports"; +/** + * SHAREPOINT SITE URL + * ------------------------------------------------------------------ + * This is the URL to the SharePoint site where you want to install + * spReportify. This value is used to send HTTP requests to get data + * to report and to generate URLs to Reports. + * + * Controlled transformations: + * - with or without "https://" (will be added if missing), + * - http will be changed to https, + * - code will ensure there is "/" at the end, + * + * Examples: + * - tenant.sharepoint.com/sites/MySite/ + * - https://tenant.sharepoint.com/sites/MySite + */ +var _SPR_URL = "https://123.sharepoint.com/sites/Mysite/"; + +/** + * LIST TO STORE REPORTS + * ------------------------------------------------------------------ + * This is the name of the SharePoint List where Reports definitions + * are stored. There is 2 methods to identify this list, you can + * use it's GUID or it's name, please, ensure both variables are + * correctly set. + * + * --- Variable _SPR_REPORTLISTTYPE (ReportListType) ---------------- + * This is a flag to tell if the reference is a GUID or the Title. + * + * Acceptable values: + * - "guid" + * - "title" + * + * --- Variable _SPR_REPORTLISTREF (ReportListRef) ------------------ + * This is the GUID or the Title of the SharePoint List. + */ +var _SPR_REPORTLISTTYPE = "title"; +var _SPR_REPORTLISTREF = "Reports"; -// Allow reporting on Libraries. -var _ALLOW_LIBRARY = false; +/** + * ALLOW REPORTING ON LIBRARIES + * ------------------------------------------------------------------ + * Set this value to 'true' if you want to allow using Libraries as + * datasource for reports. + */ +var _SPR_ALLOWLIBRARY = false; + +/** + * ALLOW REPORTING ON HIDDEN LIBRARIES + * ------------------------------------------------------------------ + * Set this value to 'true' if you want to allow using hidden + * libraries as datasource for reports. + */ +var _SPR_ALLOWHIDDENLIBRARY = false; -// Allow reporting on Hidden Libraries -var _ALLOW_LIBRARY_HIDDEN = false; +/** + * ALLOW REPORTING ON LISTS + * ------------------------------------------------------------------ + * Set this to 'true' if you want to allow using Lists as datasources + * for reports. THIS SHOULD BE SET TO 'true' FOR NORMAL USE. + */ +var _SPR_ALLOWLIST = true; -// Allow reporting on Lists. -var _ALLOW_LIST = true; +/** + * ALLOW REPORTING ON HIDDEN LISTS + * ------------------------------------------------------------------ + * Set this to 'true' if you want to allow using hidden Lists as + * datasources for reports. + */ +var _SPR_ALLOWHIDDENLIST = false; -// Allow reporting on Hidden Lists -var _ALLOW_LIST_HIDDEN = false; +/** + * ALWAYS ALLOW FIELDS + * ------------------------------------------------------------------ + * This is an Array of Fields that should always be available. Use + * this parameter to make the field 'ID' always available. You + * can also use this parameter for 'Content Type' per example. + */ +var _SPR_ALLOWFIELDS = [ + "ID" +]; -// Always-available Fields (columns) -> Array of "Name" -var _ALLOW_FIELDS_ALWAYS = ["ID"]; +/** + * LOG LEVEL + * ------------------------------------------------------------------ + * Set the level of details written to the Browser Console. + * + * Accepted values: + * error Errors only. 4 + * warn Potential issues that may lead to errors. 3 + * info General Information. 2 + * trace Output everything to the console. 1 + * + * (empty) Disabled. 0 + */ +var _SPR_LOGLEVEL = "trace"; -var _SPREPORTIFY_BUILDER_PAGE = "dbr.aspx"; -var _SPREPORTIFY_RUNNER_PAGE = "drr.aspx"; \ No newline at end of file +/** + * SCRIPT PAGE NAMES + * ------------------------------------------------------------------ + * This is the name of the pages for spReportify Script. This is a + * more technical parameter, used to generate URLs to share Reports, + * and to determine if the user is using the Runner or the Builder. + * + * If you change the name of '.aspx' pages, update these parameters. + * + * --- Variable _SPR_PAGEBUILDER (PageBuilder) ---------------------- + * Set this value to the name of the '.aspx' page of the Report + * Builder. Example: 'file.aspx'. + * + * --- Variable _SPR_PAGERUNNER (PageRunner) ----------------------- + * Set this value to the name of the '.aspx' page of the Report + * Runner. Example: 'file.aspx'. + * + */ +var _SPR_PAGEBUILDER = "dbr.aspx"; +var _SPR_PAGERUNNER = "drr.aspx"; \ No newline at end of file diff --git a/dbr.aspx b/dbr.aspx index c131e27..69ad462 100644 --- a/dbr.aspx +++ b/dbr.aspx @@ -116,6 +116,7 @@