使用soui开发的mbc,只支持windows版本
w1146869587
2022-01-24 4905e2e7537d507f218e8e9595485e09d9f3a2b4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#include "StdAfx.h" 
#include "MBShareMgr.h"
 
 
CMBShareMgr::CMBShareMgr(void)
{
    m_pDocMgr       = new  CMBShareDocMgr();
    m_pCatalogMgr   = new CMBShareCatalogMgr();
    m_nRecords        = 0;
    m_nTotalPages   = 0;
    m_nCurPage      = 0;
    m_nPageSize        = 0;
    m_bLoadShare    = false;
}
 
 
CMBShareMgr::~CMBShareMgr(void)
{
    if( m_pDocMgr )
    {
        delete m_pDocMgr;
        m_pDocMgr = NULL;
    }
    if( m_pCatalogMgr )
    {
        delete m_pCatalogMgr;
        m_pCatalogMgr = NULL;
    }
}
 
 
CMBShareDocMgr      *CMBShareMgr::GetShareDocMgr()
    return m_pDocMgr; 
}
 
CMBShareCatalogMgr  *CMBShareMgr::GetShareCatalogMgr()
{
    return m_pCatalogMgr;
}
 
void  CMBShareMgr::GetBaseObjVector(CMBBaseObjVector &vectorObj)
{
    m_pCatalogMgr->GetBaseObjVector(vectorObj);
    m_pDocMgr->GetBaseObjVector(vectorObj);
}
 
// ÒƳý²éѯ¹ÜÀíÆ÷
void  CMBShareMgr::RemoveShareMgr()
{
    m_pDocMgr->RemoveAllDocInfo();
    m_pCatalogMgr->RemoveAllCatalogInfo();
}
 
int  CMBShareMgr::GetCount()
{
    return m_pDocMgr->GetCount() + m_pCatalogMgr->GetCount();
}
 
 
bool CMBShareMgr::ParseXml( CString strXml,CString &strErrInfo )
{
    if( strXml.IsEmpty() )
    {     
        return true;
    }
    pugi::xml_document    xmlDoc;    
    if (!xmlDoc.load(strXml))   
    {   
        strErrInfo = _T("CMBShareMgr::ParseXml,¼ÓÔØxmlʧ°Ü!");
        return false;
    }   
 
     
    RemoveShareMgr();
 
    CString strRecords,strTotalPages,
        strCurPage,strPageSize,strFileSize;
 
    pugi::xml_node form  = xmlDoc.child(_T("Result")); 
    //////½Ó¿Ú·µ»ØµÄÊý¾ÝºÍ½Ó¿ÚÎĵµ²»Ò»Ö£¬ËùÒÔÏȰ´ÕÕ½Ó¿ÚÀ´·µ»ØµÄÊý¾Ý½âÎö
    form  = xmlDoc.child(_T("Body")); 
    pugi::xml_node node = form; 
    //////////////////Ò³µÄÐÅÏ¢////////////////////////////////
    m_strSessionID     = node.child_value(_T("SessionID"));
    strRecords           = node.child_value(_T("Records"));
    m_nRecords         = _ttoi(strRecords);
    strTotalPages      = node.child_value(_T("TotalPages"));
    m_nTotalPages      = _ttoi(strTotalPages);
    strCurPage         = node.child_value(_T("CurPage"));
    m_nCurPage         = _ttoi(strCurPage);
    strPageSize        = node.child_value(_T("PageSize"));
    m_nPageSize        = _ttoi(strPageSize); 
    ///////////////////catalogÐÅÏ¢/////////////////////////////
    //node =  form.child(_T("Body")).child(_T("Catalog"));  
    node =  form.child(_T("Catalog"));  //////½Ó¿Ú·µ»ØµÄÊý¾ÝºÍ½Ó¿ÚÎĵµ²»Ò»Ö£¬ËùÒÔÏȰ´ÕÕ½Ó¿ÚÀ´·µ»ØµÄÊý¾Ý½âÎö
    for (pugi::xml_node catalogNode = node; catalogNode; catalogNode = catalogNode.next_sibling()) 
    {
        CMBShareCatalogInfo *pCatalog  = new CMBShareCatalogInfo(); 
        pCatalog->m_strID          = catalogNode.attribute(_T("ID")).value(); 
        pCatalog->m_strListType    = catalogNode.attribute(_T("ListType")).value();
        pCatalog->m_strOrder       = catalogNode.attribute(_T("Order")).value(); 
        CString strSubCount        = catalogNode.attribute(_T("SubCount")).value();
        pCatalog->m_nSubCount      = _ttoi(strSubCount);
        CString strFileCount       = catalogNode.attribute(_T("FileCount")).value();
        pCatalog->m_nFileCount     = _ttoi(strFileCount);
        pCatalog->m_strDtCreate    = catalogNode.attribute(_T("DTCreate")).value(); 
        pCatalog->m_strHasAce      = catalogNode.attribute(_T("HasAce")).value();
        pCatalog->m_strPermit      = catalogNode.attribute(_T("Permit")).value();
        pCatalog->m_strGlobalEdit  = catalogNode.attribute(_T("GlobalEdit")).value(); 
        pCatalog->m_strMasterID    = catalogNode.attribute(_T("MasterID")).value();
        pCatalog->m_strMasterName  = catalogNode.attribute(_T("MasterName")).value();
        pCatalog->m_strName        = catalogNode.child_value(_T("Name"));    
 
        pCatalog->m_strSharedTime  = catalogNode.attribute(_T("SharedTime")).value();// ¨C ¹²Ïíʱ¼ä
        pCatalog->m_strInvalidDate = catalogNode.attribute(_T("InvalidDate")).value();// ¨C Ê§Ð§ÈÕÆÚ
 
        pCatalog->m_strSharers      = catalogNode.child_value(_T("Sharers"));// ¨C ¹²Ïí¸øÄÄЩÈË
        pCatalog->m_strTags            = catalogNode.child_value(_T("Tags"));// ¨C Îĵµ±êÇ©
 
        pCatalog->m_strOwnerUserID  = catalogNode.attribute(_T("OwnerUserID")).value();// ¨C ¹²ÏíÕߵǼÃû
        pCatalog->m_strOwnerUserName= catalogNode.attribute(_T("OwnerUserName")).value();// ¨C ¹²ÏíÕßÃû³Æ 
        pCatalog->m_strLastViewTime = catalogNode.attribute(_T("LastViewTime")).value();// ¨C ×îºóÒ»´Îä¯ÀÀʱ¼ä
        pCatalog->m_strLastModify   = catalogNode.attribute(_T("LastModify")).value();// ¨C ×îºóÒ»´ÎÐÞ¸Äʱ¼ä 
 
        if( !m_pCatalogMgr->AddCatalogInfo(pCatalog) )
        { 
            delete pCatalog;
            pCatalog = NULL;
        }
    } 
    ///////////////////docÐÅÏ¢/////////////////////////////////
    //node =  form.child(_T("Body")).child(_T("Doc"));  
    node =  form.child(_T("Doc"));      //////½Ó¿Ú·µ»ØµÄÊý¾ÝºÍ½Ó¿ÚÎĵµ²»Ò»Ö£¬ËùÒÔÏȰ´ÕÕ½Ó¿ÚÀ´·µ»ØµÄÊý¾Ý½âÎö
    for (pugi::xml_node docNode = node; docNode; docNode = docNode.next_sibling()) 
    {
        CMBShareDocInfo *pDoc    = new CMBShareDocInfo();  
        pDoc->m_strID        = docNode.attribute(_T("ID")).value();
        pDoc->m_strName      = docNode.child_value(_T("Name"));  
        pDoc->m_strStatus    = docNode.attribute(_T("Status")).value();
        pDoc->m_strFileType  = docNode.attribute(_T("FileType")).value();
        pDoc->m_strFileTime  = docNode.attribute(_T("FileTime")).value(); 
        strFileSize               = docNode.attribute(_T("FileSize")).value();
        pDoc->m_nFileSize    = _ttoi(strFileSize);
        pDoc->m_strDTCreate  = docNode.attribute(_T("DTCreate")).value();        
        pDoc->m_strCreatorID = docNode.attribute(_T("CreatorID")).value();
        pDoc->m_strCreatorName = docNode.attribute(_T("CreatorName")).value();
 
        pDoc->m_strLocker      = docNode.attribute(_T("Locker")).value(); 
        pDoc->m_strLockerName  = docNode.attribute(_T("LockerName")).value(); 
        pDoc->m_strLockTime    = docNode.attribute(_T("LockTime")).value(); 
 
        pDoc->m_strTags      = docNode.attribute(_T("Tags")).value();            
        pDoc->m_strThumbURL  = docNode.child_value(_T("ThumbURL"));
        
        pDoc->m_strSharedTime  = docNode.attribute(_T("SharedTime")).value();// ¨C ¹²Ïíʱ¼ä
        pDoc->m_strInvalidDate = docNode.attribute(_T("InvalidDate")).value();// ¨C Ê§Ð§ÈÕÆÚ
 
        pDoc->m_strSharers     = docNode.child_value(_T("Sharers"));// ¨C ¹²Ïí¸øÄÄЩÈË
        pDoc->m_strTags           = docNode.child_value(_T("Tags"));// ¨C Îĵµ±êÇ©
 
        pDoc->m_strOwnerUserID  = docNode.attribute(_T("OwnerUserID")).value();// ¨C ¹²ÏíÕߵǼÃû
        pDoc->m_strOwnerUserName= docNode.attribute(_T("OwnerUserName")).value();// ¨C ¹²ÏíÕßÃû³Æ 
        pDoc->m_strLastViewTime = docNode.attribute(_T("LastViewTime")).value();// ¨C ×îºóÒ»´Îä¯ÀÀʱ¼ä
        pDoc->m_strLastModify   = docNode.attribute(_T("LastModify")).value();// ¨C ×îºóÒ»´ÎÐÞ¸Äʱ¼ä 
 
        if( !m_pDocMgr->AddDocInfo(pDoc) )
        { 
            delete pDoc;
            pDoc = NULL;
        }
    }  
 
    return true;
}