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.ho;
032:
033: import java.io.*;
034: import java.util.*;
035:
036: import javax.swing.*;
037:
038: import de.ug2t.channel.ho.session.*;
039: import de.ug2t.kernel.*;
040: import de.ug2t.unifiedGui.interfaces.*;
041: import de.ug2t.xmlScript.*;
042:
043: public class HoRequest implements IHoRequest, Serializable {
044: private Map pem_submitValues = new HashMap();
045: private transient IHoSession pem_session = null;
046: private IUnApplication pem_appl = null;
047:
048: // @@
049:
050: public HoRequest(IHoSession xSession, IUnApplication xAppl) {
051: this .pem_session = xSession;
052: this .pem_appl = xAppl;
053: }
054:
055: /*
056: * (non-Javadoc)
057: *
058: * @see de.ug2t.channel.ho.session.IHoRequest#pcmf_setSubmitValue(java.lang.String,
059: * java.lang.String)
060: */
061: public synchronized Object pcmf_setSubmitValue(String xKey,
062: String xValue) {
063: return (this .pem_submitValues.put(xKey, xValue));
064: };
065:
066: /*
067: * (non-Javadoc)
068: *
069: * @see de.ug2t.channel.ho.session.IHoRequest#pcmf_clearSubmitValues()
070: */
071: public synchronized void pcmf_clearSubmitValues() {
072: this .pem_submitValues.clear();
073:
074: return;
075: };
076:
077: /*
078: * (non-Javadoc)
079: *
080: * @see de.ug2t.channel.ho.session.IHoRequest#pcmf_submit()
081: */
082: public synchronized void pcmf_submit() {
083: // @@
084:
085: Iterator l_it = this .pem_submitValues.keySet().iterator();
086: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
087: "");
088: Object l_key = null;
089: Object l_val = null;
090:
091: if (this .pem_session.pcmf_isAlive() == false) {
092: JOptionPane.showMessageDialog(null,
093: "Server connection lost! Client will be closed");
094: System.exit(-1);
095: }
096:
097: if (this .pem_session.pcmf_isInTransaction()) {
098: ScXmlScript.pcmf_createPBody(l_remCall);
099: } else {
100: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
101: ScXmlScript.pcmf_addProc(l_remCall, null);
102: }
103: ;
104:
105: Map l_values = this .pem_submitValues;
106:
107: String l_appl = KeRegisteredObject
108: .pcmf_getObjName(this .pem_appl);
109: if (l_appl == null)
110: l_appl = IUnApplication.MY_APPL;
111:
112: while (l_it.hasNext()) {
113: l_key = l_it.next();
114: l_val = l_values.get(l_key);
115: ScXmlScript.pcmf_addCall(l_remCall, null, l_appl,
116: "pcmf_setSubmitVal");
117: ScXmlScript.pcmf_addCallPar(l_remCall, (String) l_key,
118: "false", "java.lang.String");
119: ScXmlScript.pcmf_addCallPar(l_remCall, (String) l_val,
120: "false", "java.lang.String");
121: ScXmlScript.pcmf_endCallPar(l_remCall);
122: }
123: ;
124:
125: pcmf_clearSubmitValues();
126:
127: ScXmlScript.pcmf_addCall(l_remCall, null, l_appl, "pcmf_work");
128: ScXmlScript.pcmf_addCallPar(l_remCall, "null", "false",
129: "java.lang.Object");
130: ScXmlScript.pcmf_addCallPar(l_remCall, "null", "false",
131: "java.lang.Object");
132: ScXmlScript.pcmf_addCallPar(l_remCall, "true", "false",
133: "boolean");
134:
135: ScXmlScript.pcmf_endAll(l_remCall);
136:
137: this .pem_session.pcmf_call(l_remCall.toString(), null);
138:
139: if (this .pem_session.pcmf_isAlive() == false) {
140: JOptionPane.showMessageDialog(null,
141: "Server connection lost! Client will be closed");
142: System.exit(-1);
143: }
144: };
145:
146: public void pcmf_setInPlayBack(boolean xIn) {
147: // @@
148: }
149: }
|