Search in sources :

Example 26 with Interceptors

use of javax.interceptor.Interceptors in project UVMS-ActivityModule-APP by UnionVMS.

the class FACatchResource method getFACatchSummaryReport.

@POST
@Path("/summary")
@Consumes(value = { MediaType.APPLICATION_JSON })
@Produces(MediaType.APPLICATION_JSON)
@Interceptors(ActivityExceptionInterceptor.class)
@IUserRoleInterceptor(requiredUserRole = { ActivityFeaturesEnum.LIST_ACTIVITY_REPORTS })
public Response getFACatchSummaryReport(@Context HttpServletRequest request, @HeaderParam("scopeName") String scopeName, @HeaderParam("roleName") String roleName, FishingActivityQuery fishingActivityQuery) throws ServiceException {
    log.info("Query Received to getFACatchSummaryReport. " + fishingActivityQuery);
    if (fishingActivityQuery == null) {
        return createErrorResponse("Query to find list is null.");
    }
    FACatchSummaryReportResponse faCatchSummaryReportResponse = reportService.getFACatchSummaryReportResponse(fishingActivityQuery);
    log.info("Successfully processed");
    return createSuccessResponse(faCatchSummaryReportResponse);
}
Also used : FACatchSummaryReportResponse(eu.europa.ec.fisheries.uvms.activity.model.schemas.FACatchSummaryReportResponse) Path(javax.ws.rs.Path) Interceptors(javax.interceptor.Interceptors) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces) IUserRoleInterceptor(eu.europa.ec.fisheries.uvms.activity.rest.IUserRoleInterceptor)

Example 27 with Interceptors

use of javax.interceptor.Interceptors in project UVMS-ActivityModule-APP by UnionVMS.

the class FishingActivityResource method listActivityReportsByQuery.

@POST
@Path("/list")
@Consumes(value = { MediaType.APPLICATION_JSON })
@Produces(MediaType.APPLICATION_JSON)
@Interceptors(ActivityExceptionInterceptor.class)
@IUserRoleInterceptor(requiredUserRole = { ActivityFeaturesEnum.LIST_ACTIVITY_REPORTS })
public Response listActivityReportsByQuery(@Context HttpServletRequest request, @HeaderParam("scopeName") String scopeName, @HeaderParam("roleName") String roleName, FishingActivityQuery fishingActivityQuery) throws ServiceException {
    log.info("Query Received to search Fishing Activity Reports. " + fishingActivityQuery);
    if (fishingActivityQuery == null) {
        return createErrorResponse("Query to find list is null.");
    }
    String username = request.getRemoteUser();
    List<Dataset> datasets = usmService.getDatasetsPerCategory(USMSpatial.USM_DATASET_CATEGORY, username, USMSpatial.APPLICATION_NAME, roleName, scopeName);
    log.info("Successful retrieved");
    FilterFishingActivityReportResultDTO resultDTO = activityService.getFishingActivityListByQuery(fishingActivityQuery, datasets);
    return createSuccessPaginatedResponse(resultDTO.getResultList(), resultDTO.getTotalCountOfRecords());
}
Also used : Dataset(eu.europa.ec.fisheries.wsdl.user.types.Dataset) FilterFishingActivityReportResultDTO(eu.europa.ec.fisheries.ers.service.dto.FilterFishingActivityReportResultDTO) Path(javax.ws.rs.Path) Interceptors(javax.interceptor.Interceptors) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces) IUserRoleInterceptor(eu.europa.ec.fisheries.uvms.activity.rest.IUserRoleInterceptor)

Aggregations

Interceptors (javax.interceptor.Interceptors)27 SecureActionForum (it.vige.rubia.auth.SecureActionForum)21 JSFUtil.handleException (it.vige.rubia.ui.JSFUtil.handleException)17 Topic (it.vige.rubia.model.Topic)13 ModuleException (it.vige.rubia.ModuleException)9 Post (it.vige.rubia.model.Post)6 Forum (it.vige.rubia.model.Forum)5 IUserRoleInterceptor (eu.europa.ec.fisheries.uvms.activity.rest.IUserRoleInterceptor)4 PollOption (it.vige.rubia.model.PollOption)4 ViewTopic (it.vige.rubia.ui.view.ViewTopic)4 Path (javax.ws.rs.Path)4 Produces (javax.ws.rs.Produces)4 Poll (it.vige.rubia.model.Poll)3 Poster (it.vige.rubia.model.Poster)3 ArrayList (java.util.ArrayList)3 Date (java.util.Date)3 Consumes (javax.ws.rs.Consumes)3 POST (javax.ws.rs.POST)3 Dataset (eu.europa.ec.fisheries.wsdl.user.types.Dataset)2 PortalUtil.createMessage (it.vige.rubia.PortalUtil.createMessage)2