Exemple #1
0
 class Decoding(Context):
     '''
     The decoding context.
     '''
     # ---------------------------------------------------------------- Optional
     parent = optional(Context)
     input = optional(Input)
Exemple #2
0
class Decoding(Context):
    '''
    The decoding context.
    '''
    # ---------------------------------------------------------------- Defined
    parent = defines(Context, doc='''
    @rtype: Context
    The parent decoding that this decoding is based on.
    ''')
    doDecode = defines(IDo, doc='''
    @rtype: callable(target, value)
    Decodes the value into the provided target.
    @param target: Context
        Target context object used for decoding.
    @param value: dictionary{object: object}
        The dictionary value to be decoded.
    ''')
    isMandatory = defines(bool, doc='''
    @rtype: boolean
    Indicates that the decoding needs to have a value provided.
    ''')
    # ---------------------------------------------------------------- Optional
    doBegin = optional(IDo)
    doEnd = optional(IDo)
    # ---------------------------------------------------------------- Required
    type = requires(Type)
    doSet = requires(IDo)
    doGet = requires(IDo)
Exemple #3
0
class ResponseHTTP(Context):
    '''
    Context for HTTP response data. 
    '''
    # ---------------------------------------------------------------- Required
    status = requires(int,
                      doc='''
    @rtype: integer
    The response status code.
    ''')
    # ---------------------------------------------------------------- Optional
    code = optional(str,
                    doc='''
    @rtype: string
    The response code message.
    ''')
    text = optional(str,
                    doc='''
    @rtype: string
    The response text message (a short message).
    ''')
    headers = optional(dict,
                       doc='''
    @rtype: dictionary{string, string}
    The response headers.
    ''')
Exemple #4
0
 class Decoding(Context):
     '''
     The decoding context.
     '''
     # ---------------------------------------------------------------- Optional
     parent = optional(Context)
     property = optional(TypeProperty)
Exemple #5
0
class Request(Context):
    '''
    The request context.
    '''
    # ---------------------------------------------------------------- Optional
    accTypes = optional(list)
    accCharSets = optional(list)
Exemple #6
0
class RequestContentData(Context):
    '''
    The request content context used for the content.
    '''
    # ---------------------------------------------------------------- Optional
    name = optional(str)
    type = optional(str)
    charSet = optional(str)
    length = optional(int)
Exemple #7
0
class Definition(Context):
    '''
    The definition context.
    '''
    # ---------------------------------------------------------------- Optional
    isMandatory = optional(bool)
    enumeration = optional(list)
    references = optional(list)
    # ---------------------------------------------------------------- Required
    name = requires(str)
    types = requires(list)
class PermissionResource(Context):
    '''
    The permission context.
    '''
    # ---------------------------------------------------------------- Optional
    values = optional(dict)
    putHeaders = optional(dict)
    navigate = optional(str)
    # ---------------------------------------------------------------- Required
    method = requires(int)
    path = requires(Path)
    invoker = requires(Invoker)
    filters = requires(list)
Exemple #9
0
class DefineEncoder(Context):
    '''
    The create encoder context.
    '''
    # ---------------------------------------------------------------- Defined
    encoder = defines(ITransfrom,
                      doc='''
    @rtype: ITransfrom
    The encoder to be used for rendering objects.
    ''')
    # ---------------------------------------------------------------- Optional
    name = optional(str)
    specifiers = optional(list)
    # ---------------------------------------------------------------- Required
    objType = requires(Type)
class Solicit(Context):
    '''
    The solicit context.
    '''
    # ---------------------------------------------------------------- Defined
    gateways = defines(Iterable,
                       doc='''
    @rtype: Iterable(Gateway)
    The ACL gateways.
    ''')
    # ---------------------------------------------------------------- Optional
    rootURI = optional(str)
    replacements = optional(dict)
    # ---------------------------------------------------------------- Required
    permissions = requires(Iterable)
Exemple #11
0
class Register(Context):
    '''
    The register context.
    '''
    # ---------------------------------------------------------------- Defined
    invokers = defines(list,
                       doc='''
    @rtype: list[Context]
    The invokers created based on the services.
    ''')
    validations = definesIf(dict,
                            doc='''
    @rtype: dictionary{TypeService: list[object, object]}
    The validations indexed by the service type. As a value a list that provides on the first position the binded 
    validation target and on the second the binded target
    ''')
    doCopyInvoker = defines(IDo,
                            doc='''
    @rtype: callable(destination:Context, source:Context, exclude:set=None) -> Context
    On the first position the destination invoker to copy to and on the second position the source to copy from, returns
    the destination invoker. Accepts also a named argument containing a set of attributes names to exclude.
    ''')
    # ---------------------------------------------------------------- Optional
    exclude = optional(set)
    # ---------------------------------------------------------------- Required
    services = requires(Iterable)
Exemple #12
0
class Request(Context):
    '''
    The request context.
    '''
    # ---------------------------------------------------------------- Required
    uri = requires(str)
    # ---------------------------------------------------------------- Optional
    argumentsOfType = optional(dict)
    # ---------------------------------------------------------------- Defined
    extension = defines(str,
                        doc='''
    @rtype: string
    The extension of the requested URI.
    ''')
    path = defines(Path,
                   doc='''
    @rtype: Path
    The path to the resource node.
    ''')
    converterId = defines(Converter,
                          doc='''
    @rtype: Converter
    The converter to use for model id's.
    ''')
    normalizerParameters = defines(Normalizer,
                                   doc='''
    @rtype: Normalizer
    The normalizer to use for decoding parameters names.
    ''')
    converterParameters = defines(Converter,
                                  doc='''
    @rtype: Converter
    The converter to use for the parameters values.
    ''')
class Solicitation(Context):
    '''
    The solicitation context.
    '''
    # ---------------------------------------------------------------- Optional
    encoderPath = optional(IEncoderPath)
    # ---------------------------------------------------------------- Required
    permissions = requires(Iterable)
Exemple #14
0
class ResponseContentEncode(Context):
    '''
    The response content context.
    '''
    # ---------------------------------------------------------------- Required
    type = requires(str)
    # ---------------------------------------------------------------- Optional
    charSet = optional(str)
Exemple #15
0
 class Definition(Context):
     '''
     The definition context.
     '''
     # ---------------------------------------------------------------- Optional
     references = optional(list)
     # ---------------------------------------------------------------- Required
     name = requires(str)
Exemple #16
0
class RequestContent(RequestContentData):
    '''
    The request content context.
    '''
    # ---------------------------------------------------------------- Required
    source = requires(IInputStream)
    # ---------------------------------------------------------------- Optional
    fetchNextContent = optional(Callable)
Exemple #17
0
class Decoding(Context):
    '''
    The decoding context.
    '''
    # ---------------------------------------------------------------- Optional
    parent = optional(Context)
    # ---------------------------------------------------------------- Required
    input = requires(Input)
    doDecode = requires(IDo)
Exemple #18
0
class RequestContent(Context):
    '''
    The request content context.
    '''
    # ---------------------------------------------------------------- Optional
    doFetchNextContent = optional(IDo)
    # ---------------------------------------------------------------- Required
    type = requires(str)
    charSet = requires(str)
Exemple #19
0
class Decoding(Context):
    '''
    The decoding context.
    '''
    # ---------------------------------------------------------------- Optional
    isMandatory = optional(bool)
    # ---------------------------------------------------------------- Required
    type = requires(Type)
    doDecode = requires(IDo)
Exemple #20
0
class Decoding(Context):
    '''
    The decoding context.
    '''
    # ---------------------------------------------------------------- Optional
    parent = optional(Context)
    # ---------------------------------------------------------------- Required
    input = requires(Input)
    property = requires(TypeProperty)
class Permission(Context):
    '''
    The permission context.
    '''
    # ---------------------------------------------------------------- Optional
    navigate = optional(str)
    # ---------------------------------------------------------------- Required
    access = requires(Access)
    filters = requires(dict)
Exemple #22
0
class Decoding(Context):
    '''
    The decoding context.
    '''
    # ---------------------------------------------------------------- Optional
    parent = optional(Context)
    # ---------------------------------------------------------------- Required
    contentDefinitions = requires(dict)
    doDecode = requires(IDo)
Exemple #23
0
class Invoker(Context):
    '''
    The invoker context.
    '''
    # ---------------------------------------------------------------- Optional
    filterInjected = optional(dict)
    # ---------------------------------------------------------------- Required
    path = requires(list)
    filterName = requires(str)
    location = requires(str)
Exemple #24
0
class HeadersRequire(Context):
    '''
    Context for required headers. 
    '''
    # ---------------------------------------------------------------- Required
    headers = optional(dict,
                       doc='''
    @rtype: dictionary{string, string}
    The raw headers.
    ''')
Exemple #25
0
class Decoding(Context):
    '''
    The decoding context.
    '''
    # ---------------------------------------------------------------- Optional
    parent = optional(Context)
    # ---------------------------------------------------------------- Required
    parameterDefinition = requires(Context)
    doDecode = requires(IDo)
    doDefault = requires(IDo)
Exemple #26
0
class RequestContentHTTPAsyncore(RequestContentHTTP):
    '''
    The request content context.
    '''
    # ---------------------------------------------------------------- Optional
    contentReader = optional(Callable, doc='''
    @rtype: Callable
    The content reader callable used for pushing data from the asyncore read. Once the reader is finalized it will
    return a chain that is used for further request processing.
    ''')
Exemple #27
0
class RequestDecode(Context):
    '''
    The request context.
    '''
    # ---------------------------------------------------------------- Required
    decoderHeader = requires(IDecoderHeader)
    # ---------------------------------------------------------------- Optional
    argumentsOfType = optional(dict)
    accLanguages = optional(list)
    language = optional(str)
    # ---------------------------------------------------------------- Defined
    normalizer = defines(Normalizer, doc='''
    @rtype: Normalizer
    The normalizer to use for decoding request content.
    ''')
    converter = defines(Converter, doc='''
    @rtype: Converter
    The converter to use for decoding request content.
    ''')
Exemple #28
0
class Response(Context):
    '''
    The response context.
    '''
    # ---------------------------------------------------------------- Optional
    text = optional(str)
    errorMessage = optional(str, doc='''
    @rtype: object
    The error message for the code.
    ''')
    errorDetails = optional(Object, doc='''
    @rtype: Object
    The error text object describing a detailed situation for the error.
    ''')
    # ---------------------------------------------------------------- Required
    status = requires(int)
    code = requires(str)
    isSuccess = requires(bool)
    renderFactory = requires(Callable)
Exemple #29
0
class Response(Context):
    '''
    The response context.
    '''
    # ---------------------------------------------------------------- Optional
    indexerFactory = optional(Callable)
    # ---------------------------------------------------------------- Required
    renderFactory = requires(Callable)
    obj = requires(object)
    isSuccess = requires(bool)
Exemple #30
0
class RequestContentDecode(Context):
    '''
    The request content context.
    '''
    # ---------------------------------------------------------------- Optional
    source = optional(IInputStream)
    # ---------------------------------------------------------------- Defined
    length = defines(int, doc='''
    @rtype: integer
    The content source length in bytes. 
    ''')