<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head profile="http://internetalchemy.org/2003/02/profile"> <link rel="foaf" type="application/rdf+xml" title="FOAF" href="http://www.openlinksw.com/dataspace/uda/about.rdf" /> <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" /> <meta name="dc.title" content="17. Internet Services" /> <meta name="dc.subject" content="17. Internet Services" /> <meta name="dc.creator" content="OpenLink Software Documentation Team ; " /> <meta name="dc.copyright" content="OpenLink Software, 1999 - 2009" /> <link rel="top" href="index.html" title="OpenLink Virtuoso Universal Server: Documentation" /> <link rel="search" href="/doc/adv_search.vspx" title="Search OpenLink Virtuoso Universal Server: Documentation" /> <link rel="parent" href="internetservices.html" title="Chapter Contents" /> <link rel="prev" href="maildelivstore.html" title="Mail Delivery & Storage" /> <link rel="next" href="mime.html" title="MIME & Internet Messages" /> <link rel="shortcut icon" href="../images/misc/favicon.ico" type="image/x-icon" /> <link rel="stylesheet" type="text/css" href="doc.css" /> <link rel="stylesheet" type="text/css" href="/doc/translation.css" /> <title>17. Internet Services</title> <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" /> <meta name="author" content="OpenLink Software Documentation Team ; " /> <meta name="copyright" content="OpenLink Software, 1999 - 2009" /> <meta name="keywords" content="" /> <meta name="GENERATOR" content="OpenLink XSLT Team" /> </head> <body> <div id="header"> <a name="nntpnewsgroups" /> <img src="../images/misc/logo.jpg" alt="" /> <h1>17. Internet Services</h1> </div> <div id="navbartop"> <div> <a class="link" href="internetservices.html">Chapter Contents</a> | <a class="link" href="maildelivstore.html" title="Mail Delivery & Storage">Prev</a> | <a class="link" href="mime.html" title="MIME & Internet Messages">Next</a> </div> </div> <div id="currenttoc"> <form method="post" action="/doc/adv_search.vspx"> <div class="search">Keyword Search: <br /> <input type="text" name="q" /> <input type="submit" name="go" value="Go" /> </div> </form> <div> <a href="http://www.openlinksw.com/">www.openlinksw.com</a> </div> <div> <a href="http://docs.openlinksw.com/">docs.openlinksw.com</a> </div> <br /> <div> <a href="index.html">Book Home</a> </div> <br /> <div> <a href="contents.html">Contents</a> </div> <div> <a href="preface.html">Preface</a> </div> <br /> <div class="selected"> <a href="internetservices.html">Internet Services</a> </div> <br /> <div> <a href="webdavserver.html">WebDAV Server</a> </div> <div> <a href="uriqa.html">URIQA Semantic Web Enabler</a> </div> <div> <a href="maildelivstore.html">Mail Delivery & Storage</a> </div> <div class="selected"> <a href="nntpnewsgroups.html">NNTP Newsgroups</a> <div> <a href="#nntpclient" title="NNTP Client">NNTP Client</a> <a href="#newsserver" title="NNTP Server">NNTP Server</a> </div> </div> <div> <a href="mime.html">MIME & Internet Messages</a> </div> <div> <a href="ftpservices.html">FTP Services</a> </div> <div> <a href="vspguide.html">VSP Guide</a> </div> <div> <a href="ldap.html">LDAP</a> </div> <br /> </div> <div id="text"> <a name="nntpnewsgroups" /> <h2>17.4. NNTP Newsgroups</h2> <a name="nntpclient" /> <h3>17.4.1. NNTP Client</h3> <div class="funcsynopsis"> <div class="funcsynopsis"> <a name="fproto_nntp_get" /> <span class="funcdef">array <a href="fn_nntp_get.html"> <span class="function">nntp_get</span> </a> </span> (<span class="paramdef">in <span class="parameter">server</span> varchar</span>, <span class="paramdef">in <span class="parameter">command</span> varchar</span>, <span class="paramdef">in <span class="parameter">group</span> varchar</span>, <span class="paramdefoptional">[in <span class="optional">first_message</span> integer]</span>, <span class="paramdefoptional">[in <span class="optional">last_message</span> integer]</span>); </div> </div> <p>Returns information about an NNTP server.</p> <a name="commandsandexamples" /> <h4>17.4.1.1. Commands and Examples</h4> <p> If the requested messages don't exist, <span class="computeroutput">nttp_get()</span> returns NULL. </p> <p> Get a list of all groups from the server 'news.openlinksw.com', port 119: </p> <a name="" /> <div class="example"> <div> <pre class="programlisting"> nntp_get ('news.openlinksw.com:119', 'list'); </pre> </div> <p> This call returns an array of the form Array ((<group 1> varchar, <last message> integer, <first message> integer, <posting allowed> varchar ) (<group 2> . . . . ) . . . ) </p> <p> ARTICLE, HEAD, BODY, STAT To get the bodies of all messages in the group 'openlink.public.virtuoso': </p> <div> <pre class="programlisting"> nntp_get ('news.openlinksw.com:119', 'body', 'openlink.public.virtuoso'); </pre> </div> <p> This call returns an array of the form Array ((<message number> integer, <body of message> blob) . . . ) </p> <p> To get the article (head + body) of messages numbered from 5 to 10 in the group 'openlink.public.virtuoso': </p> <div> <pre class="programlisting"> nntp_get ('news.openlinksw.com:119', 'article', 'openlink.public.virtuoso', 5, 10); </pre> </div> <p> This call returns an array of the form Array ((<message number> integer, <body of message> blob) . . . ) </p> <p> To get the headers of messages numbered from 7 to the end of the 'openlink.public.virtuoso' group: </p> <div> <pre class="programlisting"> nntp_get ('news.openlinksw.com:119', 'head', 'openlink.public.virtuoso', 7); </pre> </div> <p> To get the status of all messages in the group 'openlink.public.virtuoso': </p> <div> <pre class="programlisting"> nntp_get ('news.openlinksw.com:119', 'stat', 'openlink.public.virtuoso',); </pre> </div> <p> This call returns an array of the form Array ((<message number> integer, <message ID> varchar) . . . ) </p> <p> To get the status of the 'openlink.public.virtuoso' group: </p> <div> <pre class="programlisting"> nntp_get ('news.openlinksw.com:119', 'group', 'openlink.public.virtuoso'); </pre> </div> <p> This call returns an array of the form Array (<number of messages> integer, <first message> integer, <last message> integer) </p> </div> <br /> <br /> <a name="newsserver" /> <h3>17.4.2. NNTP Server</h3> <a name="newssrvenable" /> <h4>17.4.2.1. Enabling the NNTP Server</h4> <p>The Virtuoso News Server listening port is configured in the HTTP section of the virtuoso.ini file.</p> <div> <pre class="screen">[HTTPServer] NewsServerPort = 119</pre> </div> <p>If the port is not defined Virtuoso will disable the News Server subsystem.</p> <br /> <a name="newssrvcmds" /> <h4>17.4.2.2. NNTP Server Commands</h4> <p>The server supports the following commands:</p> <ul> <li>article [MessageID|Number]</li> <li>body [Number]</li> <li>group newsgroup</li> <li>head [Number]</li> <li>help</li> <li>last</li> <li>list</li> <li>mode reader</li> <li>newgroups yymmdd hhmmss</li> <li>next</li> <li>post</li> <li>xover [range]</li> <li>stat [MessageID|Number]</li> </ul> <br /> <div class="tip"> <div class="tiptitle">See Also:</div> <p> <a href="systemtables.html#newssrvtables">News System Tables</a> </p> </div> <a name="newssrvadd" /> <h4>17.4.2.3. Add Groups to NNTP Server</h4> <p>To add a new newsgroup you must insert a row into the table DB.DBA.NEWS_GROUPS. Below is an example of an insert statement that you could use to do this:</p> <div> <pre class="programlisting"> insert into DB.DBA.NEWS_GROUPS (NG_NAME, NG_DESC, NG_UP_INT, NG_CLEAR_INT, NG_POST, NG_UP_TIME, NG_OUT_GROUP, NG_NUM, NG_FIRST, NG_LAST, NG_SERVER, NG_SERV_PORT, NG_CREAT, NG_UP_MESS, NG_PASS) values ('openlink.public.virtuoso', 'virtuoso news group' , update interval, clear interval, 1, now(), 'openlink.public.virtuoso', 0, 0, 0, 'news.openlinksw.com', 110, now(), 0, 0); </pre> </div> <p>If the group you want to add is local, change <span class="computeroutput">news.openlinksw.com</span> to <span class="computeroutput">localhost</span>, change the port to 0, and the <span class="computeroutput">external name</span> to <span class="computeroutput">''</span> (that is, two single quotes).</p> <p>See also the <a href=""> Newsgroups Administration</a> section of the Visual Server Administration Interface.</p> <br /> <br /> <table border="0" width="90%" id="navbarbottom"> <tr> <td align="left" width="33%"> <a href="maildelivstore.html" title="Mail Delivery & Storage">Previous</a> <br />Mail Delivery & Storage</td> <td align="center" width="34%"> <a href="internetservices.html">Chapter Contents</a> </td> <td align="right" width="33%"> <a href="mime.html" title="MIME & Internet Messages">Next</a> <br />MIME & Internet Messages</td> </tr> </table> </div> <div id="footer"> <div>Copyright© 1999 - 2009 OpenLink Software All rights reserved.</div> <div id="validation"> <a href="http://validator.w3.org/check/referer"> <img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /> </a> <a href="http://jigsaw.w3.org/css-validator/"> <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height="31" width="88" /> </a> </div> </div> </body> </html>