Package com.adito.extensions

Examples of com.adito.extensions.ShortcutParameterItem


                if (!def.isHidden()) {
                    if (this.getFocussedField() == null){
                        // now set the focused field to the first attribute.
                        this.setFocussedField("f_" + arrayIndex);
                    }
                    ShortcutParameterItem item = new ShortcutParameterItem(des,
                                    def,
                                    def.getDefaultValue().equals(PropertyDefinition.UNDEFINED_PARAMETER) ? ""
                                        : def.getDefaultValue(),
                                    (Locale) request.getSession().getAttribute(Globals.LOCALE_KEY));
                    if (log.isDebugEnabled())
                        log.debug("Adding item " + item.getName());
                    parameterItems.add(item);
                }
            }
      Collections.sort(parameterItems);

      // Now we have a sorted list of parameter items, build up the list
      // of categories
      categories = new ArrayList<String>();
      categoryTitles = new ArrayList<String>();
      for (Iterator i = parameterItems.iterator(); i.hasNext();) {
        ShortcutParameterItem spi = (ShortcutParameterItem) i.next();
        String category = String.valueOf(spi.getCategory());
        if (!categories.contains(category)) {
          categories.add(category);
          categoryTitles.add(spi.getLocalisedCategory());
        }

      }
    }
  }
View Full Code Here


   */
  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    ActionErrors errors = null;
    if (isCommiting()) {
      for (Iterator i = parameterItems.iterator(); i.hasNext();) {
        ShortcutParameterItem item = (ShortcutParameterItem) i.next();
        try {
          ActionMessage err = item.validateItem();
          if (err != null) {
            if (errors == null) {
              errors = new ActionErrors();
            }
            errors.add(Globals.ERROR_KEY, err);
View Full Code Here

   *      javax.servlet.http.HttpServletRequest)
   */
  public void reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest request) {
    if (parameterItems != null) {
      for (Iterator i = parameterItems.iterator(); i.hasNext();) {
        ShortcutParameterItem item = (ShortcutParameterItem) i.next();
        if (item.getDefinition().getType() == PropertyDefinition.TYPE_BOOLEAN) {
          item.setValue(Boolean.FALSE.toString());
        } else if (item.getDefinition().getType() == PropertyDefinition.TYPE_LIST) {
          item.setValue(item.getDefinition().getDefaultValue());
        }
      }
    }
  }
View Full Code Here

     */
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = super.validate(mapping, request);
        if (isCommiting()) {
            for (Iterator i = parameterItems.iterator(); i.hasNext();) {
                ShortcutParameterItem item = (ShortcutParameterItem) i.next();
                try {
                    ActionMessage err = item.validateItem();
                    if (err != null) {
                        if (errors == null) {
                            errors = new ActionErrors();
                        }
                        errors.add(Globals.ERROR_KEY, err);
View Full Code Here

     */
    public void reset(ActionMapping mapping, HttpServletRequest request) {
        super.reset(mapping, request);
        if (parameterItems != null) {
            for (Iterator i = parameterItems.iterator(); i.hasNext();) {
                ShortcutParameterItem item = (ShortcutParameterItem) i.next();
                if (item.getDefinition().getType() == PropertyDefinition.TYPE_BOOLEAN) {
                    item.setValue(Boolean.FALSE.toString());
                } else if (item.getDefinition().getType() == PropertyDefinition.TYPE_LIST) {
                    item.setValue(item.getDefinition().getDefaultValue());
                }
            }
        }
        this.autoStart = false;
    }
View Full Code Here

                try {
                    String value = (String) ((ApplicationShortcut) resource).getParameters().get(def.getName());
                    if (value == null) {
                        value = def.getDefaultValue();
                    }
                    ShortcutParameterItem item = new ShortcutParameterItem(des, def, value, locale);
                    if (log.isDebugEnabled())
                        log.debug("Adding item " + item.getName());
                    parameterItems.add(item);
                } catch (Exception e) {
                    log.warn("Failed to create shortcut parameter for " + def.getName()
                                    + ". Probably a problem with the extension descriptor.", e);
                }
            }
        }
        Collections.sort(parameterItems);

        // Now we have a sorted list of parameter items, build up the list of
        // categories
        categories = new ArrayList<String>();
        categoryTitles = new ArrayList<String>();
        for (Iterator i = parameterItems.iterator(); i.hasNext();) {
            ShortcutParameterItem spi = (ShortcutParameterItem) i.next();
            String category = String.valueOf(spi.getCategory());
            if (!categories.contains(category)) {
                categories.add(category);
                categoryTitles.add(spi.getLocalisedCategory());
            }

        }
    }
View Full Code Here

        ApplicationShortcut as = (ApplicationShortcut) getResource();
        as.setAutoStart(isAutoStart());
        Map<String, String> parameterMap = as.getParameters();
        parameterMap.clear();
        for (Iterator i = getParameterItems().iterator(); i.hasNext();) {
            ShortcutParameterItem pi = (ShortcutParameterItem) i.next();
            parameterMap.put(pi.getName(), pi.getPropertyValue().toString());
        }
    }
View Full Code Here

        boolean favorite = ((Boolean) seq.getAttribute(ApplicationShortcutWizardDetailsForm.ATTR_FAVORITE, Boolean.FALSE))
                        .booleanValue();
        List parameterItems = ((List) seq.getAttribute(ApplicationShortcutWizardAdditionalDetailsForm.ATTR_PARAMETERS, null));
        Map parameterMap = new HashMap();
        for (Iterator i = parameterItems.iterator(); i.hasNext();) {
            ShortcutParameterItem pi = (ShortcutParameterItem) i.next();
            parameterMap.put(pi.getName(), pi.getPropertyValue().toString());
        }
        boolean autoStart = false; // TODO hook this in
        ApplicationShortcut shortcut = null;
        try {
            int shortcutId = ApplicationShortcutDatabaseFactory.getInstance().createApplicationShortcut(application, name, description,
View Full Code Here

TOP

Related Classes of com.adito.extensions.ShortcutParameterItem

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.