Running Profound.js Spaces Workspaces in Profound.js
Applications created on Profound.js Spaces can be exported and run in Profound.js. (Note: in Profound.js release 4.15.0, there's a new "Import" feature that automates these manual steps for you. Please see below for details).
Exporting a Profound.js Spaces Workspace
To export a workpace, right-click on Workspace Files in the Files tree in the Profound.js Spaces IDE and select Download Zip.
The ZIP file will include a directory that is named after the workspace.
Installing a New Profound.js Server with the Workspace
If the workspace start program is a Profound.js module or the workspace has Profound.js web service routes, the directory contents will look like below. In this example, a workspace created using the Rest Web Services template was exported:
The directory contains a package.json that can be used by NPM to install Profound.js. The 'modules' directory includes a sub-directory named 'app' which includes all of the workspace files, including the workspace Git repository:
To run the workspace in a new Profound.js installation, extract the contents of the ZIP to your desired PC or server and run npm install from within the top-level directory. This will install a copy of Profound.js in the directory. See Installation for more information on the installation process and server configuration.
Installing a Workspace in an Existing Profound.js Server
To run a workspace containing Profound.js programs in an existing Profound.js installation, place a copy of the 'app' directory into the 'modules' directory of the Profound.js server. The 'app' directory can be renamed, if desired. The Profound.js server will automatically load the workspace the next time it is restarted.
Installing a non-Profound.js Workspace in an Existing Profound.js Server
Workspaces that don't contain Profound.js programs (i.e. static HTML/CSS/JavaScript workspaces) are exported without the 'package.json' file and 'modules' directory that are used for installing Profound.js. Instead, just a directory containing the workspace files is exported. For example:
This type of workspace can only be installed in an existing Profound.js server. To install, copy the top-level directory into the Profound.js server's 'modules' directory. The directory can be renamed, if desired. The Profound.js server will automatically load the workspace the next time it is restarted.
Database Configuration
Profound.js Spaces workspaces come with a built-in MariaDB (MySQL) database that is only accessible from workspaces running on Profound.js Spaces. To run a workspace that uses the database in Profound.js, you'll need to set up an instance of MariaDB or MySQL that Profound.js can connect to, and configure the 'mysql' database driver. See databaseConnections for database driver configuration details.
Running the Workspace
Once the workspace is installed, the workspace can be launched using a URL path that matches the workspace directory name in 'modules'. For example, if the default directory name 'app' is used, then the workspace start file can be launched with a URL like this:
http://localhost:8081/app
Web service routes can be run by appending the route path to the URL above. For example, to run a web service with route path 'list':
http://localhost:8081/app/list
Configuring Workspace Settings
The Profound.js Designer is aware of workspaces and can be used to edit the workspace's app start file, and to edit web service routes. To edit settings, click right-click on the desired file in the Designer's Files tree and select Properties.
Settings changed in the File Properties dialog will be saved to the workspace's 'settings.json' file and will be effective immediately.Â
Deploying Changes to Profound.js Spaces
Changes made to a workspace with Profound.js can be deployed to Profound.js Spaces via GitHub. If the Profound.js Spaces workspace was setup on or cloned from GitHub, changes can be pushed from the Profound.js Designer to GitHub. See Git Integration for information on using Git in the Profound.js Designer.Â
Changes can then be manually pulled from GitHub into the Profound.js Spaces IDE, or the workspace can be configured to automatically sync with GitHub so that it performs an automatic pull when changes are pushed to GitHub. See the Profound.js Spaces docs for information on using Git in the Profound.js Spaces IDE.
Importing a Profound.js Spaces workspace into Profound.js
In Profound.js version 4.15.0, an "Import' button has been added to the "Home" ribbon in the Profound.js Designer that makes it easy to import a Profound.js Spaces workspace into Profound.js and run it. It automates the manual steps that you would have to do as detailed above for earlier releases of Profound.js.
Example:
1) Suppose you have a Profound.js Spaces workspace called "rdf-hello" that was created from the "Rich Display Hello World" template that you want to import into Profound.js and run it.
2) In Profound.js Designer, click the "Import" button on the "Home" ribbon.
3) The "Import Cloud Workspace" dialog below is displayed. Input the owner, the workspace, and the module name that you want to use for the workspace in Profound.js. By default, the module name is the same as the workspace and is automatically filled out as you input the workspace. In the example, the workspace and module names are both "rdf-hello". Click "Import".
4) All the files needed to run that workspace in Profound.js are downloaded from Profound.js Spaces and uploaded into a sub-directory (with the same name as the module name) under the directory "modules" in the directory where Profound.js is installed. In this example, the sub-directory (module) name is "rdf-hello".
5) Re-start Profound.js server to refresh the routes needed to run your workspace. Click "Launch/Launch Profound.js Module" to run the workspace "rdf-hello" that you just imported into Profound.js.
Two improvements have been added to this new "Import" feature in the release after Profound.js 4.15.0:
1) If a sub-directory with the same name already exists in directory "modules", you will be prompted with a Warning message asking if you want to replace it or not.
2) The "Import" action will also automatically refresh the routes needed to run your workspace in Profound.js, so that you can run that workspace without having to re-start the Profound.js server.
Some documentation pages have recently moved to a new section: Profound AppDev. If you are having trouble finding specific pages, try the documentation search capability or reach out to our Support team!