Load a webapp config file into an XML document, then call ReadWebapp() with the root node, which is expected to be a <webappCfg> tag. Arguments: None
| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hdsApp::ReadWebappCfg | (hzString&,) |
Declared in file: hzDissemino.h
Defined in file : hdsConfig.cpp
Function Logic:
Function body:
hzEcode hdsApp::ReadWebappCfg (hzString& cfgPath)
{
// Category: Dissemino Application Configuration
//
// Load a webapp config file into an XML document, then call ReadWebapp() with the root node, which is expected to be a <webappCfg> tag.
//
// Arguments: None
//
// Returns: E_ARGUMENT If no project file is supplied
// E_OPENFAIL If the project file could not be loaded
// E_CONFIG If there are errors in the XML config
// E_OK If the project config was read in
_hzfunc("hdsApp::ReadWebappCfg") ;
hzDocXml X ; // The config document
hzXmlNode* pRoot ; // Config document root
hzString S ; // Intermeadiate string
hzEcode rc = E_OK ; // Return code
if (!this)
hzexit(E_CORRUPT, "No Instance") ;
if (!m_BaseDir || !m_RootFile)
return hzerr(E_NOINIT, "No project file") ;
// S = m_BaseDir ;
// S += "/config/" ;
// S += m_RootFile ;
m_pLog->Log("Processing Webapp Cfg File [%s]\n", *S) ;
rc = X.Load(*cfgPath) ;
if (rc != E_OK)
{
m_pLog->Log(X.Error()) ;
return hzerr(rc, "Could not load project file [%s]", *cfgPath) ;
}
m_pLog->Log("Loaded project file [%s]\n", *cfgPath) ;
pRoot = X.GetRoot() ;
if (!pRoot)
{
hzerr(E_OPENFAIL, "Could not obtain project file root [%s]", *S) ;
return E_OPENFAIL ;
}
m_pLog->Log("Obtained project's XML root <%s>\n", pRoot->txtName()) ;
rc = ReadWebapp(pRoot) ;
return rc ;
}