misc. fixes
authorzapata <zapata>
Sun, 27 Apr 2003 20:18:15 +0000 (20:18 +0000)
committerzapata <zapata>
Sun, 27 Apr 2003 20:18:15 +0000 (20:18 +0000)
source/mircoders/localizer/MirProducerAssistantLocalizer.java
source/mircoders/localizer/basic/MirBasicDataModelLocalizer.java
source/mircoders/localizer/basic/MirBasicPostingSessionHandler.java
source/mircoders/localizer/basic/MirBasicProducerAssistantLocalizer.java

index 190d18b..8e11e75 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 package mircoders.localizer;
@@ -33,5 +33,6 @@ import java.util.Map;
 
 public interface MirProducerAssistantLocalizer {
   public void initializeGenerationValueSet(Map aValueSet) throws MirLocalizerExc, MirLocalizerFailure;
-  public String filterText(String aText) throws MirLocalizerExc, MirLocalizerFailure;
+  public String filterHTMLText(String aText) throws MirLocalizerExc, MirLocalizerFailure;
+  public String filterNonHTMLText(String aText) throws MirLocalizerExc, MirLocalizerFailure;
 }
index 2ef0be8..9c73889 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 package mircoders.localizer.basic;
@@ -273,10 +273,10 @@ public class MirBasicDataModelLocalizer implements MirDataModelLocalizer {
     public Object getValue(EntityAdapter anEntityAdapter) {
       try {
         if (anEntityAdapter.get("is_html")!=null && anEntityAdapter.get("is_html").equals("1")) {
-          return anEntityAdapter.get(fieldName);
+          return MirGlobal.localizer().producerAssistant().filterHTMLText((String) anEntityAdapter.get(fieldName));
         }
         else {
-          return MirGlobal.localizer().producerAssistant().filterText((String) anEntityAdapter.get(fieldName));
+          return MirGlobal.localizer().producerAssistant().filterNonHTMLText((String) anEntityAdapter.get(fieldName));
         }
       }
       catch (Throwable t) {
index b4eca4f..0152cab 100755 (executable)
@@ -203,6 +203,7 @@ public abstract class MirBasicPostingSessionHandler implements SessionHandler {
   }
 
   protected void makeErrorResponse(Request aRequest, Session aSession, Response aResponse, Throwable anError) throws SessionExc, SessionFailure {
+    aResponse.setResponseValue("errorstring", anError.getMessage());
     aResponse.setResponseGenerator(configuration.getString("Localizer.OpenSession.ErrorTemplate"));
   };
 
index ba162c1..253ed1d 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 package mircoders.localizer.basic;
@@ -128,13 +128,17 @@ public class MirBasicProducerAssistantLocalizer implements MirProducerAssistantL
 
   };
 
-  public String filterText(String aText) {
+  public String filterNonHTMLText(String aText) {
     return StringUtil.createHTML(
-        StringUtil.deleteForbiddenTags(aText),
+        StringUtil.removeHTMLTags(aText),
         MirGlobal.config().getString("Producer.ImageRoot"),
         MirGlobal.config().getString("Producer.MailLinkName"),
         MirGlobal.config().getString("Producer.ExtLinkName"),
         MirGlobal.config().getString("Producer.IntLinkName")
     );
   }
+
+  public String filterHTMLText(String aText) {
+    return StringUtil.deleteForbiddenTags(aText);
+  }
 }