001: // @@
002: // @@
003: /*
004: * Wi.Ser Framework
005: *
006: * Version: 1.8.1, 20-September-2007
007: * Copyright (C) 2005 Dirk von der Weiden <dvdw@imail.de>
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library located in LGPL.txt in the
021: * license directory; if not, write to the
022: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
023: * Boston, MA 02111-1307, USA.
024: *
025: * If this agreement does not cover your requirements, please contact us
026: * via email to get detailed information about the commercial license
027: * or our service offerings!
028: *
029: */
030: // @@
031: package de.ug2t.unifiedGui;
032:
033: import java.io.*;
034: import java.util.*;
035: import java.util.Map;
036:
037: import javax.swing.text.html.*;
038:
039: import org.xml.sax.*;
040: import org.xml.sax.helpers.*;
041:
042: import de.ug2t.channel.ho.*;
043: import de.ug2t.channel.ho.server.generic.*;
044: import de.ug2t.channel.ho.session.*;
045: import de.ug2t.channel.markup.generic.*;
046: import de.ug2t.kernel.*;
047: import de.ug2t.model.values.*;
048: import de.ug2t.unifiedGui.interfaces.*;
049: import de.ug2t.unifiedGui.plugins.*;
050: import de.ug2t.unifiedGui.scripting.*;
051:
052: public final class UnApplFactSAXHandler extends DefaultHandler {
053: protected IMoValue pdm_actMValue = null;
054: protected KeTreeElement pdm_act = null;
055: protected final Stack pdm_elements = new Stack();
056: protected final Stack pdm_names = new Stack();
057: protected final Stack pdm_feStack = new Stack();
058: protected final Stack pdm_allNameStack = new Stack();
059: protected final Stack pdm_sourceStack = new Stack();
060: protected int pdm_AppType = UnComponentFactory.MARKUP;
061: protected boolean pdm_mixed = false;
062: protected IUnApplication pdm_appl = null;
063: protected IUnPage pdm_page = null;
064: protected String pdm_name = null;
065: protected UnComponentFactory pdm_objFact = null;
066:
067: protected int pdm_optionNr = 0;
068: protected int pdm_optionFalseNr = 0;
069:
070: protected boolean pdm_optional = true;
071: protected final Map pdm_forEachs = new LinkedHashMap();
072: static final private Map pem_producers = new HashMap();
073: private boolean pem_terminateOnError = true;
074: protected UnApplicationFactory pdm_myProducer = null;
075:
076: public KeTreeElement pcmf_getActNode() {
077: return (this .pdm_act);
078: }
079:
080: public String pcmf_getActName() {
081: return (this .pdm_name);
082: }
083:
084: public IUnPage pcmf_getPage() {
085: return (this .pdm_page);
086: }
087:
088: static {
089: UnApplFactSAXHandler.pcmf_addProducer("application",
090: new de.ug2t.unifiedGui.UnXMLTAGapp());
091: UnApplFactSAXHandler.pcmf_addProducer("button",
092: new de.ug2t.unifiedGui.UnXMLTAGbut());
093: UnApplFactSAXHandler.pcmf_addProducer("optDlg",
094: new de.ug2t.unifiedGui.UnXMLTAGoptDlg());
095: UnApplFactSAXHandler.pcmf_addProducer("link",
096: new de.ug2t.unifiedGui.UnXMLTAGlink());
097: UnApplFactSAXHandler.pcmf_addProducer("roLink",
098: new de.ug2t.unifiedGui.UnXMLTAGroLink());
099:
100: UnApplFactSAXHandler.pcmf_addProducer("html",
101: new de.ug2t.unifiedGui.UnXMLTAGhtml());
102:
103: UnApplFactSAXHandler.pcmf_addProducer("tplSec",
104: new de.ug2t.unifiedGui.UnXMLTAGhtmlTplSec());
105: UnApplFactSAXHandler.pcmf_addProducer("renderCache",
106: new de.ug2t.unifiedGui.UnXMLTAGrenderCache());
107:
108: UnApplFactSAXHandler.pcmf_addProducer("inputField",
109: new de.ug2t.unifiedGui.UnXMLTAGinpField());
110: UnApplFactSAXHandler.pcmf_addProducer("input",
111: new de.ug2t.unifiedGui.UnXMLTAGinpField());
112:
113: UnApplFactSAXHandler.pcmf_addProducer("page",
114: new de.ug2t.unifiedGui.UnXMLTAGpage());
115:
116: UnApplFactSAXHandler.pcmf_addProducer("htmlPage",
117: new de.ug2t.unifiedGui.UnXMLTAGhtmlPage());
118: UnApplFactSAXHandler.pcmf_addProducer("htmlForm",
119: new de.ug2t.unifiedGui.UnXMLTAGhtmlForm());
120: UnApplFactSAXHandler.pcmf_addProducer("htmlLink",
121: new de.ug2t.unifiedGui.UnXMLTAGhtmlLink());
122: UnApplFactSAXHandler.pcmf_addProducer("htmlhbox",
123: new de.ug2t.unifiedGui.UnXMLTAGhtmlHBox());
124: UnApplFactSAXHandler.pcmf_addProducer("htmlvbox",
125: new de.ug2t.unifiedGui.UnXMLTAGhtmlVBox());
126: UnApplFactSAXHandler.pcmf_addProducer("htmlbox",
127: new de.ug2t.unifiedGui.UnXMLTAGhtmlBox());
128: UnApplFactSAXHandler.pcmf_addProducer("htmlButton",
129: new de.ug2t.unifiedGui.UnXMLTAGhtmlButton());
130: UnApplFactSAXHandler.pcmf_addProducer("htmlGui",
131: new de.ug2t.unifiedGui.UnXMLTAGhtmlGui());
132: UnApplFactSAXHandler.pcmf_addProducer("htmlTabPane",
133: new de.ug2t.unifiedGui.UnXMLTAGhtmlTabPane());
134: UnApplFactSAXHandler.pcmf_addProducer("htmlSplitPane",
135: new de.ug2t.unifiedGui.UnXMLTAGhtmlSplitPane());
136:
137: UnApplFactSAXHandler.pcmf_addProducer("pageTpl",
138: new de.ug2t.unifiedGui.UnXMLTAGpageTempl());
139:
140: UnApplFactSAXHandler.pcmf_addProducer("swingGrid",
141: new de.ug2t.unifiedGui.UnXMLTAGsetGrid());
142: UnApplFactSAXHandler.pcmf_addProducer("swingFill",
143: new de.ug2t.unifiedGui.UnXMLTAGsetSwingFill());
144: UnApplFactSAXHandler.pcmf_addProducer("swingPos",
145: new de.ug2t.unifiedGui.UnXMLTAGsetPosSwing());
146: UnApplFactSAXHandler.pcmf_addProducer("swingLayout",
147: new de.ug2t.unifiedGui.UnXMLTAGsetSwingLayout());
148: UnApplFactSAXHandler.pcmf_addProducer("swingWeights",
149: new de.ug2t.unifiedGui.UnXMLTAGsetSwingWeights());
150: UnApplFactSAXHandler.pcmf_addProducer("swingInsets",
151: new de.ug2t.unifiedGui.UnXMLTAGsetSwingInsets());
152: UnApplFactSAXHandler.pcmf_addProducer("weights",
153: new de.ug2t.unifiedGui.UnXMLTAGsetWeights());
154: UnApplFactSAXHandler.pcmf_addProducer("fill",
155: new de.ug2t.unifiedGui.UnXMLTAGsetFill());
156: UnApplFactSAXHandler.pcmf_addProducer("fixedSize",
157: new de.ug2t.unifiedGui.UnXMLTAGsetFSize());
158: UnApplFactSAXHandler.pcmf_addProducer("swingPSize",
159: new de.ug2t.unifiedGui.UnXMLTAGsetPSizeSwing());
160: UnApplFactSAXHandler.pcmf_addProducer("logWriter",
161: new de.ug2t.unifiedGui.UnXMLTAGsetLog());
162:
163: UnApplFactSAXHandler.pcmf_addProducer("insets",
164: new de.ug2t.unifiedGui.UnXMLTAGsetInsets());
165: UnApplFactSAXHandler.pcmf_addProducer("position",
166: new de.ug2t.unifiedGui.UnXMLTAGsetPos());
167: UnApplFactSAXHandler.pcmf_addProducer("font",
168: new de.ug2t.unifiedGui.UnXMLTAGsetFont());
169: UnApplFactSAXHandler.pcmf_addProducer("disable",
170: new de.ug2t.unifiedGui.UnXMLTAGdisable());
171: UnApplFactSAXHandler.pcmf_addProducer("java",
172: new de.ug2t.unifiedGui.UnXMLTAGjava());
173: UnApplFactSAXHandler.pcmf_addProducer("preFunction",
174: new de.ug2t.unifiedGui.UnXMLTAGpreFct());
175: UnApplFactSAXHandler.pcmf_addProducer("postFunction",
176: new de.ug2t.unifiedGui.UnXMLTAGpostFct());
177: UnApplFactSAXHandler.pcmf_addProducer("hide",
178: new de.ug2t.unifiedGui.UnXMLTAGhide());
179: UnApplFactSAXHandler.pcmf_addProducer("hideAll",
180: new de.ug2t.unifiedGui.UnXMLTAGhideall());
181: UnApplFactSAXHandler.pcmf_addProducer("onValueSetRepaint",
182: new de.ug2t.unifiedGui.UnXMLTAGrpons());
183: UnApplFactSAXHandler.pcmf_addProducer("generalRepaint",
184: new de.ug2t.unifiedGui.UnXMLTAGrpg());
185: UnApplFactSAXHandler.pcmf_addProducer("readOnly",
186: new de.ug2t.unifiedGui.UnXMLTAGreadonly());
187: UnApplFactSAXHandler.pcmf_addProducer("autoEcho",
188: new de.ug2t.unifiedGui.UnXMLTAGautoEcho());
189: UnApplFactSAXHandler.pcmf_addProducer("eventLatency",
190: new de.ug2t.unifiedGui.UnXMLTAGeventlatency());
191: UnApplFactSAXHandler.pcmf_addProducer("focus",
192: new de.ug2t.unifiedGui.UnXMLTAGfocus());
193: UnApplFactSAXHandler.pcmf_addProducer("view",
194: new de.ug2t.unifiedGui.UnXMLTAGsetView());
195: UnApplFactSAXHandler.pcmf_addProducer("span",
196: new de.ug2t.unifiedGui.UnXMLTAGsetSpan());
197: UnApplFactSAXHandler.pcmf_addProducer("extCss",
198: new de.ug2t.unifiedGui.UnXMLTAGsetExtCss());
199: UnApplFactSAXHandler.pcmf_addProducer("autoDelete",
200: new de.ug2t.unifiedGui.UnXMLTAGsetAutoDelete());
201: UnApplFactSAXHandler.pcmf_addProducer("htmlPos",
202: new de.ug2t.unifiedGui.UnXMLTAGsetPos());
203: UnApplFactSAXHandler.pcmf_addProducer("htmlLOM",
204: new de.ug2t.unifiedGui.UnXMLTAGsetHtmlLOM());
205: UnApplFactSAXHandler.pcmf_addProducer("container",
206: new de.ug2t.unifiedGui.UnXMLTAGcontainer());
207: UnApplFactSAXHandler.pcmf_addProducer("addProd",
208: new de.ug2t.unifiedGui.UnXMLTAGaddProd());
209: UnApplFactSAXHandler.pcmf_addProducer("addInfo",
210: new de.ug2t.unifiedGui.UnXMLTAGaddInfo());
211: UnApplFactSAXHandler.pcmf_addProducer("srvListener",
212: new de.ug2t.unifiedGui.UnXMLTAGsrvListener());
213: UnApplFactSAXHandler.pcmf_addProducer("mapListener",
214: new de.ug2t.unifiedGui.UnXMLTAGmapListener());
215: UnApplFactSAXHandler.pcmf_addProducer("pcListener",
216: new de.ug2t.unifiedGui.UnXMLTAGpcListener());
217: UnApplFactSAXHandler.pcmf_addProducer("srvStmtListener",
218: new de.ug2t.unifiedGui.UnXMLTAGsrvListenerStmt());
219: UnApplFactSAXHandler.pcmf_addProducer("navigationErrorHandler",
220: new de.ug2t.unifiedGui.UnXMLTAGnavHdl());
221: UnApplFactSAXHandler.pcmf_addProducer("eventChannel",
222: new de.ug2t.unifiedGui.UnXMLTAGevChannel());
223: UnApplFactSAXHandler.pcmf_addProducer("eventOnChange",
224: new de.ug2t.unifiedGui.UnXMLTAGevOc());
225: UnApplFactSAXHandler.pcmf_addProducer("eventPrio",
226: new de.ug2t.unifiedGui.UnXMLTAGevPrio());
227: UnApplFactSAXHandler.pcmf_addProducer("submitEvent",
228: new de.ug2t.unifiedGui.UnXMLTAGsubmit());
229: UnApplFactSAXHandler.pcmf_addProducer("sync",
230: new de.ug2t.unifiedGui.UnXMLTAGsync());
231: UnApplFactSAXHandler.pcmf_addProducer("xScript",
232: new de.ug2t.unifiedGui.UnXMLTAGxScript());
233: UnApplFactSAXHandler.pcmf_addProducer("script",
234: new de.ug2t.unifiedGui.UnXMLTAGscripting());
235: UnApplFactSAXHandler.pcmf_addProducer("inlinePlugin",
236: new de.ug2t.unifiedGui.UnXMLTAGinlinePlugin());
237: UnApplFactSAXHandler.pcmf_addProducer("label",
238: new de.ug2t.unifiedGui.UnXMLTAGtext());
239: UnApplFactSAXHandler.pcmf_addProducer("aPopup",
240: new de.ug2t.unifiedGui.UnXMLTAGaPopup());
241: UnApplFactSAXHandler.pcmf_addProducer("htmlAPopup",
242: new de.ug2t.unifiedGui.UnXMLTAGhtmlaPopup());
243: UnApplFactSAXHandler.pcmf_addProducer("progressBar",
244: new de.ug2t.unifiedGui.UnXMLTAGprogressBar());
245: UnApplFactSAXHandler.pcmf_addProducer("hbox",
246: new de.ug2t.unifiedGui.UnXMLTAGHBox());
247: UnApplFactSAXHandler.pcmf_addProducer("vbox",
248: new de.ug2t.unifiedGui.UnXMLTAGVBox());
249: UnApplFactSAXHandler.pcmf_addProducer("box",
250: new de.ug2t.unifiedGui.UnXMLTAGBox());
251: UnApplFactSAXHandler.pcmf_addProducer("flex",
252: new de.ug2t.unifiedGui.UnXMLTAGFlex());
253: UnApplFactSAXHandler.pcmf_addProducer("hidden",
254: new de.ug2t.unifiedGui.UnXMLTAGhidden());
255: UnApplFactSAXHandler.pcmf_addProducer("filler",
256: new de.ug2t.unifiedGui.UnXMLTAGfiller());
257: UnApplFactSAXHandler.pcmf_addProducer("line",
258: new de.ug2t.unifiedGui.UnXMLTAGline());
259: UnApplFactSAXHandler.pcmf_addProducer("spinner",
260: new de.ug2t.unifiedGui.UnXMLTAGspinner());
261: UnApplFactSAXHandler.pcmf_addProducer("comboBox",
262: new de.ug2t.unifiedGui.UnXMLTAGcomboBox());
263: UnApplFactSAXHandler.pcmf_addProducer("checkBox",
264: new de.ug2t.unifiedGui.UnXMLTAGCB());
265: UnApplFactSAXHandler.pcmf_addProducer("drawPane",
266: new de.ug2t.unifiedGui.UnXMLTAGdrawPane());
267: UnApplFactSAXHandler.pcmf_addProducer("snapShot",
268: new de.ug2t.unifiedGui.UnXMLTAGssWidget());
269: UnApplFactSAXHandler.pcmf_addProducer("splitPane",
270: new de.ug2t.unifiedGui.UnXMLTAGsplitPane());
271: UnApplFactSAXHandler.pcmf_addProducer("slider",
272: new de.ug2t.unifiedGui.UnXMLTAGslider());
273: UnApplFactSAXHandler.pcmf_addProducer("plugin",
274: new de.ug2t.unifiedGui.UnXMLTAGplugin());
275: UnApplFactSAXHandler.pcmf_addProducer("pluginObj",
276: new de.ug2t.unifiedGui.UnXMLTAGpluginObj());
277: UnApplFactSAXHandler
278: .pcmf_addProducer(
279: "pluginObjRef",
280: new de.ug2t.unifiedGui.UnXMLTAGpluginComponentReference());
281: UnApplFactSAXHandler.pcmf_addProducer("cursor",
282: new de.ug2t.unifiedGui.UnXMLTAGcursor());
283:
284: UnApplFactSAXHandler.pcmf_addProducer("entry",
285: new de.ug2t.unifiedGui.UnXMLTAGentry());
286: UnApplFactSAXHandler.pcmf_addProducer("item",
287: new de.ug2t.unifiedGui.UnXMLTAGentry());
288:
289: UnApplFactSAXHandler.pcmf_addProducer("icon",
290: new de.ug2t.unifiedGui.UnXMLTAGicon());
291:
292: UnApplFactSAXHandler.pcmf_addProducer("htmlColorSchema",
293: new de.ug2t.unifiedGui.UnXMLTAGhtmlColorSchema());
294:
295: UnApplFactSAXHandler.pcmf_addProducer("objRef",
296: new de.ug2t.unifiedGui.UnXMLTAGref());
297: UnApplFactSAXHandler.pcmf_addProducer("refObj",
298: new de.ug2t.unifiedGui.UnXMLTAGrefObj());
299: UnApplFactSAXHandler.pcmf_addProducer("radio",
300: new de.ug2t.unifiedGui.UnXMLTAGradio());
301: UnApplFactSAXHandler.pcmf_addProducer("singleRadio",
302: new de.ug2t.unifiedGui.UnXMLTAGsingleRadio());
303: UnApplFactSAXHandler.pcmf_addProducer("textBox",
304: new de.ug2t.unifiedGui.UnXMLTAGtextBox());
305: UnApplFactSAXHandler.pcmf_addProducer("editor",
306: new de.ug2t.unifiedGui.UnXMLTAGeditor());
307: UnApplFactSAXHandler.pcmf_addProducer("listBox",
308: new de.ug2t.unifiedGui.UnXMLTAGlistBox());
309: UnApplFactSAXHandler.pcmf_addProducer("table",
310: new de.ug2t.unifiedGui.UnXMLTAGtable());
311: UnApplFactSAXHandler.pcmf_addProducer("tree",
312: new de.ug2t.unifiedGui.UnXMLTAGtreeView());
313: UnApplFactSAXHandler.pcmf_addProducer("menu",
314: new de.ug2t.unifiedGui.UnXMLTAGmenu());
315: UnApplFactSAXHandler.pcmf_addProducer("ctxMenu",
316: new de.ug2t.unifiedGui.UnXMLTAGctxMenu());
317: UnApplFactSAXHandler.pcmf_addProducer("border",
318: new de.ug2t.unifiedGui.UnXMLTAGborder());
319: UnApplFactSAXHandler.pcmf_addProducer("toolTip",
320: new de.ug2t.unifiedGui.UnXMLTAGtip());
321: UnApplFactSAXHandler.pcmf_addProducer("color",
322: new de.ug2t.unifiedGui.UnXMLTAGcolor());
323: UnApplFactSAXHandler.pcmf_addProducer("image",
324: new de.ug2t.unifiedGui.UnXMLTAGimage());
325: UnApplFactSAXHandler.pcmf_addProducer("bgimage",
326: new de.ug2t.unifiedGui.UnXMLTAGbgimage());
327: UnApplFactSAXHandler.pcmf_addProducer("wdgBorder",
328: new de.ug2t.unifiedGui.UnXMLTAGwdgBorder());
329: UnApplFactSAXHandler.pcmf_addProducer("tabIdx",
330: new de.ug2t.unifiedGui.UnXMLTAGtabIdx());
331: UnApplFactSAXHandler.pcmf_addProducer("cssClass",
332: new de.ug2t.unifiedGui.UnXMLTAGcssClass());
333: UnApplFactSAXHandler.pcmf_addProducer("takeMaxSpace",
334: new de.ug2t.unifiedGui.UnXMLTAGtakeMax());
335: UnApplFactSAXHandler.pcmf_addProducer("commonLayout",
336: new de.ug2t.unifiedGui.UnXMLTAGlayout());
337: UnApplFactSAXHandler.pcmf_addProducer("form",
338: new de.ug2t.unifiedGui.UnXMLTAGform());
339: UnApplFactSAXHandler.pcmf_addProducer("htmlText",
340: new de.ug2t.unifiedGui.UnXMLTAGhtmlPane());
341: UnApplFactSAXHandler.pcmf_addProducer("tabPane",
342: new de.ug2t.unifiedGui.UnXMLTAGtabPane());
343: UnApplFactSAXHandler.pcmf_addProducer("setTab",
344: new de.ug2t.unifiedGui.UnXMLTAGsetTab());
345: UnApplFactSAXHandler.pcmf_addProducer("fileChooser",
346: new de.ug2t.unifiedGui.UnXMLTAGfileChooser());
347: UnApplFactSAXHandler.pcmf_addProducer("dialog",
348: new de.ug2t.unifiedGui.UnXMLTAGdialog());
349: UnApplFactSAXHandler.pcmf_addProducer("include",
350: new de.ug2t.unifiedGui.UnXMLTAGinclude());
351: UnApplFactSAXHandler.pcmf_addProducer("default",
352: new de.ug2t.unifiedGui.UnXMLTAGsetDefault());
353: UnApplFactSAXHandler.pcmf_addProducer("value",
354: new de.ug2t.unifiedGui.UnXMLTAGsetValue());
355: UnApplFactSAXHandler.pcmf_addProducer("pluginLocal",
356: new de.ug2t.unifiedGui.UnXMLTAGsetPlLocal());
357: UnApplFactSAXHandler.pcmf_addProducer("deleteColors",
358: new de.ug2t.unifiedGui.UnXMLTAGdeleteColorSettings());
359: UnApplFactSAXHandler.pcmf_addProducer("toolBox",
360: new de.ug2t.unifiedGui.UnXMLTAGtoolBox());
361: UnApplFactSAXHandler.pcmf_addProducer("option",
362: new de.ug2t.unifiedGui.UnXMLTAGsetOption());
363: UnApplFactSAXHandler.pcmf_addProducer("forEach",
364: new de.ug2t.unifiedGui.UnXMLTAGsetForEach());
365: UnApplFactSAXHandler.pcmf_addProducer("comment",
366: new de.ug2t.unifiedGui.UnXMLTAGcomment());
367: UnApplFactSAXHandler.pcmf_addProducer("dataCallback",
368: new de.ug2t.unifiedGui.UnXMLTAGCallBack());
369:
370: UnApplFactSAXHandler.pcmf_addProducer("metaModel",
371: new de.ug2t.unifiedGui.UnXMLTAGmodelTpl());
372: UnApplFactSAXHandler.pcmf_addProducer("model",
373: new de.ug2t.unifiedGui.UnXMLTAGmodel());
374: UnApplFactSAXHandler.pcmf_addProducer("singleValue",
375: new de.ug2t.unifiedGui.UnXMLTAGsingleValue());
376: UnApplFactSAXHandler.pcmf_addProducer("stdSingleValue",
377: new de.ug2t.unifiedGui.UnXMLTAGstdSingleValue());
378: UnApplFactSAXHandler.pcmf_addProducer("modelValRef",
379: new de.ug2t.unifiedGui.UnXMLTAGvalueReference());
380: UnApplFactSAXHandler.pcmf_addProducer("modelValRtRef",
381: new de.ug2t.unifiedGui.UnXMLTAGvalueRtReference());
382: UnApplFactSAXHandler.pcmf_addProducer("multipleValue",
383: new de.ug2t.unifiedGui.UnXMLTAGmultipleValue());
384: UnApplFactSAXHandler.pcmf_addProducer("transformer",
385: new de.ug2t.unifiedGui.UnXMLTAGtransformer());
386: UnApplFactSAXHandler.pcmf_addProducer("observer",
387: new de.ug2t.unifiedGui.UnXMLTAGobserver());
388: UnApplFactSAXHandler.pcmf_addProducer("validator",
389: new de.ug2t.unifiedGui.UnXMLTAGvalidator());
390: UnApplFactSAXHandler.pcmf_addProducer("uiMap",
391: new de.ug2t.unifiedGui.UnXMLTAGuiMap());
392: UnApplFactSAXHandler.pcmf_addProducer("uiErrorGW",
393: new de.ug2t.unifiedGui.UnXMLTAGuiErrorGW());
394: UnApplFactSAXHandler.pcmf_addProducer("HoTcpIpSessionReader",
395: new de.ug2t.unifiedGui.UnXMLTAGreader());
396: UnApplFactSAXHandler.pcmf_addProducer("writer",
397: new de.ug2t.unifiedGui.UnXMLTAGwriter());
398:
399: UnApplFactSAXHandler.pcmf_addProducer("appInit",
400: new de.ug2t.unifiedGui.UnXMLTAGappInit());
401: UnApplFactSAXHandler.pcmf_addProducer("active",
402: new de.ug2t.unifiedGui.UnXMLTAGactive());
403: UnApplFactSAXHandler.pcmf_addProducer("maximize",
404: new de.ug2t.unifiedGui.UnXMLTAGmaximize());
405: UnApplFactSAXHandler.pcmf_addProducer("registerGlobal",
406: new de.ug2t.unifiedGui.UnXMLTAGregisterGlobal());
407: UnApplFactSAXHandler.pcmf_addProducer("registerValue",
408: new de.ug2t.unifiedGui.UnXMLTAGregisterValue());
409: UnApplFactSAXHandler.pcmf_addProducer("unregisterValue",
410: new de.ug2t.unifiedGui.UnXMLTAGunregisterValue());
411: UnApplFactSAXHandler.pcmf_addProducer("key",
412: new de.ug2t.unifiedGui.UnXMLTAGkey());
413:
414: UnApplFactSAXHandler.pcmf_addProducer("uiSqlMap",
415: new de.ug2t.unifiedGui.UnXMLTAGsqlTableMapUI());
416: UnApplFactSAXHandler.pcmf_addProducer("sqlModelMap",
417: new de.ug2t.unifiedGui.UnXMLTAGsqlTableMapModel());
418:
419: UnApplFactSAXHandler.pcmf_addProducer("sqlTable",
420: new de.ug2t.unifiedGui.UnXMLTAGsqlTable());
421: UnApplFactSAXHandler.pcmf_addProducer("sqlTableJoin",
422: new de.ug2t.unifiedGui.UnXMLTAGsqlTableJoin());
423: UnApplFactSAXHandler.pcmf_addProducer("sqlObjectMap",
424: new de.ug2t.unifiedGui.UnXMLTAGsqlUiMap());
425: UnApplFactSAXHandler.pcmf_addProducer("sqlTableUiMap",
426: new de.ug2t.unifiedGui.UnXMLTAGsqlTableUiMap());
427:
428: UnApplFactSAXHandler.pcmf_addProducer("listLoader",
429: new de.ug2t.unifiedGui.UnXMLTAGlistLoader());
430: UnApplFactSAXHandler.pcmf_addProducer("treeViewLoader",
431: new de.ug2t.unifiedGui.UnXMLTAGtreeLoader());
432: UnApplFactSAXHandler.pcmf_addProducer("tableLoader",
433: new de.ug2t.unifiedGui.UnXMLTAGtableLoader());
434:
435: // Internal Use
436: UnApplFactSAXHandler.pcmf_addProducer("INT_SCF",
437: new de.ug2t.unifiedGui.UnXMLTAGsetCurrentFile());
438: };
439:
440: public final void pcmf_init(int xApplType,
441: UnComponentFactory xObjFact, UnApplicationFactory xProd) {
442: if (xApplType == UnComponentFactory.MIXED) {
443: this .pdm_mixed = true;
444: xApplType = UnComponentFactory.HALFOBJECT;
445: } else
446: this .pdm_mixed = false;
447:
448: this .pdm_AppType = xApplType;
449: this .pdm_objFact = xObjFact;
450: this .pdm_myProducer = xProd;
451:
452: return;
453: };
454:
455: public final void pcmf_init(UnComponentFactory xObjFact,
456: IUnApplication xAppl, KeTreeNode xRoot,
457: UnApplicationFactory xProd) {
458: if (xAppl instanceof MuGenericApplication)
459: this .pdm_AppType = UnComponentFactory.MARKUP;
460: else
461: this .pdm_AppType = UnComponentFactory.HALFOBJECT;
462:
463: this .pdm_mixed = false;
464: this .pdm_objFact = xObjFact;
465:
466: // Aktuelles Item setzen
467: pdm_act = xRoot;
468: pdm_name = xRoot.pcmf_getName();
469: pdm_appl = xAppl;
470: this .pdm_myProducer = xProd;
471:
472: return;
473: };
474:
475: public final void pcmf_init(int xApplType,
476: UnComponentFactory xObjFact, IUnApplication xAppl,
477: KeTreeNode xRoot, UnApplicationFactory xProd) {
478: if (xApplType == UnComponentFactory.MIXED) {
479: this .pdm_mixed = true;
480: xApplType = UnComponentFactory.HALFOBJECT;
481: } else
482: this .pdm_mixed = false;
483:
484: this .pdm_AppType = xApplType;
485: this .pdm_objFact = xObjFact;
486:
487: // Aktuelles Item setzen
488: pdm_act = xRoot;
489: pdm_name = xRoot.pcmf_getName();
490: pdm_appl = xAppl;
491: this .pdm_myProducer = xProd;
492:
493: return;
494: };
495:
496: public final void pcmf_exit() {
497: pdm_actMValue = null;
498: pdm_act = null;
499: pdm_appl = null; // Aktuelle Appl
500: pdm_page = null; // Aktuelle Seite
501: pdm_name = null; // Aktueller Name
502: pdm_optionNr = 0;
503: pdm_optionFalseNr = 0;
504: pdm_optional = true;
505: pdm_forEachs.clear();
506:
507: pdm_elements.clear();
508: pdm_names.clear();
509: pdm_feStack.clear();
510: pdm_allNameStack.clear();
511: pdm_sourceStack.clear();
512: }
513:
514: public static final IUnSAXAppFactHandler pcmf_addProducer(
515: String xName, IUnSAXAppFactHandler xProd) {
516: return ((IUnSAXAppFactHandler) pem_producers.put(xName, xProd));
517: };
518:
519: public final void pcmf_doExecStack(Object xIf, Object xObj,
520: String xName) {
521: // Aktuelles Item setzen
522: if (xObj instanceof IMoValue)
523: this .pdm_actMValue = (IMoValue) xObj;
524: else if (xObj instanceof KeTreeElement)
525: pdm_act = (KeTreeElement) xObj;
526: else
527: KeLog.pcmf_log(this .pdm_appl.pcmf_getUnComponent()
528: .toString(), "no valid type on parsing-stack: "
529: + xObj.getClass().toString(), this , KeLog.FATAL);
530:
531: pdm_elements.push(xIf);
532: // Aktuellen Namen setzen
533: pdm_name = xName;
534: pdm_names.push(xName);
535:
536: return;
537: };
538:
539: public final void startElementFromCache(String uri,
540: String localName, String qName, Attributes attributes,
541: IUnSAXAppFactHandler handler, UnApplFactSAXHandler xHdl)
542: throws Exception {
543: String l_name = KeTools.pcmf_deRef(attributes.getValue("name"));
544: if (l_name == null)
545: l_name = "";
546:
547: this .pdm_allNameStack.push(l_name);
548:
549: handler.pcmf_hdlSaxEvent(xHdl, qName, attributes);
550: }
551:
552: public final void startElement(String uri, String localName,
553: String qName, Attributes attributes) throws SAXException {
554: String l_name = KeTools.pcmf_deRef(attributes.getValue("name"));
555: if (l_name == null)
556: l_name = "";
557:
558: this .pdm_allNameStack.push(l_name);
559:
560: if (this .pdm_optional == false) {
561: if (qName.equals("option") || qName.equals("xScript"))
562: this .pdm_optionNr++;
563:
564: return;
565: }
566:
567: IUnSAXAppFactHandler l_prod = (IUnSAXAppFactHandler) UnApplFactSAXHandler.pem_producers
568: .get(qName);
569:
570: // @@
571:
572: try {
573: if (l_prod == null)
574: KeLog.pcmf_log("ug2t", "no such producer found: "
575: + qName, this , KeLog.ERROR);
576: else
577: l_prod.pcmf_hdlSaxEvent(this , qName, attributes);
578: } catch (Exception e) {
579: KeLog.pcmf_logException("ug2t", this , e);
580: String l_attributes = "";
581: for (int i = 0; i < attributes.getLength(); i++)
582: l_attributes += attributes.getQName(i) + "=\'"
583: + attributes.getValue(i) + "\' ";
584:
585: KeLog.pcmf_log("ug2t", "XML Error: [URI: " + uri
586: + "] [Tag: " + qName + "] [Attributes: + "
587: + l_attributes + "]", this , KeLog.FATAL);
588: IHoSession l_session = (IHoSession) KeRegisteredObject
589: .pcmf_getObjByName(IHoSession.SESSION_NAME);
590: if (this .pem_terminateOnError) {
591: if (this .pdm_appl != null) {
592: this .pdm_appl.pcmf_close();
593: if (l_session != null)
594: l_session.pcmf_commitTr();
595: } else {
596: if (l_session != null)
597: l_session.pcmf_kill();
598: }
599: }
600:
601: throw new SAXException(
602: "SAX parsing aborted! Application instance could not start");
603: }
604: ;
605:
606: return;
607: };
608:
609: // Store CDATA if enabled
610: private StringBuffer pem_cdata = null;
611:
612: protected void pdmf_startCDataRecording() {
613: this .pem_cdata = new StringBuffer();
614: }
615:
616: protected String pdmf_endCDataRecording() {
617: if (this .pem_cdata == null)
618: return ("");
619:
620: String l_ret = this .pem_cdata.toString();
621: this .pem_cdata = null;
622:
623: // @@
624:
625: return (l_ret);
626: }
627:
628: public void characters(char[] arg0, int arg1, int arg2)
629: throws SAXException {
630: if (this .pem_cdata != null)
631: this .pem_cdata.append(new String(arg0, arg1, arg2));
632: }
633:
634: public final void endElement(String uri, String localName,
635: String qName) throws SAXException {
636: String l_feStr = this .pdm_allNameStack.pop().toString();
637:
638: // @@
639:
640: if (qName.equals("option") || qName.equals("xScript")) {
641: if (this .pdm_optionFalseNr == this .pdm_optionNr) {
642: this .pdm_optional = true;
643: this .pdm_optionFalseNr = 0;
644: }
645: this .pdm_optionNr--;
646: } else if (qName.equals("html")) {
647: String l_html = this .pdmf_endCDataRecording();
648: if (this .pdm_act instanceof MuGenericRaw)
649: ((MuGenericRaw) this .pdm_act).pcmf_setValue(l_html);
650: } else if (qName.equals("htmlForm") || qName.equals("htmlPage")) {
651: try {
652: String l_html = this .pdmf_endCDataRecording();
653: if (!l_html.trim().equals("")) {
654: UnHtmlParserCallback l_cb = new UnHtmlParserCallback(
655: l_html, this , false);
656: HTMLEditorKit.Parser l_parser = new UnHtmlEditorKit()
657: .pcmf_getHtmlParser();
658: l_parser.parse(new StringReader(l_html), l_cb,
659: false);
660:
661: AttributesImpl l_attr = new AttributesImpl();
662: l_attr.addAttribute(null, null, "name", "",
663: this .pdm_name);
664: l_attr.addAttribute(null, null, "htmlTpl", "", l_cb
665: .pcmf_getHtmlTpl());
666: l_attr.addAttribute(null, null, "orphan", "",
667: "true");
668: l_attr.addAttribute(null, null, "asLayoutManager",
669: "", "true");
670: l_attr.addAttribute(null, null, "handleVar", "",
671: "true");
672:
673: this .startElement("", "tplSec", "tplSec", l_attr);
674: this .endElement("", "tplSec", "tplSec");
675: }
676: } catch (Exception e) {
677: KeLog.pcmf_logException("ug2t", this , e);
678: KeLog.pcmf_log("ug2t",
679: "Exception during application-production (EndElement) [URI: "
680: + uri + "] [Tag: " + localName + "]",
681: this , KeLog.FATAL);
682: }
683: } else if (qName.equals("htmlText")) {
684: String l_html = this .pdmf_endCDataRecording();
685: if (this .pdm_act instanceof IUnHtmlPane)
686: ((IUnHtmlPane) this .pdm_act).pcmf_setHtmlString(l_html);
687: } else if (qName.equals("script")) {
688: String l_script = this .pdmf_endCDataRecording();
689: if (this .pdm_elements.peek() instanceof IUnScriptIntegrator) {
690: IUnScriptIntegrator l_scriptobj = (IUnScriptIntegrator) this .pdm_elements
691: .peek();
692: l_scriptobj.pcmf_setScript(l_script);
693: if (l_scriptobj.pcmf_getType().equals(
694: IUnScriptIntegrator.CALL)) {
695: this .pdm_elements.pop();
696: l_scriptobj.pcmf_execObj(this .pdm_elements.peek());
697: this .pdm_elements.push(l_scriptobj);
698: }
699: }
700: } else if (qName.equals("inlinePlugin")) {
701: String l_pl = this .pdmf_endCDataRecording();
702: if (this .pdm_elements.peek() instanceof String) {
703: String l_name = (String) this .pdm_names.peek();
704: String l_register = (String) this .pdm_elements.peek();
705: PlBasicComponentAggregat l_plug = this .pdm_objFact
706: .pcmf_createAggregatedInlinePlugin(l_name,
707: pdm_AppType, pcmf_getAppl(), l_pl);
708: l_plug.pcmf_reRegister(l_register);
709: }
710: }
711:
712: if (this .pdm_optional == false)
713: return;
714:
715: // @@
716:
717: if (qName.equals("forEach"))
718: this .pdm_forEachs.remove(this .pdm_feStack.pop());
719: else {
720: Iterator l_it = this .pdm_forEachs.keySet().iterator();
721: UnFEContainer l_fe = null;
722: while (l_it.hasNext()) {
723: UnFeDescriptor l_desc = (UnFeDescriptor) l_it.next();
724: if (l_desc.pcmf_getFEMode() == UnFeDescriptor.FE_DESC_NAME
725: && l_desc.pcmf_evaluateName(l_feStr)) {
726: l_fe = (UnFEContainer) this .pdm_forEachs
727: .get(l_desc);
728: l_fe.pcmf_doInclude(this );
729: continue;
730: } else if (l_desc.pcmf_getFEMode() == UnFeDescriptor.FE_DESC_TAG
731: && l_desc.pcmf_evaluateTag(qName)) {
732: l_fe = (UnFEContainer) this .pdm_forEachs
733: .get(l_desc);
734: l_fe.pcmf_doInclude(this );
735: continue;
736: }
737: }
738: }
739: ;
740:
741: // @@
742:
743: try {
744:
745: Object l_obj = this .pdm_elements.pop();
746:
747: if (this .pdm_AppType == UnComponentFactory.HALFOBJECT) {
748: // Font setzen
749: UnFontDescriptor l_font = this .pdm_appl
750: .pcmf_getUnComponent().pcmf_getFont();
751: if (l_font != null && this .pdm_elements.size() > 0
752: && l_obj != this .pdm_elements.peek()) {
753: if (l_obj instanceof UnComponent) {
754: UnComponent l_c = (UnComponent) l_obj;
755: if (l_c.pcmf_getAppl() != null
756: && l_c.pcmf_getFont() == null
757: && l_c.pcmf_getCssClass() == null)
758: l_c.pcmf_setFont(l_font);
759: }
760: }
761:
762: // @@
763: }
764:
765: if (qName.equals("INT_SCF"))
766: this .pdm_myProducer.pem_mySource = (InputSource) this .pdm_sourceStack
767: .pop();
768: else if (qName.equals("container")) {
769: KeTreeNode l_parent = ((KeTreeNode) l_obj)
770: .pcmf_getParentNode();
771: if (l_parent instanceof IUnTable)
772: ((IUnTable) l_parent)
773: .pcmf_addRow(((KeTreeNode) l_obj)
774: .pcmf_getAllSubs());
775: else if (l_parent instanceof IUnListComponent) {
776: Iterator l_myIt = ((KeTreeNode) l_obj)
777: .pcmf_getSubIterator();
778: KeTreeNode l_myObj = null;
779: while (l_myIt.hasNext()) {
780: l_myObj = (KeTreeNode) l_myIt.next();
781: ((IUnListComponent) l_parent).pcmf_addValueObj(
782: l_myObj.pcmf_getName(), l_myObj);
783: }
784: } else if (l_parent instanceof HoGenericTreeNode) {
785: ArrayList l_childs = new ArrayList(
786: ((KeTreeNode) l_obj).pcmf_getAllSubs());
787: Iterator l_myIt = l_childs.iterator();
788: KeTreeNode l_myObj = null;
789: l_parent.pcmf_removeNode(((KeTreeNode) l_obj));
790: if (l_childs.size() == 1) {
791: l_myObj = (KeTreeNode) l_myIt.next();
792: ((KeTreeNode) l_obj).pcmf_removeNode(l_myObj);
793: l_parent.pcmf_setValue("~"
794: + l_myObj.pcmf_getRemName());
795: l_myObj.pcmf_setEarlyAutoDelete(false);
796: } else {
797: while (l_myIt.hasNext()) {
798: l_myObj = (KeTreeNode) l_myIt.next();
799: ((KeTreeNode) l_obj)
800: .pcmf_removeNode(l_myObj);
801: l_parent.pcmf_addNode(l_myObj
802: .pcmf_getName(), l_myObj);
803: }
804: }
805: } else if (l_parent instanceof IUnSlider) {
806: Iterator l_myIt = ((KeTreeNode) l_obj)
807: .pcmf_getSubIterator();
808: KeTreeNode l_myObj = null;
809: while (l_myIt.hasNext()) {
810: l_myObj = (KeTreeNode) l_myIt.next();
811: ((IUnSlider) l_parent).pcmf_addValueItem(
812: l_myObj.pcmf_getName(), l_myObj);
813: }
814: }
815: }
816:
817: if (l_obj instanceof IUnTabbedPane)
818: ((IUnTabbedPane) l_obj).pcmf_commitTabs();
819: else if (l_obj instanceof IUnMenu)
820: ((IUnMenu) l_obj).pcmf_commitMenu();
821: else if (l_obj instanceof IUnTable)
822: ((IUnTable) l_obj).pcmf_commitTable();
823: else if (l_obj instanceof IUnTreeView)
824: ((IUnTreeView) l_obj).pcmf_getUnComponent()
825: .pcmf_repaint();
826: else if (l_obj instanceof IUnSlider)
827: ((IUnSlider) l_obj).pcmf_commitSlider();
828:
829: this .pdm_names.pop();
830: if (pdm_elements.size() != 0) {
831: Object l_act = this .pdm_elements.peek();
832: if (l_act instanceof IMoValue)
833: this .pdm_actMValue = (IMoValue) l_act;
834: else {
835: this .pdm_actMValue = null;
836: pdm_act = (KeTreeElement) l_act;
837: }
838:
839: pdm_name = (String) this .pdm_names.peek();
840: if (pdm_act instanceof de.ug2t.unifiedGui.interfaces.IUnPage)
841: this .pdm_page = (IUnPage) pdm_act;
842: } else {
843: pdm_act = null;
844: pdm_name = null;
845: }
846: ;
847: } catch (Exception e) {
848: KeLog.pcmf_logException("ug2t", this , e);
849: KeLog.pcmf_log("ug2t",
850: "Exception during application-production (EndElement) [URI: "
851: + uri + "] [Tag: " + localName + "]", this ,
852: KeLog.FATAL);
853: IHoSession l_session = (IHoSession) KeRegisteredObject
854: .pcmf_getObjByName(IHoSession.SESSION_NAME);
855:
856: if (this .pem_terminateOnError) {
857: if (this .pdm_appl != null) {
858: this .pdm_appl.pcmf_close();
859: if (l_session != null)
860: l_session.pcmf_commitTr();
861: } else {
862: if (l_session != null)
863: l_session.pcmf_kill();
864: }
865: }
866:
867: throw new SAXException(
868: "SAX parsing aborted! Application instance could not start");
869: }
870: ;
871:
872: return;
873: };
874:
875: public final IUnApplication pcmf_getAppl() {
876: return (pdm_appl);
877: };
878:
879: public void pcmf_setTerminateOnError(boolean xTerm) {
880: this.pem_terminateOnError = xTerm;
881: }
882: };
|