예제 #1
0
 public int deleteAddresssByUser(UserType user) throws FactoryException {
   long[] ids =
       getIdByField(
           new QueryField[] {QueryFields.getFieldOwner(user.getId())},
           user.getOrganization().getId());
   return deleteAddresssByIds(ids, user.getOrganization());
 }
예제 #2
0
 public int deleteAddresssInGroup(DirectoryGroupType group) throws FactoryException {
   // Can't just delete by group;
   // Need to get ids so as to delete participations as well
   //
   long[] ids =
       getIdByField(
           new QueryField[] {QueryFields.getFieldGroup(group.getId())},
           group.getOrganization().getId());
   /// TODO: Delete participations
   ///
   return deleteAddresssByIds(ids, group.getOrganization());
 }
예제 #3
0
  public List<AddressType> searchAddresss(
      String searchValue, long startRecord, int recordCount, DirectoryGroupType dir)
      throws FactoryException {

    ProcessingInstructionType instruction = null;
    if (startRecord >= 0 && recordCount >= 0) {
      instruction = new ProcessingInstructionType();
      instruction.setOrderClause("name ASC");
      instruction.setPaginate(true);
      instruction.setStartIndex(startRecord);
      instruction.setRecordCount(recordCount);
    }

    List<QueryField> fields = buildSearchQuery(searchValue, dir.getOrganization());
    fields.add(QueryFields.getFieldGroup(dir.getId()));
    return search(fields.toArray(new QueryField[0]), instruction, dir.getOrganization());
  }
예제 #4
0
 @Override
 public void setFactoryFields(
     List<QueryField> fields, NameIdType map, ProcessingInstructionType instruction) {
   AddressType use_map = (AddressType) map;
   fields.add(QueryFields.getFieldPreferred(use_map.getPreferred()));
   fields.add(QueryFields.getFieldGroup(use_map.getGroup().getId()));
   fields.add(QueryFields.getFieldDescription(use_map.getDescription()));
   fields.add(QueryFields.getFieldAddressLine1(use_map.getAddressLine1()));
   fields.add(QueryFields.getFieldAddressLine2(use_map.getAddressLine2()));
   fields.add(QueryFields.getFieldCity(use_map.getCity()));
   fields.add(QueryFields.getFieldState(use_map.getState()));
   fields.add(QueryFields.getFieldRegion(use_map.getRegion()));
   fields.add(QueryFields.getFieldLocationType(use_map.getLocationType()));
   fields.add(QueryFields.getFieldCountry(use_map.getCountry()));
   fields.add(QueryFields.getFieldPostalCode(use_map.getPostalCode()));
 }