@Override public View getContentView(HttpServletRequest request, PluginContext pluginContext) { if (pluginContext.getLocalPath().equals("/edit")) { Bundle bundle = getBundleById(request.getParameter("id")); BundleConfiguration bundleConfiguration = null; try { bundleConfiguration = new BundleConfiguration(bundle, configAdmin, metaTypeService); } catch (Exception e) { message = "Error: " + e.getMessage(); return new RedirectView(pluginContext.getApplicationPath()); } return new ConfigurationView(bundle, bundleConfiguration, metaTypeService, loader); } else if (pluginContext.getLocalPath().equals("/changebundle")) { String id = request.getParameter("id"); Bundle bundle = getBundleById(id); try { BundleConfiguration bundleConfiguration = new BundleConfiguration(bundle, configAdmin, metaTypeService); Dictionary<String, String> bundleProperties = new Hashtable<String, String>(); String[] keys = request.getParameterValues("keyList"); if (keys != null) { for (String key : keys) { String value = request.getParameter(key + "Property"); if (value != null && !value.isEmpty()) { bundleProperties.put(key, request.getParameter(key + "Property")); } } } String newkey = request.getParameter("newkey"); if (!newkey.equals("")) { bundleProperties.put(newkey, request.getParameter("newkeyProperty")); } bundleConfiguration.setBundleProperties(bundleProperties); return new RedirectView(pluginContext.getApplicationPath() + "/edit?id=" + id); } catch (Exception e) { message = "Error: " + e.getMessage(); return new RedirectView(pluginContext.getApplicationPath()); } } else if (pluginContext.getLocalPath().equals("/install")) { installBundle(request, pluginContext); return new RedirectView(pluginContext.getApplicationPath()); } else if (pluginContext.getLocalPath().equals("/uninstall")) { Bundle bundle = getBundleById(request.getParameter("id")); if (bundle != null) { try { message = "Info: " + bundle.getSymbolicName() + " uninstalled"; bundle.uninstall(); } catch (BundleException e) { message = "Error: " + e.getMessage(); } } return new RedirectView(pluginContext.getApplicationPath()); } else if (pluginContext.getLocalPath().equals("/update")) { Bundle bundle = getBundleById(request.getParameter("id")); if (bundle != null) { try { message = "Info: " + bundle.getSymbolicName() + " updated"; bundle.update(); } catch (BundleException e) { message = "Error: " + e.getMessage(); } } return new RedirectView(pluginContext.getApplicationPath()); } else if (pluginContext.getLocalPath().equals("/stop")) { Bundle bundle = getBundleById(request.getParameter("id")); if (bundle != null) { try { message = "Info: " + bundle.getSymbolicName() + " stoped"; bundle.stop(); } catch (BundleException e) { message = "Error: " + e.getMessage(); } } return new RedirectView(pluginContext.getApplicationPath()); } else if (pluginContext.getLocalPath().equals("/start")) { Bundle bundle = getBundleById(request.getParameter("id")); if (bundle != null) { try { message = "Info: " + bundle.getSymbolicName() + " started"; bundle.start(); } catch (BundleException e) { message = "Error: " + e.getMessage(); } } return new RedirectView(pluginContext.getApplicationPath()); } else { String temp = message; message = null; return new BundleListView(context, loader, temp); } }