Examples of MForm


Examples of org.apache.sqoop.model.MForm

    inputs = new LinkedList<MInput<?>>();
    input = new MStringInput("I1", false, (short)30);
    inputs.add(input);
    input = new MStringInput("I2", false, (short)30);
    inputs.add(input);
    forms.add(new MForm("F1", inputs));

    inputs = new LinkedList<MInput<?>>();
    input = new MStringInput("I3", false, (short)30);
    inputs.add(input);
    input = new MStringInput("I4", false, (short)30);
    inputs.add(input);
    forms.add(new MForm("F2", inputs));

    return forms;
  }
View Full Code Here

Examples of org.apache.sqoop.model.MForm

      String formName = rsetForm.getString(4);
      String formType = rsetForm.getString(5);
      int formIndex = rsetForm.getInt(6);
      List<MInput<?>> formInputs = new ArrayList<MInput<?>>();

      MForm mf = new MForm(formName, formInputs);
      mf.setPersistenceId(formId);

      inputFetchStmt.setLong(formPosition, formId);

      ResultSet rsetInput = inputFetchStmt.executeQuery();
      while (rsetInput.next()) {
        long inputId = rsetInput.getLong(1);
        String inputName = rsetInput.getString(2);
        long inputForm = rsetInput.getLong(3);
        short inputIndex = rsetInput.getShort(4);
        String inputType = rsetInput.getString(5);
        boolean inputSensitivity = rsetInput.getBoolean(6);
        short inputStrLength = rsetInput.getShort(7);
        String inputEnumValues = rsetInput.getString(8);
        String value = rsetInput.getString(9);

        MInputType mit = MInputType.valueOf(inputType);

        MInput input = null;
        switch (mit) {
        case STRING:
          input = new MStringInput(inputName, inputSensitivity, inputStrLength);
          break;
        case MAP:
          input = new MMapInput(inputName, inputSensitivity);
          break;
        case INTEGER:
          input = new MIntegerInput(inputName, inputSensitivity);
          break;
        case ENUM:
          input = new MEnumInput(inputName, inputSensitivity, inputEnumValues.split(","));
          break;
        default:
          throw new SqoopException(DerbyRepoError.DERBYREPO_0006,
              "input-" + inputName + ":" + inputId + ":"
              + "form-" + inputForm + ":" + mit.name());
        }

        // Set persistent ID
        input.setPersistenceId(inputId);

        // Set value
        if(value == null) {
          input.setEmpty();
        } else {
          input.restoreFromUrlSafeValueString(value);
        }

        if (mf.getInputs().size() != inputIndex) {
          throw new SqoopException(DerbyRepoError.DERBYREPO_0009,
            "form: " + mf
            + "; input: " + input
            + "; index: " + inputIndex
            + "; expected: " + mf.getInputs().size()
          );
        }

        mf.getInputs().add(input);
      }

      if (mf.getInputs().size() == 0) {
        throw new SqoopException(DerbyRepoError.DERBYREPO_0008,
          "connector-" + formConnectorId
          + "; form: " + mf
        );
      }
View Full Code Here

Examples of org.apache.sqoop.model.MForm

      print(type);
      print(" %s ", resourceString(Constants.RES_FORMDISPLAYER_FORM));
      print(findx++);
      println(":");

      MForm form = fiter.next();
      print("      %s: ", resourceString(Constants.RES_FORMDISPLAYER_NAME));
      println(form.getName());

      // Label
      print("      %s: ", resourceString(Constants.RES_FORMDISPLAYER_LABEL));
      println(bundle.getString(form.getLabelKey()));

      // Help text
      print("      %s: ", resourceString(Constants.RES_FORMDISPLAYER_HELP));
      println(bundle.getString(form.getHelpKey()));

      List<MInput<?>> inputs = form.getInputs();
      Iterator<MInput<?>> iiter = inputs.iterator();
      int iindx = 1;
      while (iiter.hasNext()) {
        print("      %s ", resourceString(Constants.RES_FORMDISPLAYER_INPUT));
        print(iindx++);
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.