当前位置: 首页>>代码示例>>Java>>正文


Java GetterUtil类代码示例

本文整理汇总了Java中com.liferay.portal.kernel.util.GetterUtil的典型用法代码示例。如果您正苦于以下问题:Java GetterUtil类的具体用法?Java GetterUtil怎么用?Java GetterUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GetterUtil类属于com.liferay.portal.kernel.util包,在下文中一共展示了GetterUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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);
	}
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:27,代码来源:DeliverableTypesManagementImpl.java

示例2: postProcessSearchQuery

import com.liferay.portal.kernel.util.GetterUtil; //导入依赖的package包/类
@Override
public void postProcessSearchQuery(BooleanQuery searchQuery, BooleanFilter fullQueryBooleanFilter,
        SearchContext searchContext) throws Exception {
            
    boolean advancedSearch = GetterUtil.getBoolean(searchContext.getAttribute("advancedSearch"), false);

    addSearchTerm(searchQuery, searchContext, "description", false);
    if (!advancedSearch) {
        addSearchTerm(searchQuery, searchContext, "workPackage", true);
    }
    
    // TODO: add ticketURL

    LinkedHashMap<String, Object> params = (LinkedHashMap<String, Object>) searchContext.getAttribute("params");

    if (params != null) {
        String expandoAttributes = (String) params.get("expandoAttributes");

        if (Validator.isNotNull(expandoAttributes)) {
            addSearchExpando(searchQuery, searchContext, expandoAttributes);
        }
    }
}
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:24,代码来源:TaskRecordIndexer.java

示例3: getTaskRecords

import com.liferay.portal.kernel.util.GetterUtil; //导入依赖的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;
    }
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:24,代码来源:TimetrackerUtil.java

示例4: ContactDisplayTerms

import com.liferay.portal.kernel.util.GetterUtil; //导入依赖的package包/类
public ContactDisplayTerms(PortletRequest portletRequest) {
    super(portletRequest);

    company = ParamUtil.getString(portletRequest, COMPANY);
    contactId = ParamUtil.getString(portletRequest, CONTACT_ID);
    createDate = ParamUtil.getString(portletRequest, CREATE_DATE);
    email = ParamUtil.getString(portletRequest, EMAIL);
    fax = ParamUtil.getString(portletRequest, FAX);
    fullName = ParamUtil.getString(portletRequest, FULL_NAME);
    // TODO: add default IMPP
    name = ParamUtil.getString(portletRequest, NAME);
    modifiedDate = ParamUtil.getString(portletRequest, MODIFIED_DATE);
    String statusString = ParamUtil.getString(portletRequest, STATUS);

    if (Validator.isNotNull(statusString)) {
        status = GetterUtil.getInteger(statusString);
    }

    phone = ParamUtil.getString(portletRequest, PHONE);
    userName = ParamUtil.getString(portletRequest, USER_NAME);
}
 
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:22,代码来源:ContactDisplayTerms.java

示例5: MeasurementDisplayTerms

import com.liferay.portal.kernel.util.GetterUtil; //导入依赖的package包/类
public MeasurementDisplayTerms(PortletRequest portletRequest) {

        super(portletRequest);

        createDate = ParamUtil.getString(portletRequest, CREATE_DATE);
        data = ParamUtil.getString(portletRequest, DATA);
        from = ParamUtil.getLong(portletRequest, FROM);
        groupId = ParamUtil.getLong(portletRequest, GROUP_ID);
        id = ParamUtil.getString(portletRequest, ID);
        measurementId = ParamUtil.getLong(portletRequest, MEASUREMENT_ID);
        modifiedDate = ParamUtil.getString(portletRequest, MODIFIED_DATE);
        name = ParamUtil.getString(portletRequest, NAME);
        String statusString = ParamUtil.getString(portletRequest, STATUS);

        if (Validator.isNotNull(statusString)) {
            status = GetterUtil.getInteger(statusString);
        }
        until = ParamUtil.getLong(portletRequest, UNTIL);
        userName = ParamUtil.getString(portletRequest, USER_NAME);
    }
 
开发者ID:inofix,项目名称:ch-inofix-data-manager,代码行数:21,代码来源:MeasurementDisplayTerms.java

示例6: buildSplittedQuery

import com.liferay.portal.kernel.util.GetterUtil; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public BooleanQuery buildSplittedQuery(
	JSONObject configurationObject, QueryParams queryParams)
	throws Exception {

	BooleanQuery query = new BooleanQueryImpl();
	
	String keywordSplitter = configurationObject.getString("keywordSplitter");

	String [] keywords = queryParams.getKeywords().split(keywordSplitter);
		
	for (String keyword : keywords) {
		WildcardQuery q = buildClause(configurationObject, keyword);
		query.add(q, BooleanClauseOccur.SHOULD);
	}
	
	float boost = GetterUtil.getFloat(configurationObject.get("boost"), 1.0f);
	query.setBoost(boost);
	
	return query;
}
 
开发者ID:peerkar,项目名称:liferay-gsearch,代码行数:25,代码来源:WildcardQueryBuilderImpl.java

示例7: getFormReportByRegistrationTemplateId

import com.liferay.portal.kernel.util.GetterUtil; //导入依赖的package包/类
@Override
public Response getFormReportByRegistrationTemplateId(HttpServletRequest request, HttpHeaders header,
		Company company, Locale locale, User user, ServiceContext serviceContext, long registrationTemplateId) {
	// TODO Get FormReport of RegistrationTemplates
	BackendAuth auth = new BackendAuthImpl();

	RegistrationTemplateFormReportInputUpdateModel result = new RegistrationTemplateFormReportInputUpdateModel();

	try {

		if (!auth.isAuth(serviceContext)) {
			throw new UnauthenticationException();
		}
		long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
		RegistrationTemplates registrationTemplate = RegistrationTemplatesLocalServiceUtil
				.getRegTempbyRegId(groupId, registrationTemplateId);

		result.setFormReport(registrationTemplate.getFormReport());

		return Response.status(200).entity(result).build();

	} catch (Exception e) {
		_log.error(e);
		return processException(e);
	}
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:27,代码来源:RegistrationTemplatesManagementImpl.java

示例8: mappingToStepRole

import com.liferay.portal.kernel.util.GetterUtil; //导入依赖的package包/类
public static List<RoleDataModel> mappingToStepRole(List<ProcessStepRole> stepRoles) {
	List<RoleDataModel> outputs = new ArrayList<RoleDataModel>();

	for (ProcessStepRole role : stepRoles) {

		RoleDataModel model = new RoleDataModel();

		model.setRoleId(GetterUtil.getInteger(role.getRoleId()));
		model.setRoleName(_getRoleName(role.getRoleId()));
		model.setCondition(role.getCondition());
		model.setModerator(Boolean.toString(role.getModerator()));

		outputs.add(model);
	}

	return outputs;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:18,代码来源:ServiceProcessUtils.java

示例9: mappingToDossierTemplateList

import com.liferay.portal.kernel.util.GetterUtil; //导入依赖的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;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:19,代码来源:DossierTemplateUtils.java

示例10: 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);
	}
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:27,代码来源:RegistrationTemplatesManagementImpl.java

示例11: mappingToRegistrationTemplateModel

import com.liferay.portal.kernel.util.GetterUtil; //导入依赖的package包/类
public static RegistrationTemplateDetailModel mappingToRegistrationTemplateModel(
		RegistrationTemplates registrationTemplates) {

	if (registrationTemplates == null) {
		return null;
	}
	long registrationTemplateId = GetterUtil.getLong(registrationTemplates.getRegistrationTemplateId());
	RegistrationTemplateDetailModel model = new RegistrationTemplateDetailModel();

	model.setRegistrationTemplateId(registrationTemplateId);
	model.setGovAgencyCode(registrationTemplates.getGovAgencyCode());
	model.setFormName(registrationTemplates.getFormName());
	model.setFormNo(registrationTemplates.getFormNo());
	model.setMultiple(registrationTemplates.getMultiple());

	return model;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:18,代码来源:RegistrationTemplatesUtils.java

示例12: mappingToDeliverableTypesSearchByIdResultsModel

import com.liferay.portal.kernel.util.GetterUtil; //导入依赖的package包/类
public static List<DossierLogSearchIdModel> mappingToDeliverableTypesSearchByIdResultsModel(
		List<Document> documents) {

	List<DossierLogSearchIdModel> outputs = new ArrayList<DossierLogSearchIdModel>();

	for (Document document : documents) {

		DossierLogSearchIdModel model = new DossierLogSearchIdModel();

		long dossierLogId = GetterUtil.getLong(document.get("entryClassPK"));
		// int notificationType =
		// GetterUtil.getInteger(document.get(DossierLogTerm.NOTIFICATION_TYPE));

		model.setDossierLogId(dossierLogId);
		model.setAuthor(document.get(DossierLogTerm.AUTHOR));
		model.setContent(document.get(DossierLogTerm.CONTENT));
		model.setCreateDate(document.get(DossierLogTerm.CREATE_DATE));
		model.setNotificationType(document.get(DossierLogTerm.NOTIFICATION_TYPE));
		model.setPayload(document.get(DossierLogTerm.PAYLOAD));

		outputs.add(model);
	}

	return outputs;

}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:27,代码来源:RegistrationTemplatesUtils.java

示例13: getformdatabyRegidRefid

import com.liferay.portal.kernel.util.GetterUtil; //导入依赖的package包/类
@Override
public Response getformdatabyRegidRefid(HttpServletRequest request, HttpHeaders header, Company company,
		Locale locale, User user, ServiceContext serviceContext, long registrationId, String referenceUid)
		throws PortalException {
	BackendAuth auth = new BackendAuthImpl();
	try {
		if (!auth.isAuth(serviceContext)) {
			throw new UnauthenticationException();
		}
		long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
		RegistrationForm registrationForm = RegistrationFormLocalServiceUtil.findFormbyRegidRefid(groupId,
				registrationId, referenceUid);

		return Response.status(200).entity(registrationForm.getFormData()).build();

	} catch (Exception e) {
		return processException(e);
	}
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:20,代码来源:RegistrationFormManagementImpl.java

示例14: getStatisticByAgency

import com.liferay.portal.kernel.util.GetterUtil; //导入依赖的package包/类
@Override
public Response getStatisticByAgency(HttpServletRequest request, HttpHeaders header, Company company, Locale locale,
		User user, ServiceContext serviceContext) {
	ServiceInfoActions actions = new ServiceInfoActionsImpl();
	
	long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
	
	JSONObject results = JSONFactoryUtil.createJSONObject();
	
	try {
		results = actions.getStatisticByAdministration(serviceContext, groupId);
		
		_log.info(results);
		
		return Response.status(200).entity(JSONFactoryUtil.looseSerialize(results)).build();

	} catch (Exception e) {
		ErrorMsg error = new ErrorMsg();

			error.setMessage("Forbidden.");
			error.setCode(HttpURLConnection.HTTP_FORBIDDEN);
			error.setDescription("Forbidden.");

			return Response.status(HttpURLConnection.HTTP_FORBIDDEN).entity(error).build();
	}
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:27,代码来源:ServiceInfoManagementImpl.java

示例15: getRegistrationTemplatebyId

import com.liferay.portal.kernel.util.GetterUtil; //导入依赖的package包/类
@Override
public Response getRegistrationTemplatebyId(HttpServletRequest request, HttpHeaders header, Company company,
		Locale locale, User user, ServiceContext serviceContext, String id) {
	// TODO Get RegistrationTemplates by Id
	BackendAuth auth = new BackendAuthImpl();
	long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
	try {

		if (!auth.isAuth(serviceContext)) {
			throw new UnauthenticationException();
		}

		RegistrationTemplates registrationTemplates = RegistrationTemplatesLocalServiceUtil
				.getRegistrationTemplatebyId(groupId, id);

		RegistrationTemplateDetailModel result = RegistrationTemplatesUtils
				.mappingToRegistrationTemplateModel(registrationTemplates);

		return Response.status(200).entity(result).build();

	} catch (Exception e) {
		_log.error(e);
		return processException(e);
	}
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:26,代码来源:RegistrationTemplatesManagementImpl.java


注:本文中的com.liferay.portal.kernel.util.GetterUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。