'Apply parameters values from session items'

def do_apply(self, input):

    plugin = self.get_active_plugin()
    params = util.iDict()
    inputList = input.strip().split()
    if (not inputList):
        for contract in self.session.get_contractlist():
            for param in contract.get_paramlist():
                params.setdefault(param.name, []).append((param, contract))
        self.apply_process(params, plugin)
    else:
        try:
            index = int(inputList[0])
        except ValueError:
            raise exception.CmdErr, 'apply    [index]'
        contract = self.fb.session.get_contract(index)
        for param in contract.get_paramlist():
            params[param.name] = [(param, contract)]
        self.apply_process(params, plugin, singlemode=True)
