本文整理汇总了Java中com.liferay.portal.kernel.model.User类的典型用法代码示例。如果您正苦于以下问题:Java User类的具体用法?Java User怎么用?Java User使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
User类属于com.liferay.portal.kernel.model包,在下文中一共展示了User类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateRegFormFormData
import com.liferay.portal.kernel.model.User; //导入依赖的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);
}
}
示例2: processLifecycleEvent
import com.liferay.portal.kernel.model.User; //导入依赖的package包/类
@Override
public void processLifecycleEvent(LifecycleEvent lifecycleEvent) throws ActionException {
User user;
try {
user = PortalUtil.getUser(lifecycleEvent.getRequest());
PrincipalThreadLocal.setName(user.getUserId());
PermissionChecker permissionChecker;
permissionChecker = PermissionCheckerFactoryUtil.create(user);
PermissionThreadLocal.setPermissionChecker(permissionChecker);
String friendlyUrl = user.getSiteGroups().get(0).getFriendlyURL();
lifecycleEvent.getResponse().sendRedirect("/group" + friendlyUrl);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
示例3: getDetail
import com.liferay.portal.kernel.model.User; //导入依赖的package包/类
@Override
public Response getDetail(HttpServletRequest request, HttpHeaders header, Company company, Locale locale, User user,
ServiceContext serviceContext, Long id) {
BackendAuth auth = new BackendAuthImpl();
try {
if (!auth.isAuth(serviceContext)) {
throw new UnauthenticationException();
}
RegistrationActions action = new RegistrationActionsImpl();
Registration detail = action.getDetail(id);
RegistrationDetailResultModel result = RegistrationUtils.mappingToRegistrationDetailResultModel(detail);
return Response.status(200).entity(result).build();
} catch (Exception e) {
return processException(e);
}
}
示例4: updateDeliverableTypeFormReport
import com.liferay.portal.kernel.model.User; //导入依赖的package包/类
public Response updateDeliverableTypeFormReport(HttpServletRequest request, HttpHeaders header, Company company,
Locale locale, User user, ServiceContext serviceContext, long deliverableTypeId, String formReport) {
// 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.updateDeliverableTypeFormReport(groupId, deliverableTypeId,
formReport, serviceContext);
DeliverableTypeDetailModel result = DeliverableTypesUtils.mappingToDeliverableTypesModel(deliverableType);
return Response.status(200).entity(result).build();
} catch (Exception e) {
return processException(e);
}
}
示例5: getStatisticByAgency
import com.liferay.portal.kernel.model.User; //导入依赖的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();
}
}
示例6: getFormScriptByDeliverableTypeId
import com.liferay.portal.kernel.model.User; //导入依赖的package包/类
@Override
public Response getFormScriptByDeliverableTypeId(HttpServletRequest request, HttpHeaders header, Company company,
Locale locale, User user, ServiceContext serviceContext, long deliverableTypeId) {
// TODO Get FormScript of Deliverable Type
BackendAuth auth = new BackendAuthImpl();
try {
if (!auth.isAuth(serviceContext)) {
throw new UnauthenticationException();
}
DeliverableType deliverableType = DeliverableTypeLocalServiceUtil.getDeliverableType(deliverableTypeId);
return Response.status(200).entity(deliverableType.getFormScript()).build();
} catch (Exception e) {
return processException(e);
}
}
示例7: getMappingDataByDeliverableTypeId
import com.liferay.portal.kernel.model.User; //导入依赖的package包/类
@Override
public Response getMappingDataByDeliverableTypeId(HttpServletRequest request, HttpHeaders header, Company company,
Locale locale, User user, ServiceContext serviceContext, long deliverableTypeId) {
// TODO Get MappingData of Deliverable Type
BackendAuth auth = new BackendAuthImpl();
try {
if (!auth.isAuth(serviceContext)) {
throw new UnauthenticationException();
}
DeliverableType deliverableType = DeliverableTypeLocalServiceUtil.getDeliverableType(deliverableTypeId);
return Response.status(200).entity(deliverableType.getMappingData()).build();
} catch (Exception e) {
return processException(e);
}
}
示例8: updatePaymentFileConfirm
import com.liferay.portal.kernel.model.User; //导入依赖的package包/类
@PUT
@Path("/{id}/payments/{referenceUid}/confirm")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "upload PaymentFile")
@ApiResponses(value = {
@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns"),
@ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class) })
public Response updatePaymentFileConfirm(@Context HttpServletRequest request, @Context HttpHeaders header,
@Context Company company, @Context Locale locale, @Context User user,
@Context ServiceContext serviceContext,
@ApiParam(value = "id of payments", required = true) @PathParam("id") String id,
@ApiParam(value = "reference of paymentFile", required = true) @PathParam("referenceUid") String referenceUid,
@ApiParam(value = "Attachment files") @Multipart("file") Attachment file,
@ApiParam(value = "Metadata of PaymentFile") @Multipart("confirmNote") String confirmNote,
@ApiParam(value = "Metadata of PaymentFile") @Multipart("paymentMethod") String paymentMethod,
@ApiParam(value = "Metadata of PaymentFile") @Multipart("confirmPayload") String confirmPayload);
示例9: deleteFormbyRegId
import com.liferay.portal.kernel.model.User; //导入依赖的package包/类
@Override
public Response deleteFormbyRegId(HttpServletRequest request, HttpHeaders header, Company company, Locale locale,
User user, ServiceContext serviceContext, long id, String referenceUid) {
BackendAuth auth = new BackendAuthImpl();
try {
if (!auth.isAuth(serviceContext)) {
throw new UnauthenticationException();
}
long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
RegistrationFormActions action = new RegistrationFormActionsImpl();
action.deleteRegistrationForm(groupId, id, referenceUid);
return Response.status(HttpURLConnection.HTTP_NO_CONTENT).build();
} catch (Exception e) {
return processException(e);
}
}
示例10: addConfig
import com.liferay.portal.kernel.model.User; //导入依赖的package包/类
@POST
@Path("/{id}/configs")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "Get the config info of ServerConfig", response = ServerConfigSingleInputModel.class)
@ApiResponses(value = {
@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns the config info of ServerConfig", response = ServerConfigSingleInputModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal error", response = ExceptionModel.class) })
public Response addConfig(@Context HttpServletRequest request, @Context HttpHeaders header,
@Context Company company, @Context Locale locale, @Context User user,
@Context ServiceContext serviceContext, @PathParam("id") long id, @BeanParam ServerConfigSingleInputModel input);
示例11: getDeliverableLog
import com.liferay.portal.kernel.model.User; //导入依赖的package包/类
@GET
@Path("/deliverables/{id}/logs")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@ApiOperation(value = "Get info log for deliverable id")
@ApiResponses(value = {
@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns"),
@ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not Found", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access defined", response = ExceptionModel.class) })
public Response getDeliverableLog(@Context HttpServletRequest request, @Context HttpHeaders header,
@Context Company company, @Context Locale locale, @Context User user, @Context ServiceContext serviceContext,
@ApiParam(value = "id for Deliverable Log", required = true) @PathParam("id") Long id);
示例12: getServerConfigs
import com.liferay.portal.kernel.model.User; //导入依赖的package包/类
@Override
public Response getServerConfigs(HttpServletRequest request, HttpHeaders header, Company company, Locale locale,
User user, ServiceContext serviceContext, ServerConfigSearchModel query) {
BackendAuth auth = new BackendAuthImpl();
try {
if (!auth.isAuth(serviceContext)) {
throw new UnauthenticationException();
}
if (query.getEnd() == 0) {
query.setStart(-1);
query.setEnd(-1);
}
int count = ServerConfigLocalServiceUtil.getServerConfigsCount();
List<ServerConfig> configs = ServerConfigLocalServiceUtil.getServerConfigs(query.getStart(),
query.getEnd());
ServerConfigResultsModel results = new ServerConfigResultsModel();
results.setTotal(count);
results.getData().addAll(ServerConfigUtils.mappingTOData(configs));
return Response.status(200).entity(results).build();
} catch (Exception e) {
ErrorMsg error = new ErrorMsg();
error.setMessage("Content not found!");
error.setCode(404);
error.setDescription(e.getMessage());
return Response.status(404).entity(error).build();
}
}
示例13: getProcessActions
import com.liferay.portal.kernel.model.User; //导入依赖的package包/类
@GET
@Path("/{id}/actions")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "Get all ProcessActions of a ServiceProcess", response = ProcessActionResultsModel.class)
@ApiResponses(value = {
@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns a list ProcessStepRoles of a ProcessStep", response = ProcessActionResultsModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class) })
public Response getProcessActions(@Context HttpServletRequest request, @Context HttpHeaders header,
@Context Company company, @Context Locale locale, @Context User user,
@Context ServiceContext serviceContext, @PathParam("id") long id, @BeanParam ProcessActionSearchModel query);
示例14: updateRegistrationTemplateSampleData
import com.liferay.portal.kernel.model.User; //导入依赖的package包/类
public Response updateRegistrationTemplateSampleData(HttpServletRequest request, HttpHeaders header,
Company company, Locale locale, User user, ServiceContext serviceContext, long registrationTemplatesId,
String sampleData) {
// TODO Update FormReport of RegistrationTemplates
BackendAuth auth = new BackendAuthImpl();
long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
try {
if (!auth.isAuth(serviceContext)) {
throw new UnauthenticationException();
}
RegistrationTemplatesActions action = new RegistrationTemplatesActionsImpl();
RegistrationTemplates registrationTemplate = action.updateSampledata(groupId, registrationTemplatesId,
sampleData, serviceContext);
RegistrationTemplateDetailModel result = RegistrationTemplatesUtils
.mappingToRegistrationTemplateModel(registrationTemplate);
return Response.status(200).entity(result).build();
} catch (Exception e) {
_log.error(e);
return processException(e);
}
}
示例15: getSampleData
import com.liferay.portal.kernel.model.User; //导入依赖的package包/类
@GET
@Path("/{id}/parts/{partno}/sampledata")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "Get sampledata of a DossierPart", response = DossierPartContentInputUpdateModel.class)
@ApiResponses(value = {
@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns the sampledata", response = DossierPartContentInputUpdateModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class) })
public Response getSampleData(@Context HttpServletRequest request, @Context HttpHeaders header,
@Context Company company, @Context Locale locale, @Context User user,
@Context ServiceContext serviceContext, @PathParam("id") long id, @PathParam("partno") String partNo);