You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ju...@apache.org on 2020/01/09 22:17:27 UTC
[jspwiki] 17/32: JSPWIKI-120: move getVersionHistory from
WikiEngine into same method in PageManager
This is an automated email from the ASF dual-hosted git repository.
juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit 806fc47dcd20c4a6b30c4e75d52fc8515648a098
Author: juanpablo <ju...@apache.org>
AuthorDate: Sun Jan 5 17:04:32 2020 +0100
JSPWIKI-120: move getVersionHistory from WikiEngine into same method in PageManager
---
.../src/main/java/org/apache/wiki/WikiEngine.java | 163 +++++++--------------
.../org/apache/wiki/pages/DefaultPageManager.java | 18 ++-
.../java/org/apache/wiki/pages/PageManager.java | 8 +-
.../org/apache/wiki/tags/HistoryIteratorTag.java | 81 ++++------
.../wiki/providers/VersioningFileProviderTest.java | 9 +-
jspwiki-war/src/main/webapp/rss.jsp | 7 +-
.../src/main/webapp/templates/210/DiffTab.jsp | 2 +-
.../src/main/webapp/templates/default/DiffTab.jsp | 2 +-
8 files changed, 111 insertions(+), 179 deletions(-)
diff --git a/jspwiki-main/src/main/java/org/apache/wiki/WikiEngine.java b/jspwiki-main/src/main/java/org/apache/wiki/WikiEngine.java
index 8e60b4c..4a82ada 100644
--- a/jspwiki-main/src/main/java/org/apache/wiki/WikiEngine.java
+++ b/jspwiki-main/src/main/java/org/apache/wiki/WikiEngine.java
@@ -87,7 +87,6 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.Enumeration;
-import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
@@ -1107,29 +1106,23 @@ public class WikiEngine {
}
/**
- * Turns a WikiName into something that can be
- * called through using an URL.
+ * Turns a WikiName into something that can be called through using an URL.
*
* @since 1.4.1
* @param pagename A name. Can be actually any string.
* @return A properly encoded name.
* @see #decodeName(String)
*/
- public String encodeName( String pagename )
- {
- try
- {
+ public String encodeName( final String pagename ) {
+ try {
return URLEncoder.encode( pagename, m_useUTF8 ? "UTF-8" : "ISO-8859-1" );
- }
- catch( UnsupportedEncodingException e )
- {
+ } catch( final UnsupportedEncodingException e ) {
throw new InternalWikiException( "ISO-8859-1 not a supported encoding!?! Your platform is borked." , e);
}
}
/**
- * Decodes a URL-encoded request back to regular life. This properly heeds
- * the encoding as defined in the settings file.
+ * Decodes a URL-encoded request back to regular life. This properly heeds the encoding as defined in the settings file.
*
* @param pagerequest The URL-encoded string to decode
* @return A decoded string.
@@ -1138,14 +1131,13 @@ public class WikiEngine {
public String decodeName( final String pagerequest ) {
try {
return URLDecoder.decode( pagerequest, m_useUTF8 ? "UTF-8" : "ISO-8859-1" );
- } catch( UnsupportedEncodingException e ) {
+ } catch( final UnsupportedEncodingException e ) {
throw new InternalWikiException("ISO-8859-1 not a supported encoding!?! Your platform is borked.", e);
}
}
/**
- * Returns the IANA name of the character set encoding we're
- * supposed to be using right now.
+ * Returns the IANA name of the character set encoding we're supposed to be using right now.
*
* @since 1.5.3
* @return The content encoding (either UTF-8 or ISO-8859-1).
@@ -1158,9 +1150,8 @@ public class WikiEngine {
}
/**
- * Returns the {@link org.apache.wiki.workflow.WorkflowManager} associated with this
- * WikiEngine. If the WIkiEngine has not been initialized, this method will return
- * <code>null</code>.
+ * Returns the {@link org.apache.wiki.workflow.WorkflowManager} associated with this WikiEngine. If the WIkiEngine has not been
+ * initialized, this method will return <code>null</code>.
* @return the task queue
*/
public WorkflowManager getWorkflowManager()
@@ -1169,27 +1160,22 @@ public class WikiEngine {
}
/**
- * Returns the un-HTMLized text of the latest version of a page.
- * This method also replaces the < and & -characters with
- * their respective HTML entities, thus making it suitable
- * for inclusion on an HTML page. If you want to have the
- * page text without any conversions, use getPureText().
+ * Returns the un-HTMLized text of the latest version of a page. This method also replaces the < and & -characters with
+ * their respective HTML entities, thus making it suitable for inclusion on an HTML page. If you want to have the page text
+ * without any conversions, use getPureText().
*
* @param page WikiName of the page to fetch.
* @return WikiText.
*/
- public String getText( String page )
+ public String getText( final String page )
{
return getText( page, WikiPageProvider.LATEST_VERSION );
}
/**
- * Returns the un-HTMLized text of the given version of a page.
- * This method also replaces the < and & -characters with
- * their respective HTML entities, thus making it suitable
- * for inclusion on an HTML page. If you want to have the
- * page text without any conversions, use getPureText().
- *
+ * Returns the un-HTMLized text of the given version of a page. This method also replaces the < and & -characters with
+ * their respective HTML entities, thus making it suitable for inclusion on an HTML page. If you want to have the page text
+ * without any conversions, use getPureText().
*
* @param page WikiName of the page to fetch
* @param version Version of the page to fetch
@@ -1210,14 +1196,10 @@ public class WikiEngine {
}
/**
- * Returns the un-HTMLized text of the given version of a page in
- * the given context. USE THIS METHOD if you don't know what
- * doing.
+ * Returns the un-HTMLized text of the given version of a page in the given context. USE THIS METHOD if you don't know what doing.
* <p>
- * This method also replaces the < and & -characters with
- * their respective HTML entities, thus making it suitable
- * for inclusion on an HTML page. If you want to have the
- * page text without any conversions, use getPureText().
+ * This method also replaces the < and & -characters with their respective HTML entities, thus making it suitable
+ * for inclusion on an HTML page. If you want to have the page text without any conversions, use getPureText().
*
* @since 1.9.15.
* @param context The WikiContext
@@ -1231,8 +1213,7 @@ public class WikiEngine {
}
/**
- * Returns the converted HTML of the page using a different
- * context than the default context.
+ * Returns the converted HTML of the page using a different context than the default context.
*
* @param context A WikiContext in which you wish to render this page in.
* @param page WikiPage reference.
@@ -1255,8 +1236,7 @@ public class WikiEngine {
}
/**
- * Returns the converted HTML of the page's specific version.
- * The version must be a positive integer, otherwise the current
+ * Returns the converted HTML of the page's specific version. The version must be a positive integer, otherwise the current
* version is returned.
*
* @param pagename WikiName of the page to convert.
@@ -1439,17 +1419,17 @@ public class WikiEngine {
* Individual PageFilters, such as the {@link org.apache.wiki.filters.SpamFilter} may also throw a
* {@link org.apache.wiki.api.exceptions.RedirectException}.
*/
- public void saveText( WikiContext context, String text ) throws WikiException {
+ public void saveText( final WikiContext context, final String text ) throws WikiException {
// Check if page data actually changed; bail if not
- WikiPage page = context.getPage();
- String oldText = getPageManager().getPureText( page );
- String proposedText = TextUtil.normalizePostData( text );
+ final WikiPage page = context.getPage();
+ final String oldText = getPageManager().getPureText( page );
+ final String proposedText = TextUtil.normalizePostData( text );
if ( oldText != null && oldText.equals( proposedText ) ) {
return;
}
// Check if creation of empty pages is allowed; bail if not
- boolean allowEmpty = TextUtil.getBooleanProperty( m_properties, PROP_ALLOW_CREATION_OF_EMPTY_PAGES, false );
+ final boolean allowEmpty = TextUtil.getBooleanProperty( m_properties, PROP_ALLOW_CREATION_OF_EMPTY_PAGES, false );
if ( !allowEmpty && !pageExists( page ) && text.trim().equals( "" ) ) {
return;
}
@@ -1457,26 +1437,26 @@ public class WikiEngine {
// Create approval workflow for page save; add the diffed, proposed and old text versions as
// Facts for the approver (if approval is required). If submitter is authenticated, any reject
// messages will appear in his/her workflow inbox.
- WorkflowBuilder builder = WorkflowBuilder.getBuilder( this );
- Principal submitter = context.getCurrentUser();
- Step prepTask = m_tasksManager.buildPreSaveWikiPageTask( context, proposedText );
- Step completionTask = m_tasksManager.buildSaveWikiPageTask();
- String diffText = m_differenceManager.makeDiff( context, oldText, proposedText );
- boolean isAuthenticated = context.getWikiSession().isAuthenticated();
- Fact[] facts = new Fact[ 5 ];
+ final WorkflowBuilder builder = WorkflowBuilder.getBuilder( this );
+ final Principal submitter = context.getCurrentUser();
+ final Step prepTask = m_tasksManager.buildPreSaveWikiPageTask( context, proposedText );
+ final Step completionTask = m_tasksManager.buildSaveWikiPageTask();
+ final String diffText = m_differenceManager.makeDiff( context, oldText, proposedText );
+ final boolean isAuthenticated = context.getWikiSession().isAuthenticated();
+ final Fact[] facts = new Fact[ 5 ];
facts[ 0 ] = new Fact( WorkflowManager.WF_WP_SAVE_FACT_PAGE_NAME, page.getName() );
facts[ 1 ] = new Fact( WorkflowManager.WF_WP_SAVE_FACT_DIFF_TEXT, diffText );
facts[ 2 ] = new Fact( WorkflowManager.WF_WP_SAVE_FACT_PROPOSED_TEXT, proposedText );
facts[ 3 ] = new Fact( WorkflowManager.WF_WP_SAVE_FACT_CURRENT_TEXT, oldText);
- facts[ 4 ] = new Fact( WorkflowManager.WF_WP_SAVE_FACT_IS_AUTHENTICATED, Boolean.valueOf( isAuthenticated ) );
- String rejectKey = isAuthenticated ? WorkflowManager.WF_WP_SAVE_REJECT_MESSAGE_KEY : null;
- Workflow workflow = builder.buildApprovalWorkflow( submitter,
- WorkflowManager.WF_WP_SAVE_APPROVER,
- prepTask,
- WorkflowManager.WF_WP_SAVE_DECISION_MESSAGE_KEY,
- facts,
- completionTask,
- rejectKey );
+ facts[ 4 ] = new Fact( WorkflowManager.WF_WP_SAVE_FACT_IS_AUTHENTICATED, isAuthenticated );
+ final String rejectKey = isAuthenticated ? WorkflowManager.WF_WP_SAVE_REJECT_MESSAGE_KEY : null;
+ final Workflow workflow = builder.buildApprovalWorkflow( submitter,
+ WorkflowManager.WF_WP_SAVE_APPROVER,
+ prepTask,
+ WorkflowManager.WF_WP_SAVE_DECISION_MESSAGE_KEY,
+ facts,
+ completionTask,
+ rejectKey );
m_workflowMgr.start( workflow );
// Let callers know if the page-save requires approval
@@ -1486,28 +1466,6 @@ public class WikiEngine {
}
/**
- * Returns a Collection of WikiPages containing the version history of a page.
- *
- * @param page Name of the page to look for
- * @return an ordered List of WikiPages, each corresponding to a different revision of the page.
- */
- public List< ? extends WikiPage > getVersionHistory( String page ) {
- List< ? extends WikiPage > c = null;
-
- try {
- c = m_pageManager.getVersionHistory( page );
-
- if( c == null ) {
- c = m_attachmentManager.getVersionHistory( page );
- }
- } catch( ProviderException e ) {
- log.error( "FIXME", e );
- }
-
- return c;
- }
-
- /**
* Returns this object's ReferenceManager.
* @return The current ReferenceManager instance.
*
@@ -1547,7 +1505,6 @@ public class WikiEngine {
* Returns the current variable manager.
* @return The current VariableManager.
*/
-
public VariableManager getVariableManager()
{
return m_variableManager;
@@ -1637,23 +1594,19 @@ public class WikiEngine {
}
/**
- * Figure out to which page we are really going to. Considers
- * special page names from the jspwiki.properties, and possible aliases.
- * This method delgates requests to
- * {@link org.apache.wiki.WikiContext#getRedirectURL()}.
+ * Figure out to which page we are really going to. Considers special page names from the jspwiki.properties, and possible aliases.
+ * This method delgates requests to {@link org.apache.wiki.WikiContext#getRedirectURL()}.
* @param context The Wiki Context in which the request is being made.
* @return A complete URL to the new page to redirect to
* @since 2.2
*/
-
public String getRedirectURL( final WikiContext context )
{
return context.getRedirectURL();
}
/**
- * Shortcut to create a WikiContext from a supplied HTTP request,
- * using a default wiki context.
+ * Shortcut to create a WikiContext from a supplied HTTP request, using a default wiki context.
* @param request the HTTP request
* @param requestContext the default context to use
* @return a new WikiContext object.
@@ -1674,8 +1627,7 @@ public class WikiEngine {
}
/**
- * Returns the URL of the global RSS file. May be null, if the
- * RSS file generation is not operational.
+ * Returns the URL of the global RSS file. May be null, if the RSS file generation is not operational.
* @since 1.7.10
* @return The global RSS url
*/
@@ -1690,8 +1642,7 @@ public class WikiEngine {
}
/**
- * Returns the root path. The root path is where the WikiEngine is
- * located in the file system.
+ * Returns the root path. The root path is where the WikiEngine is located in the file system.
*
* @since 2.2
* @return A path to where the Wiki is installed in the local filesystem.
@@ -1711,9 +1662,8 @@ public class WikiEngine {
}
/**
- * Returns the RSSGenerator. If the property <code>jspwiki.rss.generate</code>
- * has not been set to <code>true</code>, this method will return <code>null</code>,
- * <em>and callers should check for this value.</em>
+ * Returns the RSSGenerator. If the property <code>jspwiki.rss.generate</code> has not been set to <code>true</code>, this method
+ * will return <code>null</code>, <em>and callers should check for this value.</em>
* @since 2.1.165
* @return the RSS generator
*/
@@ -1772,11 +1722,9 @@ public class WikiEngine {
}
/**
- * Returns the AclManager employed by this WikiEngine.
- * The AclManager is lazily initialized.
+ * Returns the AclManager employed by this WikiEngine. The AclManager is lazily initialized.
* <p>
- * The AclManager implementing class may be set by the
- * System property {@link #PROP_ACL_MANAGER_IMPL}.
+ * The AclManager implementing class may be set by the System property {@link #PROP_ACL_MANAGER_IMPL}.
* </p>
*
* @since 2.3
@@ -1834,8 +1782,7 @@ public class WikiEngine {
* Registers a WikiEventListener with this instance.
* @param listener the event listener
*/
- public final synchronized void addWikiEventListener( final WikiEventListener listener )
- {
+ public final synchronized void addWikiEventListener( final WikiEventListener listener ) {
WikiEventManager.addWikiEventListener( this, listener );
}
@@ -1843,8 +1790,7 @@ public class WikiEngine {
* Un-registers a WikiEventListener with this instance.
* @param listener the event listener
*/
- public final synchronized void removeWikiEventListener( final WikiEventListener listener )
- {
+ public final synchronized void removeWikiEventListener( final WikiEventListener listener ) {
WikiEventManager.removeWikiEventListener( this, listener );
}
@@ -1869,8 +1815,7 @@ public class WikiEngine {
}
/**
- * Adds an attribute to the engine for the duration of this engine. The
- * value is not persisted.
+ * Adds an attribute to the engine for the duration of this engine. The value is not persisted.
*
* @since 2.4.91
* @param key the attribute name
diff --git a/jspwiki-main/src/main/java/org/apache/wiki/pages/DefaultPageManager.java b/jspwiki-main/src/main/java/org/apache/wiki/pages/DefaultPageManager.java
index 123ce71..07a58d3 100644
--- a/jspwiki-main/src/main/java/org/apache/wiki/pages/DefaultPageManager.java
+++ b/jspwiki-main/src/main/java/org/apache/wiki/pages/DefaultPageManager.java
@@ -359,12 +359,22 @@ public class DefaultPageManager extends ModuleManager implements PageManager {
* @see org.apache.wiki.pages.PageManager#getVersionHistory(java.lang.String)
*/
@Override
- public List< WikiPage > getVersionHistory( final String pageName ) throws ProviderException {
- if( pageExists( pageName ) ) {
- return m_provider.getVersionHistory( pageName );
+ public < T extends WikiPage > List< T > getVersionHistory( final String pageName ) {
+ List< T > c = null;
+
+ try {
+ if( pageExists( pageName ) ) {
+ c = (List< T >)m_provider.getVersionHistory( pageName );
+ }
+
+ if( c == null ) {
+ c = (List< T >)m_engine.getAttachmentManager().getVersionHistory( pageName );
+ }
+ } catch( final ProviderException e ) {
+ LOG.error( "ProviderException requesting version history for " + pageName, e );
}
- return null;
+ return c;
}
/**
diff --git a/jspwiki-main/src/main/java/org/apache/wiki/pages/PageManager.java b/jspwiki-main/src/main/java/org/apache/wiki/pages/PageManager.java
index 1780a5d..9cee4c6 100644
--- a/jspwiki-main/src/main/java/org/apache/wiki/pages/PageManager.java
+++ b/jspwiki-main/src/main/java/org/apache/wiki/pages/PageManager.java
@@ -184,11 +184,11 @@ public interface PageManager extends WikiEventListener {
/**
* Gets a version history of page. Each element in the returned List is a WikiPage.
*
- * @param pageName The name of the page to fetch history for
- * @return If the page does not exist, returns null, otherwise a List of WikiPages.
- * @throws ProviderException If the repository fails.
+ * @param pageName The name of the page or attachment to fetch history for
+ * @return If the page does not exist or there's some problem retrieving the version history, returns null,
+ * otherwise a List of WikiPages / Attachments, each corresponding to a different revision of the page / attachment.
*/
- List<WikiPage> getVersionHistory( String pageName ) throws ProviderException;
+ < T extends WikiPage > List< T > getVersionHistory( String pageName );
/**
* Returns the provider name.
diff --git a/jspwiki-main/src/main/java/org/apache/wiki/tags/HistoryIteratorTag.java b/jspwiki-main/src/main/java/org/apache/wiki/tags/HistoryIteratorTag.java
index c33cd59..694b4a5 100644
--- a/jspwiki-main/src/main/java/org/apache/wiki/tags/HistoryIteratorTag.java
+++ b/jspwiki-main/src/main/java/org/apache/wiki/tags/HistoryIteratorTag.java
@@ -18,18 +18,17 @@
*/
package org.apache.wiki.tags;
-import java.io.IOException;
-import java.util.List;
-
-import javax.servlet.jsp.JspWriter;
-import javax.servlet.jsp.PageContext;
-
import org.apache.log4j.Logger;
import org.apache.wiki.WikiContext;
import org.apache.wiki.WikiEngine;
import org.apache.wiki.WikiPage;
import org.apache.wiki.api.exceptions.ProviderException;
+import javax.servlet.jsp.JspWriter;
+import javax.servlet.jsp.PageContext;
+import java.io.IOException;
+import java.util.List;
+
/**
* Iterates through tags.
*
@@ -40,57 +39,42 @@ import org.apache.wiki.api.exceptions.ProviderException;
*
* @since 2.0
*/
-
// FIXME: Too much in common with IteratorTag - REFACTOR
-public class HistoryIteratorTag
- extends IteratorTag
-{
+public class HistoryIteratorTag extends IteratorTag {
+
private static final long serialVersionUID = 0L;
-
- static Logger log = Logger.getLogger( HistoryIteratorTag.class );
+ private static final Logger LOG = Logger.getLogger( HistoryIteratorTag.class );
@Override
public final int doStartTag() {
m_wikiContext = (WikiContext) pageContext.getAttribute( WikiTagBase.ATTR_CONTEXT, PageContext.REQUEST_SCOPE );
+ final WikiEngine engine = m_wikiContext.getEngine();
+ final WikiPage page = m_wikiContext.getPage();
- WikiEngine engine = m_wikiContext.getEngine();
- WikiPage page;
-
- page = m_wikiContext.getPage();
-
- try
- {
- if( page != null && engine.pageExists(page) )
- {
- @SuppressWarnings("unchecked")
- List< WikiPage > versions = ( List< WikiPage > )engine.getVersionHistory( page.getName() );
+ try {
+ if( page != null && engine.pageExists( page ) ) {
+ final List< WikiPage > versions = engine.getPageManager().getVersionHistory( page.getName() );
- if( versions == null )
- {
+ if( versions == null ) {
// There is no history
return SKIP_BODY;
}
m_iterator = versions.iterator();
- if( m_iterator.hasNext() )
- {
- WikiContext context = (WikiContext)m_wikiContext.clone();
- context.setPage( (WikiPage)m_iterator.next() );
+ if( m_iterator.hasNext() ) {
+ final WikiContext context = ( WikiContext )m_wikiContext.clone();
+ context.setPage( ( WikiPage )m_iterator.next() );
pageContext.setAttribute( WikiTagBase.ATTR_CONTEXT, context, PageContext.REQUEST_SCOPE );
pageContext.setAttribute( getId(), context.getPage() );
- }
- else
- {
+ } else {
return SKIP_BODY;
}
}
return EVAL_BODY_BUFFERED;
- }
- catch( ProviderException e )
- {
- log.fatal("Provider failed while trying to iterator through history",e);
+ } catch( final ProviderException e ) {
+ LOG.fatal("Provider failed while trying to iterator through history",e);
// FIXME: THrow something.
}
@@ -98,27 +82,21 @@ public class HistoryIteratorTag
}
@Override
- public final int doAfterBody()
- {
- if( bodyContent != null )
- {
- try
- {
- JspWriter out = getPreviousOut();
+ public final int doAfterBody() {
+ if( bodyContent != null ) {
+ try {
+ final JspWriter out = getPreviousOut();
out.print(bodyContent.getString());
bodyContent.clearBody();
- }
- catch( IOException e )
- {
- log.error("Unable to get inner tag text", e);
+ } catch( final IOException e ) {
+ LOG.error("Unable to get inner tag text", e);
// FIXME: throw something?
}
}
- if( m_iterator != null && m_iterator.hasNext() )
- {
- WikiContext context = (WikiContext)m_wikiContext.clone();
- context.setPage( (WikiPage)m_iterator.next() );
+ if( m_iterator != null && m_iterator.hasNext() ) {
+ final WikiContext context = ( WikiContext )m_wikiContext.clone();
+ context.setPage( ( WikiPage )m_iterator.next() );
pageContext.setAttribute( WikiTagBase.ATTR_CONTEXT, context, PageContext.REQUEST_SCOPE );
pageContext.setAttribute( getId(), context.getPage() );
return EVAL_BODY_BUFFERED;
@@ -126,4 +104,5 @@ public class HistoryIteratorTag
return SKIP_BODY;
}
+
}
diff --git a/jspwiki-main/src/test/java/org/apache/wiki/providers/VersioningFileProviderTest.java b/jspwiki-main/src/test/java/org/apache/wiki/providers/VersioningFileProviderTest.java
index 5f9f703..5edd440 100644
--- a/jspwiki-main/src/test/java/org/apache/wiki/providers/VersioningFileProviderTest.java
+++ b/jspwiki-main/src/test/java/org/apache/wiki/providers/VersioningFileProviderTest.java
@@ -18,6 +18,7 @@
*/
package org.apache.wiki.providers;
+
import net.sf.ehcache.CacheManager;
import org.apache.wiki.TestEngine;
import org.apache.wiki.WikiContext;
@@ -173,7 +174,7 @@ public class VersioningFileProviderTest
engine.saveText( NAME1, text );
// confirm the right number of versions have been recorded
- Collection versionHistory = engine.getVersionHistory(NAME1);
+ List< WikiPage > versionHistory = engine.getPageManager().getVersionHistory(NAME1);
Assertions.assertEquals( 2, versionHistory.size(), "number of versions" );
// fetch the updated page
@@ -221,7 +222,7 @@ public class VersioningFileProviderTest
engine.saveText( NAME1, text3 );
// confirm the right number of versions have been recorded
- Collection versionHistory = engine.getVersionHistory(NAME1);
+ Collection versionHistory = engine.getPageManager().getVersionHistory(NAME1);
Assertions.assertEquals( 3, versionHistory.size(), "number of versions" );
// fetch the latest version of the page
@@ -288,7 +289,7 @@ public class VersioningFileProviderTest
engine.saveText( NAME1, text3 );
// confirm the right number of versions have been recorded
- Collection versionHistory = engine.getVersionHistory(NAME1);
+ Collection versionHistory = engine.getPageManager().getVersionHistory(NAME1);
Assertions.assertEquals( 3, versionHistory.size(), "number of versions" );
// fetch the latest version of the page
@@ -464,7 +465,7 @@ public class VersioningFileProviderTest
engine.saveText( NAME1, text2 );
engine.saveText( NAME1, text3 );
- Collection history = engine.getVersionHistory(NAME1);
+ Collection history = engine.getPageManager().getVersionHistory(NAME1);
Assertions.assertEquals( 3, history.size(), "size" );
}
diff --git a/jspwiki-war/src/main/webapp/rss.jsp b/jspwiki-war/src/main/webapp/rss.jsp
index 088f329..95f1570 100644
--- a/jspwiki-war/src/main/webapp/rss.jsp
+++ b/jspwiki-war/src/main/webapp/rss.jsp
@@ -100,12 +100,9 @@
if( "blog".equals( mode ) ) {
org.apache.wiki.plugin.WeblogPlugin plug = new org.apache.wiki.plugin.WeblogPlugin();
- changed = plug.findBlogEntries(wiki,
- wikipage.getName(),
- new Date(0L),
- new Date());
+ changed = plug.findBlogEntries( wiki, wikipage.getName(), new Date(0L), new Date() );
} else {
- changed = ( List< WikiPage > )wiki.getVersionHistory( wikipage.getName() );
+ changed = wiki.getPageManager().getVersionHistory( wikipage.getName() );
}
//
diff --git a/jspwiki-war/src/main/webapp/templates/210/DiffTab.jsp b/jspwiki-war/src/main/webapp/templates/210/DiffTab.jsp
index f55b68f..35c0005 100644
--- a/jspwiki-war/src/main/webapp/templates/210/DiffTab.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/DiffTab.jsp
@@ -29,7 +29,7 @@
<%
WikiContext c = WikiContext.findContext( pageContext );
- List history = c.getEngine().getVersionHistory(c.getPage().getName());
+ List history = c.getEngine().getPageManager().getVersionHistory(c.getPage().getName());
pageContext.setAttribute( "history", history );
pageContext.setAttribute( "diffprovider", c.getEngine().getVariableManager().getVariable(c,"jspwiki.diffProvider"));
%>
diff --git a/jspwiki-war/src/main/webapp/templates/default/DiffTab.jsp b/jspwiki-war/src/main/webapp/templates/default/DiffTab.jsp
index 1f7972b..d88f3ef 100644
--- a/jspwiki-war/src/main/webapp/templates/default/DiffTab.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/DiffTab.jsp
@@ -29,7 +29,7 @@
<%
WikiContext c = WikiContext.findContext( pageContext );
%>
-<c:set var="history" value="<%= c.getEngine().getVersionHistory(c.getPage().getName()) %>" />
+<c:set var="history" value="<%= c.getEngine().getPageManager().getVersionHistory(c.getPage().getName()) %>" />
<c:set var="diffprovider" value='<%= c.getEngine().getVariableManager().getVariable(c,"jspwiki.diffProvider") %>' />
<wiki:PageExists>
<form action="<wiki:Link jsp='Diff.jsp' format='url' />"