コード例 #1
0
 /**
  * Get the configured {@link UserTaggingCoreQueryParameters}
  *
  * @param parameters Parameter for filtering of blogs
  * @param request The request.
  * @return {@link UserTaggingCoreQueryParameters}
  */
 private UserTaggingCoreQueryParameters configureQueryInstance(
     Map<String, ?> parameters, Request request) {
   UserTaggingCoreQueryParameters queryParameters = new UserTaggingCoreQueryParameters(USER_QUERY);
   new TimelineQueryParametersConfigurator<UserTaggingCoreQueryParameters>(
           ResourceHandlerHelper.getNameProvider(request))
       .configure(parameters, queryParameters);
   queryParameters.sortByLastNameAsc();
   queryParameters.getTypeSpecificExtension().setIncludeChildTopics(false);
   return queryParameters;
 }
コード例 #2
0
  /**
   * {@inheritDoc}
   *
   * @param request - javax request
   * @throws ResponseBuildException exception while building the response
   * @throws ExtensionNotSupportedException extension is not supported
   */
  @Override
  public Response handleListInternally(
      GetCollectionTimelineUserParameter getCollectionTimelineUserParameter,
      String requestedMimeType,
      UriInfo uriInfo,
      String requestSessionId,
      Request request)
      throws ResponseBuildException, ExtensionNotSupportedException {

    Map<String, String> parameters = TimelineNoteHelper.toMap(uriInfo.getQueryParameters());
    UserTaggingCoreQueryParameters queryParameters = configureQueryInstance(parameters, request);
    PageableList<TimelineUserResource> timelineUserList =
        ServiceLocator.findService(QueryManagement.class)
            .query(
                USER_QUERY,
                queryParameters,
                new UserDataToTimelineUserConverter<UserData, TimelineUserResource>());
    Map<String, Object> metaData =
        ResourceHandlerHelper.generateMetaDataForPaging(
            getCollectionTimelineUserParameter.getOffset(),
            getCollectionTimelineUserParameter.getMaxCount(),
            timelineUserList.getMinNumberOfElements());
    return ResponseHelper.buildSuccessResponse(timelineUserList, request, metaData);
  }