Commit Graph

180 Commits

Author SHA1 Message Date
Sean Hammond 85a013f2c9 [#42] Remove non-string extras from packages
Remove extras whose values are not strings (e.g. dicts, lists..) from
packages before attempting to create or update the packages on the
target site.

In CKAN 1 it was possible for the values of extras to be other types,
but in CKAN 2 they must be strings, so when harvesting from a CKAN 1 site
into a CKAN 2 site SQLAlchemy would crash when trying to create packages
with non-string extras.

The fix in this commit is to simply remove any non-string extras from
the harvested package. (Alternatively, we could try to convert them to a
string using JSON.)

Fixes #42.
2013-05-31 15:43:42 +02:00
amercader c1f83e0d3e Strip spaces from url when creating or updating a source 2012-08-17 12:24:41 +01:00
amercader a8aebac965 Fix the harvest object show call 2012-08-09 13:38:17 +01:00
amercader bb5ba43ebb Allow showing harvest objects by default (on the default auth profile) 2012-08-09 13:37:28 +01:00
amercader 4c562e5f5f Do not store the object when importing 2012-08-09 11:17:41 +01:00
amercader e4b3cb440c Do not use repo.are_tables_created
When checking whether the core tables have been alredy created  it is
best to use package_table.exists(), as are_tables_created reflects the
tables, causing conflicts with other extensions.

This allows ckanext-harvest and ckanext-spatial to be used together on
ckan 1.8 onwards.
2012-08-09 11:06:05 +01:00
amercader 4d2fdeac57 Allow defining segments of harvest objects to import
Useful when importing large number of objects, as it allows
parallelization
2012-08-02 18:41:59 +01:00
amercader 7011efe5dc Allow not linking to datasets when importing records
With the -j flag, harvest objects are not linked to datasets when
importing. This is useful sometimes when importing records for the first
time.
2012-07-30 12:11:55 +01:00
David Read 203bcb053b Status can have links in it now. 2012-07-23 16:15:11 +01:00
David Read a61ea06faf Merge branch 'master' of github.com:okfn/ckanext-harvest 2012-07-19 15:27:04 +01:00
David Read 1a4e43a2a9 Status message added - change config to set the text. 2012-07-19 15:17:50 +01:00
amercader 4d00e665f1 [cli] Speed up run command 2012-06-29 11:32:18 +01:00
David Read 5df2b64dda Merge branch 'master' of github.com:okfn/ckanext-harvest 2012-06-15 18:38:33 +01:00
David Read c0a9965b52 Reword warning. 2012-06-15 18:38:22 +01:00
Sean Hammond 528e98120c [#2533] Fix some imports broken by ckan cleanups 2012-06-15 12:08:35 +02:00
David Read ccf0cd3da2 Add copious logging to record what happens in harvesting. 2012-06-08 17:09:22 +01:00
David Read a5fac2ac86 Added logic for getting a harvest source when viewing a dataset. 2012-06-01 17:03:40 +01:00
David Read 5151f4ee23 In publisher auth mode, any member of the group can make the changes. This brings things in line with the general idea that Admins have the power to do this plus authorize other editors/admins. 2012-05-29 15:21:34 +01:00
David Read 017222afd2 Withdrawn language introduced for uklp. 2012-05-28 18:41:03 +01:00
David Read 103eea9d50 Improve layout of sources to span page. 2012-05-28 18:13:34 +01:00
amercader b1a4cc7721 [ui][xs] Nicer button 2012-05-10 11:53:19 +01:00
amercader 3941b691f4 [ui] Fix style for CKAN 1.7 2012-05-09 16:03:03 +01:00
amercader f0a09e8299 [logic] Fix small bug in dictization 2012-05-09 15:58:23 +01:00
David Read 718202d886 Logging is now assured. 2012-04-10 20:53:29 +01:00
David Read 00e911a70c Fix name of the queue logger. Moved imports of ckanext.harvest until after _load_config so that the loggers do not start disabled. 2012-04-10 20:10:17 +01:00
amercader e797f50a05 [cli] Fix create job command 2012-03-19 17:28:53 +00:00
amercader 38a9a03355 [logic] Fix variables naming 2012-03-19 17:01:20 +00:00
Ian Murray 1145e6ea72 [master][auth/publisher] Check for 'ignore_auth' in harvest_object_show
Use case: In ckanext-dgu we want to index the harvest_object.content field.  As indexing is done synchronously we need
to provide a way for that harvest_object to be accessed when the current http request is made by a non-sysadmin user.
2012-03-15 18:14:57 +00:00
Ian Murray 7f10418f44 [master][auth] get_obj_object() function was missing 2012-03-15 18:09:44 +00:00
amercader 871eae94b6 [ckan harvester] Fix bug on force all check 2012-03-15 11:31:12 +00:00
amercader f210455aef [ckan harvester] Replace title on default extras 2012-03-13 12:38:14 +00:00
amercader e0bef2ef9c [base] Minor fix for harvesters without config 2012-03-12 14:46:28 +00:00
amercader 4fe38ec49d [tests,auth] Add tests for the auth profiles
Note that only the tests related to the currently loaded auth
profile will be run.
2012-03-08 16:14:44 +00:00
amercader 4a7007460b [logic] Fix broken imports 2012-03-07 17:08:17 +00:00
amercader 763f07fcad [logic,cli] Add session to the context in cli commands 2012-03-07 15:20:49 +00:00
amercader bf6df2dcd6 Fix merge 2012-03-07 15:04:50 +00:00
amercader 9fcaefe8ff [ui] Fix source datasets paging 2012-03-07 15:03:33 +00:00
amercader 6cccbb61c9 Bug fix, new job count property had not been updated 2012-03-07 12:10:32 +00:00
amercader 124f3191c8 [ui] Add class to config fields so they can be hidden via CSS 2012-03-07 11:56:18 +00:00
amercader d9cfc52643 [ui,auth] Aggregate sources by publisher on the sources list 2012-03-07 11:49:12 +00:00
amercader 97b390f3c1 [auth,logic,ui] Handle publishers on the UI
Add fields for publishers in the form when using the publihser auth
profile. Some changes related to the source schema.
2012-03-06 16:01:43 +00:00
amercader aea785701f [logic,auth] Check that users actually exist 2012-03-06 10:37:31 +00:00
amercader f0e2521d9b [logic,auth] Modify checks to ensure users are admins of their publishers 2012-03-06 10:16:27 +00:00
amercader d98206858d [plugin,auth] Check on startup if ckan is also using the publisher profile 2012-03-05 17:10:02 +00:00
amercader 2a2397c0ed [logic,auth] Implement publisher auth profile
The publisher profile allows general users to handle harvest sources
based on membership to a certain group (publisher), as opposed to the
default auth profile where only sysadmins can perform any harvesting
task.
To enable it, put this directive in your ini file:

    ckan.harvest.auth.profile = publisher

TODO:
 * Save publisher id / user id when creating sources
 * Show publisher in form and index page
2012-03-02 16:49:39 +00:00
amercader 3b68298bba [logic,auth] Use the site user for CLI commands auth checks 2012-03-01 12:46:42 +00:00
amercader a35eb75440 [logic,auth] Add auth logic layer
The first version of the auth layer is based on the current policy, i.e.
you need to be sysadmin to perform any action.

TODO: the CLI is still not working.
2012-03-01 12:02:16 +00:00
amercader c798013752 [logic] Refactor the rest of the logic functions (create,update,delete) 2012-02-29 15:20:35 +00:00
amercader 651474e9f1 [logic] Refactor logic layer to follow CKAN core conventions
To make maintenance easier and better support the upcoming auth checks,
the logic layer has been refactored to mimic the structure of the one on
CKAN core: separate actions and dictize functions and logic functions
receive a context.
Only get functions are included in this commit.
2012-02-29 10:59:02 +00:00
amercader 50537a6738 Merge branch 'master' into enh-1726-harvesting-model-update 2012-02-15 12:01:15 +00:00