Package com.adito.extensions

Examples of com.adito.extensions.ExtensionBundle


  private Map<String,ExtensionDescriptor> getLoadedPlugins() {
    Map<String,ExtensionDescriptor> map = new HashMap<String,ExtensionDescriptor>();
    for (Iterator i = getLoadedExtensions().entrySet().iterator(); i.hasNext();) {
      Map.Entry entry = (Map.Entry) i.next();
      ExtensionBundle b = (ExtensionBundle) entry.getValue();
      for (Iterator j = b.iterator(); j.hasNext();) {
        ExtensionDescriptor des = (ExtensionDescriptor) j.next();
        if (des.getExtensionType() instanceof PluginType) {
          map.put(des.getId(), des);
        }
      }
View Full Code Here


  }

  private Map<String,ExtensionBundle> getLoadedExtensions() {
    Map<String,ExtensionBundle> map = new HashMap<String,ExtensionBundle>();
    for (Iterator i = ExtensionStore.getInstance().getExtensionBundles().iterator(); i.hasNext();) {
      ExtensionBundle bundle = (ExtensionBundle) i.next();
      map.put(bundle.getId(), bundle);
    }
    return map;
  }
View Full Code Here

     */
    public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                                     HttpServletResponse response) throws Exception {
        try {
            String bundleId = request.getParameter("bundleId");
            ExtensionBundle bundle;
            try {
                bundle = ExtensionStore.getInstance().getExtensionBundle(bundleId);
            }
            catch(Exception e) {
                bundle = ExtensionStore.getInstance().getDownloadableExtensionStoreDescriptor(true).getApplicationBundle(bundleId);
View Full Code Here

            getSessionInfo(request).getUser());
        String id = request.getParameter("id");
        if (id == null || id.equals("")) {
            throw new Exception("No id parameter supplied.");
        }
        ExtensionBundle bundle = ExtensionStore.getInstance().getExtensionBundle(id);
        if (bundle == null) {
            throw new Exception("No application with an id of " + id);
        }
        ExtensionStore.getInstance().removeExtensionBundle(bundle);
        if (bundle.isContainsPlugin())
          GlobalWarningManager.getInstance().addMultipleGlobalWarning(new GlobalWarning(GlobalWarning.MANAGEMENT_USERS, new BundleActionMessage("extensions",
                            "extensionStore.message.pluginRemovedRestartRequired"), DismissType.DISMISS_FOR_USER));
        ActionMessages msgs = new ActionMessages();
        msgs.add(Globals.MESSAGE_KEY, new ActionMessage("extensionStore.message.applicationRemoved", bundle.getName()));
        saveMessages(request, msgs);
        return new RedirectWithMessages(mapping.findForward("refresh"), request);
    }
View Full Code Here

        ActionForward fwd = new RedirectWithMessages(mapping.findForward("refresh"), request);
        URLConnection con = ExtensionStore.getInstance().downloadExtension(id, version);
       
        try {
            InputStream in = con.getInputStream();           
            ExtensionBundle bundle = ExtensionStore.getInstance().installExtensionFromStore(id, in, request, con.getContentLength());
            ExtensionStore.getInstance().licenseCheck(bundle, request, fwd);
            ExtensionStore.getInstance().postInstallExtension(bundle, request);
            ActionMessages msgs = new ActionMessages();
            msgs.add(Globals.MESSAGE_KEY, new ActionMessage("extensionStore.message.applicationInstalled", bundle.getName()));
            saveMessages(request, msgs);
        } catch (CoreException ce) {
            ActionMessages errs = new ActionMessages();
            errs.add(Globals.ERROR_KEY, ce.getBundleActionMessage());
            saveErrors(request, errs);
View Full Code Here

            PolicyConstants.PERM_CHANGE,
            getSessionInfo(request).getUser());
        URLConnection con = ExtensionStore.getInstance().downloadExtension(id, version);
        try {
            InputStream in = con.getInputStream();           
            ExtensionBundle bundle = ExtensionStore.getInstance().updateExtension(id, in, request, con.getContentLength());
            if (bundle.isContainsPlugin())
              GlobalWarningManager.getInstance().addMultipleGlobalWarning(new GlobalWarning(GlobalWarning.MANAGEMENT_USERS, new BundleActionMessage("extensions",
                                "extensionStore.message.extensionUpdatedRestartRequired"), DismissType.DISMISS_FOR_USER));
            ActionMessages msgs = new ActionMessages();
            msgs.add(Globals.MESSAGE_KEY, new ActionMessage("extensionStore.message.applicationUpdated", bundle.getName()));
            saveMessages(request, msgs);
        } catch (CoreException ce) {
            ActionMessages errs = new ActionMessages();
            errs.add(Globals.ERROR_KEY, ce.getBundleActionMessage());
            saveErrors(request, errs);
View Full Code Here

                    throws Exception {
        String id = request.getParameter("id");
        PolicyUtil.checkPermission(PolicyConstants.EXTENSIONS_RESOURCE_TYPE,
            PolicyConstants.PERM_CHANGE,
            getSessionInfo(request).getUser());
        ExtensionBundle bundle = ExtensionStore.getInstance().getExtensionBundle(id);
        if (bundle.getStatus() == ExtensionBundleStatus.ENABLED) {
            bundle.start();
        }
        if (bundle.getStatus() == ExtensionBundleStatus.STARTED) {
            bundle.activate();
        }
        ActionMessages messages = new ActionMessages();
        messages.add(Globals.MESSAGE_KEY, new ActionMessage("extensionStore.message.applicationDisable", bundle.getName()));
        saveMessages(request, messages);
        return mapping.findForward("list");
    }
View Full Code Here

                    throws Exception {
        String id = request.getParameter("id");
        PolicyUtil.checkPermission(PolicyConstants.EXTENSIONS_RESOURCE_TYPE,
            PolicyConstants.PERM_CHANGE,
            getSessionInfo(request).getUser());
        ExtensionBundle bundle = ExtensionStore.getInstance().getExtensionBundle(id);
        bundle.stop();
        ActionMessages messages = new ActionMessages();
        messages.add(Globals.MESSAGE_KEY, new ActionMessage("extensionStore.message.applicationDisable", bundle.getName()));
        saveMessages(request, messages);
        return mapping.findForward("list");
    }
View Full Code Here

                    throws Exception {
        String id = request.getParameter("id");
        PolicyUtil.checkPermission(PolicyConstants.EXTENSIONS_RESOURCE_TYPE,
            PolicyConstants.PERM_CHANGE,
            getSessionInfo(request).getUser());
        ExtensionBundle bundle = ExtensionStore.getInstance().getExtensionBundle(id);
        if (!bundle.canDisable()) {
            throw new Exception("Bundle cannot be disabled.");
        }
        if (!bundle.isContainsPlugin()) {
            bundle.stop();
        }
        ExtensionStore.getInstance().disableExtension(id);
        if(bundle.isContainsPlugin()) {
          GlobalWarningManager.getInstance().addMultipleGlobalWarning(new GlobalWarning(GlobalWarning.MANAGEMENT_USERS, new BundleActionMessage("extensions",
                            "extensionStore.message.stateChangeRestartRequired"), DismissType.DISMISS_FOR_USER));
        }
        ActionMessages messages = new ActionMessages();
        messages.add(Globals.MESSAGE_KEY, new ActionMessage("extensionStore.message.applicationDisable", bundle.getName()));
        saveMessages(request, messages);
        return new RedirectWithMessages(mapping.findForward("list"), request);
    }
View Full Code Here

                    throws Exception {
        String id = request.getParameter("id");
        PolicyUtil.checkPermission(PolicyConstants.EXTENSIONS_RESOURCE_TYPE,
            PolicyConstants.PERM_CHANGE,
            getSessionInfo(request).getUser());
        ExtensionBundle bundle = ExtensionStore.getInstance().getExtensionBundle(id);
        if (!bundle.canEnable()) {
            throw new Exception("Bundle cannot be enabled.");
        }
        ExtensionStore.getInstance().enableExtension(id);
        if(bundle.isContainsPlugin()) {
          GlobalWarningManager.getInstance().addMultipleGlobalWarning(new GlobalWarning(GlobalWarning.MANAGEMENT_USERS, new BundleActionMessage("extensions",
                            "extensionStore.message.stateChangeRestartRequired"), DismissType.DISMISS_FOR_USER));
        } else {
            bundle.activate();
        }
        ActionMessages messages = new ActionMessages();
        messages.add(Globals.MESSAGE_KEY, new ActionMessage("extensionStore.message.applicationEnable", bundle.getName()));
        saveMessages(request, messages);
        return new RedirectWithMessages(mapping.findForward("list"), request);
    }
View Full Code Here

TOP

Related Classes of com.adito.extensions.ExtensionBundle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.