本文整理汇总了Java中com.liferay.portal.kernel.search.Document类的典型用法代码示例。如果您正苦于以下问题:Java Document类的具体用法?Java Document怎么用?Java Document使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Document类属于com.liferay.portal.kernel.search包,在下文中一共展示了Document类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doGetDocument
import com.liferay.portal.kernel.search.Document; //导入依赖的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.Document; //导入依赖的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: reindexJobPos
import com.liferay.portal.kernel.search.Document; //导入依赖的package包/类
protected void reindexJobPos(long companyId) throws PortalException {
final IndexableActionableDynamicQuery indexableActionableDynamicQuery = JobPosLocalServiceUtil
.getIndexableActionableDynamicQuery();
indexableActionableDynamicQuery.setCompanyId(companyId);
indexableActionableDynamicQuery
.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<JobPos>() {
@Override
public void performAction(JobPos jobPos) {
try {
Document document = getDocument(jobPos);
indexableActionableDynamicQuery.addDocuments(document);
} catch (PortalException pe) {
if (_log.isWarnEnabled()) {
_log.warn("Unable to index contact " + jobPos.getJobPosId(), pe);
}
}
}
});
indexableActionableDynamicQuery.setSearchEngineId(getSearchEngineId());
indexableActionableDynamicQuery.performActions();
}
示例4: doGetDocument
import com.liferay.portal.kernel.search.Document; //导入依赖的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;
}
示例5: mappingToProcessOptionResults
import com.liferay.portal.kernel.search.Document; //导入依赖的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;
}
示例6: reindexResourceRole
import com.liferay.portal.kernel.search.Document; //导入依赖的package包/类
protected void reindexResourceRole(long companyId) throws PortalException {
final IndexableActionableDynamicQuery indexableActionableDynamicQuery = ResourceRoleLocalServiceUtil
.getIndexableActionableDynamicQuery();
indexableActionableDynamicQuery.setCompanyId(companyId);
indexableActionableDynamicQuery
.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<ResourceRole>() {
@Override
public void performAction(ResourceRole resourceRole) {
try {
Document document = getDocument(resourceRole);
indexableActionableDynamicQuery.addDocuments(document);
} catch (PortalException pe) {
if (_log.isWarnEnabled()) {
_log.warn("Unable to index contact " + resourceRole.getResourceRoleId(), pe);
}
}
}
});
indexableActionableDynamicQuery.setSearchEngineId(getSearchEngineId());
indexableActionableDynamicQuery.performActions();
}
示例7: mappingDataModel
import com.liferay.portal.kernel.search.Document; //导入依赖的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;
}
示例8: mappingToDossierTemplateList
import com.liferay.portal.kernel.search.Document; //导入依赖的package包/类
public static List<DossierTemplateDataModel> mappingToDossierTemplateList(List<Document> documents) {
List<DossierTemplateDataModel> outputs = new ArrayList<DossierTemplateDataModel>();
for (Document doc : documents) {
DossierTemplateDataModel model = new DossierTemplateDataModel();
model.setDossierTemplateId(GetterUtil.getLong(doc.get(Field.ENTRY_CLASS_PK)));
model.setCreateDate(doc.get(Field.CREATE_DATE));
model.setModifiedDate(doc.get(Field.MODIFIED_DATE));
model.setTemplateName(doc.get(DossierTemplateTerm.TEMPLATE_NAME));
model.setTemplateNo(doc.get(DossierTemplateTerm.TEMPLATE_NO));
model.setDescription(doc.get(DossierTemplateTerm.DESCRIPTION));
outputs.add(model);
}
return outputs;
}
示例9: reindex
import com.liferay.portal.kernel.search.Document; //导入依赖的package包/类
protected void reindex(long companyId) throws PortalException {
final IndexableActionableDynamicQuery indexableActionableDynamicQuery = PaymentConfigLocalServiceUtil
.getIndexableActionableDynamicQuery();
indexableActionableDynamicQuery.setCompanyId(companyId);
indexableActionableDynamicQuery
.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<PaymentConfig>() {
@Override
public void performAction(PaymentConfig object) {
try {
Document document = getDocument(object);
indexableActionableDynamicQuery.addDocuments(document);
} catch (PortalException pe) {
if (_log.isWarnEnabled()) {
_log.warn("Unable to index contact " + object.getPrimaryKey(), pe);
}
}
}
});
indexableActionableDynamicQuery.setSearchEngineId(getSearchEngineId());
indexableActionableDynamicQuery.performActions();
}
示例10: doGetDocument
import com.liferay.portal.kernel.search.Document; //导入依赖的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;
}
示例11: reindexMWorkTime
import com.liferay.portal.kernel.search.Document; //导入依赖的package包/类
protected void reindexMWorkTime(long companyId) throws PortalException {
final IndexableActionableDynamicQuery indexableActionableDynamicQuery = WorkTimeLocalServiceUtil
.getIndexableActionableDynamicQuery();
indexableActionableDynamicQuery.setCompanyId(companyId);
indexableActionableDynamicQuery
.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<WorkTime>() {
@Override
public void performAction(WorkTime workTime) {
try {
Document document = getDocument(workTime);
indexableActionableDynamicQuery.addDocuments(document);
} catch (PortalException pe) {
if (_log.isWarnEnabled()) {
_log.warn("Unable to index WorkTime " + workTime.getWorkTimeId(), pe);
}
}
}
});
indexableActionableDynamicQuery.setSearchEngineId(getSearchEngineId());
indexableActionableDynamicQuery.performActions();
}
示例12: reindex
import com.liferay.portal.kernel.search.Document; //导入依赖的package包/类
protected void reindex(long companyId) throws PortalException {
final IndexableActionableDynamicQuery indexableActionableDynamicQuery = DossierTemplateLocalServiceUtil
.getIndexableActionableDynamicQuery();
indexableActionableDynamicQuery.setCompanyId(companyId);
indexableActionableDynamicQuery
.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<DossierTemplate>() {
@Override
public void performAction(DossierTemplate object) {
try {
Document document = getDocument(object);
indexableActionableDynamicQuery.addDocuments(document);
} catch (PortalException pe) {
if (_log.isWarnEnabled()) {
_log.warn("Unable to index contact " + object.getPrimaryKey(), pe);
}
}
}
});
indexableActionableDynamicQuery.setSearchEngineId(getSearchEngineId());
indexableActionableDynamicQuery.performActions();
}
示例13: doGetDocument
import com.liferay.portal.kernel.search.Document; //导入依赖的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;
}
示例14: getMeasurements
import com.liferay.portal.kernel.search.Document; //导入依赖的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;
}
示例15: reindexOfficeSite
import com.liferay.portal.kernel.search.Document; //导入依赖的package包/类
protected void reindexOfficeSite(long companyId) throws PortalException {
final IndexableActionableDynamicQuery indexableActionableDynamicQuery = OfficeSiteLocalServiceUtil
.getIndexableActionableDynamicQuery();
indexableActionableDynamicQuery.setCompanyId(companyId);
indexableActionableDynamicQuery
.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<OfficeSite>() {
@Override
public void performAction(OfficeSite officeSite) {
try {
Document document = getDocument(officeSite);
indexableActionableDynamicQuery.addDocuments(document);
} catch (PortalException pe) {
if (_log.isWarnEnabled()) {
_log.warn("Unable to index contact " + officeSite.getOfficeSiteId(), pe);
}
}
}
});
indexableActionableDynamicQuery.setSearchEngineId(getSearchEngineId());
indexableActionableDynamicQuery.performActions();
}