Fehler #2400 FormprocessException, modul ccm-rssfeed

git-svn-id: https://svn.libreccm.org/ccm/trunk@3213 8810af33-2d31-482b-a856-94f89814c4df
master
konermann 2015-02-16 12:03:42 +00:00
parent dcbcc5964b
commit b3ad73df50
4 changed files with 63 additions and 1 deletions

View File

@ -0,0 +1,2 @@
com.arsdigita.london.rss.feed_already_exist=A feed already exists for that URL

View File

@ -0,0 +1,2 @@
com.arsdigita.london.rss.feed_already_exist=Es besteht bereits ein Feed f\u00fcr diese URL.

View File

@ -35,6 +35,7 @@ import com.arsdigita.bebop.event.FormValidationListener;
import com.arsdigita.bebop.form.TextArea;
import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.bebop.form.FormErrorDisplay;
import com.arsdigita.rssfeed.util.RssfeedGlobalizationUtil;
@ -136,7 +137,8 @@ public abstract class FeedForm extends Form {
return; // Matching itself, that's ok
}
throw new FormProcessException("A feed already exists for that URL");
throw new FormProcessException(RssfeedGlobalizationUtil.globalize(
"com.arsdigita.london.rss.feed_already_exist"));
} catch (DataObjectNotFoundException ex) {
// No matching feed, hurrah
}

View File

@ -0,0 +1,56 @@
/*
* Copyright (C) 2009 Jens Pelzetter, Center of Social Politic Research, University of Bremen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package com.arsdigita.rssfeed.util;
import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
* Compilation of methods to simplify the handling of globalizing keys.
* Basically it adds the name of package's resource bundle files to the
* globalize methods and forwards to GlobalizedMessage, shortening the
* method invocation in the various application classes.
*
* @author Alexander Konermann
*/
public class RssfeedGlobalizationUtil implements Globalized {
/** Name of Java resource files to handle Rssfeed's globalisation. */
final public static String BUNDLE_NAME =
"com.arsdigita.rssfeed.RssfeedResources";
/**
* Returns a globalized message using the package specific bundle,
* provided by BUNDLE_NAME.
*/
public static GlobalizedMessage globalize (String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
/**
* Returns a globalized message object, using the package specific bundle,
* as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
* interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize (String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
}
}