@POST
    @Path("ji")
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    @Produces(MediaType.TEXT_PLAIN)
    public String enqueue(@FormParam("applicationname") String applicationName, @FormParam("module") String module,
            @FormParam("mail") String mail, @FormParam("keyword1") String keyword1, @FormParam("keyword2") String keyword2,
            @FormParam("keyword3") String keyword3, @FormParam("parentid") Integer parentId, @FormParam("user") String user,
            @FormParam("sessionid") String sessionId, @FormParam("parameterNames") List<String> prmNames,
            @FormParam("parameterValues") List<String> prmValues)
    {
        if (user == null && security != null && security.getUserPrincipal() != null)
        {
            user = security.getUserPrincipal().getName();
        }

        JobRequest jd = new JobRequest(applicationName, user);

        jd.setModule(module);
        jd.setEmail(mail);
        jd.setKeyword1(keyword1);
        jd.setKeyword2(keyword2);
        jd.setKeyword3(keyword3);
        jd.setParentID(parentId);
        jd.setSessionID(sessionId);

        for (int i = 0; i < prmNames.size(); i++)
        {
            String name = prmNames.get(i);
            String value = null;
            try
            {
                value = prmValues.get(i);
            }
            catch (IndexOutOfBoundsException e)
            {
                throw new ErrorDto("There should be as many parameter names as parameter values", 6, e, Status.BAD_REQUEST);
            }
            jd.addParameter(name, value);
            log.trace("Adding a parameter: " + name + " - " + value);
        }

        Integer i = JqmClientFactory.getClient().enqueue(jd);
        return i.toString();
    }
@ POST @ Path ( "ji" ) @ Consumes ( MediaType . APPLICATION_FORM_URLENCODED ) @ Produces ( MediaType . TEXT_PLAIN ) public String enqueue ( @ FormParam ( "applicationname" ) String applicationName , @ FormParam ( "module" ) String module , @ FormParam ( "mail" ) String mail , @ FormParam ( "keyword1" ) String keyword1 , @ FormParam ( "keyword2" ) String keyword2 , @ FormParam ( "keyword3" ) String keyword3 , @ FormParam ( "parentid" ) Integer parentId , @ FormParam ( "user" ) String user , @ FormParam ( "sessionid" ) String sessionId , @ FormParam ( "parameterNames" ) List < String > prmNames , @ FormParam ( "parameterValues" ) List < String > prmValues ) { if ( user == null && security != null && security . getUserPrincipal ( ) != null ) { user = security . getUserPrincipal ( ) . getName ( ) ; } JobRequest jd = new JobRequest ( applicationName , user ) ; jd . setModule ( module ) ; jd . setEmail ( mail ) ; jd . setKeyword1 ( keyword1 ) ; jd . setKeyword2 ( keyword2 ) ; jd . setKeyword3 ( keyword3 ) ; jd . setParentID ( parentId ) ; jd . setSessionID ( sessionId ) ; for ( int i = 0 ; i < prmNames . size ( ) ; i ++ ) { String name = prmNames . get ( i ) ; String value = null ; try { value = prmValues . get ( i ) ; } catch ( IndexOutOfBoundsException e ) { throw new ErrorDto ( "There should be as many parameter names as parameter values" , 6 , e , Status . BAD_REQUEST ) ; } jd . addParameter ( name , value ) ; log . trace ( "Adding a parameter: " + name + " - " + value ) ; } Integer i = JqmClientFactory . getClient ( ) . enqueue ( jd ) ; return i . toString ( ) ; }
///////////////////////////////////////////////////////////