[cvs] expresso commit by ppilgrim: Changes to support the upgrade to Struts

JCorporate Ltd jcorp at jcorporate.com
Wed Dec 8 22:52:42 UTC 2004


Log Message:
-----------
Changes to support the upgrade to Struts 1.2.6 Beta

Modified Files:
--------------
    eforum/src/WEB-INF/src/com/jcorporate/eforum:
        ForumUtils.java
        MessagesBundle.properties
    eforum/src/WEB-INF/src/com/jcorporate/eforum/controller:
        Browse.java
    eforum/src/WEB-INF/src/com/jcorporate/eforum/dbobj:
        ForumMonoTextDef.java
        ForumOptions.java
        ForumSubscribe.java
        ForumVarTextDef.java
    eforum/src/WEB-INF/src/com/jcorporate/eforum/job:
        IndexMessages.java
    expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller:
        ExpressoActionServlet.java
    expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/ext/struts/taglib/html:
        ExComboBoxTag.java
    expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/services/test:
        ActionTestServlet.java

Revision Data
-------------
Index: ExpressoActionServlet.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller/ExpressoActionServlet.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller/ExpressoActionServlet.java -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller/ExpressoActionServlet.java -u -r1.21 -r1.22
--- expresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller/ExpressoActionServlet.java
+++ expresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller/ExpressoActionServlet.java
@@ -71,11 +71,8 @@
 import org.apache.struts.Globals;
 import org.apache.struts.action.Action;
 import org.apache.struts.action.ActionFormBean;
-import org.apache.struts.action.ActionFormBeans;
 import org.apache.struts.action.ActionForward;
-import org.apache.struts.action.ActionForwards;
 import org.apache.struts.action.ActionMapping;
-import org.apache.struts.action.ActionMappings;
 import org.apache.struts.action.ActionServlet;
 import org.apache.struts.action.DynaActionFormClass;
 import org.apache.struts.config.ActionConfig;
@@ -99,9 +96,13 @@
 
 
 /**
+ * 
+ * <p>
+ * 
+ * <p>
  * Title:        Expresso Project
  * Description:
- * Copyright:    Copyright (c) 2001, 2002, 2003
+ * Copyright:    Copyright (c) 2001, 2002, 2003, 2004
  * Company:      Jcorporate
  *
  * @author Michael Rimov, Extended by Peter Pilgrim
@@ -131,7 +132,7 @@
      * <p/>
      * <p/>
      * We require the <em>interception</em> of the implementation of the
-     * <code>ActionServlet.initModuleConfig</code> method in this
+     * <code>ActionServlet.initModuleConfig</code> method in�this
      * class, because we need to keep a record of all the defined
      * modules and their configurations. It makes easy to implement
      * controller factory interface.
@@ -329,12 +330,7 @@
         if (prefix.length() < 1) {
             defaultControllerConfig(config);
             defaultMessageResourcesConfig(config);
-            defaultFormBeansConfig(config);
-            defaultForwardsConfig(config);
-            defaultMappingsConfig(config);
         }
-
-
         // Return the completed configuration object
         return config;
 
@@ -634,77 +630,8 @@
     }
 
 
-    /**
-     * Perform backwards-compatible configuration of an ActionFormBeans
-     * collection, and expose it as a servlet context attribute (as was
-     * used in Struts 1.0).  Note that the current controller code does
-     * not (and should not) reference this attribute for any reason.
-     *
-     * @param config The ModuleConfig object for the default app
-     * @since Struts 1.1
-     * @deprecated Will be removed in a release after Struts 1.1.
-     */
-    private void defaultFormBeansConfig(ModuleConfig config) {
-
-        FormBeanConfig fbcs[] = config.findFormBeanConfigs();
-        ActionFormBeans afb = new ActionFormBeans();
-        afb.setFast(false);
-        for (int i = 0; i < fbcs.length; i++) {
-            afb.addFormBean((ActionFormBean) fbcs[i]);
-        }
-        afb.setFast(true);
-        getServletContext().setAttribute(Globals.FORM_BEANS_KEY, afb);
-
-    }
 
 
-    /**
-     * Perform backwards-compatible configuration of an ActionForwards
-     * collection, and expose it as a servlet context attribute (as was
-     * used in Struts 1.0).  Note that the current controller code does
-     * not (and should not) reference this attribute for any reason.
-     *
-     * @param config The ModuleConfig object for the default app
-     * @since Struts 1.1
-     * @deprecated Will be removed in a release after Struts 1.1.
-     */
-    private void defaultForwardsConfig(ModuleConfig config) {
-
-        ForwardConfig fcs[] = config.findForwardConfigs();
-        ActionForwards af = new ActionForwards();
-        af.setFast(false);
-        for (int i = 0; i < fcs.length; i++) {
-            af.addForward((ActionForward) fcs[i]);
-        }
-        af.setFast(true);
-        getServletContext().setAttribute(Globals.FORWARDS_KEY, af);
-
-    }
-
-
-    /**
-     * Perform backwards-compatible configuration of an ActionMappings
-     * collection, and expose it as a servlet context attribute (as was
-     * used in Struts 1.0).  Note that the current controller code does
-     * not (and should not) reference this attribute for any reason.
-     *
-     * @param config The ModuleConfig object for the default app
-     * @since Struts 1.1
-     * @deprecated Will be removed in a release after Struts 1.1.
-     */
-    private void defaultMappingsConfig(ModuleConfig config) {
-
-        ActionConfig acs[] = config.findActionConfigs();
-        ActionMappings am = new ActionMappings();
-        am.setServlet(this);
-        am.setFast(false);
-        for (int i = 0; i < acs.length; i++) {
-            am.addMapping((ActionMapping) acs[i]);
-        }
-        am.setFast(true);
-        getServletContext().setAttribute(Globals.MAPPINGS_KEY, am);
-
-    }
 
 
     /**
Index: ForumUtils.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/eforum/src/WEB-INF/src/com/jcorporate/eforum/ForumUtils.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lsrc/WEB-INF/src/com/jcorporate/eforum/ForumUtils.java -Lsrc/WEB-INF/src/com/jcorporate/eforum/ForumUtils.java -u -r1.1 -r1.2
--- src/WEB-INF/src/com/jcorporate/eforum/ForumUtils.java
+++ src/WEB-INF/src/com/jcorporate/eforum/ForumUtils.java
@@ -6,9 +6,19 @@
 import java.util.Enumeration;
 import java.util.Hashtable;
 
+import org.apache.commons.beanutils.BasicDynaClass;
+import org.apache.commons.beanutils.DynaBean;
+import org.apache.commons.beanutils.DynaProperty;
+import org.apache.commons.beanutils.LazyDynaBean;
+
+import com.jcorporate.eforum.dbobj.ForumOptions;
+import com.jcorporate.eforum.dbobj.ForumSignature;
 import com.jcorporate.expresso.core.controller.ControllerException;
 import com.jcorporate.expresso.core.controller.ControllerRequest;
 import com.jcorporate.expresso.core.controller.ControllerResponse;
+import com.jcorporate.expresso.core.controller.ServletControllerRequest;
+import com.jcorporate.expresso.core.db.DBException;
+import com.jcorporate.expresso.core.dbobj.RequestContext;
 
 /**
  * This is a static non instantiable class with eForum utilities 
@@ -19,6 +29,11 @@
 public final class ForumUtils {
 
     /**
+     * The JSP attribute of the forum profile bean
+     */
+    public static final String JSP_FORUM_PROFILE_BEAN = "forumProfile";
+    
+    /**
      * Private constructor
      */
     private ForumUtils() {
@@ -67,4 +82,123 @@
         System.out.println("========================================");
     }
 
+    /**
+     * Returns a forum profile dyna bean specifically for this forum 
+     * users. 
+     * 
+     * <p><b>TECH NOTE<b>:
+     * The forum profile <code>DynaBean</code> is a pseudo JavaBean
+     * that contains the merged properties of both DBObjects
+     * {@link ForumOptions} and 
+     * {@link ForumSignature }. 
+     * 
+     * This bean contains only property name and values pairs.
+     * We use the bean on the web user interface like a value object
+     * and to divorce the database 
+     * 
+     * @param userId the user id
+     * @return the dynaBean object
+     * 
+     * @see LazyDynaBean
+     */
+    public static DynaBean createForumProfileDynaBean( int userId, RequestContext requestContext )
+    throws DBException
+    {
+        DynaProperty[] props = new DynaProperty[]{
+            new DynaProperty("autoWrapMsg", Boolean.class),
+            new DynaProperty("autoWrapRelies", Boolean.class),
+            new DynaProperty("displayVariable", Boolean.class),
+            new DynaProperty("indentReplies", Boolean.class),
+            new DynaProperty("indentText", String.class),
+            new DynaProperty("monoTextFontCss", String.class),
+            new DynaProperty("uid", Integer.class),
+            new DynaProperty("useSignature", Boolean.class),
+            new DynaProperty("signature", String.class),
+            new DynaProperty("varTextFontCss", String.class),
+            new DynaProperty("wordWrapLength", Integer.class),
+//            new DynaProperty("", Integer.class)
+//            new DynaProperty("", String.class)
+//            new DynaProperty("", Boolean.class)
+        };
+        BasicDynaClass dynaClass = new BasicDynaClass("forumProfile", null, props);        
+
+        ForumLazyDynaBean bean = new ForumLazyDynaBean( dynaClass );
+        
+        // Retrieve the current forum options
+        ForumOptions fo = new ForumOptions();
+        fo.setDataContext( requestContext.getDBName() );
+        fo.setField( ForumOptions.FLD_UID, requestContext.getUid() );
+        if ( !fo.find() ) {
+            fo.checkDefaultValueIntegrity();
+        }
+
+        bean.setBoolean("autoWrapMsg", fo.getFieldBoolean( ForumOptions.FLD_AUTO_WRAP_MSG ) );
+        bean.setBoolean("autoWrapReplies", fo.getFieldBoolean( ForumOptions.FLD_AUTO_WRAP_REPLIES ) );
+        bean.setBoolean("displayVariable", fo.getFieldBoolean( ForumOptions.FLD_DISPLAY_VARIABLE ) );
+        bean.setBoolean("indentReplies", fo.getFieldBoolean( ForumOptions.FLD_INDENT_REPLIES ) );
+        bean.set("indentText", fo.getField( ForumOptions.FLD_INDENT_TEXT ) );
+        bean.set("monoTextFontCss", fo.getField( ForumOptions.VFLD_MONO_TEXT_FONT_CSSNAME ) );
+        bean.setInteger("msgWidth", fo.getFieldInt( ForumOptions.FLD_MSG_WIDTH ) );
+        bean.setInteger("msgHeight", fo.getFieldInt( ForumOptions.FLD_MSG_HEIGHT ) );
+        bean.setInteger("uid", fo.getFieldInt( ForumOptions.FLD_UID ) );
+        bean.setBoolean("useSignature", fo.getFieldBoolean( ForumOptions.FLD_USE_SIGNATURE ) );
+        bean.set("varTextFontCss", fo.getField( ForumOptions.VFLD_VAR_TEXT_FONT_CSSNAME ) );
+        bean.setInteger("wordWrapLength", fo.getFieldInt( ForumOptions.FLD_WORD_WRAP_LENGTH ) );
+        
+        // Set the value of the text/css style that will display
+        // the forum messages.
+        if ( fo.getFieldBoolean( ForumOptions.FLD_DISPLAY_VARIABLE ) )
+            bean.set("messageTextFontCss", fo.getField( ForumOptions.VFLD_VAR_TEXT_FONT_CSSNAME ) );
+        else
+            bean.set("messageTextFontCss", fo.getField( ForumOptions.VFLD_MONO_TEXT_FONT_CSSNAME ) );
+            
+        // bean.set("", fo.getField( ForumOptions. ) );
+        
+        // Retrieve the current forum signature
+        ForumSignature sign = new ForumSignature();
+        sign.setDataContext( requestContext.getDBName() );
+        sign.setField( ForumSignature.FLD_UID, requestContext.getUid() );
+        sign.find();
+        
+        bean.set("signature", sign.getField( ForumSignature.FLD_SIGNATURE_TEXT ) );
+        
+        return bean;
+    }
+
+    /**
+     * A convenience method that generates the forum profile bean in the 
+     * session scope for the JSP view.
+     * 
+     * @param request the controller request
+     * @return the dynaBean object
+     * 
+     * @throws DBException
+     */
+    public static void generateForumProfile( ControllerRequest request )
+    throws DBException
+    {
+        generateForumProfile( request.getUid(), request );
+    }
+    
+    /**
+     * A convenience method that generates the forum profile bean in the 
+     * session scope for the JSP view.
+     * 
+     * @param userId the user id
+     * @param request the controller request
+     * @return the dynaBean object
+     * 
+     * @throws DBException
+     * 
+     * @see #createForumProfileDynaBean(int, RequestContext)
+     * @see #JSP_FORUM_PROFILE_BEAN
+     */
+    public static void generateForumProfile( int userId, ControllerRequest request )
+    throws DBException
+    {
+        DynaBean bean = createForumProfileDynaBean( userId, request );
+        request.setAttrib( JSP_FORUM_PROFILE_BEAN, bean );
+        ServletControllerRequest servReq = (ServletControllerRequest)request;
+        servReq.getHttpServletRequest().getSession().setAttribute( JSP_FORUM_PROFILE_BEAN, bean );
+    }
 }
Index: MessagesBundle.properties
===================================================================
RCS file: /home/javacorp/.cvs/expresso/eforum/src/WEB-INF/src/com/jcorporate/eforum/MessagesBundle.properties,v
retrieving revision 1.9
retrieving revision 1.10
diff -Lsrc/WEB-INF/src/com/jcorporate/eforum/MessagesBundle.properties -Lsrc/WEB-INF/src/com/jcorporate/eforum/MessagesBundle.properties -u -r1.9 -r1.10
--- src/WEB-INF/src/com/jcorporate/eforum/MessagesBundle.properties
+++ src/WEB-INF/src/com/jcorporate/eforum/MessagesBundle.properties
@@ -158,6 +158,8 @@
 FN_Var_Text_Font_Id=Proportional Message Text Font
 FN_Mono_Text_Font_Id=Monospace Message Text Font
 FN_DisplayVariable=Display Message in Proportional Font?
+FN_Mono_Text_Font_CssName=Monospace Message Text Font Css Name
+FN_Var_Text_Font_CssName=Proportional Message Text Font Css Name
 
 # ---------------------------------------------
 TN_FORUMMONOTEXTDEF=Forum Monospace Text Font Definitions
Index: ExComboBoxTag.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/ext/struts/taglib/html/ExComboBoxTag.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/ext/struts/taglib/html/ExComboBoxTag.java -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/ext/struts/taglib/html/ExComboBoxTag.java -u -r1.11 -r1.12
--- expresso-web/WEB-INF/src/com/jcorporate/expresso/ext/struts/taglib/html/ExComboBoxTag.java
+++ expresso-web/WEB-INF/src/com/jcorporate/expresso/ext/struts/taglib/html/ExComboBoxTag.java
@@ -209,10 +209,6 @@
         String nameToUse = name;
         String propertyToUse = property;
 
-        if (StringUtil.notNull(nameToUse).equals(Globals.FORM_BEANS_KEY)) {
-            nameToUse = null;
-        }
-
         if (nameToUse == null) {
             myInput = ControllerUtils.findInput(pageContext, propertyToUse);
         } else {
Index: Browse.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/eforum/src/WEB-INF/src/com/jcorporate/eforum/controller/Browse.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -Lsrc/WEB-INF/src/com/jcorporate/eforum/controller/Browse.java -Lsrc/WEB-INF/src/com/jcorporate/eforum/controller/Browse.java -u -r1.26 -r1.27
--- src/WEB-INF/src/com/jcorporate/eforum/controller/Browse.java
+++ src/WEB-INF/src/com/jcorporate/eforum/controller/Browse.java
@@ -563,6 +563,9 @@
         String myName = new String(thisClass + "browseMessages()");
 
         try {
+            // Generate personalisation bean
+            ForumUtils.generateForumProfile( request );
+
             // Retrieve the parameters for this state method: forum group id
             // and forum thread id
             ForumGroup thisGroup = new ForumGroup(SecuredDBObject.SYSTEM_ACCOUNT);
@@ -805,6 +808,9 @@
                                           ControllerResponse response)
         throws ControllerException {
         try {
+            // Generate personalisation bean
+            ForumUtils.generateForumProfile( request );
+
             ForumMessage ml = new ForumMessage(SecuredDBObject.SYSTEM_ACCOUNT);
             ml.setDataContext(request.getDataContext());
             ml.setField("MessageId", request.getParameter("MessageId"));
@@ -925,6 +931,9 @@
         String myName = new String(thisClass + "browseThreadsState()");
 
         try {
+            // Generate personalisation bean
+            ForumUtils.generateForumProfile( request );
+
             User myUser = new User();
             myUser.setDataContext(request.getDataContext());
             myUser.setUid(request.getUid());
@@ -2531,6 +2540,8 @@
         String myName = new String(thisClass + "selGroupState()");
 
         try {
+            ForumUtils.generateForumProfile( request );
+            
             User myUser = new User();
             myUser.setDataContext(request.getDataContext());
             myUser.setUid(request.getUid());
Index: ForumMonoTextDef.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/eforum/src/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumMonoTextDef.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lsrc/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumMonoTextDef.java -Lsrc/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumMonoTextDef.java -u -r1.3 -r1.4
--- src/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumMonoTextDef.java
+++ src/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumMonoTextDef.java
@@ -97,7 +97,7 @@
      */
     public synchronized void populateDefaultValues() throws DBException 
     {
-        String fontSizeList[] = { "8", "10", "12" };
+        String fontSizeList[] = { "8", "10", "12", "14", "16", "18", "24", "36" };
         
         ForumMonoTextDef textFont;
         for ( int k=0; k<fontSizeList.length; ++k ) {
Index: ForumVarTextDef.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/eforum/src/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumVarTextDef.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -Lsrc/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumVarTextDef.java -Lsrc/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumVarTextDef.java -u -r1.4 -r1.5
--- src/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumVarTextDef.java
+++ src/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumVarTextDef.java
@@ -97,7 +97,7 @@
      */
     public synchronized void populateDefaultValues() throws DBException 
     {
-        String fontSizeList[] = { "8", "10", "12" };
+        String fontSizeList[] = { "8", "10", "12", "14", "16", "18", "24", "36" };
         
         ForumVarTextDef textFont;
         for ( int k=0; k<fontSizeList.length; ++k ) {
Index: ForumOptions.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/eforum/src/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumOptions.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -Lsrc/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumOptions.java -Lsrc/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumOptions.java -u -r1.6 -r1.7
--- src/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumOptions.java
+++ src/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumOptions.java
@@ -3,13 +3,17 @@
 import java.util.Vector;
 
 import org.apache.log4j.Logger;
+import org.apache.commons.beanutils.*;
 
+import com.jcorporate.eforum.*;
 import com.jcorporate.expresso.core.dataobjects.DataObjectMetaData;
 import com.jcorporate.expresso.core.db.DBException;
 import com.jcorporate.expresso.core.dbobj.RequestContext;
 import com.jcorporate.expresso.core.dbobj.SecuredDBObject;
 import com.jcorporate.expresso.core.dbobj.ValidValue;
 import com.jcorporate.expresso.core.misc.StringUtil;
+import com.jcorporate.expresso.core.security.User;
+
 
 /**
  * This is a data object stores a static set of
@@ -47,7 +51,7 @@
     /** Data field name constant */
     public static final String  FLD_AUTO_WRAP_REPLIES = "AutoWrapReplies";
     /** Data field name constant */
-    public static final String  FLD_DISPLAY_VARIABLE =  "DisplayVarText";
+    public static final String  FLD_DISPLAY_VARIABLE  = "DisplayVarText";
     /** Data field name constant */
     public static final String  FLD_VAR_TEXT_FONT_ID  = ForumVarTextDef.FLD_VAR_TEXT_FONT_ID;
     /** Data field name constant */
@@ -55,6 +59,12 @@
     /** Data field name constant */
     // public static final String       FLD_ = "";
 
+    //                                                        01234567890123456789
+    /** Virtual field constant */
+    public static final String VFLD_VAR_TEXT_FONT_CSSNAME  = "VarTxtFntCssName";
+    /** Virtual field constant */
+    public static final String VFLD_MONO_TEXT_FONT_CSSNAME = "MonoTxtFntCssName";
+
     /**
      * Default constructor
      * @see com.jcorporate.expresso.core.dbobj.SecuredDBObject#SecuredDBObject
@@ -123,6 +133,48 @@
     }
 
     /**
+     * Extends the standard DBObject method to retrieve a field
+     * 
+     * <p><b>TECH NOTE<b>:
+     * <ul>
+     *
+     * <li><b> LoginName </b> - the login name of the user who
+     * created this message. <code>ExpUid</code> is mapped to logged
+     * user <code>LoginName</code>
+     * </li>
+     *
+     * </ul>
+     *
+     * @param fieldName the name of the field
+     * @return value of the field
+     *
+     * @throws DBException if a database failure occurs
+     */
+    public String getField(String fieldName) throws DBException 
+    {
+        if (VFLD_MONO_TEXT_FONT_CSSNAME.equals(fieldName)) {
+            ForumMonoTextDef mono = new ForumMonoTextDef();
+            mono.setDataContext(this.getDataContext());
+            mono.setField( ForumMonoTextDef.FLD_MONO_TEXT_FONT_ID, 
+                    getField( FLD_MONO_TEXT_FONT_ID ));
+            if ( mono.find()) 
+                return mono.getField( ForumMonoTextDef.FLD_TEXT_FONT_CSSNAME );
+            return "undefined-cssname";
+        }
+        else if (VFLD_VAR_TEXT_FONT_CSSNAME.equals(fieldName)) {
+            ForumVarTextDef var = new ForumVarTextDef();
+            var.setDataContext(this.getDataContext());
+            var.setField( ForumVarTextDef.FLD_VAR_TEXT_FONT_ID,
+                    getField( FLD_VAR_TEXT_FONT_ID ));
+            if ( var.find()) 
+                return var.getField( ForumVarTextDef.FLD_TEXT_FONT_CSSNAME );
+            return "undefined-cssname";
+        }
+
+        return super.getField(fieldName);
+    }
+    
+    /**
      * Define meta data for this data object
      *
      * @see com.jcorporate.expresso.core.dbobj.SecuredDBObject#setupFields
@@ -152,6 +204,10 @@
 
         // addField(FLD_,       "int",      0,   false, "FN_");
 
+        // As convenience add a login name derived field
+        addVirtualField(VFLD_MONO_TEXT_FONT_CSSNAME, "varchar",  250, "FN_Mono_Text_Font_CssName"); 
+        addVirtualField(VFLD_VAR_TEXT_FONT_CSSNAME,  "varchar",  250, "FN_Var_Text_Font_CssName"); 
+        
         // Define the primary key fields
         addKey(FLD_UID);
 
@@ -165,7 +221,11 @@
         setDefaultValue( FLD_AUTO_WRAP_MSG, "false" );
         setDefaultValue( FLD_AUTO_WRAP_REPLIES, "false" );
         setDefaultValue( FLD_DISPLAY_VARIABLE, "true" );
+        setDefaultValue( FLD_MONO_TEXT_FONT_ID, "3" );
+        setDefaultValue( FLD_VAR_TEXT_FONT_ID, "3" );
 
+        
+        // TECH NOTE:
         // Here follows an real example of automatic look up of
         // enumerated values pertaining to a database column. In
         // Expresso Framework we specify the column only accepts
@@ -215,8 +275,8 @@
         forumOption.setField( FLD_AUTO_WRAP_MSG, "false" );
         forumOption.setField( FLD_AUTO_WRAP_REPLIES, "false" );
         forumOption.setField( FLD_DISPLAY_VARIABLE, "true" );
-        forumOption.setField( FLD_VAR_TEXT_FONT_ID,  1 );
-        forumOption.setField( FLD_MONO_TEXT_FONT_ID,  1 );
+        forumOption.setField( FLD_VAR_TEXT_FONT_ID,  3 );
+        forumOption.setField( FLD_MONO_TEXT_FONT_ID,  3 );
 
         forumOption.addIfNeeded();
     }
@@ -246,7 +306,6 @@
         return super.getValidValues(fieldName);
     }
     
-
 } 
 
 // End
Index: ForumSubscribe.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/eforum/src/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumSubscribe.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -Lsrc/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumSubscribe.java -Lsrc/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumSubscribe.java -u -r1.15 -r1.16
--- src/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumSubscribe.java
+++ src/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumSubscribe.java
@@ -307,6 +307,8 @@
 
     /**
      * Extends the standard DBObject method to retrieve a field
+     * 
+     * <p><b>TECH NOTE<b>:
      * <ul>
      *
      * <li><b> LoginName </b> - the login name of the user who
Index: IndexMessages.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/eforum/src/WEB-INF/src/com/jcorporate/eforum/job/IndexMessages.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -Lsrc/WEB-INF/src/com/jcorporate/eforum/job/IndexMessages.java -Lsrc/WEB-INF/src/com/jcorporate/eforum/job/IndexMessages.java -u -r1.8 -r1.9
--- src/WEB-INF/src/com/jcorporate/eforum/job/IndexMessages.java
+++ src/WEB-INF/src/com/jcorporate/eforum/job/IndexMessages.java
@@ -17,6 +17,8 @@
 // $Revision$    $State$    $Locker$
 //
 
+package com.jcorporate.eforum.job;
+
 import java.util.Locale;
 import com.jcorporate.eforum.ForumSchema;
 import com.jcorporate.eforum.search.SearchIndexer; // *PP* Tue Oct 22 00:55:01 BST 2002
Index: ActionTestServlet.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/services/test/ActionTestServlet.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/services/test/ActionTestServlet.java -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/services/test/ActionTestServlet.java -u -r1.10 -r1.11
--- expresso-web/WEB-INF/src/com/jcorporate/expresso/services/test/ActionTestServlet.java
+++ expresso-web/WEB-INF/src/com/jcorporate/expresso/services/test/ActionTestServlet.java
@@ -69,7 +69,6 @@
 import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
-import org.apache.struts.action.ActionMappings;
 
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
@@ -93,15 +92,6 @@
         super();
     }
 
-
-    /**
-     * @deprecated For the Struts 1.1 do not use this method
-     */
-    public ActionMappings getActionMappings() {
-        // return this.mappings;
-        return null;
-
-    }
 
     public synchronized static ActionTestServlet getInstance(ServletConfig config)
             throws ServletException {


More information about the cvs mailing list