<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум компьютерной помощи &mdash; Вебсервис в Лотусе - отдает вложения документа.]]></title>
	<link rel="self" href="https://itpmr.ru/extern.php?action=feed&amp;tid=1071&amp;type=atom" />
	<updated>2019-04-15T05:29:53Z</updated>
	<generator>PunBB</generator>
	<id>https://itpmr.ru/viewtopic.php?id=1071</id>
		<entry>
			<title type="html"><![CDATA[Re: Вебсервис в Лотусе - отдает вложения документа.]]></title>
			<link rel="alternate" href="https://itpmr.ru/viewtopic.php?pid=124749#p124749" />
			<content type="html"><![CDATA[<p>Класс полей документа и вложений.<br /></p><div class="codebox"><pre><code>Class PoliaYurL
    &#039;Public NumDocF As Integer &#039; сколько нашлось доков
    Public RegNum As String &#039; регномер
    Public Tip  As String &#039; тип - решщение / постановление
    Public Datareg As String   &#039; дата рег
    Public Header As String  &#039; заголовок
    Public Ispolnitel As String   &#039; вносит на расмотрение
    Public UNID As String
    Public Embed As ClassAtach
End Class

Class ClassAtach
    Public descriptionAtach() As String    
    Public File64Atach() As String    
End Class</code></pre></div>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>https://itpmr.ru/profile.php?id=2</uri>
			</author>
			<updated>2019-04-15T05:29:53Z</updated>
			<id>https://itpmr.ru/viewtopic.php?pid=124749#p124749</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Вебсервис в Лотусе - отдает вложения документа.]]></title>
			<link rel="alternate" href="https://itpmr.ru/viewtopic.php?pid=124748#p124748" />
			<content type="html"><![CDATA[<p>Функция отдает только одно вложение документа, по названию вложения.<br /></p><div class="codebox"><pre><code>    Public Function getAttachNew (AtName As String, UNID As String, Fault1 As WS_FAULT) As ClassAtach
        Print &quot;СТАРТ - функция getAttach&quot;
        On Error Goto processError
        Dim session  As NotesSession 
        Set session = New NotesSession 
        Dim inStream As NotesStream
        Dim file As String
        Dim Atachob As New ClassAtach &#039; Вложения
        Dim db2 As NotesDatabase
        Set db2 = session.GetDatabase(&quot;192&quot;,&quot;r.nsf&quot;)
        If Not db2.Isopen Then&#039;проверка доступа к базе 
            Print &quot;Нет доступа к БД Решения/распоряжения&quot;
        Else
            Print db2.Title
        End If
        Dim formula As String
        formula =  {id = &quot;} &amp;  UNID    &amp; {&quot;}    &#039; regnom - текст ,  regnoms - цифра
        Print formula
        Set dc=db2.Search(formula, Nothing, 0)
        Print &quot;dc.count &quot; dc.count 
        Print &quot;Print&quot; AtName
        For i=1 To dc.count
            Set doc = dc.GetNthDocument(i)    
            If doc.HasEmbedded Then        &#039;есть вложения 
                datapatch$ = {C:\Tmp-attach\} 
                attachments = Evaluate(&quot;@AttachmentNames&quot;, doc) 
                Forall a In attachments
                    If AtName =  a Then
                        Set o=doc.GetAttachment(a)
                        Set inStream=session.Createstream
                        Call o.ExtractFile ( datapatch$ &amp; o.Name)
                        file = datapatch$ &amp; o.Name 
                        Print  file
                        Call inStream.Open(file)
                        plainText$ =    inStream.ReadText()
                        Dim b64 As New CBase64()
                        plainText$ =  b64.encode (inStream) 
                        Call inStream.Close
                        Kill     datapatch$ &amp; o.Name
                        Redim Preserve Atachob.descriptionAtach(0)
                        Redim Preserve Atachob.File64Atach(0)
                        Atachob.descriptionAtach(0) = o.Name 
                        Atachob.File64Atach(0) = plainText$ 
                    Else
                        Print &quot;ненужное вложение &quot;  a
                    End If
                    
                End Forall
            Else
                Print &quot;нет вложений&quot;    
            End If
        Next    
        Set getAttachNew = Atachob
        Print &quot;КОНЕЦ - функция getAttachNew&quot;  
        Exit Function
processError:
        Print Err, Error &amp; { _В строке__ } &amp; Erl
        Call Fault1.setFault(True)   &#039; необходимо для ошибочной активации 
        Call Fault1.setFaultString(Error$  &amp; Erl())  
        Exit Function
    End Function</code></pre></div>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>https://itpmr.ru/profile.php?id=2</uri>
			</author>
			<updated>2019-04-15T05:29:09Z</updated>
			<id>https://itpmr.ru/viewtopic.php?pid=124748#p124748</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Вебсервис в Лотусе - отдает вложения документа.]]></title>
			<link rel="alternate" href="https://itpmr.ru/viewtopic.php?pid=124747#p124747" />
			<content type="html"><![CDATA[<p>Функция отдает вложение в base64 и название файла вложения<br /></p><div class="codebox"><pre><code>    Public Function getAttach (UNID As String, Fault1 As WS_FAULT) As ClassAtach
        Print &quot;СТАРТ - функция getAttach&quot; 
        Dim session  As NotesSession 
        Set session = New NotesSession 
        Dim inStream As NotesStream
        Dim file As String
        Dim Atachob As New ClassAtach &#039; Вложения
        Dim db2 As NotesDatabase
        Set db2 = session.GetDatabase(&quot;192&quot;,&quot;r.nsf&quot;)
        If Not db2.Isopen Then&#039;проверка доступа к базе 
            Print &quot;Нет доступа к БД&quot;
        Else
            Print db2.Title
        End If
        Dim formula As String
        formula =  {id = &quot;} &amp;  UNID    &amp; {&quot;}    &#039; regnom - текст ,  regnoms - цифра
        Print formula
        Set dc=db2.Search(formula, Nothing, 0)
        Print &quot;dc.count &quot; dc.count 
        For i=1 To dc.count
            Set doc = dc.GetNthDocument(i)    
            
            If doc.HasEmbedded Then        &#039;есть вложения 
                datapatch$ = {C:\Tmp-attach\} 
                attachments = Evaluate(&quot;@AttachmentNames&quot;, doc) 
                i=0
                Forall a In attachments
                    Set o=doc.GetAttachment(a)
                    Set inStream=session.Createstream
                    Call o.ExtractFile ( datapatch$ &amp; o.Name)
                    file = datapatch$ &amp; o.Name 
                    Print  file
                    Call inStream.Open(file)
                    plainText$ =    inStream.ReadText()
                    Dim b64 As New CBase64()
                    plainText$ =  b64.encode (inStream) 
                    Call inStream.Close
                    Kill     datapatch$ &amp; o.Name
                    Redim Preserve Atachob.descriptionAtach(i)
                    Redim Preserve Atachob.File64Atach(i)
                    Atachob.descriptionAtach(i) = o.Name 
                    Atachob.File64Atach(i) = plainText$ 
                    i=i+1
                End Forall
            Else
                Print &quot;нет вложений&quot;    
            End If
        Next    
        Set getAttach = Atachob
        Print &quot;КОНЕЦ - функция getAttach&quot;  
    End Function</code></pre></div>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>https://itpmr.ru/profile.php?id=2</uri>
			</author>
			<updated>2019-04-15T05:28:08Z</updated>
			<id>https://itpmr.ru/viewtopic.php?pid=124747#p124747</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Вебсервис в Лотусе - отдает вложения документа.]]></title>
			<link rel="alternate" href="https://itpmr.ru/viewtopic.php?pid=124746#p124746" />
			<content type="html"><![CDATA[<p>Класс отдает заголовки вложений.<br /></p><div class="codebox"><pre><code>Class ClassArray  &#039; описание вложения для getRD
    Public Function    FuncAtachttInfo  (doc As NotesDocument, Fault1 As WS_FAULT) As ClassAtach
        &#039;Print &quot;FunctionArray&quot;  &amp; doc.header(0)    
        On Error Goto processError3            
        Dim file As String
        Dim session As New NotesSession
        Dim inStream As NotesStream
        Dim Atachob As New ClassAtach 
        
        If doc.HasEmbedded Then    
            datapatch$ = {C:\Tmp-attach\} 
            attachments = Evaluate(&quot;@AttachmentNames&quot;, doc) 
            i=0
            Forall a In attachments
                Set o=doc.GetAttachment(a)
                Redim Preserve Atachob.descriptionAtach(i)
                Redim Preserve Atachob.File64Atach(i)
                Atachob.descriptionAtach(i) = o.Name 
                Atachob.File64Atach(i) = &quot;&quot; &#039; plainText$   неисп
                i=i+1
            End Forall
        Else
            Print &quot;нет вложений&quot;    
        End If
        Set FuncAtachttInfo = Atachob
        Exit Function
processError3:
        Print Err, Error &amp; { _В строке__ } &amp; Erl
        Call Fault1.setFault(True)   &#039; необходимо для ошибочной активации 
        Call Fault1.setFaultString(Error$  &amp; Erl())  
        Exit Function
    End Function
End Class    </code></pre></div>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>https://itpmr.ru/profile.php?id=2</uri>
			</author>
			<updated>2019-04-15T05:24:21Z</updated>
			<id>https://itpmr.ru/viewtopic.php?pid=124746#p124746</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Вебсервис в Лотусе - отдает вложения документа.]]></title>
			<link rel="alternate" href="https://itpmr.ru/viewtopic.php?pid=124745#p124745" />
			<content type="html"><![CDATA[<p>Класс RDNameArray&nbsp; &nbsp;- описывает то что отдает функция getRD, значения полей документа.&nbsp; &nbsp; </p><div class="codebox"><pre><code>Class RDNameArray  &#039; Поля Документа
    Public MainMassiv() As PoliaYurL  &#039;  главный тег POLIAYURL   (экземпляр MainMassiv  класса  PoliaYurL)
    Public Function    MyArr  (dc As NotesDocumentCollection, Fault1 As WS_FAULT) As String
        Print &quot;MyArr&quot;
        Dim doc As NotesDocument 
        If (dc.count = 0) Then
            Redim MainMassiv(0)
        Else
            j%=0
            For i=1 To dc.count
                Set doc = dc.GetNthDocument(i)    
            &#039;    Print j% &quot;. &quot; doc.header(0)  
                Print   doc.datereg(0) &quot;    -  datereg&quot;
                Dim obyekt As New PoliaYurL
                obyekt.RegNum = doc.regnoms(0)
            &#039;    Print doc.regnoms(0)   &quot;    -  regnoms&quot;
                obyekt.Tip = doc.docnomen(0)
                obyekt.Datareg = doc.datereg(0)
                obyekt.Header = doc.header(0)
                obyekt.Ispolnitel = doc.resolution(0)
                obyekt.UNID = doc.id(0)
                Set Myfunk = New ClassArray      
                Set    obyekt.Embed =    Myfunk.FuncAtachttInfo(doc,Fault1)    
                Redim Preserve MainMassiv (j%)
                Set MainMassiv(j%) = obyekt  
                j%=j%+1
            Next
        End If
        Print &quot;MyArr-ЕНД&quot;
    End Function
End Class</code></pre></div>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>https://itpmr.ru/profile.php?id=2</uri>
			</author>
			<updated>2019-04-15T05:23:40Z</updated>
			<id>https://itpmr.ru/viewtopic.php?pid=124745#p124745</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Вебсервис в Лотусе - отдает вложения документа.]]></title>
			<link rel="alternate" href="https://itpmr.ru/viewtopic.php?pid=124744#p124744" />
			<content type="html"><![CDATA[<p>Функция находит документы по диапазону дат, заголовку дока. Основная функция вебсервиса, точка входа.</p><div class="codebox"><pre><code> 
Class Yurclass
   &#039; ----------------------   2  ---------------   ПОЛУЧИТЬ ДОК
    Public Function getRD    (Date1 As String, Date2 As String, RegNum As String, header As String, Fault1 As WS_FAULT) As RDNameArray
        Print &quot;СТАРТ вебсервиса Prok-ra. функция getRD&quot;
        Dim formula As String
        Dim doc As NotesDocument
        Dim dc As NotesDocumentCollection
        Dim session  As NotesSession 
        Set session = New NotesSession 
        Dim db2 As NotesDatabase
        Set db2 = session.GetDatabase(&quot;192.....&quot;,&quot;r.nsf&quot;)
        If Not db2.Isopen Then&#039;проверка доступа к базе 
            Print &quot;Нет доступа к БД &quot;
        Else
            Print db2.Title
        End If
        If RegNum&lt;&gt;&quot;&quot; Then
            formula =  {regnoms = &quot;} &amp;  RegNum    &amp; {&quot;}    &#039; regnom - текст ,  regnoms - цифра
            Set dc=db2.Search(formula, Nothing, 0)
        End If
        
        If header&lt;&gt;&quot;&quot; Then
            formula =  {[header] CONTAINS &quot;} &amp;  header &amp; {&quot;}        
            Set dc=db2.FTSearch(formula,0,FT_DATE_DES,FT_STEMS+FT_FUZZY)
        End If
        
        If Date1&lt;&gt;&quot;&quot; Then 
            formula =  {([datereg] &gt;= } &amp;  Date1 &amp;{)}
            Set dc=db2.FTSearch(formula,0)
        End If
        If Date2&lt;&gt;&quot;&quot; Then 
            formula = formula +   { &amp; ([datereg] &lt;= } &amp;  Date2 &amp;{)}
            Set dc=db2.FTSearch(formula,0)
        End If
        
        Print formula           &#039;Set dc=db2.FTSearch(formula,0,FT_SCORES)        
        
        Print &quot;dc.count &quot; dc.count 
        Set getRD = New RDNameArray
        Call getRD.MyArr(dc,Fault1)
        Print &quot;ЕНД функция getRD.  вебсервиса Prok-ra&quot;
    End Function
End Class</code></pre></div>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>https://itpmr.ru/profile.php?id=2</uri>
			</author>
			<updated>2019-04-15T05:21:58Z</updated>
			<id>https://itpmr.ru/viewtopic.php?pid=124744#p124744</id>
		</entry>
</feed>
