Package com.adito.extensions

Examples of com.adito.extensions.ExtensionDescriptor


   * @param id
   * @return ExtensionDescriptor
   */
  public ExtensionDescriptor getExtensionDescriptor(String id) {
    for (ExtensionBundle bundle : extensionBundlesList) {
      ExtensionDescriptor descriptor = bundle.getApplicationDescriptor(id);
      if (descriptor != null && descriptor instanceof ExtensionDescriptor) {
        return (ExtensionDescriptor) descriptor;
      }
    }
    return null;
View Full Code Here


                    .addAttribute(CoreAttributeConstants.EVENT_ATTR_EXTENSION_TYPE, extensionType));
  }

  private static String getExtensionType(ExtensionBundle bundle) {
    for (Iterator itr = bundle.iterator(); itr.hasNext();) {
      ExtensionDescriptor descriptor = (ExtensionDescriptor) itr.next();
      if (descriptor.getExtensionType() instanceof ExtensionType) {
        return descriptor.getExtensionType().getType();
      }
    }
    return null;
  }
View Full Code Here

    //
    parameterItems = (List<ShortcutParameterItem>) wizardSequence.getAttribute(ATTR_PARAMETERS, null);

    // Get the application selected in the previous step and retrieve all of
    // the shortcut parameter items
    ExtensionDescriptor des = ExtensionStore.getInstance()
            .getExtensionDescriptor((String) wizardSequence.getAttribute(ApplicationShortcutWizardApplicationForm.ATTR_SELECTED_APPLICATION,
              null));
    if (parameterItems == null) {
      parameterItems = new ArrayList<ShortcutParameterItem>();
     
      // use the array we we want the index to get the correct element.
      Object[] entryArray = des.getParametersAndDefaults().entrySet().toArray();
      for (int arrayIndex = 0; arrayIndex < entryArray.length; arrayIndex++) {
                ApplicationParameterDefinition def = (ApplicationParameterDefinition) ((Map.Entry)entryArray[arrayIndex]).getValue();
                if (!def.isHidden()) {
                    if (this.getFocussedField() == null){
                        // now set the focused field to the first attribute.
View Full Code Here

        selectedApplication = (String)wizardSequence.getAttribute(ATTR_SELECTED_APPLICATION, null);
        for (Iterator i = ExtensionStore.getInstance().getAllAvailableExtensionBundles().iterator(); i.hasNext();) {
            ExtensionBundle b = (ExtensionBundle)i.next();
            if(b.getStatus() == ExtensionBundleStatus.ACTIVATED) {
              for(Iterator j = b.iterator(); j.hasNext(); ) {
                  ExtensionDescriptor d = (ExtensionDescriptor)j.next();
                 
                  // Only show extensions if the type is not hidden and the extension itself is not hidden
                  if(!d.isHidden() && !d.getExtensionType().isHidden()) {
                      if (this.getFocussedField() == null){
                          this.setFocussedField("check" + d.getId());
                      }
                      availableApplications.add(d);
                  }
              }
            }
View Full Code Here

      // Look for new plugins
      boolean newPluginsFound = false;
      for (Iterator i = newLoadedPlugins.entrySet().iterator(); i.hasNext();) {
        Map.Entry ent = (Map.Entry) i.next();
        if (!currentlyLoadedPlugins.containsKey(ent.getKey())) {
          ExtensionDescriptor des = (ExtensionDescriptor) newLoadedPlugins.get(ent.getKey());
          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) {
View Full Code Here

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

    String ticket = request.getParameter("ticket");
    String id = request.getParameter("id");
    if(id == null) {
      throw new Exception("No id");
    }
    ExtensionDescriptor app = ExtensionStore.getInstance().getExtensionDescriptor(id);
    if(app == null) {
      throw new Exception("No extension with id of " + id);
    }
    Properties properties = new Properties();
    for (Enumeration e = request.getParameterNames(); e.hasMoreElements();) {
View Full Code Here

     *      javax.servlet.http.HttpServletRequest,
     *      javax.servlet.http.HttpServletResponse)
     */
    protected ActionForward onExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                    HttpServletResponse response) throws Exception {
      ExtensionDescriptor desc = getExtensionDescriptor(mapping, form, request, response);
      if(desc == null) {
        throw new Exception("No application extension.");
      }
        SessionInfo session = LogonControllerFactory.getInstance().getSessionInfo(request);
        String ref = request.getParameter("returnTo");
View Full Code Here

    }

    if (sessionInfo == null)
      throw new CoreException(0, "");

    ExtensionDescriptor app = ExtensionStore.getInstance().getExtensionDescriptor(application);

    if (app == null)
      app = ExtensionStore.getInstance().getAgentApplication();

    if (!app.containsFile(file)) {
      log.error("Agent requested a file that does not exist (" + file + ").");
      sendError(file + " not found", response);
    } else {
      sendFile(app.getFile(file), response);
    }
  }
View Full Code Here

        try {
            for (Iterator i = applicationShortcuts.iterator(); i.hasNext();) {
                ApplicationShortcut applicationShortcut = (ApplicationShortcut) i.next();
                List policies = PolicyDatabaseFactory.getInstance().getPoliciesAttachedToResource(applicationShortcut,
                                session.getUser().getRealm());
                ExtensionDescriptor ed = ExtensionStore.getInstance().getExtensionDescriptor(applicationShortcut.getApplication());
                if (ed == null) {
                    log.warn("Found shortcut with an application ID '" + applicationShortcut.getApplication()
                                    + "' that does not exist. An extension may have been removed.");
                } else {
                  if(ed.getApplicationBundle().getStatus() != ExtensionBundleStatus.ACTIVATED) {
                        log.warn("Found shortcut with an application ID '" + applicationShortcut.getApplication()
                            + "' that uses an application contained in an extension bundle that is not activated (its status is '" + ed.getApplicationBundle().getStatus().getName() + "'). Ignoring.");
                  }
                  else {
                      ApplicationShortcutItem item = new ApplicationShortcutItem(ed, applicationShortcut, policies, session
                                      .getNavigationContext(), applicationShortcut.sessionPasswordRequired(session));
                      item.setFavoriteType(getFavoriteType(applicationShortcut.getResourceId()));
View Full Code Here

TOP

Related Classes of com.adito.extensions.ExtensionDescriptor

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.