本文整理汇总了Java中com.liferay.portal.kernel.util.GetterUtil.getLong方法的典型用法代码示例。如果您正苦于以下问题:Java GetterUtil.getLong方法的具体用法?Java GetterUtil.getLong怎么用?Java GetterUtil.getLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.liferay.portal.kernel.util.GetterUtil
的用法示例。
在下文中一共展示了GetterUtil.getLong方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMeasurements
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的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;
}
示例2: getSampleDataByRegistrationTemplateId
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
@Override
public Response getSampleDataByRegistrationTemplateId(HttpServletRequest request, HttpHeaders header,
Company company, Locale locale, User user, ServiceContext serviceContext, long registrationTemplateId) {
// TODO Get SampleData of RegistrationTemplates
BackendAuth auth = new BackendAuthImpl();
RegistrationTemplateSampleDataInputUpdateModel result = new RegistrationTemplateSampleDataInputUpdateModel();
try {
if (!auth.isAuth(serviceContext)) {
throw new UnauthenticationException();
}
long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
RegistrationTemplates registrationTemplate = RegistrationTemplatesLocalServiceUtil
.getRegTempbyRegId(groupId, registrationTemplateId);
result.setSampleData(registrationTemplate.getSampleData());
return Response.status(200).entity(result).build();
} catch (Exception e) {
_log.error(e);
return processException(e);
}
}
示例3: getDeliverabletypebyId
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
@Override
public Response getDeliverabletypebyId(HttpServletRequest request, HttpHeaders header, Company company,
Locale locale, User user, ServiceContext serviceContext, String id) {
// TODO Get Deliverable Type by Id or typeCode
BackendAuth auth = new BackendAuthImpl();
long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
try {
if (!auth.isAuth(serviceContext)) {
throw new UnauthenticationException();
}
DeliverableType deliverableType = DeliverableTypeLocalServiceUtil.getDeliverableTypebyId(groupId, id);
DeliverableTypeDetailModel result = DeliverableTypesUtils.mappingToDeliverableTypesModel(deliverableType);
return Response.status(200).entity(result).build();
} catch (Exception e) {
return processException(e);
}
}
示例4: updateRegFormFormData
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
@Override
public Response updateRegFormFormData(HttpServletRequest request, HttpHeaders header, Company company,
Locale locale, User user, ServiceContext serviceContext, long registrationId, String referenceUid,
String formData) throws PortalException {
BackendAuth auth = new BackendAuthImpl();
try {
if (!auth.isAuth(serviceContext)) {
throw new UnauthenticationException();
}
long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
RegistrationFormActions action = new RegistrationFormActionsImpl();
RegistrationForm registrationForm = action.updateRegFormFormData(groupId, registrationId, referenceUid,
formData, serviceContext);
RegistrationFormDetailModel result = RegistrationFormUtils
.mappingToRegistrationFormDetailModel(registrationForm);
return Response.status(200).entity(result).build();
} catch (Exception e) {
return processException(e);
}
}
示例5: updateDeliverableTypeMappingData
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
public Response updateDeliverableTypeMappingData(HttpServletRequest request, HttpHeaders header, Company company,
Locale locale, User user, ServiceContext serviceContext, long deliverableTypeId, String mappingData) {
// TODO Update FormReport of Deliverable Type
BackendAuth auth = new BackendAuthImpl();
long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
try {
if (!auth.isAuth(serviceContext)) {
throw new UnauthenticationException();
}
DeliverableTypesActions action = new DeliverableTypesActionsImpl();
DeliverableType deliverableType = action.updateDeliverableTypeMappingData(groupId, deliverableTypeId,
mappingData, serviceContext);
DeliverableTypeDetailModel result = DeliverableTypesUtils.mappingToDeliverableTypesModel(deliverableType);
return Response.status(200).entity(result).build();
} catch (Exception e) {
return processException(e);
}
}
示例6: getRegistrationLogs
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
@Override
public Response getRegistrationLogs(HttpServletRequest request, HttpHeaders header, Company company, Locale locale, User user,
ServiceContext serviceContext, long registrationId, RegistrationLogSearchModel query) {
BackendAuth auth = new BackendAuthImpl();
long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
try {
if (!auth.isAuth(serviceContext)) {
throw new UnauthenticationException();
}
RegistrationLogActions action = new RegistrationLogActionsImpl();
RegistrationLogResultsModel results = new RegistrationLogResultsModel();
JSONObject registrationLog = action.getRegistrationLog(groupId, registrationId, query.getStart(), query.getEnd(), query.getSort(), query.getOrder(), serviceContext);
List<Document> documents = (List<Document>) registrationLog.get("data");
results.setTotal(registrationLog.getInt("total"));
results.getData().addAll(RegistrationLogUtils.mappingToRegistrationLoggDataListDocument(documents));
return Response.status(200).entity(results).build();
} catch (Exception e) {
_log.error(e);
return processException(e);
}
}
示例7: addDeliverableType
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
@Override
public Response addDeliverableType(HttpServletRequest request, HttpHeaders header, Company company, Locale locale,
User user, ServiceContext serviceContext, DeliverableTypeInputModel input) {
// TODO Add Deliverable Type
BackendAuth auth = new BackendAuthImpl();
long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
String counter = String.valueOf(input.getCounter());
try {
if (!auth.isAuth(serviceContext)) {
throw new UnauthenticationException();
}
DeliverableTypesActions action = new DeliverableTypesActionsImpl();
DeliverableType deliverableType = action.addDeliverableType(groupId, input.getDeliverableName(),
input.getDeliverableType(), input.getCodePattern(), counter, input.getFormScript(),
input.getFormReport(), input.getMappingData(), serviceContext);
DeliverableTypeDetailModel result = DeliverableTypesUtils.mappingToDeliverableTypesModel(deliverableType);
return Response.status(200).entity(result).build();
} catch (Exception e) {
return processException(e);
}
}
示例8: addRegistrationForm
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
@Override
public Response addRegistrationForm(HttpServletRequest request, HttpHeaders header, Company company, Locale locale,
User user, ServiceContext serviceContext, RegistrationFormInputModel input, long registrationId,
String formNo) {
BackendAuth auth = new BackendAuthImpl();
RegistrationFormDetailModel result = null;
long companyId = company.getCompanyId();
try {
if (!auth.isAuth(serviceContext)) {
throw new UnauthenticationException();
}
long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
// long fileEntryId = getfileEntryId(input.getFormData(),
// input.getFormScript(), input.getFormReport());
// TODO: lam lai
String govAgencyCode = "";
RegistrationTemplates registrationTemplate = RegistrationTemplatesLocalServiceUtil
.getRegTempbyFormNoGovCode(groupId, formNo, govAgencyCode);
String referenceUid = UUID.randomUUID().toString();
RegistrationForm registrationForm = RegistrationFormLocalServiceUtil.addRegistrationForm(groupId, companyId,
registrationId, referenceUid, registrationTemplate.getFormNo(), registrationTemplate.getFormName(),
registrationTemplate.getSampleData(), registrationTemplate.getFormScript(),
registrationTemplate.getFormReport(), 0, true, false, serviceContext);
result = RegistrationFormUtils.mappingToRegistrationFormDetailModel(registrationForm);
return Response.status(200).entity(result).build();
} catch (Exception e) {
return processException(e);
}
}
示例9: getDossier
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
protected Dossier getDossier(long groupId, String refId) throws PortalException {
Dossier dossier = null;
dossier = DossierLocalServiceUtil.getByRef(groupId, refId);
if (Validator.isNull(dossier)) {
long dossierId = GetterUtil.getLong(refId);
if (dossierId != 0) {
dossier = DossierLocalServiceUtil.fetchDossier(dossierId);
}
}
return dossier;
}
示例10: doReindex
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
@Override
protected void doReindex(String[] ids) throws Exception {
long companyId = GetterUtil.getLong(ids[0]);
reindex(companyId);
}
示例11: doReindex
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
@Override
protected void doReindex(String[] ids) throws Exception {
long companyId = GetterUtil.getLong(ids[0]);
reindexDictCollection(companyId);
}
示例12: updatePaymentConfig
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
@Override
public Response updatePaymentConfig(HttpServletRequest request, HttpHeaders header, Company company, Locale locale,
User user, ServiceContext serviceContext, long id, PaymentConfigInputModel input) {
long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
BackendAuth auth = new BackendAuthImpl();
try {
if (!auth.isAuth(serviceContext)) {
throw new UnauthenticationException();
}
if (!auth.hasResource(serviceContext, PaymentConfig.class.getName(), ActionKeys.ADD_ENTRY)) {
throw new UnauthorizationException();
}
PaymentConfig paymentConfig = PaymentConfigLocalServiceUtil.updatePaymentConfig(groupId, id,
input.getGovAgencyCode(), input.getGovAgencyName(), input.getGovAgencyTaxNo(),
input.getInvoiceTemplateNo(), input.getInvoiceIssueNo(), input.getInvoiceLastNo(), StringPool.BLANK,
input.getBankInfo(), StringPool.BLANK, serviceContext);
PaymentConfigInputModel result = PaymentConfigUtils.mappingToModel(paymentConfig);
return Response.status(200).entity(result).build();
} catch (Exception e) {
ErrorMsg error = new ErrorMsg();
if (e instanceof UnauthenticationException) {
error.setMessage("Non-Authoritative Information.");
error.setCode(HttpURLConnection.HTTP_NOT_AUTHORITATIVE);
error.setDescription("Non-Authoritative Information.");
return Response.status(HttpURLConnection.HTTP_NOT_AUTHORITATIVE).entity(error).build();
} else {
if (e instanceof UnauthorizationException) {
error.setMessage("Unauthorized.");
error.setCode(HttpURLConnection.HTTP_NOT_AUTHORITATIVE);
error.setDescription("Unauthorized.");
return Response.status(HttpURLConnection.HTTP_UNAUTHORIZED).entity(error).build();
} else {
error.setMessage("Internal Server Error");
error.setCode(HttpURLConnection.HTTP_FORBIDDEN);
error.setDescription(e.getMessage());
return Response.status(HttpURLConnection.HTTP_INTERNAL_ERROR).entity(error).build();
}
}
}
}
示例13: doReindex
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
@Override
protected void doReindex(String[] ids) throws Exception {
long companyId = GetterUtil.getLong(ids[0]);
reindexEmployeeJobPos(companyId);
}
示例14: mappingToDossierFileSearchResultsModel
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
public static List<DossierFileSearchResultModel> mappingToDossierFileSearchResultsModel(
List<Document> documents) {
List<DossierFileSearchResultModel> outputs =
new ArrayList<DossierFileSearchResultModel>();
for (Document document : documents) {
DossierFileSearchResultModel model =
new DossierFileSearchResultModel();
long dossierId = GetterUtil.getLong(document.get(DossierFileTerm.DOSSIER_ID));
long dossierFileId = GetterUtil.getLong(document.get(DossierFileTerm.DOSSIER_FILE_ID));
model.setDossierId(dossierId);
model.setReferenceUid(document.get(DossierFileTerm.REFERENCE_UID));
model.setDossierTemplateNo(document.get(DossierFileTerm.DOSSIER_TEMPLATE_NO));
model.setDossierPartNo(document.get(DossierFileTerm.DOSSIER_PART_NO));
model.setDossierPartType(GetterUtil.getInteger(document.get(DossierFileTerm.DOSSIER_PART_TYPE)));
model.setFileTemplateNo(document.get(DossierFileTerm.FILE_TEMPLATE_NO));
model.setDisplayName(document.get(DossierFileTerm.DISPLAY_NAME));
String fileType = StringPool.BLANK;
long fileSize = 0;
//String fileVersion = StringPool.BLANK;
if (dossierFileId > 0) {
try {
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(
dossierFileId);
DLFileVersion dlFileVersion =
DLFileVersionLocalServiceUtil.getLatestFileVersion(
fileEntry.getFileEntryId(), true);
fileType = dlFileVersion.getExtension();
fileSize = dlFileVersion.getSize();
// fileVersion = dlFileVersion.getVersion();
}
catch (Exception e) {
}
}
model.setFileType(fileType);
model.setFileSize(fileSize);
model.setOriginal(GetterUtil.getBoolean(document.get(DossierFileTerm.ORIGINAL)));
model.setIsNew(GetterUtil.getBoolean(document.get(DossierFileTerm.IS_NEW)));
model.setSignCheck(GetterUtil.getInteger(document.get(DossierFileTerm.SIGN_CHECK)));
model.setSignInfo(document.get(DossierFileTerm.SIGN_INFO));
model.setDossierFileId(dossierFileId);
model.setDossierId(dossierId);
outputs.add(model);
}
return outputs;
}
示例15: postProcessContextBooleanFilter
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
@Override
public void postProcessContextBooleanFilter(
BooleanFilter contextBooleanFilter, SearchContext searchContext)
throws Exception {
addStatus(contextBooleanFilter, searchContext);
// id
String id = (String) searchContext.getAttribute(DataManagerField.ID);
if (Validator.isNotNull(id)) {
contextBooleanFilter.addRequiredTerm(DataManagerField.ID, id);
}
// timestamp
long timestamp = GetterUtil.getLong(
searchContext.getAttribute(DataManagerField.TIMESTAMP));
if (timestamp > 0) {
contextBooleanFilter.addRequiredTerm("timestamp_Number_sortable",
timestamp);
}
// from- and until-date
Date fromDate = GetterUtil.getDate(
searchContext.getAttribute("fromDate"),
DateFormat.getDateInstance(), null);
Date untilDate = GetterUtil.getDate(
searchContext.getAttribute("untilDate"),
DateFormat.getDateInstance(), null);
long max = Long.MAX_VALUE;
long min = Long.MIN_VALUE;
if (fromDate != null) {
min = fromDate.getTime();
}
if (untilDate != null) {
max = untilDate.getTime();
}
contextBooleanFilter.addRangeTerm("timestamp_Number_sortable", min,
max);
}