* as given by getDataModel().
*
*/
- public abstract function getRawData( );
+ public abstract function getNativeData( );
+
+ public abstract function getSize( );
public abstract function getParserOutput( Title $title = null, $revId = null, ParserOptions $options = NULL );
}
#TODO: implement specialized ParserOutput for Wikidata model
- #TODO: provide addToParserOutput fule Multipart... somehow.
+ #TODO: provide "combined" ParserOutput for Multipart... somehow.
- # TODO: EditPage::mergeChanges( Content $a, Content $b )
# TODO: Wikipage::isCountable(Content $a)
- # TODO: Title::newFromRedirectRecurse( $this->getRawText() );
# TODO: isCacheable( )
# TODO: getSize( )
# TODO: WikiPage::getAutosummary( $oldtext, $text, $flags )
# TODO: EditPage::getPreloadedText( $preload ) // $wgParser->getPreloadText
+ # TODO: tie into EditPage, make it use Content-objects throughout, make edit form aware of content model and format
+ # TODO: make model-aware diff view!
+ # TODO: handle ImagePage and CategoryPage
+ # TODO: Title::newFromRedirectRecurse( $this->getRawText() );
# TODO: tie into API to provide contentModel for Revisions
# TODO: tie into API to provide serialized version and contentFormat for Revisions
*
* @return String the raw text
*/
- public function getRawData( ) {
+ public function getNativeData( ) {
$text = $this->mText;
return $text;
}
* @return String the raw text
*/
public function getSearchText( ) { #FIXME: use!
- return $this->getRawData();
+ return $this->getNativeData();
}
/**
* @return String the raw text
*/
public function getWikitextForTransclusion( ) { #FIXME: use!
- return $this->getRawData();
+ return $this->getNativeData();
}
/**
public function getSection( $section ) {
global $wgParser;
- $text = $this->getRawData();
+ $text = $this->getNativeData();
$sect = $wgParser->getSection( $text, $section, false );
return new WikitextContent( $sect );
throw new MWException( "Incompatible content model for section: document uses $myModelName, section uses $sectionModelName." );
}
- $oldtext = $this->getRawData();
- $text = $with->getRawData();
+ $oldtext = $this->getNativeData();
+ $text = $with->getNativeData();
if ( $section == 'new' ) {
# Inserting a new section
}
public function getRedirectChain() {
- $text = $this->getRawData();
+ $text = $this->getNativeData();
return Title::newFromRedirectArray( $text );
}
/**
* Returns the message as raw text, using the options supplied to the constructor minus "parse" and "parseinline".
*/
- public function getRawData( ) {
+ public function getNativeData( ) {
$opt = array_diff( $this->mOptions, array('parse', 'parseinline') );
return wfMsgExt( $this->mMessageKey, $this->mParameters, $opt );
protected function getHtml( ) {
$html = "";
$html .= "<pre class=\"mw-code mw-js\" dir=\"ltr\">\n";
- $html .= htmlspecialchars( $this->getRawData() );
+ $html .= htmlspecialchars( $this->getNativeData() );
$html .= "\n</pre>\n";
return $html;
protected function getHtml( ) {
$html = "";
$html .= "<pre class=\"mw-code mw-css\" dir=\"ltr\">\n";
- $html .= htmlspecialchars( $this->getRawData() );
+ $html .= htmlspecialchars( $this->getNativeData() );
$html .= "\n</pre>\n";
return $html;
return $this->getText( Revision::RAW );
}
- protected function getRawData() {
+ protected function getNativeData() {
$content = $this->getContent( Revision::RAW );
if ( !$content ) return null;
- return $content->getRawData();
+ return $content->getNativeData();
}
/**
if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
if ( $this->mTitle->exists() ) {
- $text = $this->getRawData();
+ $text = $this->getNativeData();
} else {
$text = false;
}
$isminor = ( $flags & EDIT_MINOR ) && $user->isAllowed( 'minoredit' );
$bot = $flags & EDIT_FORCE_BOT;
- $oldtext = $this->getRawData(); // current revision
+ $oldtext = $this->getNativeData(); // current revision
$oldsize = strlen( $oldtext );
$oldid = $this->getLatest();
$oldIsRedirect = $this->isRedirect();