Package com.adito.properties.impl.policyattributes

Examples of com.adito.properties.impl.policyattributes.PolicyAttributeKey


            }
        }
        // Update the attributes
        for(AttributeValueItem v : policyForm.getAttributeValueItems()) {
           if(v.getDefinition().getVisibility() != AttributeDefinition.USER_CONFIDENTIAL_ATTRIBUTE) {
               Property.setProperty(new PolicyAttributeKey(policyForm.getResourceId(), v.getDefinition().getName()), v.getDefinition().formatAttributeValue(v.getValue()), getSessionInfo(request));
           }
        }
        saveMessage(request, "editPolicy.message.saved", pol);
        return getRedirectWithMessages(mapping, request);
    }
View Full Code Here


     * @throws Exception
     */
    @Test
    public void storeAndRetrievePolicyAttributeValue() throws Exception {
        String value = "new value";
        PolicyAttributeKey key = new PolicyAttributeKey(0, "newKey");
        propertyDatabase.storeAttributeValue(key, value);
        String retrievedValue = propertyDatabase.retrieveAttributeValue(key);
        Assert.assertEquals("Attribute value should be this one.", value, retrievedValue);
        propertyDatabase.storeAttributeValue(key, null);
    }
View Full Code Here

        // Update the attributes
        for(Iterator i = resourceForm.getAttributeValueItems().iterator(); i.hasNext(); ) {
           AttributeValueItem v = (AttributeValueItem)i.next();
           if(v.getDefinition().getVisibility() != AttributeDefinition.USER_CONFIDENTIAL_ATTRIBUTE) {
               if (v.getDefinition().getPropertyClass().getName().equals(PolicyAttributes.NAME)){
                   Property.setProperty(new PolicyAttributeKey(resource.getResourceId(), v.getName()), v.getDefinition().formatAttributeValue(v.getPropertyValue()), getSessionInfo(request));
               }
               else{
                   Property.setProperty(new ResourceKey(v.getDefinition().getName(), resource.getResourceType(), resource.getResourceId()), v.getDefinition().formatAttributeValue(v.getPropertyValue()), getSessionInfo(request));
               }
           }
View Full Code Here

            AttributeDefinition def = (AttributeDefinition) propertyClass.getDefinition(key);
            if (def == null) {
                VariableReplacement.log.warn("Invalid policy attribute '" + key + "'");
                return null;
            } else {
                return Property.getProperty(new PolicyAttributeKey(policy.getResourceId(), key));
            }
        }
    return null;
  }
View Full Code Here

            AttributeDefinition def = (AttributeDefinition) d;
            if (!def.isHidden()) {
                if (def.getVisibility() != AttributeDefinition.USER_CONFIDENTIAL_ATTRIBUTE) {
                    String value = def.getDefaultValue();
                    if (user != null) {
                        value = Property.getProperty(new PolicyAttributeKey(getResourceId(), def.getName()));
                    }
                    AttributeValueItem item = new AttributeValueItem(def, request, value);
                    attributeValueItems.add(item);
                }
            }
View Full Code Here

TOP

Related Classes of com.adito.properties.impl.policyattributes.PolicyAttributeKey

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.