Examples of Form


Examples of net.sf.jsptest.html.Form

        this.forms = new ArrayList();
        NodeList elements = document.getElementsByTagName("FORM");
        for (int i = 0; i < elements.getLength(); i++) {
            Element element = (Element) elements.item(i);
            if (chooser.accept(element)) {
                forms.add(new Form(element));
            }
        }
        if (forms.isEmpty()) {
            Assert.fail("Form not found.");
        }
View Full Code Here

Examples of net.xoetrope.builder.w3c.html.tags.Form

      htmlTags.put( HTML.Tag.DIV, new Div( HTML.Tag.DIV ));
      htmlTags.put( HTML.Tag.DL, new XDataTagHandler( HTML.Tag.DL ));
      htmlTags.put( HTML.Tag.DT, new XDataTagHandler( HTML.Tag.DT ));
      htmlTags.put( HTML.Tag.EM, new XFormatTagHandler( HTML.Tag.EM ));
      htmlTags.put( HTML.Tag.FONT, new Font());
      htmlTags.put( HTML.Tag.FORM, new Form());
//      htmlTags.put( HTML.Tag.FRAME, new Integer( XHtmlBuilder.FRAME ));
//      htmlTags.put( HTML.Tag.FRAMESET, new Integer( XHtmlBuilder.FRAMESET ));
      htmlTags.put( HTML.Tag.H1, new XHeadingTag( HTML.Tag.H1 ));
      htmlTags.put( HTML.Tag.H2, new XHeadingTag( HTML.Tag.H2 ));
      htmlTags.put( HTML.Tag.H3, new XHeadingTag( HTML.Tag.H3 ));
View Full Code Here

Examples of org.activiti.workflow.simple.alfresco.model.config.Form

   
    // Create a form-config for the task
    Module shareModule = AlfrescoConversionUtil.getExtension(conversion).getModules().get(0);
    Configuration configuration = shareModule.addConfiguration(AlfrescoConversionConstants.EVALUATOR_TASK_TYPE
        , type.getName());
    Form formConfig = configuration.createForm();
   
    // Populate model and form based on FormDefinition
    formCreator.createForm(type, formConfig, humanStep.getForm(), conversion);
   
    // Set up property sharing using task-listeners
View Full Code Here

Examples of org.apache.artimus.article.http.Form

        throws IOException, ServletException {

        response.setContentType("text/plain");
        PrintWriter printWriter = response.getWriter();
        ArrayList list = null;
        Form article = null;

        // - Retrieve collection of items in databse
        // -- For larger collections, the results would have to
        // -- batched in segments of, say, 100 records each
        // - ResultUtils.getCollection is the underlying
        // - actor here, and returns an ArrayList

        try {
            // - Create an indexWriter and start a fresh index
            IndexWriter index = Engine.getIndexWriter(true);

            // - Run through list and create a document for each article
            // -- Store keyword and title since they are needed for the search list
            // -- Be sure not to pass any blank strings
            list = (ArrayList)
                Access.select(new Form());
            for (int i=0; i<list.size(); i++) {
                article = (Form) list.get(i);
                // - Add document to index
                Access.index(
                    article.getArticle(),article.getContributor(),article.getCreator(),
                    article.getTitle(),article.getContent(),index);
                // - Report progress
                printWriter.print(i); printWriter.print(':');
                printWriter.println(article.getTitle());
            }

            // - Final report
            printWriter.print(index.docCount());
            printWriter.println(" articles indexed.");
View Full Code Here

Examples of org.apache.click.control.Form

    public FormProperties() {

        // Setup demonstration form

        form = new Form("form");

        FieldSet fieldSet = new FieldSet("demo", "<b>Demonstration Form</b>");
        form.add(fieldSet);

        nameField = new TextField("name");
        nameField.setRequired(true);
        nameField.setFocus(true);
        fieldSet.add(nameField);

        emailField = new EmailField("email");
        emailField.setRequired(true);
        fieldSet.add(emailField);

        investmentsField = new InvestmentSelect("investments");
        fieldSet.add(investmentsField);

        dateJoinedField = new DateField("dateJoined");
        fieldSet.add(dateJoinedField);

        form.add(new Submit("ok", "  OK  ", this, "onOkClick"));

        Submit cancel = new PageSubmit("cancel", HomePage.class);
        cancel.setCancelJavaScriptValidation(true);
        form.add(cancel);

        addControl(form);

        // Setup control form

        optionsForm = new Form("optionsForm");
        optionsForm.setColumns(3);
        optionsForm.setLabelAlign("right");
        optionsForm.setListener(this, "onApplyChanges");
        optionsForm.setLabelStyle("padding-left:2em;");
View Full Code Here

Examples of org.apache.cocoon.components.jxforms.xmlform.Form

            } else if (ev instanceof StartForm) {
                StartForm startForm = (StartForm)ev;
                StartElement startElement = startForm.startElement;
                String view = startElement.attributes.getValue(VIEW);
                String id = startElement.attributes.getValue(ID);
                Form newForm = Form.lookup(objectModel, id);
                consumer.startElement(startElement.namespaceURI,
                                      startElement.localName,
                                      startElement.raw,
                                      startElement.attributes);
                execute(consumer, newForm, view, contextPath,
                        jxpathContextFactory.newContext(null,
                                                        newForm.getModel()),
                        startForm.next, startForm.endForm);
                consumer.endElement(startElement.namespaceURI,
                                    startElement.localName,
                                    startElement.raw);
                ev = startForm.endForm.next;
                continue;
            } else if (ev instanceof EndForm) {
                StartElement startElement =
                    ((EndForm)ev).startForm.startElement;
                consumer.endElement(startElement.namespaceURI,
                                    startElement.localName,
                                    startElement.raw);
            } else if (ev instanceof StartSubmit) {
                StartElement startElement = ((StartSubmit)ev).startElement;
                Attributes attrs = startElement.attributes;
                if (kont != null) {
                    String id = startElement.attributes.getValue(ID);
                    if (id == null) {
                        id = "";
                    }
                    String cont =
                        startElement.attributes.getValue(CONTINUATION);
                    int level = 0;
                    if (BACK.equals(cont)) {
                        level = 3;
                    }
                    WebContinuation wk = kont;
                    for (int i = 0; i < level; i++) {
                        wk = wk.getParentContinuation();
                        if (wk == null) {
                            throw new SAXParseException("No such continuation",
                                                        ev.location,
                                                        null);
                        }
                    }
                    String kontId = wk.getId();
                    AttributesImpl newAttrs =
                        new AttributesImpl(startElement.attributes);
                    int i = newAttrs.getIndex(ID);
                    String phase = attrs.getValue(PHASE);
                    if (phase == null) {
                        phase = currentView;
                    }
                    if (i >= 0) {
                        newAttrs.setValue(i, kontId + ":" + phase + ":" +id);
                    } else {
                        newAttrs.addAttribute("", ID, ID, "CDATA",
                                              kontId + ":" + phase + ":" + id);
                    }
                    attrs = newAttrs;
                }
                consumer.startElement(startElement.namespaceURI,
                                      startElement.localName,
                                      startElement.raw,
                                      attrs);
            } else if (ev instanceof EndSubmit) {
                StartElement startElement =
                    ((EndSubmit)ev).startSubmit.startElement;
                consumer.endElement(startElement.namespaceURI,
                                    startElement.localName,
                                    startElement.raw);
            } else if (ev instanceof StartItem) {
                StartElement startElement = ((StartItem)ev).startElement;
                consumer.startElement(startElement.namespaceURI,
                                      startElement.localName,
                                      startElement.raw,
                                      startElement.attributes);
            } else if (ev instanceof EndItem) {
                StartElement startElement =
                    ((EndItem)ev).startItem.startElement;
                consumer.endElement(startElement.namespaceURI,
                                    startElement.localName,
                                    startElement.raw);
            } else if (ev instanceof StartChoices) {
                StartElement startElement = ((StartChoices)ev).startElement;
                consumer.startElement(startElement.namespaceURI,
                                      startElement.localName,
                                      startElement.raw,
                                      startElement.attributes);
            } else if (ev instanceof EndChoices) {
                StartElement startElement =
                    ((EndChoices)ev).startChoices.startElement;
                consumer.endElement(startElement.namespaceURI,
                                    startElement.localName,
                                    startElement.raw);
            } else if (ev instanceof StartValue) {
                StartElement startElement = ((StartValue)ev).startElement;
                consumer.startElement(startElement.namespaceURI,
                                      startElement.localName,
                                      startElement.raw,
                                      startElement.attributes);
            } else if (ev instanceof EndValue) {
                StartElement startElement =
                    ((EndValue)ev).startValue.startElement;
                consumer.endElement(startElement.namespaceURI,
                                    startElement.localName,
                                    startElement.raw);
            } else if (ev instanceof StartHidden) {
                StartElement startElement = ((StartHidden)ev).startElement;
                consumer.startElement(startElement.namespaceURI,
                                      startElement.localName,
                                      startElement.raw,
                                      startElement.attributes);
            } else if (ev instanceof EndHidden) {
                StartElement startElement =
                    ((EndHidden)ev).startHidden.startElement;
                consumer.endElement(startElement.namespaceURI,
                                    startElement.localName,
                                    startElement.raw);
            } else if (ev instanceof StartOutput) {
                StartOutput startOutput = (StartOutput)ev;
                StartElement startElement = startOutput.startElement;
                JXPathContext ctx = jxpathContext;
                String formId = startElement.attributes.getValue(FORM);
                if (formId != null) {
                    Form theForm = Form.lookup(objectModel, formId);
                    if (theForm == null) {
                        throw new SAXParseException("form not found: " + formId,
                                                    ev.location,
                                                    null);
                    }
                    ctx = jxpathContextFactory.newContext(null,
                                                          theForm.getModel());
                }
                consumer.startElement(startElement.namespaceURI,
                                      startElement.localName,
                                      startElement.raw,
                                      startElement.attributes);
                Object val = null;
                if (startOutput.ref != null) {
                    val = startOutput.ref.getValue(ctx);
                } else if (startOutput.value != null) {
                    val = startOutput.value.getValue(ctx);
                }
                if (val != null) {
                    consumer.startElement(NS, VALUE, VALUE, EMPTY_ATTRS);
                    String str = String.valueOf(val);
                    consumer.characters(str.toCharArray(), 0, str.length());
                    consumer.endElement(NS, VALUE, VALUE);
                   
                }
            } else if (ev instanceof EndOutput) {
                StartElement startElement =
                    ((EndOutput)ev).startOutput.startElement;
                consumer.endElement(startElement.namespaceURI,
                                    startElement.localName,
                                    startElement.raw);
            } else if (ev instanceof EndGroup) {
                StartElement startElement =
                    ((EndGroup)ev).startGroup.startElement;
                consumer.endElement(startElement.namespaceURI,
                                    startElement.localName,
                                    startElement.raw);
            } else if (ev instanceof StartViolations) {
                StartViolations startViolations =
                    (StartViolations)ev;
                StartElement startElement =
                    startViolations.startElement;
                Attributes attrs = startElement.attributes;
                String formAttr = attrs.getValue(FORM);
                Form theForm = form;
                if (formAttr != null) {
                    theForm = Form.lookup(objectModel, formAttr);
                }
                Set violations = form.getViolationsAsSortedSet();
                String mypath = null;
View Full Code Here

Examples of org.apache.cocoon.components.xmlform.Form

        }

        super.startElement(uri, name, raw, attributes);

        // load up the referenced form
        Form currentForm = Form.lookup(objectModel, id);

        // if the form wasn't found, we're in trouble
        if (currentForm==null) {
            String error = "Form is null [id="+String.valueOf(id)+"]";
View Full Code Here

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

    public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)
            throws Exception {
        String formSource = parameters.getParameter("form-definition");
        String formAttribute = parameters.getParameter("attribute-name");

        Form form = formManager.createForm(resolver.resolveURI(formSource));

        Field birthDate = (Field)form.getChild("birthdate");
        birthDate.setValue(new Date());

        Repeater repeater = (Repeater)form.getChild("contacts");
        repeater.addRow();
        Field field = (Field)repeater.getWidget(0, "firstname");
        field.setValue("Jules");

        repeater.addRow();
View Full Code Here

Examples of org.apache.cocoon.woody.formmodel.Form

            throws Exception {
        String formSource = parameters.getParameter("form-definition");
        String formAttribute = parameters.getParameter("attribute-name");

        FormDefinition formDefinition = formManager.getFormDefinition(resolver.resolveURI(formSource));
        Form form = (Form)formDefinition.createInstance();

        Request request = ObjectModelHelper.getRequest(objectModel);
        request.setAttribute(formAttribute, form);

        return null;
View Full Code Here

Examples of org.apache.cocoon.xmlform.Form

      if (validator_ == null ) setup( resolver );
     
      // reset the session state if requested
      if ( request.getParameter("reset"!= null) session.removeAttribute( formName_ );

      Form form = (Form) session.getAttribute( formName_ );
      if (form == null)
        {
          // first time here, populate the bean with initial values
          form = new Form();
          form.setInstance( new  TestBean() );
          session.setAttribute( formName_, form );
        }
      TestBean  jBean = (TestBean) form.getInstance();

      // call prepare in case the bean needs to massaged before population
      prepare( jBean );
     
      // update the bean with request parameter values
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.