在domino中应用RSS

参照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
 具体使用在下一节

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值