-
Notifications
You must be signed in to change notification settings - Fork 614
Plugin Development
The BIMserver project has a strong focus on interaction with other systems, that's what the Service Interfaces are for (accessible via SOAP, Protocol Buffers or JSON). However, some logic will only work (efficiently) when running within the BIMserver, that's where plugins come into play.
All plugins implement the Plugin interface:
public interface Plugin {
void init(PluginManager pluginManager) throws PluginException; // Initialization code, if your plugin requires other plugins, this is the time to check for them, be sure to throw a PluginException when something is wrong
String getName(); // A short name of this plugin
String getDescription(); // A short description of this plugin
String getVersion(); // A version, not used for dependencies (yet)
boolean isInitialized(); // Should return whether this plugin is successfully initialized
}
Do not implement the Plugin class directly, there are sub-interfaces for the different purposes plugins can have.
Name | Functionality |
---|---|
Serializer | Create a serialized version of a model (can be text or binary) |
Deserializer | Parse a serialized version of a model and store it in the database |
Render Engine | Triangulates IFC geometry |
Query Engine | Provides a way of querying a model |
Schema | Provides the BIMserver with metadata about the models |
Object IDM | Provides the BIMserver with a way of traversing objects |
Model Merge | Merge multiple models into one model |
Model Compare | Compare 2 models |
Service | Services can be triggered by certain events |
This tutorial assumes you use eclipse, but other IDEs should also work
The easiest way to learn is to look how other people have done things, there are quite a few plugins already, so have a look at them.
- Create a new java project for your plugin, for example "PluginTest"
- Create your plugin class, this class must implement the plugin interface you want to write a plugin for, make sure you implement all methods correctly. For this example we will create a serializer and we will name the plugin "TestSerializerPlugin" in the package "test".
- Create a plugin folder under your project
- Create a plugin.xml file under the plugin folder, the content should like like this:
<?xml version="1.0" encoding="utf-8"?>
<PluginDescriptor>
<PluginImplementation>
<interfaceClass>org.bimserver.plugins.serializers.SerializerPlugin</interfaceClass>
<implementationClass>test.TestSerializerPlugin</implementationClass>
<enabled>true</enabled>
</PluginImplementation>
</PluginDescriptor>
Now to test your plugin locally you will have to tell the BIMserver where your plugin can be found. Edit "LocalDevPluginLoader.java" and look for the lines with loadPluginFromEclipseProject. Add
pluginManager.loadPluginsFromEclipseProject(new File("../PluginTest"));
Now you can start the BIMserver and your plugin should be available as yet another way to serialize models.
To make your plugin available on deployed BIMservers (either WAR or JAR), you have to create a JAR file of your plugin. It should contain the compiled code, your plugin folder (+plugin.xml), and any required JAR files. The place of jar files doesn't matter, as long as they have the extension ".jar".
BIMserver is an open framework that uses Plugins. Derivatives of bimserver.org code inherit the Affero GPL code. Plugins build from scratch can also be licensed under the GPL license (and used as plugin in BIMserver). This does not go for snippets, GUIs and some separate (or remote) running services where BIMserver is a client to that service. Again: when in doubt, feel free to contact us. More details and examples on http://bimserver.org/license/
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