@Override public Void execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException, ServerException { LocalMavenPluginBundle mavenPluginBundle = new LocalMavenPluginBundle(data); try { List<SPluginInformation> pluginInformationFromPluginFile = bimServer.getPluginManager().getPluginInformationFromJar(new ByteArrayInputStream(data)); for (SPluginInformation sPluginInformation : pluginInformationFromPluginFile) { sPluginInformation.setEnabled(true); if (installAllPluginsForAllUsers) { sPluginInformation.setInstallForAllUsers(true); } if (installAllPluginsForNewUsers) { sPluginInformation.setInstallForNewUsers(true); } } bimServer.getPluginManager().install(mavenPluginBundle, pluginInformationFromPluginFile, false); } catch (Exception e) { LOGGER.error("", e); throw new UserException(e); } return null; } }
setEnabled((Boolean)val); return;
private void processPluginDescriptor(PluginDescriptor pluginDescriptor, List<SPluginInformation> list) { for (AbstractPlugin pluginImplementation : pluginDescriptor.getPlugins()) { if (pluginImplementation instanceof JavaPlugin) { JavaPlugin javaPlugin = (JavaPlugin) pluginImplementation; SPluginInformation sPluginInformation = new SPluginInformation(); String name = javaPlugin.getName(); // TODO when all plugins have a name, this code can go if (name == null) { name = javaPlugin.getImplementationClass(); } sPluginInformation.setName(name); sPluginInformation.setDescription(javaPlugin.getDescription()); sPluginInformation.setEnabled(true); // For java plugins we use the implementation class as // identifier sPluginInformation.setIdentifier(javaPlugin.getImplementationClass()); sPluginInformation.setType(getPluginTypeFromClass(javaPlugin.getInterfaceClass())); list.add(sPluginInformation); } else if (pluginImplementation instanceof org.bimserver.plugins.WebModulePlugin) { org.bimserver.plugins.WebModulePlugin webModulePlugin = (org.bimserver.plugins.WebModulePlugin) pluginImplementation; SPluginInformation sPluginInformation = new SPluginInformation(); sPluginInformation.setIdentifier(webModulePlugin.getIdentifier()); sPluginInformation.setName(webModulePlugin.getName()); sPluginInformation.setDescription(webModulePlugin.getDescription()); sPluginInformation.setType(SPluginType.WEB_MODULE); sPluginInformation.setEnabled(true); list.add(sPluginInformation); } } }
SPluginInformation sPluginInformation = new SPluginInformation(); sPluginInformation.setEnabled(true); sPluginInformation.setDescription(pluginDescriptor.getDescription()); sPluginInformation.setIdentifier(pluginDescriptor.getIdentifier());
public SPluginInformation convertToSObject(PluginInformation input) { if (input == null) { return null; } SPluginInformation result = new SPluginInformation(); result.setOid(input.getOid()); result.setRid(input.getRid()); result.setName(input.getName()); result.setType(SPluginType.values()[input.getType().ordinal()]); result.setDescription(input.getDescription()); result.setEnabled(input.isEnabled()); result.setIdentifier(input.getIdentifier()); result.setInstallForAllUsers(input.isInstallForAllUsers()); result.setInstallForNewUsers(input.isInstallForNewUsers()); return result; }