Package it.eng.spago.base

Examples of it.eng.spago.base.RequestContainer


   */
  private void modifyObjMetadata(SourceBean serviceRequest, String mod, SourceBean serviceResponse)
    throws EMFUserError, SourceBeanException {
   
    try {
      RequestContainer reqCont = getRequestContainer();
      SessionContainer sessCont = reqCont.getSessionContainer();
      SessionContainer permSess = sessCont.getPermanentContainer();
      IEngUserProfile profile = (IEngUserProfile)permSess.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
      
      IObjMetadataDAO dao=DAOFactory.getObjMetadataDAO();
      dao.setUserProfile(profile);
View Full Code Here


private void modDetailMap(SourceBean serviceRequest, String mod, SourceBean serviceResponse)
  throws EMFUserError, SourceBeanException {
 
  try {
   
    RequestContainer reqCont = getRequestContainer();
    SessionContainer sessCont = reqCont.getSessionContainer();
    SessionContainer permSess = sessCont.getPermanentContainer();
    IEngUserProfile profile = (IEngUserProfile)permSess.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
    ISbiGeoMapsDAO daoGeoMaps=DAOFactory.getSbiGeoMapsDAO();
    daoGeoMaps.setUserProfile(profile);
   
View Full Code Here

*/
private void insRelMapFeature(SourceBean request, SourceBean response)
  throws EMFUserError, SourceBeanException {
 
  try {   
    RequestContainer reqCont = getRequestContainer();
    SessionContainer sessCont = reqCont.getSessionContainer();
    SessionContainer permSess = sessCont.getPermanentContainer();
    IEngUserProfile profile = (IEngUserProfile)permSess.getAttribute(IEngUserProfile.ENG_USER_PROFILE);

    ISbiGeoMapFeaturesDAO dao=DAOFactory.getSbiGeoMapFeaturesDAO();
    dao.setUserProfile(profile);
View Full Code Here

      PortletTracer.info(Constants.NOME_MODULO, "AdapterPortlet", "processService", "Invocato");
        try {
            SourceBean serviceRequest = null;
            EMFErrorHandler emfErrorHandler = null;
           
            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
            boolean isLoop = request.getAttribute(Constants.PUBLISHING_MODE_LOOPBACK) != null;
            if(isLoop) {
              // remove from the request the loopback attribute
              request.removeAttribute(Constants.PUBLISHING_MODE_LOOPBACK);
              //String responseContainerName = (String)request.getAttribute(Constants.RESPONSE_CONTAINER);
             
              //**************** START MODFIFICATION ZERBETTO 09-10-2006 ****************
              // get from the session the previous response container name
              //String responseContainerName = (String)request.getPortletSession().getAttribute(RESPONSE_CONTAINER_NAME);
              // get from the session the previous response container
              //ResponseContainer loopbackResponseContainer = (ResponseContainer)request.getPortletSession().getAttribute(responseContainerName);
              ResponseContainer loopbackResponseContainer = (ResponseContainer)request.getPortletSession().getAttribute(Constants.RESPONSE_CONTAINER);
              //**************** END MODFIFICATION ZERBETTO 09-10-2006 ****************
             
                TracerSingleton.log(
                    Constants.NOME_MODULO,
                    TracerSingleton.DEBUG,
                    "AdapterPortlet::service: loop-back rilevato");
                serviceRequest =
                    loopbackResponseContainer.getLoopbackServiceRequest();
                if (serviceRequest == null)
                    serviceRequest = new SourceBean(Constants.SERVICE_REQUEST);
                else {
                    Object newServiceRequest =
                        serviceRequest.getAttribute(Constants.SERVICE_REQUEST);
                    if ((newServiceRequest != null)
                        && (newServiceRequest instanceof SourceBean))
                        serviceRequest = (SourceBean) newServiceRequest;
                } // if (serviceRequest == null)
                emfErrorHandler = loopbackResponseContainer.getErrorHandler();
                if (emfErrorHandler == null)
                    emfErrorHandler = new EMFErrorHandler();
            } // if (isLoop)
            else {
              monitor = MonitorFactory.start("controller.adapter.portlet");
              serviceRequest = new SourceBean(Constants.SERVICE_REQUEST);
              requestContainer.setServiceRequest(serviceRequest);
             
                boolean isMultipart = false;
               
                // only an ActionRequest can have a multipart content
                if (request instanceof ActionRequest && PortletFileUpload.isMultipartContent((ActionRequest) request)) {
                  isMultipart = true;
                }
               
                if (isMultipart) {
                  handleMultipartForm((ActionRequest) request, requestContext);
                } else {
                  handleSimpleForm(request, requestContext);
                }
             
              // ***************** START SERVICE ***********************************************
              String actionName = (String) request.getAttribute("ACTION_NAME");
              if(actionName!=null) {
                request.removeAttribute("ACTION_NAME");
                serviceRequest.setAttribute("ACTION_NAME", actionName);
                serviceRequest.setAttribute(NEW_SESSION, "TRUE");
              }
              String page = (String)request.getAttribute("PAGE");
              if(page!=null) {
                request.removeAttribute("PAGE");
                serviceRequest.setAttribute("PAGE", page);
                serviceRequest.setAttribute(NEW_SESSION, "TRUE");
             
            // *******************************************************************************************
              emfErrorHandler = new EMFErrorHandler();
            }
           
            //***************** NAVIGATION CONTROL *******************************************************
            String navigation = getInitParameter("light_navigation");
            if ("enabled".equalsIgnoreCase(navigation)) {
              serviceRequest = LightNavigationManager.controlLightNavigation(request, serviceRequest);
            }
            //updates service request after LightNavigationManager control
            requestContainer.setServiceRequest(serviceRequest);
            //********************************************************************************************
           
            boolean isRequestedSessionIdValid = true;
            PortletSession session = request.getPortletSession(true);
            /*
            if (session.isNew()) {
                String newSessionString =
                    (String) (serviceRequest.getAttribute(NEW_SESSION));
                isRequestedSessionIdValid =
                    ((newSessionString != null)
                        && (newSessionString.equalsIgnoreCase("TRUE")));
            } // if (session.isNew())
            */
            synchronized (session) {
               
              // try to get the previous request container. Download from the session the previous
              // request container name and if it isn't null (it's null only formthe first invocation)
              //use it for download the request container object
              RequestContainer parentRequestContainer = null;
             
              //**************** START MODFIFICATION ZERBETTO 09-10-2006 ****************
              //String parentRequestContainerName =
              //  (String) session.getAttribute(REQUEST_CONTAINER_NAME);
              //if(parentRequestContainerName != null) {
              //  parentRequestContainer = (RequestContainer) session.getAttribute(parentRequestContainerName);
              //}
              parentRequestContainer = (RequestContainer) session.getAttribute(Constants.REQUEST_CONTAINER);
              //**************** END MODFIFICATION ZERBETTO 09-10-2006 ****************

                if (!Navigator.isNavigatorEnabled()) {
                    if (parentRequestContainer == null)
                        requestContainer.setSessionContainer(
                            new PortletSessionContainer(true));
                    else
                        requestContainer.setSessionContainer(
                            parentRequestContainer.getSessionContainer());
                }
                else {
                    if (parentRequestContainer == null)
                        requestContainer.setSessionContainer(
                            new PortletSessionContainer(true));
View Full Code Here

    //if (responseContainerName != null)
    //  responseContainer = (ResponseContainer)session.getAttribute(responseContainerName);
    //else
    //  TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.INFORMATION, "AdapterPortlet::doView: responseContainerName nullo");
    // if request container is not null set into RequestContainer ThreadLocal variable
      RequestContainer requestContainer = (RequestContainer)session.getAttribute(Constants.REQUEST_CONTAINER);
      ResponseContainer responseContainer = (ResponseContainer)session.getAttribute(Constants.RESPONSE_CONTAINER);
      TracerSingleton.log(
                Constants.NOME_MODULO,
                TracerSingleton.DEBUG,
                "AdapterPortlet::doView: request container retrieved from session: " + requestContainer);
View Full Code Here

     *
     * @throws Exception the exception
     */
    private void prepareRender(RequestContextIFace requestContext, PublisherConfiguration publisher) throws Exception {

    RequestContainer requestContainer = requestContext.getRequestContainer();
    ResponseContainer responseContainer = requestContext.getResponseContainer();

    // Prepare service request for loopback management
        try {
            SourceBean loopbackServiceRequest = new SourceBean(Constants.SERVICE_REQUEST);
View Full Code Here

    logger.debug("IN - userId: " + userId);
   
    if (userId==null) return null;
   
    // get request container
    RequestContainer reqCont = RequestContainer.getRequestContainer();
    // get user name
    String userName = userId;
    // get user from database
   
    try {
View Full Code Here

        if (aSession.isOpen()) aSession.close();
      }
    }
    //End writing log in the DB

    RequestContainer aRequestContainer = RequestContainer.getRequestContainer();
    SessionContainer aSessionContainer = aRequestContainer.getSessionContainer();

    IEngUserProfile userProfile =UserUtilities.getUserProfile();
    String userId="";
    if (userProfile!=null) userId=(String)((UserProfile)userProfile).getUserId();
    //sets the userid as input parameter for the query fo statements.xml
View Full Code Here

  }

 
  private ListIFace loadSpagoList(SourceBean request, SourceBean response, Integer parId, String roleName) throws Exception {
          logger.debug("IN");
    RequestContainer requestContainer = getRequestContainer();
    SessionContainer session = requestContainer.getSessionContainer();
    String parameterFieldName = (String)request.getAttribute("parameterFieldName");
    logger.debug("parameterFieldName="+parameterFieldName);
    // define the spago paginator and list object
    PaginatorIFace paginator = new GenericPaginator();
    ListIFace list = new GenericList();
View Full Code Here

 
  /* (non-Javadoc)
   * @see it.eng.spago.dispatching.service.list.basic.IFaceBasicListService#getList(it.eng.spago.base.SourceBean, it.eng.spago.base.SourceBean)
   */
  public ListIFace getList(SourceBean request, SourceBean response) throws Exception {
    RequestContainer requestContainer = getRequestContainer();
    IEngUserProfile profile = (IEngUserProfile) requestContainer.getSessionContainer().getPermanentContainer().getAttribute(IEngUserProfile.ENG_USER_PROFILE);
    
    //Start writing log in the DB
    Session aSession =null;
    try {
      aSession = HibernateUtil.currentSession();
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.