-
Notifications
You must be signed in to change notification settings - Fork 612
BimServerClient
To connect to a BIMserver you can use one of the 3 protocols: SOAP, [JSON](JSON API) or [Protocol Buffers](Protocol Buffers). To make connecting to a BIMserver even easier, there also is a Java library you can use.
You can download a nightly build here, select the latest date, and then the file named "bimserver-client-lib-[date].zip". Or download a release.
Extract the zipfile, copy the jar files from the "lib" and "dep" folders to your own project and include them in the build path.
Of course you can also use the client from source code, in that case download a source zip file, or checkout the projects from GIT.
Connecting via SOAP with authentication, and listing all projects
// Create a BimServerClientFactory, change Json to ProtocolBuffers or Soap if you like
BimServerClientFactory factory = new SoapBimServerClientFactory("http://localhost:8080");
// Create a new BimServerClient with authentication
BimServerClient bimServerClient = factory.create(new UsernamePasswordAuthenticationInfo("[email protected]", "admin"));
// List project names
for (SProject project : bimServerClient .getBimsie1ServiceInterface().getAllProjects(true, true)) {
System.out.println(project.getName());
}
Connecting with JSON and checking in a file:
// Create a BimServerClientFactory, change Json to ProtocolBuffers or Soap if you like
BimServerClientFactory factory = new JsonBimServerClientFactory("http://localhost:8080");
// Create a new BimServerClient with authentication
BimServerClientInterface bimServerClient = getFactory().create(new UsernamePasswordAuthenticationInfo("[email protected]", "admin"));
// Create a new project
SProject newProject = bimServerClient.getBimsie1ServiceInterface().addProject("test" + Math.random());
// This is the file we will be checking in
File ifcFile = new File("../TestData/data/AC11-FZK-Haus-IFC.ifc");
// Find a deserializer to use
SDeserializerPluginConfiguration deserializer = bimServerClient.getBimsie1ServiceInterface().getSuggestedDeserializerForExtension("ifc");
// Checkin
bimServerClient.checkin(newProject.getOid(), "test", deserializer.getOid(), false, true, ifcFile);
Connect via JSON and Download a revision as IFC
// Create a BimServerClientFactory, change Json to ProtocolBuffers or Soap if you like
BimServerClientFactory factory = new JsonBimServerClientFactory("http://localhost:8080");
// Find a serializer
SSerializerPluginConfiguration serializer = bimServerClient.getBimsie1ServiceInterface().getSerializerByContentType("application/ifc");
// Get the project details
SProject project = bimServerClient.getBimsie1ServiceInterface().getProjectByPoid([INSERT OID OF YOUR PROJECT]);
// Download the latest revision
Long downloadId = bimServerClient.getBimsie1ServiceInterface().download(project.getLastRevisionId(), colladaSerializer.getOid(), true, false); // Note: sync: false
InputStream downloadData = bimServerClient.getDownloadData(downloadId, serializer .getOid());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
IOUtils.copy(downloadData, baos);
System.out.println(baos.size() + " bytes downloaded");
Examples on how to use the client-library can be found here.
Examples on how to use the client-side EMF model can be found here
Examples on how to use the low-level-calls from the client library are here
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