Package it.eng.spago.base

Examples of it.eng.spago.base.RequestContainer


    try {
      if (request instanceof HttpServletRequest) {
        HttpServletRequest httpRequest = (HttpServletRequest) request;
        HttpSession session = httpRequest.getSession();

        RequestContainer requestContainer = (RequestContainer) session.getAttribute(Constants.REQUEST_CONTAINER);
        if (requestContainer == null) {
          // RequestContainer does not exists yet (maybe it is the
          // first call to Spago)
          // initializing Spago objects (user profile object must
          // be put into PermanentContainer)
          requestContainer = new RequestContainer();
          SessionContainer sessionContainer = new SessionContainer(true);
          requestContainer.setSessionContainer(sessionContainer);
          session.setAttribute(Constants.REQUEST_CONTAINER, requestContainer);
        }
        SessionContainer sessionContainer = requestContainer.getSessionContainer();
        SessionContainer permanentSession = sessionContainer.getPermanentContainer();
        IEngUserProfile profile = (IEngUserProfile) permanentSession.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
        if (profile == null) {
          logger.debug("User profile not found in session, creating a new one and putting in session....");
          // in case the profile does not exist, creates a new one
View Full Code Here


      resp = new SourceBean("");
    } catch (SourceBeanException e1) {
      logger.error("Source Bean Exception");
      return null;
    }
    RequestContainer reqContainer = new RequestContainer();
    ResponseContainer resContainer = new ResponseContainer();
    reqContainer.setServiceRequest(request);
    resContainer.setServiceResponse(resp);
    DefaultRequestContext defaultRequestContext = new DefaultRequestContext(
        reqContainer, resContainer);
    resContainer.setErrorHandler(new EMFErrorHandler());
    RequestContainer.setRequestContainer(reqContainer);
    ResponseContainer.setResponseContainer(resContainer);
    SessionContainer session = new SessionContainer(true);
    reqContainer.setSessionContainer(session);
    errorHandler = defaultRequestContext.getErrorHandler();

    Engine engine;
    try {
      engine = DAOFactory.getEngineDAO().loadEngineByID(document.getEngineId());
View Full Code Here

      aSession = getSession();
      tx = aSession.beginTransaction();
      String username = null;
      IEngUserProfile profile=null;
      try {
        RequestContainer reqCont = RequestContainer.getRequestContainer();
        if(reqCont!=null){
          SessionContainer sessCont = reqCont.getSessionContainer();
          SessionContainer permCont = sessCont.getPermanentContainer();
          profile = (IEngUserProfile)permCont.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
          username = (String)((UserProfile)profile).getUserId();
        }
      } catch (Exception e) {
View Full Code Here

      aSession = getSession();
      tx = aSession.beginTransaction();
      String username = null;
      Collection roles = null;
      try {
        RequestContainer reqCont = RequestContainer.getRequestContainer();
        if(reqCont!=null){
          username = (String)((UserProfile)profile).getUserId();
          roles  = ((UserProfile)profile).getRolesForUse();
         
        }
View Full Code Here

      aSession = getSession();
      tx = aSession.beginTransaction();
      String username = null;
      Collection roles = null;
      try {
        RequestContainer reqCont = RequestContainer.getRequestContainer();
        if(reqCont!=null){
          username = (String)((UserProfile)profile).getUserId();
          roles  = ((UserProfile)profile).getRolesForUse();       
        }
      } catch (Exception e) {
View Full Code Here

   * @return a boolean value which says if conditions are verified.
   *
   * @throws Exception if an exception occurs.
   */
  public boolean validate(String serviceType, String serviceName, RequestContextIFace context)  {
    RequestContainer requestContainer = context.getRequestContainer();
    ResponseContainer responseContainer = context.getResponseContainer();
    _serviceName = serviceName;
    _serviceType = serviceType;
    ConfigSingleton config = ConfigSingleton.getInstance();
   
View Full Code Here

            request = new SourceBean("");
            resp = new SourceBean("");
          } catch (SourceBeanException e1) {
            e1.printStackTrace();
          }
          RequestContainer reqContainer = new RequestContainer();
          ResponseContainer resContainer = new ResponseContainer();
          reqContainer.setServiceRequest(request);
          resContainer.setServiceResponse(resp);
          DefaultRequestContext defaultRequestContext = new DefaultRequestContext(
              reqContainer, resContainer);
          resContainer.setErrorHandler(new EMFErrorHandler());
          RequestContainer.setRequestContainer(reqContainer);
          ResponseContainer.setResponseContainer(resContainer);
          Locale locale = new Locale("it","IT","");
          SessionContainer session = new SessionContainer(true);
          reqContainer.setSessionContainer(session);
          SessionContainer permSession = session.getPermanentContainer();
          //IEngUserProfile profile = new AnonymousCMSUserProfile();
          permSession.setAttribute(IEngUserProfile.ENG_USER_PROFILE, profile);
          errorHandler = defaultRequestContext.getErrorHandler();

          String className = eng.getClassName();
          logger.debug("Try instantiating class " + className
              + " for internal engine " + eng.getName() + "...");
          InternalEngineIFace internalEngine = null;
          // tries to instantiate the class for the internal engine
          try {
            if (className == null && className.trim().equals(""))
              throw new ClassNotFoundException();
            internalEngine = (InternalEngineIFace) Class.forName(className).newInstance();
          } catch (ClassNotFoundException cnfe) {
            logger.error("The class ['" + className
                + "'] for internal engine " + eng.getName()
                + " was not found.", cnfe);
            Vector params = new Vector();
            params.add(className);
            params.add(eng.getName());
            errorHandler.addError(new EMFUserError(EMFErrorSeverity.ERROR,
                2001, params));
            return response;
          } catch (Exception e) {
            logger.error("Error while instantiating class " + className, e);
            errorHandler.addError(new EMFUserError(EMFErrorSeverity.ERROR,
                100));
            return response;
          }
          try {
            reqContainer.setAttribute("scheduledExecution", "true");
            internalEngine.execute(reqContainer, biObject, resp);
          } catch (EMFUserError e) {
            logger.error("Error during engine execution", e);
            errorHandler.addError(e);
          } catch (Exception e) {
            logger.error("Error while engine execution", e);
            errorHandler.addError(new EMFUserError(EMFErrorSeverity.ERROR,
                100));
          }
          return response;
        }
        else if(eng.getClassName().equals("it.eng.spagobi.engines.chart.SpagoBIChartInternalEngine")){
          SourceBean request = null;
          EMFErrorHandler errorHandler = null;
          try {
            request = new SourceBean("");
          } catch (SourceBeanException e1) {
            e1.printStackTrace();
          }
          RequestContainer reqContainer = new RequestContainer();
          SpagoBIChartInternalEngine sbcie=new SpagoBIChartInternalEngine();

          // Call chart engine
          File file=sbcie.executeChartCode(reqContainer, biObject, null, profile);
View Full Code Here

      currTheme=ThemesManager.getCurrentTheme(requestContainer);
      if(currTheme==null)currTheme=ThemesManager.getDefaultTheme();
   
    TracerSingleton.log(SpagoBIConstants.NAME_MODULE, TracerSingleton.DEBUG,
    "ScriptWizardTag::doStartTag:: invocato");
    RequestContainer aRequestContainer = RequestContainer.getRequestContainer();
    SessionContainer aSessionContainer = aRequestContainer.getSessionContainer();
    SessionContainer permanentSession = aSessionContainer.getPermanentContainer();
    IEngUserProfile userProfile = (IEngUserProfile)permanentSession.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
    boolean isable = false;
    try {
      isable = userProfile.isAbleToExecuteAction(SpagoBIConstants.LOVS_MANAGEMENT);
View Full Code Here

   *
   * @throws JspException the jsp exception
   */
  public int doStartTag() throws JspException {
    httpRequest = (HttpServletRequest) pageContext.getRequest();
    RequestContainer requestContainer = ChannelUtilities.getRequestContainer(httpRequest);
    ResponseContainer responseContainer = ChannelUtilities.getResponseContainer(httpRequest);
    SourceBean serviceRequest = requestContainer.getServiceRequest();
    SourceBean serviceResponse = responseContainer.getServiceResponse();
    SourceBean moduleResponse = (SourceBean)serviceResponse.getAttribute(moduleName);
    List functionalitiesList = null;
    if (attributeToRender == null || attributeToRender.trim().equals("")) {
      functionalitiesList = (List) moduleResponse.getAttribute(SpagoBIConstants.FUNCTIONALITIES_LIST);
View Full Code Here

    logger.debug("OUT");
      }
  
    private void goToDocumentRating(SourceBean request, String mod, SourceBean response) throws EMFUserError, SourceBeanException  {
     
      RequestContainer requestContainer = this.getRequestContainer();   
        SessionContainer session = requestContainer.getSessionContainer();
        SessionContainer permanentSession = session.getPermanentContainer();
      String objId= (String)request.getAttribute("OBJECT_ID");

      response.setAttribute("OBJECT_ID", objId);
      response.setAttribute("MESSAGEDET", mod);
View Full Code Here

TOP

Related Classes of it.eng.spago.base.RequestContainer

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.