Package org.apache.cocoon.forms

Examples of org.apache.cocoon.forms.FormsException


                    break;
                }
                if (widgetDefinition == containerDefinition) {
                    Location location = containerDefinition.getLocation();
                    if (parent instanceof FormDefinition) {
                        throw new FormsException("Container: Non-terminating recursion detected in form definition.",
                                                 location);
                    }

                    throw new FormsException("Container: Non-terminating recursion detected in widget definition: " + parent.getId(),
                                             location);
                }
            }
        }
    }
View Full Code Here


                                        DomHelper.getLocation(widgetElement));
            }
        }

        if (actionCommand == null) {
            throw new FormsException("Required attribute 'command' is missing.",
                                     DomHelper.getLocationObject(widgetElement));
        }


        RepeaterActionDefinition definition = createDefinition(widgetElement, actionCommand);
        setupDefinition(widgetElement, definition, context);
        setDisplayData(widgetElement, definition);

        definition.setActionCommand(actionCommand);

        // Warn of the mis-named 'on-action' that existed initially
        Element buggyOnActivate = DomHelper.getChildElement(widgetElement, FormsConstants.DEFINITION_NS, "on-activate", false);
        if (buggyOnActivate != null) {
            throw new FormsException("Use 'on-action' instead of 'on-activate' on row-action.",
                                     DomHelper.getLocationObject(buggyOnActivate));
        }

        Iterator i = buildEventListeners(widgetElement, "on-action", ActionListener.class).iterator();
        while (i.hasNext()) {
View Full Code Here

       
        } else if ("page-custom".equals(actionCommand)) {
            return new RepeaterActionDefinition.ChangePageActionDefinition(repeater, RepeaterActionDefinition.ChangePageActionDefinition.CUSTOM);

        } else {
            throw new FormsException("Unknown repeater action '" + actionCommand + "'.",
                                     DomHelper.getLocationObject(element));
        }
    }
View Full Code Here

     */
    public void initializeFrom(WidgetDefinition definition) throws Exception {
        super.initializeFrom(definition);

        if (!(definition instanceof UploadDefinition)) {
            throw new FormsException("Ancestor definition " + definition.getClass().getName() + " is not an UploadDefinition.",
                                     getLocation());
        }

        UploadDefinition other = (UploadDefinition) definition;

View Full Code Here

        if (classDefinition == null && getEnclosingLibrary() != null) { // not found in form's library, so ask enclosing library
            classDefinition = getEnclosingLibrary().getDefinition(getId());
        }

        if (classDefinition == null) {
            throw new FormsException("NewDefinition: Class with id '" + getId() + "' does not exist.",
                                     getLocation());
        }

        if (!(classDefinition instanceof ClassDefinition)) {
            throw new FormsException("NewDefinition: Id '" + getId() + "' is not a class.",
                                     getLocation());
        }

        return (ClassDefinition) classDefinition;
    }
View Full Code Here

                if (definition instanceof UnionDefinition) {
                    break;
                }

                if (definition == this) {
                    throw new FormsException("NewDefinition: Non-terminating recursion detected in widget definition '" + parent.getId() + "'.",
                                             getLocation());
                }
            }
        }
View Full Code Here

    /**
     * initialize this definition with the other, sort of like a copy constructor
     */
    public void initializeFrom(WidgetDefinition definition) throws Exception {
        if (!(definition instanceof AbstractWidgetDefinition)) {
            throw new FormsException("Ancestor definition " + definition.getClass().getName() + " is not an AbstractWidgetDefinition.",
                                     getLocation());
        }

        AbstractWidgetDefinition other = (AbstractWidgetDefinition) definition;

View Full Code Here

                if (listener instanceof ConfigurableWidgetListener) {
                    ((ConfigurableWidgetListener)listener).setConfiguration( element );
                }
                return (WidgetListener)listener;
            } else {
                throw new FormsException("Bean referenced by " + name + " is not a " + listenerClass.getName(), DomHelper.getLocationObject( element ));
            }
        } catch(BeansException be) {
            throw new FormsException("Bean referenced by " + name + " doesn't exist in Spring context", be, DomHelper.getLocationObject( element ));
        }
    }
View Full Code Here

     */
    public void initializeFrom(WidgetDefinition definition) throws Exception {
        super.initializeFrom(definition);

        if (!(definition instanceof CaptchaFieldDefinition)) {
            throw new FormsException("Ancestor definition " + definition.getClass().getName() + " is not a CaptchaFieldDefinition.",
                                     getLocation());
        }

        CaptchaFieldDefinition other = (CaptchaFieldDefinition) definition;

View Full Code Here

                return (Element) node;
            }
        }

        if (required) {
            throw new FormsException("Required element '" + localName + "' is missing.",
                                     DomHelper.getLocationObject(element));
        }

        return null;
    }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.forms.FormsException

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.