Package com.adito.properties.attributes

Examples of com.adito.properties.attributes.AttributeValueItem


            user = udb.getAccount(account.getUsername());
        }

        // Update the attributes
        for(Iterator i = account.getAttributeValueItems().iterator(); i.hasNext(); ) {
           AttributeValueItem v = (AttributeValueItem)i.next();
           if(v.getDefinition().getVisibility() != AttributeDefinition.USER_CONFIDENTIAL_ATTRIBUTE) {
               Property.setProperty(new UserAttributeKey(user, v.getDefinition().getName()), v.getDefinition().formatAttributeValue(v.getValue()), info);
           }
        }
        // XXX HACK to ensure user attributes in memory are the same as persisted
        for(Iterator j = LogonControllerFactory.getInstance().getActiveSessions().entrySet().iterator(); j.hasNext(); ) {
            Map.Entry e = (Map.Entry)j.next();
View Full Code Here


    public ActionForward resetUserAttributes(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        UserAccountForm account = (UserAccountForm) form;
        PolicyUtil.checkPermission(PolicyConstants.ACCOUNTS_AND_GROUPS_RESOURCE_TYPE, PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN, request);
        for(Iterator i = account.getAttributeValueItems().iterator(); i.hasNext(); ) {
            AttributeValueItem v = (AttributeValueItem)i.next();
            v.setValue(v.getDefinition().parseValue(v.getDefinition().getDefaultValue()));
        }
        return mapping.findForward("display");
    }
View Full Code Here

            ResourceUtil.setResourceGlobalFavorite(resource, ((AbstractFavoriteResourceForm) resourceForm).isFavorite());
        }

        // 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));
               }
           }
        }
        return cleanUpAndReturnToReferer(mapping, form, request, response);
    }
View Full Code Here

                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);
                }
            }
        }

        /*
         * Sort the list of items and build up the list of categories
         */

        Collections.sort(attributeValueItems);
        categoryIds = new ArrayList();
        categoryTitles = new ArrayList();
        for (Iterator i = attributeValueItems.iterator(); i.hasNext();) {
            AttributeValueItem item = (AttributeValueItem) i.next();
            int idx = categoryIds.indexOf(item.getCategoryId());
            if (idx == -1) {
                categoryIds.add(item.getCategoryId());
                categoryTitles.add(item.getCategoryLabel());
            }
        }
    }
View Full Code Here

           if (!def.isHidden() && isResourcePropertyDefinition(resource, d)) {
                    String value = def.getDefaultValue();
                    if (resource != null) {
                        value = Property.getProperty(new ResourceKey(def.getName(), resource.getResourceType(), resource.getResourceId()));
                    }
                    AttributeValueItem item = new AttributeValueItem(def, request, value, getSubCategoryString(resource));
                    userAttributeValueItems.add(item);
            }
        }

        /*
         * Sort the list of items and build up the list of categories
         */

        Collections.sort(userAttributeValueItems);
        categoryIds = new ArrayList<String>();
        categoryTitles = new ArrayList<String>();
        for (Iterator i = userAttributeValueItems.iterator(); i.hasNext();) {
            AttributeValueItem item = (AttributeValueItem) i.next();
            int idx = categoryIds.indexOf(item.getCategoryId());
            if (idx == -1) {
                categoryIds.add(item.getCategoryId());
                categoryTitles.add(item.getCategoryLabel());
            }
        }
    }
View Full Code Here

    public void reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest request) {
        super.reset(mapping, request);
        recordSelectedPoliciesStatus(request);
        if (userAttributeValueItems != null) {
            for (Iterator i = userAttributeValueItems.iterator(); i.hasNext();) {
                AttributeValueItem item = (AttributeValueItem) i.next();
                if (item.getDefinition().getType() == PropertyDefinition.TYPE_BOOLEAN) {
                    item.setSelected(false);
                }
            }
        }
    }
View Full Code Here

                if (def.getVisibility() != AttributeDefinition.USER_CONFIDENTIAL_ATTRIBUTE) {
                    String value = def.getDefaultValue();
                    if (user != null) {
                        value = Property.getProperty(new UserAttributeKey(user, def.getName()));
                    }
                    AttributeValueItem item = new AttributeValueItem(def, request, value);
                    userAttributeValueItems.add(item);
                }
            }
        }

        /*
         * Sort the list of items and build up the list of categories
         */

        Collections.sort(userAttributeValueItems);
        categoryIds = new ArrayList();
        categoryTitles = new ArrayList();
        for (Iterator i = userAttributeValueItems.iterator(); i.hasNext();) {
            AttributeValueItem item = (AttributeValueItem) i.next();
            int idx = categoryIds.indexOf(item.getCategoryId());
            if (idx == -1) {
                categoryIds.add(item.getCategoryId());
                categoryTitles.add(item.getCategoryLabel());
            }
        }
    }
View Full Code Here

     */
    public void reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest request) {
        enabled = false;
        if (userAttributeValueItems != null) {
            for (Iterator i = userAttributeValueItems.iterator(); i.hasNext();) {
                AttributeValueItem item = (AttributeValueItem) i.next();
                if (item.getDefinition().getType() == PropertyDefinition.TYPE_BOOLEAN) {
                    item.setSelected(false);
                }
            }
        }
    }
View Full Code Here

                        errors.add(Globals.ERROR_KEY, new ActionMessage("createAccount.error.userAlreadyExists", username));
                    } 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

    public void initialize(List<AttributeValueItem> userAttributeValueItems) throws Exception {
        this.userAttributeValueItems = userAttributeValueItems;
        categoryIds = new ArrayList<String>();
        categoryTitles = new ArrayList<String>();
        for (Iterator i = userAttributeValueItems.iterator(); i.hasNext();) {
            AttributeValueItem item = (AttributeValueItem) i.next();
            int idx = categoryIds.indexOf(item.getCategoryId());
            if (idx == -1) {
                categoryIds.add(item.getCategoryId());
                categoryTitles.add(item.getCategoryLabel());
            }
        }
        selectedTab = categoryIds.size() > 0 ? categoryIds.get(0) : "";
    }
View Full Code Here

TOP

Related Classes of com.adito.properties.attributes.AttributeValueItem

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.