Uniform Resource Identifiers (URIs) provide a standardized way to identify and access resources. They typically follow the structure scheme://resource, where the scheme indicates how the resource should be interpreted or handled. Some widely used schemes include https for web resources and mailto for email messages.
CSPro uses a URI with the custom scheme
cspro. A CSPro URI does not use an
authority. The first part of the resource path is a description, or action, with the following options:
Beyond the scheme, empty authority, and path, a CSPro URI can contain properties specified as a
query string. If creating a query string dynamically in logic, you can use the
encode function with the
URIComponent argument.
A tool, CSPro URI Handler, is distributed with the CSPro suite and registered with Windows so that URIs that begin with
cspro:// are handled by CSPro. URIs that begin with the path
/data are opened in
Data Manager and URIs that begin with
/text are opened in
Text Viewer.
CSPro URIs with a path beginning in
/data can be used as
data connection strings. For example, the following two statements result in identical behavior:
setfile(HOUSING_DICT, "housing.json|writeLabels=true");
setfile(HOUSING_DICT, "cspro:///data/housing.json?writeLabels=true");
On Windows, data CSPro URIs are opened in
Data Manager. For example, if the CSPro examples are installed in the directory
C:\cspro-examples\, the following URI would open the Popstan Census data file:
cspro:///data/C:/cspro-examples/Popstan%20Census/Popstan%20Census.dat
The following defines a property, specified as a query string, so that Data Manager does not ask for a dictionary to describe the
Text data source, and further gives the key (case IDs) of a case to open.
cspro:///data/C:/cspro-examples/Popstan%20Census/Popstan%20Census.dat?dictionaryPath=Census%20Dictionary.dcf&key=010117100110870031
CSPro URIs with a path beginning in
/sync can be used as
sync connection strings. For example, the following two statements result in identical behavior:
syncconnect("https://example.org/csweb/api|username=islands&password=violet")
syncconnect("cspro:///sync/https://example.org/csweb/api?username=islands&password=violet")
On Windows, CSPro URIs with a path beginning in
/text are opened in
Text Viewer. For example, pasting this URL in File Explorer or a web browser will open the
readme.txt file located in the CSPro installation folder.
cspro:///text/C:/Program%20Files%20(x86)/CSPro%208.1/readme.txt