This is a detailed list of changes in CSPro 8.1. For a more general overview, see the readme.txt file located in the CSPro installation folder.
A feature showcase demonstrating some of CSPro 8.1's new features is available on
GitHub.
There are some breaking changes in CSWeb 8.1. When upgrading CSWeb, make sure that you are aware of how these changes will impact your processes. CSPro 8.1 is compatible with CSWeb 8.0.
- CSPro is now open source! The source code, written primarily in C++, JavaScript, Java/Kotlin, and PHP, with some code written in C#, is available on GitHub: github.com/csprousers.
- The CSWeb data source facilitates directly accessing or updating CSWeb data without the need to run synchronizations. This data source can be used like other data sources: as the main dictionary for data collection, as an external dictionary, etc. Instead of storing cases in a file on a local machine, cases are stored on the CSWeb server.
- CSWeb data can be viewed directly using Data Manager without needing to download the data to your local machine.
- Markdown can be used while specifying question text, in templated reports, and can be viewed (as generated HTML) using the view function or in CSView. Markdown can also be edited in CSCode and included as part of CSPro Documents.
- Applications can now incorporate JavaScript in addition to CSPro logic. Many open-source JavaScript libraries exist that can be brought into your application, and as a dynamically typed language, some programming tasks may be easier using JavaScript. By using the JS namespace, it is possible to evaluate JavaScript, invoke functions, and convert CSPro symbols to JavaScript numbers, strings, arrays, and objects. It is also possible to create function wrappers in CSPro logic that appear as user-defined functions but call into JavaScript when invoked.
- The Data Viewer tool has been renamed Data Manager and has new features including:
- HTTP requests can be made and responses processed using actions in the Action Invoker's Network namespace.
- CSPro's handling of text encoding and newline characters is changing, with the aim to standardize the settings across file types.
- In a future release, files without a BOM (byte order mark) will be treated as text encoded in UTF-8, not ANSI.
- It will be possible to override this default behavior by specifying an override.
- In this release, Text Viewer treats files without a BOM as UTF-8, with an Encoding menu that lets you change the encoding to ANSI.
- To prepare for the future release, if you use external tools to process CSPro files, you will want to ensure that they process files without a BOM as UTF-8, and that they can handle newlines written only with a line feed character ("\n", not "\r\n").
- Images in the WebP format can be loaded and saved using the Image object and can be used as value set images.
- A new dialog, Manage Application Files, replaces the Add Files and Drop Files dialogs, providing a central place to manage an application's files and each file's properties. New properties include:
- The CSPro Settings dialog has been renamed Manage Credentials and now allows for the granular clearing of synchronization, data, and location credentials.
- CSPro URIs, using the custom scheme cspro://, can identify data sources and synchronization services. On Windows, the URI scheme is registered with the operating system and opening URIs can result in opening resources in Data Manager or Text Viewer.
- Numeric value sets can be generated in descending order.
- Right-clicking on the header of one of the dictionary grids provides an option to reset the column widths for that grid. The calculation of the default grid widths has been modified to account for large monitors.
- The upper case field property is applied to all text entered into a field, regardless of entry method. Previously, text pasted from the clipboard was not transformed to upper case.
- Referencing synchronization services, such as when using syncconnect, is possible using a single string, a synchronization connection string. This eliminates the need to specify the type of the service.
- The SyncService PFF attribute, using this connection string, replaces the previous attributes named SyncType and SyncUrl.
- The same dictionary can be used to synchronize data to different databases or data sets on the same synchronization service by specifying a syncable name. This name, rather than the dictionary's actual name, will be used when sending or receiving cases from a synchronization service.
- The syncdata function can now be used with a data entry application's main dictionary.
- Multiple dictionaries can now be synchronized as part of Simple Synchronization routine.
- You can specify what Dropbox account you want to use for synchronizing, supporting operations where multiple Dropbox accounts are in use.
- Synchronization messages, previously only handled by Bluetooth, are now stored when sent to all synchronization services.
- Paradata in logs other than the currently open log can be synchronized using Sync.syncParadata.
- An option supports creating the directory used for Local Files synchronization, facilitating easy testing of synchronization operations on a local machine.
- Synchronization routines can be executed using the Action Invoker's Sync namespace with the actions: Sync.connect, Sync.disconnect, Sync.sendMessage, and Sync.syncParadata.
- CSEntry can be launched using a deep link that starts with "https://csprousers.org/pff". CSEntry runs the application specified as part of the deep link's path.
- A new mapping property allows Leaflet to be selected as the mapping engine for Android. On Windows, Leaflet is the only available mapping engine.
- Offline maps can now use ArcGIS Tile Packages that use the CompactV2 storage format (with the file extension .tpkx).
- When using Leaflet, ArcGIS Tile Packages created using the Mixed tile format ("JPEG in the center of the package with PNG 32 on the edge of the package") are supported.
- Leaflet mapping supports using HTML tags in text entries for functions such as Map.setTitle and Map.setMarkerText. (This was already possible when using the Google Maps mapping engine.)
- Question text can be defined using Markdown. The Markdown is rendered as HTML for display.
- The default format for new question text can be specified, and the editor's toolbar displays the format with four options. The first two options,
and
, are the HTML-based options that previously existed. A new option,
allows for the specification of question text as a HTML text template, supporting <? ?> template expressions. This HTML is edited as code with no visual editor. The final option,
, is for Markdown question text. - When using formatting options, or adding images or hyperlinks, the question text editor will use the correct syntax based on whether the question is using HTML or Markdown.
- To toggle between question text and help text, the editor's toolbar now contains two buttons:
for question text and
for help text. - You can view a preview of question text by pressing Ctrl + F5 or selecting Preview Text Template from the View menu. This will not run the CSPro logic, so the preview will not necessarily look complete, but it can be useful to view an approximation of how the rendered question text will appear.
- The QSF logic object gives access to the StringWriter in use when processing question text as a text template.
- A new namespace, JS, contains functions that facilitate executing JavaScript from within CSPro logic. Functions in the namespace include: JS.eval, JS.getValue, JS.getValueJson, JS.hasValue, JS.invoke, JS.setValue, and JS.setValueFromJson.
- The new keyword declare can be used to declare a user-defined function. The declared function can be referenced in logic prior to its definition. Using a function prior to its definition was previously possible only using workarounds such as invoke or function pointers.
- A new object, StringWriter, supports building strings incrementally. The Report object is a kind of StringWriter, and the QSF special name, used when processing question text, is also a kind of StringWriter. A StringWriter has the functions: clear, toString, write, writeEncoded, writeEncodedLine, and writeLine.
- The Report object implements three new functions, inherited from its StringWriter parent: writeEncoded, writeEncodedLine, and writeLine.
- The encode function supports encoding to Markdown format.
- A new function, ValueSet.removeDuplicates, removes duplicate entries from a dynamic value set.
- The EXIF data of an image can be queried using the Image.getExif function. EXIF data in a JPEG can include useful information such as the date and time when a photo was taken, as well as GPS coordinates.
- The Image object can now load icon files (.ico) on Windows and can save to that format on all platforms.
- Images used by the Map.addImageButton and Map.setMarkerImage functions can be specified as URLs pointing to local resources (using localhost URLs) or to remote servers.
- If an Array object is defined with initial values and is also marked as a saved array, the initial values will only be used if the array does not exist in the saved array file.
- The Symbol.updateValueFromJson function has been renamed Symbol.setValueFromJson, though the old name will remain as an alias for some time.
- A Geometry object can be used as an argument to Map.zoomTo, which uses the Geometry object's bounds to set the rectangular region of the map when shown.
- JavaScript files can be associated with applications by using the Manage Application Files interface. The JavaScript can be evaluated as a global script or as a module.
- Functions in the JS namespace allow interaction with JavaScript using CSPro logic:
- JS.eval: Evaluates JavaScript in the global execution context.
- JS.getValue: Converts a JavaScript variable or property to its CSPro equivalent.
- JS.getValueJson: Returns the JSON representation of a JavaScript variable or property.
- JS.hasValue: Returns whether a JavaScript variable or property is defined (not undefined).
- JS.invoke: Executes a JavaScript function that exists in the global execution context with any CSPro arguments converted to their JavaScript equivalents.
- JS.setValue: Converts a CSPro variable to its JavaScript equivalent and adds this as a variable to the global scope, or sets an object's property.
- JS.setValueFromJson: Create a JavaScript variable using JSON and adds it as a variable to the global scope, or sets an object's property.
- A new action, throwException, throws an exception in the current execution environment.
- A new namespace, Network, provides functionality to make HTTP requests and handle responses, with the actions: Network.fetch, Network.fetchBody, Network.fetchBytes, Network.fetchFile, Network.fetchJson, and Network.fetchText
- Additional Data actions support interacting with data sources, with the new actions: Data.close, Data.contains, Data.countCases, Data.deleteCase, Data.getCurrentCase, Data.open, Data.query, Data.queryCases, Data.queryKeys, Data.readCase, and Data.writeCase.
- The functionality of Data.getCase has been replaced by Data.getCurrentCase and Data.readCase. The old action will remain for some time, but new applications should use the new actions.
- A new namespace, Sync, provides ways to interact with synchronization services, with the actions: Sync.connect, Sync.disconnect, Sync.sendMessage, and Sync.syncParadata.
- A new action, System.createShortcut, creates a shortcut to a CSPro application or file. The shortcut is placed on the Windows Desktop, or on the Android launcher.
- The UI.closeDialog action has been renamed UI.close, though the old name will remain as an alias for some time. A new argument allows the HTML dialog or web view to be closed without a valid result but instead with an exception that is thrown in the execution environment that launched the dialog or web view.
- A new action, UI.setWebViewOptions, sets options for the current web view. These options include allowing access to a device's camera, geolocation, and microphone.
- The JSON format of exceptions has changed from a string to an object with message, name, and cause properties.
- The File.copy action's overwrite flag has additional options to control whether a source file overwrites a destination file.
- SQLite in-memory databases can be opened using Sqlite.open by specifying ":memory:" as the name.
- The version of SQLite included with CSPro now supports mathematical functions such as atan2 and sin.
- Binary data can be cached, an optimization useful when binary data will be used by multiple actions.
- Resource IDs, such as those used by the Sqlite namespace's actions, do not need to be specified when they can be calculated implicitly.
- The Sqlite namespace's database resource ID argument is now named dbId. The old name, db, will work in CSPro 8.1 but not in future versions.
- The Logic.updateSymbolValue action has been renamed Logic.setSymbolValue, though the old name will remain as an alias for some time.
- The Compare Data tool will match duplicate cases by UUID when running a comparison in indexed order. Additionally, comparing cases in sequential order now works properly with data sources with duplicate cases.
- The Paradata Concatenator and paradata function's concatenation routines have been optimized, improving performance when processing many paradata logs.
- CSWeb requires PHP 8.1 or higher.
- CSPro 8.0 and earlier versions cannot synchronize data with CSWeb 8.1, so you must upgrade CSPro and CSWeb in tandem.
- The roles system has been overhauled, providing more granular control over what users can access. A new predefined role, Developer, gives more access than the Standard User role.
- The Standard User role can no longer create deployment packages, though it can be used to download and update applications. The new Developer role can be used for application deployments.
- The Data tab now contains two Manage in CSPro options: one to view data directly using Data Manager without downloading the entire data set, and the original option to download the data to your local machine.