From fabee46f9029e4feb6ff21c5391565b634ee60e5 Mon Sep 17 00:00:00 2001 From: John Glover Date: Mon, 29 Apr 2013 18:13:41 +0200 Subject: [PATCH] [#531] Add note about /preview URL for resources. --- doc/data-viewer.rst | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/doc/data-viewer.rst b/doc/data-viewer.rst index edfc9480b4e..f8074370591 100644 --- a/doc/data-viewer.rst +++ b/doc/data-viewer.rst @@ -23,6 +23,7 @@ the following sections: * `Viewing structured data: the Data Explorer`_ * `Viewing JSON data`_ * `Viewing PDF documents`_ +* `Embedding Previews In Other Web Pages`_ These sections list the resource formats that each extension can preview and provide instructions for how to enable each extension. @@ -76,10 +77,6 @@ Viewing structured data: the Data Explorer .. versionadded:: 2.0 the ``recline_preview`` extension is new in CKAN 2.0. -.. versionchanged:: 2.0 - The ability to embed data explorer previews in external sites is - not supported in CKAN 2.0. - **Configuration required:** The ``recline_preview`` extension must be added to ``ckan.plugins`` in your CKAN configuration file. This extension is part of CKAN and so does not need to be installed separately. @@ -146,3 +143,17 @@ The ``pdf_preview`` extension provides previews of any ``pdf`` documents that have been added to a CKAN instance (and so are stored in the `Filestore `_) as well as any external ``pdf`` documents. This extension uses Mozilla's `pdf.js `_ library. + + +Embedding Previews In Other Web Pages +------------------------------------- + +.. versionchanged:: 2.0 + The URL that is used to obtain the contents of the resource preview has + changed from ``/dataset/{name}/resource/{resource_id}/embed`` + to ``/dataset/{name}/resource/{resource_id}/preview``. + +For each resource, the preview content can be viewed at +``/dataset/{dataset id}/resource/{resource id}/preview``. +The preview content can therefore be embedded in other web pages by loading +the contents of this URL in an iframe.