Uploading CAWI projects to SCROLL
SCRAPI (SCROLL API) is a system for loading complete, or components of, CAWI projects into SCROLL. It uses a script, scrapi, to load the files.
Loading a complete project
The example below is based on using SCRAPI to load CAWI project myproject into SCROLL account MyAccount on server scroll.infotap.uk.
Develop and test the CAWI project on a local machine or a server in the usual way.
For convenience add a new user to the SCROLL account for the SCRAPI run.
If an existing user is used then they will be logged out of any open SCROLL session when scrapi is run. When testing it is convenient to have a SCROLL session open for testing and not have to login again after each SCRAPI update.
In the example below the main account user is fred.bloggs@gide.net so text "+API" is added to the email of the user created for running SCRAPI. The SCRAPI user must be an Account Administrator with Full project rights.
Create file scrapi.json to specify the project account details.
{"server" : "https://scroll.infotap.uk",
"email" : "fred.bloggs+API@gide.net",
"account" : "MyAccount",
"project" : "myproject"
}
- Use scrapi to create the new project in SCROLL with no layout as in the example below:
scrapi create-project myproject "My project title" none
- Write a script to use scrapi to upload the CAWI files and directories to SCROLL.
scrapi upload dsc myproject.dsc
scrapi upload rsc myproject.rsc/*
scrapi upload docs myproject.docs/*
scrapi upload ini myproject.ini
- Sign in to SCRAPI
scrapi sign-in
When prompted enter the SCROLL account password for the user specified in scrapi.json
- Run the script to run scrapi and upload the CAWI project files.
List of scrapi actions
The full list of actions that can be performed with the scrapi command are listed below. User and account details can be supplied in the scrapi.json file or as arguments to the scrapi command.
Usage:
scrapi [--arg value ...] action [params ...]
Where arg is:
--server SCROLL server - e.g. https://scroll.infotap.uk
--email Email address of user to connect as.
--account Name of SCROLL account to access
--project Identifier of project to access
and action is:
status Display current authentication status using cached credentials
sign-in Authenticate to server (enter password when prompted)
sign-out Sign out from server (invalidate current session)
list-accounts List all accounts the user can access
list-projects List all projects in selected account
list-layouts List all layouts available in selected account
create-project Create a new project
identifier Short identifier
title Title
layout Layout tag (or "none" for no layout)
project-info Return info about selected project
upload Upload a file to the development zone
dir Target directory (or file) for upload - "dsc", "ini", "rsc" or "docs"
file Name of file(s)
publish Publish project (copy from development to live zones)
upload-data Upload data (.csv, .xlsx, .zip, .scroll) to data zone
file Name of file(s)
upload-global-data Upload data (.csv, .xlsx, .zip, .scroll) to global distribution list
file Name of file(s)
delete-data Delete all data from project distribution list
delete-global-data Delete all data from a data project
Examples:
scrapi --server https://scroll.infotap.uk --email fred.bloggs+API@gide.net sign-in
scrapi --server https://scroll.infotap.uk --email fred.bloggs+API@gide.net list-accounts
scrapi --server https://scroll.infotap.uk --email fred.bloggs+API@gide.net --account MyAccount list-projects
scrapi --server https://scroll.infotap.uk --email fred.bloggs+API@gide.net --account MyAccount --project myproject project-info
scrapi --server https://scroll.infotap.uk --email fred.bloggs+API@gide.net --account MyAccount --project myproject upload dsc myproject.dsc