Changeset 504 for branches


Ignore:
Timestamp:
04/03/14 17:28:39 (5 years ago)
Author:
jls17
Message:
Location:
branches/work_311
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/work_311/doc/DocImageDetails.cpp

    r480 r504  
    1919#include "../core/ARImage.h" 
    2020#include "../output/WorkflowReferenceTable.h" 
     21#include "../output/RootLevel.h" 
    2122#include "DocOverlayHelper.h" 
    2223 
     
    7879 
    7980                stringstream imgTag; 
    80                 imgTag << "<p class=\"ars_image\"><img src=\"" << CWebUtil::RootPath(rootLevel) << imageLink->GetFullFileName() <<  "\" alt=\"" << image.GetType() << "\" /></p>"; 
     81                imgTag << "<p class=\"ars_image\"><img src=\"" << RootLevel(rootLevel) << imageLink->GetFullFileName() <<  "\" alt=\"" << image.GetType() << "\" /></p>"; 
    8182                webPage.AddContent(imgTag.str()); 
    8283 
  • branches/work_311/output/FileNaming.cpp

    r419 r504  
    6868const char* FILE_SERVER = "server"; 
    6969 
     70class MainHomePage : public IFileStructure 
     71{ 
     72public: 
     73        MainHomePage() { } 
     74        virtual string GetFileName() const { return FILE_INDEX; } 
     75        virtual string GetFullFileName() const { return CWebUtil::DocName(GetFileName()); } 
     76        virtual string GetPath() const { return ""; } 
     77        virtual unsigned int GetRootLevel() const { return 0; } 
     78}; 
     79 
    7080//////////////////////////////////////////////////////////////////// 
    7181// for Schemas                                                    // 
     
    12591269        switch (params.page) 
    12601270        { 
     1271                case PAGE_MAINHOME: return new MainHomePage(); 
    12611272                case PAGE_DETAILS: 
    12621273                { 
     
    23722383        switch (params.page) 
    23732384        { 
     2385                case PAGE_MAINHOME: return new MainHomePage(); 
    23742386                case PAGE_DETAILS: 
    23752387                { 
  • branches/work_311/output/IFileStructure.h

    r246 r504  
    9797const unsigned int PAGE_OVERVIEW_OTHER = '#'; 
    9898 
     99const unsigned int PAGE_MAINHOME = 0; 
     100 
    99101// === PAGE_DETAILS === 
    100102// CPageParams: obj1 = arServerObject -- detail page for object --- objType = AR_STRUCT_ITEM_XML_* 
  • branches/work_311/output/ImageTag.cpp

    r503 r504  
    7777                return strm; 
    7878        } 
     79 
     80        ostream& operator <<(ostream &strm, OUTPUT::ImageTag::ImageEnum image) 
     81        { 
     82                ImageTag img(image, 0); 
     83                return img.ToStream(strm); 
     84        } 
     85 
     86        ostream& operator <<(ostream &strm, const OUTPUT::ImageTag &image) 
     87        { 
     88                return image.ToStream(strm); 
     89        } 
    7990}; // end namespace OUTPUT 
    80  
    81 ostream& operator <<(ostream &strm, OUTPUT::ImageTag::ImageEnum image) 
    82 { 
    83         ImageTag img(image, 0); 
    84         return img.ToStream(strm); 
    85 } 
    86  
    87 ostream& operator <<(ostream &strm, const OUTPUT::ImageTag &image) 
    88 { 
    89         return image.ToStream(strm); 
    90 } 
  • branches/work_311/output/ImageTag.h

    r503 r504  
    4545                ImageEnum imageOverlayId; 
    4646        }; 
     47 
     48        std::ostream& operator<<(std::ostream& strm, OUTPUT::ImageTag::ImageEnum image); 
     49        std::ostream& operator<<(std::ostream& strm, const OUTPUT::ImageTag &image); 
    4750}; 
    48  
    49 std::ostream& operator<<(std::ostream& strm, OUTPUT::ImageTag::ImageEnum image); 
    50 std::ostream& operator<<(std::ostream& strm, const OUTPUT::ImageTag &image); 
  • branches/work_311/output/RootLevel.cpp

    r503 r504  
    3737        } 
    3838 
     39        ostream& operator <<(ostream &stream, const OUTPUT::RootLevel &rootLevelObj) 
     40        { 
     41                stream << rootLevelObj.GetRootPath(); 
     42                return stream; 
     43        } 
    3944}; // end namespace OUTPUT; 
    4045 
    41 ostream& operator <<(ostream &stream, const OUTPUT::RootLevel &rootLevelObj) 
    42 { 
    43         stream << rootLevelObj.GetRootPath(); 
    44         return stream; 
    45 } 
  • branches/work_311/output/RootLevel.h

    r503 r504  
    2929        }; 
    3030 
     31        std::ostream& operator <<(std::ostream &stream, const OUTPUT::RootLevel &rootLevelObj); 
    3132}; // end namespace OUTPUT 
    32  
    33 std::ostream& operator <<(std::ostream &stream, const OUTPUT::RootLevel &rootLevelObj); 
  • branches/work_311/output/WebPage.cpp

    r442 r504  
    1616 
    1717#include "stdafx.h" 
     18#include "RootLevel.h" 
    1819#include "WebPage.h" 
    1920#include "WebUtil.h" 
     
    8384        strm << "<table>" << endl; 
    8485        strm << "<tr>" << endl; 
    85         strm << "<td>" << CWebUtil::Link("Main", CWebUtil::RootPath(rootLevel)+ CWebUtil::DocName("index"), "server.gif", rootLevel) << "</td>" << endl; 
     86        strm << "<td>" << CWebUtil::Link("Main", CPageParams(PAGE_MAINHOME), "server.gif", rootLevel) << "</td>" << endl; 
    8687        strm << "<td>" << " (Server: " << CWebUtil::Link(appConfig.serverName, CPageParams(PAGE_SERVER_INFO), "", rootLevel) << "</td>" << endl; 
    8788        strm << "<td>" << "@" << "</td>" << endl; 
     
    99100{ 
    100101        strm << "<table><tr>" << endl; 
    101         strm << "<td>" << CWebUtil::Link("Main", CWebUtil::RootPath(rootLevel) + CWebUtil::DocName("index"), "next.gif", rootLevel)<< "</td>" << endl; 
     102        strm << "<td>" << CWebUtil::Link("Main", CPageParams(PAGE_MAINHOME), "next.gif", rootLevel)<< "</td>" << endl; 
    102103        strm << "<td>&nbsp;</td>" << endl; 
    103104        strm << "<td>" << CWebUtil::Link("Top", "#top", "up.gif", rootLevel)<< "</td>" << endl; 
     
    126127                strm << "</div>" << endl; 
    127128        } 
    128         strm << "<iframe id=\"IFrameMenu\" src=\"" << CWebUtil::RootPath(rootLevel) << "template/navigation." << CWebUtil::WebPageSuffix() << "\" name=\"Navigation\" frameborder=\"0\">" << endl; 
     129        strm << "<iframe id=\"IFrameMenu\" src=\"" << RootLevel(rootLevel) << "template/navigation." << CWebUtil::WebPageSuffix() << "\" name=\"Navigation\" frameborder=\"0\">" << endl; 
    129130        strm << "<p>IFrame not supported by this browser.</p></iframe></td><td class=\"TdMainContent\">" << endl; 
    130131} 
     
    202203void CWebPage::AddScriptReference(std::ostream &strm, const std::string &scriptPath) 
    203204{ 
    204         strm << "<script src=\"" << CWebUtil::RootPath(rootLevel) << scriptPath << "\" type=\"text/javascript\"></script>" << endl; 
     205        strm << "<script src=\"" << RootLevel(rootLevel) << scriptPath << "\" type=\"text/javascript\"></script>" << endl; 
    205206} 
    206207 
    207208void CWebPage::AddStyleSheetReference(std::ostream &strm, const std::string &cssPath) 
    208209{ 
    209         strm << "<link rel=\"stylesheet\" type=\"text/css\" href=\"" << CWebUtil::RootPath(rootLevel) << cssPath << "\" />" << endl; 
     210        strm << "<link rel=\"stylesheet\" type=\"text/css\" href=\"" << RootLevel(rootLevel) << cssPath << "\" />" << endl; 
    210211} 
    211212 
  • branches/work_311/output/WebUtil.cpp

    r500 r504  
    1616 
    1717#include "stdafx.h" 
     18#include "RootLevel.h" 
    1819#include "WebUtil.h" 
    1920#include "../ARInside.h" 
     
    2930CWebUtil::~CWebUtil(void) 
    3031{ 
    31 } 
    32  
    33 string CWebUtil::RootPath(int level) 
    34 { 
    35         switch(level) 
    36         { 
    37         case 0: 
    38         default: return "./"; 
    39         case 1: return "../"; 
    40         case 2: return "../../"; 
    41         case 3: return "../../../"; 
    42         } 
    4332} 
    4433 
     
    151140        if (!imgOverlay.empty()) 
    152141        { 
    153                 strm << "style=\"background:url(" << CWebUtil::RootPath(rootLevel) << "img/" << imgName << ")\" " 
    154                      << "src=\"" << CWebUtil::RootPath(rootLevel) << "img/" << imgOverlay << "\" "; 
     142                strm << "style=\"background:url(" << RootLevel(rootLevel) << "img/" << imgName << ")\" " 
     143                     << "src=\"" << RootLevel(rootLevel) << "img/" << imgOverlay << "\" "; 
    155144        } 
    156145        else 
    157146        { 
    158                 strm << "src=\"" << CWebUtil::RootPath(rootLevel) << "img/" << imgName << "\" "; 
     147                strm << "src=\"" << RootLevel(rootLevel) << "img/" << imgName << "\" "; 
    159148        } 
    160149        strm << "width=\"" << width << "\" height=\"" << height << "\" alt=\"" << imgName << "\" />"; 
     
    385374string CWebUtil::LinkToHelper(string name, int objectCount, const CPageParams& page, const string& image, int rootLevel) 
    386375{ 
     376        RootLevel rootPath(rootLevel); 
    387377        stringstream strmTmp; 
    388378        strmTmp.str(""); 
     
    390380        if(objectCount > -1) strmTmp << objectCount << " "; 
    391381 
    392         strmTmp << CWebUtil::Link(name, RootPath(rootLevel) + page->GetFullFileName(), image, rootLevel); 
     382        strmTmp << CWebUtil::Link(name, rootPath.GetRootPath() + page->GetFullFileName(), image, rootLevel); 
    393383        return strmTmp.str(); 
    394384} 
     
    445435        else 
    446436        { 
    447                 strmTmp << "<a href=\"" << RootPath(rootLevel) + linkToPage->GetFullFileName() << "\""; 
     437                strmTmp << "<a href=\"" << RootLevel(rootLevel) << linkToPage->GetFullFileName() << "\""; 
    448438                if (target > TARGET_MODE_SELF) 
    449439                { 
     
    465455string CWebUtil::GetRelativeURL(int rootLevel, const CPageParams& page) 
    466456{ 
    467         return RootPath(rootLevel) + page->GetFullFileName(); 
    468 } 
     457        RootLevel rootPath(rootLevel); 
     458        return rootPath.GetRootPath() + page->GetFullFileName(); 
     459} 
  • branches/work_311/output/WebUtil.h

    r500 r504  
    3636                ~CWebUtil(void); 
    3737 
    38                 static string RootPath(int level);       
    3938                static string Validate(const string& text); 
    4039                //static string Replace(string text); 
  • branches/work_311/output/webpage/HtmlReferenceListImpl.cpp

    r311 r504  
    1717#include "stdafx.h" 
    1818#include "HtmlReferenceListImpl.h" 
     19#include "../RootLevel.h" 
    1920#include "../WebUtil.h" 
    2021 
     22using namespace OUTPUT; 
    2123using namespace OUTPUT::WebPage; 
    2224 
     
    6163void HtmlReferenceListImpl::WriteCSSReference(std::ostream &output, const std::string &cssPath) const 
    6264{ 
    63         output << "<link rel=\"stylesheet\" type=\"text/css\" href=\"" << CWebUtil::RootPath(rootLevel) << cssPath << "\" />" << endl; 
     65        output << "<link rel=\"stylesheet\" type=\"text/css\" href=\"" << RootLevel(rootLevel) << cssPath << "\" />" << endl; 
    6466} 
    6567 
    6668void HtmlReferenceListImpl::WriteJSReference(std::ostream &output, const std::string &scriptPath) const 
    6769{ 
    68         output << "<script src=\"" << CWebUtil::RootPath(rootLevel) << scriptPath << "\" type=\"text/javascript\"></script>" << endl; 
     70        output << "<script src=\"" << RootLevel(rootLevel) << scriptPath << "\" type=\"text/javascript\"></script>" << endl; 
    6971} 
  • branches/work_311/output/webpage/HtmlReferenceListImplTest.cpp

    r311 r504  
    2424 
    2525        output << refList; 
    26         ASSERT_EQ("<script src=\"./jquery.js\" type=\"text/javascript\"></script>\n", output.str()); 
     26        ASSERT_EQ("<script src=\"jquery.js\" type=\"text/javascript\"></script>\n", output.str()); 
    2727} 
    2828 
     
    3535 
    3636        output << refList; 
    37         ASSERT_EQ("<link rel=\"stylesheet\" type=\"text/css\" href=\"./page.css\" />\n", output.str()); 
     37        ASSERT_EQ("<link rel=\"stylesheet\" type=\"text/css\" href=\"page.css\" />\n", output.str()); 
    3838} 
Note: See TracChangeset for help on using the changeset viewer.