Package com.adito.core

Examples of com.adito.core.BundleActionMessage


                msgs.add(Globals.ERROR_KEY, new ActionMessage("login.invalidCredentials"));
                saveErrors(request, msgs);
                return new RedirectWithMessages(mapping.findForward("logon"), request);
            } catch (Exception e) {
                log.error("Internal error authenticating.", e);
                msgs.add(Globals.ERROR_KEY, new BundleActionMessage("security", "login.error", e.getMessage()));
                saveErrors(request, msgs);
                request.getSession().setAttribute(Constants.EXCEPTION, e);
              request.getSession().removeAttribute(LogonStateAndCache.LOGON_STATE_MACHINE);
                request.getSession().removeAttribute(Constants.AUTH_SESSION);
                return new RedirectWithMessages(mapping.findForward("logon"), request);
            }
        } else {
            ActionMessages errs = new ActionMessages();
            errs.add(Globals.MESSAGE_KEY, new BundleActionMessage("security", "login.logonNotAllowed", "No scheme available."));
            saveErrors(request, errs);
            request.getSession().removeAttribute(LogonStateAndCache.LOGON_STATE_MACHINE);
            request.getSession().removeAttribute(Constants.AUTH_SESSION);
            if (form != null)
                form.reset(mapping, request);
View Full Code Here


        if (PolicyDatabaseFactory.getInstance().isAnyAccessRightAllowed(scheme.getUser(), true, true, false)) {
           
            if ("false".equals(Property.getProperty(new ContextKey("webServer.disableCertificateWarning")))
                            && !KeyStoreManager.getInstance(KeyStoreManager.DEFAULT_KEY_STORE).isCertificateTrusted(
                                            Property.getProperty(new ContextKey("webServer.alias")))) {
                GlobalWarningManager.getInstance().addMultipleGlobalWarning(new GlobalWarning(GlobalWarning.MANAGEMENT_USERS, new BundleActionMessage("keystore",
                    "keyStore.untrustedCertificate.warning"), DismissType.DISMISS_FOR_USER));
            }
           
        }
View Full Code Here

      ExtensionStore.getInstance().licenseCheck(bundle, request, fileUpload.getUploadedForward());
      ExtensionStore.getInstance().postInstallExtension(bundle, request);
    } else {
      bundle = ExtensionStore.getInstance().updateExtension(id, file.getInputStream(), request, file.getFileSize());
      if (bundle.isContainsPlugin())
        GlobalWarningManager.getInstance().addMultipleGlobalWarning(new GlobalWarning(GlobalWarning.MANAGEMENT_USERS, new BundleActionMessage("extensions",
                "extensionStore.message.extensionUpdatedRestartRequired"), DismissType.DISMISS_FOR_USER));
    }

    return fileUpload.getUploadedForward();
View Full Code Here

          des.getApplicationBundle().setType(ExtensionBundle.TYPE_PENDING_INSTALLATION);
          newPluginsFound = true;
        }
      }
      if (newPluginsFound) {
        GlobalWarningManager.getInstance().addMultipleGlobalWarning(new GlobalWarning(GlobalWarning.MANAGEMENT_USERS, new BundleActionMessage("extensions",
                "extensionStore.message.pluginInstalledRestartRequired"), DismissType.DISMISS_FOR_USER));
      }

      // Look for new extensions
      Map newLoadedExtensions = getLoadedExtensions();

      // Look for extension updates
      File updatedExtensionsDir = ExtensionStore.getInstance().getUpdatedExtensionsDirectory();
      boolean updatesFound = false;
      for (Iterator i = newLoadedExtensions.entrySet().iterator(); i.hasNext();) {
        Map.Entry ent = (Map.Entry) i.next();
        if (new File(updatedExtensionsDir, (String) ent.getKey()).exists()) {
          final ExtensionBundle bundle = (ExtensionBundle) ent.getValue();
          for (Iterator j = bundle.iterator(); j.hasNext();) {
            ExtensionDescriptor des = (ExtensionDescriptor) j.next();
            des.getApplicationBundle().setType(ExtensionBundle.TYPE_PENDING_UPDATE);
          }
          updatesFound = true;
        }
      }
      if (updatesFound) {
        GlobalWarningManager.getInstance().addMultipleGlobalWarning(new GlobalWarning(GlobalWarning.MANAGEMENT_USERS, new BundleActionMessage("extensions",
                "extensionStore.message.extensionUpdatedRestartRequired"), DismissType.DISMISS_FOR_USER));
      }

      // Check for new extensions
      for (Iterator i = newLoadedExtensions.entrySet().iterator(); i.hasNext();) {
        Map.Entry ent = (Map.Entry) i.next();
        if (!currentlyLoadedExtensions.containsKey(ent.getKey())) {
          final ExtensionBundle bundle = (ExtensionBundle) ent.getValue();

          // If installing, there may be a license agreement to handle
          File licenseFile = bundle.getLicenseFile();
          if (licenseFile != null && licenseFile.exists()) {
            final boolean fNewPluginsFound = newPluginsFound;
            CoreUtil.requestLicenseAgreement(request.getSession(), new LicenseAgreement(bundle.getName(),
                    licenseFile,
                    new LicenseAgreementCallback() {
                      public void licenseAccepted(HttpServletRequest request) {
                        // Dont care
                      }

                      public void licenseRejected(HttpServletRequest request) {
                        try {
                          ExtensionStore.getInstance().removeExtensionBundle(bundle);
                        } catch (Exception e) {
                        }
                        if (fNewPluginsFound) {
                          GlobalWarningManager.getInstance().removeGlobalWarning(request.getSession(),
                            "extensionStore.message.pluginInstalledRestartRequired");
                          GlobalWarningManager.getInstance().addMultipleGlobalWarning(new GlobalWarning(GlobalWarning.MANAGEMENT_USERS,
                            new BundleActionMessage("extensions",
                                    "extensionStore.message.pluginLicenseRejectedRestartRequired"), DismissType.DISMISS_FOR_USER));
                        }
                      }

                    },
View Full Code Here

     */
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        if(isCommiting()) {
            if(selectedPolicies.size() == 0) {
                ActionErrors errs = new ActionErrors();
                errs.add(Globals.ERROR_KEY, new BundleActionMessage(getResourceBundle(), getResourcePrefix() + ".error.noPoliciesSelected"));
                return errs;
            }
            else {
                /* Make sure the selected policies are all currently available, this prevents
                 * anyone fiddling the polices they are allowed to configure
View Full Code Here

        ExtensionStore extensionStore = ExtensionStore.getInstance();
        ActionMessages msgs = new ActionMessages();
        try {
            extensionStore.resetExtensionStoreUpdate();
            storeDescriptor = extensionStore.getDownloadableExtensionStoreDescriptor(true, ExtensionStore.getWorkingVersion());
            msgs.add(Globals.MESSAGE_KEY, new BundleActionMessage("extensions", "extensionStore.message.refreshed"));
            saveMessages(request, msgs);
        } catch (Exception e) {
            log.error("Failed to refresh extension store.", e);
            msgs.add(Globals.ERROR_KEY, new BundleActionMessage("extensions", "extensionStore.message.failedToRefresh", e
                            .getMessage()));
            saveErrors(request, msgs);
        }
        defaultExtensionsForm.initialise(request.getSession(), ExtensionStore.getInstance().getAllAvailableExtensionBundles(extensionCategory));
        return null; // Return null because we are in a subform
View Full Code Here

        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

        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) {
View Full Code Here

        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);
View Full Code Here

        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();
View Full Code Here

TOP

Related Classes of com.adito.core.BundleActionMessage

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.