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/03/21 17:04:09 UTC
[jspwiki] 07/36: add back constructors to ensure page/attachment
backwards compatibility
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 b48d88f979ac125d45e92ba9b7a092033d83575b
Author: juanpablo <ju...@apache.org>
AuthorDate: Fri Mar 20 19:32:54 2020 +0100
add back constructors to ensure page/attachment backwards compatibility
---
jspwiki-main/src/main/java/org/apache/wiki/WikiPage.java | 14 ++++++++++++--
.../main/java/org/apache/wiki/attachment/Attachment.java | 12 ++++++++++++
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/jspwiki-main/src/main/java/org/apache/wiki/WikiPage.java b/jspwiki-main/src/main/java/org/apache/wiki/WikiPage.java
index 1413923..36412f3 100644
--- a/jspwiki-main/src/main/java/org/apache/wiki/WikiPage.java
+++ b/jspwiki-main/src/main/java/org/apache/wiki/WikiPage.java
@@ -51,10 +51,10 @@ public class WikiPage implements Page {
private final Map<String,Object> m_attributes = new HashMap<>();
private Acl m_accessList = null;
-
+
/**
* Create a new WikiPage using a given engine and name.
- *
+ *
* @param engine The Engine that owns this page.
* @param name The name of the page.
*/
@@ -65,6 +65,16 @@ public class WikiPage implements Page {
}
/**
+ * Create a new WikiPage using a given engine and name.
+ *
+ * @param engine The Engine that owns this page.
+ * @param name The name of the page.
+ */
+ public WikiPage( final WikiEngine engine, final String name ) {
+ this( ( Engine )engine, name );
+ }
+
+ /**
* Returns the name of the page.
*
* @return The page name.
diff --git a/jspwiki-main/src/main/java/org/apache/wiki/attachment/Attachment.java b/jspwiki-main/src/main/java/org/apache/wiki/attachment/Attachment.java
index 7f9b068..3b47033 100644
--- a/jspwiki-main/src/main/java/org/apache/wiki/attachment/Attachment.java
+++ b/jspwiki-main/src/main/java/org/apache/wiki/attachment/Attachment.java
@@ -18,6 +18,7 @@
*/
package org.apache.wiki.attachment;
+import org.apache.wiki.WikiEngine;
import org.apache.wiki.WikiPage;
import org.apache.wiki.api.core.Engine;
@@ -45,6 +46,17 @@ public class Attachment extends WikiPage implements org.apache.wiki.api.core.Att
}
/**
+ * Creates a new attachment. The final name of the attachment will be a synthesis of the parent page name and the file name.
+ *
+ * @param engine The Engine which is hosting this attachment.
+ * @param parentPage The page which will contain this attachment.
+ * @param fileName The file name for the attachment.
+ */
+ public Attachment( final WikiEngine engine, final String parentPage, final String fileName ) {
+ this( ( Engine )engine, parentPage, fileName );
+ }
+
+ /**
* Returns a human-readable, only-debugging-suitable description.
*
* @return A debugging string