Package gavo :: Package web :: Module examplesrender :: Class Examples
[frames] | no frames]

Class Examples

source code

                                       object --+    
                                                |    
                        grend.CustomTemplateMixin --+
                                                    |
                   object --+                       |
                            |                       |
       nevow.rend.DataFactory --+                   |
                                |                   |
                   object --+   |                   |
                            |   |                   |
     nevow.rend.RenderFactory --+                   |
                                |                   |
                   object --+   |                   |
                            |   |                   |
      nevow.rend.MacroFactory --+                   |
                                |                   |
                   object --+   |                   |
                            |   |                   |
 nevow.rend.ConfigurableMixin --+                   |
                                |                   |
              nevow.rend.Fragment --+               |
                                    |               |
   nevow.rend.ConfigurableFactory --+               |
                                    |               |
nevow.rend.FreeformChildMixin --+   |               |
                                |   |               |
      nevow.rend.ChildLookupMixin --+               |
                                    |               |
                      nevow.rend.Page --+           |
                                        |           |
                       object --+       |           |
                                |       |           |
           common.CommonRenderers --+   |           |
                                    |   |           |
                grend.GavoRenderMixin --+           |
                                        |           |
                           grend.GavoPage --+       |
                                            |       |
                      grend.ResourceBasedPage --+   |
                                                |   |
                           grend.ServiceBasedPage --+
                                                    |
                                                   Examples

A renderer for examples for service usage.

This renderer formats _example meta items in its service.  Its output
is XHTML compliant to VOSI examples; clients can parse it to, 
for instance, fill forms for service operation or display examples
to users.

The examples make use of RDFa to convey semantic markup.  To see
what kind of semantics is contained, try 
http://www.w3.org/2012/pyRdfa/Overview.html and feed it the
example URL of your service.

The default content of _example is ReStructuredText, and really, not much
else  makes sense.  An example for such a meta item can be viewed by
executing ``gavo admin dumpDF //userconfig``, in the tapexamples STREAM.

To support annotation of things within the example text, DaCHS
defines several RST extensions, both interpreted text roles (used like
``:role-name:`content with blanks```) and custom directives (used
to mark up blocks introduced by a single line like
``.. directive-name ::`` (the blanks before and after the
directive name are significant).

Here's the custom interpreted text roles:

* *dl-id*: An publisher DID a service returns data for (used in 
  datalink examples)
* *taptable*: A (fully qualified) table name a TAP example query is
  (particularly) relevant for; in HTML, this is also a link
  to the table description.
* *genparam*: A "generic parameter" as defined by DALI.  The values
  of these have the form param(value), e.g., :genparam:\`POS(32,4)\`.
  Right now, not parantheses are allowed in the value.  Complain
  if this bites you.

These are the custom directives:

* *tapquery*: The query discussed in a TAP example.

Examples for how to write TAP examples are in the userconfig.rd 
distributed with DaCHS.  Examples for Datalink examples can
be found in the GAVO RDs feros/q and califa/q3.

Instance Methods
 
render_title(self, ctx, data) source code
 
data_examples(self, ctx, data)
returns _Example instances from the service metadata.
source code

Inherited from grend.CustomTemplateMixin: getDocFactory

Inherited from grend.ServiceBasedPage: __init__, __provides__, child, data_serviceURL, locateChild, processData, renderHTTP, renderer, runService, runServiceWithFormalData

Inherited from grend.ResourceBasedPage: data_rdId

Inherited from nevow.rend.Page: child_, flattenFactory, onPostFailure, onPostSuccess, rememberStuff, renderString, renderSynchronously, webFormPost

Inherited from nevow.rend.Fragment: get, remember, rend

Inherited from nevow.rend.DataFactory: __providedBy__

Inherited from nevow.rend.RenderFactory: render_data, render_mapping, render_sequence, render_string, render_xml

Inherited from nevow.rend.MacroFactory: macro

Inherited from nevow.rend.ConfigurableMixin: getBinding, getBindingNames, getDefault, postForm

Inherited from grend.GavoRenderMixin: data_meta, data_rd, render_authinfo, render_datameta, render_explodableMeta, render_ifadmin, render_ifdata, render_ifmeta, render_ifnodata, render_ifnoslot, render_ifownmeta, render_ifslot, render_intro, render_meta, render_metahtml, render_prependsite, render_withsidebar

Inherited from common.CommonRenderers: render_commonhead, render_getconfig, render_rootlink, render_unicode, render_urlescape

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Inherited from nevow.rend.ConfigurableFactory: configurable_, configurable_original, locateConfigurable

Inherited from nevow.rend.ChildLookupMixin: childFactory, putChild

Inherited from nevow.rend.FreeformChildMixin: child_freeform_hand

Class Methods
 
isCacheable(self, segments, request)
should return true if the content rendered will only change when the associated RD changes.
source code

Inherited from grend.ResourceBasedPage: isBrowseable, makeAccessURL

Class Variables
  name = 'examples'
hash(x)
  checkedRenderer = False
  customTemplate = <nevow.loaders.xmlfile object>
hash(x)

Inherited from grend.ServiceBasedPage: __implemented__, openRenderer

Inherited from grend.ResourceBasedPage: parameterStyle, preferredMethod, resultType, urlUse

Inherited from nevow.rend.Page: addSlash, afterRender, beforeRender, buffered

Inherited from nevow.rend.Fragment: original

Inherited from grend.GavoRenderMixin: macroPackage

Inherited from nevow.rend.ChildLookupMixin: children

Properties

Inherited from grend.CustomTemplateMixin: docFactory

Inherited from object: __class__

Method Details

isCacheable(self, segments, request)
Class Method

source code 

should return true if the content rendered will only change when the associated RD changes.

request is a nevow request object. web.root.ArchiveService already makes sure that you only see GET request without arguments and without a user, so you do not need to check this.

Overrides: grend.ResourceBasedPage.isCacheable
(inherited documentation)