<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум компьютерной помощи &mdash; Использование Java библиотек в Lotusscript]]></title>
	<link rel="self" href="http://itpmr.ru/extern.php?action=feed&amp;tid=848&amp;type=atom" />
	<updated>2014-04-17T08:35:13Z</updated>
	<generator>PunBB</generator>
	<id>http://itpmr.ru/viewtopic.php?id=848</id>
		<entry>
			<title type="html"><![CDATA[Re: Использование Java библиотек в Lotusscript]]></title>
			<link rel="alternate" href="http://itpmr.ru/viewtopic.php?pid=124154#p124154" />
			<content type="html"><![CDATA[<p>Функция для получения сигнатур, без которых нельзя вызвать метод с класса на яве.<br />Function getMethodSignatures(jClass As Javaclass, l As NotesLog)<br />&nbsp; &nbsp; Dim msg$<br />&nbsp; &nbsp; Dim methods As JavaMethodCollection<br />&nbsp; &nbsp; Set methods = jclass.Getclassmethods()<br />&nbsp; &nbsp; Forall meth In methods<br />&nbsp; &nbsp; &nbsp; &nbsp; msg$ = meth.Methodname &amp; &quot; - SIG: &quot; &amp; meth.Signature<br />&nbsp; &nbsp; &nbsp; &nbsp; If Not(l Is Nothing) Then Call l.logaction(msg$)<br />&nbsp; &nbsp; &nbsp; &nbsp; Print msg$<br />&nbsp; &nbsp; End Forall<br />&nbsp; &nbsp; <br />End Function</p>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>http://itpmr.ru/profile.php?id=2</uri>
			</author>
			<updated>2014-04-17T08:35:13Z</updated>
			<id>http://itpmr.ru/viewtopic.php?pid=124154#p124154</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Использование Java библиотек в Lotusscript]]></title>
			<link rel="alternate" href="http://itpmr.ru/viewtopic.php?pid=124153#p124153" />
			<content type="html"><![CDATA[<p>Кнопочка выгражает в XML файл (C:\text\supertest.xml) вложения в формате PDF в Base64 кодировке.</p><p>В опциях подключаем <br />Use &quot;Base64Java&quot;<br />Use &quot;libBase64&quot;</p><p>Sub Click(Source As Button)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; Dim session As New NotesSession<br />&nbsp; &nbsp; Dim uiworkspace As New NotesUIWorkspace&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; Dim histold As String&nbsp; &nbsp; <br />&nbsp; &nbsp; Dim uidoc As NotesUIDocument <br />&nbsp; &nbsp; Dim doc As NotesDocument<br />&nbsp; &nbsp; Set uidoc =uiworkspace.CurrentDocument<br />&nbsp; &nbsp; Set doc =uidoc.Document<br />&nbsp; &nbsp; datapatch$ = {C:\out\}<br />&nbsp; &nbsp; Dim rtitem As NotesRichTextItem<br />&nbsp; &nbsp; Set rtitem = doc.GetFirstItem( &quot;ПРИЛОЖЕНИЯ_&quot; )<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; Set strm = session.CreateStream()&nbsp; &#039; XML-ка<br />&nbsp; &nbsp; Call strm.Open(&quot;C:\text\supertest.xml&quot;, &quot;UTF-8&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; xml = {&lt;html xmlns=&#039;http://_.w3.org/1999/xhtml&#039; encoding=&#039;UTF-8&#039;&gt;}+ Chr(13)<br />&nbsp; &nbsp; xml = xml + {&lt;head&gt;} + Chr(13)<br />&nbsp; &nbsp; xml = xml + {&lt;/head&gt;} + Chr(13)<br />&nbsp; &nbsp; xml = xml + {&lt;body&gt;} + Chr(13)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; Dim inStream As NotesStream<br />&nbsp; &nbsp; Set inStream=session.Createstream() &#039; сохряненный файл на винте&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; Dim currentLog As New NotesLog( &quot;Script log&quot; )<br />&nbsp; &nbsp; Call currentLog.OpenFileLog( &quot;d:\log.txt&quot; )<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; Dim mySession As JavaSession<br />&nbsp; &nbsp; Dim myClass As JavaClass<br />&nbsp; &nbsp; Dim myMethod As JavaMethod<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; Dim jBase64 As JavaObject<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; Set mySession = New JavaSession()<br />&nbsp; &nbsp; Set myClass = mySession.GetClass(&quot;Base64Java&quot;)<br />&nbsp; &nbsp; Set myMethod = myClass.GetMethod(&quot;encodeFile&quot;,&quot;(Ljava/lang/String;)V&quot;)<br />&nbsp; &nbsp; Set jBase64 = myClass.CreateObject()<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; &#039;Call getMethodSignatures (myClass,currentLog)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; Forall obj In rtitem.EmbeddedObjects<br />&nbsp; &nbsp; &nbsp; &nbsp; If ( obj.Type = EMBED_ATTACHMENT ) Then<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Call obj.ExtractFile( datapatch$ &amp; obj.Source )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oname$ = obj.Source <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Argument = datapatch$ &amp; oname$<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xxx = myMethod.Invoke(jBase64,&nbsp; &nbsp; Argument)&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Call inStream.Open(datapatch$ &amp; oname$)&nbsp; &nbsp; &#039; в поток inStream файл&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; plainText$ = inStream.ReadText()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If&nbsp; &nbsp;Strright(oname$, &quot;.&quot;) = &quot;pdf&quot; Then<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xml = xml + {&lt;Application&gt;} + {&lt;a href=&quot;data:application/pdf;base64,} + plainText$ +{&quot;&gt;} + oname$ + {&lt;/a&gt;} + {&lt;/Application&gt;&lt;br /&gt;} + Chr(13)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; End If<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Call inStream.Close<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Kill &nbsp; &nbsp; datapatch$ &amp; oname$&nbsp; &nbsp; &#039; стереть файл&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; End If<br />&nbsp; &nbsp; End Forall<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; xml = xml + {&lt;/body&gt;}<br />&nbsp; &nbsp; xml = xml + {&lt;/html&gt;}<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; Call&nbsp; strm.WriteText(xml)<br />&nbsp; &nbsp; Call strm.Close&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />End Sub</p>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>http://itpmr.ru/profile.php?id=2</uri>
			</author>
			<updated>2014-04-17T08:31:05Z</updated>
			<id>http://itpmr.ru/viewtopic.php?pid=124153#p124153</id>
		</entry>
</feed>
