...| Home | CMS...
DBPrism Content Management System > Dynamic Content > News Feed >
Search Engine > FAQ Report > News Feed >
+ Home ...
+ Download
+ Documentation
> DBPrism Content Management System
+ DBPrism - Apache Cocoon
+ Credits
+ Legal
 
+ CMS
+ Introduction to DBPrism / Cocoon and DBPrism CMS
+ Install Instruction
+ External Cache Invalidator Server
+ CMS-Tables
+ Upload Utility
+ Config File
+ CMS Addin for JDeveloper 9i DS
+ Dynamic Content
+ Source Code
+ Stylesheets
+ Scripts Explained
+ Security
 
+ links
+ Yahoo.groups
+ OTN
+ OSCOM.org
 
Moreover news
+ IBM speeds Java on mainframes (CNET Asia)
+ Middle-aged mainframe converts to Java (ZDNet UK)
+ IBM speeds Java on mainframes (ZDNet)
+ IBM speeds Java on mainframes (CNET)
+ All Buttons (JavaBoutique)
+ Drag-and-Drop Editor Out for Linux Devs (Internet News)
+ Using Program Parameters in Java (JavaBoutique)
+ Sun pledges to cooperate with Microsoft (AP via Seattle Post Intelligencer)
+ Sun pledges to cooperate with Microsoft (Boston Globe)
+ Bitter legal feud ends with payment, Sun cuts 3,300 more jobs (China Post)
+ Sun and Microsoft settle (Chicago Sun-Times)
+ Microsoft to pay $1.6 billion, settle with Sun Microsystems (Baltimore Sun)
+ Visualize Hoovers Data With Anacubis (ResearchBuzz via ResearchBuzz)
+ Sun and BEA advance Java app offerings (Computer Weekly)
+ Sun wants to lift its Java profile (ZDNet UK)
+ 'Smack the Pingu' on Your Mobile Phone! (PA News via The Scotsman Online)
+ Third Generation Mobile Phone Game from Nihon Enterprise (Japan Corp)
+ Comment: Free but shackled - the Java trap (Sydney Morning Herald)
+ Sun plots Java comeback (CNET Asia)
+ Veritas and BEA vow to love Java together (The Register)
+ Microsoft and Sun's settlement will yield web services benefits and support for Java (Computer Weekly)
+ Sun plots Java comeback (CNET)
+ Sun plots Java comeback (ZDNet)
+ Sun enables new wave of mobile Java services (Sunday Times South Africa)
+ Sun Releases Sun Java Studio 6 (Techfocus)
+ Sam Pitrodas Telecom Firm Sets Up India Centre (Financial Express)
+ Multi Player Mobile Gaming (BBC)
+ Combining SOAP and JavaMail (Java Pro)
+ Draw Applet (JavaBoutique)
+ IBM dedicates module to Java on mainframes (CNET)
 
+ OTN News
+ View Live Customer Webcast Demos of Enterprise Manager 10g Grid Control
+ Oracle Database 10g for Windows Now Available for Download
+ Download New Oracle 10g JDBC Drivers
+ JDeveloper 10g Reviewed in Internet.com's Java Boutique
+ Java Developer's Journal Readers Name Oracle Products "Best" in Two Categories
+ New OracleAS Portal Extension for Macromedia Dreamweaver
+ Learn from the Experts During Java Week
+ Download Oracle Database 10g
+ New OracleAS Web Cache How-To Documents
+ Learn About SQL 2003 Support in Oracle Database 10g
+ New: Quick Installation Guide for RAC on Oracle Database 10g SE (Windows)
+ Oracle Forms Diagnostic Techniques
+ Introduction to JavaServer Faces
+ Prepare for Oracle Database 10g
+ New Tutorial: Learn JSP 2.0
+ Learn Best Practices for Consolidating Oracle on Linux Deployments
+ What's New in PL/SQL in Oracle Database 10g?
+ New Oracle 10g JDBC Samples
+ New Tech Tip: Using HttpUnit in Oracle JDeveloper 10g
+ Oracle 10g Supports Microsoft Windows Media Streaming Services and Windows Media File Format (ASF)
+ New Books at Oracle 10g Book Center
+ Tech Tip: Using JSTL SQL in Oracle JDeveloper 10g Preview
+ New Technical Article Series: The Hitchhiker's Guide to PHP
+ New Enterprise Manager 10g Grid Control Hands-on Tutorial
+ OC4J 10g (10.0.3) Developer Preview 2 Now Available
+ Download the New Oracle JDeveloper Application Migration Assistant (AMA) Search Rules for WebLogic Migrations
+ Learn Oracle in 2 Days
+ Download the new Oracle XDK 10g Production Release
+ Explore New JDBC 10g How-To's
+ New Oracle 10g JDBC Sample: CachedRowSet
+ New RowSet Implementation Tutorial Series
+ Download 2003 ODTUG Conference Papers
+ New Tutorial: Understanding TLD Caching in JSPs
+ Deploy the New J2EE 1.4 Adventure Builder Reference Application to OC4J
+ Download New Servlet Advanced Sample Applications
+ New: Oracle XDK 10g Unicode Support and XSLT Extension Sample App
+ New Oracle Application Server ProcessConnect End-to-End Samples
DBPrism at SourceForge
Built with Cocoon2
CMS
 
DBPrism CMS News Feed from Moreover.com

News Feed from Moreover.com (TM) are built by a simple Java Stored Procedure that selects the news from two tables, these tables are populated by a database job that connects to Moreover web site. Here SQL description for these tables:

CREATE TABLE NEWS_CATEGORIES
 (
  id                         VARCHAR2(10),
  lang                       VARCHAR2(32),
  title                      VARCHAR2(4000),
  CONSTRAINT news_category_pk PRIMARY KEY (id)
 )
CREATE TABLE NEWS_ARTICLES
 (
  art_cat_id                    VARCHAR2(10) NOT NULL,
  lang                          VARCHAR2(32),
  id                            VARCHAR2(10) NOT NULL,
  url                           VARCHAR2(4000),
  headline_text                 VARCHAR2(4000),
  source                        VARCHAR2(255),
  media_type                    VARCHAR2(255),
  m_cluster                       VARCHAR2(255),
  tagline                       VARCHAR2(255),
  document_url                  VARCHAR2(4000),
  harvest_time                  VARCHAR2(255),
  access_registration           VARCHAR2(255),
  access_status                 VARCHAR2(255),
  CONSTRAINT article_pk PRIMARY KEY (id),
  CONSTRAINT article_category_fk FOREIGN KEY (art_cat_id)
      REFERENCES NEWS_CATEGORIES(id)
 )

An anonymous PLSQL block is used for uploading the news and invalidating the content using the External Cache Invalidator Server. Here the code:

create or replace procedure UploadNews(category VARCHAR2) as
  jobId BINARY_INTEGER;
  par cache.cache_parameters;
begin
  -- Uncomment these lines if your server is behind a firewall
  --cmsNews.setSystemProperty('proxySet','true');
  --cmsNews.setSystemProperty('proxyHost','proxy.unicen.edu.ar');
  --cmsNews.setSystemProperty('proxyPort','8080');
  cmsNews.doImport(category);

/* invalidate Cocoon's sitemap entry:
   <map:match pattern="content/news.xml">
    <map:generate type="db" src="/cms/cmsNews.list">
        <map:parameter name="Cache-Control" value="External"/>
        <map:parameter name="category" value="Java news"/>
    </map:generate>
    <map:serialize/>
   </map:match>
 */
  par.num_vals := 1;
  par.names(1) := 'category';
  par.vals(1) := category;
  cache.invalidate('cachehost',8888,'/cms/','cmsNews.list',par);
end UploadNews;

Unlike the previous one example the news feed do not require an entry into the CMS metadata because it directly called by Cocoon content aggregation, here the definition into cocoon's sitemap.xmap file:

....
   <!-- Generates the content news with information extracted from moreover.com
   -->
   <map:match pattern="content/news.xml">
    <map:generate src="/cms/cmsNews.list">
        <map:parameter name="Cache-Control" value="External"/>
        <map:parameter name="category" value="Java news"/>
    </map:generate>
    <map:serialize/>
   </map:match>
...
   <map:match pattern="**.html">
    <map:aggregate element="document">
     <map:part src="cocoon:/header/{1}.xml"/>
     <map:part src="cocoon:/content/{1}.xml"/>
     <map:part src="cocoon:/content/news.xml"/>
    </map:aggregate>
    <map:transform type="extractor"/>
    <map:transform src="stylesheets/document2html.xsl"/>
    <map:serialize type="html"/>
   </map:match>

It means that every CMS page is composed (aggreggated into the tag document) with the content of the page metadata (header), the content as is, and the news feed, then the extractor gets the content of SVG images and finally is transformed to html with the stylesheet document2html.xsl.

OK, I will explain now step by step the CMS News Feed's code.

  public static void doList(String category)
  throws SQLException {

CMS News Feed has a main entry point called doList with only one argument category of type String which defines the category of Moreover.com news to show (for example Java News).

This stored procedure get the content of the news from the previous one tables using Oracle XML Utility.

    Connection cn = new OracleDriver().defaultConnection();
    oracle.xml.sql.query.OracleXMLQuery q =
    new oracle.xml.sql.query.OracleXMLQuery(cn,
      "select a.id as \"@id\",a.url \"@url\",a.headline_text headline_text,a.source source "+
      "from news_categories c, news_articles a "+
      "where c.title='"+category+"' and c.id=a.art_cat_id");
    q.setRowsetTag("moreovernews");
    q.setRowTag("article");
    q.useLowerCaseTagNames();
    q.setRowIdAttrName(null);

Get a default connection because it is a Java Stored Procedure and is already connected on the caller enviroment, and creates an instance of Oracle XML Query with the given select on news_categories and news_articles join.

This XML Query will return an XML result like this:

      <moreovernews>
        <article id="_29976230">
          <url>http://c.moreover.com/click/here.pl?x29976219</url>
          <headline_text>Microsoft memo: Beat Linux</headline_text>
        </article>
        <!-- more articles here ...-->
      </moreovernews>

Finally, the transformed document is sent to CMS output using DBPrism's Java XML Toolkit Procedures.

    Jxtp.prolog();
    // Adds DOM tree
    Jxtp.p(q.getXMLDOM().getDocumentElement());
    Jxtp.epilog();


Search Engine > FAQ Report > News Feed >
Last Update: 2003-08-07 09:42:43.0| webmaster@dbprism.com.ar
Search | Use AltaVista (TM) query syntax<<
Quick Links<<
(C) 2003 - DBPrism ~ DBPrism CMS | Marcelo F. Ochoa | TANDIL ~ Argentina