Uploaded image for project: 'Minyaa Suite'
  1. Minyaa Suite
  2. MYAA-938

Timesheet Gadget Actions broken with JIRA 4.3

XMLWordPrintableJSON

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 2.5
    • None
    • None
    • Security Level: Public
    • None

      With previous AJS Framework, when REST call was done wiht a Parameter typed Array, it was rerieve aas follow ...

      @POST
      @Path("myRestService/{pathParam}")
      // @Consumes ({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN})
      public Response performAction(
      		@Context HttpServletRequest _request,
      		@PathParam("pathParam") String _pathParam,
      		@QueryParam("queryParam") final String _queryParam)
      {
      	List listValue = new ArrayList();
      	Map requestParams = _request.getParameterMap(); 
      	if ( requestParams.containsKey("arrayParam") ) {
      		String[] arrayParam = (String[]) _request.getParameterMap().get("arrayParam");
      		for (int i = 0; i < arrayParam.length; i++) {
      			listValue.add((String) arrayParam[i]);
      		}
      	}
      	...
      

      Now, the it seems to be usable as follow

      @POST
      @Path("myRestService/{pathParam}")
      // @Consumes ({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN})
      public Response performAction(
      		@Context HttpServletRequest _request,
      		@PathParam("pathParam") String _pathParam,
      		@QueryParam("queryParam") final String _queryParam,
      		@QueryParam("arrayParam[]") final String[] _arrayParam
            )
      {
      	List listValue = new ArrayList();
      	for (int i = 0; i < _arrayParam.length; i++) {
      		listValue.add((String) arrayParam[i]);
      	}
      	...
      

      For compatibilities reason, it is maintained as follow :

      @POST
      @Path("myRestService/{pathParam}")
      // @Consumes ({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN})
      public Response performAction(
      		@Context HttpServletRequest _request,
      		@PathParam("pathParam") String _pathParam,
      		@QueryParam("queryParam") final String _queryParam)
      {
      	List listValue = new ArrayList();
      	Map requestParams = _request.getParameterMap(); 
      	if ( requestParams.containsKey("arrayParam[]") ) {
      		String[] arrayParam = (String[]) _request.getParameterMap().get("arrayParam");
      		for (int i = 0; i < arrayParam.length; i++) {
      			listValue.add((String) arrayParam[i]);
      		}
      	}
      	if ( requestParams.containsKey("arrayParam") ) {
      		String[] arrayParam = (String[]) _request.getParameterMap().get("arrayParam");
      		for (int i = 0; i < arrayParam.length; i++) {
      			listValue.add((String) arrayParam[i]);
      		}
      	}
      

            vthoule Vincent Thoulé
            vthoule Vincent Thoulé
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h
                1h