portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed-2/portal/src/webapp/WEB-INF/conf/ojb repository_page.xml
Date Wed, 15 Oct 2003 20:18:24 GMT
taylor      2003/10/15 13:18:24

  Modified:    portal/src/sql/hsql create-db-phase2.sql
  Added:       portal/src/webapp/WEB-INF/conf/ojb repository_page.xml
  Log:
  Started OJB impl of Page Service.
  This is a PSML replacement using a normalized database backend
  See create-db-phase2.sql for the ddl of pages, fragments
  See org.apache.jetspeed.om.page for the java interfaces
  repository_page.xml is the initial ojb mapping
  
  Revision  Changes    Path
  1.2       +58 -76    jakarta-jetspeed-2/portal/src/sql/hsql/create-db-phase2.sql
  
  Index: create-db-phase2.sql
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/sql/hsql/create-db-phase2.sql,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- create-db-phase2.sql	28 Jul 2003 23:47:53 -0000	1.1
  +++ create-db-phase2.sql	15 Oct 2003 20:18:24 -0000	1.2
  @@ -1,95 +1,77 @@
   ----------------------------------------------------------------------------
  --- PSML Roots
  +-- Page Definitions
   ----------------------------------------------------------------------------
  -CREATE TABLE PSML
  +CREATE TABLE PAGE
   (
  -    PSML_ID INTEGER NOT NULL PRIMARY KEY,
  -    NAME VARCHAR (32),
  -    PSML_TYPE SMALLINT NOT NULL,
  -    MEDIA_TYPE VARCHAR (128),
  -    LANGUAGE VARCHAR (2),
  -    COUNTRY VARCHAR (2),
  -    PAGE VARCHAR (128)
  +    PAGE_ID INTEGER NOT NULL PRIMARY KEY,
  +    ID VARCHAR(80),
  +    TITLE VARCHAR(100),
  +    DEFAULT_SKIN VARCHAR(100),
  +    DEFAULT_DECORATOR VARCHAR(100),
  +    DEFAULT_PORTLET_DECORATOR VARCHAR(100),
  +    ACL VARCHAR(80),
  +    UNIQUE(ID)
   );
   
  -ALTER TABLE PSML ADD CONSTRAINT UK_PSML UNIQUE (PSML_TYPE, NAME, MEDIA_TYPE, LANGUAGE,
COUNTRY, PAGE);
  --- CREATE INDEX IX_PSML_1 ON PSML (PSML_TYPE, NAME, MEDIA_TYPE, LANGUAGE, COUNTRY, PAGE);
  -
   ----------------------------------------------------------------------------
  --- PSML Entries
  +-- Fragments (portlets, layouts)
   ----------------------------------------------------------------------------
  -CREATE TABLE PSML_ENTRY
  +CREATE TABLE FRAGMENT
   ( 
  -    PSML_ENTRY_ID INTEGER NOT NULL PRIMARY KEY,
  -    PSML_ID INTEGER NOT NULL,
  -    ENTRY_TYPE SMALLINT NOT NULL,
  -    PARENT_ID INTEGER,
  -    PORTLET_ID INTEGER,
  -    LAYOUT_ID INTEGER,
  -    CONTROL_ID INTEGER,
  -    SKIN_ID INTEGER,
  -    SECURITY_ID INTEGER
  +    FRAGMENT_ID INTEGER NOT NULL PRIMARY KEY,
  +    ID VARCHAR(80),
  +    COMPONENT_NAME(80),
  +    ACL VARCHAR(80),
  +    TITLE VARCHAR(100),
  +    TYPE VARCHAR(40),
  +    SKIN VARCHAR(80),
  +    DECORATOR VARCHAR(80),
  +    STATE VARCHAR(40),
  +    UNIQUE(ID)
  +);
  +                                
  +-- associates a page with its top level fragments
  +CREATE TABLE PAGE_FRAGMENTS
  +(
  +    PAGE_ID INTEGER NOT NULL,
  +    FRAGMENT_ID INTEGER NOT NULL,    
   );
   
  -----------------------------------------------------------------------------
  --- Layout (Controller) Registry
  -----------------------------------------------------------------------------
  -CREATE TABLE LAYOUT
  -( 
  -    LAYOUT_ID INTEGER NOT NULL PRIMARY KEY,
  -    CLASSNAME VARCHAR (128),
  -    TEMPLATE VARCHAR (128),
  -    ACTION VARCHAR (128),
  -    TITLE VARCHAR (128),
  -    DESCRIPTION VARCHAR (256)
  -    -- TODO PARAMETERS
  -    -- TODO MEDIA TYPES
  - 
  +CREATE INDEX IX_PAGE_FRAGMENTS_1 ON PAGE_FRAGMENTS (PAGE_ID, FRAGMENT_ID);
  +
  +-- associates a fragment with its top level fragments
  +CREATE TABLE SUB_FRAGMENTS
  +(
  +    FRAGMENT_ID INTEGER NOT NULL,
  +    SUB_FRAGMENT_ID INTEGER NOT NULL
   );
   
  -----------------------------------------------------------------------------
  --- Control (Window) Registry
  -----------------------------------------------------------------------------
  -CREATE TABLE CONTROL
  -( 
  -    CONTROL_ID INTEGER NOT NULL PRIMARY KEY,
  -    CLASSNAME VARCHAR (128),
  -    TEMPLATE VARCHAR (128),
  -    ACTION VARCHAR (128),
  -    TITLE VARCHAR (128),
  -    DESCRIPTION VARCHAR (256)
  -    -- TODO PARAMETERS
  -    -- TODO MEDIA TYPES
  - 
  +CREATE INDEX IX_SUB_FRAGMENTS_1 ON SUB_FRAGMENTS (FRAGMENT_ID, SUBFRAGMENT_ID);
  +
  +
  +CREATE TABLE FRAGMENT_PARAMETER
  +(
  +    PARAMETER_ID INTEGER PRIMARY KEY,
  +    FRAGMENT_ID INTEGER NOT NULL,
  +    NAME VARCHAR(80) NOT NULL,
  +    VALUE LONGVARCHAR NOT NULL
   );
   
  -----------------------------------------------------------------------------
  --- Skin Registry
  -----------------------------------------------------------------------------
  -CREATE TABLE SKIN
  -( 
  -    SKIN_ID INTEGER NOT NULL PRIMARY KEY
  -    -- TODO  
  +CREATE UNIQUE INDEX IX_FRAGMENT_PARAMETER_1 ON FRAGMENT_PARAMETER (FRAGMENT_ID, PARAMETER_ID);
  +
  +-- names a reference to a fragment subtree
  +CREATE TABLE FRAGMENT_REF
  +(
  +    FRAGMENT_REF_ID INTEGER NOT NULL PRIMARY KEY,
  +    FRAGMENT_ID INTEGER NOT NULL,
  +    NAME VARCHAR(80) NOT NULL,
  +    TITLE VARCHAR(100)
   );
   
  -----------------------------------------------------------------------------
  --- Security Registry
  -----------------------------------------------------------------------------
  -CREATE TABLE SECURITY
  -( 
  -    SECURITY_ID INTEGER NOT NULL PRIMARY KEY,
  -    NAME VARCHAR (128) NOT NULL,
  -    TITLE VARCHAR (128),
  -    DESCRIPTION VARCHAR (256)
  -    -- TODO ACCESS ACTIONS
  -    -- TODO ALLOW IF CONSTRAINTS (ROLE, USER, GROUP, OWNER)
  +CREATE TABLE FRAGMENT_REFS
  +(
  +    FRAGMENT_REF_ID INTEGER NOT NULL,
  +    FRAGMENT_ID INTEGER NOT NULL
   );
   
  -CREATE INDEX IX_PSML_ENTRY_1 ON PSML_ENTRY (PSML_ID, PARENT_ID);
  -ALTER TABLE PSML_ENTRY ADD CONSTRAINT FK_PSML_ENTRY_1 FOREIGN KEY (PSML_ID) REFERENCES
PSML (PSML_ID) ON DELETE CASCADE;
  -ALTER TABLE PSML_ENTRY ADD CONSTRAINT FK_PSML_ENTRY_2 FOREIGN KEY (PARENT_ID) REFERENCES
PSML_ENTRY (PSML_ENTRY_ID) ON DELETE CASCADE;
  --- ALTER TABLE PSML_ENTRY ADD CONSTRAINT FK_PSML_ENTRY_3 FOREIGN KEY (LAYOUT_ID) REFERENCES
LAYOUT (LAYOUT_ID) ON DELETE SET NULL;
  --- ALTER TABLE PSML_ENTRY ADD CONSTRAINT FK_PSML_ENTRY_4 FOREIGN KEY (CONTROL_ID) REFERENCES
CONTROL (CONTROL_ID) ON DELETE SET NULL;
  --- ALTER TABLE PSML_ENTRY ADD CONSTRAINT FK_PSML_ENTRY_5 FOREIGN KEY (SKIN_ID) REFERENCES
SKIN (SKIN_ID) ON DELETE SET NULL;
  --- ALTER TABLE PSML_ENTRY ADD CONSTRAINT FK_PSML_ENTRY_6 FOREIGN KEY (SECURITY_ID) REFERENCES
SKIN (SECURITY_ID) ON DELETE SET NULL;
   
  
  
  
  1.1                  jakarta-jetspeed-2/portal/src/webapp/WEB-INF/conf/ojb/repository_page.xml
  
  Index: repository_page.xml
  ===================================================================
  <!--
     - P A G E
  -->	
   
    <class-descriptor
     	  class="org.apache.jetspeed.om.page.impl.ojb.PageImpl"
     	  table="PAGE"
     >     
        <field-descriptor
           name="pageId"
           column="PAGE_ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"         
        />
        <field-descriptor
           name="id"
           column="ID"
           jdbc-type="VARCHAR"
        />
        <field-descriptor
           name="title"
           column="TITLE"
           jdbc-type="VARCHAR"
        />
        <field-descriptor
           name="defaultSkin"
           column="DEFAULT_SKIN"
           jdbc-type="VARCHAR"
        />
        <field-descriptor
           name="defaultDecorator"
           column="DEFAULT_DECORATOR"
           jdbc-type="VARCHAR"
        /> 
        <field-descriptor
           name="defaultPortletDecorator"
           column="DEFAULT_PORTLET_DECORATOR"
           jdbc-type="VARCHAR"
        /> 
        <field-descriptor
           name="acl"
           column="ACL"
           jdbc-type="VARCHAR"
        />              
        <collection-descriptor
        	  name="pageFragments" 
            element-class-ref="org.apache.jetspeed.om.page.impl.ojb.FragmentImpl" 
            indirection-table="PAGE_FRAGMENTS">
            <fk-pointing-to-this-class column="PAGE_ID"/>
            <fk-pointing-to-element-class column="FRAGMENT_ID"/>
         </collection-descriptor>              
     </class-descriptor>
     
  <!--
     - F R A G M E N T
  -->	
   
    <class-descriptor
     	  class="org.apache.jetspeed.om.page.impl.ojb.FragmentImpl"
     	  table="FRAGMENT"
     >     
        <field-descriptor
           name="fragmentId"
           column="FRAGMENT_ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"         
        />
        <field-descriptor
           name="id"
           column="ID"
           jdbc-type="VARCHAR"
        />
        <field-descriptor
           name="title"
           column="TITLE"
           jdbc-type="VARCHAR"
        />
        <field-descriptor
           name="component"
           column="Component"
           jdbc-type="VARCHAR"
        />
        <field-descriptor
           name="Skin"
           column="SKIN"
           jdbc-type="VARCHAR"
        />
        <field-descriptor
           name="decorator"
           column="DECORATOR"
           jdbc-type="VARCHAR"
        /> 
        <field-descriptor
           name="acl"
           column="ACL"
           jdbc-type="VARCHAR"
        />              
        <field-descriptor
           name="type"
           column="TYPE"
           jdbc-type="VARCHAR"
        />              
        <field-descriptor
           name="state"
           column="STATE"
           jdbc-type="VARCHAR"
        />              
  
          <collection-descriptor
        	  name="subFragments" 
            element-class-ref="org.apache.jetspeed.om.page.impl.ojb.FragmentImpl" 
            indirection-table="FRAGMENTS">
            <fk-pointing-to-this-class column="FRAGMENT_ID"/>
            <fk-pointing-to-element-class column="SUB_FRAGMENT_ID"/>
         </collection-descriptor>              
              
     </class-descriptor>
  
     
        
        
    
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message