summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwbauer <wbauer@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-10-13 12:26:28 +0000
committerwbauer <wbauer@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-10-13 12:26:28 +0000
commitb45d01ce32c23539a4446be0cb1501f6be5cb2e8 (patch)
treeef5a9dba48e8a28721284847a2b4bb5ad0290ebd
parent8852be703a5cacaf271575ccee04bbe27612d16b (diff)
downloadmocca-b45d01ce32c23539a4446be0cb1501f6be5cb2e8.tar.gz
mocca-b45d01ce32c23539a4446be0cb1501f6be5cb2e8.tar.bz2
mocca-b45d01ce32c23539a4446be0cb1501f6be5cb2e8.zip
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@103 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java5
-rw-r--r--BKULocalApp/src/main/resources/at/gv/egiz/bku/local/defaultConf/template.zipbin23517 -> 24829 bytes
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/HashDataInputServlet.java42
3 files changed, 28 insertions, 19 deletions
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
index 08f22595..0bdff867 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
@@ -27,6 +27,9 @@ import javax.swing.WindowConstants;
import at.gv.egiz.bku.gui.BKUGUIFacade;
import at.gv.egiz.bku.gui.BKUGUIFactory;
import at.gv.egiz.bku.online.applet.BKUApplet;
+import at.gv.egiz.bku.online.applet.QuitHandler;
+import at.gv.egiz.bku.smccstal.AbstractSMCCSTAL;
+import at.gv.egiz.stal.QuitRequest;
import at.gv.egiz.stal.STAL;
import at.gv.egiz.stal.STALFactory;
@@ -36,6 +39,7 @@ public class SMCCSTALFactory implements STALFactory {
@Override
public STAL createSTAL() {
+ AbstractSMCCSTAL.addRequestHandler(QuitRequest.class, QuitHandler.getInstance());
SMCCSTAL stal;
JDialog dialog;
ResourceBundle resourceBundle;
@@ -51,6 +55,7 @@ public class SMCCSTALFactory implements STALFactory {
stal = new SMCCSTAL(new BKUGuiProxy(dialog, gui), dialog, resourceBundle);
dialog.setPreferredSize(new Dimension(400, 200));
dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
+ dialog.setTitle("MOCCA");
dialog.pack();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = dialog.getSize();
diff --git a/BKULocalApp/src/main/resources/at/gv/egiz/bku/local/defaultConf/template.zip b/BKULocalApp/src/main/resources/at/gv/egiz/bku/local/defaultConf/template.zip
index 8bdcbb0d..f14b0c19 100644
--- a/BKULocalApp/src/main/resources/at/gv/egiz/bku/local/defaultConf/template.zip
+++ b/BKULocalApp/src/main/resources/at/gv/egiz/bku/local/defaultConf/template.zip
Binary files differ
diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/HashDataInputServlet.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/HashDataInputServlet.java
index df338c4a..9844a2aa 100644
--- a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/HashDataInputServlet.java
+++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/HashDataInputServlet.java
@@ -70,31 +70,35 @@ public class HashDataInputServlet extends SpringBKUServlet {
}
List<HashDataInput> hdi = rb.getHashDataInput();
log.debug("Got hashdata list with " + hdi.size() + " entries");
- String param = req.getParameter("number");
+ String param = req.getParameter("refId");
+ log.debug("Got request for refId:" + param);
if ((param == null) && (hdi.size() > 1)) {
resp.sendRedirect("multiHashDataInput.html");
return;
}
- int num = 0;
- if (param != null) {
- log.debug("Got request for hashdata#" + num);
- num = Integer.parseInt(param);
+ if ((param == null) && (hdi.size() == 1)) {
+ param = hdi.get(0).getReferenceId();
+ log.debug("Request parameter not set, setting to: "+param);
}
- if ((hdi.size() <= num) || (num < 0)) {
- log.warn("Requested hashdatainput exceeds listsize");
- resp.sendError(-1);
- return;
- }
- resp.setCharacterEncoding(req.getCharacterEncoding());
- resp.setContentType(hdi.get(num).getMimeType());
- String charSet = req.getCharacterEncoding();
- if (charSet == null) {
- charSet = "UTF-8";
+ for (HashDataInput hd : hdi) {
+ if (hd.getReferenceId().equals(param)) {
+ log.debug("Found hashdatainput for refId:" + param);
+ resp.setCharacterEncoding(hd.getEncoding());
+ resp.setContentType(hd.getMimeType());
+ String charSet = hd.getEncoding();
+ if (charSet == null) {
+ charSet = "UTF-8";
+ }
+ Reader r = new InputStreamReader(hd.getHashDataInput(), charSet);
+ Writer w = new OutputStreamWriter(resp.getOutputStream(), charSet);
+ StreamUtil.copyStream(r, w);
+ w.close();
+ return;
+
+ }
}
- Reader r = new InputStreamReader(hdi.get(num).getHashDataInput(), charSet);
- Writer w = new OutputStreamWriter(resp.getOutputStream(), charSet);
- StreamUtil.copyStream(r, w);
- w.close();
+ log.error("Cannot find hashdata for id:" + param);
+ resp.sendError(404);
return;
}