在domino中应用RSS
2004-07-05 16:19
281 查看
参照rss2.0写了发布rss的两个类
Class Rss
Private strRdfLiResource As String
Private strH As String
Private strAbout As String
Private strlink As String
Private strTitle As String
Private strdescription As String
Sub New()
End Sub
Property Set about As Variant
strAbout=about
End Property
Property Set title As Variant
strTitle=title
End Property
Property Set description As Variant
strDescription=description
End Property
Property Set link As Variant
strLink=link
End Property
Private Function getChannel() As String
Dim strRss As String
strRss=|<channel rdf:about="|+strAbout+|">|
strRss=strRss+|<channel rdf:about="|+strAbout+|">|
strRss=strRss+|<title>|+strtitle+|</title> |
strRss=strRss+| <description>|+strdescription+|</description> |
strRss=strRss+| <link>|+strlink+|</link> |
''strRss=strRss+|<image rdf:resource="http://192.198.64.36/video.nsf/dqgl_ajla.gif" /> |
strRss=strRss+|<items>|
strRss=strRss+|<rdf:Seq>|
strRss=strRss+strRdfLiResource
strRss=strRss+|</rdf:Seq>|
strRss=strRss+|</items>|
strRss=strRss+|</channel>|
End Function
Public Function toXML()
Dim strItemXml As String
Print "Content-type: text/xml"
Print |<?xml version="1.0" encoding="GB2312"?>|
Print | <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
Print |xmlns:dc="http://purl.org/dc/elements/1.1/" |
Print |xmlns:foaf="http://xmlns.com/foaf/0.1/" |
Print |xmlns="http://purl.org/rss/1.0/" >|
strItemXml= getChannel()
Print strItemXml
Print |</rdf:RDF>|
End Function
Public Sub addItem(rssItem As Variant)
strH=strh+rssItem.getXml()
strRdfLiResource=rssItem.about
End Sub
Function Valiater() As Boolean
Dim isflag As Boolean
isflag=True
If strRdfLiResource="" Then
isflag=False
End If
If strabout ="" Then
isflag=False
End If
Valiater=isflag
End Function
End Class
Class Rssitem
Private strXml As String
Private strAbout As String
Private strTitle As String
Private strLink As String
Private strDescription As String
Private strDate As String
Private strCreator As String
Private strResouce As String
Private strCreateDate As String
Private strAuthorMail As String
Sub New()
strDate=Now
End Sub
Property Set about As String
strAbout=about
End Property
Property Get about As String
about=strAbout
End Property
Property Set title As String
strtitle=title
End Property
Property Set link As String
strlink=link
End Property
Property Set description As String
strdescription =description
End Property
Property Set date As String
strdate=Date
End Property
Property Set creator As String
strcreator=creator
End Property
Property Set resouce As String
strresouce=resouce
End Property
Property Set createDate As String
strcreateDate= createDate
End Property
Property Set authorMail As String
strauthorMail=authorMail
End Property
Function getXML() As String
Call createXml()
getXML=strXml
End Function
Private Sub createXml()
Dim strH As String
strH=|<item rdf:about="|+strAbout+|">|
strH=strH+|<title>|+strTitle+|</title> |
strH=strH+|<link>|+strLink+|</link> |
strH=strH+|<description>|+strDescription+|</description> |
strH=strH+|<dc:date>|+strDate+|</dc:date> |
strH=strH+| <dc:creator>|+strCreator+|</dc:creator> |
strH=strH+|<foaf:maker>|
strH=strH+| <foaf:Person>|
strH=strH+|<foaf:mbox rdf:resource="|+strAuthorMail+|" /> |
strH=strH+|</foaf:Person>|
strH=strH+|</foaf:maker>|
strH=strH+|</item>|
strXml=strH
End Sub
Function Valiater() As Boolean
Dim isflag As Boolean
isflag=True
If strAbout="" Then
isflag=False
End If
If strLink="" Then
isflag=False
End If
If strTitle="" Then
isflag=False
End If
Valiater=isflag
End Function
End Class
具体使用在下一节
Class Rss
Private strRdfLiResource As String
Private strH As String
Private strAbout As String
Private strlink As String
Private strTitle As String
Private strdescription As String
Sub New()
End Sub
Property Set about As Variant
strAbout=about
End Property
Property Set title As Variant
strTitle=title
End Property
Property Set description As Variant
strDescription=description
End Property
Property Set link As Variant
strLink=link
End Property
Private Function getChannel() As String
Dim strRss As String
strRss=|<channel rdf:about="|+strAbout+|">|
strRss=strRss+|<channel rdf:about="|+strAbout+|">|
strRss=strRss+|<title>|+strtitle+|</title> |
strRss=strRss+| <description>|+strdescription+|</description> |
strRss=strRss+| <link>|+strlink+|</link> |
''strRss=strRss+|<image rdf:resource="http://192.198.64.36/video.nsf/dqgl_ajla.gif" /> |
strRss=strRss+|<items>|
strRss=strRss+|<rdf:Seq>|
strRss=strRss+strRdfLiResource
strRss=strRss+|</rdf:Seq>|
strRss=strRss+|</items>|
strRss=strRss+|</channel>|
End Function
Public Function toXML()
Dim strItemXml As String
Print "Content-type: text/xml"
Print |<?xml version="1.0" encoding="GB2312"?>|
Print | <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
Print |xmlns:dc="http://purl.org/dc/elements/1.1/" |
Print |xmlns:foaf="http://xmlns.com/foaf/0.1/" |
Print |xmlns="http://purl.org/rss/1.0/" >|
strItemXml= getChannel()
Print strItemXml
Print |</rdf:RDF>|
End Function
Public Sub addItem(rssItem As Variant)
strH=strh+rssItem.getXml()
strRdfLiResource=rssItem.about
End Sub
Function Valiater() As Boolean
Dim isflag As Boolean
isflag=True
If strRdfLiResource="" Then
isflag=False
End If
If strabout ="" Then
isflag=False
End If
Valiater=isflag
End Function
End Class
Class Rssitem
Private strXml As String
Private strAbout As String
Private strTitle As String
Private strLink As String
Private strDescription As String
Private strDate As String
Private strCreator As String
Private strResouce As String
Private strCreateDate As String
Private strAuthorMail As String
Sub New()
strDate=Now
End Sub
Property Set about As String
strAbout=about
End Property
Property Get about As String
about=strAbout
End Property
Property Set title As String
strtitle=title
End Property
Property Set link As String
strlink=link
End Property
Property Set description As String
strdescription =description
End Property
Property Set date As String
strdate=Date
End Property
Property Set creator As String
strcreator=creator
End Property
Property Set resouce As String
strresouce=resouce
End Property
Property Set createDate As String
strcreateDate= createDate
End Property
Property Set authorMail As String
strauthorMail=authorMail
End Property
Function getXML() As String
Call createXml()
getXML=strXml
End Function
Private Sub createXml()
Dim strH As String
strH=|<item rdf:about="|+strAbout+|">|
strH=strH+|<title>|+strTitle+|</title> |
strH=strH+|<link>|+strLink+|</link> |
strH=strH+|<description>|+strDescription+|</description> |
strH=strH+|<dc:date>|+strDate+|</dc:date> |
strH=strH+| <dc:creator>|+strCreator+|</dc:creator> |
strH=strH+|<foaf:maker>|
strH=strH+| <foaf:Person>|
strH=strH+|<foaf:mbox rdf:resource="|+strAuthorMail+|" /> |
strH=strH+|</foaf:Person>|
strH=strH+|</foaf:maker>|
strH=strH+|</item>|
strXml=strH
End Sub
Function Valiater() As Boolean
Dim isflag As Boolean
isflag=True
If strAbout="" Then
isflag=False
End If
If strLink="" Then
isflag=False
End If
If strTitle="" Then
isflag=False
End If
Valiater=isflag
End Function
End Class
具体使用在下一节
相关文章推荐
- 使用RSS提升DPDK应用的性能
- 可以应用到马克斯电影站生成Rss Feed的代码
- J2EE集成DOMINO应用
- Linux企业应用--RHAS 2.1 下安装中文 Lotus Domino R 6.5 图解
- RSS在网络营销中的应用尝试(转)
- Domino,大规模集团企业信息化应用的王者!
- 在Web微信应用中使用博客园RSS以及Quartz.NET实现博客文章内容的定期推送功能
- 可以应用到马克斯电影站生成Rss Feed的代码
- Linux企业应用--RHAS 2.1 下安装中文 Lotus Domino R 6.5 图解
- [导入]RSS商业应用和电子商务的结合
- JavaRSS.com中的Ajax应用
- Tickr:一个开源的 Linux 桌面 RSS 新闻速递应用
- Android(java)学习笔记205:网易新闻RSS客户端应用编写逻辑过程
- 在Domino平台上应用Java 反射机制
- 刚写了个AJAX在DOMINO中最简单的应用
- 语音技术新应用 Voice RSS (语音RSS)
- PHP应用正则表达式分析RSS
- RSS News Module的应用
- Domino应用之:考勤管理(BETA2)
- J2EE应用如何和DOMINO集成