[ckan-dev] Problem adding datasets using sh script.

Isabel Ruiz isaruizmellado at gmail.com
Wed Feb 4 12:58:27 UTC 2015


Hi!

Thanks Matt and Adrià!

It finally works!

I have changed type="dataset" and now I can see on datasets list and
"dataset counter" count my new dataset.


Muchas gracias :-) !!!!

On Wed, Feb 4, 2015 at 1:29 PM, Adrià Mercader <adria.mercader at okfn.org>
wrote:

> Hi Isabel,
>
> > type="package",
>
> That's what's causing the issue. Define type as "dataset" or better yet,
> don't use it all unless you are using custom dataset types.
> (And yes, I know that on "member_create" you need "object_type=package" ;)
> )
>
> Search results on the main page filter datasets of type "dataset", that's
> why it's not coming up, even if your dataset was created fine.
>
> Buena suerte,
>
> Adrià
>
>
>
> On 4 February 2015 at 12:19, Matt Fullerton <matt.fullerton at okfn.de>
> wrote:
>
>> Hi Isabel,
>> Have you tried
>>
>> paster --plugin=ckan search-index rebuild -c path/to/production.ini
>>
>> ?
>>
>> --
>> Matt Fullerton
>> Softwareentwickler
>> matt.fullerton at okfn.de
>> +49 89 74560495
>> Open Knowledge Foundation Deutschland e.V.
>> Singerstr. 109
>> 10179 Berlin
>> http://www.okfn.de
>>
>> On 3 February 2015 at 10:06, Isabel Ruiz <isaruizmellado at gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> We are running CKAN 2.2. in Ubuntu..
>>> We have datastore and datapusher.
>>> Actually we have more than 300 datasets on CKAN and it works fine!
>>>
>>> We want to add more than 100 new datasets, so we want to create a sh
>>> batch file for it.
>>>
>>> We have executed sh file (I attached it) adding one dataset, and this
>>> process does not return errors.
>>>
>>>
>>> We have these problems:
>>>
>>> 1- If we go to "datasets list": we notice that this text: "XXX datasets
>>> found" doesn't count new dataset.
>>> 2- "datasets list" does not include our new dataset, I mean: it seems
>>> our dataset doesn't exists.
>>> 3- If we looking for our new dataset using "Search datasets": It does
>>> not find these new dataset.
>>>
>>> If we....
>>> 1- If we go to organizations and we select it organization: CKAN shows
>>> me my new dataset.
>>> 2- If we go to groups and we select it group: CKAN shows me my new
>>> dataset, too.
>>> 3- If we select my new dataset I can see that each field has been
>>> created correctly.
>>> 4- We have used curl command too, and we have same problem.
>>> 5- We have executed this command (I dont know if it is necessary), but
>>> we have same problems we have told you: reindex paster command: paster
>>> --plugin=ckan search-index rebuild --config=/etc/ckan/default/inifile.ini
>>>
>>>
>>> What can be wrong with this process?
>>>
>>> Thanks !
>>>
>>>
>>> malaga = ckanapi.RemoteCKAN('URL',
>>>   apikey='ourapikey',
>>>   user_agent='useragent')
>>>
>>>     package=malaga.action.package_create(
>>>       name="name",
>>>       title="title",
>>>       author="Author",
>>>       author_email="email at malaga.eu",
>>>       license_id="cc-by-sa",
>>>       notes="Notes",
>>>       state="active",
>>>       type="package",
>>>       tags=[{"display_name": "tagdisplay1", "name": "tagname1", "state":
>>> "active"}, {"display_name": "tagdisplay2", "name": "tagname2", "state":
>>> "active"}],
>>>       extras=[{"key": "key1", "value": "key2"}],
>>>       owner_org="organization name")
>>>
>>>     group=malaga.action.member_create(
>>>       id="id",
>>>       object=package['id'],
>>>       object_type="package",
>>>       capacity="admin")
>>>
>>>     resource = malaga.action.resource_create(
>>>       package_id=package['id'],
>>>       url="validURL",
>>>       description="description",
>>>       format='csv',
>>>       name="CSV",
>>>       resource_type='file',
>>>       mimetype='text/csv',
>>>       size=os.path.getsize(sys.argv[1]),
>>>       webstore_url='active')
>>>
>>>
>>>
>>>
>>> --
>>> Isabel M. Ruiz Mellado
>>> http://about.me/isabelruiz
>>>
>>> _______________________________________________
>>> ckan-dev mailing list
>>> ckan-dev at lists.okfn.org
>>> https://lists.okfn.org/mailman/listinfo/ckan-dev
>>> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>>>
>>>
>>
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> https://lists.okfn.org/mailman/listinfo/ckan-dev
>> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>>
>>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
>


-- 
Isabel M. Ruiz Mellado
http://about.me/isabelruiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20150204/e263449b/attachment-0003.html>


More information about the ckan-dev mailing list