001: // @@
002: // @@
003: /*
004: * Wi.Ser Framework
005: *
006: * LGPL Version: 1.8.1, 20-September-2007
007: * Copyright (C) 2005-2006 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.channel.markup.service;
032:
033: import javax.servlet.*;
034:
035: import de.ug2t.channel.markup.generic.*;
036: import de.ug2t.kernel.*;
037: import de.ug2t.unifiedGui.*;
038: import de.ug2t.xmlScript.*;
039:
040: abstract public class AMuProducer implements IKeProducer {
041: protected Object pdm_config = null;
042: protected String pdm_url = null;
043: protected int pdm_port = 8080;
044: protected String pdm_xScriptFile = null;
045: protected String pdm_appName = null;
046: protected ScXmlScript pdm_script = null;
047: protected String pdm_startProc = null;
048:
049: private UnApplicationFactory pem_prod = null;
050:
051: public AMuProducer(ServletConfig xConfig, UnApplicationFactory xProd)
052: throws Exception {
053: pdm_config = (Object) xConfig;
054: pem_prod = xProd;
055:
056: // manuell : ohne guiApplFactory
057: pdm_url = xConfig.getInitParameter("rootURL");
058:
059: String l_port = xConfig.getInitParameter("port");
060: if (l_port != null)
061: pdm_port = Integer.parseInt(l_port);
062:
063: pdm_xScriptFile = xConfig.getInitParameter("xScriptFile");
064: pdm_appName = xConfig.getInitParameter("appName");
065: pdm_startProc = xConfig.getInitParameter("startProc");
066:
067: if (pdm_startProc == null)
068: pdm_startProc = "webInit.xml";
069:
070: if (pdm_url == null)
071: pdm_url = "/StdWebUrl";
072:
073: // Debug
074: // System.out.println("============================");
075: // System.out.println(pem_url);
076: // System.out.println(pem_port);
077: // System.out.println(pem_xScriptFile);
078: // System.out.println(pem_appName);
079: // System.out.println(pem_startProc);
080: // System.out.println(pem_rootDir);
081: // System.out.println("============================");
082:
083: // Dies kann zu Problemen Führen, da die Methode nur mit Verzeichnissen,
084: // nicht aber innerhalb einer war-Fales funktioniert.
085: if (pdm_xScriptFile != null) {
086: KeLog.pcmf_log("ug2t", "loading xScript: "
087: + pdm_xScriptFile, this , KeLog.TRACE);
088: pdm_script = new ScXmlScript(pdm_xScriptFile);
089: }
090: ;
091:
092: return;
093: };
094:
095: public AMuProducer() {
096: pdm_config = null;
097:
098: return;
099: };
100:
101: public ServletConfig pcmf_getServletConfig() {
102: return ((ServletConfig) pdm_config);
103: };
104:
105: public Object pcmf_getConfig() {
106: return (pdm_config);
107: };
108:
109: public void pcmf_setConfig(Object xConfig) {
110: pdm_config = xConfig;
111: };
112:
113: public void pcmf_setServletConfig(ServletConfig xConfig) {
114: pdm_config = xConfig;
115: };
116:
117: public Object pcmf_produce(Object xParamter) throws Exception {
118: MuGenericApplication l_appl = null;
119:
120: if (pem_prod != null) {
121: l_appl = (MuGenericApplication) pem_prod
122: .pcmf_produce(new Integer(UnComponentFactory.MARKUP));
123: } else {
124: throw (new Exception("no configuration found"));
125: }
126: ;
127:
128: return (l_appl);
129: };
130: };
|