Package com.adito.extensions

Examples of com.adito.extensions.ApplicationParameterDefinition


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


            throw new Exception("No descriptor named " + ((ApplicationShortcut) resource).getApplication());
        }

        for (Iterator i = des.getParametersAndDefaults().entrySet().iterator(); i.hasNext();) {
            Map.Entry entry = (Map.Entry) i.next();
            ApplicationParameterDefinition def = (ApplicationParameterDefinition) entry.getValue();
            if (!def.isHidden()) {
                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);
View Full Code Here

                if(des != null) {
                    addAttribute(CoreAttributeConstants.EVENT_ATTR_APPLICATION_NAME, des.getName());
                    for (Iterator i = des.getParametersAndDefaults().entrySet().iterator(); i.hasNext();) {
                        Map.Entry entry = (Map.Entry) i.next();
                        String val = (String)shortcut.getParameters().get(entry.getKey());
                        ApplicationParameterDefinition def = (ApplicationParameterDefinition) entry.getValue();
                        addAttribute(def.getName(), def.getType() == ApplicationParameterDefinition.TYPE_PASSWORD ? "******" : ( val == null ? "" : val ) );
                    }
                }
            }
            catch(Exception e) {               
            }
View Full Code Here

TOP

Related Classes of com.adito.extensions.ApplicationParameterDefinition

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.