The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

News.Report message schema in xAPFramework.net


  • Subject: News.Report message schema in xAPFramework.net
  • From: Stuart Booth
  • Date: Sun, 21 Sep 2003 22:06:00 +0000

Bet you never thought you'd actually see me get around to this, James!
:-))

Some real code I just used to test my new support for some of your
schema. This code sends a real xAP message.

C# code snippet:

private static void TestNewsSchema()
{
xAPNewsReportMessage news_report = new xAPNewsReportMessage
("xaporg",
"xAPAutomation.org", new Url("<a href="http://www.xapautomation.org/";>http://www.xapautomation.org/</a>"),
"PostNuke Powered
Site");

news_report.AddNewsStory("MisterHouse support for xAP 1.2", new
Url
("<a href="http://www.xapautomation.org/modules.php?op=modload&amp;name=News&amp;file=article&amp;sid=16";>http://www.xapautomation.org/modules.php?op=modload&amp;amp;name=News&amp;amp;file=art\
icle&amp;amp;sid=16</a>"), null);

xAPSender.ApplicationSender.Send(news_report);
}

All the block counting (in the Count= field of News.Feed) and the
message block indexing (News.Story.[X]) is taken care of for you by
the schema encapsulation classes. This result in the following:

xap-header
{
v=12
hop=1
uid=FFABCD00
class=News.Report
source=KCSoft.TestFramework.anya
}
News.Feed
{
link=<a href="http://www.xapautomation.org/";>http://www.xapautomation.org/</a>
desc=PostNuke Powered Site
title=xAPAutomation.org
station=xaporg
count=1
}
News.Story.1
{
link=<a href="http://www.xapautomation.org/modules.php?op=modload&amp;name=News&amp;f";>http://www.xapautomation.org/modules.php?op=modload&amp;amp;name=News&amp;amp;f</a>
ile=article&amp;amp;sid=16
title=MisterHouse support for xAP 1.2
}

How does that look? Any other suggestions you use yourself that I
should incorporate?

I've still got to do News.Alert but it'll share some of the code of
course. I've added some helpful support for block name indexing to my
framework code to facilitate this type of schema, to help keep block
names unique.

S
--
Stuart Booth
xAPFramework.net - a reusable xAP framework for .net

<a href="http://www.xapframework.net/";>http://www.xapframework.net/</a>
<a
href="/group/xAP_developer/post?postID=dk_jS8HiVG1RJzhLV2jmIHI6Qb5VQtGnHIfRrMMMYaxNigFRLUNiYzWofnabEs03RtSMIX9IS-JEniKxpSrDYuQv">stuart@x...</a>





xAP_Development Main Index | xAP_Development Thread Index | xAP_Development Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.