jvanzyl     01/05/28 08:22:02

  Modified:    build    build.xml
               docs     code-standards.html pullmodel.html
               docs/howto tdk-howto.html
               src/java/org/apache/turbine/services/pull
                        TurbinePullService.java
               src/java/org/apache/turbine/services/pull/util
                        UIManager.java
  Added:       conf/torque/templates/sql/base/sapdb db.props
  Log:
  - updating docs
  
  Revision  Changes    Path
  1.4       +1 -0      jakarta-turbine/build/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/build/build.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- build.xml 2001/05/20 01:16:10     1.3
  +++ build.xml 2001/05/28 15:21:59     1.4
  @@ -390,6 +390,7 @@
               </fileset>
           </copy>
           -->
  +      
       </target>
   
       <!-- ================================================================== -->
  
  
  
  1.1                  jakarta-turbine/conf/torque/templates/sql/base/sapdb/db.props
  
  Index: db.props
  ===================================================================
  # Taken from java.sql.Types in the IBM 1.3 JDK
  # JDBC to SapDB mappings.
  
  BIT =
  TINYINT =
  SMALLINT =
  INTEGER = INT
  BIGINT =
  FLOAT =
  REAL =
  DOUBLE =
  NUMERIC =
  DECIMAL =
  CHAR = VARCHAR2
  VARCHAR = VARCHAR2
  LONGVARCHAR = VARCHAR2
  DATE = DATE
  TIME =
  TIMESTAMP = DATE
  BINARY =
  VARBINARY = LONG RAW
  LONGVARBINARY =
  NULL =
  OTHER =
  JAVA_OBJECT =
  DISTINCT =
  STRUCT =
  ARRAY =
  BLOB =
  CLOB =
  REF =
  
  AUTOINCREMENT = AUTO_INCREMENT
  NOTNULL = NOT NULL
  
  primaryKeyInsideTableDirective = true
  foreignKeyInsideTableDirective = true
  indexInsideTableDirective = false
  
  removeNotNullWithAutoIncrement = false
  
  suppressDefaults = false
  
  
  
  1.44      +0 -0      jakarta-turbine/docs/code-standards.html
  
  Index: code-standards.html
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/docs/code-standards.html,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- code-standards.html       2001/05/20 01:27:53     1.43
  +++ code-standards.html       2001/05/28 15:22:00     1.44
  @@ -308,7 +308,7 @@
       <tr>
         <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" 
height="1" vspace="0" hspace="0" border="0"/></td>
         <td bgcolor="#ffffff"><pre>
  -@version $Id: code-standards.html,v 1.43 2001/05/20 01:27:53 jon Exp $
  +@version $Id: code-standards.html,v 1.44 2001/05/28 15:22:00 jvanzyl Exp $
   </pre></td>
         <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" 
height="1" vspace="0" hspace="0" border="0"/></td>
       </tr>
  
  
  
  1.45      +0 -0      jakarta-turbine/docs/pullmodel.html
  
  Index: pullmodel.html
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/docs/pullmodel.html,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- pullmodel.html    2001/05/20 01:28:01     1.44
  +++ pullmodel.html    2001/05/28 15:22:00     1.45
  @@ -149,7 +149,7 @@
           <blockquote>
                                       <p>By: <a href="mailto:[EMAIL PROTECTED]";>Jon S. 
Stevens</a>
   <br />
  -$Date: 2001/05/20 01:28:01 $
  +$Date: 2001/05/28 15:22:00 $
   </p>
                                                   <p>
   This document is to explain a different type of philosophy for working with
  
  
  
  1.13      +24 -19    jakarta-turbine/docs/howto/tdk-howto.html
  
  Index: tdk-howto.html
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/docs/howto/tdk-howto.html,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- tdk-howto.html    2001/05/27 20:25:49     1.12
  +++ tdk-howto.html    2001/05/28 15:22:00     1.13
  @@ -194,12 +194,16 @@
                                                   <p>
   In order to do anything interesting with the TDK, you are also going to need a
   database that is compatable with the JDBC standard.  The TDK currently comes
  -with drivers for MySQL and Postgres.  Other drivers can be downloaded from the
  -vendor's websites located here:
  +with drivers for Hypersonic, InstantDB, MySQL, Postgres and SAPDB. Other drivers 
can be 
  +downloaded from the vendor's websites located here:
   </p>
                                                   <ul>
  -<li><a 
href="http://technet.oracle.com/software/tech/java/sqlj_jdbc/software_index.htm";>Oracle
 JDBC Drivers</a>.</li>
  -<li><a href="http://instantdb.enhydra.org/";>InstantDB JDBC Drivers</a>.</li>
  +  <li>
  +    <a 
href="http://technet.oracle.com/software/tech/java/sqlj_jdbc/software_index.htm";>Oracle
 JDBC Drivers</a>.
  +  </li>
  +  <li>
  +    <a href="http://www.sybase.com/products/eaimiddleware/jconnectforjdbc/";>Sybase 
JDBC Drivers</a>.
  +  </li>
   </ul>
                                                   <p>
   Simply download these drivers to any directory for now.  We will make use
  @@ -348,7 +352,7 @@
       <tr>
         <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" 
height="1" vspace="0" hspace="0" border="0"/></td>
         <td bgcolor="#ffffff"><pre>
  -tar -xvzf tdk1-1a14.tar.gz
  +tar -xvzf tdk-2.1.tar.gz
   </pre></td>
         <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" 
height="1" vspace="0" hspace="0" border="0"/></td>
       </tr>
  @@ -386,7 +390,7 @@
   property "target.package" to the name of the package that you would like your
   java files to live in and the property "target.directory" to the directory that
   you would like your classes to be created in.  These two values are usually a
  -mirror of one another.  Finally, change the property "turbine.app.name" to the
  +mirror of one another.  Finally, change the property "turbine.app" to the
   name of the application that you would like to create.  Usually this is the same
   as the identifier specified at the end of your target.package.
   </p>
  @@ -449,19 +453,19 @@
   </p>
                                                   <p>
   4.  Once the initial set of files has been created, you will need to go into
  -the directory "/TDKROOT/webapps/APPNAME/WEB-INF/build/project" and edit
  -your "APPNAME.properties" file.  This file is used to specify properties
  +the directory "/TDKROOT/webapps/APPNAME/WEB-INF/build" and edit
  +your "build.properties" file.  This file is used to specify properties
   such as the type of database you are using and your DB connection info.  This
   information is used to create the tables Turbine will be using and the classes
   used to access them.  At this time you should also copy your JDBC drivers
   (renaming .zip files to .jar files) into the
  -"webapps/APPNAME/WEB-INF/lib" directory if you are using a database other than
  -MySQL or Postgres.  These files will be important when creating the database
  -tables in the next step.
  +"webapps/APPNAME/WEB-INF/lib" directory if you are using a database for which
  +the TDK does not provide JDBC drivers. These files will be important when 
  +creating the database tables in the next step.
   </p>
                                                   <p>
   5.  Go to the directory "/TDKROOT/webapps/APPNAME/WEB-INF/build" and run the
  -command "./build.sh init"  This command <strong>must be run</strong> before 
  +command "ant init"  This command <strong>must be run</strong> before 
   attempting to use the TDK.  It creates the database tables and OM 
   classes for accessing them.
   </p>
  @@ -470,14 +474,15 @@
   <br />
   For Oracle and Sybase users it is often common that the database
   has already been created: if this is the case then by setting the
  -<strong>database.manual.creation</strong> property in your project
  -properties file you can force the 'create-database' target to
  +<strong>database.manual.creation</strong> property in your "build.properties"
  +file you can force the 'create-database' target to
   be skipped.
   </p>
                                                   <p>
   6.  Your first Turbine app has now been created!  go back to the root directory
  -of your TDK installation and type in "./bin/startup.sh"  This will start the
  -Tomcat servlet engine and make your application available.
  +of your TDK installation and type in "./bin/catalina.sh run" if you want to
  +see console output or "./bin/catalina.sh start" if you want the servlet
  +container process to run in the background. 
   </p>
                                                   <p>
   NOTE
  @@ -650,13 +655,13 @@
                                       <p>
   Now that we know about actions, we should change our database to something more
   useful.  In order to do this, move to the directory
  -"webapps/APPNAME/WEB-INF/build/project" and open up the file
  +"webapps/APPNAME/WEB-INF/conf" and open up the file
   "APPNAME-schema.xml".  This file contains our database schema in XML.  This
   file should be rather self explainatory.  Within it you can create new tables
   and new fields within existing tables.  Add some more rows to the example
   table and save the file back.  Now go to the directory
   "webapps/APPNAME/WEB-INF/build" and run the command
  -"./build.sh init" again.  (WARNING: If this is done you will lose all of your
  +"ant init" again.  (WARNING: If this is done you will lose all of your
   data in the existing tables, do not run if you have data in your tables
   that you want to save.)  This will update existing databases and their objects
   with new fields and create the databases defined in the .xml file, along with
  @@ -693,7 +698,7 @@
   You now have your first Turbine application up and running and you now know
   how to edit the Java and .vm files in the TDK in order to begin building a
   specific application.  In order to recompile any Java files that you change
  -or create in the TDK, run "webapps/APPNAME/WEB-INF/build.sh compile".
  +or create in the TDK, move to "webapps/APPNAME/WEB-INF/build" and run "ant compile".
   This will recompile all of the Java files that have changed in your project.
   You may also wish to join the Turbine Users mailing list.  Instructions for
   doing so can be found <a href="http://jakarta.apache.org/site/mail.html";>here.</a>
  
  
  
  1.22      +28 -25    
jakarta-turbine/src/java/org/apache/turbine/services/pull/TurbinePullService.java
  
  Index: TurbinePullService.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/pull/TurbinePullService.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- TurbinePullService.java   2001/05/19 23:03:53     1.21
  +++ TurbinePullService.java   2001/05/28 15:22:01     1.22
  @@ -89,41 +89,41 @@
    * templates. You list the tools in the following way:
    * </p>
    * <pre>
  - *tool.<scope>.<id> = <classname>
  + * tool.<scope>.<id> = <classname>
    *
  - *<scope>      is the tool scope: global, request, session
  + * <scope>      is the tool scope: global, request, session
    *             or persistent (see below for more details)
  - *<id>         is the name of the tool in the context
  + * <id>         is the name of the tool in the context
    *
  - *You can configure the tools in this way:
  - *tool.<id>.<parameter> = <value>
  + * You can configure the tools in this way:
  + * tool.<id>.<parameter> = <value>
    *
  - *So if you find "global", "request", "session" or "persistent" as second
  - *part, it is a configuration to put a tool into the toolbox, else it is a
  - *tool specific configuration.
  + * So if you find "global", "request", "session" or "persistent" as second
  + * part, it is a configuration to put a tool into the toolbox, else it is a
  + * tool specific configuration.
    *
  - *For example:
  + * For example:
    *
  - *tool.global.ui    = org.apache.turbine.util.pull.UIManager
  - *tool.global.mm    = org.apache.turbine.util.pull.MessageManager
  - *tool.request.link = org.apache.turbine.util.template.TemplateLink
  - *tool.request.page = org.apache.turbine.util.template.TemplatePageAttributes
  + * tool.global.ui    = org.apache.turbine.util.pull.UIManager
  + * tool.global.mm    = org.apache.turbine.util.pull.MessageManager
  + * tool.request.link = org.apache.turbine.util.template.TemplateLink
  + * tool.request.page = org.apache.turbine.util.template.TemplatePageAttributes
    *
  - *Then:
  + * Then:
    *
  - *tool.ui.skin = default
  + * tool.ui.skin = default
    *
  - *configures the value of "skin" for the "ui" tool.
  + * configures the value of "skin" for the "ui" tool.
    *
  - *Tools are accessible in all templates by the <id> given
  - *to the tool. So for the above listings the UIManager would
  - *be available as $ui, the MessageManager as $mm, the TemplateLink
  - *as $link and the TemplatePageAttributes as $page.
  + * Tools are accessible in all templates by the <id> given
  + * to the tool. So for the above listings the UIManager would
  + * be available as $ui, the MessageManager as $mm, the TemplateLink
  + * as $link and the TemplatePageAttributes as $page.
    *
  - *You should avoid using tool names called "global", "request",
  - *"session" or "persistent" because of clashes with the possible Scopes.
  + * You should avoid using tool names called "global", "request",
  + * "session" or "persistent" because of clashes with the possible Scopes.
    *
  - *Scopes:
  + * Scopes:
    *
    *  global:     tool is instantiated once and that instance is available
    *              to all templates for all requests. Tool must be threadsafe.
  @@ -142,12 +142,12 @@
    *              user's objectdata. Tool should be threadsafe and 
    *              Serializable.
    *
  - *Defaults: none
  + * Defaults: none
    * </pre>
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason van Zyl</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Sean Legassick</a>
  - * @version $Id: TurbinePullService.java,v 1.21 2001/05/19 23:03:53 jon Exp $
  + * @version $Id: TurbinePullService.java,v 1.22 2001/05/28 15:22:01 jvanzyl Exp $
    */
   public class TurbinePullService extends TurbineBaseService 
       implements PullService
  @@ -639,8 +639,11 @@
           {
               ToolData toolData = (ToolData)it.next();
               Object tool = context.remove(toolData.toolName);
  +            
               if (tool != null)
  +            {
                   pool.putInstance(tool);
  +            }                
           }
       }
   }
  
  
  
  1.9       +154 -72   
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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- UIManager.java    2001/03/06 06:12:38     1.8
  +++ UIManager.java    2001/05/28 15:22:01     1.9
  @@ -25,13 +25,13 @@
    *    Alternately, this acknowledgment may appear in the software itself,
    *    if and wherever such third-party acknowledgments normally appear.
    *
  - * 4. The names "Apache" and "Apache Software Foundation" and 
  - *    "Apache Turbine" must not be used to endorse or promote products 
  - *    derived from this software without prior written permission. For 
  + * 4. The names "Apache" and "Apache Software Foundation" and
  + *    "Apache Turbine" must not be used to endorse or promote products
  + *    derived from this software without prior written permission. For
    *    written permission, please contact [EMAIL PROTECTED]
    *
    * 5. Products derived from this software may not be called "Apache",
  - *    "Apache Turbine", nor may "Apache" appear in their name, without 
  + *    "Apache Turbine", nor may "Apache" appear in their name, without
    *    prior written permission of the Apache Software Foundation.
    *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  @@ -66,6 +66,7 @@
   import org.apache.turbine.services.pull.TurbinePull;
   import org.apache.turbine.services.resources.TurbineResources;
   import org.apache.turbine.services.servlet.TurbineServlet;
  +import org.apache.turbine.om.security.User;
   
   /**
    * UIManager.java
  @@ -102,7 +103,8 @@
    * how could this be handled with a web app.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason van Zyl</a>
  - * @version $Id: UIManager.java,v 1.8 2001/03/06 06:12:38 chrise Exp $
  + * @author <a href="mailto:[EMAIL PROTECTED]";>James Coltman</a>
  + * @version $Id: UIManager.java,v 1.9 2001/05/28 15:22:01 jvanzyl Exp $
    */
   public class UIManager implements ApplicationTool
   {
  @@ -111,7 +113,7 @@
        * resources directory.
        */
       private static final String SKINS_DIRECTORY = "/ui/skins";
  -    
  +
       /**
        * The name of the directory where images are
        * stored for this skin.
  @@ -132,7 +134,13 @@
        * which actually contains the name/value pairs.
        */
       private static final String SKIN_PROPERTY_DEFAULT = "default";
  -    
  +
  +    /**
  +     * Attribute name of skinName value in User's temp hashmap.
  +     */
  +    private static final String SKIN_ATTRIBUTE = 
  +        "org.apache.turbine.services.pull.util.UIManager.skin";
  +
       /**
        * The actual skin being used for the webapp.
        */
  @@ -141,7 +149,7 @@
       /**
        * The skins directory.
        */
  -     private static String skinsDirectory;
  +    private static String skinsDirectory;
   
       /**
        * The file within the skin directory that actually
  @@ -166,11 +174,11 @@
        * for the skin.
        */
       private static Properties skinProperties;
  -    
  +
       /**
        * Initialize the UIManager object.
        *
  -     * @param data ignored
  +     * @param data This is null, RunData or User depending upon specified tool 
scope.
        */
       public void init(Object data)
       {
  @@ -178,18 +186,26 @@
            * Store the resources directory for use in image().
            */
           resourcesDirectory = TurbinePull.getResourcesDirectory();
  -        
  -        /*
  -         * Try and grab the requested skin from the TR.props
  -         * file. If the property is not present use the
  -         * default skin.
  -         */
  -        skinName = TurbineResources.getString(SKIN_PROPERTY,
  -            SKIN_PROPERTY_DEFAULT);
  -    
  +
  +        if (data == null)
  +        {
  +            Log.debug("UI Manager scope is global");
  +            setSkin();
  +        }
  +        else if (data instanceof RunData)
  +        {
  +            Log.debug("UI Manager scope is request");
  +            setSkin((RunData) data);
  +        }
  +        else if (data instanceof User)
  +        {
  +            Log.debug("UI Manager scope is session");
  +            setSkin((User) data);
  +        }
  +
           skinsDirectory = 
               TurbinePull.getAbsolutePathToResourcesDirectory() + SKINS_DIRECTORY;
  -        
  +
           loadSkin();
       }
   
  @@ -206,7 +222,7 @@
   
           loadSkin();
       }
  -    
  +
       /**
        * Retrieve a property from the properties held
        * within the properties file for this skin.
  @@ -234,15 +250,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(skinName)
  +            .append(IMAGES_DIRECTORY)
  +            .append("/")
  +            .append(imageId);
  +
           return cu.getURI(sb.toString());
       }
   
  @@ -255,22 +271,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(skinName)
  +            .append(IMAGES_DIRECTORY)
  +            .append("/")
  +            .append(imageId);
  +
           return sb.toString();
       }
   
  @@ -292,14 +308,14 @@
       {
           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(skinName)
  +            .append("/")
  +            .append(SKIN_CSS_FILE);
  +
           return cu.getURI(sb.toString());
       }
   
  @@ -312,21 +328,20 @@
       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);
  -        
  +
  +        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);
  +
           return sb.toString();
       }
   
  @@ -338,17 +353,84 @@
       private void loadSkin()
       {
           skinProperties = new Properties();
  -        
  +
           try
           {
  -            FileInputStream is = new FileInputStream(
  -                skinsDirectory + "/" + skinName + "/" + SKIN_PROPS_FILE);
  -            
  +            FileInputStream is = new FileInputStream(skinsDirectory + "/" +
  +                    skinName + "/" + SKIN_PROPS_FILE);
  +
               skinProperties.load(is);
           }
           catch (Exception e)
           {
               Log.error("Cannot load skin: " + skinName);
           }
  +    }
  +
  +    /**
  +     * Set the skin name to the skin from the TR.props
  +     * file. If the property is not present use the
  +     * default skin.
  +     */
  +    public void setSkin()
  +    {
  +        this.skinName = TurbineResources.getString(SKIN_PROPERTY,
  +                SKIN_PROPERTY_DEFAULT);
  +    }
  +
  +    /**
  +     * Set the skin name to the specified skin.
  +     *
  +     * @param skinName the skin name to use.
  +     */
  +    public void setSkin(String skinName)
  +    {
  +        this.skinName = skinName;
  +    }
  +
  +    /**
  +     * Set the skin name when the tool is configured to be
  +     * loaded on a per-request basis. By default it calls getSkin
  +     * to return the skin specified in TR.properties. Developers can
  +     * write a subclass of UIManager that overrides this method to
  +     * determine the skin to use based on information held in the request.
  +     *
  +     * @param data a RunData instance
  +     */
  +    protected void setSkin(RunData data)
  +    {
  +        setSkin();
  +    }
  +
  +    /**
  +     * Set the skin name when the tool is configured to be
  +     * loaded on a per-session basis. It the user's temp hashmap contains
  +     * a value in the attribute specified by the String constant SKIN_ATTRIBUTE
  +     * then that is returned. Otherwise it calls getSkin to return the skin
  +     * specified in TR.properties.
  +     *
  +     * @param user a User instance
  +     */
  +    protected void setSkin(User user)
  +    {
  +        if (user.getTemp(SKIN_ATTRIBUTE) == null)
  +        {
  +            setSkin();
  +        }
  +        else
  +        {
  +            setSkin((String) user.getTemp(SKIN_ATTRIBUTE));
  +        }
  +    }
  +
  +    /**
  +     * Set the skin name user's temp hashmap for the current session.
  +     *
  +     * @param user a User instance
  +     * @param skin the skin name for the session
  +     */
  +    public static void setSkin(User user, String skin)
  +    {
  +        user.setTemp(SKIN_ATTRIBUTE, skin);
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to