Examples of PropertyDefinition


Examples of com.adito.boot.PropertyDefinition

    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        if (isCommiting()) {
            ActionErrors errs = null;
            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());
                    if (errs == null) {
                        errs = new ActionErrors();
                    }
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());
        ResourceKey resourceKey = (ResourceKey) key;
        try {
            String val = ProfilesFactory.getInstance().retrieveAttributeValue(resourceKey);
            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 == null ? def.getDefaultValue() : val;
        } catch (Exception e) {
            log.error("Failed to retrieve property.", e);
        }
        return null;
    }
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());
        ResourceKey resourceKey = (ResourceKey) key;
        String oldValue = retrieveProperty(key);
        if (def.getDefaultValue().equals(value)) {
            value = null;
        }

        if ((oldValue == null && value != null) || (oldValue != null && value == null) || !oldValue.equals(value)) {

            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()
                .storeAttributeValue(resourceKey, value);
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

     */
    public String retrievePropertyImpl(AbstractPropertyKey key) throws IllegalArgumentException {
        if (!(key instanceof ProfilePropertyKey)) {
            throw new IllegalArgumentException("Property key is not an instanceof ProfilePropertyKey");
        }
        PropertyDefinition def = getDefinition(key.getName());
        ProfilePropertyKey profilesKey = (ProfilePropertyKey) key;
        try {
            String val = ProfilesFactory.getInstance().retrieveGenericProperty(profilesKey.getName(),
                profilesKey.isUserSpecific() ? profilesKey.getUsername() : "",
                String.valueOf(profilesKey.getProfile()),
                String.valueOf(profilesKey.getRealm()),
                "");
            // If a username was supplied, then now try the global profiles
            if(val == null && profilesKey.isUserSpecific()) {
                val = ProfilesFactory.getInstance().retrieveGenericProperty(profilesKey.getName(),
                    "",
                    String.valueOf(profilesKey.getProfile()),
                    String.valueOf(profilesKey.getRealm()),
                    "");
            }
           
            // Fallback to defaults
            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;
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

    public String storePropertyImpl(AbstractPropertyKey key, String value) throws IllegalArgumentException {
        if (!(key instanceof ProfilePropertyKey)) {
            throw new IllegalArgumentException("Property key is not an instanceof ProfilePropertyKey");
        }
        PropertyDefinition def = getDefinition(key.getName());
        ProfilePropertyKey profilesKey = (ProfilePropertyKey) 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);
            }
        }

        // If the definitions shows a visibilitiy of CONTEXT_CONFIGURATION then
        // set the property value in the context
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

     * @param sessionInfo session info
     * @return old value
     */
    public static String setProperty(AbstractPropertyKey key, String newValue, SessionInfo sessionInfo) {

        PropertyDefinition def = getDefinition(key);
        PropertyProfile p = null;
        try {
            PropertyClass t = def.getPropertyClass();
            String oldVal = t.storeProperty(key, newValue);
            if ( ( oldVal == null && newValue != null ) || !oldVal.equals(newValue)) {
                if (key instanceof ProfilePropertyKey) {
                    p = ProfilesFactory.getInstance().getPropertyProfile(((ProfilePropertyKey) key).getProfile());
                }
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

     * @param key property key
     * @return value
     * @throws IllegalArgumentException if property doesn't exist
     */
    public static String getProperty(AbstractPropertyKey key) throws IllegalArgumentException {
        PropertyDefinition def = getDefinition(key);
        if (def == null) {
            throw new IllegalArgumentException("Invalid key. " + key);
        }
        PropertyClass t = def.getPropertyClass();
        return t.retrieveProperty(key);
    }
View Full Code Here

Examples of com.filenet.api.admin.PropertyDefinition

          objectStore.getPropertyDefinitions(GuidConstants.Class_Document,
              null);
      boolean hasMarkings = false;

      while (propertyDefinitionIterator.hasNext()) {
        PropertyDefinition propertyDefinition = propertyDefinitionIterator.next();

        if (propertyDefinition instanceof PropertyDefinitionString) {
          MarkingSet markingSet = ((PropertyDefinitionString) propertyDefinition).get_MarkingSet();
          if (markingSet != null) {
            logger.log(Level.INFO, "Document class has property associated with Markings set");
View Full Code Here

Examples of com.sslexplorer.boot.PropertyDefinition

        // Register the new authentication scheme
        AuthenticationSchemeManager.getInstance().registerScheme("RADIUS", RADIUSAuthenticationScheme.class, "radius");
       
        // Register the new property definitions

        PropertyDefinition serverHostName = new DefaultPropertyDefinition(PropertyDefinition.TYPE_STRING, "radius.serverHostName", "",
                        false, 200, "localhost", 2, 10, "radius");
        ContextHolder.getContext().getPropertyDatabase().registerPropertyDefinition(serverHostName);
        PropertyDefinition authenticationPort = new DefaultPropertyDefinition(PropertyDefinition.TYPE_INTEGER, "radius.authenticationPort", "",
                        false, 200, "1812", 2, 20, "radius");
        ContextHolder.getContext().getPropertyDatabase().registerPropertyDefinition(authenticationPort);
        PropertyDefinition accountingPort = new DefaultPropertyDefinition(PropertyDefinition.TYPE_INTEGER, "radius.accountingPort", "",
                        false, 200, "1813", 2, 30, "radius");
        ContextHolder.getContext().getPropertyDatabase().registerPropertyDefinition(accountingPort);
        PropertyDefinition sharedSecret = new DefaultPropertyDefinition(PropertyDefinition.TYPE_STRING, "radius.sharedSecret", "",
                        false, 200, "shared_secret", 2, 40, "radius");
        ContextHolder.getContext().getPropertyDatabase().registerPropertyDefinition(sharedSecret);
        PropertyDefinition authenticationMethod = new DefaultPropertyDefinition(PropertyDefinition.TYPE_LIST, "radius.authenticationMethod", "chap,ppp",
                        false, 200, "chap", 2, 50, "radius");
        ContextHolder.getContext().getPropertyDatabase().registerPropertyDefinition(authenticationMethod);
       
        // Add the new menu items
        coreServlet.addMenuItem("setup", new MenuItem("radiusConfiguration", "radius", "/showRADIUSConfiguration.do", true, true,
View Full Code Here

Examples of fr.imag.adele.apam.declarations.PropertyDefinition

    if (group != null && Attribute.isInheritedAttribute(name)) {
      String groupType = group.getAttrDefinition(name);
      if (groupType != null) {
        // Allowed only if defining a field, and if types are the same.
        // Default values are not allowed above in that case.
        PropertyDefinition propDef = component
            .getPropertyDefinition(name);
        if (propDef == null) {
          validator.error("Invalid property definition " + name);
          return false;
        }
        if (propDef.getField() == null) {
          validator.error("Property " + name
              + " allready defined in the group.");
          return false;
        }
        if (!propDef.getType().equals(groupType)) {
          validator.error("Cannot refine property definition " + name
              + " Not the same types : " + propDef.getType()
              + " not equal " + groupType);
          return false;
        }
        if (group.getAttrDefault(name) != null && group.getAttrDefault(name).length()>0) {
          validator.error("Cannot refine property definition with a default value properties "
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.