Package com.google.enterprise.connector.dctm.dfcwrap

Examples of com.google.enterprise.connector.dctm.dfcwrap.IValue


   * @throws RepositoryException if an unexpected error occurs
   */
  private void getDctmAttribute(String name, int dataType, List<Value> values)
      throws RepositoryException {
    for (int i = 0, n = object.getValueCount(name); i < n; i++) {
      IValue val = object.getRepeatingValue(name, i);
      try {
        switch (dataType) {
          case IAttr.DM_BOOLEAN:
            values.add(Value.getBooleanValue(val.asBoolean()));
            break;
          case IAttr.DM_DOUBLE:
            values.add(Value.getDoubleValue(val.asDouble()));
            break;
          case IAttr.DM_ID:
            // TODO: Should we check for null here?
            values.add(Value.getStringValue(val.asId().getId()));
            break;
          case IAttr.DM_INTEGER:
            values.add(Value.getLongValue(val.asInteger()));
            break;
          case IAttr.DM_STRING:
            values.add(Value.getStringValue(val.asString()));
            break;
          case IAttr.DM_TIME:
            Date date = val.asTime().getDate();
            if (date != null) {
              values.add(Value.getDateValue(getCalendarFromDate(date)));
            }
            break;
          default:
View Full Code Here


    collec.next();
  }

  public void testAsString() {
    try {
      IValue val = collec.getValue("r_object_id");
      Assert.assertTrue(val instanceof MockDmValue);
      String valSg = val.asString();
      assertEquals(valSg, DmInitialize.DM_ID1);
    } catch (RepositoryException e) {
      // TODO: Why is this exception ignored?
    }
  }
View Full Code Here

    IQuery query = null;
    query = localClient.getQuery();
    query.setDQL(DmInitialize.DM_QUERY_STRING_ENABLE);
    ICollection collec = query.execute(sess7, IQuery.READ_QUERY);
    if (collec.next()) {
      IValue val = collec.getValue("r_object_id");
      Assert.assertTrue(val instanceof MockDmValue);
    }
  }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.dctm.dfcwrap.IValue

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.