001: /*
002: * The contents of this file are subject to the
003: * Mozilla Public License Version 1.1 (the "License");
004: * you may not use this file except in compliance with the License.
005: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006: *
007: * Software distributed under the License is distributed on an "AS IS"
008: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
009: * See the License for the specific language governing rights and
010: * limitations under the License.
011: *
012: * The Initial Developer of the Original Code is Simulacra Media Ltd.
013: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014: *
015: * All Rights Reserved.
016: *
017: * Contributor(s):
018: */
019: package org.openharmonise.rm.resources.publishing;
020:
021: import java.util.*;
022:
023: import org.openharmonise.commons.dsi.*;
024: import org.openharmonise.rm.dsi.DatabaseInfo;
025: import org.openharmonise.rm.resources.xml.*;
026:
027: /**
028: * Parent object to allow hierarchies of <code>Template</code> objects.
029: *
030: * @author Michael Bell
031: * @version $Revision: 1.2 $
032: *
033: */
034: public class TemplateGroup extends XMLResourceGroup {
035:
036: //DB constants
037: private static final String TBL_TEMPLATEGROUP = "template_group";
038:
039: //XML constants
040: public static final String TAG_TEMPLATEGROUP = "TemplateGroup";
041:
042: private static List CHILD_CLASS_NAMES = null;
043:
044: static {
045: DatabaseInfo.getInstance().registerTableName(
046: TemplateGroup.class.getName(), TBL_TEMPLATEGROUP);
047:
048: try {
049: CHILD_CLASS_NAMES = new Vector();
050: CHILD_CLASS_NAMES.add(TemplateGroup.class.getName());
051: CHILD_CLASS_NAMES.add(Template.class.getName());
052:
053: } catch (Exception e) {
054: throw new RuntimeException(e.getMessage());
055: }
056: }
057:
058: /**
059: * Basic empty constructor.
060: */
061: public TemplateGroup() {
062: super ();
063: }
064:
065: /**
066: * Constructs object with an interface to the DB.
067: *
068: * @param dbintrf
069: */
070: public TemplateGroup(AbstractDataStoreInterface dbintrf) {
071: super (dbintrf);
072: }
073:
074: /**
075: * Constructor for a known historical object.
076: *
077: * @param dbintrf
078: * @param nId
079: * @param bIsHist
080: */
081: public TemplateGroup(AbstractDataStoreInterface dbintrf, int nId,
082: int nKey, boolean bIsHist) {
083: super (dbintrf, nId, nKey, bIsHist);
084: }
085:
086: /**
087: * Standard constructor for a known object.
088: *
089: * @param dbintrf
090: * @param nId
091: */
092: public TemplateGroup(AbstractDataStoreInterface dbintrf, int nId) {
093: super (dbintrf, nId);
094: }
095:
096: /* (non-Javadoc)
097: * @see org.openharmonise.rm.dsi.DataStoreObject#getDBTableName()
098: */
099: public String getDBTableName() {
100:
101: return TBL_TEMPLATEGROUP;
102: }
103:
104: /* (non-Javadoc)
105: * @see org.openharmonise.rm.publishing.Publishable#getTagName()
106: */
107: public String getTagName() {
108: return TAG_TEMPLATEGROUP;
109: }
110:
111: /* (non-Javadoc)
112: * @see org.openharmonise.rm.resources.AbstractParentObject#getChildClassNames()
113: */
114: public List getChildClassNames() {
115:
116: return CHILD_CLASS_NAMES;
117: }
118:
119: }
|