#NEWLINE# def RenderAjax( self , request , response ) : #NEWLINE# #INDENT# 'Parse the flow args from the form and launch the flow.' #NEWLINE# self . flow_name = self . _GetFlowName ( request ) #NEWLINE# self . client_id = request . REQ . get ( 'client_id' , None ) #NEWLINE# self . dom_node = request . REQ . get ( 'dom_node' ) #NEWLINE# flow_cls = flow . GRRFlow . classes . get ( self . flow_name ) #NEWLINE# if ( flow_cls is not None ) : #NEWLINE# #INDENT# self . args = forms . SemanticProtoFormRenderer ( flow_cls . args_type ( ) , prefix = 'args' ) . ParseArgs ( request ) #NEWLINE# try : #NEWLINE# #INDENT# self . args . Validate ( ) #NEWLINE# #UNINDENT# except ValueError as e : #NEWLINE# #INDENT# return self . CallJavascript ( response , 'SemanticProtoFlowForm.RenderAjaxError' , error = str ( e ) ) #NEWLINE# #UNINDENT# self . runner_args = forms . SemanticProtoFormRenderer ( flow_runner . FlowRunnerArgs ( ) , prefix = 'runner_' ) . ParseArgs ( request ) #NEWLINE# self . runner_args . Validate ( ) #NEWLINE# self . flow_id = flow . GRRFlow . StartFlow ( client_id = self . client_id , flow_name = self . flow_name , token = request . token , args = self . args , runner_args = self . runner_args ) #NEWLINE# #UNINDENT# self . args_html = semantic . FindRendererForObject ( self . args ) . RawHTML ( request ) #NEWLINE# self . runner_args_html = semantic . FindRendererForObject ( self . runner_args ) . RawHTML ( request ) #NEWLINE# response = renderers . TemplateRenderer . Layout ( self , request , response , apply_template = self . ajax_template ) #NEWLINE# return self . CallJavascript ( response , 'SemanticProtoFlowForm.RenderAjax' , renderer = self . __class__ . __name__ , dom_node = self . dom_node )