/**
   * Create the ValueObject collection to hold the set of DomainObjects.
   *
   * @param map - maps DomainObjects to created ValueObjects
   * @param domainObjectSet - Set of ims.core.resource.place.domain.objects.Location objects.
   */
  public static ims.admin.vo.LocationShortVoCollection createLocationShortVoCollectionFromLocation(
      DomainObjectMap map, java.util.Set domainObjectSet) {
    ims.admin.vo.LocationShortVoCollection voList = new ims.admin.vo.LocationShortVoCollection();
    if (null == domainObjectSet) {
      return voList;
    }
    int rieCount = 0;
    int activeCount = 0;
    java.util.Iterator iterator = domainObjectSet.iterator();
    while (iterator.hasNext()) {
      ims.core.resource.place.domain.objects.Location domainObject =
          (ims.core.resource.place.domain.objects.Location) iterator.next();
      ims.admin.vo.LocationShortVo vo = create(map, domainObject);

      if (vo != null) voList.add(vo);

      if (domainObject != null) {
        if (domainObject.getIsRIE() != null && domainObject.getIsRIE().booleanValue() == true)
          rieCount++;
        else activeCount++;
      }
    }
    voList.setRieCount(rieCount);
    voList.setActiveCount(activeCount);
    return voList;
  }
  /**
   * Create the ValueObject collection to hold the list of DomainObjects.
   *
   * @param map - maps DomainObjects to created ValueObjects
   * @param domainObjectList - List of ims.core.resource.place.domain.objects.Location objects.
   */
  public static ims.admin.vo.LocationShortVoCollection createLocationShortVoCollectionFromLocation(
      DomainObjectMap map, java.util.List domainObjectList) {
    ims.admin.vo.LocationShortVoCollection voList = new ims.admin.vo.LocationShortVoCollection();
    if (null == domainObjectList) {
      return voList;
    }
    int rieCount = 0;
    int activeCount = 0;
    for (int i = 0; i < domainObjectList.size(); i++) {
      ims.core.resource.place.domain.objects.Location domainObject =
          (ims.core.resource.place.domain.objects.Location) domainObjectList.get(i);
      ims.admin.vo.LocationShortVo vo = create(map, domainObject);

      if (vo != null) voList.add(vo);

      if (domainObject != null) {
        if (domainObject.getIsRIE() != null && domainObject.getIsRIE().booleanValue() == true)
          rieCount++;
        else activeCount++;
      }
    }

    voList.setRieCount(rieCount);
    voList.setActiveCount(activeCount);
    return voList;
  }
  /**
   * Update the ValueObject with the Domain Object.
   *
   * @param map DomainObjectMap of DomainObjects to already created ValueObjects.
   * @param valueObject to be updated
   * @param domainObject ims.core.resource.place.domain.objects.Location
   */
  public static ims.admin.vo.LocationShortVo insert(
      DomainObjectMap map,
      ims.admin.vo.LocationShortVo valueObject,
      ims.core.resource.place.domain.objects.Location domainObject) {
    if (null == domainObject) {
      return valueObject;
    }
    if (null == map) {
      map = new DomainObjectMap();
    }

    valueObject.setID_Location(domainObject.getId());
    valueObject.setIsRIE(domainObject.getIsRIE());

    // If this is a recordedInError record, and the domainObject
    // value isIncludeRecord has not been set, then we return null and
    // not the value object
    if (valueObject.getIsRIE() != null
        && valueObject.getIsRIE().booleanValue() == true
        && !domainObject.isIncludeRecord()) return null;

    // If this is not a recordedInError record, and the domainObject
    // value isIncludeRecord has been set, then we return null and
    // not the value object
    if ((valueObject.getIsRIE() == null || valueObject.getIsRIE().booleanValue() == false)
        && domainObject.isIncludeRecord()) return null;

    // UpperName
    valueObject.setUpperName(domainObject.getUpperName());
    // Name
    valueObject.setName(domainObject.getName());
    // isActive
    valueObject.setIsActive(domainObject.isIsActive());
    // IsVirtual
    valueObject.setIsVirtual(domainObject.isIsVirtual());
    // Type
    ims.domain.lookups.LookupInstance instance5 = domainObject.getType();
    if (null != instance5) {
      ims.framework.utils.ImagePath img = null;
      ims.framework.utils.Color color = null;
      img = null;
      if (instance5.getImage() != null) {
        img =
            new ims.framework.utils.ImagePath(
                instance5.getImage().getImageId(), instance5.getImage().getImagePath());
      }
      color = instance5.getColor();
      if (color != null) color.getValue();

      ims.core.vo.lookups.LocationType voLookup5 =
          new ims.core.vo.lookups.LocationType(
              instance5.getId(), instance5.getText(), instance5.isActive(), null, img, color);
      ims.core.vo.lookups.LocationType parentVoLookup5 = voLookup5;
      ims.domain.lookups.LookupInstance parent5 = instance5.getParent();
      while (parent5 != null) {
        if (parent5.getImage() != null) {
          img =
              new ims.framework.utils.ImagePath(
                  parent5.getImage().getImageId(), parent5.getImage().getImagePath());
        } else {
          img = null;
        }
        color = parent5.getColor();
        if (color != null) color.getValue();
        parentVoLookup5.setParent(
            new ims.core.vo.lookups.LocationType(
                parent5.getId(), parent5.getText(), parent5.isActive(), null, img, color));
        parentVoLookup5 = parentVoLookup5.getParent();
        parent5 = parent5.getParent();
      }
      valueObject.setType(voLookup5);
    }
    // DisplayInEDTracking
    valueObject.setDisplayInEDTracking(domainObject.isDisplayInEDTracking());
    // CaseNoteFolderLocation
    valueObject.setCaseNoteFolderLocation(domainObject.isCaseNoteFolderLocation());
    return valueObject;
  }