本文整理汇总了Java中com.liferay.portal.kernel.search.Field类的典型用法代码示例。如果您正苦于以下问题:Java Field类的具体用法?Java Field怎么用?Java Field使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Field类属于com.liferay.portal.kernel.search包,在下文中一共展示了Field类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doGetDocument
import com.liferay.portal.kernel.search.Field; //导入依赖的package包/类
@Override
protected Document doGetDocument(TaskRecord taskRecord) throws Exception {
Document document = getBaseModelDocument(CLASS_NAME, taskRecord);
document.addDateSortable(Field.CREATE_DATE, taskRecord.getCreateDate());
document.addTextSortable("description", taskRecord.getDescription());
document.addNumberSortable("duration", taskRecord.getDuration());
document.addDateSortable("fromDate", taskRecord.getFromDate());
document.addNumberSortable("taskRecordId", taskRecord.getTaskRecordId());
document.addNumberSortable(Field.STATUS, taskRecord.getStatus());
document.addTextSortable("ticketURL", taskRecord.getTicketURL());
document.addKeyword("ownerUserId", taskRecord.getUserId());
document.addDateSortable("modifiedDate", taskRecord.getModifiedDate());
document.addDateSortable("untilDate", taskRecord.getUntilDate());
document.addTextSortable("userName", taskRecord.getUserName());
document.addTextSortable("workPackage", taskRecord.getWorkPackage());
return document;
}
示例2: getTaskRecords
import com.liferay.portal.kernel.search.Field; //导入依赖的package包/类
public static List<TaskRecord> getTaskRecords(Hits hits) {
List<Document> documents = ListUtil.toList(hits.getDocs());
List<TaskRecord> taskRecords = new ArrayList<TaskRecord>();
for (Document document : documents) {
try {
long taskRecordId = GetterUtil.getLong(document.get(Field.ENTRY_CLASS_PK));
TaskRecord taskRecord = TaskRecordLocalServiceUtil.getTaskRecord(taskRecordId);
taskRecords.add(taskRecord);
} catch (Exception e) {
if (_log.isErrorEnabled()) {
_log.error(e.getMessage());
}
}
}
return taskRecords;
}
示例3: getFileEntry
import com.liferay.portal.kernel.search.Field; //导入依赖的package包/类
/**
* Returns the file entry related to the indexed document
*
* @param searchResultDocument The indexed document
* @return The file entry related to the indexed document
*
* @throws SearchResultProcessorException If the file entry is not found
*/
private FileEntry getFileEntry(Document searchResultDocument) throws SearchResultProcessorException {
long groupId = Long.parseLong(searchResultDocument.get(Field.GROUP_ID));
long fileEntryId = Long.parseLong(searchResultDocument.get(Field.ENTRY_CLASS_PK));
FileEntry fileEntry;
try {
fileEntry = this.dlAppService.getFileEntry(fileEntryId);
} catch(PortalException e) {
throw new SearchResultProcessorException(e, searchResultDocument, "Cannot find DLFileEntry");
}
if(fileEntry.getGroupId() != groupId) {
throw new SearchResultProcessorException(searchResultDocument, "Returned DLFileEntry has a groupId different from the one referenced in the index");
}
return fileEntry;
}
示例4: getContacts
import com.liferay.portal.kernel.search.Field; //导入依赖的package包/类
public static List<Contact> getContacts(Hits hits) {
List<Document> documents = ListUtil.toList(hits.getDocs());
List<Contact> taskRecords = new ArrayList<Contact>();
for (Document document : documents) {
try {
long taskRecordId = GetterUtil.getLong(document.get(Field.ENTRY_CLASS_PK));
Contact taskRecord = ContactLocalServiceUtil.getContact(taskRecordId);
taskRecords.add(taskRecord);
} catch (Exception e) {
if (_log.isErrorEnabled()) {
_log.error(e.getMessage());
}
}
}
return taskRecords;
}
示例5: searchLucene
import com.liferay.portal.kernel.search.Field; //导入依赖的package包/类
public Hits searchLucene(LinkedHashMap<String, Object> params, Sort[] sorts, int start, int end,
SearchContext searchContext) throws ParseException, SearchException {
String keywords = (String) params.get(Field.KEYWORD_SEARCH);
String groupId = (String) params.get(Field.GROUP_ID);
Indexer<Registration> indexer = IndexerRegistryUtil.nullSafeGetIndexer(Registration.class);
searchContext.addFullQueryEntryClassName(CLASS_NAME);
searchContext.setEntryClassNames(new String[] { CLASS_NAME });
searchContext.setAttribute("paginationType", "regular");
searchContext.setLike(true);
searchContext.setStart(start);
searchContext.setEnd(end);
searchContext.setAndSearch(true);
searchContext.setSorts(sorts);
BooleanQuery booleanQuery = null;
if (Validator.isNotNull(keywords)) {
booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
} else {
booleanQuery = indexer.getFullQuery(searchContext);
}
if (Validator.isNotNull(groupId)) {
MultiMatchQuery query = new MultiMatchQuery(groupId);
query.addFields(Field.GROUP_ID);
booleanQuery.add(query, BooleanClauseOccur.MUST);
}
booleanQuery.addRequiredTerm(Field.ENTRY_CLASS_NAME, CLASS_NAME);
return IndexSearcherHelperUtil.search(searchContext, booleanQuery);
}
示例6: doGetDocument
import com.liferay.portal.kernel.search.Field; //导入依赖的package包/类
@Override
protected Document doGetDocument(DossierTemplate object) throws Exception {
Document document = getBaseModelDocument(CLASS_NAME, object);
// Indexer of audit fields
document.addNumberSortable(Field.COMPANY_ID, object.getCompanyId());
document.addNumberSortable(Field.GROUP_ID, object.getGroupId());
document.addDateSortable(Field.MODIFIED_DATE, object.getCreateDate());
document.addDateSortable(Field.CREATE_DATE, object.getModifiedDate());
document.addNumberSortable(Field.USER_ID, object.getUserId());
document.addKeywordSortable(Field.USER_NAME, String.valueOf(object.getUserName()));
document.addKeywordSortable(Field.ENTRY_CLASS_NAME, CLASS_NAME);
document.addNumberSortable(Field.ENTRY_CLASS_PK, object.getPrimaryKey());
// add text fields
document.addTextSortable(DossierTemplateTerm.TEMPLATE_NAME, object.getTemplateName());
document.addTextSortable(DossierTemplateTerm.TEMPLATE_NO, object.getTemplateNo());
document.addTextSortable(DossierTemplateTerm.DESCRIPTION, object.getDescription());
return document;
}
示例7: doGetDocument
import com.liferay.portal.kernel.search.Field; //导入依赖的package包/类
@Override
protected Document doGetDocument(RegistrationLog object) throws Exception {
Document document = getBaseModelDocument(CLASS_NAME, object);
// Indexer of audit fields
// document.addNumberSortable(Field.REGISTRATIONLOG_ID, object.getRegistrationLogId());
document.addNumberSortable(Field.GROUP_ID, object.getGroupId());
document.addDateSortable(Field.MODIFIED_DATE, object.getCreateDate());
document.addDateSortable(Field.CREATE_DATE, object.getModifiedDate());
document.addNumberSortable(Field.USER_ID, object.getUserId());
// document.addKeywordSortable(Field.USER_NAME, String.valueOf(object.getUserName()));
document.addKeywordSortable(Field.ENTRY_CLASS_NAME, CLASS_NAME);
document.addNumberSortable(Field.ENTRY_CLASS_PK, object.getPrimaryKey());
// add number fields
document.addNumberSortable(RegistrationLogTerm.REGISTRATION_ID, object.getRegistrationId());
// add text fields
document.addTextSortable(RegistrationLogTerm.AUTHOR, object.getAuthor());
document.addTextSortable(RegistrationLogTerm.CONTENT, object.getContent());
document.addTextSortable(RegistrationLogTerm.PAYLOAD, object.getPayload());
return document;
}
示例8: getMeasurements
import com.liferay.portal.kernel.search.Field; //导入依赖的package包/类
public static List<Measurement> getMeasurements(Hits hits) {
List<Document> documents = ListUtil.toList(hits.getDocs());
List<Measurement> measurements = new ArrayList<Measurement>();
for (Document document : documents) {
try {
long measurementId = GetterUtil.getLong(document.get(Field.ENTRY_CLASS_PK));
Measurement measurement = MeasurementLocalServiceUtil.getMeasurement(measurementId);
measurements.add(measurement);
} catch (Exception e) {
if (_log.isErrorEnabled()) {
_log.error(e.getMessage());
}
}
}
return measurements;
}
示例9: mappingToProcessStepData
import com.liferay.portal.kernel.search.Field; //导入依赖的package包/类
public static List<ProcessStepDataModel> mappingToProcessStepData(List<Document> documents) {
List<ProcessStepDataModel> outputs = new ArrayList<ProcessStepDataModel>();
for (Document doc : documents) {
ProcessStepDataModel model = new ProcessStepDataModel();
model.setProcessStepId(GetterUtil.getLong(doc.get(Field.ENTRY_CLASS_PK)));
model.setStepCode(doc.get(ProcessStepTerm.STEP_CODE));
model.setStepName(doc.get(ProcessStepTerm.STEP_NAME));
model.setSequenceNo(doc.get(ProcessStepTerm.SEQUENCE_NO));
model.setDossierStatus(doc.get(ProcessStepTerm.DOSSIER_STATUS));
model.setDossierStatusText(doc.get(ProcessStepTerm.DOSSIER_STATUS_TEXT));
model.setDossierSubStatus(doc.get(ProcessStepTerm.DOSSIER_SUB_STATUS));
model.setDossierSubStatusText(doc.get(ProcessStepTerm.DOSSIER_SUB_STATUS_TEXT));
model.setDurationCount(doc.get(ProcessStepTerm.DURATION_COUNT));
model.setStepInstruction(doc.get(ProcessStepTerm.STEP_INSTRUCTION));
model.setBriefNote(doc.get(ProcessStepTerm.BRIEF_NOTE));
model.setCustomProcessUrl(doc.get(ProcessStepTerm.CUSTOM_PROCESS_URL));
model.setEditable(doc.get(ProcessStepTerm.EDITABLE));
outputs.add(model);
}
return outputs;
}
示例10: mappingToProcessOptionResults
import com.liferay.portal.kernel.search.Field; //导入依赖的package包/类
public static List<ProcessOption> mappingToProcessOptionResults(List<Document> documents) {
List<ProcessOption> processes = new ArrayList<ProcessOption>();
for (Document doc : documents) {
ProcessOption processOption = new ProcessOption();
processOption.setProcessOptionId(GetterUtil.getInteger(doc.get(Field.ENTRY_CLASS_PK)));
processOption.setSeqOrder(GetterUtil.getInteger(doc.get(ProcessOptionTerm.SEQ_ORDER)));
processOption.setAutoSelect(doc.get(ProcessOptionTerm.AUTO_SELECT));
processOption.setInstructionNote(doc.get(ProcessOptionTerm.INSTRUCTION_NOTE));
processOption.setSubmissionNote(doc.get(ProcessOptionTerm.SUBMISSION_NOTE));
processOption.setDossierTemplateId(GetterUtil.getInteger(doc.get(ProcessOptionTerm.DOSSIER_TEMPLATEID)));
processOption.setTemplateNo_0020(doc.get(ProcessOptionTerm.TEMPLATE_NO));
processOption.setTemplateName(doc.get(ProcessOptionTerm.TEMPLATE_NAME));
processOption.setServiceProcessId(GetterUtil.getInteger(doc.get(ProcessOptionTerm.SERVICE_PROCESS_ID)));
processOption.setProcessNo(doc.get(ProcessOptionTerm.PROCESS_NO));
processOption.setProcessName(doc.get(ProcessOptionTerm.PROCESS_NAME));
processOption.setOptionName(doc.get(ProcessOptionTerm.OPTION_NAME));
processes.add(processOption);
}
return processes;
}
示例11: mappingDataModel
import com.liferay.portal.kernel.search.Field; //导入依赖的package包/类
public static List<PaymentConfigDataModel> mappingDataModel(List<Document> documents) {
List<PaymentConfigDataModel> outputs = new ArrayList<PaymentConfigDataModel>();
for (Document doc : documents) {
PaymentConfigDataModel model = new PaymentConfigDataModel();
model.setPaymentConfigId(GetterUtil.getLong(doc.get(Field.ENTRY_CLASS_PK)));
model.setGovAgencyCode(doc.get(PaymentConfigTerm.GOV_AGENCY_CODE));
model.setGovAgencyName(doc.get(PaymentConfigTerm.GOV_AGENCY_NAME));
model.setGovAgencyTaxNo(doc.get(PaymentConfigTerm.GOV_AGENCY_TAX_NO));
model.setInvoiceIssueNo(doc.get(PaymentConfigTerm.INVOICE_ISSUE_NO));
model.setInvoiceLastNo(doc.get(PaymentConfigTerm.INVOICE_LAST_NO));
model.setInvoiceTemplateNo(doc.get(PaymentConfigTerm.INVOICE_TEMPLATE_NO));
model.setBankInfo(doc.get(PaymentConfigTerm.BANK_INFO));
outputs.add(model);
}
return outputs;
}
示例12: getDate
import com.liferay.portal.kernel.search.Field; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public String getDate()
throws ParseException {
String dateString = "";
try {
if (Validator.isNotNull(_document.get(Field.MODIFIED_DATE))) {
Date lastModified = QueryBuilderImpl.INDEX_DATE_FORMAT.parse(
_document.get(Field.MODIFIED_DATE));
DateFormat dateFormat =
DateFormat.getDateInstance(DateFormat.SHORT, _locale);
dateString = dateFormat.format(lastModified);
}
}
catch (ParseException e) {
_log.error(e, e);
}
return dateString;
}
示例13: doGetDocument
import com.liferay.portal.kernel.search.Field; //导入依赖的package包/类
@Override
protected Document doGetDocument(JobPos jobPos) throws Exception {
Document document = getBaseModelDocument(CLASS_NAME, jobPos);
document.addKeywordSortable(Field.COMPANY_ID, String.valueOf(jobPos.getCompanyId()));
document.addDateSortable(Field.MODIFIED_DATE, jobPos.getModifiedDate());
document.addKeywordSortable(Field.USER_ID, String.valueOf(jobPos.getUserId()));
document.addKeywordSortable(Field.USER_NAME, String.valueOf(jobPos.getUserName()));
document.addNumberSortable(JobPosTerm.GROUP_ID, jobPos.getGroupId());
document.addNumberSortable(JobPosTerm.JOBPOS_ID, jobPos.getJobPosId());
document.addTextSortable(JobPosTerm.TITLE, jobPos.getTitle());
document.addTextSortable(JobPosTerm.DESCRIPTION, jobPos.getDescription());
document.addNumberSortable(JobPosTerm.MAPPING_ROLE_ID, jobPos.getMappingRoleId());
document.addNumberSortable(JobPosTerm.LEADER, jobPos.getLeader());
return document;
}
示例14: doGetDocument
import com.liferay.portal.kernel.search.Field; //导入依赖的package包/类
@Override
protected Document doGetDocument(WorkingUnit workingUnit) throws Exception {
Document document = getBaseModelDocument(CLASS_NAME, workingUnit);
document.addKeywordSortable(Field.COMPANY_ID, String.valueOf(workingUnit.getCompanyId()));
document.addDateSortable(Field.MODIFIED_DATE, workingUnit.getModifiedDate());
document.addKeywordSortable(Field.USER_ID, String.valueOf(workingUnit.getUserId()));
document.addKeywordSortable(Field.USER_NAME, String.valueOf(workingUnit.getUserName()));
document.addNumberSortable(WorkingUnitTerm.GROUP_ID, workingUnit.getGroupId());
document.addNumberSortable(WorkingUnitTerm.WORKINGUNIT_ID, workingUnit.getWorkingUnitId());
document.addTextSortable(WorkingUnitTerm.NAME, workingUnit.getName());
document.addTextSortable(WorkingUnitTerm.ENNAME, workingUnit.getEnName());
document.addTextSortable(WorkingUnitTerm.GOV_AGENCY_CODE, workingUnit.getGovAgencyCode());
document.addNumberSortable(WorkingUnitTerm.PARENT_WORKING_UNIT_ID, workingUnit.getParentWorkingUnitId());
document.addTextSortable(WorkingUnitTerm.SIBLING, workingUnit.getSibling());
document.addTextSortable(WorkingUnitTerm.TREEINDEX, workingUnit.getTreeIndex());
document.addTextSortable(WorkingUnitTerm.ADDRESS, workingUnit.getAddress());
document.addTextSortable(WorkingUnitTerm.TEL_NO, workingUnit.getTelNo());
document.addTextSortable(WorkingUnitTerm.FAX_NO, workingUnit.getFaxNo());
document.addTextSortable(WorkingUnitTerm.EMAIL, workingUnit.getEmail());
document.addTextSortable(WorkingUnitTerm.WEBSITE, workingUnit.getWebsite());
document.addNumberSortable(WorkingUnitTerm.LOGO_FILE_ENTRY_ID, workingUnit.getLogoFileEntryId());
return document;
}
示例15: doGetDocument
import com.liferay.portal.kernel.search.Field; //导入依赖的package包/类
@Override
protected Document doGetDocument(DictCollection dictCollection) throws Exception {
Document document = getBaseModelDocument(CLASS_NAME, dictCollection);
document.addKeywordSortable(Field.COMPANY_ID, String.valueOf(dictCollection.getCompanyId()));
document.addDateSortable(Field.MODIFIED_DATE, dictCollection.getModifiedDate());
document.addKeywordSortable(Field.USER_ID, String.valueOf(dictCollection.getUserId()));
document.addKeywordSortable(Field.USER_NAME, String.valueOf(dictCollection.getUserName()));
document.addNumberSortable(DictCollectionTerm.GROUP_ID, dictCollection.getGroupId());
document.addNumberSortable(DictCollectionTerm.DICT_COLLECTION_ID, dictCollection.getDictCollectionId());
document.addTextSortable(DictCollectionTerm.COLLECTION_CODE, dictCollection.getCollectionCode());
document.addTextSortable(DictCollectionTerm.COLLECTION_NAME, dictCollection.getCollectionName());
document.addTextSortable(DictCollectionTerm.COLLECTION_NAME_EN, dictCollection.getCollectionNameEN());
document.addTextSortable(DictCollectionTerm.DESCRIPTION, dictCollection.getDescription());
document.addTextSortable(DictCollectionTerm.DATAFORM, dictCollection.getDataForm());
return document;
}