Skip to content

Commit

Permalink
Merge branch 'master' into enhancement-2362-extension-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Jul 2, 2012
2 parents 19bff77 + 2df478d commit 8e4aa2c
Show file tree
Hide file tree
Showing 130 changed files with 9,628 additions and 3,212 deletions.
40 changes: 40 additions & 0 deletions CHANGELOG.txt
@@ -1,6 +1,46 @@
CKAN CHANGELOG
++++++++++++++

v1.8
====

* [#2592,#2428] Ubuntu 12.04 Precise is now supported with CKAN source install.
The source install instructions have been updated and simplified.
Some of CKAN's dependencies have been updated and some removed.
* Requirements have been updated see doc/install-from-source.rst
users will need to do a new pip install (#2592)
* [#2304,#2305] New 'follow' feature. You'll now see a 'Followers' tab on user
and dataset pages, where you can see how many users are following that user
or dataset. If you're logged in, you'll see a 'Follow' button on the pages
of datasets and other users that you can click to follow them. Also when
logged in, if you go to your own user page you'll see a new 'Dashboard' tab
where you can see an activity stream from of all the users and datasets that
you're following. There are also API calls for the follow features, see the
Action API reference documentation.
* [#2345] New action API reference docs. The documentation for CKAN's Action
API has been rewritten, with each function and its arguments and return
values now individually documented.

v1.7.1 2012-06-20
=================

Minor:
* Documentation enhancements regarding install and extensions (#2505)
* Home page and search results speed improvements (#2402,#2403)
* I18n: Added Greek translation and updated other ones (#2506)

Bug fixes:
* UI fixes (#2507)
* Fixes for i18n login and logout issues (#2497)
* Date on add/edit resource breaks if offset is specified (#2383)
* Fix in organizations read page (#2509)
* Add synchronous_search plugin to deployment.ini template (#2521)
* Inconsistent language on license dropdown (#2575)
* Fix bug in translating lists in multilingual plugin
* Group autocomplete doesn't work with multiple words (#2373)
* Other minor fixes


v1.7 2012-05-09
===============

Expand Down
9 changes: 1 addition & 8 deletions ckan/config/deployment.ini_tmpl
Expand Up @@ -24,7 +24,7 @@ app_instance_uuid = ${app_instance_uuid}

# List the names of CKAN extensions to activate.
# Note: This line is required to be here for packaging, even if it is empty.
ckan.plugins = stats
ckan.plugins = stats synchronous_search

# If you'd like to fine-tune the individual locations of the cache data dirs
# for the Cache data, or the Session saves, un-comment the desired settings
Expand Down Expand Up @@ -83,13 +83,6 @@ package_form = standard
# * queue - native Python Queue (debugging and tests only)
#carrot_messaging_library = pyamqplib

## Update the search index synchronously (i.e. in-process rather than
## out-of-process as would be case if using AMQP framework)
## Set to false to disable, true to enable
## Default enabled (and enabled if option entirely absent)
## NOTE this is mutually exclusive with ckan.async_notifier
ckan.build_search_index_synchronously = true

## Perform search just using database (rather than use e.g. solr).
## In this setup search is crude and limited .e.g no full-text search, no faceting ...
## However, very useful for getting up and running quickly with CKAN
Expand Down
94 changes: 93 additions & 1 deletion ckan/config/environment.py
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
"""Pylons environment configuration"""
import os
import logging
Expand Down Expand Up @@ -176,6 +177,89 @@ def template_loaded(template):
config['pylons.app_globals'].genshi_loader = TemplateLoader(
template_paths, auto_reload=True, callback=template_loaded)

#################################################################
# #
# HORRIBLE GENSHI HACK #
# #
#################################################################
# #
# Genshi does strange things to get stuff out of the template #
# variables. This stops it from handling properties in the #
# correct way as it returns the property rather than the actual #
# value of the property. #
# #
# By overriding lookup_attr() in the LookupBase class we are #
# able to get the required behaviour. Using @property allows #
# us to move functionality out of templates whilst maintaining #
# backwards compatability. #
# #
#################################################################



'''
This code is based on Genshi code
Copyright © 2006-2012 Edgewall Software
All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
The name of the author may not be used to endorse or promote
products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
'''
from genshi.template.eval import LookupBase

@classmethod
def genshi_lookup_attr(cls, obj, key):
__traceback_hide__ = True
try:
val = getattr(obj, key)
except AttributeError:
if hasattr(obj.__class__, key):
raise
else:
try:
val = obj[key]
except (KeyError, TypeError):
val = cls.undefined(key, owner=obj)
if isinstance(val, property):
val = val.fget()
return val

setattr(LookupBase, 'lookup_attr', genshi_lookup_attr)
del genshi_lookup_attr
del LookupBase

#################################################################
# #
# END OF GENSHI HACK #
# #
#################################################################

# CONFIGURATION OPTIONS HERE (note: all config options will override
# any Pylons config options)

Expand All @@ -189,7 +273,15 @@ def template_loaded(template):

if ckan_db:
config['sqlalchemy.url'] = ckan_db
engine = sqlalchemy.engine_from_config(config, 'sqlalchemy.')

# for postgresql we want to enforce utf-8
sqlalchemy_url = config.get('sqlalchemy.url', '')
if sqlalchemy_url.startswith('postgresql://'):
extras = {'client_encoding': 'utf8'}
else:
extras = {}

engine = sqlalchemy.engine_from_config(config, 'sqlalchemy.', **extras)

if not model.meta.engine:
model.init_model(engine)
Expand Down
4 changes: 2 additions & 2 deletions ckan/config/middleware.py
Expand Up @@ -20,7 +20,7 @@

from ckan.plugins import PluginImplementations
from ckan.plugins.interfaces import IMiddleware
from ckan.lib.i18n import get_locales
from ckan.lib.i18n import get_locales_from_config

from ckan.config.environment import load_environment

Expand Down Expand Up @@ -145,7 +145,7 @@ class I18nMiddleware(object):
def __init__(self, app, config):
self.app = app
self.default_locale = config.get('ckan.locale_default', 'en')
self.local_list = get_locales()
self.local_list = get_locales_from_config()

def __call__(self, environ, start_response):
# strip the language selector from the requested url
Expand Down
20 changes: 17 additions & 3 deletions ckan/config/routing.py
Expand Up @@ -141,7 +141,12 @@ def make_map():
action='read', url='', conditions=GET)
m.connect('datastore_write', '/api/data/{id}{url:(/.*)?}',
action='write', url='', conditions=PUT_POST_DELETE)

m.connect('datastore_read_shortcut',
'/dataset/{dataset}/resource/{id}/api{url:(/.*)?}',
action='read', url='', conditions=GET)
m.connect('datastore_write_shortcut',
'/dataset/{dataset}/resource/{id}/api{url:(/.*)?}',
action='write', url='', conditions=PUT_POST_DELETE)

map.redirect('/packages', '/dataset')
map.redirect('/packages/{url:.*}', '/dataset/{url}')
Expand Down Expand Up @@ -183,12 +188,19 @@ def make_map():
'history',
'read_ajax',
'history_ajax',
'followers',
]))
)
m.connect('/dataset/{id}.{format}', action='read')
m.connect('/dataset/{id}', action='read')
m.connect('/dataset/{id}/resource/{resource_id}', action='resource_read')
m.connect('/dataset/{id}/resource/{resource_id}/embed', action='resource_embedded_dataviewer')
m.connect('/dataset/{id}/resource/{resource_id}',
action='resource_read')
m.connect('/dataset/{id}/resource/{resource_id}/download',
action='resource_download')
m.connect('/dataset/{id}/resource/{resource_id}/embed',
action='resource_embedded_dataviewer')
m.connect('/dataset/{id}/resource/{resource_id}/viewer',
action='resource_embedded_dataviewer', width="960", height="800")

# group
map.redirect('/groups', '/group')
Expand Down Expand Up @@ -240,6 +252,8 @@ def make_map():
m.connect('/user/edit', action='edit')
# Note: openid users have slashes in their ids, so need the wildcard
# in the route.
m.connect('/user/dashboard', action='dashboard')
m.connect('/user/followers/{id:.*}', action='followers')
m.connect('/user/edit/{id:.*}', action='edit')
m.connect('/user/reset/{id:.*}', action='perform_reset')
m.connect('/user/register', action='register')
Expand Down
2 changes: 2 additions & 0 deletions ckan/config/solr/CHANGELOG.txt
Expand Up @@ -8,6 +8,8 @@ v1.4 - (ckan>=1.7)
* Add title_string so you can sort alphabetically on title.
* Fields related to analytics, access and view counts.
* Add data_dict field for the whole package_dict.
* Add vocab_* dynamic field so it is possible to facet by vocabulary tags
* Add copyField for text with source vocab_*

v1.3 - (ckan>=1.5.1)
--------------------
Expand Down
2 changes: 2 additions & 0 deletions ckan/config/solr/schema-1.4.xml
Expand Up @@ -153,6 +153,7 @@
<field name="data_dict" type="string" indexed="false" stored="true" />

<dynamicField name="extras_*" type="text" indexed="true" stored="true" multiValued="false"/>
<dynamicField name="vocab_*" type="string" indexed="true" stored="true" multiValued="true"/>
<dynamicField name="*" type="string" indexed="true" stored="false"/>
</fields>

Expand All @@ -165,6 +166,7 @@
<copyField source="download_url" dest="urls"/>
<copyField source="res_url" dest="urls"/>
<copyField source="extras_*" dest="text"/>
<copyField source="vocab_*" dest="text"/>
<copyField source="urls" dest="text"/>
<copyField source="name" dest="text"/>
<copyField source="title" dest="text"/>
Expand Down

0 comments on commit 8e4aa2c

Please sign in to comment.