Показать сообщение отдельно
Старый 23.07.2007, 13:46   #4  
petr is offline
petr
Участник
Соотечественники
 
557 / 201 (8) ++++++
Регистрация: 30.05.2005
Адрес: Швейцария
X++:
    // AOSRunMode::client - this method is always called on the client, which eliminates the need for a CAS assert.
public static client DocuValue writeDocuValue(DocuRef  docuRef, Filename filename = '', BinData binData = null)
{
    DocuValue   docuValue;
    DocuType    docuType;
;

    ttsbegin;

    docuType  = docuRef.docuType();
    docuValue = docuRef.docuValue(true);

    [docuValue.FileName, docuValue.FileType, docuValue.Path] = Docu::splitFilename(filename);
    if (docuType.FilePlace != DocuFilePlace::NoCopy)
        docuValue.Path = ''; //path is already stored in ArchivePath in docuType or docuParameters

    if (docuType.FilePlace == DocuFilePlace::Database)
    {
        // Insert to database
        if (WinAPI::fileLocked(filename))
        {
            info("@SYS72783",'',SysInfoAction_Formrun::newFormnameControlnameDesc(formstr(DocuOpenFile), identifierstr(Grid), "@SYS4167"));
        }
        else
        {
            if (! binData)
            {
                binData = new BinData();
                if (binData.loadFile(filename)) //only works if file not locked
                {
                    docuValue.File = binData.getData();
                }
                else
                    throw error(strfmt("@SYS54217",filename));
            }
            else
                docuValue.File = binData.getData();
        }
    }

    docuValue.update();

    ttscommit;
    return docuValue;
}
где docuValue.File имеет вид container.

Последний раз редактировалось petr; 23.07.2007 в 13:58. Причина: Более полный ответ