28namespace DocumentsReader {
50 m_tagElementNames(), m_tagAttributeNames()
55 : m_storageType ( dpt.m_storageType ), m_storageSize ( dpt.m_storageSize ),
56 m_cardinalityType ( dpt.m_cardinalityType ),
57 m_tagElementNames(dpt.m_tagElementNames), m_tagAttributeNames(dpt.m_tagAttributeNames)
112 LDEBUG <<
"DocumentPropertyType::init()";
118 QString storageTypeId = QString::fromUtf8(unitConfiguration.
getParamsValueAtKey (
"storageType" ).c_str());
132 LERROR <<
"no param 'storageType' in DocumentPropertyType group for " <<
getId();
146 LWARN <<
"no param 'storageSize' in DocumentPropertyType group for " <<
getId();
152 QString cardinalityTypeId = QString::fromUtf8(unitConfiguration.
getParamsValueAtKey (
"cardinality" ).c_str());
166 LERROR <<
"no param 'cardinality' in DocumentPropertyType group for " <<
getId();
173 const std::deque< std::string >& list = unitConfiguration.
getListsValueAtKey (
"elementNames" );
174 for(
const std::string& elem : list)
178 LDEBUG <<
"DocumentPropertyType::init: m_tagElementNames.push_back("
187 LDEBUG <<
"no list 'elementNames' in DocumentPropertyType group for " <<
getId();
193 const std::deque< std::string >& list = unitConfiguration.
getListsValueAtKey (
"attributeNames" );
194 for (
auto it = list.begin() ; it != list.end() ; it++ )
197 std::string::size_type spaceOffset=it->find (
' ' );
198 if ( spaceOffset == std::string::npos )
201 LWARN <<
"DocumentPropertyType::init(): ill formed attributeName for "
202 <<
getId() <<
": " << *it;
206 unsigned int equalOffset=it->find (
'=',spaceOffset+1 );
207 std::string attributeName ( *it,spaceOffset+1,equalOffset-spaceOffset-1 );
208 std::string newFieldName ( *it,0,spaceOffset );
211 LDEBUG <<
"DocumentPropertyType::init: m_tagAttributeNames.push_back("
212 << newFieldName <<
", " << attributeName <<
")";
214 m_d->
m_tagAttributeNames.push_back ( pair<QString,QString> ( QString::fromUtf8(newFieldName.c_str()),QString::fromUtf8(attributeName.c_str()) ) );
221 LDEBUG <<
"no list 'attributeNames' in DocumentPropertyType group for " <<
getId();
244 unitConfiguration, manager );
259 unitConfiguration, manager );
263 LERROR <<
"no list ('attributeNames' or 'elementNames') in DocumentPropertyType group for " <<
getId();
Defines a Factory to create Object of type Base.
std::string & getParamsValueAtKey(const std::string &key)
std::deque< std::string > & getListsValueAtKey(const std::string &key)
return a message when a 'list' was not found
return a message when a 'param' was not found
std::deque< QString > m_tagElementNames
std::deque< std::pair< QString, QString > > m_tagAttributeNames
DocumentPropertyTypePrivate()
CardinalityType m_cardinalityType
StorageType m_storageType
~DocumentPropertyTypePrivate()
DocumentPropertyTypePrivate & operator=(const DocumentPropertyTypePrivate &dpt)
const std::deque< QString > & getElementTagNames() const
const long int & getStorageSize() const
DocumentPropertyTypePrivate * m_d
const StorageType & getStorageType() const
DocumentPropertyType & operator=(const DocumentPropertyType &dpt)
const std::deque< std::pair< QString, QString > > & getAttributeTagNames() const
void init(Lima::Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, Manager *manager) override
const CardinalityType & getValueCardinality() const
virtual ~DocumentPropertyType()
bool operator<(const DocumentPropertyType &dpt) const
ExtensionDocumentPropertyType()
void init(Lima::Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, Manager *manager) override
void init(Lima::Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, Manager *manager) override
StandardDocumentPropertyType()
Manage initialization of InitializableObjects using configuration module and parameters.
const std::string & getId() const
get the object id
Use this exception to signal an error in one of the configuration files.
#define EXTENSIONDOCUMENTPROPERTYTYPE_CLASSID
#define STANDARDDOCUMENTPROPERTYTYPE_CLASSID
originally detectModuleConfigurationStructure.h in detectlibraries
Lima::SimpleFactory< AbstractReaderResource, Lima::DocumentsReader::ExtensionDocumentPropertyType > extensionDocumentPropertyTypeFactory(EXTENSIONDOCUMENTPROPERTYTYPE_CLASSID)
static const QString cardinalityTypeTag[MAX_STORAGE_TYPE]
Lima::SimpleFactory< AbstractReaderResource, Lima::DocumentsReader::StandardDocumentPropertyType > standardPropertyTypeFactory(STANDARDDOCUMENTPROPERTYTYPE_CLASSID)
StorageType
a type meaning the storage type of an attribute
static const QString storageTypeTag[MAX_STORAGE_TYPE]
CardinalityType
a type meaning the cardinality of an attribute