Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

This package provides an JSON-RPC item tree implementation for Zope3.

Detailed Documentation

JSONRPC Tree

This package offers a JSONRPC tree view which can be used as navigation tree. Let’s show how we can register our jsonrpc tree view:

>>> from zope.configuration import xmlconfig
>>> import z3c.jsonrpc
>>> context = xmlconfig.file('meta.zcml', z3c.jsonrpc)
>>> context = xmlconfig.string("""
... <configure
...     xmlns:z3c="http://namespaces.zope.org/z3c">
...   <z3c:jsonrpc
...       for="*"
...       class="z3c.jsontree.jsonrpc.JSONTreeItems"
...       permission="zope.Public"
...       methods="loadJSONTreeItems"
...       layer="z3c.jsonrpc.testing.IJSONRPCTestSkin"
...       />
... </configure>
... """, context)

Now we will setup some content structure based on the default zope folder class:

>>> from zope.site.folder import Folder
>>> site  = getRootFolder()
>>> content = Folder()
>>> site['content'] = content

And we need to be able to get an absoluteURL for the form:

>>> import zope.interface
>>> import zope.component
>>> from zope.location.interfaces import ILocation
>>> from zope.traversing.browser.interfaces import IAbsoluteURL
>>> class FakeURL(object):
...     zope.interface.implements(IAbsoluteURL)
...     zope.component.adapts(ILocation, zope.interface.Interface)
...     def __init__(self, context, request):
...         pass
...     def __str__(self):
...         return u'http://fake/url'
...     def __call__(self):
...         return str(self)
>>> zope.component.provideAdapter(FakeURL)

JSON-RPC proxy

If we call our JSON-RPC tree item method, we can see the different JSON data on the different contexts:

>>> from z3c.jsonrpc.testing import JSONRPCTestProxy
>>> siteURL = 'http://localhost/++skin++JSONRPCTestSkin'
>>> proxy = JSONRPCTestProxy(siteURL)
>>> proxy.loadJSONTreeItems('z3cJSONTree')
{u'treeChilds': {u'childs':
[{u'hasChilds': False,
  u'contextURL': u'http://fake/url',
  u'url': u'http://fake/url/@@SelectedManagementView.html',
  u'linkHandler': u'',
  u'content': u'content',
  u'iconURL': u'',
  u'id': u'z3cJSONTree.::content'}],
  u'id': u'z3cJSONTree'}}

The content object has no items and returns some empty JSON data:

>>> proxy = JSONRPCTestProxy(siteURL + '/content')
>>> proxy.loadJSONTreeItems('z3cJSONTree')
{u'treeChilds': {u'childs': [], u'id': u'z3cJSONTree'}}

CHANGES

0.6.0 (2010-09-23)

  • reflect changes in zope packages, use new package externals

  • fix broken tests

  • Fix className handling in javacsript, it seems that newer version of JQuery can’t handle $.className.has(ele, …) use $(ele).hasClass(…) instead.

  • Fix: getParentsFromContextToObject, don’t return a parent chain if an item is a location proxied NotFound error object. It’s possible that such a NotFound object will wrap a context which we don’t allow in our parent chain at all.

0.5.1 (2009-03-10)

  • Fix: use imports from newest packages e.g. zope.site.folder.Folder

  • Fix: be smart to NotFound error objects. NotFound errors are not locatable.

0.5.0 (2008-04-16)

  • Fix: adjust ITreeItems adapter. Added additional discriminator which prevents to get missused as /@@/ adapter if configured with base registry

  • implemented ITreeItems adapter which is responsible for list all items listed in tree

  • Initial Release

Metadata

Release files for z3c.jsontree 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for z3c.jsontree 0.6.0
File Size Uploaded Provenance Actions
z3c.jsontree-0.6.0.tar.gz 20.8 kB Without provenance Details for z3c.jsontree-0.6.0.tar.gz

Release files / z3c.jsontree-0.6.0.tar.gz

Download URL z3c.jsontree-0.6.0.tar.gz
Size 20.8 kB
Tags Source
SHA-256 checksum
How to use checksums
886a97b866f9e6988e0cd349d93dc61e1a159667343ec0da78d9ef66c401cac6
BLAKE2b-256 checksum
How to use checksums
6dce8b65a7adaf9510a5ccb2e9f0817f72006ad98f33f3cd750df26dc1b5d082
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for z3c.jsontree 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page