public void run(){ try { syncService.setCacheOutputFiles(cacheOutputFiles); callback.success(); } catch (Throwable e) { callback.error(e); } } });
public void run(){ try { callback.success(syncService.getServiceRepositoryUrl()); } catch (Throwable e) { callback.error(e); } } });
public void run(){ try { syncService.setPluginStrictVersionChecking(strict); callback.success(); } catch (Throwable e) { callback.error(e); } } });
@Override public void setup(String siteAddress, String serverName, String serverDescription, String serverIcon, String adminName, String adminUsername, String adminPassword) throws ServerException, UserException { SettingsInterface settingsInterface = getServiceMap().get(SettingsInterface.class); if (!siteAddress.startsWith("http://") && !siteAddress.startsWith("https://")) { throw new UserException("Site address should start with \"http://\" or \"https://\""); } if (siteAddress.startsWith("http://http://") || siteAddress.startsWith("https://https://")) { throw new UserException("Site address should not have duplicate protocols"); } settingsInterface.setSiteAddress(siteAddress); settingsInterface.setServerName(serverName); settingsInterface.setServerDescription(serverDescription); settingsInterface.setServerIcon(serverIcon); if (adminUsername.trim().isEmpty()) { throw new UserException("Admin Username cannot be empty"); } if (adminPassword.trim().isEmpty()) { throw new UserException("Admin Password cannot be empty"); } DatabaseSession session = getBimServer().getDatabase().createSession(); try { AddUserDatabaseAction addUserDatabaseAction = new AddUserDatabaseAction(getBimServer(), session, AccessMethod.INTERNAL, adminUsername, adminPassword, adminName, UserType.ADMIN, getAuthorization(), false, ""); session.executeAndCommitAction(addUserDatabaseAction); } catch (BimserverDatabaseException e) { LOGGER.error("", e); } finally { session.close(); } getBimServer().getServerInfoManager().update(); }
adminInterface.setup("http://localhost:" + port, name, "My Description", "http://localhost:" + port + "/img/bimserver.png", "Administrator", "admin@bimserver.org", "admin"); SettingsInterface settingsInterface = bimServer.getServiceFactory().get(new SystemAuthorization(1, TimeUnit.HOURS), AccessMethod.INTERNAL).get(SettingsInterface.class); settingsInterface.setCacheOutputFiles(false); settingsInterface.setPluginStrictVersionChecking(false); } catch (Exception e) {
public void run(){ try { syncService.setServerName(serverName); callback.success(); } catch (Throwable e) { callback.error(e); } } });
public void run(){ try { syncService.setSiteAddress(siteAddress); callback.success(); } catch (Throwable e) { callback.error(e); } } });
public void run(){ try { syncService.setServerDescription(strict); callback.success(); } catch (Throwable e) { callback.error(e); } } });
public void run(){ try { syncService.setServerIcon(serverIcon); callback.success(); } catch (Throwable e) { callback.error(e); } } });
public void run(){ try { callback.success(syncService.getEmailSenderAddress()); } catch (Throwable e) { callback.error(e); } } });
public void run(){ try { callback.success(syncService.getProtocolBuffersPort()); } catch (Throwable e) { callback.error(e); } } });
@Override public List<SModelCheckerInstance> getAllRepositoryModelCheckers() throws ServerException, UserException { requireRealUserAuthentication(); try { List<SModelCheckerInstance> modelCheckers = new ArrayList<SModelCheckerInstance>(); String content = NetUtils.getContent(new URL(getServiceMap().get(SettingsInterface.class).getServiceRepositoryUrl() + "/modelcheckers"), 5000); JSONObject root = new JSONObject(new JSONTokener(content)); JSONArray modelCheckersJson = root.getJSONArray("modelcheckers"); for (int i = 0; i < modelCheckersJson.length(); i++) { JSONObject modelCheckerJson = modelCheckersJson.getJSONObject(i); SModelCheckerInstance sModelChecker = new SModelCheckerInstance(); sModelChecker.setName(modelCheckerJson.getString("name")); sModelChecker.setCode(modelCheckerJson.getString("code")); sModelChecker.setDescription(modelCheckerJson.getString("description")); sModelChecker.setModelCheckerPluginClassName(modelCheckerJson.getString("modelCheckerPluginClassName")); modelCheckers.add(sModelChecker); } return modelCheckers; } catch (Exception e) { return handleException(e); } }
adminInterface.setup("http://localhost:" + port, "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);
@Override public SExtendedDataSchema getExtendedDataSchemaFromRepository(String namespace) throws UserException, ServerException { requireRealUserAuthentication(); try { String content = NetUtils.getContent(new URL(getServiceMap().get(SettingsInterface.class).getServiceRepositoryUrl() + "/extendeddataschemas?namespace=" + namespace), 5000); JSONObject root = new JSONObject(new JSONTokener(content)); SExtendedDataSchema sExtendedDataSchema = new SExtendedDataSchema(); sExtendedDataSchema.setName(root.getString("name")); sExtendedDataSchema.setContentType(root.getString("contentType")); sExtendedDataSchema.setUrl(root.getString("url")); return sExtendedDataSchema; } catch (Exception e) { return handleException(e); } }
content = NetUtils.getContent(new URL(getServiceMap().get(SettingsInterface.class).getServiceRepositoryUrl() + "/extendeddataschemas.json"), 5000);
try { List<SServiceDescriptor> sServiceDescriptors = new ArrayList<SServiceDescriptor>(); URL url = new URL(getServiceMap().get(SettingsInterface.class).getServiceRepositoryUrl() + "/services.json"); String content = NetUtils.getContent(url, 5000); JSONObject root = new JSONObject(new JSONTokener(content));