Return TypeFunction nameArguments
voidhdsArtref::Generate(hzChain&,hzHttpEvent*,unsigned int&,)

Declared in file: hzDissemino.h
Defined in file : hdsGenerate.cpp

Function Logic:

0:START 1:!this 2:Fatal 3:pE 4:hzHttpEvent::Session pInfo 5:pAG 6:!pAG 7:pInfo&&pInfo->m_pTree 8:pInfo->m_pTree->m_Groupname==m_Group 9:pAG 10:!pAG 11:hzChain::Printf 12: No text 13:m_Show==300 14:items hdsNavtree::ExportDataScript hzChain::Printf items 15: No text 16:m_Article[0]==(char)64 17:!memcmp(*m_Article,@resarg;/,9) 18:pE&&pE->m_Resarg 19:hdsNavtree::GetItem pArt 20:S hdsNavtree::GetItem pArt 21:hdsNavtree::GetItem pArt 22:!pArt 23:hzChain::Printf 24:m_Show==100 25:items 26:m_Show==200 27:items 28:pArtStd 29:hdsArticleStd::Display 30:items 31:pArtCIF&&pE 32:items 33:hzChain::Printf 34: No text

Function body:

void hdsArtref::Generate (hzChain& C, hzHttpEvent* pE, unsigned int& nLine)
{
   _hzfunc("hdsArtref::Generate") ;
   hzList<hdsVE*>::Iter    ih ;
   hdsInfo*        pInfo = 0;
   hdsNavtree*     pAG = 0;
   hdsArticle*     pArt = 0;
   hdsArticleStd*  pArtStd = 0;
   hdsArticleCIF*  pArtCIF = 0;
   hzString        S ;
   if (!this)
       Fatal("No instance\n") ;
   if (pE)
       pInfo = (hdsInfo*) pE->Session() ;
   threadLog("info %p\n", pInfo) ;
   pAG = m_pApp->m_ArticleGroups[m_Group] ;
   if (!pAG)
   {
       if (pInfo && pInfo->m_pTree)
           if (pInfo->m_pTree->m_Groupname == m_Group)
               pAG = pInfo->m_pTree ;
   }
   if (!pAG)
   {
       C.Printf("SORRY: No such article group (%s)", *m_Group) ;
       return ;
   }
   if (m_Show == 300)
   {
       C << "\n<script language="javascript">\n"   ;
       pAG->ExportDataScript(C) ;
       C.Printf("makeTree('%s');\n", *m_Group) ;
       C << "</script>\n" ;
       return ;
   }
   if (m_Article[0]== CHAR_AT)
   {
       if (!memcmp(*m_Article, "@resarg;/", 9))
       {
           if (pE && pE->m_Resarg)
               pArt = (hdsArticle*) pAG->GetItem(pE->m_Resarg) ;
           else
           {
               S = *m_Article + 9;
               pArt = (hdsArticle*) pAG->GetItem(S) ;
           }
       }
   }
   else
   {
       pArt = (hdsArticle*) pAG->GetItem(m_Article) ;
       threadLog("fetched article %p %s\n", pArt, *m_Article) ;
   }
   if (!pArt)
   {
       C.Printf("SORRY: No article with group (%s) and name (%s)", *m_Group, *m_Article) ;
   }
   else
   {
       if (m_Show == 100)
       {
           C << pArt->m_Title ;
       }
       else if (m_Show == 200)
       {
           pArtStd = dynamic_cast<hdsArticleStd*>(pArt) ;
           if (pArtStd)
           {
               pArtStd->Display(C, pE) ;
           }
           else
           {
               pArtCIF = dynamic_cast<hdsArticleCIF*>(pArt) ;
               if (pArtCIF && pE)
                   pArtCIF->m_pFunc(C, pArtCIF, pE) ;
           }
       }
       else
       {
           C.Printf("FOUND: article with group (%s) and name (%s) but no show directive", *m_Group, *pArt->m_Title) ;
       }
   }
}