Package gavo :: Package web :: Module root :: Class ArchiveService
[frames] | no frames]

Class ArchiveService

source code

                   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 --+
                                        |
                                       ArchiveService

The root resource on the data center.

It does the main dispatching based on four mechanisms:

  1. redirects -- one-segments fragments that redirect somewhere else. This is for "bad" shortcuts corresponding to input directory name exclusively (since it's so messy). These will not match if path has more than one segment.
  2. statics -- first segment leads to a resource that gets passed any additional segments.
  3. mappings -- first segment is replaced by something else, processing continues.
  4. resource based -- consisting of an RD id, a service id, a renderer and possibly further segments.

The first three mechanisms only look at the first segment to determine any action (except that redirect is skipped if len(segments)>1).

The statics and mappings are configured on the class level.

Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
renderHTTP(self, ctx) source code
 
locateChild(self, ctx, segments)
Locate a child page of this one.
source code

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

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

Inherited from nevow.rend.DataFactory: __providedBy__, child

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

Inherited from nevow.rend.MacroFactory: macro

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

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
 
addRedirect(cls, key, destination) source code
 
addStatic(cls, key, resource) source code
 
addMapping(cls, key, segments) source code
 
installVanityMap(cls)
builds the redirects prescribed by the system-wide vanity map.
source code
Class Variables
  timestampStarted = 1556782136.41
  statics = {'.well-known': <gavo.web.ifpages.WellKnown object>,...
  mappings = {'HSOY': ['tableinfo', 'hsoy.main'], 'TOSS': ['toss...
  redirects = {'adql': '/__system__/adql/query/form', 'apfs': '/...

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

Inherited from nevow.rend.Fragment: docFactory, original

Inherited from nevow.rend.ChildLookupMixin: children

Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

renderHTTP(self, ctx)

source code 
Overrides: nevow.rend.Page.renderHTTP

locateChild(self, ctx, segments)

source code 

Locate a child page of this one. ctx is a nevow.context.PageContext representing the parent Page, and segments is a tuple of each element in the URI. An tuple (page, segments) should be returned, where page is an instance of nevow.rend.Page and segments a tuple representing the remaining segments of the URI. If the child is not found, return NotFound instead.

locateChild is designed to be easily overridden to perform fancy lookup tricks. However, the default locateChild is useful, and looks for children in three places, in this order:

  • in a dictionary, self.children
  • a member of self named child_<childname>. This can be either an attribute or a method. If an attribute, it should be an object which can be adapted to IResource. If a method, it should take the context and return an object which can be adapted to IResource.
  • by calling self.childFactory(ctx, name). Name is a single string instead of a tuple of strings. This should return an object that can be adapted to IResource.
Overrides: nevow.rend.FreeformChildMixin.locateChild

Class Variable Details

statics

Value:
{'.well-known': <gavo.web.ifpages.WellKnown object>,
 '_portaljs': <gavo.web.jsonquery.PortalPage object>,
 'clientcount': <gavo.web.ifpages.CurReaders object>,
 'favicon.ico': <nevow.static.File object>,
 'favicon.png': <nevow.static.Data object>,
 'formal.css': <gavo.imp.formal.util.LazyResource object>,
 'formal.js': <gavo.imp.formal.util.LazyResource object>,
 'getRR': <gavo.web.metarender.ResourceRecordMaker object>,
...

mappings

Value:
{'HSOY': ['tableinfo', 'hsoy.main'],
 'TOSS': ['toss', 'q', 'legacy', 'form'],
 'browse': ['__system__', 'services', 'overview', 'rdinfo'],
 'datalinkuws': ['__system__', 'products', 'p', 'dlasync'],
 'fhssa': ['flashheros', 'q', 'ssa', 'ssap.xml'],
 'genrd': ['__system__', 'run', 'genrd'],
 'getproduct': ['__system__', 'products', 'p', 'get'],
 'getproducts': ['__system__', 'products', 'products', 'p', 'get'],
...

redirects

Value:
{'adql': '/__system__/adql/query/form',
 'apfs': '/apfs/res/apfs_new/catquery/form',
 'inflight': '/inflight/res/lc1/ui/fixed',
 'lensdemo/view/q/form': '/lensunion/q/im/form',
 'ppmxl': '/ppmxl/q/cone/info'}