Pushing content into Surfulater from other Programs – Part 1

Surfulater provides a simple method to enable content to be added to it from other applications (think MS Word etc.) via. the Windows Clipboard. This was developed for Surfulater’s our own internal use, and has now been extended and opened up following user discussions on our Support Forums.

This is accomplished though a simple, clearly defined format, that enables anyone to add new content to Surfulater, in an open extensible way. As an example one of our Surfulater users, Perry Mowbray, has used this to write an add-in for Microsoft Word that enables Word users to add new content to Surfulater.

In essence whenever Surfulater is running it keeps an eye on information that gets placed into the Windows Clipboard, and if it sees something destined for it, it grabs it and creates a nice new article. For this to work the information placed into the Clipboard needs to follow some simple rules. Lets start with an example:

<SULCONTENT action=”add” source=”Clipboard” template=”Clipboard”>
 <Title>Example 1</Title>
 <Text>Some text for example one</Text>
</SULCONTENT>

This is about as simple as it gets. To try it for yourself, start Surfulater, then right click and choose Save Target As.. on this file and save it as SXCF_Example1.txt Next open the file in Windows Notepad, use Edit|Select All, and then Edit|Copy, to copy it to the Windows Clipboard. Surfulater will pick this up and create the following article:

Example 1 
Now for something more complex:

<SULCONTENT action=”add” source=”WebBrowser” source_application=”InternetExplorer” template=”IE” thumbnail=””>
        <Title>Mini HDD</Title>
 <Text><![CDATA[<TR><TH width=”100%” bgColor=#d5d6d5><FONT face=Arial,Helvetica size=2>Tiny
                hard drive garners Guinness World Record as smallest HDD</FONT></TH></TR>
                <TR><TD width=”100%” height=20><FONT face=Arial,Helvetica size=2>Mar. 17, 2004</FONT> —
                <FONT face=Arial,Helvetica size=2><IMG hspace=10 src=”http://deviceforge.com/files/misc/toshiba-tinyhd-thm.jpg” mce_src=”http://deviceforge.com/files/misc/toshiba-tinyhd-thm.jpg”
                align=left vspace=5>Toshiba announced this week that Guinness World
                Records has certified its 0.85-inch hard disk drive (HDD) as the smallest
                HDD in the world. Toshiba claims its 0.85-inch HDD, announced in
                January 2004, is the first HDD to deliver multi-gigabyte data
                storage in a sub-one-inch form factor.</FONT>
                <A href=”http://deviceforge.com/news/NS8560517030.html” mce_href=”http://deviceforge.com/news/NS8560517030.html” >
                <IMG src=”http://deviceforge.com/images/readmore.gif” mce_src=”http://deviceforge.com/images/readmore.gif” align=right border=0></A>
                </TD></TR>]]>
        </Text>
 <Reference><![CDATA[<A href=”http://deviceforge.com/news/200404120922NS2297227508.html” mce_href=”http://deviceforge.com/news/200404120922NS2297227508.html” >
                   http://deviceforge.com/news/200404120922NS2297227508.html</A>]]>
        </Reference>
 <Comments>This is a copy of an article included in the sample Knowledge Base included with Surfulater.
 </Comments>
 <Attachments><![CDATA[I’ve also attached a MS Word Document located on my PC <a href=”file://d:/saig/bin6/test1.doc” mce_href=”file://d:/saig/bin6/test1.doc” attach=”true”>
                     test1.doc</a> Neat huh!]]>
        </Attachments>
</SULCONTENT>

This is a copy of an article from the sample Knowledge Base included with Surfulater, along with some extra content; a Comment and an Attachment. Perform the steps outlined above on this file, SXCF_Example2.txt  to see the result for yourself. The Attachment will be missing unless you just so happen to have a file d:\saig\bin6\test1.doc  And this is what it looks like.

Surfulater Article

These examples should clearly show the capabilities on offer with Surfulater’s XML Clipboard Format.  I have to say that I think this is pretty neat stuff, not rocket science, but impressive none the less.

In Part 2 of this article I’ll explain the SXCF in detail, enabling you to use it your own applications or in program add-ons.

Note: The examples above and the content of these articles require Surfulater V1.96.0.0 or later.

One Reply to “Pushing content into Surfulater from other Programs – Part 1”

Comments are closed.