Config_FeatureReader::Config_FeatureReader(const std::string& theXmlFile,
const std::string& theLibraryName,
+ const std::string& theDocSection,
const char* theEventGenerated)
: Config_XMLReader(theXmlFile),
myLibraryName(theLibraryName),
+ myLibraryDocSection(theDocSection),
myEventGenerated(theEventGenerated ? theEventGenerated : Config_FeatureMessage::GUI_EVENT()),
myIsProcessWidgets(theEventGenerated != NULL)
{
outFeatureMessage->setInternal(isInternal);
std::string aHelpFile = getProperty(theFeatureNode, HELP_FILE);
- if (!aHelpFile.empty())
- outFeatureMessage->setHelpFileName(myLibraryName + "/" + aHelpFile);
+ if (!aHelpFile.empty()) {
+ aHelpFile =
+ (myLibraryDocSection.empty() ? myLibraryName : myLibraryDocSection) + "/" + aHelpFile;
+ outFeatureMessage->setHelpFileName(aHelpFile);
+ }
bool isHideFaces = getBooleanAttribute(theFeatureNode, HIDEFACES_PANEL, false);
outFeatureMessage->setHideFacesPanel(isHideFaces);
/// Constructor
Config_FeatureReader(const std::string& theXmlFile,
const std::string& theLibraryName,
+ const std::string& theDocSection = std::string(),
const char* theEventGenerated = 0);
virtual ~Config_FeatureReader();
/// Returns list of all features defined in reader's file
private:
std::string myLibraryName;
+ std::string myLibraryDocSection;
std::list<std::string> myFeatures;
/// event generated on feature data sending, by default it is Config_FeatureMessage::GUI_EVENT()
MAYBE_UNUSED const static char* PLUGIN_SCRIPT = "script";
MAYBE_UNUSED const static char* PLUGIN_DEPENDENCY = "dependency";
MAYBE_UNUSED const static char* PLUGIN_USES = "uses";
+MAYBE_UNUSED const static char* PLUGIN_DOCSECTION = "docsection";
/*
* Hardcoded xml entities of dataModel.xml
std::string aPluginLibrary = getProperty(theNode, PLUGIN_LIBRARY);
std::string aPluginScript = getProperty(theNode, PLUGIN_SCRIPT);
std::string aPluginName = addPlugin(aPluginLibrary, aPluginScript, aPluginConf);
+ std::string aPluginDocSection = getProperty(theNode, PLUGIN_DOCSECTION);
std::string aUsesPlugin = getProperty(theNode, PLUGIN_USES);
if (!aUsesPlugin.empty()) { // send information about the plugin dependencies
std::shared_ptr<Config_PluginMessage> aMess(new Config_PluginMessage(
Events_Loop::loop()->send(aMess);
}
- std::list<std::string> aFeatures = importPlugin(aPluginName, aPluginConf);
+ std::list<std::string> aFeatures = importPlugin(aPluginName, aPluginConf, aPluginDocSection);
std::list<std::string>::iterator it = aFeatures.begin();
for (; it != aFeatures.end(); it++) {
addFeature(*it, aPluginConf);
}
std::list<std::string> Config_ModuleReader::importPlugin(const std::string& thePluginLibrary,
- const std::string& thePluginXmlConf)
+ const std::string& thePluginXmlConf,
+ const std::string& thePluginDocSection)
{
if (thePluginXmlConf.empty()) { //probably a third party library
loadLibrary(thePluginLibrary);
Config_FeatureReader aReader = Config_FeatureReader(thePluginXmlConf,
thePluginLibrary,
+ thePluginDocSection,
myEventGenerated);
aReader.readAll();
return aReader.features();
bool hasRequiredModules(xmlNodePtr aNode) const;
/// reads info about plugin's features from plugin xml description
std::list<std::string> importPlugin(const std::string& thePluginLibrary,
- const std::string& thePluginFile);
+ const std::string& thePluginFile,
+ const std::string& thePluginDocSection);
/// stores information about plugin in the internal cache
std::string addPlugin(const std::string& aPluginLibrary,
const std::string& aPluginScript,