Package it.eng.spago.dispatching.service

Examples of it.eng.spago.dispatching.service.RequestContextIFace


           
            RequestContainer requestContainer = new RequestContainer();
            RequestContainer.setRequestContainer(requestContainer);
            ResponseContainer responseContainer = new ResponseContainer();
            ResponseContainer.setResponseContainer(responseContainer);
            RequestContextIFace requestContext = new DefaultRequestContext(requestContainer,
                    responseContainer);
           
            // try to get from the request the loopback attribute. If present the method has to serve
            // a loopback request (the method has been called from the doRenderService)
            // if not present is a normal request
View Full Code Here


              }
            }
            // *******************************************************************
          } else {
              Exception serviceException = (Exception)responseContainer.getAttribute(PORTLET_EXCEPTION);
                RequestContextIFace requestContext =
                    new DefaultRequestContext(requestContainer, responseContainer);
                PublisherConfiguration publisher =
                  Publisher.getPublisherConfiguration(requestContext,
                      serviceException);
              String publisherType = publisher.getType();
View Full Code Here

     */
    public void service(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {
        Monitor monitor = null;
      IEventNotifier eventNotifier = null;
      RequestContextIFace requestContext = null;

        try {
          SourceBean serviceRequest = null;
            EMFErrorHandler emfErrorHandler = null;
            EMFExceptionHandler exceptionHandler = new EMFExceptionHandler();
View Full Code Here

   * @throws Exception If any exception occurred
   */
  public static ListIFace getList(ServiceIFace service, SourceBean request, SourceBean response) throws Exception {
    PaginatorIFace paginator = new GenericPaginator();
    InitializerIFace serviceInitializer = (InitializerIFace) service;
    RequestContextIFace serviceRequestContext = (RequestContextIFace) service;
    int pagedRows = 10;
    SourceBean rowsSourceBean = null;
    SourceBean config = serviceInitializer.getConfig();
    if (config != null) {
      pagedRows = Integer.parseInt((String) serviceInitializer.getConfig().getAttribute("ROWS"));
      paginator.setPageSize(pagedRows);
      String pool = (String) serviceInitializer.getConfig().getAttribute("POOL");
      SourceBean statement = (SourceBean) serviceInitializer.getConfig().getAttribute("QUERIES.SELECT_QUERY");
      rowsSourceBean =
        (SourceBean) QueryExecutor.executeQuery(
          serviceRequestContext.getRequestContainer(),
          serviceRequestContext.getResponseContainer(),
          pool,
          statement,
          "SELECT");
    } else {
      // in case the query is dinamically created, the config SourceBean is in response
      config = (SourceBean) response.getAttribute("CONFIG");
      pagedRows = Integer.parseInt((String) config.getAttribute("ROWS"));
      paginator.setPageSize(pagedRows);
      String pool = (String) config.getAttribute("POOL");
      String statement = (String) ((SourceBean) config.getAttribute("QUERIES.SELECT_QUERY")).getAttribute("statement");
      rowsSourceBean = (SourceBean) executeSelect(serviceRequestContext
          .getRequestContainer(), serviceRequestContext
          .getResponseContainer(), pool, statement);
    }

    List rowsVector = null;
    if (rowsSourceBean != null)
      rowsVector = rowsSourceBean.getAttributeAsList(DataRow.ROW_TAG);
    if ((rowsSourceBean == null)) {//|| (rowsVector.size() == 0)) {
      EMFErrorHandler engErrorHandler = serviceRequestContext.getErrorHandler();
      engErrorHandler.addError(new EMFUserError(EMFErrorSeverity.INFORMATION, 10001));
    } // if ((rowsSourceBean == null) || (rowsVector.size() == 0))
    else
      for (int i = 0; i < rowsVector.size(); i++)
        paginator.addRow(rowsVector.get(i));
   
       
   
        // chiamo la funzione di ricerca nelle colonne (se non vi sono dati di ricerca la funzione
    // non esegue nessuna operazione)
    // SearchTextInList.search(request, response, pagedRows, rowsVector);
   
       
   
    ListIFace list = new GenericList();
    list.setPaginator(paginator);
    // list.addStaticData(firstData);
   
    // filter the list
    String valuefilter = (String) request.getAttribute(SpagoBIConstants.VALUE_FILTER);
//    if((valuefilter!=null) && !(valuefilter.trim().equals(""))) {
//      list = filterList(list, valuefilter, request);
//    }
    if (valuefilter != null) {
      String columnfilter = (String) request
          .getAttribute(SpagoBIConstants.COLUMN_FILTER);
      String typeFilter = (String) request
          .getAttribute(SpagoBIConstants.TYPE_FILTER);
      String typeValueFilter = (String) request
          .getAttribute(SpagoBIConstants.TYPE_VALUE_FILTER);
      list = filterList(list, valuefilter, typeValueFilter, columnfilter, typeFilter, serviceRequestContext.getErrorHandler());
    }
   
    return list;
  } // public static ListIFace getList(ServiceIFace service, SourceBean
View Full Code Here

   */
  public static boolean delete(ServiceIFace service, SourceBean request, SourceBean response) {
    InitializerIFace serviceInitializer = (InitializerIFace) service;
    String pool = (String) serviceInitializer.getConfig().getAttribute("POOL");
    SourceBean statement = (SourceBean) serviceInitializer.getConfig().getAttribute("QUERIES.DELETE_QUERY");
    RequestContextIFace serviceRequestContext = (RequestContextIFace) service;
    Boolean isOK =
      (Boolean) QueryExecutor.executeQuery(
        serviceRequestContext.getRequestContainer(),
        serviceRequestContext.getResponseContainer(),
        pool,
        statement,
        "DELETE");
    EMFErrorHandler engErrorHandler = serviceRequestContext.getErrorHandler();
    if ((isOK != null) && isOK.booleanValue()) {
      engErrorHandler.addError(new EMFUserError(EMFErrorSeverity.INFORMATION, 10002));
      return true;
    } // if ((isOK != null) && isOK.booleanValue())
    TracerSingleton.log(
View Full Code Here

    }
    //End writing log in the DB

    paginator.setPageSize(pagedRows);

    RequestContextIFace serviceRequestContext = (RequestContextIFace) this;

    // Chiamata al workflow
    SourceBean rowsSourceBean = getAssigments();


    List rowsVector = null;
    if (rowsSourceBean != null)
      rowsVector = rowsSourceBean.getAttributeAsList(DataRow.ROW_TAG);
    if ((rowsSourceBean == null)) {//|| (rowsVector.size() == 0)) {
      EMFErrorHandler engErrorHandler = serviceRequestContext.getErrorHandler();
      engErrorHandler.addError(new EMFUserError(EMFErrorSeverity.INFORMATION, 10001));
    } // if ((rowsSourceBean == null) || (rowsVector.size() == 0))
    else{
      for (int i = 0; i < rowsVector.size(); i++)
        paginator.addRow(rowsVector.get(i));
View Full Code Here

           
            RequestContainer requestContainer = new RequestContainer();
            RequestContainer.setRequestContainer(requestContainer);
            ResponseContainer responseContainer = new ResponseContainer();
            ResponseContainer.setResponseContainer(responseContainer);
            RequestContextIFace requestContext = new DefaultRequestContext(requestContainer,
                    responseContainer);
           
            // try to get from the request the loopback attribute. If present the method has to serve
            // a loopback request (the method has been called from the doRenderService)
            // if not present is a normal request
View Full Code Here

              }
            }
            // *******************************************************************
          } else {
              Exception serviceException = (Exception)responseContainer.getAttribute(PORTLET_EXCEPTION);
                RequestContextIFace requestContext =
                    new DefaultRequestContext(requestContainer, responseContainer);
                PublisherConfiguration publisher =
                  Publisher.getPublisherConfiguration(requestContext,
                      serviceException);
              String publisherType = publisher.getType();
View Full Code Here

     */
    public void service(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {
        Monitor monitor = null;
      IEventNotifier eventNotifier = null;
      RequestContextIFace requestContext = null;

        try {
          SourceBean serviceRequest = null;
            EMFErrorHandler emfErrorHandler = null;
            EMFExceptionHandler exceptionHandler = new EMFExceptionHandler();
View Full Code Here

           
            RequestContainer requestContainer = new RequestContainer();
            RequestContainer.setRequestContainer(requestContainer);
            ResponseContainer responseContainer = new ResponseContainer();
            ResponseContainer.setResponseContainer(responseContainer);
            RequestContextIFace requestContext = new DefaultRequestContext(requestContainer,
                    responseContainer);
           
            // try to get from the request the loopback attribute. If present the method has to serve
            // a loopback request (the method has been called from the doRenderService)
            // if not present is a normal request
View Full Code Here

TOP

Related Classes of it.eng.spago.dispatching.service.RequestContextIFace

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.