Package com.adito.properties.attributes.forms

Examples of com.adito.properties.attributes.forms.AttributeDefinitionForm


     * @return forward
     * @throws Exception
     */
    public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        AttributeDefinitionForm df = (AttributeDefinitionForm) form;
        AttributeDefinition def = (AttributeDefinition) request.getSession().getAttribute(Constants.EDITING_ITEM);
        if (def.isSystem()) {
            throw new Exception("System attribute definitions may not be edited.");
        }
        df.initialise(def);
        df.setEditing();
        df.setReferer(CoreUtil.getReferer(request));
        CoreUtil.addRequiredFieldMessage(this, request);
        return mapping.findForward("display");
    }
View Full Code Here


     * @return forward
     * @throws Exception
     */
    public ActionForward create(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        AttributeDefinitionForm df = (AttributeDefinitionForm) form;
        AttributeDefinition def = (AttributeDefinition) request.getSession().getAttribute(Constants.EDITING_ITEM);
        if (def.isSystem()) {
            throw new Exception("System attribute definitions may not be edited.");
        }
       
        // Initialise the form
        df.initialise(def);
        df.setCreating();
        df.setReferer(CoreUtil.getReferer(request));
       
        // Display
        CoreUtil.addRequiredFieldMessage(this, request);
        return mapping.findForward("display");
    }
View Full Code Here

     * @return forward
     * @throws Exception
     */
    public ActionForward commit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        AttributeDefinitionForm df = (AttributeDefinitionForm) form;
        df.applyToDefinition();
        if (df.getEditing()) {
            ProfilesFactory.getInstance().updateAttributeDefinition(df.getDefinition());
            df.getDefinition().getPropertyClass().registerPropertyDefinition(df.getDefinition());
        } else {
            ProfilesFactory.getInstance().createAttributeDefinition(df.getDefinition());
            df.getDefinition().getPropertyClass().registerPropertyDefinition(df.getDefinition());
        }
        return cleanUpAndReturnToReferer(mapping, form, request, response);
    }
View Full Code Here

TOP

Related Classes of com.adito.properties.attributes.forms.AttributeDefinitionForm

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.