-
Notifications
You must be signed in to change notification settings - Fork 614
BimServerClientMavenEclipse
hlg edited this page Nov 18, 2021
·
6 revisions
First, make sure your Eclipse version has maven support, if it hasn't you need to install the m2e plugin first.
Create a new Maven project (you can also convert an existing project to a Maven project if you want).
Edit the pom.xml file. Add the following (make sure the version of the bimserverclientlib matches with the version of BIMserver you want to connect to):
<dependencies>
<dependency>
<groupId>org.opensourcebim</groupId>
<artifactId>bimserverclientlib</artifactId>
<version>1.5.51</version>
</dependency>
</dependencies>
Add a new Class
Copy and paste the following test-snippet:
import org.bimserver.client.BimServerClient;
import org.bimserver.client.json.JsonBimServerClientFactory;
import org.bimserver.shared.ChannelConnectionException;
import org.bimserver.shared.UsernamePasswordAuthenticationInfo;
import org.bimserver.shared.exceptions.BimServerClientException;
import org.bimserver.shared.exceptions.PublicInterfaceNotFoundException;
import org.bimserver.shared.exceptions.ServiceException;
public class Main {
public static void main(String[] args) {
try {
JsonBimServerClientFactory clientFactory = new JsonBimServerClientFactory("http://localhost:8080");
BimServerClient client = clientFactory.create(new UsernamePasswordAuthenticationInfo("[email protected]", "admin"));
client.getServiceInterface().addProject("test", "ifc2x3tc1");
} catch (BimServerClientException | ServiceException | ChannelConnectionException e) {
e.printStackTrace();
} catch (PublicInterfaceNotFoundException e) {
e.printStackTrace();
}
}
}
Run as Java application
The results (note: When you run the application a second time, you will get an error saying the project name is already used).
Get Started
- Quick Guide
- Requirements Version 1.2
- Requirements Version 1.3
- Requirements Version 1.4
- Requirements Version 1.4 > 2015-09-12
- Requirements Version 1.5
- Download
- JAR Starter
- Setup
Deployment
- Ubuntu installation 1.3
- Windows installation
- Security
- Memory Usage
- More memory
- Performance statistics
- Large databases
Developers
- Service Interfaces
- Common functions
- Data Model
- Low Level Calls
- Endpoints
Clients
BIMServer Developers
- Plugins in 1.5
- Plugin Development
- Eclipse
- Eclipse Modeling Framework
- Embedding
- Terminology
- Database/Versioning
- IFC STEP Encoding
- Communication
- Global changes in 1.5
- Writing a service
- Services/Notifications
- BIMserver 1.5 Developers
- Extended data
- Extended data schema
- Object IDM
New developments
- New remote service interface
- Plugins new
- Deprecated
- New query language
- Visual query language
- Reorganizing BIMserver JavaScript API
General