Return TypeFunction nameArguments
hzEcodehdbADP::InitSiteIndex(const hzString&,)

Declared in file: hzDatabase.h
Defined in file : hdbClass.cpp

Function Logic:

0:START 1:!this 2:hzexit 3:m_pSiteindex 4:Return hzerr(E_SEQUENCE,This function has already been called) 5:!dataDir 6:Return hzerr(E_ARGUMENT,No application data directory) 7:S m_pSiteindex pClass hdbClass::InitStart rc 8:rc==E_OK 9:S hdbClass::InitMember rc 10:rc==E_OK 11:S hdbClass::InitMember rc 12:rc==E_OK 13:hdbClass::InitDone rc 14:rc==E_OK 15:hdbADP::RegisterDataClass rc 16:rc!=E_OK 17:hzexit 18:pRepos 19:!pRepos 20:hzexit 21:hdbDatatype::strType hdbObjRepos::InitStart rc 22:rc!=E_OK 23:hzexit 24:S hdbObjRepos::InitMbrIndex rc 25:rc!=E_OK 26:hzexit 27:hdbObjRepos::InitDone rc 28:rc!=E_OK 29:hzexit 30:hdbObjRepos::strName hzMapS::Insert rc 31:Return rc

Function body:

hzEcode hdbADP::InitSiteIndex (const hzString& dataDir)
{
   _hzfunc("hdbADP::InitSiteIndex") ;
   hdbClass*       pClass ;
   hdbObjRepos*    pRepos ;
   hzString        S ;
   hzEcode         rc ;
   if (!this)          hzexit(E_CORRUPT, "No ADP instance") ;
   if (m_pSiteindex)   return hzerr(E_SEQUENCE, "This function has already been called") ;
   if (!dataDir)       return hzerr(E_ARGUMENT, "No application data directory") ;
   S = "siteindex" ;
   m_pSiteindex = new hdbIndexText() ;
   pClass = new hdbClass(*this, HDB_CLASS_DESIG_SYS) ;
   rc = pClass->InitStart(S) ;
   if (rc == E_OK) { S = "pageUrl" ;   rc = pClass->InitMember(S, datatype_STRING, HDB_MBR_POP_SINGLE_COMPULSORY) ; }
   if (rc == E_OK) { S = "PageTitle" ; rc = pClass->InitMember(S, datatype_STRING, HDB_MBR_POP_SINGLE_COMPULSORY) ; }
   if (rc == E_OK)
   {
       rc = pClass->InitDone() ;
   }
   if (rc == E_OK)
       rc = RegisterDataClass(pClass) ;
   if (rc != E_OK)
       hzexit(rc, "Could not init subsriber class") ;
   pRepos = new hdbObjRepos(*this) ;
   if (!pRepos)
       hzexit(E_MEMORY, "No subsciber cache allocated") ;
   rc = pRepos->InitStart(pClass, pClass->strType(), dataDir, HDB_REPOS_CACHE) ;
   if (rc != E_OK)
       hzexit(rc, "Could not init subsriber repos") ;
   S = "pageUrl" ;
   rc = pRepos->InitMbrIndex(S, true) ;
   if (rc != E_OK)
       hzexit(rc, "Could not init subsriber repos index") ;
   rc = pRepos->InitDone() ;
   if (rc != E_OK)
       hzexit(rc, "Could not complete subsriber repos initialization") ;
   threadLog("Complete subsriber repos initialization") ;
   rc = m_mapRepositories.Insert(pRepos->strName(), pRepos) ;
   threadLog("Subscriber Repos Reg complete\n") ;
   return rc ;
}