Exemplo n.º 1
0
    BOOL LoadFromXmlRpc(CWizXmlRpcStructValue& data)
    {
        BOOL bInfo = FALSE;
        BOOL bData = FALSE;
        data.GetBool(_T("attachment_info"), bInfo);
        data.GetBool(_T("attachment_data"), bData);
        data.GetInt64(_T("version"), nVersion);
        //
        nParts = 0;
        nParts |= bInfo ? WIZKM_XMKRPC_ATTACHMENT_PART_INFO : 0;
        nParts |= bData ? WIZKM_XMKRPC_ATTACHMENT_PART_DATA : 0;
        //
        data.GetString(_T("attachment_guid"), strGUID);
        data.GetInt64(_T("version"), nVersion);
        //
        if (bInfo)
        {
            data.GetStr(_T("attachment_document_guid"), strDocumentGUID);
            data.GetStr(_T("attachment_name"), strName);
            data.GetStr(_T("attachment_url"), strURL);
            data.GetStr(_T("attachment_description"), strDescription);
            data.GetTime(_T("dt_info_modified"), tInfoModified);
            data.GetStr(_T("info_md5"), strInfoMD5);
            data.GetTime(_T("dt_data_modified"), tDataModified);
            data.GetStr(_T("data_md5"), strDataMD5);
        }

        //
        data.GetInt(_T("attachment_zip_size"), nDataSize);
        //
        return !strGUID.isEmpty();
    }
Exemplo n.º 2
0
bool WIZDOCUMENTDATAEX_XMLRPC_SIMPLE::LoadFromXmlRpc(CWizXmlRpcStructValue& data)
{
    data.GetStr(_T("document_guid"), strGUID);
    data.GetStr(_T("document_title"), strTitle);	/*用于同步过程,显示正在下载的文章标题////*/
    data.GetStr(_T("document_category"), strLocation);	/*用于CyberArticle判断是否需要下载该文档(是否属于当前书籍)////*/
    /*
        data.GetStr(_T("document_filename"), strName);
        data.GetStr(_T("document_seo"), strSEO);
        data.GetStr(_T("document_url"), strURL);
        data.GetStr(_T("document_author"), strAuthor);
        data.GetStr(_T("document_keywords"), strKeywords);
        data.GetStr(_T("document_type"), strType);
        data.GetStr(_T("document_owner"), strOwner);
        data.GetStr(_T("document_filetype"), strFileType);
        data.GetStr(_T("document_styleguid"), strStyleGUID);
        data.GetTime(_T("dt_created"), tCreated);
        data.GetTime(_T("dt_modified"), tModified);
        data.GetTime(_T("dt_accessed"), tAccessed);
        data.GetInt(_T("document_iconindex"), nIconIndex);
        data.GetInt(_T("document_protected"), nProtected);
        data.GetInt(_T("document_readcount"), nReadCount);
        data.GetInt(_T("document_attachment_count"), nAttachmentCount);
        */
    data.GetTime(_T("dt_info_modified"), tInfoModified);
    data.GetStr(_T("info_md5"), strInfoMD5);
    data.GetTime(_T("dt_data_modified"), tDataModified);
    data.GetStr(_T("data_md5"), strDataMD5);
    data.GetTime(_T("dt_param_modified"), tParamModified);
    data.GetStr(_T("param_md5"), strParamMD5);
    data.GetInt64(_T("version"), nVersion);
    //
    //data.GetArrayStringArray(_T("tags"), arrayTagGUID);
    //
    return !strGUID.isEmpty();
}
Exemplo n.º 3
0
bool WIZGROUPDATA::LoadFromXmlRpc(CWizXmlRpcStructValue& data, const QString& kbGUID)
{
    Q_UNUSED(kbGUID);

    data.GetStr(_T("kb_name"), strGroupName);
    data.GetStr(_T("kb_note"), strGroupNote);
    data.GetStr(_T("kb_guid"), strGroupGUID);
    data.GetInt(_T("user_group"), nUserGroup);
    data.GetStr(_T("kapi_url"), strDatabaseServer);
    data.GetStr(_T("server_url"), strServerUrl);
    data.GetTime(_T("dt_created"), tCreated);
    data.GetTime(_T("dt_modified"), tModified);
    data.GetStr(_T("user_name"), strUserName);

    // obsolete, not used currently
    data.GetStr(_T("role_note"), strRoleNote);
    data.GetTime(_T("dt_role_created"), tRoleCreated);
    data.GetStr(_T("owner_name"), strOwner);
    data.GetStr(_T("kb_type"), strType);
    data.GetStr(_T("kb_seo"), strGroupSEO);
    data.GetStr(_T("tag_names"), strGroupTags);
    data.GetStr(_T("kb_id"), strId);

    return !strGroupName.isEmpty()
            && !strGroupGUID.isEmpty()
            && !strDatabaseServer.isEmpty();
}
Exemplo n.º 4
0
bool WIZGROUPDATA::LoadFromXmlRpc(CWizXmlRpcStructValue& data)
{
    data.GetString("biz_guid", bizGUID);
    data.GetString("biz_name", bizName);

    data.GetTime("dt_created", tCreated);
    data.GetTime("dt_modified", tModified);
    data.GetTime("dt_role_created", tRoleCreated);

    data.GetString("kapi_url", strDatabaseServer);

    data.GetString("kb_guid", strGroupGUID);
    data.GetString("kb_id", strId);
    data.GetString("kb_name", strGroupName);
    data.GetString("kb_note", strGroupNote);
    data.GetString("kb_seo", strGroupSEO);
    data.GetString("kb_type", strType);
    data.GetString("owner_name", strOwner);
    data.GetString("role_note", strRoleNote);
    data.GetString("server_url", strServerUrl);
    data.GetString("tag_names", strGroupTags);
    data.GetInt("user_group", nUserGroup);
    data.GetString("user_name", strUserName);

    return !strGroupName.isEmpty()
            && !strGroupGUID.isEmpty()
            && !strDatabaseServer.isEmpty();
}
Exemplo n.º 5
0
BOOL WIZDOCUMENTATTACHMENTDATA::LoadFromXmlRpc(CWizXmlRpcStructValue& data)
{
    data.GetStr("attachment_guid", strGUID);
    data.GetStr("attachment_document_guid", strDocumentGUID);
    data.GetStr("attachment_name", strName);
    data.GetStr("attachment_url", strURL);
    data.GetStr("attachment_description", strDescription);
    data.GetTime("dt_info_modified", tInfoModified);
    data.GetStr("info_md5", strInfoMD5);
    data.GetTime("dt_data_modified", tDataModified);
    data.GetStr("data_md5", strDataMD5);
    data.GetInt64("version", nVersion);

    return !strGUID.isEmpty() && !strDocumentGUID.isEmpty();
}
Exemplo n.º 6
0
BOOL WIZDOCUMENTATTACHMENTDATA::LoadFromXmlRpc(CWizXmlRpcStructValue& data, const QString& kbGUID)
{
    strKbGUID = kbGUID;
    data.GetStr(_T("attachment_guid"), strGUID);
    data.GetStr(_T("attachment_document_guid"), strDocumentGUID);
    data.GetStr(_T("attachment_name"), strName);
    data.GetStr(_T("attachment_url"), strURL);
    data.GetStr(_T("attachment_description"), strDescription);
    data.GetTime(_T("dt_info_modified"), tInfoModified);
    data.GetStr(_T("info_md5"), strInfoMD5);
    data.GetTime(_T("dt_data_modified"), tDataModified);
    data.GetStr(_T("data_md5"), strDataMD5);
    data.GetInt64(_T("version"), nVersion);

    return !strGUID.IsEmpty() && !strDocumentGUID.IsEmpty();
}
Exemplo n.º 7
0
bool WIZMESSAGEDATA::LoadFromXmlRpc(CWizXmlRpcStructValue& data)
{
    data.GetString("biz_guid", bizGUID);
    data.GetString("kb_guid", kbGUID);
    data.GetString("document_guid", documentGUID);

    data.GetInt64("id", nId);
    data.GetTime("dt_created", tCreated);
    data.GetInt("message_type", nMessageType);
    data.GetInt("read_status", nReadStatus);
    data.GetInt("email_status", nEmailStatus);
    data.GetInt("sms_status", nSMSStatus);

    data.GetString("title", title);
    data.GetString("message_body", messageBody);
    data.GetString("note", note);

    data.GetString("receiver_alias", receiverAlias);
    data.GetString("receiver_guid", receiverGUID);
    data.GetString("receiver_id", receiverId);

    data.GetString("sender_alias", senderAlias);
    data.GetString("sender_guid", senderGUID);
    data.GetString("sender_id", senderId);

    data.GetInt64("version", nVersion);

    return true;
}
Exemplo n.º 8
0
BOOL WIZDOCUMENTDATABASE::LoadFromXmlRpc(CWizXmlRpcStructValue& data, const QString& kbGUID)
{
    strKbGUID = kbGUID;
    data.GetStr(_T("document_guid"), strGUID);
    data.GetStr(_T("document_title"), strTitle);
    data.GetStr(_T("document_category"), strLocation);

    data.GetTime(_T("dt_info_modified"), tInfoModified);
    data.GetStr(_T("info_md5"), strInfoMD5);
    data.GetTime(_T("dt_data_modified"), tDataModified);
    data.GetStr(_T("data_md5"), strDataMD5);
    data.GetTime(_T("dt_param_modified"), tParamModified);
    data.GetStr(_T("param_md5"), strParamMD5);
    data.GetInt64(_T("version"), nVersion);

    return !strGUID.IsEmpty();
}
Exemplo n.º 9
0
BOOL WIZTAGDATA::LoadFromXmlRpc(CWizXmlRpcStructValue& data)
{
    return data.GetStr(_T("tag_guid"), strGUID)
        && data.GetStr(_T("tag_group_guid"), strParentGUID)
        && data.GetStr(_T("tag_name"), strName)
        && data.GetStr(_T("tag_description"), strDescription)
        && data.GetTime(_T("dt_info_modified"), tModified)
        && data.GetInt64(_T("version"), nVersion);
}
Exemplo n.º 10
0
bool WIZDOCUMENTDATABASE::LoadFromXmlRpc(CWizXmlRpcStructValue& data)
{
    data.GetString("data_md5", strDataMD5);
    data.GetString("document_category", strLocation);
    data.GetString("document_guid", strGUID);
    data.GetString("document_title", strTitle);

    data.GetTime("dt_info_modified", tInfoModified);
    data.GetTime("dt_data_modified", tDataModified);
    data.GetTime("dt_param_modified", tParamModified);

    data.GetString("info_md5", strInfoMD5);
    data.GetString("param_md5", strParamMD5);

    data.GetInt64("version", nVersion);

    return !strGUID.isEmpty();
}
Exemplo n.º 11
0
BOOL WIZSTYLEDATA::LoadFromXmlRpc(CWizXmlRpcStructValue& data)
{
    data.GetStr(_T("style_description"), strDescription);

    return data.GetStr(_T("style_guid"), strGUID)
        && data.GetStr(_T("style_name"), strName)
        && data.GetColor(_T("style_textcolor"), crTextColor)
        && data.GetColor(_T("style_backcolor"), crBackColor)
        && data.GetBool(_T("style_text_bold"), bTextBold)
        && data.GetInt(_T("style_flagindex"), nFlagIndex)
        && data.GetTime(_T("dt_info_modified"), tModified)
        && data.GetInt64(_T("version"), nVersion);
}
Exemplo n.º 12
0
BOOL WIZDELETEDGUIDDATA::LoadFromXmlRpc(CWizXmlRpcStructValue& data, const QString& kbGUID)
{
    strKbGUID = kbGUID;

    CString strType;

    BOOL bRet = data.GetStr(_T("deleted_guid"), strGUID)
        && data.GetStr(_T("guid_type"), strType)
        && data.GetTime(_T("dt_deleted"), tDeleted)
        && data.GetInt64(_T("version"), nVersion);

    eType = WIZOBJECTDATA::TypeStringToObjectType(strType);

    return bRet;
}
Exemplo n.º 13
0
bool WIZDELETEDGUIDDATA::LoadFromXmlRpc(CWizXmlRpcStructValue& data)
{
    CString strType;

    // this field maybe "nil"
    data.GetTime(_T("dt_deleted"), tDeleted);

    bool bRet = data.GetStr(_T("deleted_guid"), strGUID)
        && data.GetStr(_T("guid_type"), strType)
        && data.GetInt64(_T("version"), nVersion);

    eType = WIZOBJECTDATA::TypeStringToObjectType(strType);

    return bRet;
}
Exemplo n.º 14
0
BOOL WIZUSERMESSAGEDATA::LoadFromXmlRpc(CWizXmlRpcStructValue &data)
{
    data.GetInt64(_T("id"), nMessageID);
    data.GetStr(_T("biz_guid"), strBizGUID);
    data.GetStr(_T("kb_guid"), strKbGUID);
    data.GetStr(_T("document_guid"), strDocumentGUID);
    data.GetStr(_T("sender_guid"), strSenderGUID);
    data.GetStr(_T("sender_id"), strSenderID);
    data.GetStr(_T("receiver_guid"), strReceiverGUID);
    data.GetStr(_T("receiver_id"), strReceiverID);
    data.GetInt(_T("message_type"), nMessageType);
    data.GetInt(_T("read_status"), nReadStatus);
    data.GetTime(_T("dt_created"), tCreated);
    data.GetStr(_T("message_body"), strMessageText);
    data.GetInt64(_T("version"), nVersion);
    data.GetStr(_T("sender_alias"), strSender);
    data.GetStr(_T("receiver_alias"), strReceiver);
    data.GetStr(_T("sender_alias"), strSender);
    data.GetStr(_T("title"), strTitle);
    return 	TRUE;
}
Exemplo n.º 15
0
BOOL WIZDOCUMENTDATAEX::LoadFromXmlRpc(CWizXmlRpcStructValue& data)
{
    bool bInfo = false;
    bool bData = false;
    bool bParam = false;
    data.GetBool("document_info", bInfo);
    data.GetBool("document_data", bData);
    data.GetBool("document_param", bParam);
    data.GetInt64("version", nVersion);

    // document_data field default is 0, aquire data use other api now.
    Q_ASSERT(!bData);

    nObjectPart = 0;
    nObjectPart |= bInfo ? WIZKM_XMKRPC_DOCUMENT_PART_INFO : 0;
    nObjectPart |= bData ? WIZKM_XMKRPC_DOCUMENT_PART_DATA : 0;
    nObjectPart |= bParam ? WIZKM_XMKRPC_DOCUMENT_PART_PARAM : 0;

    data.GetString("document_guid", strGUID);

    if (bInfo) {
        data.GetString("document_title", strTitle);
        data.GetString("document_category", strLocation);
        data.GetString("document_filename", strName);
        data.GetString("document_seo", strSEO);
        data.GetString("document_url", strURL);
        data.GetString("document_author", strAuthor);
        data.GetString("document_keywords", strKeywords);
        data.GetString("document_type", strType);
        data.GetString("document_owner", strOwner);
        data.GetString("document_filetype", strFileType);
        data.GetString("document_styleguid", strStyleGUID);
        data.GetInt("document_iconindex", nIconIndex);
        data.GetInt("document_protected", nProtected);
        data.GetInt("document_attachment_count", nAttachmentCount);

        // md5
        data.GetString("data_md5", strDataMD5);
        data.GetString("info_md5", strInfoMD5);
        data.GetString("param_md5", strParamMD5);

        // time
        data.GetTime("dt_created", tCreated);
        data.GetTime("dt_modified", tModified);
        data.GetTime("dt_accessed", tAccessed);
        data.GetTime("dt_data_modified", tDataModified);
        data.GetTime("dt_info_modified", tInfoModified);
        data.GetTime("dt_param_modified", tParamModified);

        data.GetStringArray("document_tags", arrayTagGUID);
    }

    if (bData) {
        Q_ASSERT(0);
    }

    if (bParam) {
        CWizDocumentParamDataArray params;
        if (!data.GetArray("document_params", params)) {
            TOLOG("Failed to load document param when parse xml-rpc!");
            return false;
        }

        arrayParam.assign(params.begin(), params.end());
    }

    return !strGUID.isEmpty();
}
Exemplo n.º 16
0
 BOOL LoadFromXmlRpc(CWizXmlRpcStructValue& data)
 {
     BOOL bInfo = FALSE;
     BOOL bData = FALSE;
     BOOL bParam = FALSE;
     data.GetBool(_T("document_info"), bInfo);
     data.GetBool(_T("document_data"), bData);
     data.GetBool(_T("document_param"), bParam);
     data.GetInt64(_T("version"), nVersion);
     //
     nParts = 0;
     nParts |= bInfo ? WIZKM_XMKRPC_DOCUMENT_PART_INFO : 0;
     nParts |= bData ? WIZKM_XMKRPC_DOCUMENT_PART_DATA : 0;
     nParts |= bParam ? WIZKM_XMKRPC_DOCUMENT_PART_PARAM : 0;
     //
     data.GetStr(_T("document_guid"), strGUID);
     //
     if (bInfo)
     {
         data.GetStr(_T("document_title"), strTitle);
         data.GetStr(_T("document_category"), strLocation);
         data.GetStr(_T("document_filename"), strName);
         data.GetStr(_T("document_seo"), strSEO);
         data.GetStr(_T("document_url"), strURL);
         data.GetStr(_T("document_author"), strAuthor);
         data.GetStr(_T("document_keywords"), strKeywords);
         data.GetStr(_T("document_type"), strType);
         data.GetStr(_T("document_owner"), strOwner);
         data.GetStr(_T("document_filetype"), strFileType);
         data.GetStr(_T("document_styleguid"), strStyleGUID);
         data.GetTime(_T("dt_created"), tCreated);
         data.GetTime(_T("dt_modified"), tModified);
         data.GetTime(_T("dt_accessed"), tAccessed);
         data.GetInt(_T("document_iconindex"), nIconIndex);
         data.GetInt(_T("document_protected"), nProtected);
         //data.GetInt(_T("document_readcount"), nReadCount);
         data.GetInt(_T("document_attachment_count"), nAttachmentCount);
         data.GetTime(_T("dt_info_modified"), tInfoModified);
         data.GetStr(_T("info_md5"), strInfoMD5);
         data.GetTime(_T("dt_data_modified"), tDataModified);
         data.GetStr(_T("data_md5"), strDataMD5);
         data.GetTime(_T("dt_param_modified"), tParamModified);
         data.GetStr(_T("param_md5"), strParamMD5);
         //
         data.GetStringArray(_T("document_tags"), arrayTagGUID);
     }
     //
     if (bData)
     {
         data.GetInt(_T("document_zip_size"), nDataSize);
         if (nApiVersion < 2)
         {
             if (!data.GetStream(_T("document_zip_data"), arrayData))
             {
                 TOLOG(_T("Failed to get note data!"));
                 return FALSE;
             }
         }
     }
     //
     if (bParam)
     {
         std::deque<WIZDOCUMENTPARAMDATA> params;
         if (!data.GetArray(_T("document_params"), params))
         {
             TOLOG(_T("Failed to get note param!"));
             return FALSE;
         }
         arrayParam.assign(params.begin(), params.end());
     }
     //
     return !strGUID.isEmpty();
 }
Exemplo n.º 17
0
BOOL WIZDOCUMENTDATAEX::LoadFromXmlRpc(CWizXmlRpcStructValue& data, const QString& kbGUID)
{
    strKbGUID = kbGUID;

    BOOL bInfo = FALSE;
    BOOL bData = FALSE;
    BOOL bParam = FALSE;
    data.GetBool(_T("document_info"), bInfo);
    data.GetBool(_T("document_data"), bData);
    data.GetBool(_T("document_param"), bParam);
    ATLASSERT(data.GetInt64(_T("version"), nVersion));
    ATLASSERT(!bData);
    //
    nObjectPart = 0;
    nObjectPart |= bInfo ? WIZKM_XMKRPC_DOCUMENT_PART_INFO : 0;
    nObjectPart |= bData ? WIZKM_XMKRPC_DOCUMENT_PART_DATA : 0;
    nObjectPart |= bParam ? WIZKM_XMKRPC_DOCUMENT_PART_PARAM : 0;
    //
    data.GetStr(_T("document_guid"), strGUID);
    //
    if (bInfo)
    {
        data.GetStr(_T("document_title"), strTitle);
        data.GetStr(_T("document_category"), strLocation);
        data.GetStr(_T("document_filename"), strName);
        data.GetStr(_T("document_seo"), strSEO);
        data.GetStr(_T("document_url"), strURL);
        data.GetStr(_T("document_author"), strAuthor);
        data.GetStr(_T("document_keywords"), strKeywords);
        data.GetStr(_T("document_type"), strType);
        data.GetStr(_T("document_owner"), strOwner);
        data.GetStr(_T("document_filetype"), strFileType);
        data.GetStr(_T("document_styleguid"), strStyleGUID);
        data.GetTime(_T("dt_created"), tCreated);
        data.GetTime(_T("dt_modified"), tModified);
        data.GetTime(_T("dt_accessed"), tAccessed);
        data.GetInt(_T("document_iconindex"), nIconIndex);
        data.GetInt(_T("document_protected"), nProtected);
        //data.GetInt(_T("document_readcount"), nReadCount);
        data.GetInt(_T("document_attachment_count"), nAttachmentCount);
        data.GetTime(_T("dt_info_modified"), tInfoModified);
        data.GetStr(_T("info_md5"), strInfoMD5);
        data.GetTime(_T("dt_data_modified"), tDataModified);
        data.GetStr(_T("data_md5"), strDataMD5);
        data.GetTime(_T("dt_param_modified"), tParamModified);
        data.GetStr(_T("param_md5"), strParamMD5);

        data.GetStringArray(_T("document_tags"), arrayTagGUID);

        data.GetStr(_T("system_tags"), strSystemTags);
    }

    if (bData)
    {
        ATLASSERT(FALSE);
    }

    if (bParam)
    {
        std::deque<WIZDOCUMENTPARAMDATA> params;
        if (!data.GetArray("document_params", params, kbGUID))
        {
            TOLOG(_T("Failed to get document param!"));
            return FALSE;
        }
        arrayParam.assign(params.begin(), params.end());
    }

    return !strGUID.IsEmpty();
}