@Test public void toSolrAdvancedSearch_primaryContactWithFamilyName() throws Exception { setupOrganizationPersonAssociationPrimaryContactWithFamilyName(in); mockSearchAccessControlFields.setAccessControlFields(anyObject(SolrBaseDocument.class), anyObject(AcmAssignedObject.class)); expectLastCall(); expect(mockUserDao.quietFindByUserId("creator")).andReturn(creator); expect(mockUserDao.quietFindByUserId("modifier")).andReturn(modifier); replayAll(); SolrAdvancedSearchDocument result = unit.toSolrAdvancedSearch(in); verifyAll(); validateResultToSolrAdvancedSerach_primaryContactWithFamilyName(result); }
@Override public SolrAdvancedSearchDocument toSolrAdvancedSearch(Organization org) { SolrAdvancedSearchDocument orgDoc = new SolrAdvancedSearchDocument(); getSearchAccessControlFields().setAccessControlFields(orgDoc, org); orgDoc.setId(org.getOrganizationId() + "-ORGANIZATION"); orgDoc.setObject_type_s("ORGANIZATION"); orgDoc.setObject_id_s(org.getOrganizationId() + ""); orgDoc.setCreate_date_tdt(org.getCreated()); orgDoc.setCreator_lcs(org.getCreator()); orgDoc.setModified_date_tdt(org.getModified()); orgDoc.setModifier_lcs(org.getModifier()); orgDoc.setType_lcs(org.getOrganizationType()); orgDoc.setValue_parseable(org.getOrganizationValue()); orgDoc.setName(org.getOrganizationValue()); orgDoc.setTitle_parseable(org.getOrganizationValue()); orgDoc.setTitle_parseable_lcs(org.getOrganizationValue()); orgDoc.setStatus_lcs(org.getStatus()); AcmUser creator = getUserDao().quietFindByUserId(org.getCreator()); if (creator != null) { orgDoc.setAdditionalProperty("creator_full_name_lcs", creator.getFirstName() + " " + creator.getLastName()); } AcmUser modifier = getUserDao().quietFindByUserId(org.getModifier()); if (modifier != null) { orgDoc.setAdditionalProperty("modifier_full_name_lcs", modifier.getFirstName() + " " + modifier.getLastName()); } orgDoc.setAdditionalProperty("primary_contact_s", getPrimaryContact(org)); orgDoc.setAdditionalProperty("default_phone_s", getDefaultPhone(org)); orgDoc.setAdditionalProperty("default_location_s", getDefaultAddress(org)); orgDoc.setAdditionalProperty("default_identification_s", getDefaultIdentification(org)); String participantsListJson = ParticipantUtils.createParticipantsListJson(org.getParticipants()); orgDoc.setAdditionalProperty("acm_participants_lcs", participantsListJson); return orgDoc; }
OrganizationToSolrTransformer implements AcmObjectToSolrDocTransformer<Organization> { @Override public SolrAdvancedSearchDocument toSolrAdvancedSearch(Organization org) { SolrAdvancedSearchDocument orgDoc = new SolrAdvancedSearchDocument(); getSearchAccessControlFields().setAccessControlFields(orgDoc, org); orgDoc.setId(org.getOrganizationId() + "-ORGANIZATION"); orgDoc.setObject_type_s("ORGANIZATION"); orgDoc.setObject_id_s(org.getOrganizationId() + ""); orgDoc.setCreate_date_tdt(org.getCreated()); orgDoc.setCreator_lcs(org.getCreator()); orgDoc.setModified_date_tdt(org.getModified()); orgDoc.setModifier_lcs(org.getModifier()); orgDoc.setType_lcs(org.getOrganizationType()); orgDoc.setValue_parseable(org.getOrganizationValue()); orgDoc.setName(org.getOrganizationValue()); orgDoc.setTitle_parseable(org.getOrganizationValue()); orgDoc.setTitle_parseable_lcs(org.getOrganizationValue()); orgDoc.setStatus_lcs(org.getStatus()); AcmUser creator = getUserDao().quietFindByUserId(org.getCreator()); if (creator != null) { orgDoc.setAdditionalProperty("creator_full_name_lcs", creator.getFirstName() + " " + creator.getLastName()); } AcmUser modifier = getUserDao().quietFindByUserId(org.getModifier()); if (modifier != null) { orgDoc.setAdditionalProperty("modifier_full_name_lcs", modifier.getFirstName() + " " + modifier.getLastName()); } orgDoc.setAdditionalProperty("primary_contact_s", getPrimaryContact(org)); orgDoc.setAdditionalProperty("default_phone_s", getDefaultPhone(org)); orgDoc.setAdditionalProperty("default_location_s", getDefaultAddress(org)); orgDoc.setAdditionalProperty("default_identification_s", getDefaultIdentification(org)); String participantsListJson = ParticipantUtils.createParticipantsListJson(org.getParticipants()); orgDoc.setAdditionalProperty("acm_participants_lcs", participantsListJson); return orgDoc; } }
OrganizationToSolrTransformer implements AcmObjectToSolrDocTransformer<Organization> { @Override public SolrAdvancedSearchDocument toSolrAdvancedSearch(Organization org) { SolrAdvancedSearchDocument orgDoc = new SolrAdvancedSearchDocument(); getSearchAccessControlFields().setAccessControlFields(orgDoc, org); orgDoc.setId(org.getOrganizationId() + "-ORGANIZATION"); orgDoc.setObject_type_s("ORGANIZATION"); orgDoc.setObject_id_s(org.getOrganizationId() + ""); orgDoc.setCreate_date_tdt(org.getCreated()); orgDoc.setCreator_lcs(org.getCreator()); orgDoc.setModified_date_tdt(org.getModified()); orgDoc.setModifier_lcs(org.getModifier()); orgDoc.setType_lcs(org.getOrganizationType()); orgDoc.setValue_parseable(org.getOrganizationValue()); orgDoc.setName(org.getOrganizationValue()); orgDoc.setTitle_parseable(org.getOrganizationValue()); orgDoc.setTitle_parseable_lcs(org.getOrganizationValue()); orgDoc.setStatus_lcs(org.getStatus()); AcmUser creator = getUserDao().quietFindByUserId(org.getCreator()); if (creator != null) { orgDoc.setAdditionalProperty("creator_full_name_lcs", creator.getFirstName() + " " + creator.getLastName()); } AcmUser modifier = getUserDao().quietFindByUserId(org.getModifier()); if (modifier != null) { orgDoc.setAdditionalProperty("modifier_full_name_lcs", modifier.getFirstName() + " " + modifier.getLastName()); } orgDoc.setAdditionalProperty("primary_contact_s", getPrimaryContact(org)); orgDoc.setAdditionalProperty("default_phone_s", getDefaultPhone(org)); orgDoc.setAdditionalProperty("default_location_s", getDefaultAddress(org)); orgDoc.setAdditionalProperty("default_identification_s", getDefaultIdentification(org)); String participantsListJson = ParticipantUtils.createParticipantsListJson(org.getParticipants()); orgDoc.setAdditionalProperty("acm_participants_lcs", participantsListJson); return orgDoc; }  }
OrganizationToSolrTransformer implements AcmObjectToSolrDocTransformer<Organization> { @Override public SolrAdvancedSearchDocument toSolrAdvancedSearch(Organization org) { SolrAdvancedSearchDocument orgDoc = new SolrAdvancedSearchDocument(); getSearchAccessControlFields().setAccessControlFields(orgDoc, org); orgDoc.setId(org.getOrganizationId() + "-ORGANIZATION"); orgDoc.setObject_type_s("ORGANIZATION"); orgDoc.setObject_id_s(org.getOrganizationId() + ""); orgDoc.setCreate_date_tdt(org.getCreated()); orgDoc.setCreator_lcs(org.getCreator()); orgDoc.setModified_date_tdt(org.getModified()); orgDoc.setModifier_lcs(org.getModifier()); orgDoc.setType_lcs(org.getOrganizationType()); orgDoc.setValue_parseable(org.getOrganizationValue()); orgDoc.setName(org.getOrganizationValue()); orgDoc.setTitle_parseable(org.getOrganizationValue()); orgDoc.setTitle_parseable_lcs(org.getOrganizationValue()); orgDoc.setStatus_lcs(org.getStatus()); AcmUser creator = getUserDao().quietFindByUserId(org.getCreator()); if (creator != null) { orgDoc.setAdditionalProperty("creator_full_name_lcs", creator.getFirstName() + " " + creator.getLastName()); } AcmUser modifier = getUserDao().quietFindByUserId(org.getModifier()); if (modifier != null) { orgDoc.setAdditionalProperty("modifier_full_name_lcs", modifier.getFirstName() + " " + modifier.getLastName()); } orgDoc.setAdditionalProperty("primary_contact_s", getPrimaryContact(org)); orgDoc.setAdditionalProperty("default_phone_s", getDefaultPhone(org)); orgDoc.setAdditionalProperty("default_location_s", getDefaultAddress(org)); orgDoc.setAdditionalProperty("default_identification_s", getDefaultIdentification(org)); String participantsListJson = ParticipantUtils.createParticipantsListJson(org.getParticipants()); orgDoc.setAdditionalProperty("acm_participants_lcs", participantsListJson); return orgDoc; }  @Override List<Organization> getObjectsModifiedSince(Date lastModified, int start, int pageSize); @Override SolrAdvancedSearchDocument toSolrAdvancedSearch(Organization org); @Override SolrDocument toSolrQuickSearch(Organization in); @Override boolean isAcmObjectTypeSupported(Class acmObjectType); OrganizationDao getOrganizationDao(); void setOrganizationDao(OrganizationDao organizationDao); UserDao getUserDao(); void setUserDao(UserDao userDao); @Override Class<?> getAcmObjectTypeSupported(); SearchAccessControlFields getSearchAccessControlFields(); void setSearchAccessControlFields(SearchAccessControlFields searchAccessControlFields); }
OrganizationToSolrTransformer implements AcmObjectToSolrDocTransformer<Organization> { @Override public SolrAdvancedSearchDocument toSolrAdvancedSearch(Organization org) { SolrAdvancedSearchDocument orgDoc = new SolrAdvancedSearchDocument(); getSearchAccessControlFields().setAccessControlFields(orgDoc, org); orgDoc.setId(org.getOrganizationId() + "-ORGANIZATION"); orgDoc.setObject_type_s("ORGANIZATION"); orgDoc.setObject_id_s(org.getOrganizationId() + ""); orgDoc.setCreate_date_tdt(org.getCreated()); orgDoc.setCreator_lcs(org.getCreator()); orgDoc.setModified_date_tdt(org.getModified()); orgDoc.setModifier_lcs(org.getModifier()); orgDoc.setType_lcs(org.getOrganizationType()); orgDoc.setValue_parseable(org.getOrganizationValue()); orgDoc.setName(org.getOrganizationValue()); orgDoc.setTitle_parseable(org.getOrganizationValue()); orgDoc.setTitle_parseable_lcs(org.getOrganizationValue()); orgDoc.setStatus_lcs(org.getStatus()); AcmUser creator = getUserDao().quietFindByUserId(org.getCreator()); if (creator != null) { orgDoc.setAdditionalProperty("creator_full_name_lcs", creator.getFirstName() + " " + creator.getLastName()); } AcmUser modifier = getUserDao().quietFindByUserId(org.getModifier()); if (modifier != null) { orgDoc.setAdditionalProperty("modifier_full_name_lcs", modifier.getFirstName() + " " + modifier.getLastName()); } orgDoc.setAdditionalProperty("primary_contact_s", getPrimaryContact(org)); orgDoc.setAdditionalProperty("default_phone_s", getDefaultPhone(org)); orgDoc.setAdditionalProperty("default_location_s", getDefaultAddress(org)); orgDoc.setAdditionalProperty("default_identification_s", getDefaultIdentification(org)); String participantsListJson = ParticipantUtils.createParticipantsListJson(org.getParticipants()); orgDoc.setAdditionalProperty("acm_participants_lcs", participantsListJson); return orgDoc; }  @Override List<Organization> getObjectsModifiedSince(Date lastModified, int start, int pageSize); @Override SolrAdvancedSearchDocument toSolrAdvancedSearch(Organization org); @Override SolrDocument toSolrQuickSearch(Organization in); @Override boolean isAcmObjectTypeSupported(Class acmObjectType); OrganizationDao getOrganizationDao(); void setOrganizationDao(OrganizationDao organizationDao); UserDao getUserDao(); void setUserDao(UserDao userDao); @Override Class<?> getAcmObjectTypeSupported(); SearchAccessControlFields getSearchAccessControlFields(); void setSearchAccessControlFields(SearchAccessControlFields searchAccessControlFields);  }