Example #1
0
		void OrService::_setFromParametersMap(const ParametersMap& map)
		{
			_left = map.isTrue(PARAMETER_LEFT);
			_right = map.isTrue(PARAMETER_RIGHT);
		}
Example #2
0
		void ImportFunction::_setFromParametersMap(const ParametersMap& map)
		{
			// Import
			RegistryKeyType importId(map.get<RegistryKeyType>(PARAMETER_IMPORT_ID));
			try
			{
				boost::shared_ptr<const Import> import(ImportTableSync::Get(importId, *_env));
				if(!import->get<DataSource>())
				{
					throw RequestException("The id system of the specified import is not defined.");
				}

				// Log path
				bool outputLogs(map.getDefault<bool>(PARAMETER_OUTPUT_LOGS, false));

				// Min log force
				ImportLogLevel minLogLevel(import->get<MinLogLevel>());
				if(map.isDefined(PARAMETER_MIN_LOG_LEVEL))
				{
					minLogLevel = static_cast<ImportLogLevel>(map.get<int>(PARAMETER_MIN_LOG_LEVEL));
				}

				// Log path force
				string logPath(import->get<LogPath>());
				if(map.isDefined(PARAMETER_LOG_PATH))
				{
					logPath = map.get<string>(PARAMETER_LOG_PATH);
				}
				
				// Logger generation
				if(outputLogs)
				{
					// Importer generation
					_importer = import->getImporter(
						*_env,
						minLogLevel,
						logPath,
						_output,
						_result
					);
				}
				else
				{
					// Importer generation
					_importer = import->getImporter(
						*_env,
						minLogLevel,
						logPath,
						optional<ostream&>(),
						_result
					);
				}

				_importer->setFromParametersMap(map, true);

				_doImport = map.isTrue(PARAMETER_DO_IMPORT);
				_importDone = _importer->beforeParsing();
				_importDone &= _importer->parseFiles();
				_importDone &=_importer->afterParsing();
			}
			catch(ObjectNotFoundException<DataSource> e)
			{
				throw RequestException("Datasource not found");
			}
			catch(Exception e)
			{
				throw RequestException("Load failed : " + e.getMessage());
			}
		}
Example #3
0
		void AndFunction::_setFromParametersMap(const ParametersMap& map)
		{
			_left = map.isTrue(PARAMETER_LEFT);
			_right = map.isTrue(PARAMETER_RIGHT);
		}