Esempio n. 1
0
bool CWizIndexBase::SQLToDocumentAttachmentDataArray(const CString& strSQL,
                                                     CWizDocumentAttachmentDataArray& arrayAttachment)
{
    try
    {
        CppSQLite3Query query = m_db.execQuery(strSQL);
        while (!query.eof())
        {
            WIZDOCUMENTATTACHMENTDATA data;
            data.strKbGUID = kbGUID();
            data.strGUID = query.getStringField(documentattachmentATTACHMENT_GUID);
            data.strDocumentGUID = query.getStringField(documentattachmentDOCUMENT_GUID);
            data.strName = query.getStringField(documentattachmentATTACHMENT_NAME);
            data.strURL = query.getStringField(documentattachmentATTACHMENT_URL);
            data.strDescription = query.getStringField(documentattachmentATTACHMENT_DESCRIPTION);
            data.tInfoModified = query.getTimeField(documentattachmentDT_INFO_MODIFIED);
            data.strInfoMD5 = query.getStringField(documentattachmentATTACHMENT_INFO_MD5);
            data.tDataModified = query.getTimeField(documentattachmentDT_DATA_MODIFIED);
            data.strDataMD5 = query.getStringField(documentattachmentATTACHMENT_DATA_MD5);
            data.nVersion = query.getInt64Field(documentattachmentVersion);

            arrayAttachment.push_back(data);
            query.nextRow();
        }

        std::sort(arrayAttachment.begin(), arrayAttachment.end());
        return true;
    }
    catch (const CppSQLite3Exception& e)
    {
        return LogSQLException(e, strSQL);
    }
}
Esempio n. 2
0
bool CWizIndexBase::SQLToDocumentDataArray(const CString& strSQL, CWizDocumentDataArray& arrayDocument)
{
    try
    {
        CppSQLite3Query query = m_db.execQuery(strSQL);
        CWizStdStringArray arrayGUID;
        std::map<CString, int> mapDocumentIndex;
        while (!query.eof())
        {
            WIZDOCUMENTDATA data;
            data.strKbGUID = kbGUID();
            data.strGUID = query.getStringField(documentDOCUMENT_GUID);
            data.strTitle = query.getStringField(documentDOCUMENT_TITLE);
            data.strLocation = query.getStringField(documentDOCUMENT_LOCATION);
            data.strName = query.getStringField(documentDOCUMENT_NAME);
            data.strSEO = query.getStringField(documentDOCUMENT_SEO);
            data.strURL = query.getStringField(documentDOCUMENT_URL);
            data.strAuthor = query.getStringField(documentDOCUMENT_AUTHOR);
            data.strKeywords = query.getStringField(documentDOCUMENT_KEYWORDS);
            data.strType = query.getStringField(documentDOCUMENT_TYPE);
            data.strOwner = query.getStringField(documentDOCUMENT_OWNER);
            data.strFileType = query.getStringField(documentDOCUMENT_FILE_TYPE);
            data.strStyleGUID = query.getStringField(documentSTYLE_GUID);
            data.tCreated = query.getTimeField(documentDT_CREATED);
            data.tModified = query.getTimeField(documentDT_MODIFIED);
            data.tAccessed = query.getTimeField(documentDT_ACCESSED);
            data.nIconIndex = query.getIntField(documentDOCUMENT_ICON_INDEX);
            data.nSync = query.getIntField(documentDOCUMENT_SYNC);
            data.nProtected = query.getIntField(documentDOCUMENT_PROTECT);
            data.nReadCount = query.getIntField(documentDOCUMENT_READ_COUNT);
            data.nAttachmentCount = query.getIntField(documentDOCUMENT_ATTACHEMENT_COUNT);
            data.nIndexed = query.getIntField(documentDOCUMENT_INDEXED);
            data.tInfoModified = query.getTimeField(documentDT_INFO_MODIFIED);
            data.strInfoMD5 = query.getStringField(documentDOCUMENT_INFO_MD5);
            data.tDataModified = query.getTimeField(documentDT_DATA_MODIFIED);
            data.strDataMD5 = query.getStringField(documentDOCUMENT_DATA_MD5);
            data.tParamModified = query.getTimeField(documentDT_PARAM_MODIFIED);
            data.strParamMD5 = query.getStringField(documentDOCUMENT_PARAM_MD5);
            data.nVersion = query.getInt64Field(documentVersion);

            arrayGUID.push_back(data.strGUID);
            arrayDocument.push_back(data);
            mapDocumentIndex[data.strGUID] = int(arrayDocument.size() - 1);
            query.nextRow();
        }

        if (!arrayGUID.empty()) {
            InitDocumentExFields(arrayDocument, arrayGUID, mapDocumentIndex);
        }

        return true;
    }
    catch (const CppSQLite3Exception& e)
    {
        return LogSQLException(e, strSQL);
    }
}
Esempio n. 3
0
bool CWizIndexBase::SQLToStyleDataArray(const CString& strSQL, CWizStyleDataArray& arrayStyle)
{
    try
    {
        CppSQLite3Query query = m_db.execQuery(strSQL);
        while (!query.eof())
        {
            WIZSTYLEDATA data;
            data.strKbGUID = kbGUID();
            data.strGUID = query.getStringField(styleSTYLE_GUID);
            data.strName = query.getStringField(styleSTYLE_NAME);
            data.strDescription = query.getStringField(styleSTYLE_DESCRIPTION);
            data.crTextColor = query.getColorField(styleSTYLE_TEXT_COLOR);
            data.crBackColor = query.getColorField(styleSTYLE_BACK_COLOR);
            data.bTextBold = query.getBoolField(styleSTYLE_TEXT_BOLD);
            data.nFlagIndex = query.getIntField(styleSTYLE_FLAG_INDEX);
            data.tModified = query.getTimeField(styleDT_MODIFIED);
            data.nVersion = query.getInt64Field(styleVersion);

            arrayStyle.push_back(data);
            query.nextRow();
        }

        std::sort(arrayStyle.begin(), arrayStyle.end());
        return true;
    }
    catch (const CppSQLite3Exception& e)
    {
        return LogSQLException(e, strSQL);
    }
}
Esempio n. 4
0
bool CWizIndexBase::SQLToTagDataArray(const CString& strSQL, CWizTagDataArray& arrayTag)
{
    try
    {
        CppSQLite3Query query = m_db.execQuery(strSQL);
        while (!query.eof())
        {
            WIZTAGDATA data;
            data.strKbGUID = kbGUID();
            data.strGUID = query.getStringField(tagTAG_GUID);
            data.strParentGUID = query.getStringField(tagTAG_GROUP_GUID);
            data.strName = query.getStringField(tagTAG_NAME);
            data.strDescription = query.getStringField(tagTAG_DESCRIPTION);
            data.tModified = query.getTimeField(tagDT_MODIFIED);
            data.nVersion = query.getInt64Field(tagVersion);

            arrayTag.push_back(data);
            query.nextRow();
        }

        std::sort(arrayTag.begin(), arrayTag.end());
        return true;
    }
    catch (const CppSQLite3Exception& e)
    {
        return LogSQLException(e, strSQL);
    }
}
Esempio n. 5
0
bool CWizIndexBase::SQLToDeletedGUIDDataArray(const CString& strSQL, CWizDeletedGUIDDataArray& arrayGUID)
{
    try
    {
        CppSQLite3Query query = m_db.execQuery(strSQL);
        while (!query.eof())
        {
            WIZDELETEDGUIDDATA data;
            data.strKbGUID = kbGUID();
            data.strGUID = query.getStringField(deletedguidDELETED_GUID);
            data.eType = WIZOBJECTDATA::IntToObjectType(query.getIntField(deletedguidGUID_TYPE));
            data.tDeleted = query.getTimeField(deletedguidDT_DELETED);

            arrayGUID.push_back(data);
            query.nextRow();
        }
        return true;
    }
    catch (const CppSQLite3Exception& e)
    {
        return LogSQLException(e, strSQL);
    }
}
Esempio n. 6
0
bool CWizIndexBase::SQLToMessageDataArray(const QString& strSQL,
                                          CWizMessageDataArray& arrayMessage)
{
    try
    {
        CppSQLite3Query query = m_db.execQuery(strSQL);
        while (!query.eof())
        {
            WIZMESSAGEDATA data;
            data.nId = query.getInt64Field(msgMESSAGE_ID);
            data.bizGUID = query.getStringField(msgBIZ_GUID);
            data.kbGUID = query.getStringField(msgKB_GUID);
            data.documentGUID = query.getStringField(msgDOCUMENT_GUID);
            data.senderAlias = query.getStringField(msgSENDER);
            data.senderId = query.getStringField(msgSENDER_ID);
            data.senderGUID = query.getStringField(msgSENDER_GUID);
            data.receiverAlias = query.getStringField(msgRECEIVER);
            data.receiverId = query.getStringField(msgRECEIVER_ID);
            data.receiverGUID = query.getStringField(msgRECEIVER_GUID);
            data.nMessageType = query.getIntField(msgMESSAGE_TYPE);
            data.nReadStatus = query.getIntField(msgREAD_STATUS);
            data.tCreated = query.getTimeField(msgDT_CREATED);
            data.title = query.getStringField(msgMESSAGE_TITLE);
            data.messageBody = query.getStringField(msgMESSAGE_TEXT);
            data.nVersion = query.getInt64Field(msgWIZ_VERSION);

            arrayMessage.push_back(data);
            query.nextRow();
        }

        return true;
    }
    catch (const CppSQLite3Exception& e)
    {
        return LogSQLException(e, strSQL);
    }
}
Esempio n. 7
0
bool CWizIndexBase::SQLToMetaDataArray(const CString& strSQL, CWizMetaDataArray& arrayMeta)
{
    try
    {
        CppSQLite3Query query = m_db.execQuery(strSQL);
        while (!query.eof())
        {
            WIZMETADATA data;
            data.strKbGUID = kbGUID();
            data.strName = query.getStringField(metaMETA_NAME);
            data.strKey = query.getStringField(metaMETA_KEY);
            data.strValue = query.getStringField(metaMETA_VALUE);
            data.tModified = query.getTimeField(metaDT_MODIFIED);

            arrayMeta.push_back(data);
            query.nextRow();
        }
        return true;
    }
    catch (const CppSQLite3Exception& e)
    {
        return LogSQLException(e, strSQL);
    }
}