-
Notifications
You must be signed in to change notification settings - Fork 86
Build and deploy
This guide shows how to build and deploy Bimvie.ws testing. This has been tested in 02/2025.
Clone the BIMvie.ws (if you have not yet), BIMsurfer (old) and BIMserver Javascript API repositories.
git clone https://github.com/opensourceBIM/BIMvie.ws.git
git clone https://github.com/opensourceBIM/BIMsurfer-before2019.git
cd BIMsurfer-before2019
git checkout V1
cd ..
git clone https://github.com/opensourceBIM/BIMserver-JavaScript-API.gitWithin the BIMvie.ws, create a new folder called deps and subfolder bimserverjsapi and bimsurfer-v1. Copy the *.js files from BIMserver Javascript API and BIMsurfer to these subfolders respectively.
cd BIMvie.ws
mkdir deps
mkdir deps/bimserverjsapi
mkdir deps/bimsurfer-v1
cp ../BIMserver-JavaScript-API/*.js deps/bimserverjsapi
cp -R ../BIMsurfer-before2019/api deps/bimsurfer-v1
cp -R ../BIMsurfer-before2019/lib deps/bimsurfer-v1We need to adjust index.html and settings.js for the locations of BIMsurfer and BIMserver Javascript API.
NOTE: If you have chosen different folder names above other than deps/bimserverjsapi and deps/bimsurfer-v1, please use those.
Inside index.html, replace the following paths:
-
../bimserverjavascriptapi/bimserverclient.jswith../deps/bimserverjsapi/bimserverclient.js -
../bimserverjavascriptapi/bimserverapipromise.jswith../deps/bimserverjsapi/bimserverapipromise.js
Inside settings.js, replace the following paths:
-
"/apps/bimserverjavascriptapi";with"../deps/bimserverjsapi"; -
"../bimsurfer";with"../deps/bimsurfer-v1";
NOTE:
These should not be committed, as they are specific to a particular build or deployment.
You can test BIMvie.ws on your local machine with any webserver, for example using python3 -m http.server. With this setup, you have to tell BIMvie.ws the URL of the BIMserver through an URL parameter api_address.
For example, if you run the BIMvie.ws on port 8000 (python3 default) and BIMserver on port 8082 (BIMserver default), you use the URL http://localhost:8000/?api_address=http://localhost:8082.
The URL is stored in a cookie and you don't have to enter it again as long as you don't delete the cookie.
Alternatively, you can bake the Javascript into BIMserver plugin JAR and then install it into your local Maven repo.
npm install
node_modules/.bin/grunt
mvn installAs an alternative to mvn install you can just do mvn package and find the BIMvie.ws plugin JAR in the target directory. You can then install the plugin into BIMserver.
With this setup, BIMvie.ws and BIMserver come from the same server and you do not have to cater for the URL parameter. Instead, you select the web module from the BIMserver UI and BIMserver will provide its URL to the BIMvie.ws itself.