Example #1
0
 def invoke(self, env, context):
     r = env.componentManager.getComponent(self.elementName, self.type)
     r.src = self.src.resolve(context, env.objectModel)
     r.params = variables.buildMap(self.params, context, env.objectModel)
     r.mimeType = self.mimeType
     context.processingPipeline.reader = r
     self.log.debug('<map:read src="%s"> invoke()' % r.src)
     return context.processingPipeline.process(env)
Example #2
0
 def invoke(self, env, context):
     self.log.debug('<map:act type="%s">: invoke()' % self.type)
     resolvedParams = variables.buildMap(self.params, context, env.objectModel)
     action = env.componentManager.getComponent(self.elementName, self.type)
     result = action.act(env.objectModel, resolvedParams)
     if result is not None:
         return self.invokeChildren(env, context, result)
     else:
         return False
Example #3
0
 def invoke(self, env, context):
     resolvedParams = variables.buildMap(self.params, context, env.objectModel)
     matcher = env.componentManager.getComponent(self.elementName, self.type)
     result = matcher.match(self.pattern, env.objectModel, resolvedParams)
     if result is not None:
         self.log.debug('<map:match pattern="%s">: invoke(%s)' % (self.pattern, env.request.uri))
         return self.invokeChildren(env, context, result)
     else:
         return False
Example #4
0
 def invoke(self, env, context):
     resolvedParams = variables.buildMap(self.params, context, env.objectModel)
     for test, nodes in self.whenElements:
         expr = test.resolve(context, env.objectModel)
         selector = env.componentManager.getComponent(self.elementName, self.type)
         self.log.debug("selector: %s" % selector)
         if selector.select(expr, env.objectModel, resolvedParams):
             return self.invokeChildren(env, context, None, nodes)
     if self.otherwiseNodes is not None:
         return self.invokeChildren(env, context, None, self.otherwiseNodes)
     else:
         return False
Example #5
0
 def invoke(self, env, context):
     self.log.debug('<map:serialize> invoke()')
     s = env.componentManager.getComponent(self.elementName, self.type)
     s.params = variables.buildMap(self.params, context, env.objectModel)
     s.statusCode = self.statusCode
     if self.mimeType is not None:
         s.mimeType = self.mimeType
     context.processingPipeline.serializer = s
     if not context.isBuildingPipelineOnly:
         return context.processingPipeline.process(env)
     else:
         return True
Example #6
0
 def invoke(self, env, context):
     g = env.componentManager.getComponent(self.elementName, self.type)
     g.src = self.src.resolve(context, env.objectModel)
     g.params = variables.buildMap(self.params, context, env.objectModel)
     context.processingPipeline.generator = g
     self.log.debug('<map:generate src="%s"> invoke()' % g.src)
Example #7
0
 def invoke(self, env, context):
     t = env.componentManager.getComponent(self.elementName, self.type)
     t.src = self.src.resolve(context, env.objectModel)
     t.params = variables.buildMap(self.params, context, env.objectModel)
     context.processingPipeline.transformers.append(t)
     self.log.debug('<map:transform src="%s"> invoke()' % t.src)
Example #8
0
 def invoke(self, env, context):
     self.log.debug('<map:call resource="%s"> invoke()' % self.name)
     params = variables.buildMap(self.params, context, env.objectModel)
     return self.invokeChildren(env, context, params)