use of org.bimserver.plugins.OptionsParser in project BIMserver by opensourceBIM.
the class LocalDevBimServerStarterJar method main.
public static void main(String[] args) {
OptionsParser optionsParser = new OptionsParser(args);
ResourceFetcher resourceFetcher = new ClasspathResourceFetcher();
try {
String resourceBase = resourceFetcher.getURL("www").toExternalForm();
System.out.println("Resource base" + resourceBase);
new LocalDevBimServerStarterJar().start(-1, "127.0.0.1", "LocalDev BIMserver (8080)", 8080, 8085, optionsParser.getPluginDirectories(), optionsParser.getHome(), resourceFetcher, resourceBase, false);
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
use of org.bimserver.plugins.OptionsParser in project BIMserver by opensourceBIM.
the class TestInOut method start.
private void start(String[] args) {
BimServerConfig config = new BimServerConfig();
Path homeDir = Paths.get("home");
try {
if (Files.isDirectory(homeDir)) {
PathUtils.removeDirectoryWithContent(homeDir);
}
} catch (IOException e) {
e.printStackTrace();
}
config.setClassPath(System.getProperty("java.class.path"));
config.setHomeDir(homeDir);
config.setPort(8080);
config.setStartEmbeddedWebServer(true);
config.setResourceFetcher(new LocalDevelopmentResourceFetcher(Paths.get("../")));
BimServer bimServer = new BimServer(config);
try {
LocalDevPluginLoader.loadPlugins(bimServer.getPluginBundleManager(), new OptionsParser(args).getPluginDirectories());
bimServer.start();
if (bimServer.getServerInfo().getServerState() == ServerState.NOT_SETUP) {
AdminInterface adminInterface = bimServer.getServiceFactory().get(new SystemAuthorization(1, TimeUnit.HOURS), AccessMethod.INTERNAL).get(AdminInterface.class);
adminInterface.setup("http://localhost:8080", "Administrator", "admin@bimserver.org", "admin", null, null, null);
SettingsInterface settingsInterface = bimServer.getServiceFactory().get(new SystemAuthorization(1, TimeUnit.HOURS), AccessMethod.INTERNAL).get(SettingsInterface.class);
settingsInterface.setCacheOutputFiles(false);
}
BimServerClientInterface client = LocalDevSetup.setupJson("http://localhost:8080");
SProject project = client.getServiceInterface().addProject("test", "ifc2x3tc1");
SDeserializerPluginConfiguration deserializer = client.getServiceInterface().getSuggestedDeserializerForExtension("ifc", project.getOid());
Path inputFile = Paths.get("../TestData/data/AC11-Institute-Var-2-IFC.ifc");
client.checkinSync(project.getOid(), "test", deserializer.getOid(), false, inputFile);
project = client.getServiceInterface().getProjectByPoid(project.getOid());
SSerializerPluginConfiguration serializer = client.getServiceInterface().getSerializerByContentType("application/ifc");
Path outputFile = Paths.get("output.ifc");
client.download(project.getLastRevisionId(), serializer.getOid(), outputFile);
Diff diff = new Diff(false, false, false, inputFile, outputFile);
diff.start();
} catch (ServerException e) {
e.printStackTrace();
} catch (DatabaseInitException e) {
e.printStackTrace();
} catch (BimserverDatabaseException e) {
e.printStackTrace();
} catch (PluginException e) {
e.printStackTrace();
} catch (DatabaseRestartRequiredException e) {
e.printStackTrace();
} catch (UserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (PublicInterfaceNotFoundException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (CompareException e) {
e.printStackTrace();
} catch (BimServerClientException e) {
e.printStackTrace();
}
}
use of org.bimserver.plugins.OptionsParser in project BIMserver by opensourceBIM.
the class LocalDevBimServerStarter method main.
public static void main(String[] args) {
OptionsParser optionsParser = new OptionsParser(args);
ResourceFetcher resourceFetcher = new LocalDevelopmentResourceFetcher(Paths.get("../"));
new LocalDevBimServerStarter().start(-1, "127.0.0.1", "LocalDev BIMserver (8080)", 8080, 8085, optionsParser.getPluginDirectories(), optionsParser.getHome(), resourceFetcher, Paths.get("../BimServer").resolve("www").toAbsolutePath().toString(), true);
}
use of org.bimserver.plugins.OptionsParser in project BIMserver by opensourceBIM.
the class LocalDevSetup method setupPluginManager.
public static final PluginManagerInterface setupPluginManager(String[] args) {
try {
Path home = Paths.get("home");
if (!Files.exists(home)) {
Files.createDirectory(home);
}
Path tmp = home.resolve("tmp");
if (!Files.exists(tmp)) {
Files.createDirectories(tmp);
}
MavenPluginRepository mavenPluginRepository = new MavenPluginRepository();
PluginManager pluginManager = new PluginManager(tmp, System.getProperty("java.class.path"), null, null, null, null);
MetaDataManager metaDataManager = new MetaDataManager(tmp);
pluginManager.setMetaDataManager(metaDataManager);
PluginBundleManager pluginBundleManager = new PluginBundleManager(pluginManager, mavenPluginRepository, home.resolve("plugins"));
loadPlugins(pluginBundleManager, Paths.get(".."), new OptionsParser(args).getPluginDirectories());
metaDataManager.init(false);
pluginManager.initAllLoadedPlugins();
return pluginManager;
} catch (PluginException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
Aggregations