Examples of PropertyDefinition


Examples of com.adito.boot.PropertyDefinition

            throw new Exception("Disabled.");
        }

        // Set the properties
        String oldVal, newVal;
        PropertyDefinition def;
        for (Iterator i = f.storedItems(); i.hasNext();) {
            PropertyItem item = (PropertyItem) i.next();
            def = item.getDefinition();
            newVal = String.valueOf(item.getPropertyValue());
            if (log.isDebugEnabled())
                log.debug("Setting '" + def.getName() + "' to '" + newVal + "'");
            oldVal = Property.setProperty(createKey(def, f, sessionInfo), newVal, sessionInfo);
            if ((oldVal == null && newVal != null) || !oldVal.equals(newVal)) {
                if (def.isRestartRequired()) {
                    restartRequired = true;
                }
            }
        }
        CoreUtil.resetMainNavigation(request.getSession());
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

     * (non-Javadoc)
     *
     * @see com.adito.properties.PropertyType#retrieve(com.adito.properties.PropertyKey)
     */
    public String retrievePropertyImpl(AbstractPropertyKey key) throws IllegalArgumentException {
        PropertyDefinition def = getDefinition(key.getName());
        try {
            String val = ProfilesFactory.getInstance().retrieveGenericProperty(
                key.getName(), "", "0", "0", "");
            if (val == null) {
                val = def.getDefaultValue();
            } else {
                if (def.getType() == PropertyDefinition.TYPE_PASSWORD) {
                    try {
                        val = ContextHolder.getContext().deobfuscatePassword(val);
                    } catch (Throwable t) {
                        log.warn(
                            "Password property " + def.getName() + " could not be decoded. It has been result to the default.", t);
                    }
                }
            }
            return val;
        } catch (Exception e) {
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

        }
        return null;
    }

    public String storePropertyImpl(AbstractPropertyKey key, String value) throws IllegalArgumentException {
        PropertyDefinition def = getDefinition(key.getName());

        String oldValue = retrieveProperty(key);

        if (def.getType() == PropertyDefinition.TYPE_PASSWORD) {
            try {
                value = ContextHolder.getContext().obfuscatePassword(value);
            } catch (Throwable t) {
                log.warn("Password property " + def.getName() + " could not be encoded.", t);
            }
        }
        try {
            ProfilesFactory.getInstance().storeGenericProperty(
                key.getName(), "", "0", "0", "", value);
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

            }
            for (Iterator ei = c.getChildren().iterator(); ei
                .hasNext();) {
              Element ec = (Element) ei.next();
              if (ec.getName().equals("definition")) {
                PropertyDefinition def;
                if (pc instanceof AttributesPropertyClass) {
                  def = new XMLAttributeDefinition(ec);
                } else {
                  def = new XMLPropertyDefinition(ec);
                }
                propertyDefinitions.put(def.getName(), def);
                pc.registerPropertyDefinition(def);
              } else if (ec.getName().equals("category")) {
                PropertyDefinitionCategory cat = new DefaultPropertyDefinitionCategory(
                    ec.getAttribute("id").getIntValue(), ec
                        .getAttributeValue("bundle"),
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

        }
        return null;
      }
    }

    PropertyDefinition def = getDefinition();
    try {
      def.validate(String.valueOf(getPropertyValue()), getClass().getClassLoader());
    } catch (CoreException ce) {
      ce.getBundleActionMessage().setArg3(def.getName());
      return ce.getBundleActionMessage();
    }
    return null;
  }
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

    public void storeItems() {

        PropertyItem[] items = getPropertyItems();
        for (int i = 0; i < items.length; i++) {
            PropertyDefinition def = items[i].getDefinition();
            if (def.getCategory() == getSelectedCategory()) {
                storeItem(items[i]);
            }
        }

    }
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

        if (isCommiting()) {
            ActionErrors errs = null;
            storeItems();
            for (Iterator i = storedItems(); i.hasNext();) {
                PropertyItem item = (PropertyItem) i.next();
                PropertyDefinition def = item.getDefinition();
                try {
                    Object propertyValue = item.getPropertyValue();
                    if (propertyValue instanceof String) {
                        propertyValue = String.valueOf(propertyValue).trim();
                        item.setValue(propertyValue);
                    }
                    def.validate(String.valueOf(propertyValue), getClass().getClassLoader());
                } catch (CoreException ce) {
                    ce.getBundleActionMessage().setArg3(
                        CoreUtil.getMessageResources(request.getSession(), def.getMessageResourcesKey()).getMessage(
                            (Locale) request.getSession().getAttribute(Globals.LOCALE_KEY), def.getName() + ".name"));
                    if (errs == null) {
                        errs = new ActionErrors();
                    }
                    errs.add(Globals.ERROR_KEY, ce.getBundleActionMessage());
                } catch (Exception e) {
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

                    } catch (Exception e) {
                    }
                }
                for (Iterator i = userAttributeValueItems.iterator(); i.hasNext();) {
                    AttributeValueItem item = (AttributeValueItem) i.next();
                    PropertyDefinition def = item.getDefinition();
                    try {
                        def.validate(item.getValue().toString(), getClass().getClassLoader());
                    } catch (CoreException ce) {
                        ce.getBundleActionMessage().setArg3(item.getLabel());
                        errors.add(Globals.ERROR_KEY, ce.getBundleActionMessage());
                    } catch (CodedException ce) {
                        errors.add(Globals.ERROR_KEY, new ActionMessage("[Err:" + ce.getCode() + "] " + ce.getMessage()));
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

     * (non-Javadoc)
     *
     * @see com.adito.properties.PropertyType#retrieve(com.adito.properties.PropertyKey)
     */
    public String retrievePropertyImpl(AbstractPropertyKey key) throws IllegalArgumentException {
        PropertyDefinition def = getDefinition(key.getName());
        RealmKey realmKey = (RealmKey)key;
        try {
            String val = ProfilesFactory.getInstance().retrieveGenericProperty(
                realmKey.getName(), "", "0", String.valueOf(realmKey.getRealmID()), "");
            if (val == null) {
                val = def.getDefaultValue();
            } else {
                if (def.getType() == PropertyDefinition.TYPE_PASSWORD) {
                    try {
                        val = ContextHolder.getContext().deobfuscatePassword(val);
                    } catch (Throwable t) {
                        log.warn(
                            "Password property " + def.getName() + " could not be decoded. It has been result to the default.", t);
                    }
                }
            }
            return val;
        } catch (Exception e) {
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

        }
        return null;
    }

    public String storePropertyImpl(AbstractPropertyKey key, String value) throws IllegalArgumentException {
        PropertyDefinition def = getDefinition(key.getName());
        RealmKey realmKey = (RealmKey)key;
        String oldValue = retrieveProperty(key);

        if (def.getType() == PropertyDefinition.TYPE_PASSWORD) {
            try {
                value = ContextHolder.getContext().obfuscatePassword(value);
            } catch (Throwable t) {
                log.warn("Password property " + def.getName() + " could not be encoded.", t);
            }
        }
        try {
            ProfilesFactory.getInstance().storeGenericProperty(
                realmKey.getName(), "", "0", String.valueOf(realmKey.getRealmID()), "", value);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.