本文整理汇总了Java中com.liferay.portal.kernel.search.SearchContext.setCompanyId方法的典型用法代码示例。如果您正苦于以下问题:Java SearchContext.setCompanyId方法的具体用法?Java SearchContext.setCompanyId怎么用?Java SearchContext.setCompanyId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.liferay.portal.kernel.search.SearchContext
的用法示例。
在下文中一共展示了SearchContext.setCompanyId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSearchContext
import com.liferay.portal.kernel.search.SearchContext; //导入方法依赖的package包/类
/**
* Get searchcontext.
*
* @return searchcontext object
* @throws Exception
*/
protected SearchContext getSearchContext() throws Exception {
ThemeDisplay themeDisplay =
(ThemeDisplay) _portletRequest.getAttribute(WebKeys.THEME_DISPLAY);
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(themeDisplay.getCompanyId());
searchContext.setStart(_queryParams.getStart());
searchContext.setEnd(_queryParams.getEnd());
searchContext.setSorts(_queryParams.getSorts());
// Set facets.
_facetsBuilder.setFacets(searchContext);
return searchContext;
}
示例2: getServiceProcesses
import com.liferay.portal.kernel.search.SearchContext; //导入方法依赖的package包/类
@Override
public JSONObject getServiceProcesses(long userId, long companyId, long groupId, LinkedHashMap<String, Object> params,
Sort[] sorts, int start, int end, ServiceContext serviceContext) throws PortalException {
JSONObject result = JSONFactoryUtil.createJSONObject();
Hits hits = null;
long count = 0;
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(companyId);
hits = ServiceProcessLocalServiceUtil.searchLucene(params, sorts, start, end, searchContext);
count = ServiceProcessLocalServiceUtil.countLucene(params, searchContext);
result.put("total", count);
result.put("data", hits.toList());
return result;
}
示例3: getProcessSteps
import com.liferay.portal.kernel.search.SearchContext; //导入方法依赖的package包/类
@Override
public JSONObject getProcessSteps(long userId, long companyId, long groupId, LinkedHashMap<String, Object> params,
Sort[] sorts, int start, int end, ServiceContext serviceContext) throws PortalException {
JSONObject results = JSONFactoryUtil.createJSONObject();
Hits hits = null;
long count = 0;
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(companyId);
hits = ProcessStepLocalServiceUtil.searchLucene(params, sorts, start, end, searchContext);
count = ProcessStepLocalServiceUtil.countLucene(params, searchContext);
results.put("total", count);
results.put("data", hits.toList());
return results;
}
示例4: getDossierStatistic
import com.liferay.portal.kernel.search.SearchContext; //导入方法依赖的package包/类
@Override
public JSONObject getDossierStatistic(long userId, long companyId, long groupId, LinkedHashMap<String, Object> params,
Sort[] sorts, int start, int end, ServiceContext serviceContext) {
JSONObject result = JSONFactoryUtil.createJSONObject();
Hits hits = null;
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(companyId);
try {
hits = DossierStatisticLocalServiceUtil.searchLucene(params, sorts, start, end, searchContext);
result.put("data", hits.toList());
result.put("total", hits.toList().size());
} catch (Exception e) {
_log.error(e);
}
return result;
}
示例5: getIndexSearchContext
import com.liferay.portal.kernel.search.SearchContext; //导入方法依赖的package包/类
protected SearchContext getIndexSearchContext(Model model, long companyId) {
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(companyId);
searchContext.setEntryClassNames(new String[] {model.getClassName()});
return searchContext;
}
示例6: getDossierTemplates
import com.liferay.portal.kernel.search.SearchContext; //导入方法依赖的package包/类
@Override
public JSONObject getDossierTemplates(long userId, long companyId, long groupId,
LinkedHashMap<String, Object> params, Sort[] sorts, int start, int end, ServiceContext serviceContext)
throws PortalException {
JSONObject result = JSONFactoryUtil.createJSONObject();
Hits hits = null;
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(companyId);
hits = DossierTemplateLocalServiceUtil.searchLucene(params, sorts, start, end, searchContext);
result.put("data", hits.toList());
long total = DossierTemplateLocalServiceUtil.countLucene(params, searchContext);
result.put("total", total);
return result;
}
示例7: getDossierLogs
import com.liferay.portal.kernel.search.SearchContext; //导入方法依赖的package包/类
@Override
public JSONObject getDossierLogs(long groupId, String notificationType, Boolean owner,
int start, int end, String sort, String order, ServiceContext serviceContext) {
JSONObject result = JSONFactoryUtil.createJSONObject();
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(serviceContext.getCompanyId());
//System.out.println("/////////////////////////////////////// notificationType " + notificationType);
try {
if (start == 0) {
start = -1;
end = -1;
}
LinkedHashMap<String, Object> params = new LinkedHashMap<String, Object>();
params.put(Field.GROUP_ID, String.valueOf(groupId));
params.put(DossierLogTerm.NOTIFICATION_TYPE, notificationType);
if(owner != null && owner.booleanValue()) {
params.put(Field.USER_ID, serviceContext.getUserId());
}
Sort[] sorts = new Sort[] { SortFactoryUtil.create(sort + "_sortable", Sort.STRING_TYPE,
GetterUtil.getBoolean(order)) };
Hits hits = DossierLogLocalServiceUtil.searchLucene(params, sorts, start, end, searchContext);
result.put("data", hits.toList());
long total = DossierLogLocalServiceUtil.countLucene(params, searchContext);
result.put("total", total);
} catch (Exception e) {
_log.error(e);
}
return result;
}
示例8: generateDossierNumber
import com.liferay.portal.kernel.search.SearchContext; //导入方法依赖的package包/类
@Deprecated
public static String generateDossierNumber(String code, String pattern, long groupId, Long companyId, String agency,
String service, String template) throws ParseException, SearchException {
LinkedHashMap<String, Object> param = new LinkedHashMap<String, Object>();
param.put(DossierTerm.AGENCY, agency);
param.put(DossierTerm.SERVICE, service);
param.put(DossierTerm.TEMPLATE, template);
SearchContext sc = new SearchContext();
sc.setCompanyId(companyId);
String[] listPattern = pattern.split("/");
// Xử lý year
String year = listPattern[1].substring(1, listPattern[1].length() - 1);
Calendar calendar = Calendar.getInstance();
String y = "";
String processIdPattern = "";
if (year.length() == 2) {
y = String.valueOf(calendar.get(Calendar.YEAR)).substring(2);
// replace year
pattern = pattern.replace(listPattern[1], y);
} else {
y = String.valueOf(calendar.get(Calendar.YEAR));
// replace year
pattern = pattern.replace(listPattern[1], y);
}
String processId = String.valueOf(DossierLocalServiceUtil.countLucene(param, sc) + 1);
// String processId = "100";
String processP = "";
if (listPattern[0].equals("{code}")) {
// replace code
pattern = pattern.replace(listPattern[0], code);
processP = listPattern[2];
} else {
// replace code
pattern = pattern.replace(listPattern[2], code);
processP = listPattern[0];
}
processIdPattern = processP.substring(1, processP.length() - 1);
// replace procsesId
if (processId.length() == processIdPattern.length()) {
pattern = pattern.replace(processP, processId);
} else if (processId.length() > processIdPattern.length()) {
pattern = pattern.replace(processP, processId.substring(processId.length() - processIdPattern.length()));
} else {
String p = "%0" + (processIdPattern.length() - processId.length()) + "d%s";
pattern = pattern.replace(processP, String.format(p, 0, processId));
}
return pattern;
}
示例9: getRegistrations
import com.liferay.portal.kernel.search.SearchContext; //导入方法依赖的package包/类
@Override
public JSONObject getRegistrations(long userId, long companyId, long groupId, LinkedHashMap<String, Object> params,
Sort[] sorts, int start, int end, ServiceContext serviceContext) {
JSONObject result = JSONFactoryUtil.createJSONObject();
Hits hits = null;
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(companyId);
try {
hits = RegistrationLocalServiceUtil.searchLucene(userId, params, sorts, start, end, searchContext);
result.put("data", hits.toList());
result.put("total",
RegistrationLocalServiceUtil.countLucense(userId, params, sorts, start, end, searchContext));
} catch (Exception e) {
_log.error(e);
}
return result;
}
示例10: getDBDossierParts
import com.liferay.portal.kernel.search.SearchContext; //导入方法依赖的package包/类
@Override
public JSONObject getDBDossierParts(long userId, long companyId, long groupId, LinkedHashMap<String, Object> params,
Sort[] sorts, int start, int end, ServiceContext serviceContext) throws PortalException {
JSONObject result = JSONFactoryUtil.createJSONObject();
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(companyId);
List<DossierPart> dossierParts = DossierPartLocalServiceUtil.getByTemplateNo(groupId,
GetterUtil.getString(params.get(DossierPartTerm.TEMPLATE_NO)));
result.put("data", dossierParts);
long total = DossierPartLocalServiceUtil.countLucene(params, searchContext);
result.put("total", total);
return result;
}
示例11: getApplicants
import com.liferay.portal.kernel.search.SearchContext; //导入方法依赖的package包/类
@Override
public JSONObject getApplicants(ServiceContext context, long userId, long companyId, long groupId,
LinkedHashMap<String, Object> params, Sort[] sorts, int start, int end, ServiceContext serviceContext) {
JSONObject result = JSONFactoryUtil.createJSONObject();
Hits hits = null;
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(companyId);
try {
hits = ApplicantLocalServiceUtil.searchLucene(params, sorts, start, end, searchContext);
result.put("data", hits.toList());
long total = ApplicantLocalServiceUtil.countLucene(params, searchContext);
result.put("total", total);
} catch (Exception e) {
_log.error(e);
}
return result;
}
示例12: getDossierActions
import com.liferay.portal.kernel.search.SearchContext; //导入方法依赖的package包/类
@Override
public JSONObject getDossierActions(long dossierId, long groupId, Boolean owner, int start, int end, String sort,
String order, ServiceContext serviceContext) throws PortalException {
JSONObject result = JSONFactoryUtil.createJSONObject();
Hits hits = null;
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(serviceContext.getCompanyId());
try {
String referenceUid = null;
if (dossierId == 0) {
referenceUid = String.valueOf(dossierId);
}
if (start == 0) {
start = -1;
end = -1;
}
LinkedHashMap<String, Object> params = new LinkedHashMap<String, Object>();
params.put(Field.GROUP_ID, String.valueOf(groupId));
params.put(DossierActionTerm.DOSSIER_ID, dossierId);
if (owner != null && owner.booleanValue()) {
params.put(Field.USER_ID, serviceContext.getUserId());
}
Sort[] sorts = new Sort[] {
SortFactoryUtil.create(sort + "_sortable", Sort.STRING_TYPE, GetterUtil.getBoolean(order)) };
hits = DossierActionLocalServiceUtil.searchLucene(params, sorts, start, end, searchContext);
result.put("data", hits.toList());
long total = DossierActionLocalServiceUtil.countLucene(params, searchContext);
result.put("total", total);
} catch (Exception e) {
_log.error(e);
}
return result;
}
示例13: getServiceInfos
import com.liferay.portal.kernel.search.SearchContext; //导入方法依赖的package包/类
@Override
public JSONObject getServiceInfos(long userId, long companyId, long groupId, LinkedHashMap<String, Object> params,
Sort[] sorts, int start, int end, ServiceContext serviceContext) {
JSONObject result = JSONFactoryUtil.createJSONObject();
Hits hits = null;
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(companyId);
try {
hits = ServiceInfoLocalServiceUtil.searchLucene(params, sorts, start, end, searchContext);
result.put("data", hits.toList());
long total = ServiceInfoLocalServiceUtil.countLucene(params, searchContext);
result.put("total", total);
} catch (Exception e) {
_log.error(e);
}
return result;
}
示例14: getRegistrationForms
import com.liferay.portal.kernel.search.SearchContext; //导入方法依赖的package包/类
@Override
public JSONObject getRegistrationForms(long userId, long companyId, long groupId, LinkedHashMap<String, Object> params,
Sort[] sorts, int start, int end, ServiceContext serviceContext) {
JSONObject result = JSONFactoryUtil.createJSONObject();
Hits hits = null;
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(companyId);
try {
hits = RegistrationFormLocalServiceUtil.searchLucene(params, sorts, start, end, searchContext);
result.put("data", hits.toList());
long total = RegistrationFormLocalServiceUtil.countLucene(params, searchContext);
result.put("total", total);
} catch (Exception e) {
_log.error(e);
}
return result;
}
示例15: getFormDataByTypecode
import com.liferay.portal.kernel.search.SearchContext; //导入方法依赖的package包/类
@Override
public JSONObject getFormDataByTypecode(long groupId, LinkedHashMap<String, Object> params, Sort[] object, int start,
int end, ServiceContext serviceContext) {
// TODO Auto-generated method stub
JSONObject result = JSONFactoryUtil.createJSONObject();
Hits hits = null;
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(groupId);
try {
hits = DeliverableLocalServiceUtil.searchLucene(params, object, start, end, searchContext);
result.put("data", hits.toList());
long total = DeliverableLocalServiceUtil.countLucene(params, searchContext);
result.put("total", total);
} catch (Exception e) {
_log.error(e);
}
return result;
}