Package muntjac :: Package terminal :: Module parameter_handler
[hide private]
[frames] | no frames]

Source Code for Module muntjac.terminal.parameter_handler

 1  # Copyright (C) 2012 Vaadin Ltd.  
 2  # Copyright (C) 2012 Richard Lincoln 
 3  #  
 4  # Licensed under the Apache License, Version 2.0 (the "License");  
 5  # you may not use this file except in compliance with the License.  
 6  # You may obtain a copy of the License at  
 7  #  
 8  #     http://www.apache.org/licenses/LICENSE-2.0  
 9  #  
10  # Unless required by applicable law or agreed to in writing, software  
11  # distributed under the License is distributed on an "AS IS" BASIS,  
12  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
13  # See the License for the specific language governing permissions and  
14  # limitations under the License. 
15   
16  """Defines an interface implemented by classes capable of handling 
17  external parameters.""" 
18   
19  from muntjac.terminal.terminal import IErrorEvent as ITerminalErrorEvent 
20   
21   
22 -class IParameterHandler(object):
23 """C{IParameterHandler} is implemented by classes capable of handling 24 external parameters. 25 26 What parameters are provided depend on what the L{Terminal} provides 27 and if the application is deployed as a servlet. URL GET 28 parameters are typically provided to the L{handleParameters} 29 method. 30 31 A C{IParameterHandler} must be registered to a C{Window} using 32 L{Window.addParameterHandler} to be called when parameters are available. 33 34 @author: Vaadin Ltd. 35 @author: Richard Lincoln 36 @version: 1.1.2 37 """ 38
39 - def handleParameters(self, parameters):
40 """Handles the given parameters. All parameters names are of type 41 string and the values are string arrays. 42 43 @param parameters: 44 an unmodifiable map which contains the parameter names 45 and values 46 """ 47 raise NotImplementedError
48 49
50 -class IErrorEvent(ITerminalErrorEvent):
51 """An IErrorEvent implementation for IParameterHandler.""" 52
53 - def getParameterHandler(self):
54 """Gets the IParameterHandler that caused the error. 55 56 @return: the IParameterHandler that caused the error 57 """ 58 raise NotImplementedError
59