You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by aj...@apache.org on 2008/12/20 05:34:20 UTC
svn commit: r728235 [2/3] - in /incubator/jspwiki/trunk: ./ doc/ etc/
etc/i18n/templates/ etc/ini/ src/com/ecyrd/jspwiki/
src/com/ecyrd/jspwiki/action/ src/com/ecyrd/jspwiki/diff/
src/com/ecyrd/jspwiki/preferences/ src/com/ecyrd/jspwiki/ui/ src/com/ecy...
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java Fri Dec 19 20:34:18 2008
@@ -30,14 +30,13 @@
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.PageContext;
-import javax.servlet.jsp.jstl.fmt.LocaleSupport;
import org.apache.commons.lang.StringUtils;
import com.ecyrd.jspwiki.InternalWikiException;
import com.ecyrd.jspwiki.WikiContext;
import com.ecyrd.jspwiki.WikiEngine;
-import com.ecyrd.jspwiki.action.WikiContextFactory;
+import com.ecyrd.jspwiki.i18n.InternationalizationManager;
import com.ecyrd.jspwiki.log.Logger;
import com.ecyrd.jspwiki.log.LoggerFactory;
import com.ecyrd.jspwiki.modules.ModuleManager;
@@ -45,48 +44,52 @@
import com.ecyrd.jspwiki.preferences.Preferences.TimeFormat;
/**
- * This class takes care of managing JSPWiki templates. This class also provides
- * the ResourceRequest mechanism.
- *
- * @since 2.1.62
+ * This class takes care of managing JSPWiki templates. This class also provides
+ * the ResourceRequest mechanism.
+ *
+ * @since 2.1.62
*/
-public class TemplateManager
- extends ModuleManager
+public class TemplateManager extends ModuleManager
{
/**
- * Enum that specifies the two types of templates: {@link #VIEW} and {@link #EDIT}.
+ * Enum that specifies the two types of templates: {@link #VIEW} and
+ * {@link #EDIT}.
*/
- public enum Template {
+ public enum Template
+ {
/** Template used for viewing things. */
- VIEW("ViewTemplate.jsp"),
+ VIEW("ViewTemplate.jsp"),
/** Template used for editing things. */
EDIT("EditTemplate.jsp");
-
+
private final String m_template;
-
+
/**
* Package-private constructor.
+ *
* @param template the name of the template
*/
Template( String template )
{
m_template = template;
}
-
+
/**
* Returns the JSP for the template.
- * @return
+ *
+ * @return the template name
*/
public String template()
{
return m_template;
}
}
-
+
private static final String SKIN_DIRECTORY = "skins";
/**
- * Requests a JavaScript function to be called during window.onload. Value is {@value}.
+ * Requests a JavaScript function to be called during window.onload. Value
+ * is {@value}.
*/
public static final String RESOURCE_JSFUNCTION = "jsfunction";
@@ -148,7 +151,7 @@
// private Cache m_propertyCache;
- protected static final Logger log = LoggerFactory.getLogger(TemplateManager.class);
+ protected static final Logger log = LoggerFactory.getLogger( TemplateManager.class );
/** Requests a HTTP header. Value is {@value}. */
public static final String RESOURCE_HTTPHEADER = "httpheader";
@@ -156,30 +159,50 @@
private WikiEngine m_engine;
/**
- * Creates a new TemplateManager. There is typically one manager per engine.
- *
- * @param engine The owning engine.
- * @param properties The property list used to initialize this.
+ * List of time zones, used by {@link #listTimeZones(HttpServletRequest)}.
+ */
+ private static final List<TimeZone> TIME_ZONES;
+
+ static
+ {
+ List<TimeZone> zones = new ArrayList<TimeZone>();
+ String[] ids = { "Pacific/Midway", "Pacific/Honolulu", "America/Anchorage", "PST", "MST", "CST", "EST", "America/Caracas",
+ "Brazil/East", "Atlantic/South_Georgia", "Atlantic/Cape_Verde", "Etc/Greenwich", "CET", "ART", "EAT",
+ "Asia/Dubai", "IST", "BST", "VST", "CTT", "JST", "Australia/Sydney", "SST", "NZ", "Pacific/Tongatapu",
+ "Pacific/Kiritimati" };
+ for( String id : ids )
+ {
+ java.util.TimeZone zone = java.util.TimeZone.getTimeZone( id );
+ zones.add( zone );
+ }
+ TIME_ZONES = Collections.unmodifiableList( zones );
+ }
+
+ /**
+ * Creates a new TemplateManager. There is typically one manager per engine.
+ *
+ * @param engine The owning engine.
+ * @param properties The property list used to initialize this.
*/
public TemplateManager( WikiEngine engine, Properties properties )
{
- super(engine);
+ super( engine );
m_engine = engine;
//
- // Uses the unlimited cache.
+ // Uses the unlimited cache.
//
// m_propertyCache = new Cache( true, false );
}
/**
- * Check the existence of a template.
+ * Check the existence of a template.
*/
// FIXME: Does not work yet
public boolean templateExists( String templateName )
{
ServletContext context = m_engine.getServletContext();
- InputStream in = context.getResourceAsStream( getPath(templateName)+"ViewTemplate.jsp");
+ InputStream in = context.getResourceAsStream( getPath( templateName ) + "ViewTemplate.jsp" );
if( in != null )
{
@@ -187,7 +210,7 @@
{
in.close();
}
- catch (IOException e)
+ catch( IOException e )
{
}
@@ -198,13 +221,13 @@
}
/**
- * Tries to locate a given resource from the template directory. If the
- * given resource is not found under the current name, returns the
- * path to the corresponding one in the default template.
- *
- * @param sContext The servlet context
- * @param name The name of the resource
- * @return The name of the resource which was found.
+ * Tries to locate a given resource from the template directory. If the
+ * given resource is not found under the current name, returns the path to
+ * the corresponding one in the default template.
+ *
+ * @param sContext The servlet context
+ * @param name The name of the resource
+ * @return The name of the resource which was found.
*/
private static String findResource( ServletContext sContext, String name )
{
@@ -212,8 +235,7 @@
if( is == null )
{
- String defname = makeFullJSPName( DEFAULT_TEMPLATE,
- removeTemplatePart(name) );
+ String defname = makeFullJSPName( DEFAULT_TEMPLATE, removeTemplatePart( name ) );
is = sContext.getResourceAsStream( defname );
if( is != null )
@@ -229,15 +251,17 @@
is.close();
}
catch( IOException e )
- {}
+ {
+ }
}
return name;
}
/**
- * Attempts to find a resource from the given template, and if it's not found
- * attempts to locate it from the default template.
+ * Attempts to find a resource from the given template, and if it's not
+ * found attempts to locate it from the default template.
+ *
* @param sContext
* @param template
* @param name
@@ -245,7 +269,7 @@
*/
private static String findResource( ServletContext sContext, String template, String name )
{
- if( name.charAt(0) == '/' )
+ if( name.charAt( 0 ) == '/' )
{
// This is already a full path
return findResource( sContext, name );
@@ -257,12 +281,12 @@
}
/**
- * An utility method for finding a JSP page. It searches only under
- * either current context or by the absolute name.
- *
- * @param pageContext the JSP PageContext
- * @param name The name of the JSP page to look for (e.g "Wiki.jsp")
- * @return The context path to the resource
+ * An utility method for finding a JSP page. It searches only under either
+ * current context or by the absolute name.
+ *
+ * @param pageContext the JSP PageContext
+ * @param name The name of the JSP page to look for (e.g "Wiki.jsp")
+ * @return The context path to the resource
*/
public String findJSP( PageContext pageContext, String name )
{
@@ -272,80 +296,80 @@
}
/**
- * Removes the template part of a name.
+ * Removes the template part of a name.
*/
private static final String removeTemplatePart( String name )
{
int idx = 0;
- if( name.startsWith( "/" ) ) idx = 1;
-
- idx = name.indexOf('/', idx);
+ if( name.startsWith( "/" ) )
+ idx = 1;
+
+ idx = name.indexOf( '/', idx );
if( idx != -1 )
{
- idx = name.indexOf('/', idx+1); // Find second "/"
+ idx = name.indexOf( '/', idx + 1 ); // Find second "/"
if( idx != -1 )
{
- name = name.substring( idx+1 );
+ name = name.substring( idx + 1 );
}
}
- log.info( "Final name = "+name );
+ log.info( "Final name = " + name );
return name;
}
/**
- * Returns the full name (/templates/foo/bar) for name=bar, template=foo.
- *
+ * Returns the full name (/templates/foo/bar) for name=bar, template=foo.
+ *
* @param template The name of the template.
* @param name The name of the resource.
* @return The full name for a template.
*/
private static final String makeFullJSPName( String template, String name )
{
- return "/"+DIRECTORY+"/"+template+"/"+name;
+ return "/" + DIRECTORY + "/" + template + "/" + name;
}
/**
- * Attempts to locate a resource under the given template. If that template
- * does not exist, or the page does not exist under that template, will
- * attempt to locate a similarly named file under the default template.
- * <p>
- * Even though the name suggests only JSP files can be located, but in fact
- * this method can find also other resources than JSP files.
- *
- * @param pageContext The JSP PageContext
- * @param template From which template we should seek initially?
- * @param name Which resource are we looking for (e.g. "ViewTemplate.jsp")
- * @return path to the JSP page; null, if it was not found.
+ * Attempts to locate a resource under the given template. If that template
+ * does not exist, or the page does not exist under that template, will
+ * attempt to locate a similarly named file under the default template.
+ * <p>
+ * Even though the name suggests only JSP files can be located, but in fact
+ * this method can find also other resources than JSP files.
+ *
+ * @param pageContext The JSP PageContext
+ * @param template From which template we should seek initially?
+ * @param name Which resource are we looking for (e.g. "ViewTemplate.jsp")
+ * @return path to the JSP page; null, if it was not found.
*/
public String findJSP( PageContext pageContext, String template, String name )
{
if( name == null || template == null )
{
- log.error("findJSP() was asked to find a null template or name ("+template+","+name+")."+
- " JSP page '"+
- ((HttpServletRequest)pageContext.getRequest()).getRequestURI()+"'");
- throw new InternalWikiException("Illegal arguments to findJSP(); please check logs.");
+ log.error( "findJSP() was asked to find a null template or name (" + template + "," + name + ")." + " JSP page '"
+ + ((HttpServletRequest) pageContext.getRequest()).getRequestURI() + "'" );
+ throw new InternalWikiException( "Illegal arguments to findJSP(); please check logs." );
}
return findResource( pageContext.getServletContext(), template, name );
}
/**
- * Attempts to locate a resource under the given template. This matches the
- * functionality findJSP(), but uses the WikiContext as the argument. If there
- * is no servlet context (i.e. this is embedded), will just simply return
- * a best-guess.
- * <p>
- * This method is typically used to locate any resource, including JSP pages, images,
- * scripts, etc.
- *
- * @since 2.6
- * @param ctx the wiki context
- * @param template the name of the template to use
- * @param name the name of the resource to fine
- * @return the path to the resource
+ * Attempts to locate a resource under the given template. This matches the
+ * functionality findJSP(), but uses the WikiContext as the argument. If
+ * there is no servlet context (i.e. this is embedded), will just simply
+ * return a best-guess.
+ * <p>
+ * This method is typically used to locate any resource, including JSP
+ * pages, images, scripts, etc.
+ *
+ * @since 2.6
+ * @param ctx the wiki context
+ * @param template the name of the template to use
+ * @param name the name of the resource to fine
+ * @return the path to the resource
*/
public String findResource( WikiContext ctx, String template, String name )
{
@@ -354,96 +378,72 @@
return findResource( m_engine.getServletContext(), template, name );
}
- return getPath(template)+"/"+name;
+ return getPath( template ) + "/" + name;
}
/**
- * Returns a property, as defined in the template. The evaluation
- * is lazy, i.e. the properties are not loaded until the template is
- * actually used for the first time.
+ * Returns a property, as defined in the template. The evaluation is lazy,
+ * i.e. the properties are not loaded until the template is actually used
+ * for the first time.
*/
/*
- public String getTemplateProperty( WikiContext context, String key )
- {
- String template = context.getTemplate();
-
- try
- {
- Properties props = (Properties)m_propertyCache.getFromCache( template, -1 );
-
- if( props == null )
- {
- try
- {
- props = getTemplateProperties( template );
-
- m_propertyCache.putInCache( template, props );
- }
- catch( IOException e )
- {
- log.warn("IO Exception while reading template properties",e);
-
- return null;
- }
- }
-
- return props.getProperty( key );
- }
- catch( NeedsRefreshException ex )
- {
- // FIXME
- return null;
- }
- }
-*/
+ * public String getTemplateProperty( WikiContext context, String key ) {
+ * String template = context.getTemplate(); try { Properties props =
+ * (Properties)m_propertyCache.getFromCache( template, -1 ); if( props ==
+ * null ) { try { props = getTemplateProperties( template );
+ * m_propertyCache.putInCache( template, props ); } catch( IOException e ) {
+ * log.warn("IO Exception while reading template properties",e); return
+ * null; } } return props.getProperty( key ); } catch( NeedsRefreshException
+ * ex ) { // FIXME return null; } }
+ */
/**
- * Returns an absolute path to a given template.
+ * Returns an absolute path to a given template.
*/
private static final String getPath( String template )
{
- return "/"+DIRECTORY+"/"+template+"/";
+ return "/" + DIRECTORY + "/" + template + "/";
}
/**
- * Lists the skins available under this template. Returns an
- * empty Set, if there are no extra skins available. Note that
- * this method does not check whether there is anything actually
- * in the directories, it just lists them. This may change
- * in the future.
- *
- * @param pageContext the JSP PageContext
- * @param template The template to search
- * @return Set of Strings with the skin names.
- * @since 2.3.26
+ * Lists the skins available under this template. Returns an empty Set, if
+ * there are no extra skins available. Note that this method does not check
+ * whether there is anything actually in the directories, it just lists
+ * them. This may change in the future.
+ *
+ * @param request the HTTP request
+ * @param template The template to search
+ * @return Set of Strings with the skin names.
+ * @since 2.3.26
*/
- @SuppressWarnings("unchecked")
- public Set listSkins( PageContext pageContext, String template )
+ @SuppressWarnings( "unchecked" )
+ public Set listSkins( HttpServletRequest request, String template )
{
String place = makeFullJSPName( template, SKIN_DIRECTORY );
- ServletContext sContext = pageContext.getServletContext();
+ ServletContext sContext = request.getSession().getServletContext();
Set<String> skinSet = sContext.getResourcePaths( place );
TreeSet<String> resultSet = new TreeSet<String>();
- if( log.isDebugEnabled() ) log.debug( "Listings skins from "+place );
+ if( log.isDebugEnabled() )
+ log.debug( "Listings skins from " + place );
if( skinSet != null )
{
String[] skins = {};
- skins = skinSet.toArray(skins);
+ skins = skinSet.toArray( skins );
- for (int i = 0; i < skins.length; i++)
+ for( int i = 0; i < skins.length; i++ )
{
- String[] s = StringUtils.split(skins[i], "/");
+ String[] s = StringUtils.split( skins[i], "/" );
- if (s.length > 2 && skins[i].endsWith("/"))
+ if( s.length > 2 && skins[i].endsWith( "/" ) )
{
String skinName = s[s.length - 1];
- resultSet.add(skinName);
- if (log.isDebugEnabled())
- log.debug("...adding skin '" + skinName + "'");
+ resultSet.add( skinName );
+ if( log.isDebugEnabled() )
+ log.debug( "...adding skin '" + skinName + "'" );
}
}
}
@@ -454,144 +454,132 @@
/**
* List all installed i18n language properties
*
- * @param pageContext
- * @return map of installed Languages (with help of Juan Pablo Santos Rodriguez)
+ * @param request the HTTP request
+ * @return map of installed Languages (with help of Juan Pablo Santos
+ * Rodriguez)
* @since 2.7.x
*/
- public Map listLanguages(PageContext pageContext)
+ public Map<Locale, String> listLocales( HttpServletRequest request )
{
- LinkedHashMap<String,String> resultMap = new LinkedHashMap<String,String>();
+ LinkedHashMap<Locale, String> resultMap = new LinkedHashMap<Locale, String>();
- String clientLanguage = ((HttpServletRequest) pageContext.getRequest()).getLocale().toString();
JarInputStream jarStream = null;
-
+
try
{
JarEntry entry;
- InputStream inputStream = pageContext.getServletContext().getResourceAsStream(I18NRESOURCE_PATH);
- jarStream = new JarInputStream(inputStream);
+ InputStream inputStream = request.getSession().getServletContext().getResourceAsStream( I18NRESOURCE_PATH );
+ jarStream = new JarInputStream( inputStream );
- while ((entry = jarStream.getNextJarEntry()) != null)
+ while ( (entry = jarStream.getNextJarEntry()) != null )
{
String name = entry.getName();
- if (!entry.isDirectory() && name.startsWith(I18NRESOURCE_PREFIX) && name.endsWith(I18NRESOURCE_SUFFIX))
+ if( !entry.isDirectory() && name.startsWith( I18NRESOURCE_PREFIX ) && name.endsWith( I18NRESOURCE_SUFFIX ) )
{
- name = name.substring(I18NRESOURCE_PREFIX.length(), name.lastIndexOf(I18NRESOURCE_SUFFIX));
-
- Locale locale = new Locale(name.substring(0, 2), ((name.indexOf("_") == -1) ? "" : name.substring(3, 5)));
-
- String defaultLanguage = "";
-
- if (clientLanguage.startsWith(name))
- {
- defaultLanguage = LocaleSupport.getLocalizedMessage(pageContext, I18NDEFAULT_LOCALE);
- }
-
- resultMap.put(name, locale.getDisplayName(locale) + " " + defaultLanguage);
+ name = name.substring( I18NRESOURCE_PREFIX.length(), name.lastIndexOf( I18NRESOURCE_SUFFIX ) );
+ Locale locale = new Locale( name.substring( 0, 2 ), ((name.indexOf( "_" ) == -1) ? "" : name.substring( 3, 5 )) );
+ resultMap.put( locale, locale.getDisplayName( locale ) );
}
}
}
- catch (IOException ioe)
+ catch( IOException ioe )
{
- if (log.isDebugEnabled())
- log.debug("Could not search jar file '" + I18NRESOURCE_PATH +
- "'for properties files due to an IOException: \n" + ioe.getMessage());
+ if( log.isDebugEnabled() )
+ log.debug( "Could not search jar file '" + I18NRESOURCE_PATH + "'for properties files due to an IOException: \n"
+ + ioe.getMessage() );
}
finally
{
- if( jarStream != null )
+ if( jarStream != null )
{
- try
- {
- jarStream.close();
- }
- catch(IOException e) {}
+ try
+ {
+ jarStream.close();
+ }
+ catch( IOException e )
+ {
+ }
}
}
-
+
return resultMap;
}
-
/**
* List all available timeformats, read from the jspwiki.properties
*
- * @param pageContext
+ * @param context the wiki context
* @return map of TimeFormats
* @since 2.7.x
*/
- public Map listTimeFormats(PageContext pageContext)
+ public Map listTimeFormats( WikiContext context )
{
- WikiContext context = WikiContextFactory.findContext( pageContext );
Properties props = m_engine.getWikiProperties();
- ArrayList<String> tfArr = new ArrayList<String>(40);
- LinkedHashMap<String,String> resultMap = new LinkedHashMap<String,String>();
+ ArrayList<String> tfArr = new ArrayList<String>( 40 );
+ LinkedHashMap<String, String> resultMap = new LinkedHashMap<String, String>();
/* filter timeformat properties */
- for (Enumeration e = props.propertyNames(); e.hasMoreElements();)
+ for( Enumeration e = props.propertyNames(); e.hasMoreElements(); )
{
String name = (String) e.nextElement();
- if (name.startsWith(TIMEFORMATPROPERTIES))
+ if( name.startsWith( TIMEFORMATPROPERTIES ) )
{
- tfArr.add(name);
+ tfArr.add( name );
}
}
/* fetch actual formats */
- if (tfArr.size() == 0) /*
+ if( tfArr.size() == 0 ) /*
* no props found - make sure some default
* formats are avail
*/
{
- tfArr.add("dd-MMM-yy");
- tfArr.add("d-MMM-yyyy");
- tfArr.add("EEE, dd-MMM-yyyy, zzzz");
+ tfArr.add( "dd-MMM-yy" );
+ tfArr.add( "d-MMM-yyyy" );
+ tfArr.add( "EEE, dd-MMM-yyyy, zzzz" );
}
else
{
- Collections.sort(tfArr);
+ Collections.sort( tfArr );
- for (int i = 0; i < tfArr.size(); i++)
+ for( int i = 0; i < tfArr.size(); i++ )
{
- tfArr.set(i, props.getProperty(tfArr.get(i)));
+ tfArr.set( i, props.getProperty( tfArr.get( i ) ) );
}
}
- String prefTimeZone = Preferences.getPreference( context, "TimeZone" );
- //TimeZone tz = TimeZone.getDefault();
- TimeZone tz = TimeZone.getTimeZone(prefTimeZone);
- /*try
- {
- tz.setRawOffset(Integer.parseInt(prefTimeZone));
- }
- catch (Exception e)
- {
- }*/
+ String prefTimeZone = Preferences.getPreference( context.getHttpRequest().getSession(), "TimeZone" );
+ // TimeZone tz = TimeZone.getDefault();
+ TimeZone tz = TimeZone.getTimeZone( prefTimeZone );
+ /*
+ * try { tz.setRawOffset(Integer.parseInt(prefTimeZone)); } catch
+ * (Exception e) { }
+ */
Date d = new Date(); // current date
try
{
// dummy format pattern
SimpleDateFormat fmt = Preferences.getDateFormat( context, TimeFormat.DATETIME );
- fmt.setTimeZone(tz);
+ fmt.setTimeZone( tz );
- for (int i = 0; i < tfArr.size(); i++)
+ for( int i = 0; i < tfArr.size(); i++ )
{
try
{
- String f = tfArr.get(i);
- fmt.applyPattern(f);
+ String f = tfArr.get( i );
+ fmt.applyPattern( f );
- resultMap.put(f, fmt.format(d));
+ resultMap.put( f, fmt.format( d ) );
}
- catch (IllegalArgumentException e)
+ catch( IllegalArgumentException e )
{
} // skip parameter
}
}
- catch (IllegalArgumentException e)
+ catch( IllegalArgumentException e )
{
} // skip parameter
@@ -599,140 +587,94 @@
}
/**
- * List all timezones, with special marker for server timezone
+ * Returns a Map of locallized time zones, with the TimeZone IDs as keys and
+ * localized formatted names as the values.
*
- * @param pageContext
+ * @param request the HTTP request
* @return map of TimeZones
* @since 2.7.x
*/
- public Map listTimeZones(PageContext pageContext)
+ public Map<String, String> listTimeZones( HttpServletRequest request )
{
- LinkedHashMap<String,String> resultMap = new LinkedHashMap<String,String>();
-
- String[][] tzs = { { "GMT-12", "Enitwetok, Kwajalien" },
- { "GMT-11", "Nome, Midway Island, Samoa" },
- { "GMT-10", "Hawaii" },
- { "GMT-9", "Alaska" },
- { "GMT-8", "Pacific Time" },
- { "GMT-7", "Mountain Time" },
- { "GMT-6", "Central Time, Mexico City" },
- { "GMT-5", "Eastern Time, Bogota, Lima, Quito" },
- { "GMT-4", "Atlantic Time, Caracas, La Paz" },
- { "GMT-3:30", "Newfoundland" },
- { "GMT-3", "Brazil, Buenos Aires, Georgetown, Falkland Is." },
- { "GMT-2", "Mid-Atlantic, Ascention Is., St Helena" },
- { "GMT-1", "Azores, Cape Verde Islands" },
- { "GMT", "Casablanca, Dublin, Edinburgh, London, Lisbon, Monrovia" },
- { "GMT+1", "Berlin, Brussels, Copenhagen, Madrid, Paris, Rome" },
- { "GMT+2", "Helsinki, Athens, Kaliningrad, South Africa, Warsaw" },
- { "GMT+3", "Baghdad, Riyadh, Moscow, Nairobi" },
- { "GMT+3:30", "Tehran" },
- { "GMT+4", "Adu Dhabi, Baku, Muscat, Tbilisi" },
- { "GMT+4:30", "Kabul" },
- { "GMT+5", "Islamabad, Karachi, Tashkent" },
- { "GMT+5:30", "Bombay, Calcutta, Madras, New Delhi" },
- { "GMT+6", "Almaty, Colomba, Dhakra" },
- { "GMT+7", "Bangkok, Hanoi, Jakarta" },
- { "GMT+8", "Beijing, Hong Kong, Perth, Singapore, Taipei" },
- { "GMT+9", "Osaka, Sapporo, Seoul, Tokyo, Yakutsk" },
- { "GMT+9:30", "Adelaide, Darwin" },
- { "GMT+10", "Melbourne, Papua New Guinea, Sydney, Vladivostok" },
- { "GMT+11", "Magadan, New Caledonia, Solomon Islands" },
- { "GMT+12", "Auckland, Wellington, Fiji, Marshall Island" } };
-
- java.util.TimeZone servertz = java.util.TimeZone.getDefault();
-
- for( int i = 0; i < tzs.length; i++ )
- {
- String tzID = tzs[i][0];
- java.util.TimeZone tz = java.util.TimeZone.getTimeZone(tzID);
-
- String serverTimeZone = "";
-
- if( servertz.getRawOffset() == tz.getRawOffset() )
- {
- serverTimeZone = LocaleSupport.getLocalizedMessage(pageContext, I18NSERVER_TIMEZONE);
- tzID = servertz.getID();
+ LinkedHashMap<String, String> resultMap = new LinkedHashMap<String, String>();
+ java.util.TimeZone serverZone = java.util.TimeZone.getDefault();
+ Date now = new Date();
+
+ // Build a map of TimeZones and their localized display names
+ for( TimeZone zone : TIME_ZONES )
+ {
+ int offset = zone.getRawOffset() / 3600000;
+ String zoneLabel = "[GMT" + (offset > 0 ? "+" : "") + offset + "] "
+ + zone.getDisplayName( zone.inDaylightTime( now ), TimeZone.LONG, request.getLocale() );
+ if( serverZone.getRawOffset() == zone.getRawOffset() )
+ {
+ InternationalizationManager i18n = m_engine.getInternationalizationManager();
+ String serverLabel = i18n.get( InternationalizationManager.TEMPLATES_BUNDLE, request.getLocale(),
+ I18NSERVER_TIMEZONE );
+ zoneLabel = zoneLabel + " " + serverLabel;
}
-
- resultMap.put(tzID, "(" + tzs[i][0] + ") "+tzs[i][1] + " " + serverTimeZone);
+ resultMap.put( zone.getID(), zoneLabel );
}
-
return resultMap;
}
/**
- * Always returns a valid property map.
+ * Always returns a valid property map.
*/
/*
- private Properties getTemplateProperties( String templateName )
- throws IOException
- {
- Properties p = new Properties();
-
- ServletContext context = m_engine.getServletContext();
-
- InputStream propertyStream = context.getResourceAsStream(getPath(templateName)+PROPERTYFILE);
-
- if( propertyStream != null )
- {
- p.load( propertyStream );
-
- propertyStream.close();
- }
- else
- {
- log.debug("Template '"+templateName+"' does not have a propertyfile '"+PROPERTYFILE+"'.");
- }
-
- return p;
- }
-*/
+ * private Properties getTemplateProperties( String templateName ) throws
+ * IOException { Properties p = new Properties(); ServletContext context =
+ * m_engine.getServletContext(); InputStream propertyStream =
+ * context.getResourceAsStream(getPath(templateName)+PROPERTYFILE); if(
+ * propertyStream != null ) { p.load( propertyStream );
+ * propertyStream.close(); } else { log.debug("Template '"+templateName+"'
+ * does not have a propertyfile '"+PROPERTYFILE+"'."); } return p; }
+ */
/**
- * Returns the include resources marker for a given type. This is in a
- * HTML or Javascript comment format.
- *
- * @param context the wiki context
- * @param type the marker
- * @return the generated marker comment
+ * Returns the include resources marker for a given type. This is in a HTML
+ * or Javascript comment format.
+ *
+ * @param context the wiki context
+ * @param type the marker
+ * @return the generated marker comment
*/
- public static String getMarker(WikiContext context, String type )
+ public static String getMarker( WikiContext context, String type )
{
- if( type.equals(RESOURCE_JSLOCALIZEDSTRINGS) )
+ if( type.equals( RESOURCE_JSLOCALIZEDSTRINGS ) )
{
return getJSLocalizedStrings( context );
}
- else if( type.equals(RESOURCE_JSFUNCTION) )
+ else if( type.equals( RESOURCE_JSFUNCTION ) )
{
- return "/* INCLUDERESOURCES ("+type+") */";
+ return "/* INCLUDERESOURCES (" + type + ") */";
}
- return "<!-- INCLUDERESOURCES ("+type+") -->";
+ return "<!-- INCLUDERESOURCES (" + type + ") -->";
}
/**
- * Extract all i18n strings in the javascript domain. (javascript.*)
- * Returns a javascript snippet which defines the LoacalizedStings array.
- *
- * @param wiki context
- * @return Javascript snippet which defines the LocaliedStrings array
- * @author Dirk Frederickx
- * @since 2.5.108
+ * Extract all i18n strings in the javascript domain. (javascript.*) Returns
+ * a javascript snippet which defines the LoacalizedStings array.
+ *
+ * @param wiki context
+ * @return Javascript snippet which defines the LocaliedStrings array
+ * @author Dirk Frederickx
+ * @since 2.5.108
*/
private static String getJSLocalizedStrings( WikiContext context )
{
StringBuilder sb = new StringBuilder();
- sb.append( "var LocalizedStrings = {\n");
+ sb.append( "var LocalizedStrings = {\n" );
- ResourceBundle rb = context.getBundle("templates.default");
+ ResourceBundle rb = context.getBundle( "templates.default" );
boolean first = true;
for( Enumeration en = rb.getKeys(); en.hasMoreElements(); )
{
- String key = (String)en.nextElement();
+ String key = (String) en.nextElement();
- if( key.startsWith("javascript") )
+ if( key.startsWith( "javascript" ) )
{
if( first )
{
@@ -742,47 +684,49 @@
{
sb.append( ",\n" );
}
- sb.append( "\""+key+"\":\""+rb.getString(key)+"\"" );
+ sb.append( "\"" + key + "\":\"" + rb.getString( key ) + "\"" );
}
}
- sb.append("\n};\n");
+ sb.append( "\n};\n" );
- return( sb.toString() );
+ return(sb.toString());
}
/**
- * Adds a resource request to the current request context.
- * The content will be added at the resource-type marker
- * (see IncludeResourcesTag) in WikiJSPFilter.
- * <p>
- * The resources can be of different types. For RESOURCE_SCRIPT and RESOURCE_STYLESHEET
- * this is an URI path to the resource (a script file or an external stylesheet)
- * that needs to be included. For RESOURCE_INLINECSS
- * the resource should be something that can be added between <style></style> in the
- * header file (commonheader.jsp). For RESOURCE_JSFUNCTION it is the name of the Javascript
- * function that should be run at page load.
- * <p>
- * The IncludeResourceTag inserts code in the template files, which is then filled
- * by the WikiFilter after the request has been rendered but not yet sent to the recipient.
- * <p>
- * Note that ALL resource requests get rendered, so this method does not check if
- * the request already exists in the resources. Therefore, if you have a plugin which
- * makes a new resource request every time, you'll end up with multiple resource requests
- * rendered. It's thus a good idea to make this request only once during the page
- * life cycle.
- *
- * @param ctx The current wiki context
- * @param type What kind of a request should be added?
- * @param resource The resource to add.
+ * Adds a resource request to the current request context. The content will
+ * be added at the resource-type marker (see IncludeResourcesTag) in
+ * WikiJSPFilter.
+ * <p>
+ * The resources can be of different types. For RESOURCE_SCRIPT and
+ * RESOURCE_STYLESHEET this is an URI path to the resource (a script file or
+ * an external stylesheet) that needs to be included. For RESOURCE_INLINECSS
+ * the resource should be something that can be added between
+ * <style></style> in the header file (commonheader.jsp). For
+ * RESOURCE_JSFUNCTION it is the name of the Javascript function that should
+ * be run at page load.
+ * <p>
+ * The IncludeResourceTag inserts code in the template files, which is then
+ * filled by the WikiFilter after the request has been rendered but not yet
+ * sent to the recipient.
+ * <p>
+ * Note that ALL resource requests get rendered, so this method does not
+ * check if the request already exists in the resources. Therefore, if you
+ * have a plugin which makes a new resource request every time, you'll end
+ * up with multiple resource requests rendered. It's thus a good idea to
+ * make this request only once during the page life cycle.
+ *
+ * @param ctx The current wiki context
+ * @param type What kind of a request should be added?
+ * @param resource The resource to add.
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
public static void addResourceRequest( WikiContext ctx, String type, String resource )
{
- HashMap<String,Vector<String>> resourcemap = (HashMap<String,Vector<String>>) ctx.getVariable( RESOURCE_INCLUDES );
+ HashMap<String, Vector<String>> resourcemap = (HashMap<String, Vector<String>>) ctx.getVariable( RESOURCE_INCLUDES );
if( resourcemap == null )
{
- resourcemap = new HashMap<String,Vector<String>>();
+ resourcemap = new HashMap<String, Vector<String>>();
}
Vector<String> resources = resourcemap.get( type );
@@ -794,23 +738,23 @@
String resourceString = null;
- if( type.equals(RESOURCE_SCRIPT) )
+ if( type.equals( RESOURCE_SCRIPT ) )
{
- resourceString = "<script type='text/javascript' src='"+resource+"'></script>";
+ resourceString = "<script type='text/javascript' src='" + resource + "'></script>";
}
- else if( type.equals(RESOURCE_STYLESHEET) )
+ else if( type.equals( RESOURCE_STYLESHEET ) )
{
- resourceString = "<link rel='stylesheet' type='text/css' href='"+resource+"' />";
+ resourceString = "<link rel='stylesheet' type='text/css' href='" + resource + "' />";
}
- else if( type.equals(RESOURCE_INLINECSS) )
+ else if( type.equals( RESOURCE_INLINECSS ) )
{
- resourceString = "<style type='text/css'>\n"+resource+"\n</style>\n";
+ resourceString = "<style type='text/css'>\n" + resource + "\n</style>\n";
}
- else if( type.equals(RESOURCE_JSFUNCTION) )
+ else if( type.equals( RESOURCE_JSFUNCTION ) )
{
resourceString = resource;
}
- else if( type.equals(RESOURCE_HTTPHEADER) )
+ else if( type.equals( RESOURCE_HTTPHEADER ) )
{
resourceString = resource;
}
@@ -820,31 +764,33 @@
resources.add( resourceString );
}
- log.debug("Request to add a resource: "+resourceString);
+ log.debug( "Request to add a resource: " + resourceString );
resourcemap.put( type, resources );
ctx.setVariable( RESOURCE_INCLUDES, resourcemap );
}
/**
- * Returns resource requests for a particular type. If there are no resources,
- * returns an empty array.
- *
- * @param ctx WikiContext
- * @param type The resource request type
- * @return a String array for the resource requests
+ * Returns resource requests for a particular type. If there are no
+ * resources, returns an empty array.
+ *
+ * @param ctx WikiContext
+ * @param type The resource request type
+ * @return a String array for the resource requests
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
public static String[] getResourceRequests( WikiContext ctx, String type )
{
- HashMap<String,Vector<String>> hm = (HashMap<String,Vector<String>>) ctx.getVariable( RESOURCE_INCLUDES );
+ HashMap<String, Vector<String>> hm = (HashMap<String, Vector<String>>) ctx.getVariable( RESOURCE_INCLUDES );
- if( hm == null ) return new String[0];
+ if( hm == null )
+ return new String[0];
Vector<String> resources = hm.get( type );
- if( resources == null ) return new String[0];
+ if( resources == null )
+ return new String[0];
String[] res = new String[resources.size()];
@@ -852,19 +798,19 @@
}
/**
- * Returns all those types that have been requested so far.
- *
+ * Returns all those types that have been requested so far.
+ *
* @param ctx the wiki context
* @return the array of types requested
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
public static String[] getResourceTypes( WikiContext ctx )
{
String[] res = new String[0];
if( ctx != null )
{
- HashMap<String,String> hm = (HashMap<String,String>) ctx.getVariable( RESOURCE_INCLUDES );
+ HashMap<String, String> hm = (HashMap<String, String>) ctx.getVariable( RESOURCE_INCLUDES );
if( hm != null )
{
@@ -878,10 +824,10 @@
}
/**
- * Returns an empty collection, since at the moment the TemplateManager
- * does not manage any modules.
- *
- * @return {@inheritDoc}
+ * Returns an empty collection, since at the moment the TemplateManager does
+ * not manage any modules.
+ *
+ * @return {@inheritDoc}
*/
public Collection modules()
{
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiRequestWrapper.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiRequestWrapper.java?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiRequestWrapper.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiRequestWrapper.java Fri Dec 19 20:34:18 2008
@@ -21,6 +21,9 @@
package com.ecyrd.jspwiki.ui;
import java.security.Principal;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.Vector;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
@@ -29,11 +32,17 @@
import com.ecyrd.jspwiki.WikiSession;
import com.ecyrd.jspwiki.auth.SessionMonitor;
import com.ecyrd.jspwiki.auth.authorize.Role;
+import com.ecyrd.jspwiki.preferences.Preferences;
/**
* Servlet request wrapper that encapsulates an incoming HTTP request and
* overrides its security methods so that the request returns JSPWiki-specific
- * values.
+ * values. It also ensures that the user's {@link java.util.Locale} preference
+ * is respected by ensuring that the {@link #getLocale()} returns a preferred
+ * Locale matching what the user supplies in the
+ * {@link com.ecyrd.jspwiki.preferences.Preferences#PREFS_LOCALE} cookie. This
+ * Locale will also be returned at the top of the enumeration returned by
+ * {@link #getLocales()}.
*
* @author Andrew Jaquith
* @since 2.8
@@ -42,20 +51,56 @@
{
private final WikiSession m_session;
+ private final Locale m_locale;
+
/**
* Constructs a new wrapped request.
*
- * @param engine
- * the wiki engine
- * @param request
- * the request to wrap
+ * @param engine the wiki engine
+ * @param request the request to wrap
*/
- public WikiRequestWrapper(WikiEngine engine, HttpServletRequest request)
+ public WikiRequestWrapper( WikiEngine engine, HttpServletRequest request )
{
- super(request);
+ super( request );
// Get and stash a reference to the current WikiSession
- m_session = SessionMonitor.getInstance(engine).find(request.getSession());
+ m_session = SessionMonitor.getInstance( engine ).find( request.getSession() );
+
+ // Figure out the user's preferred Locale based on the cookie value, if supplied
+ Locale locale = Preferences.getLocale( request );
+ m_locale = request.getLocale().equals( locale ) ? null : locale;
+ }
+
+ /**
+ * {@inheritDoc}. If the user supplied a preferred locale via the cookie
+ * value {@link com.ecyrd.jspwiki.preferences.Preferences#PREFS_LOCALE},
+ * that value is returned in preference.
+ */
+ public Locale getLocale()
+ {
+ return m_locale == null ? super.getLocale() : m_locale;
+ }
+
+ /**
+ * {@inheritDoc}. If the user supplied a preferred locale via the cookie
+ * value {@link com.ecyrd.jspwiki.preferences.Preferences#PREFS_LOCALE},
+ * that value is returned as the first item in the array.
+ */
+ public Enumeration getLocales()
+ {
+ Enumeration requestLocales = super.getLocales();
+ if( m_locale == null )
+ {
+ return requestLocales;
+ }
+
+ Vector<Locale> locales = new Vector<Locale>();
+ locales.add( m_locale );
+ for( Enumeration e = requestLocales; e.hasMoreElements(); )
+ {
+ locales.add( (Locale)e.nextElement() );
+ }
+ return locales.elements();
}
/**
@@ -69,12 +114,12 @@
*/
public String getRemoteUser()
{
- if (super.getRemoteUser() != null)
+ if( super.getRemoteUser() != null )
{
return super.getRemoteUser();
}
- if (m_session.isAuthenticated())
+ if( m_session.isAuthenticated() )
{
return m_session.getLoginPrincipal().getName();
}
@@ -92,12 +137,12 @@
*/
public Principal getUserPrincipal()
{
- if (super.getUserPrincipal() != null)
+ if( super.getUserPrincipal() != null )
{
return super.getUserPrincipal();
}
- if (m_session.isAuthenticated())
+ if( m_session.isAuthenticated() )
{
return m_session.getLoginPrincipal();
}
@@ -113,22 +158,22 @@
* ASSERTED, AUTHENTICATED) returned by {@link WikiSession#getRoles()} and
* checks to see if any of these principals' names match the supplied role.
*/
- public boolean isUserInRole(String role)
+ public boolean isUserInRole( String role )
{
- boolean hasContainerRole = super.isUserInRole(role);
- if (hasContainerRole)
+ boolean hasContainerRole = super.isUserInRole( role );
+ if( hasContainerRole )
{
return true;
}
// Iterate through all of the built-in roles and look for a match
Principal[] principals = m_session.getRoles();
- for (int i = 0; i < principals.length; i++)
+ for( int i = 0; i < principals.length; i++ )
{
- if (principals[i] instanceof Role)
+ if( principals[i] instanceof Role )
{
Role principal = (Role) principals[i];
- if (Role.isBuiltInRole(principal) && principal.getName().equals(role))
+ if( Role.isBuiltInRole( principal ) && principal.getName().equals( role ) )
{
return true;
}
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiServletFilter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiServletFilter.java?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiServletFilter.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiServletFilter.java Fri Dec 19 20:34:18 2008
@@ -29,6 +29,8 @@
import com.ecyrd.jspwiki.log.Logger;
import com.ecyrd.jspwiki.log.LoggerFactory;
+import com.ecyrd.jspwiki.preferences.Preferences;
+
import org.slf4j.MDC;
import com.ecyrd.jspwiki.WikiContext;
@@ -128,6 +130,9 @@
// If we haven't done so, wrap the request
HttpServletRequest httpRequest = (HttpServletRequest) request;
+
+ // Set up user preferences
+ Preferences.setupPreferences( httpRequest );
// Set the character encoding
httpRequest.setCharacterEncoding( m_engine.getContentEncoding() );
@@ -154,8 +159,11 @@
// Prepare the WikiSession
try
{
+ // Execute the login stack
m_engine.getAuthenticationManager().login( httpRequest );
WikiSession wikiSession = SessionMonitor.getInstance( m_engine ).find( httpRequest.getSession() );
+
+ // Wrap the request
httpRequest = new WikiRequestWrapper( m_engine, httpRequest );
if ( log.isDebugEnabled() )
{
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/migrator/JSPWikiJspTransformer.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/migrator/JSPWikiJspTransformer.java?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/migrator/JSPWikiJspTransformer.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/migrator/JSPWikiJspTransformer.java Fri Dec 19 20:34:18 2008
@@ -231,6 +231,7 @@
{
tag.addAttribute( new Attribute( doc, "event", event ) );
}
+ tag.addAttribute( new Attribute( doc, "id", "wikiActionBean" ) );
// Create linebreak
Text linebreak = new Text( doc );
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/migrator/JspDocument.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/migrator/JspDocument.java?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/migrator/JspDocument.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/migrator/JspDocument.java Fri Dec 19 20:34:18 2008
@@ -156,7 +156,7 @@
* directive in the document.
*
* @param uri the URI of the taglib to add,
- * <em>e.g.,</em><code>/WEB-INF/stripes.tld</code>
+ * <em>e.g.,</em><code>http://stripes.sourceforge.net/stripes.tld</code>
* @param prefix the prefix for the tablib,
* <em>e.g.,</em><code>stripes</code>
*/
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/migrator/StripesJspTransformer.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/migrator/StripesJspTransformer.java?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/migrator/StripesJspTransformer.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/migrator/StripesJspTransformer.java Fri Dec 19 20:34:18 2008
@@ -15,6 +15,8 @@
*/
public class StripesJspTransformer extends AbstractJspTransformer
{
+ private static final String STRIPES_TAGLIB_URI = "http://stripes.sourceforge.net/stripes.tld";
+
private Map<Class<? extends ActionBean>, Set<String>> beanProperties = new HashMap<Class<? extends ActionBean>, Set<String>>();
private Map<String, Class<? extends ActionBean>> beanBindings = new HashMap<String, Class<? extends ActionBean>>();
@@ -163,7 +165,7 @@
* the <code>prefix</code> set to <code>stripes</code>; any
* <code>uri</code> value is acceptable. If the taglib declaration is
* added, it is given the prefix <code>stripes</code> and the URI
- * <code>/WEB-INF/stripes.tld</code>.
+ * <code>http://stripes.sourceforge.net/stripes.tld</code>.
*
* @param doc the JspDocument to process
* @return <code>true</code> if the Stripes taglib declaration was
@@ -175,9 +177,21 @@
List<Tag> nodes = doc.getTaglibDirective( "*", "stripes" );
if( nodes.size() == 0 )
{
- doc.addTaglibDirective( "/WEB-INF/stripes.tld", "stripes" );
+ doc.addTaglibDirective( STRIPES_TAGLIB_URI, "stripes" );
return true;
}
+ for ( Tag tag : nodes )
+ {
+ Attribute attr = tag.getAttribute( "uri" );
+ if ( attr == null )
+ {
+ tag.addAttribute( new Attribute( doc, "uri", STRIPES_TAGLIB_URI ) );
+ }
+ else if ( !STRIPES_TAGLIB_URI.equals( attr.getValue() ) )
+ {
+ attr.setValue( STRIPES_TAGLIB_URI );
+ }
+ }
return true;
}
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/stripes/DefaultWikiContext.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/stripes/DefaultWikiContext.java?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/stripes/DefaultWikiContext.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/stripes/DefaultWikiContext.java Fri Dec 19 20:34:18 2008
@@ -34,7 +34,6 @@
import com.ecyrd.jspwiki.WikiSession;
import com.ecyrd.jspwiki.auth.WikiPrincipal;
import com.ecyrd.jspwiki.auth.permissions.AllPermission;
-import com.ecyrd.jspwiki.preferences.Preferences;
/**
* <p>
@@ -134,8 +133,8 @@
}
/**
- * Locates the i18n ResourceBundle given. This method interprets the request
- * locale, and uses that to figure out which language the user wants.
+ * Locates the i18n ResourceBundle, based on the {@link java.util.Locale} object
+ * returned by {@link javax.servlet.http.HttpServletRequest#getLocale()}.
*
* @see com.ecyrd.jspwiki.i18n.InternationalizationManager
* @param bundle The name of the bundle you are looking for.
@@ -146,7 +145,7 @@
// something...
public ResourceBundle getBundle( String bundle ) throws MissingResourceException
{
- Locale loc = Preferences.getLocale( this );
+ Locale loc = getHttpRequest().getLocale();
ResourceBundle b = m_engine.getInternationalizationManager().getBundle( bundle, loc );
Added: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/stripes/LocaleConverter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/stripes/LocaleConverter.java?rev=728235&view=auto
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/stripes/LocaleConverter.java (added)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/stripes/LocaleConverter.java Fri Dec 19 20:34:18 2008
@@ -0,0 +1,80 @@
+/* Copyright 2005-2006 Tim Fennell
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.ecyrd.jspwiki.ui.stripes;
+
+import java.util.Collection;
+import java.util.Locale;
+
+import net.sourceforge.stripes.validation.TypeConverter;
+import net.sourceforge.stripes.validation.ValidationError;
+
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * Stripes type converter that converts a Locale name, expressed as a String,
+ * into an {@link java.util.Locale} object. This converter
+ * is looked up and returned by the Stripes
+ * {@link net.sourceforge.stripes.validation.TypeConverterFactory} for HTTP
+ * request parameters that need to be bound to ActionBean properties of type
+ * Locale. Stripes executes this TypeConverter during the
+ * {@link net.sourceforge.stripes.controller.LifecycleStage#BindingAndValidation}
+ * stage of request processing.
+ *
+ * @author Andrew Jaquith
+ */
+public class LocaleConverter implements TypeConverter<Locale>
+{
+
+ /**
+ * Converts a named Locale, passed as a String, into a valid
+ * {@link java.util.Locale} object. If a Locale cannot be parsed, it
+ * will return <code>null</code>. This method will not
+ * ever return errors.
+ *
+ * @param locale the locale to create
+ * @param targetType the type to return, which will always be of type
+ * {@link java.util.Locale}
+ * @param errors the current Collection of validation errors for this field
+ * @return the
+ */
+ public Locale convert( String locale, Class<? extends Locale> targetType, Collection<ValidationError> errors )
+ {
+ if ( locale == null )
+ {
+ return null;
+ }
+
+ String language = "";
+ String country = "";
+ String variant = "";
+
+ String[] res = StringUtils.split( locale, "-_" );
+
+ if( res.length > 2 ) variant = res[2];
+ if( res.length > 1 ) country = res[1];
+
+ if( res.length > 0 )
+ {
+ language = res[0];
+
+ return new Locale( language, country, variant );
+ }
+ return null;
+ }
+
+ public void setLocale( Locale locale )
+ {
+ };
+}
Added: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/stripes/TimeZoneConverter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/stripes/TimeZoneConverter.java?rev=728235&view=auto
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/stripes/TimeZoneConverter.java (added)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/stripes/TimeZoneConverter.java Fri Dec 19 20:34:18 2008
@@ -0,0 +1,58 @@
+/* Copyright 2005-2006 Tim Fennell
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.ecyrd.jspwiki.ui.stripes;
+
+import java.util.Collection;
+import java.util.Locale;
+import java.util.TimeZone;
+
+import net.sourceforge.stripes.validation.TypeConverter;
+import net.sourceforge.stripes.validation.ValidationError;
+
+/**
+ * Stripes type converter that converts a {@link java.util.TimeZone}, expressed
+ * as a String, into a TimeZone object. This converter is looked up and returned
+ * by the Stripes
+ * {@link net.sourceforge.stripes.validation.TypeConverterFactory} for HTTP
+ * request parameters that need to be bound to ActionBean properties of type
+ * TimeZone. Stripes executes this TypeConverter during the
+ * {@link net.sourceforge.stripes.controller.LifecycleStage#BindingAndValidation}
+ * stage of request processing.
+ *
+ * @author Andrew Jaquith
+ */
+public class TimeZoneConverter implements TypeConverter<TimeZone>
+{
+
+ /**
+ * Converts a named TimeZone, passed as a String, into a valid
+ * {@link java.util.TimeZone} object. If a TimeZone cannot be parsed, it will
+ * return <code>null</code>. This method will not ever return errors.
+ *
+ * @param timeZone the TimeZone to create; must be equivalent to {@link java.util.TimeZone#getID()}
+ * @param targetType the type to return, which will always be of type
+ * {@link java.util.Locale}
+ * @param errors the current Collection of validation errors for this field
+ * @return the time zone
+ */
+ public TimeZone convert( String timeZone, Class<? extends TimeZone> targetType, Collection<ValidationError> errors )
+ {
+ return TimeZone.getTimeZone( timeZone );
+ }
+
+ public void setLocale( Locale locale )
+ {
+ };
+}
Modified: incubator/jspwiki/trunk/src/webdocs/Captcha.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/Captcha.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/Captcha.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/Captcha.jsp Fri Dec 19 20:34:18 2008
@@ -10,7 +10,7 @@
<%@ page errorPage="/Error.jsp" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.ViewActionBean" event="view" />
Modified: incubator/jspwiki/trunk/src/webdocs/Comment.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/Comment.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/Comment.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/Comment.jsp Fri Dec 19 20:34:18 2008
@@ -16,7 +16,7 @@
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<%@ page import="com.ecyrd.jspwiki.util.TextUtil" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.CommentActionBean" event="comment" />
<%!
Modified: incubator/jspwiki/trunk/src/webdocs/CookieError.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/CookieError.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/CookieError.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/CookieError.jsp Fri Dec 19 20:34:18 2008
@@ -1,6 +1,6 @@
<%@ page import="com.ecyrd.jspwiki.*" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.ViewActionBean" event="view" />
<%
Modified: incubator/jspwiki/trunk/src/webdocs/CreateProfile.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/CreateProfile.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/CreateProfile.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/CreateProfile.jsp Fri Dec 19 20:34:18 2008
@@ -1,5 +1,5 @@
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
-<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.UserProfileActionBean" event="create" />
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
+<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.UserProfileActionBean" event="create" id="wikiActionBean" />
<stripes:layout-render name="/templates/default/ViewLayout.jsp">
<stripes:layout-component name="content">
<jsp:include page="/templates/default/CreateProfileContent.jsp" />
Modified: incubator/jspwiki/trunk/src/webdocs/Delete.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/Delete.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/Delete.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/Delete.jsp Fri Dec 19 20:34:18 2008
@@ -5,7 +5,7 @@
<%@ page import="com.ecyrd.jspwiki.attachment.Attachment" %>
<%@ page errorPage="/Error.jsp" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.DeleteActionBean" event="delete" />
<%!
Modified: incubator/jspwiki/trunk/src/webdocs/Diff.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/Diff.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/Diff.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/Diff.jsp Fri Dec 19 20:34:18 2008
@@ -5,7 +5,7 @@
<%@ page import="com.ecyrd.jspwiki.tags.InsertDiffTag" %>
<%@ page errorPage="/Error.jsp" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.EditActionBean" event="diff" />
<%!
Modified: incubator/jspwiki/trunk/src/webdocs/Edit.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/Edit.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/Edit.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/Edit.jsp Fri Dec 19 20:34:18 2008
@@ -8,7 +8,7 @@
<%@ page import="com.ecyrd.jspwiki.workflow.DecisionRequiredException" %>
<%@ page errorPage="/Error.jsp" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<%@ page import="com.ecyrd.jspwiki.util.TextUtil" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.EditActionBean" event="edit" />
Modified: incubator/jspwiki/trunk/src/webdocs/Error.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/Error.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/Error.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/Error.jsp Fri Dec 19 20:34:18 2008
@@ -4,12 +4,12 @@
<%@ page import="com.ecyrd.jspwiki.*" %>
<%@ page import="com.ecyrd.jspwiki.action.*" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<%@ page import="com.ecyrd.jspwiki.util.FileUtil" %>
<%!
Logger log = LoggerFactory.getLogger("JSPWiki");
%>
-<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.ErrorActionBean" />
+<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.ErrorActionBean" id="wikiActionBean" />
<%
WikiEngine wiki = WikiEngine.getInstance( getServletConfig() );
WikiContext wikiContext = WikiContextFactory.findContext( pageContext );
Modified: incubator/jspwiki/trunk/src/webdocs/Install.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/Install.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/Install.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/Install.jsp Fri Dec 19 20:34:18 2008
@@ -8,7 +8,7 @@
<%@ page import="java.util.ResourceBundle" %>
<%@ page import="java.text.MessageFormat" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.InstallActionBean" event="install" />
Modified: incubator/jspwiki/trunk/src/webdocs/LoginForm.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/LoginForm.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/LoginForm.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/LoginForm.jsp Fri Dec 19 20:34:18 2008
@@ -1,5 +1,5 @@
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
-<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.LoginActionBean" event="view" />
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
+<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.LoginActionBean" event="view" id="wikiActionBean" />
<stripes:layout-render name="/templates/default/ViewLayout.jsp">
<stripes:layout-component name="content">
<jsp:include page="/templates/default/LoginContent.jsp" />
Modified: incubator/jspwiki/trunk/src/webdocs/Message.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/Message.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/Message.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/Message.jsp Fri Dec 19 20:34:18 2008
@@ -6,7 +6,7 @@
<%@ page import="com.ecyrd.jspwiki.ui.stripes.*" %>
<%@ page import="com.ecyrd.jspwiki.tags.WikiTagBase" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<%!
Logger log = LoggerFactory.getLogger("JSPWiki");
%>
Modified: incubator/jspwiki/trunk/src/webdocs/NewBlogEntry.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/NewBlogEntry.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/NewBlogEntry.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/NewBlogEntry.jsp Fri Dec 19 20:34:18 2008
@@ -4,7 +4,7 @@
<%@ page import="com.ecyrd.jspwiki.plugin.*" %>
<%@ page errorPage="/Error.jsp" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.EditActionBean" event="edit" />
<%!
Logger log = LoggerFactory.getLogger("JSPWiki");
Modified: incubator/jspwiki/trunk/src/webdocs/PageInfo.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/PageInfo.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/PageInfo.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/PageInfo.jsp Fri Dec 19 20:34:18 2008
@@ -1,5 +1,5 @@
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
-<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.ViewActionBean" event="info" />
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
+<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.ViewActionBean" event="info" id="wikiActionBean" />
<stripes:layout-render name="/templates/default/ViewLayout.jsp">
<stripes:layout-component name="content">
<jsp:include page="/templates/default/InfoContent.jsp" />
Modified: incubator/jspwiki/trunk/src/webdocs/PageModified.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/PageModified.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/PageModified.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/PageModified.jsp Fri Dec 19 20:34:18 2008
@@ -5,7 +5,7 @@
<%@ page import="com.ecyrd.jspwiki.ui.EditorManager" %>
<%@ page errorPage="/Error.jsp" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<%@ page import="com.ecyrd.jspwiki.util.TextUtil" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.PageModifiedActionBean" event="conflict" />
Modified: incubator/jspwiki/trunk/src/webdocs/Preview.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/Preview.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/Preview.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/Preview.jsp Fri Dec 19 20:34:18 2008
@@ -6,7 +6,7 @@
<%@ page import="com.ecyrd.jspwiki.ui.EditorManager" %>
<%@ page errorPage="/Error.jsp" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.EditActionBean" event="preview" />
<%!
Logger log = LoggerFactory.getLogger("JSPWiki");
Modified: incubator/jspwiki/trunk/src/webdocs/Rename.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/Rename.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/Rename.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/Rename.jsp Fri Dec 19 20:34:18 2008
@@ -7,7 +7,7 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<%@ page import="com.ecyrd.jspwiki.util.TextUtil" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.RenameActionBean" event="rename" />
<%!
Modified: incubator/jspwiki/trunk/src/webdocs/Search.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/Search.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/Search.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/Search.jsp Fri Dec 19 20:34:18 2008
@@ -7,7 +7,7 @@
<%@ page errorPage="/Error.jsp" %>
<%@ page import="com.ecyrd.jspwiki.search.*" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<%@ page import="com.ecyrd.jspwiki.util.TextUtil" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.SearchActionBean" event="find" />
Modified: incubator/jspwiki/trunk/src/webdocs/Upload.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/Upload.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/Upload.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/Upload.jsp Fri Dec 19 20:34:18 2008
@@ -3,7 +3,7 @@
<%@ page import="com.ecyrd.jspwiki.*" %>
<%@ page errorPage="/Error.jsp" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.UploadActionBean" event="upload" />
<%!
Logger log = LoggerFactory.getLogger("JSPWiki");
Modified: incubator/jspwiki/trunk/src/webdocs/UserPreferences.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/UserPreferences.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/UserPreferences.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/UserPreferences.jsp Fri Dec 19 20:34:18 2008
@@ -1,5 +1,5 @@
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
-<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.UserPreferencesActionBean" event="prefs" />
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
+<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.UserPreferencesActionBean" event="prefs" id="wikiActionBean" />
<stripes:layout-render name="/templates/default/ViewLayout.jsp">
<stripes:layout-component name="content">
<jsp:include page="/templates/default/PreferencesContent.jsp" />
Modified: incubator/jspwiki/trunk/src/webdocs/Wiki.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/Wiki.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/Wiki.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/Wiki.jsp Fri Dec 19 20:34:18 2008
@@ -1,10 +1,7 @@
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
-<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.ViewActionBean" event="view" />
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
+<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.ViewActionBean" event="view" id="wikiActionBean" id="wikiActionBean" />
<stripes:layout-render name="/templates/default/ViewLayout.jsp">
<stripes:layout-component name="content">
<jsp:include page="/templates/default/PageContent.jsp" />
- <!--
- <wiki:Include page="/templates/default/PageContent.jsp" />
- -->
</stripes:layout-component>
</stripes:layout-render>
Modified: incubator/jspwiki/trunk/src/webdocs/Workflow.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/Workflow.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/Workflow.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/Workflow.jsp Fri Dec 19 20:34:18 2008
@@ -12,7 +12,7 @@
<%@ page import="com.ecyrd.jspwiki.workflow.Workflow" %>
<%@ page errorPage="/Error.jsp" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.WorkflowActionBean" event="view" />
<%!
Modified: incubator/jspwiki/trunk/src/webdocs/admin/SecurityConfig.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/admin/SecurityConfig.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/admin/SecurityConfig.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/admin/SecurityConfig.jsp Fri Dec 19 20:34:18 2008
@@ -5,7 +5,7 @@
<%@ page import="com.ecyrd.jspwiki.*" %>
<%@ page import="com.ecyrd.jspwiki.auth.*" %>
<%@ page errorPage="/Error.jsp" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<%@ page import="com.ecyrd.jspwiki.util.TextUtil" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.NoneActionBean" event="none" />
<%!
Modified: incubator/jspwiki/trunk/src/webdocs/templates/default/AJAXCategories.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/AJAXCategories.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/templates/default/AJAXCategories.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/templates/default/AJAXCategories.jsp Fri Dec 19 20:34:18 2008
@@ -1,6 +1,6 @@
<%@ page import="com.ecyrd.jspwiki.*" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.ViewActionBean" event="view" />
<%!
public void jspInit()
Modified: incubator/jspwiki/trunk/src/webdocs/templates/default/AJAXPreview.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/AJAXPreview.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/templates/default/AJAXPreview.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/templates/default/AJAXPreview.jsp Fri Dec 19 20:34:18 2008
@@ -7,7 +7,7 @@
<%@ page import="com.ecyrd.jspwiki.auth.permissions.*" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.ViewActionBean" event="view" />
<%!
public void jspInit()
Modified: incubator/jspwiki/trunk/src/webdocs/templates/default/AJAXSearch.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/AJAXSearch.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/templates/default/AJAXSearch.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/templates/default/AJAXSearch.jsp Fri Dec 19 20:34:18 2008
@@ -13,7 +13,7 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<%@ page import="com.ecyrd.jspwiki.search.SearchResult" %>
<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.SearchActionBean" event="find" />
<%!
Modified: incubator/jspwiki/trunk/src/webdocs/templates/default/AttachmentTab.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/AttachmentTab.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/templates/default/AttachmentTab.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/templates/default/AttachmentTab.jsp Fri Dec 19 20:34:18 2008
@@ -5,7 +5,7 @@
<%@ page import="com.ecyrd.jspwiki.auth.permissions.*" %>
<%@ page import="java.security.Permission" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<%@ page import="com.ecyrd.jspwiki.action.WikiContextFactory" %>
<%@ page import="com.ecyrd.jspwiki.util.TextUtil" %>
<%
Modified: incubator/jspwiki/trunk/src/webdocs/templates/default/CreateProfileContent.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/CreateProfileContent.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/templates/default/CreateProfileContent.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/templates/default/CreateProfileContent.jsp Fri Dec 19 20:34:18 2008
@@ -5,7 +5,7 @@
<%@ page errorPage="/Error.jsp" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
<wiki:TabbedSection defaultTab="profile">
Modified: incubator/jspwiki/trunk/src/webdocs/templates/default/DiffTab.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/DiffTab.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/templates/default/DiffTab.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/templates/default/DiffTab.jsp Fri Dec 19 20:34:18 2008
@@ -5,7 +5,7 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<%@ page import="com.ecyrd.jspwiki.action.WikiContextFactory" %>
<%
Modified: incubator/jspwiki/trunk/src/webdocs/templates/default/EditGroupContent.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/EditGroupContent.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/templates/default/EditGroupContent.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/templates/default/EditGroupContent.jsp Fri Dec 19 20:34:18 2008
@@ -9,7 +9,7 @@
<%@ page import="com.ecyrd.jspwiki.log.LoggerFactory" %>
<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
<%@ page errorPage="/Error.jsp" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<%@ page import="com.ecyrd.jspwiki.action.WikiContextFactory" %>
<%@ page import="com.ecyrd.jspwiki.util.TextUtil" %>
<%!
Modified: incubator/jspwiki/trunk/src/webdocs/templates/default/EditLayout.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/EditLayout.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/templates/default/EditLayout.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/templates/default/EditLayout.jsp Fri Dec 19 20:34:18 2008
@@ -1,6 +1,6 @@
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<stripes:layout-definition>
Modified: incubator/jspwiki/trunk/src/webdocs/templates/default/FindContent.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/FindContent.jsp?rev=728235&r1=728234&r2=728235&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/templates/default/FindContent.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/templates/default/FindContent.jsp Fri Dec 19 20:34:18 2008
@@ -7,7 +7,7 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<wiki:TabbedSection>
<wiki:Tab id="findcontent" titleKey="find.tab" accesskey="s">