added the Sidebox Manager code for the generation of sideboxes on the front
page and the eventual community front pages
This commit is contained in:
@@ -164,6 +164,10 @@
|
||||
|
||||
<object name="venice-auditor" classname="com.silverwrist.venice.app.StartupShutdownAuditor" priority="100"/>
|
||||
|
||||
<object name="venice-sidebox" classname="com.silverwrist.venice.sidebox.SideboxManager" priority="100">
|
||||
<database connection="data" namespaces="nscache"/>
|
||||
</object>
|
||||
|
||||
<object name="categories" classname="com.silverwrist.venice.community.CategoryManager" priority="100">
|
||||
<database connection="data"/>
|
||||
</object>
|
||||
|
||||
@@ -306,6 +306,47 @@ CREATE TABLE commprops (
|
||||
PRIMARY KEY (cid, nsid, prop_name)
|
||||
);
|
||||
|
||||
# The master table of sideboxes.
|
||||
CREATE TABLE sbox_master (
|
||||
sbid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, # sidebox identifier
|
||||
sb_nsid INT NOT NULL, # namespace ID of the sidebox
|
||||
sb_name VARCHAR(255) BINARY NOT NULL, # name of the sidebox
|
||||
type_nsid INT NOT NULL, # namespace ID of the type of the sidebox
|
||||
type_name VARCHAR(255) BINARY NOT NULL, # name of the type of the sidebox
|
||||
descr TINYTEXT NOT NULL, # description of the sidebox
|
||||
UNIQUE INDEX by_name (sb_nsid, sb_name)
|
||||
);
|
||||
|
||||
# This table indicates in what contexts a sidebox may be used.
|
||||
CREATE TABLE sbox_context (
|
||||
sbid INT NOT NULL, # sidebox identifier
|
||||
ctx_nsid INT NOT NULL, # namespace ID of the context
|
||||
ctx_name VARCHAR(128) BINARY NOT NULL, # name of the context
|
||||
PRIMARY KEY (sbid, ctx_nsid, ctx_name),
|
||||
UNIQUE INDEX by_ctx (ctx_nsid, ctx_name, sbid)
|
||||
);
|
||||
|
||||
# Properties to be applied to sideboxes when they are created.
|
||||
CREATE TABLE sbox_props (
|
||||
sbid INT NOT NULL, # sidebox identifier
|
||||
nsid INT NOT NULL, # property namespace identifier
|
||||
prop_name VARCHAR(255) BINARY NOT NULL, # property name
|
||||
prop_value VARCHAR(255), # property value
|
||||
PRIMARY KEY (sbid, nsid, prop_name)
|
||||
);
|
||||
|
||||
# Sidebox deployment table.
|
||||
CREATE TABLE sbox_deploy (
|
||||
uid INT NOT NULL, # user ID
|
||||
ctx_nsid INT NOT NULL, # namespace ID of the context
|
||||
ctx_name VARCHAR(128) BINARY NOT NULL, # name of the context
|
||||
param VARCHAR(255), # context parameter (property serialized)
|
||||
seq INT NOT NULL, # sequence counter
|
||||
sbid INT NOT NULL, # sidebox ID
|
||||
UNIQUE INDEX by_seq (uid, ctx_nsid, ctx_name, param, seq),
|
||||
UNIQUE INDEX by_sbid (uid, ctx_nsid, ctx_name, param, sbid)
|
||||
);
|
||||
|
||||
##############################################################################
|
||||
# Set table access rights
|
||||
##############################################################################
|
||||
@@ -339,7 +380,9 @@ INSERT INTO namespaces (nsid, namespace) VALUES
|
||||
(13, 'http://www.silverwrist.com/NS/venice/2003/05/24/system.permissions' ),
|
||||
(14, 'http://www.silverwrist.com/NS/venice/2003/05/28/community.permissions'),
|
||||
(15, 'http://www.silverwrist.com/NS/venice/2003/05/29/community.profile' ),
|
||||
(16, 'http://www.silverwrist.com/NS/venice/2003/05/30/community.globals' );
|
||||
(16, 'http://www.silverwrist.com/NS/venice/2003/05/30/community.globals' ),
|
||||
(17, 'http://www.silverwrist.com/NS/venice/2003/05/31/sidebox.context.ids' ),
|
||||
(18, 'http://www.silverwrist.com/NS/venice/2003/05/31/test.sideboxes' );
|
||||
|
||||
# Initial global properties setup
|
||||
INSERT INTO globalprop (nsid, prop_name, prop_value) VALUES
|
||||
@@ -1138,3 +1181,17 @@ INSERT INTO menuitems (menuid, sequence, itemtype, text, linktype, link) VALUES
|
||||
(4, 1, 'TEXT', 'Users', 'SERVLET', 'find_users.js.vs' ),
|
||||
(4, 2, 'TEXT', 'Categories', 'SERVLET', 'find_categories.js.vs' );
|
||||
UPDATE menuitems SET ifdef_var = 'use_categories' WHERE menuid = 4 AND sequence = 2;
|
||||
|
||||
# Create the sideboxes tables.
|
||||
INSERT INTO sbox_master (sbid, sb_nsid, sb_name, type_nsid, type_name, descr) VALUES
|
||||
(1, 18, 'test1', 18, 'test', 'Test Sidebox #1'),
|
||||
(2, 18, 'test2', 18, 'test', 'Test Sidebox #2');
|
||||
INSERT INTO sbox_context (sbid, ctx_nsid, ctx_name) VALUES
|
||||
(1, 17, 'top'),
|
||||
(2, 17, 'top');
|
||||
|
||||
INSERT INTO sbox_deploy (uid, ctx_nsid, ctx_name, param, seq, sbid) VALUES
|
||||
(1, 17, 'top', NULL, 0, 1),
|
||||
(1, 17, 'top', NULL, 1, 2),
|
||||
(2, 17, 'top', NULL, 0, 1),
|
||||
(2, 17, 'top', NULL, 1, 2);
|
||||
|
||||
Reference in New Issue
Block a user