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

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


    return includedProperties;
  }

  private Set<String> getSysObjectAttributes(ISession sess)
      throws RepositoryException {
    IType type = sess.getType("dm_sysobject");
    HashSet<String> attributes = new HashSet<String>();
    for (int j = 0; j < type.getTypeAttrCount(); j++) {
      String attrName = type.getTypeAttrNameAt(j);
      logger.config("dm_sysobject attribute: " + attrName);
      attributes.add(attrName);
    }
    return attributes;
  }
View Full Code Here


    // Loop of the selected types list.
    logger.config("Included object types: " + includedObjectType);
    String[] typeList = includedObjectType.split(",");
    for (String typeName : typeList) {
      IType type = sess.getType(typeName);
      logger.config("Type name: " + typeName + "; attribute count: "
          + type.getTypeAttrCount());

      // Loop of the properties of each selected type.
   ATTRIBUTES:
      for (int i = 0; i < type.getTypeAttrCount(); i++) {
        String attrName = type.getTypeAttrNameAt(i);
        logger.config("Attribute name " + i + ": " + attrName);

        Set<String> baseTypes = new HashSet<String>();
        if (sysObjectAttrs.contains(attrName)) {
          baseTypes.add("dm_sysobject");
        } else if (!propertiesMap.containsKey(attrName)) {
          baseTypes.add(typeName);
        } else {
          Set<String> currentTypes = propertiesMap.get(attrName);
          logger.config(attrName + " previously found in types: "
              + currentTypes);

          // Loop of the types we have already found for this attribute.
          for (String currentTypeName : currentTypes) {
            IType currentType = sess.getType(currentTypeName);
            if (currentType.isSubTypeOf(typeName)) {
              logger.config(typeName + " is supertype of " + currentTypeName);
              baseTypes.add(typeName);
            } else if (type.isSubTypeOf(currentTypeName)) {
              // We don't need typeName for this attribute, so skip to
              // the next attribute.
View Full Code Here

    Map<String, IType> superTypes = traversalManager.getSuperTypeCache();
    String typeName = type.getName();
    if (superTypes.containsKey(typeName))
      return superTypes.get(typeName);
    else {
      IType superType = type.getSuperType();
      superTypes.put(typeName, superType);
      return superType;
    }
  }
View Full Code Here

  protected void setUp() {
    superTypeNames = new ArrayList<String>(Arrays.asList(SUPER_TYPE_NAMES));
  }

  public void testType() throws RepositoryException {
    IType type = new MockDmType(TYPE_NAME);
    assertEquals(TYPE_NAME, type.getName());
    assertEquals(TYPE_NAME + "Description", type.getDescription());
  }
View Full Code Here

    assertEquals(TYPE_NAME, type.getName());
    assertEquals(TYPE_NAME + "Description", type.getDescription());
  }

  public void testSuperType() throws RepositoryException {
    IType type = new MockDmType(TYPE_NAME);
    IType souper = type.getSuperType();
    assertNotNull(souper);
    assertEquals("Super" + TYPE_NAME, souper.getName());
    assertTrue(type.isSubTypeOf(souper.getName()));
    assertNotNull(souper.getSuperType());
  }
View Full Code Here

    assertTrue(type.isSubTypeOf(souper.getName()));
    assertNotNull(souper.getSuperType());
  }

  public void testAncestorTypes() throws RepositoryException {
    IType type = new MockDmType(TYPE_NAME);
    assertTrue(superTypeNames.remove(TYPE_NAME));
    for (IType souper = type.getSuperType();
         souper != null;
         souper = souper.getSuperType()) {
      String name = souper.getName();
      assertTrue(name, type.isSubTypeOf(souper.getName()));
      assertTrue(name, superTypeNames.remove(name));
    }
    assertTrue(superTypeNames.toString(), superTypeNames.isEmpty());
  }
View Full Code Here

    }
    assertTrue(superTypeNames.toString(), superTypeNames.isEmpty());
  }

  public void testSysObject() throws RepositoryException {
    IType type = new MockDmType("dm_sysobject");
    IType souper = type.getSuperType();
    assertNull(souper);
    int attrCount = type.getTypeAttrCount();
    assertEquals(1, attrCount);
    assertEquals("dm_sysobject_attr", type.getTypeAttrNameAt(0));
  }
View Full Code Here

    assertEquals(1, attrCount);
    assertEquals("dm_sysobject_attr", type.getTypeAttrNameAt(0));
  }

  public void testAttributes() throws RepositoryException {
    IType type = new MockDmType(TYPE_NAME);
    int attrCount = type.getTypeAttrCount();
    assertEquals(7, attrCount);

    Set<String> expected = new HashSet<String>(superTypeNames);
    Set<String> expectedShared = new HashSet<String>();
    expectedShared.add("Grand_sharedattr");
    expectedShared.add("Super_sharedattr");
    expectedShared.add("sharedattr");

    Set<String> actual = new HashSet<String>();
    Set<String> actualShared = new HashSet<String>();
    for (int i = 0; i < attrCount; i++) {
      String attrName = type.getTypeAttrNameAt(i);
      assertTrue(attrName, attrName.endsWith("attr"));
      if (attrName.endsWith("_attr")) {
        actual.add(attrName.substring(0, attrName.length() - "_attr".length()));
      } else {
        actualShared.add(attrName);
View Full Code Here

TOP

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

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.