Index: branches/Wikidata/phase3/includes/EditPage.php |
— | — | @@ -866,7 +866,7 @@ |
867 | 867 | } |
868 | 868 | |
869 | 869 | $content = $this->mArticle->getContentObject(); |
870 | | - return $content->getRawData(); # this editor is for editing the raw text. so use the raw text. |
| 870 | + return $content->getNativeData(); # this editor is for editing the raw text. so use the raw text. |
871 | 871 | } |
872 | 872 | |
873 | 873 | /** |
Index: branches/Wikidata/phase3/includes/Content.php |
— | — | @@ -25,8 +25,10 @@ |
26 | 26 | * as given by getDataModel(). |
27 | 27 | * |
28 | 28 | */ |
29 | | - public abstract function getRawData( ); |
| 29 | + public abstract function getNativeData( ); |
30 | 30 | |
| 31 | + public abstract function getSize( ); |
| 32 | + |
31 | 33 | public abstract function getParserOutput( Title $title = null, $revId = null, ParserOptions $options = NULL ); |
32 | 34 | |
33 | 35 | public function getRedirectChain() { |
— | — | @@ -58,11 +60,9 @@ |
59 | 61 | } |
60 | 62 | |
61 | 63 | #TODO: implement specialized ParserOutput for Wikidata model |
62 | | - #TODO: provide addToParserOutput fule Multipart... somehow. |
| 64 | + #TODO: provide "combined" ParserOutput for Multipart... somehow. |
63 | 65 | |
64 | | - # TODO: EditPage::mergeChanges( Content $a, Content $b ) |
65 | 66 | # TODO: Wikipage::isCountable(Content $a) |
66 | | - # TODO: Title::newFromRedirectRecurse( $this->getRawText() ); |
67 | 67 | |
68 | 68 | # TODO: isCacheable( ) |
69 | 69 | # TODO: getSize( ) |
— | — | @@ -71,7 +71,11 @@ |
72 | 72 | # TODO: WikiPage::getAutosummary( $oldtext, $text, $flags ) |
73 | 73 | |
74 | 74 | # TODO: EditPage::getPreloadedText( $preload ) // $wgParser->getPreloadText |
| 75 | + # TODO: tie into EditPage, make it use Content-objects throughout, make edit form aware of content model and format |
| 76 | + # TODO: make model-aware diff view! |
| 77 | + # TODO: handle ImagePage and CategoryPage |
75 | 78 | |
| 79 | + # TODO: Title::newFromRedirectRecurse( $this->getRawText() ); |
76 | 80 | |
77 | 81 | # TODO: tie into API to provide contentModel for Revisions |
78 | 82 | # TODO: tie into API to provide serialized version and contentFormat for Revisions |
— | — | @@ -94,7 +98,7 @@ |
95 | 99 | * |
96 | 100 | * @return String the raw text |
97 | 101 | */ |
98 | | - public function getRawData( ) { |
| 102 | + public function getNativeData( ) { |
99 | 103 | $text = $this->mText; |
100 | 104 | return $text; |
101 | 105 | } |
— | — | @@ -105,7 +109,7 @@ |
106 | 110 | * @return String the raw text |
107 | 111 | */ |
108 | 112 | public function getSearchText( ) { #FIXME: use! |
109 | | - return $this->getRawData(); |
| 113 | + return $this->getNativeData(); |
110 | 114 | } |
111 | 115 | |
112 | 116 | /** |
— | — | @@ -114,7 +118,7 @@ |
115 | 119 | * @return String the raw text |
116 | 120 | */ |
117 | 121 | public function getWikitextForTransclusion( ) { #FIXME: use! |
118 | | - return $this->getRawData(); |
| 122 | + return $this->getNativeData(); |
119 | 123 | } |
120 | 124 | |
121 | 125 | /** |
— | — | @@ -186,7 +190,7 @@ |
187 | 191 | public function getSection( $section ) { |
188 | 192 | global $wgParser; |
189 | 193 | |
190 | | - $text = $this->getRawData(); |
| 194 | + $text = $this->getNativeData(); |
191 | 195 | $sect = $wgParser->getSection( $text, $section, false ); |
192 | 196 | |
193 | 197 | return new WikitextContent( $sect ); |
— | — | @@ -212,8 +216,8 @@ |
213 | 217 | throw new MWException( "Incompatible content model for section: document uses $myModelName, section uses $sectionModelName." ); |
214 | 218 | } |
215 | 219 | |
216 | | - $oldtext = $this->getRawData(); |
217 | | - $text = $with->getRawData(); |
| 220 | + $oldtext = $this->getNativeData(); |
| 221 | + $text = $with->getNativeData(); |
218 | 222 | |
219 | 223 | if ( $section == 'new' ) { |
220 | 224 | # Inserting a new section |
— | — | @@ -237,7 +241,7 @@ |
238 | 242 | } |
239 | 243 | |
240 | 244 | public function getRedirectChain() { |
241 | | - $text = $this->getRawData(); |
| 245 | + $text = $this->getNativeData(); |
242 | 246 | return Title::newFromRedirectArray( $text ); |
243 | 247 | } |
244 | 248 | |
— | — | @@ -270,7 +274,7 @@ |
271 | 275 | /** |
272 | 276 | * Returns the message as raw text, using the options supplied to the constructor minus "parse" and "parseinline". |
273 | 277 | */ |
274 | | - public function getRawData( ) { |
| 278 | + public function getNativeData( ) { |
275 | 279 | $opt = array_diff( $this->mOptions, array('parse', 'parseinline') ); |
276 | 280 | |
277 | 281 | return wfMsgExt( $this->mMessageKey, $this->mParameters, $opt ); |
— | — | @@ -287,7 +291,7 @@ |
288 | 292 | protected function getHtml( ) { |
289 | 293 | $html = ""; |
290 | 294 | $html .= "<pre class=\"mw-code mw-js\" dir=\"ltr\">\n"; |
291 | | - $html .= htmlspecialchars( $this->getRawData() ); |
| 295 | + $html .= htmlspecialchars( $this->getNativeData() ); |
292 | 296 | $html .= "\n</pre>\n"; |
293 | 297 | |
294 | 298 | return $html; |
— | — | @@ -303,7 +307,7 @@ |
304 | 308 | protected function getHtml( ) { |
305 | 309 | $html = ""; |
306 | 310 | $html .= "<pre class=\"mw-code mw-css\" dir=\"ltr\">\n"; |
307 | | - $html .= htmlspecialchars( $this->getRawData() ); |
| 311 | + $html .= htmlspecialchars( $this->getNativeData() ); |
308 | 312 | $html .= "\n</pre>\n"; |
309 | 313 | |
310 | 314 | return $html; |
Index: branches/Wikidata/phase3/includes/WikiPage.php |
— | — | @@ -429,11 +429,11 @@ |
430 | 430 | return $this->getText( Revision::RAW ); |
431 | 431 | } |
432 | 432 | |
433 | | - protected function getRawData() { |
| 433 | + protected function getNativeData() { |
434 | 434 | $content = $this->getContent( Revision::RAW ); |
435 | 435 | if ( !$content ) return null; |
436 | 436 | |
437 | | - return $content->getRawData(); |
| 437 | + return $content->getNativeData(); |
438 | 438 | } |
439 | 439 | |
440 | 440 | /** |
— | — | @@ -911,7 +911,7 @@ |
912 | 912 | |
913 | 913 | if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { |
914 | 914 | if ( $this->mTitle->exists() ) { |
915 | | - $text = $this->getRawData(); |
| 915 | + $text = $this->getNativeData(); |
916 | 916 | } else { |
917 | 917 | $text = false; |
918 | 918 | } |
— | — | @@ -1265,7 +1265,7 @@ |
1266 | 1266 | $isminor = ( $flags & EDIT_MINOR ) && $user->isAllowed( 'minoredit' ); |
1267 | 1267 | $bot = $flags & EDIT_FORCE_BOT; |
1268 | 1268 | |
1269 | | - $oldtext = $this->getRawData(); // current revision |
| 1269 | + $oldtext = $this->getNativeData(); // current revision |
1270 | 1270 | $oldsize = strlen( $oldtext ); |
1271 | 1271 | $oldid = $this->getLatest(); |
1272 | 1272 | $oldIsRedirect = $this->isRedirect(); |
Index: branches/Wikidata/phase3/includes/api/ApiEditPage.php |
— | — | @@ -112,7 +112,7 @@ |
113 | 113 | $text = ''; |
114 | 114 | } else { |
115 | 115 | $content = $articleObj->getContentObject(); |
116 | | - $text = $content->getRawData(); |
| 116 | + $text = $content->getNativeData(); |
117 | 117 | } |
118 | 118 | |
119 | 119 | if ( !is_null( $params['section'] ) ) { |
Index: branches/Wikidata/phase3/includes/api/ApiParse.php |
— | — | @@ -330,7 +330,7 @@ |
331 | 331 | $pout = $page->getParserOutput( $popts ); |
332 | 332 | if ( $getWikitext ) { |
333 | 333 | $this->content = $page->getContent( Revision::RAW ); #FIXME: use $this->content everywhere |
334 | | - $this->text = $this->content->getRawData(); #FIXME: change $this->text to $this->data?! |
| 334 | + $this->text = $this->content->getNativeData(); #FIXME: change $this->text to $this->data?! |
335 | 335 | } |
336 | 336 | return $pout; |
337 | 337 | } |
Index: branches/Wikidata/phase3/includes/ContentHandler.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | #XXX: or check by model name? |
22 | 22 | #XXX: or define $content->allowRawData()? |
23 | 23 | #XXX: or define $content->getDefaultWikiText()? |
24 | | - return $content->getRawData(); |
| 24 | + return $content->getNativeData(); |
25 | 25 | } |
26 | 26 | |
27 | 27 | #XXX: this must not be used for editing, otherwise we may loose data: |
— | — | @@ -233,7 +233,7 @@ |
234 | 234 | |
235 | 235 | public function serialize( Content $content, $format = null ) { |
236 | 236 | #FIXME: assert format |
237 | | - return $content->getRawData(); |
| 237 | + return $content->getNativeData(); |
238 | 238 | } |
239 | 239 | |
240 | 240 | /** |