001: /*
002: * JFolder, Copyright 2001-2006 Gary Steinmetz
003: *
004: * Distributable under LGPL license.
005: * See terms of license at gnu.org.
006: */
007:
008: package org.jfolder.common.tagging;
009:
010: //base classes
011: import java.util.HashMap;
012: import org.w3c.dom.Document;
013:
014: //project specific classes
015: import org.jfolder.common.UnexpectedSystemException;
016: import org.jfolder.common.tagging.ConceptTag;
017: import org.jfolder.common.tagging.ConceptTagCallContext;
018: import org.jfolder.common.tagging.ConceptTagCharacteristicHolder;
019: import org.jfolder.common.tagging.ConceptTagMenuBranch;
020: import org.jfolder.common.tagging.ConceptTagPreferences;
021: import org.jfolder.common.tagging.ConceptTagPreferencesHelper;
022: import org.jfolder.common.tagging.ConceptTagProperties;
023: import org.jfolder.common.tagging.ConceptTagSetHolder;
024: import org.jfolder.common.tagging.DetermineClassConceptTagContext;
025: import org.jfolder.common.tagging.DetermineValueAndClassConceptTagContext;
026: import org.jfolder.common.tagging.InitializeConceptTagContext;
027: import org.jfolder.common.tagging.RootConceptTagHolder;
028:
029: //other classes
030:
031: public abstract class BaseConceptTagPreferences implements
032: ConceptTagPreferences {
033:
034: //
035: private boolean validateOnlyMode = false;
036: //
037: private RootConceptTagHolder rcth = null;
038: //
039: private ConceptTagFlags ctf = null;
040: //
041: private StudioConceptTagCreParInfoContextHolder scpch = null;
042:
043: //
044: public BaseConceptTagPreferences() {
045: this .ctf = new ConceptTagFlags();
046: }
047:
048: //
049: public ConceptTagFlags getFlags() {
050: return this .ctf;
051: }
052:
053: //
054: public void setRootHolder(RootConceptTagHolder inRcth) {
055: if (this .rcth != null) {
056: throw new UnexpectedSystemException("Already set");
057: } else {
058: this .rcth = inRcth;
059: }
060: }
061:
062: public RootConceptTagHolder getRootHolder() {
063: return this .rcth;
064: }
065:
066: //
067: public String getRootConstraint() {
068: return ConceptTagPreferencesHelper.CTP_PREF_ROOT_CONSTRAINT__COMMON;
069: }
070:
071: public String getRootHandle() {
072: return (getRootConstraint() + getHandleConjunction() + "0");
073: }
074:
075: //
076: public String getHandleConjunction() {
077: return ConceptTagPreferencesHelper.CTP_PREF_HANDLE_CONJUNCTION__COMMON;
078: }
079:
080: //
081: //
082: public ConceptTag createUnknownConceptTag(String inNs, String inName) {
083:
084: throw new UnexpectedSystemException(
085: "Unknown System Entity Tag - " + "Namespace = ('"
086: + inNs + "'), Name = ('" + inName + "')");
087: }
088:
089: //
090: public HashMap getDefaultNamespaceAssignments() {
091: return new HashMap();
092: }
093:
094: public String getAttributeConstraintName() {
095: return ConceptTagPreferencesHelper.CTP_PREF_ATTRIBUTE_LOCAL_NAME__COMMON;
096: }
097:
098: public String getStyleConstraintName() {
099: return ConceptTagPreferencesHelper.CTP_PREF_STYLE_LOCAL_NAME__COMMON;
100: }
101:
102: //
103: public void setValidateOnlyMode(boolean inMode) {
104: this .validateOnlyMode = inMode;
105: }
106:
107: public boolean isValidateOnlyMode() {
108: return this .validateOnlyMode;
109: }
110:
111: //
112: //
113: //
114: public StudioConceptTagCreParInfoContextHolder getCreationParameters() {
115:
116: StudioConceptTagCreParInfoContextHolder outValue = null;
117:
118: if (this.scpch != null) {
119: outValue = this.scpch;
120: } else {
121: this.scpch = StudioConceptTagCreParInfoContextHolder
122: .newInstance(getSetHolder());
123: outValue = this.scpch;
124: }
125:
126: return outValue;
127: }
128: }
|