Examples of Output


Examples of org.jboss.seam.pages.Output

      }
     
      List<Element> childElements = element.elements("out");
      for (Element child: childElements)
      {
         Output output = new Output();
         output.setName( child.attributeValue("name") );
         output.setValue( Expressions.instance().createValueBinding( child.attributeValue("value") ) );
         String scopeName = child.attributeValue("scope");
         if (scopeName==null)
         {
            output.setScope(ScopeType.CONVERSATION);
         }
         else
         {
            output.setScope( ScopeType.valueOf( scopeName.toUpperCase() ) );
         }
         rule.getOutputs().add(output);
      }
     
   }
View Full Code Here

Examples of org.mortbay.jetty.AbstractGenerator.Output

        ByteArrayEndPoint endp = new ByteArrayEndPoint(new byte[0],4096);
        HttpGenerator hb = new HttpGenerator(new SimpleBuffers(new Buffer[]{sb,bb}),endp, sb.capacity(), bb.capacity());

        hb.setResponse(200,"OK");
       
        Output output = new Output(hb,10000);
        OutputWriter writer = new OutputWriter(output);
        writer.setCharacterEncoding(StringUtil.__UTF8);
       
        char[] chars = new char[1024];
        for (int i=0;i<chars.length;i++)
View Full Code Here

Examples of org.ofbiz.pos.component.Output

        if (!trans.isOpen()) {
            pos.showDialog("dialog/error/terminalclosed");
            return;
        }

        Output output = pos.getOutput();
        Input input = pos.getInput();
        if (input.isFunctionSet("CLOSE")) {
            String[] func = input.getFunction("CLOSE");
            String lastValue = input.value();
            if (UtilValidate.isNotEmpty(lastValue)) {

                try {
                    BigDecimal amt = new BigDecimal(lastValue);
                    amt = amt.movePointLeft(2);
                    lastValue = amt.toString();
                } catch (NumberFormatException e) {
                    Debug.logError(e, module);
                }
                if (UtilValidate.isNotEmpty(func[1])) {
                    func[1] = func[1] + "|";
                }
                func[1] = func[1] + lastValue;
                input.setFunction("CLOSE", func[1]);
            }

            String[] closeInfo = new String[0];
            if (UtilValidate.isNotEmpty(func[1])) {
                closeInfo = func[1].split("\\|");
            }
            switch (closeInfo.length) {
                case 0:
                    output.print(UtilProperties.getMessage(PosTransaction.resource,"PosEntCas",Locale.getDefault()));
                    break;
                case 1:
                    output.print(UtilProperties.getMessage(PosTransaction.resource,"PosEntChk",Locale.getDefault()));
                    break;
                case 2:
                    output.print(UtilProperties.getMessage(PosTransaction.resource,"PosEntCrc",Locale.getDefault()));
                    break;
                case 3:
                    output.print(UtilProperties.getMessage(PosTransaction.resource,"PosEntGfc",Locale.getDefault()));
                    break;
                case 4:
                    output.print(UtilProperties.getMessage(PosTransaction.resource,"PosEntOth",Locale.getDefault()));
                    break;
                case 5:
                    GenericValue state = trans.getTerminalState();
                    state.set("closedDate", UtilDateTime.nowTimestamp());
                    state.set("closedByUserLoginId", pos.getSession().getUserId());
                    state.set("actualEndingCash", new BigDecimal(closeInfo[0]));
                    state.set("actualEndingCheck", new BigDecimal(closeInfo[1]));
                    state.set("actualEndingCc", new BigDecimal(closeInfo[2]));
                    state.set("actualEndingGc", new BigDecimal(closeInfo[3]));
                    state.set("actualEndingOther", new BigDecimal(closeInfo[4]));
                    state.set("endingTxId", trans.getTransactionId());
                    Debug.logInfo("Updated State - " + state, module);
                    try {
                        state.store();
                        state.refresh();
                    } catch (GenericEntityException e) {
                        Debug.logError(e, module);
                        pos.showDialog("dialog/error/exception", e.getMessage());
                    }

                    // print the totals report
                    output.print(UtilProperties.getMessage(PosTransaction.resource,"PosWaitingFinalSales",Locale.getDefault()));
                    //pos.showDialog("dialog/error/terminalclosed"); JLR 14/11/06 : Pb with that don't know why, useless => commented out
                    printTotals(pos, state, true);

                    // lock the terminal for the moment
                    pos.getInput().setLock(true);
                    pos.getButtons().setLock(true);
                    pos.refresh(false);

                    // transmit final data to server
                    GenericValue terminal = null;
                    try {
                        terminal = state.getRelatedOne("PosTerminal");
                    } catch (GenericEntityException e) {
                        Debug.logError(e, module);
                        pos.showDialog("dialog/error/exception", e.getMessage());
                    }
                    if (terminal != null && terminal.get("pushEntitySyncId") != null) {
                        String syncId = terminal.getString("pushEntitySyncId");
                        SyncCallbackAdaptor cb = new SyncCallbackAdaptor(pos, syncId, state.getTimestamp("lastUpdatedTxStamp"));
                        pos.getSession().getDispatcher().registerCallback("runEntitySync", cb);
                    } else {
                        // no sync setting; just logout
                        SecurityEvents.logout(pos);
                    }
                    // unlock the terminal
                    pos.getInput().setLock(false);
                    pos.getButtons().setLock(false);
                    pos.refresh(true);

            }
        } else {
            trans.popDrawer();
            input.clear();
            input.setFunction("CLOSE");
            output.print(UtilProperties.getMessage(PosTransaction.resource,"PosEntCas",Locale.getDefault()));
        }
    }
View Full Code Here

Examples of org.olat.ims.qti.container.Output

        }
      }
      // set displayfeedback
      //<displayfeedback feedbacktype = "Response" linkrefid = "Correct"/>
      //<!ATTLIST displayfeedback  feedbacktype  (Response | Solution | Hint )  'Response' %I_LinkRefId; >
      Output output = itc.getOutput();
      List fbs = el_respcond.selectNodes("displayfeedback");
      for (Iterator it_fbs = fbs.iterator(); it_fbs.hasNext();) {
        Element el_dispfb = (Element) it_fbs.next();
        String linkRefId = el_dispfb.attributeValue("linkrefid"); // must exist (dtd)
        String feedbacktype = el_dispfb.attributeValue("feedbacktype"); // must exist (dtd)
        Element el_resolved =
          (Element) itc.getEl_item().selectSingleNode(".//itemfeedback[@ident='" + linkRefId + "']");
        if (el_resolved == null) continue;
        if (feedbacktype.equals("Response")) {
          // additional (olat) rule:
          // we want to render the original answer again in the simple case where the respcondition was generated
          // by the olat export and contains only one varequal.
          /*
           
              <response_label ident = "2">
                 <flow_mat>
                <material>
                    <mattext texttype="text/html">...</mattext>
                </material>
                        </flow_mat>
                    </response_label>
            ...
         
             <respcondition title="_olat_resp_feedback" continue="Yes">
              <conditionvar>
                <varequal respident="Frage6549" case="Yes">2</varequal>
              </conditionvar>
                    <displayfeedback linkrefid="2"/>
            </respcondition>
           
            In this case, it is possible (and wished) to trace the feedback back to the answer which triggered this feedback.
            Such a respcondition is identified by the title which is exactly "_olat_resp_feedback".
           
           
           */
          Element el_chosenanswer = null;
          if (respcondtitle != null && respcondtitle.equals("_olat_resp_feedback")) {
            Element el_vareq = (Element) el_respcond.selectSingleNode(".//varequal");
            String answerident = el_vareq.getText();
            el_chosenanswer = (Element) itc.getEl_item().selectSingleNode(".//response_label[@ident='" + answerident + "']//material");
          }
          output.addItem_El_response(el_chosenanswer,el_resolved); // give the whole itemfeedback to render
        } else if (feedbacktype.equals("Solution")) {
          Element el_solution = (Element) el_resolved.selectSingleNode(".//solution");
          if (el_solution != null) output.setSolution(new Solution(el_solution));
        } else if (feedbacktype.equals("Hint")) {
          //<!ENTITY % I_FeedbackStyle " feedbackstyle  (Complete | Incremental | Multilevel | Proprietary )  'Complete'">
          Element el_hint = (Element) el_resolved.selectSingleNode(".//hint");
          output.setHint(new Hint(el_hint));
        }
      }
    }
    return fulfilled;

View Full Code Here

Examples of org.olat.ims.qti.container.Output

        case QTIConstants.MESSAGE_SECTION_SUBMITTED :
          //  provide section feedback if enabled and existing
          //SectionContext sc = act.getCurrentSectionContext();         
          if (info.isFeedback()) {
            Output outp = info.getCurrentOutput();
            GenericQTIElement el_feedback = outp.getEl_response();
            if (el_feedback != null) displayFeedback(sb, el_feedback, ai, translator.getLocale());
          }
          if(!comp.getMenuDisplayConf().isEnabledMenu() && !comp.getMenuDisplayConf().isItemPageSequence()) {
            SectionContext sc = ai.getAssessmentContext().getCurrentSectionContext();
            displaySectionInfo(sb, sc, ai, comp, ubu, translator);
          }
          break;

        case QTIConstants.MESSAGE_ASSESSMENT_SUBMITTED :
          //  provide assessment feedback if enabled and existing
          if (info.isFeedback()) {
            Output outp = info.getCurrentOutput();
            GenericQTIElement el_feedback = outp.getEl_response();
            if (el_feedback != null) displayFeedback(sb, el_feedback, ai, translator.getLocale());
          }
          break;

        case QTIConstants.MESSAGE_SECTION_INFODEMANDED : // for menu item navigator
          // provide some stats maybe
          SectionContext sc = ai.getAssessmentContext().getCurrentSectionContext();
          displaySectionInfo(sb, sc, ai, comp, ubu, translator);
          break;

        case QTIConstants.MESSAGE_ASSESSMENT_INFODEMANDED : // at the start of the test
          displayAssessmentInfo(sb, act, ai, comp, ubu, translator);
          break;
      }
    }

    if (renderItems) {
      boolean displayForm = true;
      // First check wether we need to render a form.
      // No form is needed if the current item has a matapplet object to be displayed.
      // Matapplets will send their response back directly.
      SectionContext sct = act.getCurrentSectionContext();
      ItemContext itc = null;
      if (sct != null && !ai.isSectionPage()) {
        itc = sct.getCurrentItemContext();
        if (itc != null) {
          Item item = itc.getQtiItem();
          if (item.getQTIIdent().startsWith("QTIEDIT:FLA:")) displayForm = false;
        }
      }
     
      sb.append("<form action=\"");
      ubu.buildURI(sb, new String[] { VelocityContainer.COMMAND_ID }, new String[] { "sitse" });
     
      sb.append("\" id=\"ofo_iq_item\" method=\"post\">");

      if (!ai.isSectionPage()) {
        if (itc != null) displayItem(sb, renderer, ubu, itc, ai);
      } else {
        if (sct != null && sct.getItemContextCount() != 0)
          displayItems(sb, renderer, ubu, sct, ai);
      }
     
      sb.append("<div class=\"b_button_group\"><input class=\"b_button\" type=\"submit\" name=\"olat_fosm\" value=\"");
      if (ai.isSectionPage())
        sb.append(StringEscapeUtils.escapeHtml(translator.translate("submitMultiAnswers")));
      else
        sb.append(StringEscapeUtils.escapeHtml(translator.translate("submitSingleAnswer")));
      sb.append("\"");
      if (!displayForm) sb.append(" style=\"display: none;\"");
      sb.append(" /></div></form>");
    }

    if (status == QTIConstants.ASSESSMENT_FINISHED) {
      if (info.isFeedback()) {
        Output outp = info.getCurrentOutput();
        GenericQTIElement el_feedback = outp.getEl_response();
        if (el_feedback != null) displayFeedback(sb, el_feedback, ai, null);
      }
    }
    return sb;
  }
View Full Code Here

Examples of org.olat.ims.qti.container.Output

   */
  public void submitAssessment() {
    getAssessmentInstance().close();
    AssessmentContext ac = getAssessmentContext();
    if (ac.isFeedbackavailable()) {
      Output outp = ac.getOutput();
      getInfo().setCurrentOutput(outp);
      getInfo().setFeedback(true);
    }
    info.clear();
    info.setMessage(QTIConstants.MESSAGE_ASSESSMENT_SUBMITTED);
View Full Code Here

Examples of org.olat.ims.qti.container.Output

      getInfo().setRenderItems(true);
    } else { // section was successfully submitted
      sc.sectionWasSubmitted(); // increase times answered of section
      sc.eval(); // calculate any section feedback
      if (sc.isFeedbackavailable()) {
        Output outp = sc.getOutput();
        getInfo().setCurrentOutput(outp);
        getInfo().setFeedback(true);
      }
      getInfo().setMessage(QTIConstants.MESSAGE_SECTION_SUBMITTED);
      getInfo().setRenderItems(true);
View Full Code Here

Examples of org.olat.ims.qti.container.Output

      //getAssessmentContext().eval();
      getInfo().setMessage(QTIConstants.MESSAGE_ITEM_SUBMITTED);
      getInfo().setRenderItems(false);
      ItemContext itc = getAssessmentContext().getCurrentSectionContext().getCurrentItemContext();
      // check on section feedbacks
      Output outp = itc.getOutput();
      if (outp != null) getInfo().setCurrentOutput(outp);
     
     
      // check on item feedback
      if (itc.isFeedback()) { // feedback allowed
View Full Code Here

Examples of org.olat.ims.qti.container.Output

        getInfo().setError(st);
        getInfo().setRenderItems(true); // still continue to next item
      }
    } else { // ok, display feedback
      ItemContext itc = getAssessmentContext().getCurrentSectionContext().getCurrentItemContext();
      Output outp = itc.getOutput();
      if (outp != null) getInfo().setCurrentOutput(outp);
      // check on item feedback
      if (itc.isFeedback()) { // feedback allowed
        getInfo().setFeedback(itc.getOutput().hasItem_Responses());
      }
View Full Code Here

Examples of org.openstreetmap.osmosis.tagtransform.Output

        NodeList outputs = child.getChildNodes();
        for (int j = 0; j < outputs.getLength(); j++) {
          if (!(outputs.item(j) instanceof Element)) {
            continue;
          }
          Output o = parseOutput((Element) outputs.item(j));
          if (o != null) {
            output.add(o);
          }
        }
      }
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.