[cvs] eforum commit by ppilgrim: Register in CVS
JCorporate Ltd
jcorp at jcorporate.com
Sat Jun 11 10:19:38 UTC 2005
Log Message:
-----------
Register in CVS
Added Files:
-----------
eforum/src/WEB-INF/src/com/jcorporate/eforum/dbobj:
ForumSkinLAFDef.java
Revision Data
-------------
--- /dev/null
+++ src/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumSkinLAFDef.java
@@ -0,0 +1,127 @@
+package com.jcorporate.eforum.dbobj;
+
+import java.util.Vector;
+
+import com.jcorporate.expresso.core.db.DBException;
+import com.jcorporate.expresso.core.dbobj.SecuredDBObject;
+import com.jcorporate.expresso.core.security.ReadOnlyUser;
+
+/**
+ * This is a data object stores a static list of look and feel definitions
+ * otherwise known as "skin" types.
+ * This class is used in the <em>personalisation</em> feature
+ * of eForum.
+ *
+ * @author Peter Pilgrim, April 2005
+ * @version $Id: ForumSkinLAFDef.java,v 1.1 2005/06/11 10:19:37 ppilgrim Exp $
+ *
+ * @see com.jcorporate.eforum.dbobj.ForumSkinProperties
+ */
+public class ForumSkinLAFDef extends SecuredDBObject
+{
+
+ // 01234567890123456789
+
+ /** Data field name constant */
+ public static final String FLD_SKIN_ID = "Skin_Id";
+ /** Data field name constant */
+ public static final String FLD_SKIN_NAME = "Skin_Name";
+ /** Data field name constant */
+ public static final String FLD_SKIN_DESCRIP = "Skin_Descrip";
+ /** Data field name constant */
+ public static final String FLD_SKIN_TEXT_VALUE = "Skin_Text_Value";
+ /** Data field name constant */
+ public static final String FLD_SKIN_INT_VALUE = "Skin_Int_Value";
+ /** Data field name constant */
+ public static final String FLD_SKIN_DOUBLE_VALUE = "Skin_Double_Value";
+ /** Data field name constant */
+ // public static final String FLD__ = "Skin__";
+
+ /** Skin look and feel identifier */
+ public final static int CLASSIC_SKIN_LAF_ID = 1;
+ /** Skin look and feel identifier */
+ public final static int GALAXY_WARP_SKIN_LAF_ID = 2;
+
+ /**
+ * Default constructor
+ * @see com.jcorporate.expresso.core.dbobj.SecuredDBObject#SecuredDBObject
+ * @throws DBException upon error
+ */
+ public ForumSkinLAFDef() throws DBException {
+ super();
+ } /* ForumMonoTextDef() */
+
+ /**
+ * Standard constructor create a dbobject that with the user security
+ * credentials as well.
+ *
+ * @param userSecurityContext ReadOnlyUser. You can often get this
+ * from RequestRegistry
+ * @throws DBException upon construction error.
+ *
+ * @see SecuredDBObject#SecuredDBObject(ReadOnlyUser)
+ */
+ public ForumSkinLAFDef(ReadOnlyUser userSecurityContext) throws DBException {
+ super( userSecurityContext );
+ }
+
+ /**
+ * Return valid values for automatic lookup client data objects
+ *
+ * @throws DBException on database failure
+ *
+ * @see com.jcorporate.eforum.dbobj.ForumOptions
+ */
+ public Vector getValues()
+ throws DBException
+ {
+ Vector myValues = this.getValuesDefault( FLD_SKIN_ID, FLD_SKIN_NAME );
+ return myValues;
+ }
+
+ /**
+ * @see com.jcorporate.expresso.core.dbobj.SecuredDBObject#setupFields
+ * @throws DBException if database fails
+ */
+ protected synchronized void setupFields() throws DBException
+ {
+ setTargetTable("FORUMSKINLAFDEF");
+ setName("Skin Look & Feel Definitions");
+ setDescription("TN_FORUMSKINLAFDEF");
+
+ addField(FLD_SKIN_ID, "int", 0, false, "FN_SkinId");
+ addField(FLD_SKIN_NAME, "varchar", 64, false, "FN_SkinName");
+ addField(FLD_SKIN_DESCRIP, "varchar", 192, false, "FN_SkinDescrip");
+
+ // Define the primary key fields
+ addKey(FLD_SKIN_ID);
+ } /* setupFields() */
+
+ /**
+ * Populates a set of Default Values for the forums.
+ * @throws DBException if database error occurs
+ */
+ public synchronized void populateDefaultValues() throws DBException
+ {
+ ForumSkinLAFDef skinLaf;
+
+ skinLaf = new ForumSkinLAFDef();
+ skinLaf.setDataContext(getDataContext());
+ skinLaf.setField( FLD_SKIN_ID, CLASSIC_SKIN_LAF_ID );
+ skinLaf.setField( FLD_SKIN_NAME, "Classic look and feel");
+ skinLaf.setField( FLD_SKIN_DESCRIP, "This is the original look and feel circa 2000 to 2004");
+ skinLaf.addIfNeeded();
+
+ skinLaf = new ForumSkinLAFDef();
+ skinLaf.setDataContext(getDataContext());
+ skinLaf.setField( FLD_SKIN_ID, GALAXY_WARP_SKIN_LAF_ID );
+ skinLaf.setField( FLD_SKIN_NAME, "Galaxy Warp");
+ skinLaf.setField( FLD_SKIN_DESCRIP, "This theme depicts science fiction human interface of the future");
+ skinLaf.addIfNeeded();
+
+ }
+
+}
+
+// End
+
More information about the cvs
mailing list