Skip to content

Commit

Permalink
merged branch 0.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonski committed Sep 9, 2015
2 parents 6338f9b + 9c0ff10 commit fe50e7d
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plone.jsonapi.routes
====================

:Author: Ramon Bartl
:Version: 0.8.1
:Version: 0.8.2


.. contents:: Table of Contents
Expand Down
15 changes: 12 additions & 3 deletions docs/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
Changelog
=========


0.8.2 - 2015-09-09
------------------

**CLOSED ISSUES**

- https://github.com/collective/plone.jsonapi.routes/issues/52: Handle field unauthorized errors in the GET API
- https://github.com/collective/plone.jsonapi.routes/issues/51: Default Data Adapters missing


0.8.1 - 2015-09-06
------------------

Expand All @@ -11,7 +21,7 @@ Changelog
- https://github.com/collective/plone.jsonapi.routes/issues/50: API route throws error
- https://github.com/collective/plone.jsonapi.routes/pull/37: Include custom metadata columns
- https://github.com/collective/plone.jsonapi.routes/pull/37: Include custom metadata columns
_ https://github.com/collective/plone.jsonapi.routes/issues/49: Setting the ID throws a traceback
- https://github.com/collective/plone.jsonapi.routes/issues/49: Setting the ID throws a traceback
- https://github.com/collective/plone.jsonapi.routes/issues/48: Implement cut/copy/paste routes
- https://github.com/collective/plone.jsonapi.routes/issues/46: Route Provider `portal` throws TypeError
- https://github.com/collective/plone.jsonapi.routes/issues/47: ZCML directive to enable AdvancedQuery if installed
Expand All @@ -23,6 +33,7 @@ _ https://github.com/collective/plone.jsonapi.routes/issues/49: Setting the ID t
- New route provider `plonesites`
- Support for catalog brain schema


0.8 - 2015-07-20
----------------

Expand Down Expand Up @@ -177,5 +188,3 @@ _ https://github.com/collective/plone.jsonapi.routes/issues/49: Setting the ID t
----------------

- first public release

.. vim: set ft=rst ts=4 sw=4 expandtab tw=78 :
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
# built documents.
#
# The short X.Y version.
version = '0.8.1'
version = '0.8.2'
# The full version, including alpha/beta/rc tags.
release = '0.8.1'
release = '0.8.2'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
from setuptools import setup, find_packages

version = '0.8.1'
version = '0.8.2'

long_description = (
open('README.rst').read()
Expand Down
14 changes: 13 additions & 1 deletion src/plone/jsonapi/routes/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from plone.dexterity.schema import SCHEMA_CACHE
from plone.dexterity.interfaces import IDexterityContent

from AccessControl import Unauthorized

from Products.CMFCore.interfaces import ISiteRoot
from Products.ZCatalog.interfaces import ICatalogBrain
from Products.ATContentTypes.interfaces import IATContentType
Expand Down Expand Up @@ -174,15 +176,25 @@ def extract_keys(obj, keys, ignore=[]):
out = dict()

for key in keys:
value = dm.get(key)
try:
# get the field value with the data manager
value = dm.get(key)
# https://github.com/collective/plone.jsonapi.routes/issues/52
# -> skip restricted fields
except Unauthorized:
logger.debug("Skipping restricted field '%s'" % key)
continue
out[key] = get_json_value(obj, key, value=value)
if out.get("workflow_info"):
logger.warn("Workflow Info ommitted since the key 'workflow_info' "
"was found in the current schema")
return out

# additional workflow information
wf_info = get_wf_info(obj)
out["workflow_info"] = wf_info
out["state"] = wf_info.get("status")

return out


Expand Down
44 changes: 30 additions & 14 deletions src/plone/jsonapi/routes/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
<!-- Include meta directives -->
<include file="meta.zcml"/>


<!-- BATCHING
split results into multiple batches
-->

<!-- Adapter for Plone 4.3 Batching -->
<adapter
for="*"
Expand All @@ -22,6 +28,18 @@
factory=".batch.Batch42"
/>


<!-- DATA MANAGERS
get/set values from fields
-->

<!-- Default Data adapter (AT based content types) -->
<adapter
for="*"
factory=".datamanagers.ATDataManager"
/>

<!-- Data adapter for Portal manipulation -->
<adapter
for="Products.CMFPlone.interfaces.siteroot.IPloneSiteRoot"
Expand All @@ -34,18 +52,24 @@
factory=".datamanagers.BrainDataManager"
/>

<!-- Data adapter for AT Field manipulation -->
<adapter
for="Products.ATContentTypes.interfaces.IATContentType"
factory=".datamanagers.ATDataManager"
/>

<!-- Data adapter for Dexterity Field manipulation -->
<adapter
for="plone.dexterity.interfaces.IDexterityContent"
factory=".datamanagers.DexterityDataManager"
/>


<!-- DATA PROVIDERS
extract fields from schema and return a dictionary
-->

<!-- Default data provider (AT based content types) -->
<adapter
for="*"
factory=".adapters.ATDataProvider"
/>

<!-- Adapter for Catalog Brains -->
<adapter
for="Products.ZCatalog.interfaces.ICatalogBrain"
Expand All @@ -58,18 +82,10 @@
factory=".adapters.SiteRootDataProvider"
/>

<!-- Adapter for AT Content Types -->
<adapter
for="Products.ATContentTypes.interfaces.IATContentType"
factory=".adapters.ATDataProvider"
/>

<!-- Adapter for Dexterity Content Types -->
<adapter
for="plone.dexterity.interfaces.IDexterityContent"
factory=".adapters.DexterityDataProvider"
/>

</configure>

<!-- vim: set ft=xml ts=2 sw=2 expandtab : -->
4 changes: 2 additions & 2 deletions src/plone/jsonapi/routes/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def version():
return dist.version

__version__ = version()
__build__ = 444
__date__ = '2015-09-06'
__build__ = 450
__date__ = '2015-09-09'


@add_plone_route("/version", "ploneapiversion", methods=["GET"])
Expand Down

0 comments on commit fe50e7d

Please sign in to comment.