Examples of AttributeDefinition


Examples of com.adito.properties.attributes.AttributeDefinition

                errs.add(Globals.ERROR_KEY, new ActionMessage(getResourcePrefix() + ".error.noDescription"));
            } else {
                if (!getEditing()) {
                    try {
                        PropertyClass propertyClass = PropertyClassManager.getInstance().getPropertyClass(getAttributeClass());
                        AttributeDefinition def = (AttributeDefinition) propertyClass.getDefinition(getName());
                        if (def != null) {
                            errs.add(Globals.ERROR_KEY, new ActionMessage(getResourcePrefix() + ".error.duplicateName", getName()));
                        }
                    } catch (Exception e) {
                        log.error("Failed to test if attribute exists.", e);
View Full Code Here

Examples of com.adito.properties.attributes.AttributeDefinition

    public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                                     HttpServletResponse response) throws Exception {
        try {
            String name = request.getParameter("name");
            String propertyClass = request.getParameter("propertyClass");
            AttributeDefinition def = (AttributeDefinition)PropertyClassManager.getInstance().getPropertyClass(propertyClass).getDefinition(name);
            request.setAttribute(Constants.REQ_ATTR_INFO_RESOURCE, def);
            return attributeInformation(mapping, form, request, response);
        } catch (Exception e) {           
            log.error("Failed to get attribute information. ", e);
            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
View Full Code Here

Examples of com.adito.properties.attributes.AttributeDefinition

     * @return forward
     * @throws Exception on any error
     */
    public ActionForward attributeInformation(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                                                    HttpServletResponse response) throws Exception {
      AttributeDefinition def = (AttributeDefinition) request.getAttribute(Constants.REQ_ATTR_INFO_RESOURCE);
        MessageResources mr = null;
        if(def.getMessageResourcesKey() != null) {
            mr = CoreUtil.getMessageResources(request.getSession(), def.getMessageResourcesKey());
        }
        Locale locale = (Locale)request.getSession().getAttribute(Globals.LOCALE_KEY);
        ((AttributeDefinitionInformationForm) form).initialise(mr, def, locale);
        return mapping.findForward("display");
    }
View Full Code Here

Examples of com.adito.properties.attributes.AttributeDefinition

        int visibility = ((Integer) seq.getAttribute(AttributeDefinitionOptionsAction.ATTR_VISIBILITY, null)).intValue();
        int sortOrder = ((Integer) seq.getAttribute(AttributeDefinitionOptionsAction.ATTR_SORT_ORDER, null)).intValue();
        int type = ((Integer) seq.getAttribute(AttributeDefinitionOptionsAction.ATTR_TYPE, null)).intValue();
        AttributesPropertyClass attributeClass = (AttributesPropertyClass) PropertyClassManager.getInstance()
                        .getPropertyClass(attributeClassName);
        AttributeDefinition def = attributeClass.createAttributeDefinition(type,
                            name,
                            typeMeta,
                            -1,
                            category,
                            defaultValue,
View Full Code Here

Examples of com.adito.properties.attributes.AttributeDefinition

                                     HttpServletResponse response) throws Exception {
        List actionStatus = new ArrayList();
        AbstractWizardSequence seq = getWizardSequence(request);
        try {
            try {
              AttributeDefinition def = createDefinition(seq);               
                ProfilesFactory.getInstance().createAttributeDefinition(def);
                def.getPropertyClass().registerPropertyDefinition(def);
                CoreServlet.getServlet().fireCoreEvent(new CoreEvent(this,
                                CoreEventConstants.ATTRIBUTE_DEFINITION_CREATED,
                                def,
                                getSessionInfo(request),
                                CoreEvent.STATE_SUCCESSFUL));
View Full Code Here

Examples of com.adito.properties.attributes.AttributeDefinition

        AttributeDefinitionsForm schemesForm = (AttributeDefinitionsForm) form;
        String name = schemesForm.getSelectedItem();
        int idx = name.indexOf('/');
        String propertyClass = name.substring(0, idx);
        name = name.substring(idx + 1);
        AttributeDefinition def = (AttributeDefinition) PropertyClassManager.getInstance()
                        .getPropertyClass(propertyClass)
                        .getDefinition(name);
        if (def == null) {
            throw new Exception("No attribute definition with name of " + name + ".");
        }
View Full Code Here

Examples of com.adito.properties.attributes.AttributeDefinition

        AttributeDefinitionsForm f = (AttributeDefinitionsForm) form;
        String name = f.getSelectedItem();
        int idx = name.indexOf('/');
        String propertyClass = name.substring(0, idx);
        name = name.substring(idx + 1);
        AttributeDefinition def = (AttributeDefinition) PropertyClassManager.getInstance()
                        .getPropertyClass(propertyClass)
                        .getDefinition(name);
        if (def == null) {
            throw new Exception("No attribute definition with name of " + name + ".");
        }
        ProfilesFactory.getInstance().deleteAttributeDefinition(def.getPropertyClass().getName(), name);
        def.getPropertyClass().deregisterPropertyDefinition(def.getName());
        ActionMessages msgs = new ActionMessages();
        msgs.add(Globals.MESSAGE_KEY, new ActionMessage("attributeDefinitions.message.definitionDeleted", name));
        saveMessages(request, msgs);
        return mapping.findForward("refresh");
    }
View Full Code Here

Examples of com.adito.properties.attributes.AttributeDefinition

        AttributeDefinitionsForm f = (AttributeDefinitionsForm) form;
        String selected = f.getSelectedItem();
        int idx = selected.indexOf('/');
        String attributeClass = selected.substring(0, idx);
        String name = selected.substring(idx + 1);
        AttributeDefinition def = (AttributeDefinition) PropertyClassManager.getInstance()
                        .getPropertyClass(attributeClass)
                        .getDefinition(name);
        if (def == null) {
            throw new Exception("No attribute definition with name of " + name + ".");
        }
View Full Code Here

Examples of com.adito.properties.attributes.AttributeDefinition

        for (PropertyClass propertyClass : PropertyClassManager.getInstance().getPropertyClasses()) {
            if (propertyClass instanceof AttributesPropertyClass && !propertyClass.getName().equals(ResourceAttributes.NAME)) {
                Collection<PropertyDefinition> l = propertyClass.getDefinitions();
                String category = request.getParameter("category");
                for (PropertyDefinition d : l) {
                    AttributeDefinition def = (AttributeDefinition) d;
                    String categoryLabel = def.getCategoryLabel();
                    MessageResources mr = CoreUtil.getMessageResources(request.getSession(), def.getMessageResourcesKey());
                    String s = mr == null ? null : mr.getMessage("userAttributeCategory." + def.getCategory() + ".title");
                    if (s != null && !s.equals("")) {
                        categoryLabel = Util.urlDecode(s);
                    } else {
                        categoryLabel = categoryLabel == null || categoryLabel.equals("") ? "Attributes" : categoryLabel;
                    }
View Full Code Here

Examples of com.adito.properties.attributes.AttributeDefinition

         * objects
         */

        userAttributeValueItems = new ArrayList();
        for (PropertyDefinition d : propertyClass.getDefinitions()) {
            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 UserAttributeKey(user, def.getName()));
                    }
                    AttributeValueItem item = new AttributeValueItem(def, request, value);
                    userAttributeValueItems.add(item);
                }
            }
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.