}
/**
- * Return an EditPage object suitable for editing the given object
+ * Return an EditPage object suitable for editing the given object.
+ * This default implementation always fails with an MWException, because there is no
+ * generic edit page implementation suitable for all content models.
*
* @since WD.1
*
* @return EditPage
*/
public function createEditPage( Article $article ) {
- $this->checkModelID( $article->getPage()->getContentModel() );
-
- $editPage = new EditPage( $article );
- return $editPage;
+ throw new MWException( "ContentHandler class " . get_classs( $this ) . " does not provide an EditPage." );
}
/**
parent::__construct( $modelId, $formats );
}
+ /**
+ * Returns the content's text as-is.
+ *
+ * @param Content $content
+ * @param String|null $format
+ * @return mixed
+ */
public function serializeContent( Content $content, $format = null ) {
$this->checkFormat( $format );
return $content->getNativeData();
}
+ /**
+ * Return an EditPage object for editing the given object
+ *
+ * @since WD.1
+ *
+ * @param Article $article
+ * @return EditPage
+ */
+ public function createEditPage( Article $article ) {
+ $this->checkModelID( $article->getPage()->getContentModel() );
+
+ $editPage = new EditPage( $article );
+ return $editPage;
+ }
+
/**
* attempts to merge differences between three versions.
* Returns a new Content object for a clean merge and false for failure or a conflict.