[ckan-dev] [ckan-discuss] text_preview extension problem

Dominik Moritz dominik.moritz at okfn.org
Thu Sep 26 20:18:02 UTC 2013


Hey,

The ckan.preview.loadable does not require any plugins but it also just embeds the file in an iframe. I think your browser will not properly handle this filetype so I assume it won't work (I think your browser will suggest a download instead). 

I suggest, you upgrade to have the new text_preview plugin and add `dat` to the types that can be previewed (add it to ckan.preview.text_formats). See[1].

Cheers,
Dominik 

[1] http://docs.ckan.org/en/latest/data-viewer.html#viewing-highlighted-xml-json-and-plain-text-data

On 13 Sep 2013, at 09:03, Pabitra Dash <pkdash_reena at hotmail.com> wrote:

> Dominik,
> 
> I have a text file with .dat extension. As I can view the contents of a text file with .txt extension, I was hoping do get the same view for the .dat file. I included 'dat' as one of the loadables in the in file setting as sown below. However, it does not display the contents of the .dat file. Do I have to have the text_preview extension which needs an upgrade of CKAN? I will be doing the upgrade soon though. 
> 
> 
> 
> 
> ckan.preview.loadable
> = html htm rdf+xml owl+xml xml n3 n-triples turtle plain atom csv tsv rss txt
> json dat
> 
> 
> 
> Pabitra
> 
>> Subject: Re: [ckan-discuss] text_preview extension problem
>> From: dominik.moritz at okfn.org
>> Date: Fri, 13 Sep 2013 08:47:23 -0700
>> CC: ckan-dev at lists.okfn.org
>> To: pkdash_reena at hotmail.com
>> 
>> Hey,
>> 
>> The preview is formally known as json_preview in versions <2.1. The text_preview is only available in CKAN >=2.1.
>> 
>> Dominik
>> 
>> On 13 Sep 2013, at 08:45, Pabitra Dash <pkdash_reena at hotmail.com> wrote:
>> 
>>> Hi Dominik,
>>> 
>>> Thanks for responding to my email. I ran the command as you suggested. But id did not solve the problem. Now when I look inside the ckan's setup.py file I don't see the text_preview plugin included in the list of plugins (as shown below): I also don't see that plugin in the source (CKAN 2.0)
>>> 
>>> [ckan.plugins]
>>> 
>>>   synchronous_search = ckan.lib.search:SynchronousSearchPlugin
>>> 
>>>   stats=ckanext.stats.plugin:StatsPlugin
>>> 
>>>   publisher_form=ckanext.publisher_form.forms:PublisherForm
>>> 
>>>   publisher_dataset_form=ckanext.publisher_form.forms:PublisherDatasetForm
>>> 
>>>   multilingual_dataset=ckanext.multilingual.plugin:MultilingualDataset
>>> 
>>>   multilingual_group=ckanext.multilingual.plugin:MultilingualGroup
>>> 
>>>   multilingual_tag=ckanext.multilingual.plugin:MultilingualTag
>>> 
>>>   organizations=ckanext.organizations.forms:OrganizationForm
>>> 
>>>   organizations_dataset=ckanext.organizations.forms:OrganizationDatasetForm
>>> 
>>>   datastore=ckanext.datastore.plugin:DatastorePlugin
>>> 
>>>   test_tag_vocab_plugin=ckanext.test_tag_vocab_plugin:MockVocabTagsPlugin
>>> 
>>>   resource_proxy=ckanext.resourceproxy.plugin:ResourceProxy
>>> 
>>>   json_preview=ckanext.jsonpreview.plugin:JsonPreview
>>> 
>>>   pdf_preview=ckanext.pdfpreview.plugin:PdfPreview
>>> 
>>>   recline_preview=ckanext.reclinepreview.plugin:ReclinePreview
>>> 
>>>   example_itemplatehelpers=ckanext.example_itemplatehelpers.plugin:ExampleITemplateHelpersPlugin
>>> 
>>>   example_idatasetform=ckanext.example_idatasetform.plugin:ExampleIDatasetFormPlugin
>>> 
>>> 
>>> Pabitra
>>> 
>>> 
>>>> Subject: Re: [ckan-discuss] text_preview extension problem
>>>> From: dominik.moritz at okfn.org
>>>> Date: Thu, 12 Sep 2013 22:10:10 -0700
>>>> CC: ckan-discuss at lists.okfn.org
>>>> To: pkdash_reena at hotmail.com
>>>> 
>>>> Hey,
>>>> 
>>>> Try, `python setup.py develop` in the ckan folder with the virtual env activated. 
>>>> 
>>>> Dominik
>>>> 
>>>> 
>>>> On 12 Sep 2013, at 13:10, Pabitra Dash <pkdash_reena at hotmail.com> wrote:
>>>> 
>>>>> Hello All,
>>>>> 
>>>>> 
>>>>> I am getting PluginNotFoundError  for the text_preview extension which is a core extension.  As per the documentation this extension does not need a separate installation. Any help to fix this error will be very much appreciated.
>>>>> 
>>>>> Thanks,
>>>>> Pabitra
>>>>> 
>>>>> 
>>>>> 		 	   		  _______________________________________________
>>>>> ckan-discuss mailing list
>>>>> ckan-discuss at lists.okfn.org
>>>>> http://lists.okfn.org/mailman/listinfo/ckan-discuss
>>>>> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-discuss
>>>> 
>>>> Dominik Moritz
>>>> CKAN developer  |  skype: d.moritz  |  @doobly_doo
>>>> The Open Knowledge Foundation
>>>> Empowering through Open Knowledge
>>>> http://okfn.org/  |  @okfn  |  http://ckan.org  |  @CKANproject
>>>> 
>>> 		 	   		  
>> 
>> Dominik Moritz
>> CKAN developer  |  skype: d.moritz  |  @doobly_doo
>> The Open Knowledge Foundation
>> Empowering through Open Knowledge
>> http://okfn.org/  |  @okfn  |  http://ckan.org  |  @CKANproject
>> 
> 		 	   		  

Dominik Moritz
CKAN developer  |  skype: d.moritz  |  @doobly_doo
The Open Knowledge Foundation
Empowering through Open Knowledge
http://okfn.org/  |  @okfn  |  http://ckan.org  |  @CKANproject

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130926/a8292f01/attachment-0001.sig>


More information about the ckan-dev mailing list