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 2009/03/07 00:31:05 UTC
svn commit: r751135 [3/3] - in /incubator/jspwiki/trunk: ./ src/WebContent/
src/WebContent/WEB-INF/ src/WebContent/WEB-INF/classes/
src/WebContent/WEB-INF/classes/templates/ src/WebContent/scripts/
src/WebContent/templates/default/ src/WebContent/templ...
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/EditorManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/EditorManager.java?rev=751135&r1=751134&r2=751135&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/EditorManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/EditorManager.java Fri Mar 6 23:31:03 2009
@@ -23,6 +23,7 @@
import java.net.URL;
import java.util.*;
+import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.PageContext;
import org.apache.wiki.NoSuchVariableException;
@@ -289,6 +290,31 @@
}
/**
+ * Convenience method that examines the current context and attempts to
+ * figure out whether the edited text is in the HTTP request parameters or
+ * somewhere in the session. The request parameter
+ * {@link EditorManager#REQ_EDITEDTEXT} is checked first; then, the session
+ * attribute {@link EditorManager#ATTR_EDITEDTEXT}. This method is similar
+ * in most respects to {@link #getEditedText(PageContext)}
+ * except that this method does not consult the PageContext (because it has
+ * no access to it).
+ *
+ * @return the edited text, if present in the session page context or as a
+ * parameter
+ */
+ public static String getEditedText( HttpServletRequest request )
+ {
+ String usertext = request.getParameter( EditorManager.REQ_EDITEDTEXT );
+
+ if( usertext == null )
+ {
+ usertext = request.getSession().getAttribute( EditorManager.ATTR_EDITEDTEXT ).toString();
+ }
+
+ return usertext;
+ }
+
+ /**
* Contains info about an editor.
*
*/
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/TemplateManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/TemplateManager.java?rev=751135&r1=751134&r2=751135&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/TemplateManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/TemplateManager.java Fri Mar 6 23:31:03 2009
@@ -598,6 +598,7 @@
* @param context the wiki context
* @param type the marker
* @return the generated marker comment
+ * @deprecated use the Stripes <code>layout-component</code> tags instead
*/
public static String getMarker( WikiContext context, String type )
{
@@ -620,6 +621,7 @@
* @return Javascript snippet which defines the LocaliedStrings array
* @author Dirk Frederickx
* @since 2.5.108
+ * @deprecated use the Stripes <code>layout-component</code> tags instead
*/
private static String getJSLocalizedStrings( WikiContext context )
{
@@ -679,6 +681,7 @@
* @param ctx The current wiki context
* @param type What kind of a request should be added?
* @param resource The resource to add.
+ * @deprecated use the Stripes <code>layout-component</code> tags instead
*/
@SuppressWarnings( "unchecked" )
public static void addResourceRequest( WikiContext ctx, String type, String resource )
@@ -738,8 +741,8 @@
* @param ctx WikiContext
* @param type The resource request type
* @return a String array for the resource requests
+ * @deprecated use the Stripes <code>layout-component</code> tags instead
*/
-
@SuppressWarnings( "unchecked" )
public static String[] getResourceRequests( WikiContext ctx, String type )
{
@@ -763,6 +766,7 @@
*
* @param ctx the wiki context
* @return the array of types requested
+ * @deprecated use the Stripes <code>layout-component</code> tags instead
*/
@SuppressWarnings( "unchecked" )
public static String[] getResourceTypes( WikiContext ctx )
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/attachment/AttachmentManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/attachment/AttachmentManagerTest.java?rev=751135&r1=751134&r2=751135&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/attachment/AttachmentManagerTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/attachment/AttachmentManagerTest.java Fri Mar 6 23:31:03 2009
@@ -370,9 +370,9 @@
*/
public void testValidateFileName() throws Exception
{
- assertEquals( "foo.jpg", "foo.jpg", AttachmentManager.validateFileName( "foo.jpg" ) );
+ assertEquals( "foo.jpg", "foo.jpg", AttachmentManager.cleanFileName( "foo.jpg" ) );
- assertEquals( "C:\\Windows\\test.jpg", "test.jpg", AttachmentManager.validateFileName( "C:\\Windows\\test.jpg" ));
+ assertEquals( "C:\\Windows\\test.jpg", "test.jpg", AttachmentManager.cleanFileName( "C:\\Windows\\test.jpg" ));
}
public static Test suite()