Commit Graph

881 Commits

Author SHA1 Message Date
amercader 9ba6e8f3b3 [#5] Add error summary to harvest_job_dictize
It will return the counts for the 20 most common errors for that
particular job. These will available when calling harvest_job_show.

Also refactor the harvest source status object to just call
harvest_job_dictize on the 'last_job' key, as it has all the
interesting fields anyway.
2013-01-22 13:13:24 +00:00
amercader 0950827329 Merge branch '4-new-auth-for-2.0' into 2.0-dataset-sources 2013-01-22 12:03:26 +00:00
amercader 30c9eedf5f Improve harvest source status creation
Use report_status field to improve speed, remove unnecessary fields.
2013-01-17 15:43:45 +00:00
amercader bfce5185f0 [#4] Add db_to_form_schema_options to harvest plugin to avoid validation on show 2013-01-16 17:45:33 +00:00
amercader 2ab10afcf9 [#4] Fix typo in auth functions 2013-01-16 12:56:58 +00:00
amercader 2f4cd3a4b0 [#4] Fix logic functions importer 2013-01-15 19:29:17 +00:00
amercader 2bb669af21 [#4] Add owner_org field to schema and form
This should store the owner organization id.

Also added the errors box on the form.
2013-01-10 12:23:01 +00:00
kindly acb17ff3b0 capture errors more cleanly 2013-01-10 10:48:48 +00:00
amercader e49dd94b34 [#4] Remove authorization functions for the publisher profile
The different profiles will be now configured via the harvest source
datasets on CKAN core, so they are no longer needed.
2013-01-09 17:35:47 +00:00
amercader 288e1429a6 [#4] Remove the loading of different authorization profiles
The different profiles will be now configured via the harvest source
datasets on CKAN core, so it is no longer needed.

Also simplify IActions and IAuthFunction hook calls.
2013-01-09 17:32:05 +00:00
amercader 058dcad435 [#4] Minor change on the state field to fix a bug on harvest_source_show 2013-01-09 17:31:30 +00:00
amercader a866445023 [#4] Refactor authorization functions
The authorization functions have been refactored to take into account
both the new organizaton based authorization on CKAN core and the
harvest source datasets.

Basically at the source level, authorization checks are forwarded to the
relevant package auth function (package_create, package_update, etc.)
wich will check for organizations membership, sysadmin, etc.

Also we only use functions available on the plugins toolkit whenever
possible.
2013-01-09 17:26:48 +00:00
amercader 1342463f8a Merge branch '2.0-dataset-sources' into 4-new-auth-for-2.0
Conflicts:
	ckanext/harvest/logic/action/get.py
2013-01-09 11:09:34 +00:00
amercader 6b23082010 Move logic from setup_template_variables to helper functions 2013-01-09 11:07:44 +00:00
kindly 7b6beb1470 fix wrong authorization logic 2012-12-24 22:34:37 +00:00
kindly 01dfda59b6 Merge branch 'release-v2.0' into 4-new-auth-for-2.0 2012-12-24 12:46:56 +00:00
kindly 36389e7ce0 make sure gather phase finishes job if there is a severe error 2012-12-24 12:21:21 +00:00
amercader 43950aa4ff Merge branch 'release-v2.0' into 4-new-auth-for-2.0
Conflicts:
	ckanext/harvest/logic/action/get.py
	ckanext/harvest/tests/test_queue.py
2012-12-20 16:38:57 +00:00
amercader 63db45d64a Merge branch 'master' into 4-new-auth-for-2.0 2012-12-20 16:16:39 +00:00
amercader fdac761fba Merge branch 'release-v2.0' into 2.0-dataset-sources
Conflicts:
	ckanext/harvest/logic/action/get.py
	ckanext/harvest/tests/test_queue.py
2012-12-20 16:16:30 +00:00
amercader 19cd80b264 [#4] Fixes on the auth layer against the new core auth
Thanks @locusf for the original patch
2012-12-20 16:09:26 +00:00
amercader 510e2d3725 Fix pager links in harvest source page 2012-12-19 17:27:05 +00:00
kindly b940baacc0 make statistics use new report_field 2012-12-18 02:39:14 +00:00
kindly 6b42d96fe0 add report_status field 2012-12-17 23:50:26 +00:00
kindly 596b9bb475 fix auth to use new sysadmin flag 2012-12-17 23:46:43 +00:00
amercader eb50b440bf Merge branch '2.0-dataset-sources' of github.com:okfn/ckanext-harvest into 2.0-dataset-sources
Conflicts:
	ckanext/harvest/logic/action/update.py
2012-12-14 14:58:09 +00:00
amercader 478326922b Fix tests
* Adapt test_queue to harvest source datasets
* Don't use the same mock harvester on different datasets as it messes
  the tests up
* Skip auth tests for the time being
2012-12-14 14:52:19 +00:00
amercader 6df525a377 Reindex the harvest source dataset after finishing jobs
This ensures that the status details shown on the harvest sources search
page is up to date (as it is loaded from the indexed data_dict)
2012-12-14 14:27:55 +00:00
amercader 96a91dee86 Reindex the harvest source dataset after finishing jobs
This ensures that the status details shown on the harvest sources search
page is up to date (as it is loaded from the indexed data_dict)
2012-12-14 12:39:01 +00:00
amercader c1b0415cb6 Merge branch 'release-v2.0' into 2.0-dataset-sources
Conflicts:
	ckanext/harvest/model/__init__.py
2012-12-13 18:33:59 +00:00
amercader d57e73458a Make harvest object - package FK deferrable
Allows eg to add the harvest object id to the package dict before
indexing.
2012-12-13 18:21:40 +00:00
amercader b424ba1cea Add flag to avoid returning all objects when getting a job 2012-12-13 18:20:49 +00:00
amercader 0dde483992 Set job status to Finished when actually finishing it
Until now, harvest jobs were set to Finished just after sending all
objects to the fetch stage. Now every time the run command is run, jobs
are set to Running, and all previous Running jobs are checked to see if
all harvest objects have a state of Complete or Error. Only then the job
is flagged as Finished.
2012-12-13 18:19:22 +00:00
amercader 81c3881a1a Add active field to source dict 2012-12-13 18:00:07 +00:00
amercader 37efb3b978 Set harvest object state depending on the output of import_stage
Either to COMPLETE or ERROR, depending on whether it returns True or
False.
2012-12-13 14:30:13 +00:00
amercader 0609262731 [#2] Update README link 2012-12-13 13:59:45 +00:00
amercader 4da64a84ae Add more elements to the harvest sources page (still provisional) 2012-12-12 18:49:38 +00:00
amercader e0f3d47cb9 Add extra information to the harvest source page
The status object gives extra information about the source and there is
a helper function to build the dataset list for this particular source.
TODO: Pager still needs fixing.
2012-12-12 11:54:50 +00:00
amercader b567e562f4 Add after_show extension point
We hook into the package_show extension point in order to:

1. For harvest_source type datasets, add extra information about the
source, jobs, etc (calling harvest_source_show_status)
2. For normal datasets, check if they were harvested, and if so, add a
reference to the harvest object and harvest source.
2012-12-12 11:49:55 +00:00
amercader 2557636994 Update endpoints to receive the context object 2012-12-12 11:47:57 +00:00
amercader 8e1621731b Move harvest source status function as a logic function
The status dict is added automatically to harvest source packages.
Note that the actual queries still need to be updated as they proabably
won't scale.
2012-12-12 11:45:13 +00:00
kindly aa2521ee93 bump pika version 2012-12-12 01:08:11 +00:00
amercader b0407bb2ac Update harvest_source_show logic function 2012-12-11 12:49:05 +00:00
amercader fcbe6aa6de Script for creating harvest source datasets on old versions
The way we check whether datasets need to be created might need to be
improved.
2012-12-05 18:54:28 +00:00
amercader 22ec9cb5af Fix old controller import 2012-12-05 18:53:35 +00:00
amercader 697933f8d0 Add custom harvest source read page (provisional) 2012-12-05 15:47:02 +00:00
amercader 2dba7fbf78 Add custom harvest sources search page 2012-12-05 14:51:20 +00:00
amercader a605564a41 Fix links to harvest sources page 2012-12-05 13:01:56 +00:00
amercader d77bf255b4 Finish up create and edit forms, including breadcrumbs, links, etc 2012-11-30 18:53:13 +00:00
amercader 9d83322591 Fix config validator and add tests 2012-11-30 17:02:06 +00:00