|
From: creecode <icr...@us...> - 2006-03-07 05:38:57
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/xml/aggregator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6487 Modified Files: getServicesXml saveServicesXml Log Message: replace calls to verbs at extensions.latinToMac with string.(latin/mac)To(Latin/Mac) verbs Index: getServicesXml =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/xml/aggregator/getServicesXml,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** getServicesXml 26 Mar 2005 19:44:16 -0000 1.1.1.1 --- getServicesXml 7 Mar 2006 05:38:54 -0000 1.2 *************** *** 1,3 **** ! FrontierVcsFile:1:scpt:system.verbs.builtins.xml.aggregator.getServicesXml ! on getServicesXml (adrdata=xml.aggregator.init (), adrIncludeCallback=nil) { ÇChanges Ç4/2/03; 11:31:56 PM by JES ÇCreated. Factored from xml.aggregator.saveServicesXml, this script generates the xml text for the services XML file. ÇadrCallback is the optional address of a callback script. If supplied, the callback is called with the URL of each service. If the callback returns true, the service is included. If it returns false, it's not included. local (mySubscriptions); new (outlinetype, @mySubscriptions); local (oldtarget = target.set (@mySubscriptions)); local (adrservice, atts); for adrservice in @adrdata^.services { if defined (adrservice^.compilation) { local (url = nameof (adrservice^), flcontainspassword = false); local (flInclude = true); if adrIncludeCallback != nil { try { while typeOf (adrIncludeCallback^) == addressType { adrIncludeCallback = adrIncludeCallback^}; flInclude = adrIncludeCallback^ (adrservice)}}; if flInclude { bundle { //set flcontainspassword try { local (urllist = string.urlsplit (url)); flcontainspassword = urllist [2] contains "@"}}; if not flcontainspassword { try { op.insert (adrservice^.compilation.channeltitle, down); new (tabletype, @atts); atts.type = "rss"; atts.xmlUrl = url; atts.htmlUrl = adrservice^.compilation.channellink; atts.title = adrservice^.compilation.channeltitle; atts.version = adrservice^.compilation.format; atts.description = adrservice^.compilation.channeldescription; try { atts.language = adrservice^.compilation.language} else { atts.language = "unknown"}}; op.attributes.addgroup (@atts)}}}}; op.firstsummit (); op.deleteline (); try {target.set (oldtarget)}; settimecreated (@mySubscriptions, timecreated (@adrdata^.services)); local (xmltext = op.outlineToXml (@mySubscriptions)); if system.environment.isMac { //02/22/2001 JES: convert to Latin text xmltext = latinToMac.macToLatin (xmltext)}; return (xmltext)}; Çbundle //test code Çon includeCallback (adr) Çreturn (nameOf (adr^) contains "userland") Çwp.newTextObject (getServicesXml (adrIncludeCallback:@includeCallback), @scratchpad.servicesXml) Çedit (@scratchpad.servicesXml) \ No newline at end of file --- 1,59 ---- ! FrontierVcsFile:2:scpt:system.verbs.builtins.xml.aggregator.getServicesXml ! on getServicesXml (adrdata=xml.aggregator.init (), adrIncludeCallback=nil) { ! «Changes ! «2/28/06; 1:03:16 PM by TAC ! «replace latinToMac.macToLatin with string.macToLatin ! «4/2/03; 11:31:56 PM by JES ! «Created. Factored from xml.aggregator.saveServicesXml, this script generates the xml text for the services XML file. ! «adrCallback is the optional address of a callback script. If supplied, the callback is called with the URL of each service. If the callback returns true, the service is included. If it returns false, it's not included. ! ! local (mySubscriptions); ! new (outlinetype, @mySubscriptions); ! local (oldtarget = target.set (@mySubscriptions)); ! ! local (adrservice, atts); ! for adrservice in @adrdata^.services { ! if defined (adrservice^.compilation) { ! local (url = nameof (adrservice^), flcontainspassword = false); ! local (flInclude = true); ! if adrIncludeCallback != nil { ! try { ! while typeOf (adrIncludeCallback^) == addressType { ! adrIncludeCallback = adrIncludeCallback^}; ! flInclude = adrIncludeCallback^ (adrservice)}}; ! if flInclude { ! bundle { //set flcontainspassword ! try { ! local (urllist = string.urlsplit (url)); ! flcontainspassword = urllist [2] contains "@"}}; ! if not flcontainspassword { ! try { ! op.insert (adrservice^.compilation.channeltitle, down); ! new (tabletype, @atts); ! atts.type = "rss"; ! atts.xmlUrl = url; ! atts.htmlUrl = adrservice^.compilation.channellink; ! atts.title = adrservice^.compilation.channeltitle; ! atts.version = adrservice^.compilation.format; ! atts.description = adrservice^.compilation.channeldescription; ! try { ! atts.language = adrservice^.compilation.language} ! else { ! atts.language = "unknown"}}; ! op.attributes.addgroup (@atts)}}}}; ! op.firstsummit (); ! op.deleteline (); ! try {target.set (oldtarget)}; ! ! settimecreated (@mySubscriptions, timecreated (@adrdata^.services)); ! local (xmltext = op.outlineToXml (@mySubscriptions)); ! if system.environment.isMac { //02/22/2001 JES: convert to Latin text ! xmltext = string.macToLatin (xmltext)}; ! ! return (xmltext)} ! «bundle //test code ! «on includeCallback (adr) ! «return (nameOf (adr^) contains "userland") ! «wp.newTextObject (getServicesXml (adrIncludeCallback:@includeCallback), @scratchpad.servicesXml) ! «edit (@scratchpad.servicesXml) \ No newline at end of file Index: saveServicesXml =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/xml/aggregator/saveServicesXml,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** saveServicesXml 26 Mar 2005 19:44:17 -0000 1.1.1.1 --- saveServicesXml 7 Mar 2006 05:38:54 -0000 1.2 *************** *** 1,3 **** ! FrontierVcsFile:1:scpt:system.verbs.builtins.xml.aggregator.saveServicesXml ! on saveServicesXml (f, adrIncludeCallback=nil) { ÇChanges Ç4/2/03; 11:44:25 PM by JES ÇFactored the code that generates the XML to a new verb, xml.aggregator.getServicesXml. New optional parameter, adrIncludeCallback, passed to xml.aggregator.getServicesXml. If supplied, the callback script is called with the address of the service table. If it returns true, the service is included; if it returns false, the service is not included. Ç12/17/01; 5:06:14 PM by DW ÇIf the url of a service has a username:password encoded, don't include it in the file. Ç3/1/01; 11:48:38 PM by JES ÇUse Frontier.id, instead of hard-coding 'Radu'. Ç2/22/01; 9:28:50 PM by JES ÇIf this is a Mac, convert the opml text to Latin before writing the file. Ç2/13/01; 3:27:29 PM by PBS ÇSave mySubscriptions.opml as a Radio UserLand document on Macs. Ç2/5/01; 6:22:03 PM by DW ÇOnly save if myUserLandData.stats.flSaveMySubscriptions is defined and true. Ç1/23/01; 11:50:02 AM by DW ÇDon't let a problem with one channel stop the rendering of all. This is a startup issue, this script is called when we're first initialized, and I can't stop to figure out what it is about which channel that's stopping us. Ç1/2/01; 5:04:10 PM by DW ÇIf a table doesn't have a compilation sub-table, don't add it to the services file. Ç1/1/01; 11:21:33 AM by DW ÇSave an OPML file containing the services the user is subscribed to the rss/misc upstreamed folder. Çbundle //old code Çlocal (mySubscriptions) Çnew (outlinetype, @mySubscriptions) Çlocal (oldtarget = target.set (@mySubscriptions)) Ç Çlocal (adrdata = xml.aggregator.init ()) Çlocal (adrservice, atts) Çfor adrservice in @adrdata^.services Çif defined (adrservice^.compilation) Çlocal (url = nameof (adrservice^), flcontainspassword = false) Çbundle //set flcontainspassword Çtry Çlocal (urllist = string.urlsplit (url)) Çflcontainspassword = urllist [2] contains "@" Çif not flcontainspassword Çtry Çop.insert (adrservice^.compilation.channeltitle, down) Çnew (tabletype, @atts) Çatts.type = "rss" Çatts.xmlUrl = url Çatts.htmlUrl = adrservice^.compilation.channellink Çatts.title = adrservice^.compilation.channeltitle Çatts.version = adrservice^.compilation.format Çatts.description = adrservice^.compilation.channeldescription Çtry Çatts.language = adrservice^.compilation.language Çelse Çatts.language = "unknown" Çop.attributes.addgroup (@atts) Çop.firstsummit () Çop.deleteline () Çtarget.set (oldtarget) Ç Çsettimecreated (@mySubscriptions, timecreated (@adrdata^.services)) Çscratchpad.mySubscriptions = mySubscriptions; edit (@scratchpad.mySubscriptions) Ç Çlocal (xmltext = op.outlineToXml (@mySubscriptions)) local (adrdata = xml.aggregator.init ()); local (xmltext = xml.aggregator.getServicesXml (adrdata, adrIncludeCallback)); if system.environment.isMac { //02/22/2001 JES: convert to Latin text xmltext = latinToMac.macToLatin (xmltext)}; file.surefilepath (f); file.writewholefile (f, xmltext, 'OPML', Frontier.id)}; Çbundle //test code Çlocal (f = file.getSystemDisk () + "mySubscriptions.xml") ÇsaveServicesXml (f) \ No newline at end of file --- 1,75 ---- ! FrontierVcsFile:2:scpt:system.verbs.builtins.xml.aggregator.saveServicesXml ! on saveServicesXml (f, adrIncludeCallback=nil) { ! «Changes ! «2/28/06; 1:03:16 PM by TAC ! «replace latinToMac.macToLatin with string.macToLatin ! «4/2/03; 11:44:25 PM by JES ! «Factored the code that generates the XML to a new verb, xml.aggregator.getServicesXml. New optional parameter, adrIncludeCallback, passed to xml.aggregator.getServicesXml. If supplied, the callback script is called with the address of the service table. If it returns true, the service is included; if it returns false, the service is not included. ! «2001 ! «12/17/01; 5:06:14 PM by DW ! «If the url of a service has a username:password encoded, don't include it in the file. ! «3/1/01; 11:48:38 PM by JES ! «Use Frontier.id, instead of hard-coding 'Radu'. ! «2/22/01; 9:28:50 PM by JES ! «If this is a Mac, convert the opml text to Latin before writing the file. ! «2/13/01; 3:27:29 PM by PBS ! «Save mySubscriptions.opml as a Radio UserLand document on Macs. ! «2/5/01; 6:22:03 PM by DW ! «Only save if myUserLandData.stats.flSaveMySubscriptions is defined and true. ! «1/23/01; 11:50:02 AM by DW ! «Don't let a problem with one channel stop the rendering of all. This is a startup issue, this script is called when we're first initialized, and I can't stop to figure out what it is about which channel that's stopping us. ! «1/2/01; 5:04:10 PM by DW ! «If a table doesn't have a compilation sub-table, don't add it to the services file. ! «1/1/01; 11:21:33 AM by DW ! «Save an OPML file containing the services the user is subscribed to the rss/misc upstreamed folder. ! «bundle //old code ! «local (mySubscriptions) ! «new (outlinetype, @mySubscriptions) ! «local (oldtarget = target.set (@mySubscriptions)) ! « ! «local (adrdata = xml.aggregator.init ()) ! «local (adrservice, atts) ! «for adrservice in @adrdata^.services ! «if defined (adrservice^.compilation) ! «local (url = nameof (adrservice^), flcontainspassword = false) ! «bundle //set flcontainspassword ! «try ! «local (urllist = string.urlsplit (url)) ! «flcontainspassword = urllist [2] contains "@" ! «if not flcontainspassword ! «try ! «op.insert (adrservice^.compilation.channeltitle, down) ! «new (tabletype, @atts) ! «atts.type = "rss" ! «atts.xmlUrl = url ! «atts.htmlUrl = adrservice^.compilation.channellink ! «atts.title = adrservice^.compilation.channeltitle ! «atts.version = adrservice^.compilation.format ! «atts.description = adrservice^.compilation.channeldescription ! «try ! «atts.language = adrservice^.compilation.language ! «else ! «atts.language = "unknown" ! «op.attributes.addgroup (@atts) ! «op.firstsummit () ! «op.deleteline () ! «target.set (oldtarget) ! « ! «settimecreated (@mySubscriptions, timecreated (@adrdata^.services)) ! «scratchpad.mySubscriptions = mySubscriptions; edit (@scratchpad.mySubscriptions) ! « ! «local (xmltext = op.outlineToXml (@mySubscriptions)) ! ! local (adrdata = xml.aggregator.init ()); ! local (xmltext = xml.aggregator.getServicesXml (adrdata, adrIncludeCallback)); ! ! if system.environment.isMac { //02/22/2001 JES: convert to Latin text ! xmltext = string.macToLatin (xmltext)}; ! ! file.surefilepath (f); ! file.writewholefile (f, xmltext, 'OPML', Frontier.id)}; ! ! «bundle // testing ! «local (f = file.getSystemDisk () + "mySubscriptions.xml") ! «saveServicesXml (f) \ No newline at end of file |