Wednesday, June 25, 2008

This example uses Microsoft Access so you can try it without configuring a database server. You can readily adapt the script to work with Oracle, SQL Server, and other popular databases by changing the connector used. Please visit the RSSBus Connectors page on the web site to see the full range of database technologies and read/write operations supported by RSSBus.

If you want to run the demo yourself, first download and install a trial copy of RSSBus Desktop from the RSSBus Downloads page, and then download this database file and script.

Here is the Customers table from customers.mdb:
CustomerID CompanyName FirstName LastName PhoneNumber
1 Selecto Magic Bob Smith 800-123-4567
2 Woonsocket Widgets Bob Jones 800-321-4321
3 Spacely Sprokets Bob Rogers 727-888-1234

Here is the RSBScript (select.rsb) that selects from Customers:

<rsb:info title="Feed of my Customer database"

      description="append ?name=smith to URL to select customers">

  <input name="name" description="Customer last name to select."/>

</rsb:info>

 

<!-- Set record selector for lastname if we got one as input -->

<rsb:notnull attr="name">

  <rsb:set attr="rec:lastname" value="[name]" />

</rsb:notnull>

 

<rsb:set attr="database" value="customers.mdb"/>

<rsb:set attr="table" value="Customers"/>

 

<rsb:call op="accessSelect" output="out">

  <!-- The body of call statement loops for each record -->

 

  <rsb:push title="[access:firstname] [access:lastname] ([access:companyname])">

 

    <!-- Push sends record fields to RSS output as attributes -->

    <!-- Body of push becomes optional description attribute -->

    id=[access:customerid], phone=[access:phonenumber]

  </rsb:push>

</rsb:call>

To use this script, place the customers.mdb and select.rsb files in the www/ directory of your RSSBus installation, and call it with these URLs:

http://localhost:1110/select.rsb
http://localhost:1110/select.rsb?name=smith

Here is the RSS feed for the first URL, which returns all customers:

<rss version="2.0">

  <channel>

    <description>append ?name=smith to URL to select</description>

    <generator>/n software RSSBus - http://www.rssbus.com</generator>

    <link>http://127.0.0.1:1110/select.rsb</link>

    <title>Feed of my Customer database</title>

    <item>

      <access:companyname>Selecto Magic</access:companyname>

      <access:customerid>1</access:customerid>

      <access:firstname>Bob</access:firstname>

      <access:lastname>Smith</access:lastname>

      <access:phonenumber>800-123-4567</access:phonenumber>

      <description>id=1, phone=800-123-4567</description>

      <title>Bob Smith (Selecto Magic)</title>

      <guid isPermaLink="false">YAXH4HuKB1NKdNvv5SE10x6o6oU=</guid>

    </item>

    <item>

      <access:companyname>Woonsocket Widgets</access:companyname>

      <access:customerid>2</access:customerid>

      <access:firstname>Bob</access:firstname>

      <access:lastname>Jones</access:lastname>

      . . .

      <title>Bob Rogers (Spacely Sprokets)</title>

      <guid isPermaLink="false">/T4mn9va90YEe18LNiRO+YqqkSY=</guid>

    </item>

  </channel>

</rss>

You can follow the pattern shown to add more input selection parameters, or add the cols parameter to control the columns returned. See the online operation description for AccessOps for further details.

You can learn more about RSSBus by reading the RSSBus Server Quick Start Guide.


Downloads: Database To Feed
#   
Tuesday, June 03, 2008

Internally at RSSBus, we have used RSBScripts and Templates for more than just publishing content over HTTP. We have used them to generate source code and other documents, we have used them to test RSSBus operations, and we have used them to automate tasks by scheduling scripts. Much of this is accomplished using the RSSBus Console.

RSSBus Console is a console executable that executes RSSBus operations.  It makes it possible to execute scripts by double clicking them in the file manager; it helps RSBScripts to be used as simple utilities that can be scheduled using the Windows Scheduler (we will expand more on this in a later blog post); and it serves as an exploratory playground to discover connectors, understand their usage, invoke remote operations etc..

Based on feedback from several of you, we have decided to release a minor version upgrade to RSSBus Desktop which now includes the RSSBus Console. We believe that it will help you get more out of your RSSBus deployment.

The syntax to use RSSBus Console is as follows:
rssbus.exe operation -[parameter name] [parameter value] ... -[parameter name] [parameter value]

A URL to an RSS/ATOM feed, name of an operation in a connector library, or a script are all operations in RSSBus. Thus any of them can be invoked using the syntax above. We list a few examples to  get you started:

Get a remote RSS/ATOM feed. These are natural operations for RSSBus.
:: rssbus.exe  http://news.google.com/?output=rss

Invoke an operation from the connector library with parameters.
:: rssbus.exe  smtpSendEmail -from con@rssbus.com -to info@rssbus.com

Invoke a script with parameters. The extensions .rsb and .rst are mapped to rssbus.exe which allows scripts to be executed on the command prompt.
:: s3ListObjects.rsb -bucket mybucket

Get help for an operation in the connector library.
:: rssbus.exe  smtpSendEmail --help

Get help for a remote operation. RSSBus treats remote operations on the web and those installed locally in exactly the same way.
:: rssbus.exe  http://mysite.com/myservice.rsb --help

Create an HTML page from the results of an operation.
:: rssbus.exe  s3ListObjects.rsb -bucket mybucket -@html > s3list.html

Please send your suggestions or questions to support@rssbus.com. We look forward to hearing from you.
#