[cvs] eforum commit by ppilgrim: Register in CVS
JCorporate Ltd
jcorp at jcorporate.com
Sat Jun 11 10:19:54 UTC 2005
Log Message:
-----------
Register in CVS
Added Files:
-----------
eforum/src/WEB-INF/src/com/jcorporate/eforum/dbobj:
ForumSkinProperties.java
Revision Data
-------------
--- /dev/null
+++ src/WEB-INF/src/com/jcorporate/eforum/dbobj/ForumSkinProperties.java
@@ -0,0 +1,115 @@
+package com.jcorporate.eforum.dbobj;
+
+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 property name and values that are
+ * relevant to skin look-and-feels.
+ * This class is used in the <em>personalisation</em> feature
+ * of eForum.
+ *
+ * @author Peter Pilgrim, April 2005
+ * @version $Id: ForumSkinProperties.java,v 1.1 2005/06/11 10:19:53 ppilgrim Exp $
+ *
+ * @see com.jcorporate.eforum.dbobj.ForumSkinLAFDef
+ */
+public class ForumSkinProperties 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_PROPERTY_NAME = "Property_Name";
+ /** Data field name constant */
+ public static final String FLD_TEXT_VALUE = "Text_Value";
+ /** Data field name constant */
+ public static final String FLD_INT_VALUE = "Int_Value";
+ /** Data field name constant */
+ public static final String FLD_DOUBLE_VALUE = "Double_Value";
+ /** Data field name constant */
+ // public static final String FLD__ = "Skin__";
+
+ /**
+ * Default constructor
+ * @see com.jcorporate.expresso.core.dbobj.SecuredDBObject#SecuredDBObject
+ * @throws DBException upon error
+ */
+ public ForumSkinProperties() 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 ForumSkinProperties(ReadOnlyUser userSecurityContext) throws DBException {
+ super( userSecurityContext );
+ }
+
+ /**
+ * @see com.jcorporate.expresso.core.dbobj.SecuredDBObject#setupFields
+ * @throws DBException if database fails
+ */
+ protected synchronized void setupFields() throws DBException
+ {
+ setTargetTable("FORUMSKINPROPS");
+ setName("Skin Look & Feel Properties");
+ setDescription("TN_FORUMSKINPROPS");
+
+ addField(FLD_SKIN_ID, "int", 0, false, "FN_SkinId");
+ addField(FLD_PROPERTY_NAME, "varchar", 64, false, "FN_SkinPropertyName");
+ addField(FLD_TEXT_VALUE, "varchar", 192, false, "FN_SkinTextValue");
+ addField(FLD_INT_VALUE, "int", 0, false, "FN_SkinIntValue");
+ addField(FLD_DOUBLE_VALUE, "double", 0, false, "FN_SkinDoubleValue");
+
+ // Define the primary key fields
+ addKey(FLD_SKIN_ID);
+ addKey(FLD_PROPERTY_NAME);
+
+ } /* setupFields() */
+
+ /**
+ * Populates a set of Default Values for the forums.
+ * @throws DBException if database error occurs
+ */
+ public synchronized void populateDefaultValues() throws DBException
+ {
+ ForumSkinProperties skinProps;
+
+ skinProps = new ForumSkinProperties();
+ skinProps.setDataContext(getDataContext());
+ skinProps.setField( FLD_SKIN_ID, ForumSkinLAFDef.CLASSIC_SKIN_LAF_ID );
+ skinProps.setField( FLD_PROPERTY_NAME, "SKIN_FOLDER");
+ skinProps.setField( FLD_TEXT_VALUE, "classic");
+ // skinProps.setField( FLD_INT_VALUE, "");
+ // skinProps.setField( FLD_DOUBLE_VALUE, "");
+ // skinProps.setField( FLD_, "");
+ skinProps.addIfNeeded();
+
+
+ skinProps = new ForumSkinProperties();
+ skinProps.setDataContext(getDataContext());
+ skinProps.setField( FLD_SKIN_ID, ForumSkinLAFDef.GALAXY_WARP_SKIN_LAF_ID );
+ skinProps.setField( FLD_PROPERTY_NAME, "SKIN_FOLDER");
+ skinProps.setField( FLD_TEXT_VALUE, "galaxywarp");
+ // skinProps.setField( FLD_INT_VALUE, "");
+ // skinProps.setField( FLD_DOUBLE_VALUE, "");
+ // skinProps.setField( FLD_, "");
+ skinProps.addIfNeeded();
+
+ }
+
+}
+
+// End
+
More information about the cvs
mailing list