- 浏览: 80954 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
burningman:
没看明白什么意思。
WebService身份验证解决方案 -
minglelui:
调用的是webservice。服务器端调用webservice ...
Java使用httprequest来访问WebService3 -
containsoft:
楼主,你这是调用的webservice还是servlet啊?一 ...
Java使用httprequest来访问WebService3
Sub Initialize()
Dim s As New NotesSession
Dim db As NotesDatabase
Set db = s.Currentdatabase
'Set db = New NotesDatabase( "YourServer/svr/somewhere", "database.nsf")
Call ExtractImageResources( db, "J:\temp" )
End Sub
Sub ExtractImageResources(db As NotesDatabase, DestinationDirectory As String)
' =========================================================
' Extracts all GIF and JPG image resource file to <DestinationDirectory>
' DestinationDirectory must exist.
' This code creates 1 tempfile in dest. directory.
' =========================================================
Dim session As New NotesSession
Dim DestinationDir As String
Dim debug As Integer
Dim nc As NotesNoteCollection
Dim exporter As NotesDXLExporter
Dim stream As NotesStream
Dim DXLTempfile As String
Dim inputStream As NotesStream
Dim domParser As NotesDOMParser
Dim RootNode As NotesDOMDocumentNode
Dim n1 As Integer
Dim i As Integer
Dim ImageResource_Nodes As NotesDOMNodeList
Dim MyNode As NotesDOMElementNode
Dim TempNode As NotesDOMElementNode
Dim TempChildNode As NotesDOMNode
Dim MyNodeList As NotesDOMNodeList
Dim attr As NotesDOMAttributeNode
Dim IRFilename As String
Dim MimeEntity As NotesMIMEEntity
Dim outStream As NotesStream
Dim doc As NotesDocument
On Error GoTo err1
debug = 1 ' set to 0 for no debg output
DestinationDir = Trim$(DestinationDirectory)
If Right$( DestinationDir, 1)<>"\" Then DestinationDir = DestinationDir+"\"
' ====================================================
' Define tempfiles - if you manage to make the DXL export/import
' work without tempfiles, let me know !
' =====================================================
DXLTempfile = DestinationDir & "tmp_fileresources.dxl"
' ========================
' Create DXL export stream
' ========================
On Error Resume Next
Kill( DXLTempfile)
On Error GoTo err1
Set stream = session.CreateStream
If Not stream.Open( DXLTempfile,"UTF-8") Then
MessageBox "Cannot create " & DXLTempfile,, "Error"
Exit Sub
End If
Call stream.Truncate
' ===============================
' Build collection of design elements
' ===============================
If debug = 1 Then Print "Building design note document collection"
' ================================
' Export DesignNoteCollection as DXL
' ================================
If debug = 1 Then Print "Exporting image resources to " & DXLTempfile
'Set exporter = session.CreateDXLExporter(nc, stream)
Dim docExport As NotesDocument
Set docExport = db.Getdocumentbyunid("047D60B5DA6AAE384825776800317812")
Set exporter = session.CreateDXLExporter(docExport, stream)
Call exporter.Process
Call stream.Close
' =========================
' Import DXL for parsing
' =========================
If debug = 1 Then Print "Creating DXL import stream from " & DXLTempfile
Set inputStream = session.CreateStream
Call inputStream.Open ( DXLTempfile ,"UTF-8")
' =========================
' Parse DXL
' =========================
Print "Parsing DXL"
Set domParser=session.CreateDOMParser(inputStream)
domParser.Process
' =======================
' Get the root node
' ======================
Set rootNode = domParser.Document
' =========================
' Get all ImageResourceNodes
' =========================
'Set ImageResource_Nodes = RootNode.GetElementsByTagName( "imageresource" )
Set ImageResource_Nodes = RootNode.GetElementsByTagName( "jpeg" )
If debug=1 Then Print "Found " & ImageResource_Nodes.NumberOfEntries & " image resources"
If ImageResource_Nodes.NumberOfEntries=0 Then
Print "No <imageresource> node found - exiting"
GoTo finish
End If
' =============================================
' Browse all <imageresource> nodes and extract images
' from <gif> / <jpeg> child nodes
' =============================================
IRFilename = "DLTitle.jpg"
Set TempNode = ImageResource_Nodes.GetItem(1)
Set TempChildNode = TempNode.firstchild
' TempChild.NodeValue contains the base64 encoded image data
' Create output stream / file
If debug=1 Then Print "Create output file " & DestinationDir & IRFilename
Set outStream = session.CreateStream
On Error Resume Next
Kill (DestinationDir & IRFilename)
On Error GoTo err1
Call outStream.Open( DestinationDir & IRFilename, "binary")
' Create Input Stream and write Base64 data to stream
Set stream = session.CreateStream
MsgBox CStr(TempChildNode.NodeValue)
Call stream.WriteText(TempChildNode.NodeValue)
' Decode base64 and write to outstream / file
If debug=1 Then Print "Decoding Base64 to binary"
Set doc = New NotesDocument(session.CurrentDatabase )
Set MimeEntity = doc.CreateMIMEEntity
Call MimeEntity.SetContentFromBytes(stream,"", ENC_BASE64)
Call MimeEntity.GetContentAsBytes(outStream, True)
Call MimeEntity.DEcodeContent()
Call outstream.Close
Call stream.close
Call inputstream.close
finish:
If debug=1 Then Print "Removing tempfiles"
On Error Resume Next
Kill(DXLTempfile)
On Error GoTo err1
Print
Exit Sub
err1:
Print Error$ & " in line " & Erl
MessageBox Error$ & " in line " & Erl
Exit Sub
End Sub
Dim s As New NotesSession
Dim db As NotesDatabase
Set db = s.Currentdatabase
'Set db = New NotesDatabase( "YourServer/svr/somewhere", "database.nsf")
Call ExtractImageResources( db, "J:\temp" )
End Sub
Sub ExtractImageResources(db As NotesDatabase, DestinationDirectory As String)
' =========================================================
' Extracts all GIF and JPG image resource file to <DestinationDirectory>
' DestinationDirectory must exist.
' This code creates 1 tempfile in dest. directory.
' =========================================================
Dim session As New NotesSession
Dim DestinationDir As String
Dim debug As Integer
Dim nc As NotesNoteCollection
Dim exporter As NotesDXLExporter
Dim stream As NotesStream
Dim DXLTempfile As String
Dim inputStream As NotesStream
Dim domParser As NotesDOMParser
Dim RootNode As NotesDOMDocumentNode
Dim n1 As Integer
Dim i As Integer
Dim ImageResource_Nodes As NotesDOMNodeList
Dim MyNode As NotesDOMElementNode
Dim TempNode As NotesDOMElementNode
Dim TempChildNode As NotesDOMNode
Dim MyNodeList As NotesDOMNodeList
Dim attr As NotesDOMAttributeNode
Dim IRFilename As String
Dim MimeEntity As NotesMIMEEntity
Dim outStream As NotesStream
Dim doc As NotesDocument
On Error GoTo err1
debug = 1 ' set to 0 for no debg output
DestinationDir = Trim$(DestinationDirectory)
If Right$( DestinationDir, 1)<>"\" Then DestinationDir = DestinationDir+"\"
' ====================================================
' Define tempfiles - if you manage to make the DXL export/import
' work without tempfiles, let me know !
' =====================================================
DXLTempfile = DestinationDir & "tmp_fileresources.dxl"
' ========================
' Create DXL export stream
' ========================
On Error Resume Next
Kill( DXLTempfile)
On Error GoTo err1
Set stream = session.CreateStream
If Not stream.Open( DXLTempfile,"UTF-8") Then
MessageBox "Cannot create " & DXLTempfile,, "Error"
Exit Sub
End If
Call stream.Truncate
' ===============================
' Build collection of design elements
' ===============================
If debug = 1 Then Print "Building design note document collection"
' ================================
' Export DesignNoteCollection as DXL
' ================================
If debug = 1 Then Print "Exporting image resources to " & DXLTempfile
'Set exporter = session.CreateDXLExporter(nc, stream)
Dim docExport As NotesDocument
Set docExport = db.Getdocumentbyunid("047D60B5DA6AAE384825776800317812")
Set exporter = session.CreateDXLExporter(docExport, stream)
Call exporter.Process
Call stream.Close
' =========================
' Import DXL for parsing
' =========================
If debug = 1 Then Print "Creating DXL import stream from " & DXLTempfile
Set inputStream = session.CreateStream
Call inputStream.Open ( DXLTempfile ,"UTF-8")
' =========================
' Parse DXL
' =========================
Print "Parsing DXL"
Set domParser=session.CreateDOMParser(inputStream)
domParser.Process
' =======================
' Get the root node
' ======================
Set rootNode = domParser.Document
' =========================
' Get all ImageResourceNodes
' =========================
'Set ImageResource_Nodes = RootNode.GetElementsByTagName( "imageresource" )
Set ImageResource_Nodes = RootNode.GetElementsByTagName( "jpeg" )
If debug=1 Then Print "Found " & ImageResource_Nodes.NumberOfEntries & " image resources"
If ImageResource_Nodes.NumberOfEntries=0 Then
Print "No <imageresource> node found - exiting"
GoTo finish
End If
' =============================================
' Browse all <imageresource> nodes and extract images
' from <gif> / <jpeg> child nodes
' =============================================
IRFilename = "DLTitle.jpg"
Set TempNode = ImageResource_Nodes.GetItem(1)
Set TempChildNode = TempNode.firstchild
' TempChild.NodeValue contains the base64 encoded image data
' Create output stream / file
If debug=1 Then Print "Create output file " & DestinationDir & IRFilename
Set outStream = session.CreateStream
On Error Resume Next
Kill (DestinationDir & IRFilename)
On Error GoTo err1
Call outStream.Open( DestinationDir & IRFilename, "binary")
' Create Input Stream and write Base64 data to stream
Set stream = session.CreateStream
MsgBox CStr(TempChildNode.NodeValue)
Call stream.WriteText(TempChildNode.NodeValue)
' Decode base64 and write to outstream / file
If debug=1 Then Print "Decoding Base64 to binary"
Set doc = New NotesDocument(session.CurrentDatabase )
Set MimeEntity = doc.CreateMIMEEntity
Call MimeEntity.SetContentFromBytes(stream,"", ENC_BASE64)
Call MimeEntity.GetContentAsBytes(outStream, True)
Call MimeEntity.DEcodeContent()
Call outstream.Close
Call stream.close
Call inputstream.close
finish:
If debug=1 Then Print "Removing tempfiles"
On Error Resume Next
Kill(DXLTempfile)
On Error GoTo err1
Exit Sub
err1:
Print Error$ & " in line " & Erl
MessageBox Error$ & " in line " & Erl
Exit Sub
End Sub
发表评论
-
代码复用的小例子
2010-09-10 14:46 790Sub CodeShare(Source As Button) ... -
扩展Implode方法
2010-09-09 18:01 983问题描述:Lotuscript中提供的Implode对整数数组 ... -
Excel编程
2010-09-07 15:46 897xlWorkSheet.Cells(1,iYear).Valu ... -
如何获取视图中列的多值域的值?
2010-09-07 14:45 1057http://www-10.lotus.com/ldd/nd6 ... -
创建时间域
2010-09-03 15:23 713Dim dt As NotesDateTime Dim dtI ... -
如何察看隐藏视图
2010-08-30 14:12 677goto可以间接查看视图 按着ctrl+shift,通过got ... -
About response doc
2010-08-26 10:13 714http://www.dominopower.com/issu ... -
NotesUIDocument和NotesDocument的差别
2010-08-10 11:52 1359测试目的:某域值更新后,隐藏条件设置与次域有关的相关域的隐藏立 ... -
Is Not a form
2010-08-06 11:15 735http://www-10.lotus.com/ldd/nd8 ... -
删除Profile文档的几种方法
2010-07-16 16:17 1013http://www-01.ibm.com/support/d ... -
Java agent
2010-07-15 11:09 756http://space.itpub.net/10114847 ... -
lotus 8.5
2010-07-09 13:44 623http://space.itpub.net/14751907 ... -
外发邮件挂起的处理
2010-06-25 11:10 896Question: You have outgoing ma ... -
邮件链接
2010-06-14 14:56 595拷贝数据库链接然后另存为ndl文件 http://we ... -
在Notes视图中游弋
2010-06-11 00:47 699Sub Initialize() Dim session As ... -
运行代理权限问题
2010-06-10 16:43 851Just to head off any technical ... -
在Lotus开发中引入jar包
2010-06-06 21:31 686http://www.docin.com/p-41744081 ... -
实时更新RTF域的内容
2010-06-05 23:54 674call uidoc.close call ws.editd ... -
读取RTF域中的Table
2010-06-05 23:50 954This code is designed to create ... -
在RTF域中添加Table
2010-06-05 23:48 1428Developers sometimes need to re ...
相关推荐
Excel百宝箱 9.0 破解版 批量导入图片等200种功能 Excel2007 Excel百宝箱2012是强大的制表插件,当安装百宝箱后,如果您使用Excel 2003,则将产生【百宝箱】菜单,包括100多个子菜单;如果您使用Excel 2007或者2010...
ImagesWriter.htm页面 主要是 输入图片的文件夹,程序去搜索文件将文件转换成二进制数据导入数据库中。ImagesRead.htm 主要是显示图片和将数据库中的二进制数据生成图片保存到硬盘上。图片导入导出都带有真实的...
例如有两张名为“诺基亚8310”、“诺基亚7600”的图片,只需要在单元格输入“诺基亚”就行了,导入图片时可以将“诺基亚”开头的图片全部导入。 5.数量灵活:对于多个图片符合同一单元格名称的状况,可以将所有图片...
例如有两张名为“诺基亚8310”、“诺基亚7600”的图片,只需要在单元格输入“诺基亚”就行了,导入图片时可以将“诺基亚”开头的图片全部导入。 5.数量灵活:对于多个图片符合同一单元格名称的状况,可以将所有图片...
批量二维码识别、批量二维码生成、表格数据汇总、全自动检索录入、数据采集大师、批量改图片大小、批量图片导入、批量图片导出、批量导图入批注、图片查询、批量图片排序大师、批量图片格式转换、批量文字水印与Logo...
如果想取消对当前图片的替换可以使用“导入”菜单中的“还原” 全部图像都替换完之后,执行“导入”菜单中的“保存”,所作的替换就会生效 五、压缩包操作 可以提取游戏数据包中的所有文件,并支持部分游戏的文件...
如果想取消对当前图片的替换可以使用“导入”菜单中的“还原” 全部图像都替换完之后,执行“导入”菜单中的“保存”,所作的替换就会生效 五、压缩包操作 可以提取游戏数据包中的所有文件,并支持部分游戏...
可以直接依赖 aar 文件夹下的 aar 文件,也可以 clone 项目,将 smartcropperlib 作为 Android 模块导入。 另外 libs 目录下是编译好的 native library,如果引入项目不想编译,可以直接使用。(JCenter 仓库地址...
【报表分栏工具箱】【删除工资条恢复明细表】【制作工资条】【建立分页小计】【删除分页小计】【建立图片目录】【批量导入图片(精确匹配)】【批量导入图片(模糊匹配)】【批量导入图片到批注】【删除所有图片】...
基于jspsmartupload.jar类的jsp图片上传系统,数据库采用MSSQL,支持2级分类,您可以根据需要自己定制为三级。可以设置上传文件大孝文件类型、文件路径、生成缩略图,重命名等操作。jspsmartupload.jar上传组件必须...
图片的链接替换为本地图片链接,并添加命令使得双击图片可以打开原始图片链接。 其他功能: 可以通过右键菜单直接管理资料文件。 "编辑"时自动导入原文件并填写标题、链接等内容。 编辑时“原始链接”随输入实时...
数据库为mysql,启动mysql后,导入压缩包下的sql文件还原数据库。 本程序是myeclipes6.0的工程,直接导入就行。直接发布可以将webroot下所有文件复制到别的文件夹下,发布到tomcat中。 程序后台管理入口是...
主要功能是通过底层内核驱动过滤技术对Web站点目录提供全方位的防护,防止入侵者或病毒等对目录中的网页、电子文档、图片、数据库等任何类型的文件进行非法篡改和破坏。 1.网页防挂马 2.防止上传webshell web后门...
数据库在系统里面,自行导入或还原。 本系统支持MSSQL数据库,如用其他数据库请自行配置,数据库驱动在lib里面。 功能介绍: V2完美版新增了分类管理,上传图片可选择需要的大类和小类进行上传 ·支持分类上传...
如果不能在启动目录(默认为 %systemroot%System32)中找到该文件,将试着在 Windows 安装 CD 中找到它。如果有多引导系统的计算机,必须保证是在包含 Windows 的驱动器上使用该命令。 Diskpart 创建和删除硬盘...
【批量导入图片(精确匹配)】:瞬间导入所有与选区字符同名的图片到单元格,可以自由设定图片的大小及格式,且全部统一对齐 【批量导入图片(模糊匹配)】:与上一工具基本一致,只是在确定图片名称时可以糊模匹配...
【批量导入图片(自动排版)】:批量导入图片,且自动排版,可多行多列排版,可任意指定图片大小与路径 【批量导入图片到批注】:批量地将图片导入到批注中,可以自由设定图片显示大小 【删除所有图片】:删除当前表...
如果想取消对当前图片的替换可以使用“导入”菜单中的“还原” 全部图像都替换完之后,执行“导入”菜单中的“保存”,所作的替换就会生效 五、压缩包操作 可以提取游戏数据包中的所有文件,并支持部分游戏的文件...