From: zapata Date: Sun, 27 Apr 2003 20:18:15 +0000 (+0000) Subject: misc. fixes X-Git-Tag: BEFORE_MERGE_1_1~139 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=f0f8f85e69c74d10a86f3c0f7ec6e70b6abd72ff;p=mir.git misc. fixes --- diff --git a/source/mircoders/localizer/MirProducerAssistantLocalizer.java b/source/mircoders/localizer/MirProducerAssistantLocalizer.java index 190d18b5..8e11e755 100755 --- a/source/mircoders/localizer/MirProducerAssistantLocalizer.java +++ b/source/mircoders/localizer/MirProducerAssistantLocalizer.java @@ -18,13 +18,13 @@ * 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; } diff --git a/source/mircoders/localizer/basic/MirBasicDataModelLocalizer.java b/source/mircoders/localizer/basic/MirBasicDataModelLocalizer.java index 2ef0be8b..9c738893 100755 --- a/source/mircoders/localizer/basic/MirBasicDataModelLocalizer.java +++ b/source/mircoders/localizer/basic/MirBasicDataModelLocalizer.java @@ -18,13 +18,13 @@ * 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) { diff --git a/source/mircoders/localizer/basic/MirBasicPostingSessionHandler.java b/source/mircoders/localizer/basic/MirBasicPostingSessionHandler.java index b4eca4f9..0152cab1 100755 --- a/source/mircoders/localizer/basic/MirBasicPostingSessionHandler.java +++ b/source/mircoders/localizer/basic/MirBasicPostingSessionHandler.java @@ -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")); }; diff --git a/source/mircoders/localizer/basic/MirBasicProducerAssistantLocalizer.java b/source/mircoders/localizer/basic/MirBasicProducerAssistantLocalizer.java index ba162c1e..253ed1d8 100755 --- a/source/mircoders/localizer/basic/MirBasicProducerAssistantLocalizer.java +++ b/source/mircoders/localizer/basic/MirBasicProducerAssistantLocalizer.java @@ -18,13 +18,13 @@ * 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); + } }