Examples of Repeater


Examples of eu.admire.dispel.graph.Repeater

            if (node instanceof LiteralValuesNode)
            {
                List<Object> values = ((LiteralValuesNode) node).getValues();
                assertEquals(1, values.size());
                assertTrue(values.get(0) instanceof Repeater);
                Repeater repeater = (Repeater)values.get(0);
                assertFalse(repeater.isInfinite());
                assertEquals("http://example.com/", repeater.getValue());
            }
        }
    }   
View Full Code Here

Examples of org.apache.cocoon.forms.formmodel.Repeater

                childBindings, insertBinding, deleteBindings, identityBindings);
    this.adapterClass = adapterClass;
  }

  public void doLoad(Widget frmModel, JXPathContext jxpc) throws BindingException {
        Repeater repeater = (Repeater) selectWidget(frmModel, super.getId());
        if (!(repeater instanceof EnhancedRepeater)) {
            super.doLoad(frmModel, jxpc);
            return;
        }
View Full Code Here

Examples of org.apache.cocoon.forms.formmodel.Repeater

    rep.setCollection(collection);
    rep.doPageLoad();
  }

  public void doSave(Widget frmModel, JXPathContext jxpc) throws BindingException {
    Repeater repeater = (Repeater) selectWidget(frmModel, super.getId());
    if (!(repeater instanceof EnhancedRepeater)) {
      super.doSave(frmModel, jxpc);
      return;
    }
View Full Code Here

Examples of org.apache.cocoon.forms.formmodel.Repeater

     * over to the actual binding-children.
     */
    public void doLoad(Widget frmModel, JXPathContext jxpc)
    throws BindingException {
        // Find the repeater
        Repeater repeater = (Repeater) selectWidget(frmModel, this.repeaterId);
        if (repeater == null) {
            throw new BindingException("The repeater with the ID [" + this.repeaterId
                    + "] referenced in the binding does not exist in the form definition.");
        }

        repeater.clear();

        Pointer ptr = jxpc.getPointer(this.repeaterPath);
        if (ptr.getNode() != null) {
            // There are some nodes to load from
            final int initialSize = repeater.getSize();

            // build a jxpath iterator for pointers
            JXPathContext repeaterContext = jxpc.getRelativeContext(ptr);
            Iterator rowPointers = repeaterContext.iteratePointers(this.rowPath);
            //iterate through it
            int currentRow = 0;
            while (rowPointers.hasNext()) {
                // create a new row, take that as the frmModelSubContext
                Repeater.RepeaterRow thisRow;
                if (currentRow < initialSize) {
                    thisRow = repeater.getRow(currentRow++);
                } else {
                    thisRow = repeater.addRow();
                }
                // make a jxpath ObjectModelSubcontext on the iterated element
                Pointer jxp = (Pointer)rowPointers.next();
                JXPathContext rowContext = repeaterContext.getRelativeContext(jxp);
                // hand it over to children
View Full Code Here

Examples of org.apache.cocoon.forms.formmodel.Repeater

     * child-bindings are allowed to visit the narrowed contexts.
     */
    public void doSave(Widget frmModel, JXPathContext jxpc)
    throws BindingException {
        // Find the repeater
        Repeater repeater = (Repeater) selectWidget(frmModel, this.repeaterId);

        // and his context, creating the path if needed
        JXPathContext repeaterContext =
            jxpc.getRelativeContext(jxpc.createPath(this.repeaterPath));

        // create set of updatedRowIds
        Set updatedRows = new HashSet();
        //create list of rows to insert at end
        List rowsToInsert = new ArrayList();

        // iterate rows in the form model...
        int formRowCount = repeater.getSize();
        for (int i = 0; i < formRowCount; i++) {
            Repeater.RepeaterRow thisRow = repeater.getRow(i);

            // Get the identity
            List identity = getIdentity(thisRow);

            if (hasNonNullElements(identity)) {
View Full Code Here

Examples of org.apache.cocoon.forms.formmodel.Repeater

     * over to the actual binding-children.
     */
    public void doLoad(Widget frmModel, JXPathContext jxpc)
            throws BindingException {
        // Find the repeater
        Repeater repeater = (Repeater) selectWidget(frmModel, this.repeaterId);
        if (repeater == null) {
            throw new BindingException("The repeater with the ID [" + this.repeaterId
                    + "] referenced in the binding does not exist in the form definition.");
        }
        repeater.clear();
        int initialSize = repeater.getSize();

        // build a jxpath iterator for pointers
        JXPathContext repeaterContext =
            jxpc.getRelativeContext(jxpc.getPointer(this.repeaterPath));
        Iterator rowPointers = repeaterContext.iteratePointers(this.rowPath);
        //iterate through it
        while (rowPointers.hasNext()) {
            // create a new row, take that as the frmModelSubContext
            Repeater.RepeaterRow thisRow;
            if (initialSize > 0) {
                thisRow = repeater.getRow(--initialSize);
            } else {
                thisRow = repeater.addRow();
            }
            // make a jxpath ObjectModelSubcontext on the iterated element
            Pointer jxp = (Pointer)rowPointers.next();
            JXPathContext rowContext = repeaterContext.getRelativeContext(jxp);
            // hand it over to children
View Full Code Here

Examples of org.apache.cocoon.forms.formmodel.Repeater

     * child-bindings are allowed to visit the narrowed contexts.
     */
    public void doSave(Widget frmModel, JXPathContext jxpc)
            throws BindingException {
        // Find the repeater
        Repeater repeater = (Repeater) selectWidget(frmModel, this.repeaterId);
        // and his context
        JXPathContext repeaterContext =
            jxpc.getRelativeContext(jxpc.getPointer(this.repeaterPath));

        // create set of updatedRowIds
        Set updatedRows = new HashSet();
        //create list of rows to insert at end
        List rowsToInsert = new ArrayList();

        // iterate rows in the form model...
        int formRowCount = repeater.getSize();
        for (int i = 0; i < formRowCount; i++) {
            Repeater.RepeaterRow thisRow = repeater.getRow(i);

            // Get the identity
            List identity = getIdentity(thisRow);

            if (hasNonNullElements(identity)) {
View Full Code Here

Examples of org.apache.cocoon.forms.formmodel.Repeater

                    return nullHandler;
                }
            case EVENT_ELEMENT:
                return bufferHandler;
            case EVENT_END_ELEMENT:
                Repeater repeater = (Repeater)widget;
                int rowCount = repeater.getSize();
                handlers.addFirst(handler);
                handler = nestedHandler;
                contextWidgets.addFirst(contextWidget);
                for (int i = 0; i < rowCount; i++) {
                    Repeater.RepeaterRow row = repeater.getRow(i);
                    contextWidget = row;
                    if (isVisible(contextWidget)) {
                      out.getBuffer().toSAX(EffectWidgetReplacingPipe.this);
                    }
                }
View Full Code Here

Examples of org.apache.cocoon.forms.formmodel.Repeater

                                       " as child to: " + this.currentWidget.getId());
        } else if (this.currentWidget instanceof Repeater) {
            // In a repeater the XML elements are added in the order
            // they are recieved, the position attribute is not used
            if (ITEM.equals(loc)) {
                Repeater repeater = (Repeater)currentWidget;
                currentWidget = repeater.addRow();
            } else
                throw new SAXException("The element: " + loc +
                                       " is not allowed as a direct child of a Repeater");
        } else if (this.currentWidget instanceof MultiValueField) {
            this.isMultiValueItem = true;
View Full Code Here

Examples of org.apache.cocoon.forms.formmodel.Repeater

        } else if (widget instanceof ContainerWidget) {
            Iterator children = ((ContainerWidget)widget).getChildren();
            while (children.hasNext())
                generateSAX((Widget)children.next());
        } else if (widget instanceof Repeater) {
            Repeater repeater = (Repeater)widget;
            for (int i = 0; i < repeater.getSize(); i++)
                generateSAX(repeater.getRow(i), ITEM);
        }
        end(id);
    }
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.