Index: trunk/mwdumper/src/org/mediawiki/importer/Page.java |
— | — | @@ -25,13 +25,17 @@ |
26 | 26 | |
27 | 27 | package org.mediawiki.importer; |
28 | 28 | |
| 29 | +import java.util.Hashtable; |
| 30 | + |
29 | 31 | public class Page { |
30 | 32 | public Title Title; |
31 | 33 | public int Id; |
| 34 | + public Hashtable DiscussionThreadingInfo; |
32 | 35 | public String Restrictions; |
33 | 36 | |
34 | 37 | public Page() { |
35 | 38 | // <restrictions> is optional... |
36 | 39 | Restrictions = ""; |
| 40 | + DiscussionThreadingInfo = new Hashtable(); |
37 | 41 | } |
38 | 42 | } |
Index: trunk/mwdumper/src/org/mediawiki/importer/XmlDumpReader.java |
— | — | @@ -114,6 +114,15 @@ |
115 | 115 | startElements.put("namespaces","namespaces"); |
116 | 116 | startElements.put("namespace","namespace"); |
117 | 117 | |
| 118 | + endElements.put("ThreadSubject","ThreadSubject"); |
| 119 | + endElements.put("ThreadParent","ThreadParent"); |
| 120 | + endElements.put("ThreadAncestor","ThreadAncestor"); |
| 121 | + endElements.put("ThreadPage","ThreadPage"); |
| 122 | + endElements.put("ThreadID","ThreadID"); |
| 123 | + endElements.put("ThreadSummaryPage","ThreadSummaryPage"); |
| 124 | + endElements.put("ThreadAuthor","ThreadAuthor"); |
| 125 | + endElements.put("ThreadEditStatus","ThreadEditStatus"); |
| 126 | + endElements.put("ThreadType","ThreadType"); |
118 | 127 | endElements.put("base","base"); |
119 | 128 | endElements.put("case","case"); |
120 | 129 | endElements.put("comment","comment"); |
— | — | @@ -193,6 +202,7 @@ |
194 | 203 | else if (qName == "title") readTitle(); |
195 | 204 | else if (qName == "restrictions") readRestrictions(); |
196 | 205 | // rare tags: |
| 206 | + else if (qName.startsWith("Thread")) threadAttribute(qName); |
197 | 207 | else if (qName == "mediawiki") closeMediaWiki(); |
198 | 208 | else if (qName == "siteinfo") closeSiteinfo(); |
199 | 209 | else if (qName == "sitename") readSitename(); |
— | — | @@ -201,6 +211,7 @@ |
202 | 212 | else if (qName == "case") readCase(); |
203 | 213 | else if (qName == "namespaces") closeNamespaces(); |
204 | 214 | else if (qName == "namespace") closeNamespace(); |
| 215 | +// else throw(SAXException)new SAXException("Unrecognised "+qName+"(substring "+qName.length()+qName.substring(0,6)+")"); |
205 | 216 | } catch (IOException e) { |
206 | 217 | throw (SAXException)new SAXException(e.getMessage()).initCause(e); |
207 | 218 | } |
— | — | @@ -208,6 +219,10 @@ |
209 | 220 | |
210 | 221 | // ---------- |
211 | 222 | |
| 223 | + void threadAttribute(String attrib) throws IOException { |
| 224 | + page.DiscussionThreadingInfo.put(attrib, bufferContents()); |
| 225 | + } |
| 226 | + |
212 | 227 | void openMediaWiki() throws IOException { |
213 | 228 | siteinfo = null; |
214 | 229 | writer.writeStartWiki(); |