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.web.page.v1;
009:
010: //base classes
011: import java.io.IOException;
012: import java.math.BigDecimal;
013:
014: //project specific classes
015: import org.jfolder.common.StandardDataTypes;
016: import org.jfolder.common.function.BaseWebPageTag;
017: import org.jfolder.common.function.WebPageTagInstanceViewContext;
018: import org.jfolder.common.function.WebPageTagInstanceViewContextInfo;
019: import org.jfolder.common.tagging.AppraiseConceptTagContext;
020: import org.jfolder.common.tagging.ConceptTagCharacteristic;
021: import org.jfolder.common.tagging.ConceptTagConstraint;
022: import org.jfolder.common.tagging.ConceptTagConstraintHolder;
023: import org.jfolder.common.tagging.ConceptTagHelper;
024: import org.jfolder.common.tagging.DetermineClassConceptTagContext;
025: import org.jfolder.common.tagging.DetermineValueAndClassConceptTagContext;
026: import org.jfolder.common.tagging.DetermineValueAndClassConceptTagException;
027: import org.jfolder.common.tagging.DynamicConceptTagConstraintContext;
028: import org.jfolder.common.tagging.InitializeConceptTagContext;
029: import org.jfolder.common.tagging.ReturnableConceptTag;
030: import org.jfolder.common.tagging.SelectionCriteriaForReturnableConceptTag;
031: import org.jfolder.common.tagging.StaticConceptTagConstraintContext;
032: import org.jfolder.common.tagging.StudioConceptTagCreParInfoContext;
033: import org.jfolder.common.tagging.StudioConceptTagInstanceInfoContext;
034: import org.jfolder.common.tagging.StudioConceptTagTypeInfoContext;
035: import org.jfolder.common.tagging.ValueAndClassForConceptTag;
036: import org.jfolder.common.utils.xml.XMLHelper;
037:
038: //other classes
039:
040: public class TaglibComputeWithoutDisplayWebPageTag extends
041: BaseWebPageTag {
042:
043: //characteristics
044: private ConceptTagCharacteristic actionCtchar = null;
045:
046: //action details
047: public final static String ACTION_CTCON = "action";
048: private final static String ACTION_TITLE = "Action";
049: private final static String ACTION_SHORT_DESCRIPTION = "Action";
050:
051: public void initialize(InitializeConceptTagContext inIctc) {
052:
053: //
054: ConceptTagConstraintHolder rootCtconh = ConceptTagConstraintHolder
055: .newInstance(inIctc);
056: //
057:
058: //constrain "action"
059: ConceptTagConstraint actionCtcon = ConceptTagConstraint
060: .newInstance(ACTION_CTCON, rootCtconh);
061: actionCtcon.setTitle(ACTION_TITLE);
062: actionCtcon.setShortDescription(ACTION_SHORT_DESCRIPTION);
063: //
064: DynamicConceptTagConstraintContext actionDctcc = DynamicConceptTagConstraintContext
065: .newInstance(actionCtcon);
066: //
067:
068: inIctc.initialize();
069:
070: //initialize characteristics
071: this .actionCtchar = actionCtcon.getCharacteristic();
072:
073: }
074:
075: public void appraise(AppraiseConceptTagContext inActc) {
076:
077: if (inActc instanceof StudioConceptTagInstanceInfoContext) {
078:
079: StudioConceptTagInstanceInfoContext sctiic = (StudioConceptTagInstanceInfoContext) inActc;
080:
081: sctiic.setInstanceTitle("Compute Without Display");
082: sctiic.setInstanceDescription("Compute Without Display");
083: } else if (inActc instanceof StudioConceptTagTypeInfoContext) {
084:
085: StudioConceptTagTypeInfoContext scttic = (StudioConceptTagTypeInfoContext) inActc;
086:
087: scttic.setTypeTitle("Compute Without Display");
088: scttic.setTypeDescription("Compute Without Display");
089: } else if (inActc instanceof WebPageTagInstanceViewContext) {
090:
091: WebPageTagInstanceViewContext wptivc = (WebPageTagInstanceViewContext) inActc;
092: //
093: //WebPageTagInstanceViewContextInfo info = wptivc.getInfoAsHtml();
094: //info.setHtmlContent("CompWithoutRet - No Impl", true);
095: //
096: WebPageTagInstanceViewContextInfo info = wptivc
097: .getInfoAsIterativeNonHtml();
098: //
099: WebPageTagInstanceViewContextInfo subStartInfo[] = new WebPageTagInstanceViewContextInfo[1];
100: WebPageTagInstanceViewContextInfo subMiddleInfo[] = new WebPageTagInstanceViewContextInfo[1];
101: WebPageTagInstanceViewContextInfo subEndInfo[] = new WebPageTagInstanceViewContextInfo[1];
102: //
103: info.createIterativeSubParts(subStartInfo, subMiddleInfo,
104: subEndInfo);
105: //
106: //
107: (subStartInfo[0])
108: .setNonHtmlContent("compute the following actions, but do not display {");
109: //
110: WebPageTagInstanceViewContext.displayView(
111: this .actionCtchar, subMiddleInfo[0], wptivc);
112: //
113: if (this .actionCtchar.getValueLength() == 0) {
114: //
115: WebPageTagInstanceViewContextInfo emptyActionInfo = (subMiddleInfo[0])
116: .createNonHtmlInfo(ACTION_CTCON);
117: emptyActionInfo
118: .setNonHtmlContent("No Action - Click Here To Create");
119: }
120: //
121: (subEndInfo[0]).setNonHtmlContent("}");
122: //
123: //
124: /*
125: wptivc.appendContent("<table border=\"1\" align=\"center\">");
126: //
127: wptivc.appendContent("<tr>");
128: wptivc.appendContent("<td align=\"center\">"
129: + "Do the following but <u>don't</u> display</td>");
130: wptivc.appendContent("</tr>");
131: //
132: wptivc.appendContent("<tr>");
133: wptivc.appendContent("<td align=\"center\">");
134: WebPageTagInstanceViewContext.displayView(
135: this.actionCtchar, wptivc);
136: wptivc.appendContent("</td>");
137: wptivc.appendContent("</tr>");
138: //
139: wptivc.appendContent("</table>");
140: */
141: } else if (inActc instanceof SelectionCriteriaForReturnableConceptTag) {
142:
143: SelectionCriteriaForReturnableConceptTag scfrct = (SelectionCriteriaForReturnableConceptTag) inActc;
144:
145: scfrct.canReturnNothing();
146: scfrct.declareFormatAsHtml();
147: } else if (inActc instanceof StudioConceptTagCreParInfoContext) {
148:
149: StudioConceptTagCreParInfoContext scpc = (StudioConceptTagCreParInfoContext) inActc;
150: }
151: }
152:
153: public void determineValueAndClass(
154: DetermineValueAndClassConceptTagContext inDvacctc) {
155:
156: try {
157: this .actionCtchar.processIterativeStructure(inDvacctc,
158: false);
159: inDvacctc
160: .setDetermineValueAndClass(ValueAndClassForConceptTag
161: .newNothing());
162: } catch (DetermineValueAndClassConceptTagException dvaccte) {
163: inDvacctc.setDetermineException(dvaccte);
164: }
165: }
166:
167: public void determineClass(DetermineClassConceptTagContext inRcc) {
168: inRcc.setDetermineClass(StandardDataTypes.getNothingClass());
169: }
170: }
|