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.function;
009:
010: //base classes
011: import java.io.InputStream;
012: import javax.servlet.jsp.PageContext;
013: import org.w3c.dom.Attr;
014: import org.w3c.dom.Element;
015: import org.w3c.dom.Node;
016:
017: //project specific classes
018: import org.jfolder.common.tagging.ConceptTagCallContext;
019: import org.jfolder.common.tagging.ConceptTagHelper;
020: import org.jfolder.common.tagging.ConceptTagPreferences;
021: import org.jfolder.common.tagging.ConceptTagSetContext;
022: import org.jfolder.common.tagging.DetermineValueAndClassConceptTagContext;
023: import org.jfolder.common.tagging.DynamicConceptTagValidator;
024: import org.jfolder.common.tagging.RootConceptTagHolder;
025:
026: //other classes
027:
028: public class WebPageTagHelper extends ConceptTagHelper {
029:
030: public static RootConceptTagHolder getRootHolder(InputStream inIs,
031: ConceptTagSetContext inCtsc) {
032: //
033: return ConceptTagHelper.getRootHolder(inIs,
034: new WebPageTagPreferences());
035: }
036:
037: public static RootConceptTagHolder getRootHolder(Node inNode,
038: ConceptTagSetContext inCtsc) {
039: //
040: return ConceptTagHelper.getRootHolder(inNode,
041: new WebPageTagPreferences());
042: }
043:
044: public static RootConceptTagHolder getRootHolder(InputStream inIs,
045: String inRootClassName, ConceptTagSetContext inCtsc,
046: PageContext inPc) {
047: //
048: return ConceptTagHelper.getRootHolder(inIs,
049: new WebPageTagPreferences());
050: }
051:
052: public static RootConceptTagHolder getRootConceptTagHolder(
053: Node inNode, String inRootClassName,
054: ConceptTagSetContext inCtsc) {
055: //
056: return ConceptTagHelper.getRootHolder(inNode,
057: new WebPageTagPreferences());
058: }
059:
060: //public static ComponentsForReturnableWebPageTag
061: // getComponentsForReturnableWebPageTag(
062: // DetermineValueAndClassConceptTagContext inRvacfctc) {
063: //
064: // ComponentsForReturnableWebPageTag outValue = null;
065: //
066: // ReturnValueAndClassForWebPageTagContext rvacfwtc =
067: // (ReturnValueAndClassForWebPageTagContext)inRvacfctc;
068: // outValue = rvacfwtc.getComponentsForReturnableWebPageTag();
069: //
070: // return outValue;
071: //}
072:
073: public final static boolean isConstrained(
074: ConceptTagPreferences inCtp, Element inElement) {
075:
076: boolean outValue = false;
077:
078: Attr conAttr = null;
079:
080: if (inCtp.isConstraintUsed()) {
081: String conNs = inCtp.getConstraintNamespace();
082: String conName = inCtp.getConstraintName();
083: if (conNs != null) {
084: conAttr = inElement.getAttributeNodeNS(conNs, conName);
085: } else {
086: conAttr = inElement.getAttributeNode(conName);
087: }
088: }
089: if (conAttr != null) {
090: outValue = true;
091: }
092:
093: return outValue;
094: }
095: //
096: //
097: //
098: //
099: //
100: //
101: //
102: }
|