Package org.infoglue.cms.applications.common

Examples of org.infoglue.cms.applications.common.Session


  }

  protected Template handleRequest(HttpServletRequest request, HttpServletResponse response, Context context) throws Exception
  {
    final HttpSession httpSession = request.getSession();
    final Session session = new Session(httpSession);

   
    //<todo>this should definitely not be placed here
        if(session.getLocale() == null || session.getLocale().getLanguage() == null || session.getLocale().getLanguage().equalsIgnoreCase(""))
    {
          session.setLocale(java.util.Locale.ENGLISH);
    }
        else
        {
            try
            {
              ResourceBundle sk = ResourceBundle.getBundle("org.infoglue.cms.applications.PresentationStrings", session.getLocale());
              if(!sk.getLocale().equals(session.getLocale()))
              {
                session.setLocale(java.util.Locale.ENGLISH);
              }
            }
            catch (Throwable e)
            {
        logger.error("Error:" + e.getMessage() + " - setting locale to english");
              session.setLocale(java.util.Locale.ENGLISH);
            }         
        }
        //</todo>

        if(session.getLocale() == null || session.getLocale().getLanguage() == null || session.getLocale().getLanguage().equalsIgnoreCase(""))
        { 
          context.put("ui", LabelController.getController(java.util.Locale.ENGLISH));
          //context.put("ui", getStringManagerChain(java.util.Locale.ENGLISH));
        }
        else
        {
          context.put("ui", LabelController.getController(session.getLocale()));
        //context.put("ui", getStringManagerChain(session.getLocale()));
        }
       
    context.put("formatter", new VisualFormatter());
    context.put("converter", new ValueConverter());
View Full Code Here


   * on HTTP and the Servlet Spec. Makes it much easier for testing.
     */

    public final Session getSession()
    {
        return new Session(getHttpSession());
    }
View Full Code Here

  private FakeHttpServletRequest request = new FakeHttpServletRequest();

  protected void setUp() throws Exception
  {
    super.setUp();
    new Session().setInfoGluePrincipal(getAdminPrincipal());

    ActionContext.setRequest(request);
    action.setServletRequest(request);
    action.setServletResponse(new FakeHttpServletResponse());
  }
View Full Code Here

    return controller.getPropertySet(getUserPrincipal(), getWorkflowId());
  }

  protected InfoGluePrincipal getUserPrincipal()
  {
    return new Session().getInfoGluePrincipal();
  }
View Full Code Here

    return new Session().getInfoGluePrincipal();
  }

  protected void setUserPrincipal(InfoGluePrincipal userPrincipal)
  {
    new Session().setInfoGluePrincipal(userPrincipal);
  }
View Full Code Here

  /**
   * Returns the session associated with the current execution.
   */
  private Session getSession() throws WorkflowException
  {
    return new Session(((HttpServletRequest) getParameter(REQUEST_PARAMETER)).getSession());
  }
View Full Code Here

  /**
   * Constructs an OwnerStepFilter from the user associated with the current session/action context
   */
  public OwnerStepFilter()
  {
    this(new Session().getInfoGluePrincipal());
  }
View Full Code Here

TOP

Related Classes of org.infoglue.cms.applications.common.Session

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.