You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jv...@apache.org on 2001/06/04 17:34:02 UTC

cvs commit: jakarta-turbine/src/java/org/apache/turbine/services/pull/util UIManager.java

jvanzyl     01/06/04 08:34:02

  Modified:    src/java/org/apache/turbine/services/pull/util
                        UIManager.java
  Log:
  - some fixes for session use by james coltman
  
  Revision  Changes    Path
  1.10      +64 -54    jakarta-turbine/src/java/org/apache/turbine/services/pull/util/UIManager.java
  
  Index: UIManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/pull/util/UIManager.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- UIManager.java	2001/05/28 15:22:01	1.9
  +++ UIManager.java	2001/06/04 15:33:59	1.10
  @@ -68,6 +68,7 @@
   import org.apache.turbine.services.servlet.TurbineServlet;
   import org.apache.turbine.om.security.User;
   
  +
   /**
    * UIManager.java
    * <br>
  @@ -104,7 +105,7 @@
    *
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:james_coltman@majorband.co.uk">James Coltman</a>
  - * @version $Id: UIManager.java,v 1.9 2001/05/28 15:22:01 jvanzyl Exp $
  + * @version $Id: UIManager.java,v 1.10 2001/06/04 15:33:59 jvanzyl Exp $
    */
   public class UIManager implements ApplicationTool
   {
  @@ -144,7 +145,7 @@
       /**
        * The actual skin being used for the webapp.
        */
  -    private static String skinName;
  +    private String skinName;
   
       /**
        * The skins directory.
  @@ -182,7 +183,7 @@
        */
       public void init(Object data)
       {
  -        /**
  +		/**
            * Store the resources directory for use in image().
            */
           resourcesDirectory = TurbinePull.getResourcesDirectory();
  @@ -232,6 +233,14 @@
           return skinProperties.getProperty(key);
       }
   
  +	/**
  +     * Retrieve the skin name.
  +     */
  +	public String getSkin() 
  +	{
  +		return skinName;
  +	}
  +
       /**
        * Retrieve the URL for an image that is part
        * of a skin. The images are stored in the
  @@ -250,15 +259,15 @@
       {
           ContentURI cu = new ContentURI(data);
           StringBuffer sb = new StringBuffer();
  -
  -        sb.append(resourcesDirectory)
  -            .append(SKINS_DIRECTORY)
  -            .append("/")
  -            .append(skinName)
  -            .append(IMAGES_DIRECTORY)
  -            .append("/")
  -            .append(imageId);
  -
  +        
  +        sb.append(resourcesDirectory).
  +           append(SKINS_DIRECTORY).
  +           append("/").
  +           append(getSkin()).
  +           append(IMAGES_DIRECTORY).
  +           append("/").
  +           append(imageId);
  +        
           return cu.getURI(sb.toString());
       }
   
  @@ -271,22 +280,22 @@
       public String image(String imageId)
       {
           StringBuffer sb = new StringBuffer();
  -
  -        sb.append(TurbineServlet.getServerScheme())
  -            .append("://")
  -            .append(TurbineServlet.getServerName())
  -            .append(":")
  -            .append(TurbineServlet.getServerPort())
  -            .append(TurbineServlet.getContextPath())
  -            .append("/")
  -            .append(resourcesDirectory)
  -            .append(SKINS_DIRECTORY)
  -            .append("/")
  -            .append(skinName)
  -            .append(IMAGES_DIRECTORY)
  -            .append("/")
  -            .append(imageId);
  -
  +        
  +        sb.append(TurbineServlet.getServerScheme()).
  +           append("://").
  +           append(TurbineServlet.getServerName()).
  +           append(":").
  +           append(TurbineServlet.getServerPort()).
  +           append(TurbineServlet.getContextPath()).
  +           append("/").
  +           append(resourcesDirectory).
  +           append(SKINS_DIRECTORY).
  +           append("/").
  +           append(getSkin()).
  +           append(IMAGES_DIRECTORY).
  +           append("/").
  +           append(imageId);
  +        
           return sb.toString();
       }
   
  @@ -306,15 +315,15 @@
        */
       public String getStylecss(RunData data)
       {
  -        ContentURI cu = new ContentURI(data);
  +	    ContentURI cu = new ContentURI(data);
           StringBuffer sb = new StringBuffer();
  -
  -        sb.append(resourcesDirectory)
  -            .append(SKINS_DIRECTORY)
  -            .append("/")
  -            .append(skinName)
  -            .append("/")
  -            .append(SKIN_CSS_FILE);
  +        
  +        sb.append(resourcesDirectory).
  +           append(SKINS_DIRECTORY).
  +           append("/").
  +           append(getSkin()).
  +           append("/").
  +           append(SKIN_CSS_FILE);
   
           return cu.getURI(sb.toString());
       }
  @@ -327,21 +336,22 @@
        */
       public String getStylecss()
       {
  -        StringBuffer sb = new StringBuffer();
  -
  -        sb.append(TurbineServlet.getServerScheme())
  -            .append("://")
  -            .append(TurbineServlet.getServerName())
  -            .append(":")
  -            .append(TurbineServlet.getServerPort())
  -            .append(TurbineServlet.getContextPath())
  -            .append("/"). append(resourcesDirectory)
  -            .append(SKINS_DIRECTORY)
  -            .append("/")
  -            .append(skinName)
  -            .append("/")
  -            .append(SKIN_CSS_FILE);
  -
  +		StringBuffer sb = new StringBuffer();
  +        
  +        sb.append(TurbineServlet.getServerScheme()).
  +           append("://").
  +           append(TurbineServlet.getServerName()).
  +           append(":").
  +           append(TurbineServlet.getServerPort()).
  +           append(TurbineServlet.getContextPath()).
  +           append("/").
  +           append(resourcesDirectory).
  +           append(SKINS_DIRECTORY).
  +           append("/").
  +           append(getSkin()).
  +           append("/").
  +           append(SKIN_CSS_FILE);
  +        
           return sb.toString();
       }
   
  @@ -356,9 +366,9 @@
   
           try
           {
  -            FileInputStream is = new FileInputStream(skinsDirectory + "/" +
  -                    skinName + "/" + SKIN_PROPS_FILE);
  -
  +            FileInputStream is = new FileInputStream(
  +                skinsDirectory + "/" + getSkin() + "/" + SKIN_PROPS_FILE);
  +            
               skinProperties.load(is);
           }
           catch (Exception e)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: cvs commit: jakarta-turbine/src/java/org/apache/turbine/services/pull/util UIManager.java

Posted by Jon Stevens <jo...@latchkey.com>.
on 6/4/01 8:34 AM, "jvanzyl@apache.org" <jv...@apache.org> wrote:

> +    /**
> +     * Retrieve the skin name.
> +     */
> +    public String getSkin()
> +    {
> +        return skinName;
> +    }

Jason, there are tabs in that file...

-jon

-- 
"Open source is not available to commercial companies."
            -Steve Balmer, CEO Microsoft
<http://www.suntimes.com/output/tech/cst-fin-micro01.html>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org