...| Home | CMS...
DBPrism Content Management System > External Cache Invalidator Server >

+ 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
 
How DBPrism CMS is integrated with Cocoon Cache System for accelerating dynamic content generation

Integration flow

  1. A client browser sent a request to DBPrism CMS like this http://localhost/dbprism/doc/Home.html, this request is routed to an Apache WebServer, for example, which is listening into the default port (80).
  2. The Apache WebServer is configured with mod_proxy to route every url starting at /dbprism/ to a Servlet container listening on the port 8888. mod_proxy rewrites the previous one url to a new url like this http://localhost:8888/dbprism/doc/Home.html.
  3. In this example an OC4J is configured with the dbprism.ear application file which defines the mount point /dbprism/ with an instance of Cocoon.
  4. OC4J pass the url to zone interpreted by Cocoon, Cocoon receives an url without the mount point (/dbprism/), that is /doc/Home.html. At this point Cocoon check for this page in his own cache and if the page is valid return the cached version, if not executes the steps 5 and 6.
  5. Based on the sitemap.xmap definition Cocoon resolves the url /doc/Home.html as a content generated by DBPrism, then DBPrism receives a request for an stored CMS page named /Home.html, note that doc was extracted because is used as DAD information (information for connecting to the database such as username, password, connect string and so on).
  6. A CMS stored procedure is executed to retrieve the specific page (/Home.html) and the page is returned to DBPrism engine, then the page returns in the inverted path passing to Cocoon (which formats the page and stores it in his Cache System), OC4J and Apache, finishing in the client browser.
  7. At this point a Content Writer (like me) writes a new version of the document /Home.xml (CMS version of /Home.html), and upload it with the CMS Upload Utility or with JDeveloper using CMS Addin utility.
  8. The table CONTENT which stores the XML document has a trigger after update which sends an http message to the Cocoon engine invalidating the cached content. The invalidation message is sent to the Container directly (not through Apache) and Cocoon routes the url /dbprism/x-dbprism-cache-invalidate to an XSP page which parses this message and contacts the DBPrism External Invalidator Server to mark the page /doc/Home.html as no longer valid. Note that the post message includes an username and password encode in a Base64 form. An example of invalidation message is showed below. After this step a new request comming from the client browser will be routed following the steps 4,5 and 6.

CMS Triggers

These triggers are implemented on webcache.sql file, the purpose of these triggers is to control the cache coherence betwen Cocoon External Cache Invalidator Server and the content of the CMS tables.

CMS_PAGES_HEADER_TRIG

This trigger is fired when a Content Writer updates information on the table PAGES which affects information on the page header, such as the author name, modification date and so on.

CREATE OR REPLACE TRIGGER CMS_PAGES_HEADER_TRIG
  AFTER UPDATE 
  of longname,comments,meta,language,deleted,printable_version,
     name,parent,path
  on pages
  for each row
   DECLARE
      par cache.cache_parameters;
   BEGIN
/* This triggers invalidate Cocoon's cms/sitemap.xmap entry:
   <map:match pattern="header/**.xml">
    <map:generate type="db" src="/header/{1}.xml">
        <map:parameter name="Cache-Control" value="External"/>
        <map:parameter name="printable" value="no"/>
        <map:parameter name="top" value="10"/>
    </map:generate>
    <map:serialize/>
   </map:match>
*/
      par.num_vals := 2;
      par.names(1) := 'printable';
      par.names(2) := 'top';
      par.vals(1) := 'no';
      par.vals(2) := '10';
      -- invalidates new neighbors
      cache.invalidate('cachehost',8888,'/header'||:new.path,'.*\.xml$',par);
      -- invalidates old neighbors including old location of this page
      if :new.path <> :old.path then
        cache.invalidate('cachehost',8888,'/header'||:old.path,'.*\.xml$',par);
      end if;
      -- register id_page,parent for post chech trigger
      pagesPak.g_id_page := :new.id_page;
      pagesPak.g_parent  := :new.parent;
      pagesPak.g_old_id_page := :old.id_page;
      pagesPak.g_old_parent  := :old.parent;
   END;
/
CREATE OR REPLACE TRIGGER CMS_PAGES_HEADER_POST_TRIG
AFTER UPDATE ON PAGES
DECLARE
  par cache.cache_parameters;
  v_name pages.name%TYPE;
  v_path pages.path%TYPE;
begin
  par.num_vals := 2;
  par.names(1) := 'printable';
  par.names(2) := 'top';
  par.vals(1) := 'no';
  par.vals(2) := '10';
  if pagesPak.g_parent is not null then
    -- invalidate new parent
    select name,path into v_name,v_path from pages where id_page=pagesPak.g_parent;
    cache.invalidate('cachehost',8888,'/header'||v_path,v_name||'\.xml$',par);
  end if;
  if pagesPak.g_old_parent is not null then
    -- invalidate old parent
    select name,path into v_name,v_path from pages where id_page=pagesPak.g_old_parent;
    cache.invalidate('cachehost',8888,'/header'||v_path,v_name||'\.xml$',par);
  end if;
end;

CMS_PAGES_CONTENT_TRIG

This trigger is fired when a Content Writer updates information on the table CONTENT. This is mainly the content that the user see, note that the triggers is asociated to the table pages, but unlike the previous one this trigger is asociated to the column current_version this column is updated when the Content Writer makes public an specific version the document.

CREATE OR REPLACE TRIGGER CMS_PAGES_CONTENT_TRIG
  AFTER UPDATE 
  of current_version
  on pages
  for each row
   DECLARE
      par cache.cache_parameters;
   BEGIN
/* This triggers invalidate Cocoon's sitemap entry:
   <map:match pattern="content/**.xml">
    <map:generate type="db" src="/content/{1}.xml">
        <map:parameter name="Cache-Control" value="External"/>
        <map:parameter name="printable" value="no"/>
        <map:parameter name="top" value="10"/>
    </map:generate>
    <map:serialize/>
   </map:match>
 */
      par.num_vals := 2;
      par.names(1) := 'printable';
      par.names(2) := 'top';
      par.vals(1) := 'no';
      par.vals(2) := '10';
      cache.invalidate('cachehost',8888,'/content'||:new.path,:new.name||'\.xml$',par);
   END;

TOPIC_INVALID_TRIG

This trigger checks the cache coherence betwen the tables which stores FAQ Topics and the dynamic service faq.doIt.

CREATE OR REPLACE TRIGGER TOPIC_INVALID_TRIG
  AFTER UPDATE on FAQ_TOPICS
   DECLARE
      par cache.cache_parameters;
   BEGIN
/* This triggers invalidate Cocoon's sitemap entry:
   <map:match pattern="content/docs/faq.xml">
    <map:generate type="db" src="/cms/faq.doIt">
        <map:parameter name="Cache-Control" value="External"/>
        <map:parameter name="ext" value="html"/>
    </map:generate>
    <map:serialize/>
   </map:match>
 */
      par.num_vals := 1;
      par.names(1) := 'ext';
      par.vals(1) := 'html';
      cache.invalidate('cachehost',8888,'/cms/','faq.doIt',par);
   END;

RELATED_I_INVALID_TRIG and RELATED_D_INVALID_TRIG

These two triggers checks the cache coherence betwen the tables which stores Related Pages and the header information affected by the change (insert/delete).

CREATE OR REPLACE TRIGGER RELATED_I_INVALID_TRIG
  AFTER INSERT on RELATED
  for each row
   DECLARE
      par cache.cache_parameters;
      v_path PAGES.PATH%TYPE;
      v_name PAGES.NAME%TYPE;
   BEGIN
/* This triggers invalidate Cocoon's cms/sitemap.xmap entry:
   <map:match pattern="header/**.xml">
    <map:generate type="db" src="/header/{1}.xml">
        <map:parameter name="Cache-Control" value="External"/>
        <map:parameter name="printable" value="no"/>
        <map:parameter name="top" value="10"/>
    </map:generate>
    <map:serialize/>
   </map:match>
   
when a new related information is stored.
 */
      par.num_vals := 2;
      par.names(1) := 'printable';
      par.names(2) := 'top';
      par.vals(1) := 'no';
      par.vals(2) := '10';
      select path,name into v_path,v_name from pages where id_page=:new.rl_id_page_from; 
      cache.invalidate('cachehost',8888,'/header'||v_path,v_name||'\.xml$',par);
   END;
/
CREATE OR REPLACE TRIGGER RELATED_D_INVALID_TRIG
  AFTER DELETE on RELATED
  for each row
   DECLARE
      par cache.cache_parameters;
      v_path PAGES.PATH%TYPE;
      v_name PAGES.NAME%TYPE;
   BEGIN
/* This triggers invalidate Cocoon's cms/sitemap.xmap entry:
   <map:match pattern="header/**.xml">
    <map:generate type="db" src="/header/{1}.xml">
        <map:parameter name="Cache-Control" value="External"/>
        <map:parameter name="printable" value="no"/>
        <map:parameter name="top" value="10"/>
    </map:generate>
    <map:serialize/>
   </map:match>
   
when a new related information is stored.
 */
      par.num_vals := 2;
      par.names(1) := 'printable';
      par.names(2) := 'top';
      par.vals(1) := 'no';
      par.vals(2) := '10';
      select path,name into v_path,v_name from pages where id_page=:old.rl_id_page_from; 
      cache.invalidate('cachehost',8888,'/header'||v_path,v_name||'\.xml$',par);
   END;



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