Package gavo :: Package svcs :: Module uploadcores :: Class UploadCore
[frames] | no frames]

Class UploadCore

source code

                   object --+                
                            |                
 base.structure.StructureBase --+            
                                |            
                   object --+   |            
                            |   |            
           base.common.Parser --+            
                                |            
base.structure.ParseableStructure --+        
                                    |        
             base.structure.Structure --+    
                                        |    
                                core.Core --+
                                            |
                                           UploadCore

A core handling uploads of files to the database.

It allows users to upload individual files into a special staging area (taken from the stagingDir property of the destination data descriptor) and causes these files to be parsed using destDD. Note that destDD *must* have ``updating="True"`` for this to work properly (it will otherwise drop the table on each update). If uploads are the only way updates into the table occur, source management is not necessary for these, though.

You can tell UploadCores to either insert or update the incoming data using the "mode" input key.

Nested Classes

Inherited from base.structure.StructureBase: __metaclass__

Instance Methods
 
run(self, service, inputTable, queryMeta) source code
 
clearProperty(self, name) source code
 
getFullId(self) source code
 
getProperty(self, name, default=<Undefined>) source code
 
hasProperty(self, name) source code
 
setProperty(self, name, value) source code

Inherited from core.Core: __init__, __repr__, __str__, adaptForRenderer, completeElement, initialize, makeUserDoc

Inherited from base.structure.Structure: __provides__, callCompletedCallbacks, finishElement, onElementComplete, validate

Inherited from base.structure.ParseableStructure: end_, feed, feedFrom, feedObject, getAttribute, iterEvents, start_, value_

Inherited from base.structure.StructureBase: __providedBy__, adopt, breakCircles, change, copy, getAttributes, getCopyableAttributes, getSourcePosition, iterChildren, setPosition

Inherited from base.common.Parser: feedEvent

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

Class Methods

Inherited from base.structure.StructureBase: fromStructure

Class Variables
  name_ = 'uploadCore'
a sentinel for all kinds of undefined values.
  inputTableXML = '\n\t\t<inputTable id="inFields">\n\t\t\t<inpu...
hash(x)
  outputTableXML = '<outputTable>\n\t\t\t\t\t<column name="nAffe...
hash(x)
  attrSeq = [<gavo.base.parsecontext.ReferenceAttribute object>,...
  managedAttrs = {'destDD': <gavo.base.parsecontext.ReferenceAtt...

Inherited from base.structure.Structure: __implemented__

Inherited from base.structure.StructureBase: completedCallbacks

Properties
  rd

Inherited from object: __class__

Method Details

run(self, service, inputTable, queryMeta)

source code 
Overrides: core.Core.run

clearProperty(self, name)

source code 
Overrides: core.Core.clearProperty

getFullId(self)

source code 
Overrides: core.Core.getFullId

getProperty(self, name, default=<Undefined>)

source code 
Overrides: core.Core.getProperty

hasProperty(self, name)

source code 
Overrides: core.Core.hasProperty

setProperty(self, name, value)

source code 
Overrides: core.Core.setProperty

Class Variable Details

inputTableXML

hash(x)

Value:
'''
\t\t<inputTable id="inFields">
\t\t\t<inputKey name="File" type="file" required="True"
\t\t\t\ttablehead="Source to upload"/>
\t\t\t<inputKey name="Mode" type="text" tablehead="Upload mode" 
\t\t\t\trequired="True" multiplicity="forced-single">
\t\t\t\t<values default="i">
\t\t\t\t\t<option title="Insert">i</option>
...

outputTableXML

hash(x)

Value:
'''<outputTable>
\t\t\t\t\t<column name="nAffected" type="integer" 
\t\t\t\t\t\ttablehead="Number touched" required="True"/>
\t\t\t\t</outputTable>'''

attrSeq

Value:
[<gavo.base.parsecontext.ReferenceAttribute object>,
 <gavo.base.parsecontext.IdAttribute object>,
 <gavo.base.complexattrs.StructAttribute object>,
 <gavo.base.parsecontext.OriginalAttribute object>,
 <gavo.base.complexattrs.StructAttribute object>,
 <gavo.base.complexattrs.PropertyAttribute object>,
 <gavo.rscdef.common.RDAttribute object>]

managedAttrs

Value:
{'destDD': <gavo.base.parsecontext.ReferenceAttribute object>,
 'id': <gavo.base.parsecontext.IdAttribute object>,
 'inputTable': <gavo.base.complexattrs.StructAttribute object>,
 'original': <gavo.base.parsecontext.OriginalAttribute object>,
 'outputTable': <gavo.base.complexattrs.StructAttribute object>,
 'properties': <gavo.base.complexattrs.PropertyAttribute object>,
 'property': <gavo.base.complexattrs.PropertyAttribute object>,
 'rd': <gavo.rscdef.common.RDAttribute object>}

Property Details

rd

Get Method:
unreachable._getRD(self)