@Test public void toSolrQuickSearch() throws Exception { mockSearchAccessControlFields.setAccessControlFields(anyObject(SolrBaseDocument.class), anyObject(AcmAssignedObject.class)); expectLastCall(); expect(mockUserDao.quietFindByUserId("creator")).andReturn(creator); expect(mockUserDao.quietFindByUserId("modifier")).andReturn(modifier); replayAll(); SolrDocument result = unit.toSolrQuickSearch(in); verifyAll(); validateResult(result); }
@Override public SolrDocument toSolrQuickSearch(Organization in) { SolrDocument orgDoc = new SolrDocument(); getSearchAccessControlFields().setAccessControlFields(orgDoc, in); orgDoc.setId(in.getOrganizationId() + "-ORGANIZATION"); orgDoc.setObject_type_s("ORGANIZATION"); orgDoc.setObject_id_s(in.getOrganizationId() + ""); orgDoc.setCreate_tdt(in.getCreated()); orgDoc.setAuthor_s(in.getCreator()); orgDoc.setLast_modified_tdt(in.getModified()); orgDoc.setModifier_s(in.getModifier()); orgDoc.setType_s(in.getOrganizationType()); orgDoc.setData_s(in.getOrganizationValue()); orgDoc.setName(in.getOrganizationValue()); orgDoc.setTitle_parseable(in.getOrganizationValue()); orgDoc.setTitle_parseable_lcs(in.getOrganizationValue()); orgDoc.setStatus_s(in.getStatus()); AcmUser creator = getUserDao().quietFindByUserId(in.getCreator()); if (creator != null) { orgDoc.setAdditionalProperty("creator_full_name_lcs", creator.getFirstName() + " " + creator.getLastName()); } AcmUser modifier = getUserDao().quietFindByUserId(in.getModifier()); if (modifier != null) { orgDoc.setAdditionalProperty("modifier_full_name_lcs", modifier.getFirstName() + " " + modifier.getLastName()); } return orgDoc; }
OrganizationToSolrTransformer implements AcmObjectToSolrDocTransformer<Organization> { @Override public SolrDocument toSolrQuickSearch(Organization in) { SolrDocument orgDoc = new SolrDocument(); getSearchAccessControlFields().setAccessControlFields(orgDoc, in); orgDoc.setId(in.getOrganizationId() + "-ORGANIZATION"); orgDoc.setObject_type_s("ORGANIZATION"); orgDoc.setObject_id_s(in.getOrganizationId() + ""); orgDoc.setCreate_tdt(in.getCreated()); orgDoc.setAuthor_s(in.getCreator()); orgDoc.setLast_modified_tdt(in.getModified()); orgDoc.setModifier_s(in.getModifier()); orgDoc.setType_s(in.getOrganizationType()); orgDoc.setData_s(in.getOrganizationValue()); orgDoc.setName(in.getOrganizationValue()); orgDoc.setTitle_parseable(in.getOrganizationValue()); orgDoc.setTitle_parseable_lcs(in.getOrganizationValue()); orgDoc.setStatus_s(in.getStatus()); AcmUser creator = getUserDao().quietFindByUserId(in.getCreator()); if (creator != null) { orgDoc.setAdditionalProperty("creator_full_name_lcs", creator.getFirstName() + " " + creator.getLastName()); } AcmUser modifier = getUserDao().quietFindByUserId(in.getModifier()); if (modifier != null) { orgDoc.setAdditionalProperty("modifier_full_name_lcs", modifier.getFirstName() + " " + modifier.getLastName()); } return orgDoc; } }
OrganizationToSolrTransformer implements AcmObjectToSolrDocTransformer<Organization> { @Override public SolrDocument toSolrQuickSearch(Organization in) { SolrDocument orgDoc = new SolrDocument(); getSearchAccessControlFields().setAccessControlFields(orgDoc, in); orgDoc.setId(in.getOrganizationId() + "-ORGANIZATION"); orgDoc.setObject_type_s("ORGANIZATION"); orgDoc.setObject_id_s(in.getOrganizationId() + ""); orgDoc.setCreate_tdt(in.getCreated()); orgDoc.setAuthor_s(in.getCreator()); orgDoc.setLast_modified_tdt(in.getModified()); orgDoc.setModifier_s(in.getModifier()); orgDoc.setType_s(in.getOrganizationType()); orgDoc.setData_s(in.getOrganizationValue()); orgDoc.setName(in.getOrganizationValue()); orgDoc.setTitle_parseable(in.getOrganizationValue()); orgDoc.setTitle_parseable_lcs(in.getOrganizationValue()); orgDoc.setStatus_s(in.getStatus()); AcmUser creator = getUserDao().quietFindByUserId(in.getCreator()); if (creator != null) { orgDoc.setAdditionalProperty("creator_full_name_lcs", creator.getFirstName() + " " + creator.getLastName()); } AcmUser modifier = getUserDao().quietFindByUserId(in.getModifier()); if (modifier != null) { orgDoc.setAdditionalProperty("modifier_full_name_lcs", modifier.getFirstName() + " " + modifier.getLastName()); } return orgDoc; }  }
OrganizationToSolrTransformer implements AcmObjectToSolrDocTransformer<Organization> { @Override public SolrDocument toSolrQuickSearch(Organization in) { SolrDocument orgDoc = new SolrDocument(); getSearchAccessControlFields().setAccessControlFields(orgDoc, in); orgDoc.setId(in.getOrganizationId() + "-ORGANIZATION"); orgDoc.setObject_type_s("ORGANIZATION"); orgDoc.setObject_id_s(in.getOrganizationId() + ""); orgDoc.setCreate_tdt(in.getCreated()); orgDoc.setAuthor_s(in.getCreator()); orgDoc.setLast_modified_tdt(in.getModified()); orgDoc.setModifier_s(in.getModifier()); orgDoc.setType_s(in.getOrganizationType()); orgDoc.setData_s(in.getOrganizationValue()); orgDoc.setName(in.getOrganizationValue()); orgDoc.setTitle_parseable(in.getOrganizationValue()); orgDoc.setTitle_parseable_lcs(in.getOrganizationValue()); orgDoc.setStatus_s(in.getStatus()); AcmUser creator = getUserDao().quietFindByUserId(in.getCreator()); if (creator != null) { orgDoc.setAdditionalProperty("creator_full_name_lcs", creator.getFirstName() + " " + creator.getLastName()); } AcmUser modifier = getUserDao().quietFindByUserId(in.getModifier()); if (modifier != null) { orgDoc.setAdditionalProperty("modifier_full_name_lcs", modifier.getFirstName() + " " + modifier.getLastName()); } 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 SolrDocument toSolrQuickSearch(Organization in) { SolrDocument orgDoc = new SolrDocument(); getSearchAccessControlFields().setAccessControlFields(orgDoc, in); orgDoc.setId(in.getOrganizationId() + "-ORGANIZATION"); orgDoc.setObject_type_s("ORGANIZATION"); orgDoc.setObject_id_s(in.getOrganizationId() + ""); orgDoc.setCreate_tdt(in.getCreated()); orgDoc.setAuthor_s(in.getCreator()); orgDoc.setLast_modified_tdt(in.getModified()); orgDoc.setModifier_s(in.getModifier()); orgDoc.setType_s(in.getOrganizationType()); orgDoc.setData_s(in.getOrganizationValue()); orgDoc.setName(in.getOrganizationValue()); orgDoc.setTitle_parseable(in.getOrganizationValue()); orgDoc.setTitle_parseable_lcs(in.getOrganizationValue()); orgDoc.setStatus_s(in.getStatus()); AcmUser creator = getUserDao().quietFindByUserId(in.getCreator()); if (creator != null) { orgDoc.setAdditionalProperty("creator_full_name_lcs", creator.getFirstName() + " " + creator.getLastName()); } AcmUser modifier = getUserDao().quietFindByUserId(in.getModifier()); if (modifier != null) { orgDoc.setAdditionalProperty("modifier_full_name_lcs", modifier.getFirstName() + " " + modifier.getLastName()); } 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);  }