summaryrefslogtreecommitdiff
path: root/bindings/corba/java/src/org/crosswire
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/corba/java/src/org/crosswire')
-rw-r--r--bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java25
-rw-r--r--bindings/corba/java/src/org/crosswire/util/Base64.java22
-rw-r--r--bindings/corba/java/src/org/crosswire/web/i18n/ContextStart.java.notyet10
-rw-r--r--bindings/corba/java/src/org/crosswire/web/i18n/TranslateTag.java87
4 files changed, 35 insertions, 109 deletions
diff --git a/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java b/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java
index 3597b4b..d6987e9 100644
--- a/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java
+++ b/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
package org.crosswire.sword.orb;
import java.io.File;
@@ -28,7 +45,13 @@ public class SwordOrb extends Object implements HttpSessionBindingListener {
public static final String GENBOOKS = "Generic Books";
public static final String DAILYDEVOS = "Daily Devotional";
- static org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(new String[]{}, null);
+ static java.util.Properties p = new java.util.Properties();
+ static {
+ p.setProperty("com.sun.CORBA.codeset.charsets", "0x05010001, 0x00010109"); // UTF-8, UTF-16
+ p.setProperty("com.sun.CORBA.codeset.wcharsets", "0x00010109, 0x05010001"); // UTF-16, UTF-8
+ }
+
+ static org.omg.CORBA.ORB orb = org.omg.CORBA_2_3.ORB.init(new String[]{}, p);
static Hashtable clients = new Hashtable();
String ior = null;
String remoteAddr = null;
diff --git a/bindings/corba/java/src/org/crosswire/util/Base64.java b/bindings/corba/java/src/org/crosswire/util/Base64.java
index 984dc7b..a34401e 100644
--- a/bindings/corba/java/src/org/crosswire/util/Base64.java
+++ b/bindings/corba/java/src/org/crosswire/util/Base64.java
@@ -1,6 +1,17 @@
package org.crosswire.util;
/**
+ * <p>
+ * I am placing this code in the Public Domain. Do with it as you will.
+ * This software comes with no guarantees or warranties but with
+ * plenty of well-wishing instead!
+ * Please visit <a href="http://iharder.net/xmlizable">http://iharder.net/xmlizable</a>
+ * periodically to check for updates or to contribute improvements.
+ * </p>
+ *
+ * @author Robert Harder
+ * @author rob@iharder.net
+ * @version 1.3.4
* Changed last char from '/' to '-' because cookies can't use '/' so we're not really a BASE64
* standard encoder anymore
* Changed package name. --crosswire.
@@ -18,17 +29,6 @@ package org.crosswire.util;
* <li>v1.3.3 - Fixed I/O streams which were totally messed up.</li>
* </ul>
*
- * <p>
- * I am placing this code in the Public Domain. Do with it as you will.
- * This software comes with no guarantees or warranties but with
- * plenty of well-wishing instead!
- * Please visit <a href="http://iharder.net/xmlizable">http://iharder.net/xmlizable</a>
- * periodically to check for updates or to contribute improvements.
- * </p>
- *
- * @author Robert Harder
- * @author rob@iharder.net
- * @version 1.3.4
*/
public class Base64
{
diff --git a/bindings/corba/java/src/org/crosswire/web/i18n/ContextStart.java.notyet b/bindings/corba/java/src/org/crosswire/web/i18n/ContextStart.java.notyet
deleted file mode 100644
index f6823e2..0000000
--- a/bindings/corba/java/src/org/crosswire/web/i18n/ContextStart.java.notyet
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.crosswire.web.i18n;
-
-import javax.servlet.jsp.tagext.*;
-
-public class ContextStart extends TagSupport {
-
- public ContextStart() {
- }
-
-}
diff --git a/bindings/corba/java/src/org/crosswire/web/i18n/TranslateTag.java b/bindings/corba/java/src/org/crosswire/web/i18n/TranslateTag.java
deleted file mode 100644
index 1ed20a5..0000000
--- a/bindings/corba/java/src/org/crosswire/web/i18n/TranslateTag.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.crosswire.web.i18n;
-
-import javax.servlet.jsp.tagext.BodyTagSupport;
-import javax.servlet.jsp.tagext.BodyContent;
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.JspTagException;
-//import javax.servlet.jsp.JspWriter;
-import javax.servlet.http.HttpSession;
-//import java.util.HashMap;
-//import java.io.StringWriter;
-import java.util.Locale;
-import java.util.ResourceBundle;
-import java.util.MissingResourceException;
-import java.util.Properties;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-
-
-public class TranslateTag extends BodyTagSupport {
-
- private String _key=null;
- private ResourceBundle _bundle=null;
- private String _lang=null;
-
- /* Uses code from GNU gettext for translation */
- /* which is covered by the LGPL */
- public String doTranslate(ResourceBundle catalog, String msgid) throws JspTagException {
- String hashkey = "" + msgid.hashCode();
- try {
- if (catalog != null) {
- String result = (String)catalog.getObject(hashkey);
- if (result != null)
- return result;
- }
- } catch (MissingResourceException e) {
- // want to add the msgid to the properties file
- Properties props = new Properties();
-
- try {
- FileInputStream tbtin = new FileInputStream(pageContext.getServletContext().getRealPath("/WEB-INF/classes/tbt.properties"));
- props.load(tbtin);
- tbtin.close();
-
- props.put(hashkey, msgid);
-
- FileOutputStream tbtout = new FileOutputStream(pageContext.getServletContext().getRealPath("/WEB-INF/classes/tbt.properties"));
- props.store(tbtout, null);
- tbtout.close();
-
- }
- catch(java.io.IOException e2)
- {
- throw new JspTagException("IO Error: " + e2.getMessage());
- }
-
- }
- return msgid;
- }
-
- public int doAfterBody() throws JspTagException {
- BodyContent bc = getBodyContent();
- _key = bc.getString();
- HttpSession session = pageContext.getSession();
- Locale locale = (Locale) session.getAttribute("TranslateLocale");
-
- if ((_bundle == null) || (_lang != locale.toString())) {
- _lang = locale.toString();
- _bundle = ResourceBundle.getBundle("tbt", locale);
- }
-
- return 0;
- }
-
- public int doEndTag() throws JspException {
- try
- {
- pageContext.getOut().write(doTranslate(_bundle, _key));
- }
- catch(java.io.IOException e)
- {
- throw new JspTagException("IO Error: " + e.getMessage());
- }
- return EVAL_PAGE;
- }
-
-
-}