From 0c7f518f3ec41b6d23d7770f00d6c9b72c43c20a Mon Sep 17 00:00:00 2001 From: "Eric J. Bowersox" Date: Sat, 24 May 2003 09:40:17 +0000 Subject: [PATCH] added sidebox view, prep for sysadmin menu stuff --- conf-sso/sp/dynamo.xml | 2 +- conf/dynamo-venice.xml | 2 +- conf/venice-db-init-mysql.sql | 16 +- .../dynamo/dialog/LinkTypeField.java | 130 ++++++++ .../dynamo/dialog/StdItemFactory.java | 4 +- .../silverwrist/dynamo/iface/URLRewriter.java | 6 +- .../dynamo/servlet/URLRewriterImpl.java | 16 + .../silverwrist/venice/VeniceNamespaces.java | 8 +- .../venice/content/SideboxView.java | 287 ++++++++++++++++++ .../venice/content/StringSidebox.java | 96 ++++++ .../venice/frame/FrameAssembler.java | 21 +- .../venice/frame/FrameParameters.java | 4 +- .../com/silverwrist/venice/iface/Sidebox.java | 24 ++ .../dialogs/sysadmin/frame_laf.dlg.xml | 52 ++++ venice-data/scripts/top.js | 52 +++- venice-data/velocity/common/sideboxview.vm | 52 ++++ venice-data/velocity/frame.vm | 32 +- venice-data/velocity/stylesheets/adv_base.vm | 13 +- .../velocity/stylesheets/normal_base.vm | 22 +- 19 files changed, 805 insertions(+), 34 deletions(-) create mode 100644 src/dynamo-framework/com/silverwrist/dynamo/dialog/LinkTypeField.java create mode 100644 src/venice-base/com/silverwrist/venice/content/SideboxView.java create mode 100644 src/venice-base/com/silverwrist/venice/content/StringSidebox.java create mode 100644 src/venice-base/com/silverwrist/venice/iface/Sidebox.java create mode 100644 venice-data/dialogs/sysadmin/frame_laf.dlg.xml create mode 100644 venice-data/velocity/common/sideboxview.vm diff --git a/conf-sso/sp/dynamo.xml b/conf-sso/sp/dynamo.xml index ea723bb..a046b24 100644 --- a/conf-sso/sp/dynamo.xml +++ b/conf-sso/sp/dynamo.xml @@ -144,7 +144,7 @@ - + diff --git a/conf/dynamo-venice.xml b/conf/dynamo-venice.xml index 3be3c0f..0228f61 100644 --- a/conf/dynamo-venice.xml +++ b/conf/dynamo-venice.xml @@ -143,7 +143,7 @@ - + diff --git a/conf/venice-db-init-mysql.sql b/conf/venice-db-init-mysql.sql index 0bd0598..1bee98c 100644 --- a/conf/venice-db-init-mysql.sql +++ b/conf/venice-db-init-mysql.sql @@ -282,7 +282,8 @@ INSERT INTO namespaces (nsid, namespace) VALUES (9, 'http://www.silverwrist.com/NS/venice/2002/12/31/user.events' ), (10, 'http://www.silverwrist.com/NS/venice/2002/12/31/user.settings' ), (11, 'http://www.silverwrist.com/NS/venice/2002/12/31/user.profile' ), - (12, 'http://www.silverwrist.com/NS/venice/2003/01/03/system.mail.messages' ); + (12, 'http://www.silverwrist.com/NS/venice/2003/01/03/system.mail.messages' ), + (13, 'http://www.silverwrist.com/NS/venice/2003/05/24/system.permissions' ); # Initial global properties setup INSERT INTO globalprop (nsid, prop_name, prop_value) VALUES @@ -300,6 +301,8 @@ INSERT INTO globalprop (nsid, prop_name, prop_value) VALUES (1, 'page.icon.type', '!image/png' ), (1, 'page.favicon.url', '!venice-favicon.ico' ), (1, 'page.favicon.url.type', '!IMAGE' ), + (1, 'frontpage.title', '!My Front Page' ), + (1, 'left.bar.width', 'I120' ), (2, 'sheet.base.normal', '!stylesheets/normal_base.vm' ), (2, 'sheet.adv.normal', '!stylesheets/adv_base.vm' ), (5, 'smtp.host', '!localhost' ), @@ -312,6 +315,8 @@ INSERT INTO globalprop (nsid, prop_name, prop_value) VALUES (6, 'std.button.height', 'I24' ), (6, 'bn.cancel', '!cancel.jpg' ), (6, 'bnc.cancel', '!Cancel' ), + (6, 'bn.configure', '!configure.jpg' ), + (6, 'bnc.configure', '!Configure' ), (6, 'bn.create', '!create.jpg' ), (6, 'bnc.create', '!Create' ), (6, 'bn.i.accept', '!user_accept.jpg' ), @@ -526,7 +531,8 @@ INSERT INTO acedata (aceid, perm_nsid, perm_name) VALUES (2, 11, 'set.property' ), (2, 11, 'remove.property' ), (2, 12, 'set.property' ), - (2, 12, 'set.block' ); + (2, 12, 'set.block' ), + (2, 13, 'show.admin.menu' ); INSERT INTO ace (aceid, pri, flags) VALUES (3, 2, 0); INSERT INTO acldata (aclid, seq, aceid) VALUES (2, 1, 3); INSERT INTO acedata (aceid, perm_nsid, perm_name) VALUES @@ -567,9 +573,11 @@ INSERT INTO imagetype (typecode, nsid, name) VALUES INSERT INTO menus (menuid, menu_nsid, menu_name, title, subtitle) VALUES (1, 1, 'fixed.menu', 'About This Site', NULL); INSERT INTO menuitems (menuid, sequence, itemtype, text, linktype, link) VALUES - (1, 0, 'TEXT', 'Documentation', 'ABSOLUTE', 'TODO' ), - (1, 1, 'TEXT', 'About Venice', 'FRAME', 'about-venice.html'); + (1, 0, 'TEXT', 'Documentation', 'ABSOLUTE', 'TODO' ), + (1, 1, 'TEXT', 'About Venice', 'FRAME', 'about-venice.html'), + (1, 2, 'TEXT', 'System Administration', 'ABSOLUTE', 'TODO' ); UPDATE menuitems SET enable = 0 WHERE menuid = 1 AND sequence = 0; +UPDATE menuitems SET perm_nsid = 13, perm_name = 'show.admin.menu' WHERE menuid = 1 AND sequence = 2; # Create the user profile menu. INSERT INTO menus (menuid, menu_nsid, menu_name, title, subtitle) diff --git a/src/dynamo-framework/com/silverwrist/dynamo/dialog/LinkTypeField.java b/src/dynamo-framework/com/silverwrist/dynamo/dialog/LinkTypeField.java new file mode 100644 index 0000000..0651fa9 --- /dev/null +++ b/src/dynamo-framework/com/silverwrist/dynamo/dialog/LinkTypeField.java @@ -0,0 +1,130 @@ +/* + * The contents of this file are subject to the Mozilla Public License Version 1.1 + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at . + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is the Venice Web Communities System. + * + * The Initial Developer of the Original Code is Eric J. Bowersox , + * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are + * Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. + * + * Contributor(s): + */ +package com.silverwrist.dynamo.dialog; + +import java.io.*; +import java.util.*; +import org.w3c.dom.*; +import com.silverwrist.util.*; +import com.silverwrist.dynamo.except.*; +import com.silverwrist.dynamo.iface.*; +import com.silverwrist.dynamo.util.*; + +public class LinkTypeField extends BaseDialogField +{ + /*-------------------------------------------------------------------------------- + * Attributes + *-------------------------------------------------------------------------------- + */ + + private String m_value; + + /*-------------------------------------------------------------------------------- + * Constructors + *-------------------------------------------------------------------------------- + */ + + public LinkTypeField(Element elt) throws DialogException + { + super(false,elt); + m_value = null; + + } // end constructor + + protected LinkTypeField(LinkTypeField other) + { + super(other); + m_value = null; + + } // end constructor + + /*-------------------------------------------------------------------------------- + * Abstract implementations from class BaseDialogField + *-------------------------------------------------------------------------------- + */ + + protected void renderField(TextRenderControl control, Map render_params) + throws IOException, RenderingException + { + PrintWriter wr = control.getWriter(); + wr.write(""); + + } // end renderField + + protected void validateContents(Request r, Object data) throws ValidationException + { // don't need to validate the contents on a pick list + } // end validateContents + + public Object getValue() + { + return m_value; + + } // end getValue + + public boolean containsValue() + { + return (m_value!=null); + + } // end containsValue + + public void setValue(Object obj) + { + m_value = obj.toString(); + + } // end setValue + + public void setValueFrom(Request r) + { + RequestHelper rh = new RequestHelper(r); + m_value = rh.getParameterString(getName()); + + } // end setValueFrom + + public void reset() + { + m_value = null; + + } // return reset + + public Object clone() + { + return new LinkTypeField(this); + + } // end clone + +} // end class LinkTypeField diff --git a/src/dynamo-framework/com/silverwrist/dynamo/dialog/StdItemFactory.java b/src/dynamo-framework/com/silverwrist/dynamo/dialog/StdItemFactory.java index 1c6fffd..9f7f024 100644 --- a/src/dynamo-framework/com/silverwrist/dynamo/dialog/StdItemFactory.java +++ b/src/dynamo-framework/com/silverwrist/dynamo/dialog/StdItemFactory.java @@ -11,7 +11,7 @@ * * The Initial Developer of the Original Code is Eric J. Bowersox , * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are - * Copyright (C) 2002 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. + * Copyright (C) 2002-03 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. * * Contributor(s): */ @@ -64,6 +64,8 @@ class StdItemFactory implements DialogItemFactory return new HiddenField(elt); if (tagname.equals("int")) return new IntegerField(elt); + if (tagname.equals("linktypelist")) + return new LinkTypeField(elt); if (tagname.equals("localelist")) return new LocaleListField(elt); if (tagname.equals("password")) diff --git a/src/dynamo-framework/com/silverwrist/dynamo/iface/URLRewriter.java b/src/dynamo-framework/com/silverwrist/dynamo/iface/URLRewriter.java index 1ae7f8f..570a36f 100644 --- a/src/dynamo-framework/com/silverwrist/dynamo/iface/URLRewriter.java +++ b/src/dynamo-framework/com/silverwrist/dynamo/iface/URLRewriter.java @@ -11,16 +11,20 @@ * * The Initial Developer of the Original Code is Eric J. Bowersox , * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are - * Copyright (C) 2002 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. + * Copyright (C) 2002-03 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. * * Contributor(s): */ package com.silverwrist.dynamo.iface; +import java.util.List; + public interface URLRewriter { public String rewriteURL(String type, String url); public String rewriteRedirectURL(String type, String url); + public List getRewriteTypes(); + } // end interface URLRewriter diff --git a/src/dynamo-framework/com/silverwrist/dynamo/servlet/URLRewriterImpl.java b/src/dynamo-framework/com/silverwrist/dynamo/servlet/URLRewriterImpl.java index 801415a..c7824a1 100644 --- a/src/dynamo-framework/com/silverwrist/dynamo/servlet/URLRewriterImpl.java +++ b/src/dynamo-framework/com/silverwrist/dynamo/servlet/URLRewriterImpl.java @@ -34,6 +34,7 @@ class URLRewriterImpl implements URLRewriter private HttpServletRequest m_req; private HttpServletResponse m_resp; private Map m_rewriter_map; + private List m_type_list = null; /*-------------------------------------------------------------------------------- * Constructor @@ -85,4 +86,19 @@ class URLRewriterImpl implements URLRewriter } // end rewriteRedirectURL + public synchronized List getRewriteTypes() + { + if (m_type_list==null) + { // create the type list + ArrayList tmp = new ArrayList(m_rewriter_map.size()); + tmp.addAll(m_rewriter_map.keySet()); + Collections.sort(tmp); + m_type_list = Collections.unmodifiableList(tmp); + + } // end if + + return m_type_list; + + } // end getRewriteTypes + } // end class URLRewriterImpl diff --git a/src/venice-base/com/silverwrist/venice/VeniceNamespaces.java b/src/venice-base/com/silverwrist/venice/VeniceNamespaces.java index 119cc78..c35bac3 100644 --- a/src/venice-base/com/silverwrist/venice/VeniceNamespaces.java +++ b/src/venice-base/com/silverwrist/venice/VeniceNamespaces.java @@ -11,7 +11,7 @@ * * The Initial Developer of the Original Code is Eric J. Bowersox , * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are - * Copyright (C) 2002 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. + * Copyright (C) 2002-03 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. * * Contributor(s): */ @@ -34,9 +34,6 @@ public interface VeniceNamespaces public static final String CONTENT_LAF_NAMESPACE = "http://www.silverwrist.com/NS/venice/2002/12/28/content.look.and.feel"; - // public static final String VENICE_OBJECT_NAMESPACE = - // "http://www.silverwrist.com/NS/venice/2002/12/28/venice.objects"; - public static final String REQUEST_INFO_NAMESPACE = "http://www.silverwrist.com/NS/venice/2002/12/29/request.info"; @@ -58,4 +55,7 @@ public interface VeniceNamespaces public static final String MAIL_MESSAGES_NAMESPACE = "http://www.silverwrist.com/NS/venice/2003/01/03/system.mail.messages"; + public static final String SYSTEM_PERMS_NAMESPACE = + "http://www.silverwrist.com/NS/venice/2003/05/24/system.permissions"; + } // end interface VeniceNamespaces diff --git a/src/venice-base/com/silverwrist/venice/content/SideboxView.java b/src/venice-base/com/silverwrist/venice/content/SideboxView.java new file mode 100644 index 0000000..803109f --- /dev/null +++ b/src/venice-base/com/silverwrist/venice/content/SideboxView.java @@ -0,0 +1,287 @@ +/* + * The contents of this file are subject to the Mozilla Public License Version 1.1 + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at . + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is the Venice Web Communities System. + * + * The Initial Developer of the Original Code is Eric J. Bowersox , + * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are + * Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. + * + * Contributor(s): + */ +package com.silverwrist.venice.content; + +import java.util.*; +import com.silverwrist.dynamo.iface.*; +import com.silverwrist.dynamo.except.*; +import com.silverwrist.dynamo.velocity.VelocityRenderable; +import com.silverwrist.venice.frame.FramedContent; +import com.silverwrist.venice.iface.Sidebox; + +public class SideboxView implements FramedContent, VelocityRenderable +{ + /*-------------------------------------------------------------------------------- + * Static data members + *-------------------------------------------------------------------------------- + */ + + public static final int DEFAULT_WIDTH = 200; + public static final int DEFAULT_MARGIN = 5; + + private static final List MY_PARAMETERS; + + /*-------------------------------------------------------------------------------- + * Attributes + *-------------------------------------------------------------------------------- + */ + + private Object m_content; // page content (to left of sideboxes) + private List m_sideboxes; // list of sideboxes + private String m_configure_url = null; // configure URL + private String m_configure_url_type = null; // configure URL type + private int m_width = DEFAULT_WIDTH; // width of sideboxes + private int m_margin = DEFAULT_MARGIN; // sidebox margins + private String m_local_menu_selector = null; // local menu selector + private String m_local_title = null; // local title + private String m_local_qid = null; // local QID + + /*-------------------------------------------------------------------------------- + * Constructors + *-------------------------------------------------------------------------------- + */ + + public SideboxView(Object content) + { + m_content = content; + m_sideboxes = new ArrayList(); + + } // end constructor + + public SideboxView(Object content, Collection sideboxes) + { + m_content = content; + m_sideboxes = new ArrayList(); + addSideboxes(sideboxes); + + } // end constructor + + /*-------------------------------------------------------------------------------- + * Implementations from interface FramedContent + *-------------------------------------------------------------------------------- + */ + + public String getMenuSelector() + { + if (m_local_menu_selector!=null) + return m_local_menu_selector; + if (m_content instanceof FramedContent) + return ((FramedContent)m_content).getMenuSelector(); + else + return null; + + } // end getMenuSelector + + public String getPageTitle() + { + if (m_local_title!=null) + return m_local_title; + if (m_content instanceof FramedContent) + return ((FramedContent)m_content).getPageTitle(); + else + return "SideboxView"; + + } // end getPageTitle + + public String getPageQID() + { + if (m_local_qid!=null) + return m_local_qid; + if (m_content instanceof FramedContent) + return ((FramedContent)m_content).getPageQID(); + else + return null; + + } // end getPageQID + + /*-------------------------------------------------------------------------------- + * Implementations from interface VelocityParamSupplier + *-------------------------------------------------------------------------------- + */ + + public Object getParameter(String key) + { + if (key.equals("content")) + return m_content; + else if (key.equals("sideboxes")) + return Collections.unmodifiableList(m_sideboxes); + else if (key.equals("config_URL")) + return m_configure_url; + else if (key.equals("config_type")) + return m_configure_url_type; + else if (key.equals("width")) + return new Integer(m_width); + else if (key.equals("margins")) + return new Integer(m_margin); + else + return null; + + } // end getParameter + + public Collection getParameterNames() + { + return MY_PARAMETERS; + + } // end getParameterNames + + /*-------------------------------------------------------------------------------- + * Implementations from interface VelocityRenderable + *-------------------------------------------------------------------------------- + */ + + public String getMimeType() + { + return "text/html"; + + } // end getMimeType + + public String getTemplateName() + { + return "common/sideboxview.vm"; + + } // end getTemplateName + + /*-------------------------------------------------------------------------------- + * External operations + *-------------------------------------------------------------------------------- + */ + + public void setMenuSelector(String s) + { + m_local_menu_selector = s; + + } // end setMenuSelector + + public void setPageTitle(String s) + { + m_local_title = s; + + } // end setPageTitle + + public void setPageQID(String s) + { + m_local_qid = s; + + } // end setPageQID + + public Object getContent() + { + return m_content; + + } // end getContent + + public void setContent(Object obj) + { + m_content = obj; + + } // end setContent + + public void addSidebox(Sidebox box) + { + m_sideboxes.add(box); + + } // end addSidebox + + public void addSideboxes(Collection coll) + { + Iterator it = coll.iterator(); + while (it.hasNext()) + { // add only Sidebox instances to the list + Object obj = it.next(); + if (obj instanceof Sidebox) + m_sideboxes.add(obj); + + } // end while + + } // end addSideboxes + + public void setSideboxes(Collection coll) + { + m_sideboxes.clear(); + addSideboxes(coll); + + } // end setSideboxes + + public String getConfigureURL() + { + return m_configure_url; + + } // end getConfigureURL + + public void setConfigureURL(String s) + { + m_configure_url = s; + + } // end setConfigureURL + + public String getConfigureURLType() + { + return m_configure_url_type; + + } // end getConfigureURLType + + public void setConfigureURLType(String s) + { + m_configure_url_type = s; + + } // end setConfigureURLType + + public int getWidth() + { + return m_width; + + } // end getWidth + + public void setWidth(int w) + { + m_width = w; + + } // end setWidth + + public int getMargin() + { + return m_margin; + + } // end getMargin + + public void setMargin(int m) + { + m_margin = m; + + } // end setMargin + + /*-------------------------------------------------------------------------------- + * Static initializer + *-------------------------------------------------------------------------------- + */ + + static + { + ArrayList tmp = new ArrayList(); + tmp.add("content"); + tmp.add("sideboxes"); + tmp.add("config_URL"); + tmp.add("config_type"); + tmp.add("width"); + tmp.add("margins"); + tmp.trimToSize(); + MY_PARAMETERS = Collections.unmodifiableList(tmp); + + } // end static initializer + +} // end class SideboxView diff --git a/src/venice-base/com/silverwrist/venice/content/StringSidebox.java b/src/venice-base/com/silverwrist/venice/content/StringSidebox.java new file mode 100644 index 0000000..bfe1ce7 --- /dev/null +++ b/src/venice-base/com/silverwrist/venice/content/StringSidebox.java @@ -0,0 +1,96 @@ +/* + * The contents of this file are subject to the Mozilla Public License Version 1.1 + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at . + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is the Venice Web Communities System. + * + * The Initial Developer of the Original Code is Eric J. Bowersox , + * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are + * Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. + * + * Contributor(s): + */ +package com.silverwrist.venice.content; + +import com.silverwrist.venice.iface.Sidebox; + +public class StringSidebox implements Sidebox +{ + /*-------------------------------------------------------------------------------- + * Attributes + *-------------------------------------------------------------------------------- + */ + + private String m_title; + private String m_data; + + /*-------------------------------------------------------------------------------- + * Constructors + *-------------------------------------------------------------------------------- + */ + + public StringSidebox(String data) + { + m_title = "Sidebox"; + m_data = data; + + } // end constructor + + public StringSidebox(String data, String title) + { + m_title = title; + m_data = data; + + } // end constructor + + /*-------------------------------------------------------------------------------- + * Overrides from class Object + *-------------------------------------------------------------------------------- + */ + + public String toString() + { + return m_data; + + } // end toString + + /*-------------------------------------------------------------------------------- + * Implementations from interface Sidebox + *-------------------------------------------------------------------------------- + */ + + public String getSideboxTitle() + { + return m_title; + + } // end getSideboxTitle + + /*-------------------------------------------------------------------------------- + * External operations + *-------------------------------------------------------------------------------- + */ + + public void setSideboxTitle(String s) + { + m_title = s; + + } // end setSideboxTitle + + public String getData() + { + return m_data; + + } // end getData + + public void setData(String s) + { + m_data = s; + + } // end setData + +} // end class StringSidebox diff --git a/src/venice-base/com/silverwrist/venice/frame/FrameAssembler.java b/src/venice-base/com/silverwrist/venice/frame/FrameAssembler.java index 8e999b6..9593404 100644 --- a/src/venice-base/com/silverwrist/venice/frame/FrameAssembler.java +++ b/src/venice-base/com/silverwrist/venice/frame/FrameAssembler.java @@ -11,7 +11,7 @@ * * The Initial Developer of the Original Code is Eric J. Bowersox , * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are - * Copyright (C) 2002 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. + * Copyright (C) 2002-03 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. * * Contributor(s): */ @@ -27,6 +27,7 @@ import com.silverwrist.dynamo.RequestType; import com.silverwrist.dynamo.event.*; import com.silverwrist.dynamo.except.*; import com.silverwrist.dynamo.iface.*; +import com.silverwrist.dynamo.security.SecurityReferenceMonitor; import com.silverwrist.dynamo.util.*; import com.silverwrist.dynamo.velocity.VelocityParamSupplier; import com.silverwrist.dynamo.velocity.VelocityRendererConfig; @@ -114,8 +115,6 @@ public class FrameAssembler private static final Pattern PAT_LINEBREAK = Pattern.compile("\\r*\\n"); - private static final int[] NO_ACLS = new int[0]; - /*-------------------------------------------------------------------------------- * Attributes *-------------------------------------------------------------------------------- @@ -124,6 +123,7 @@ public class FrameAssembler private String m_name; // this object's name private ObjectProvider m_props; // global properties private ObjectProvider m_blocks; // global blocks + private SecurityReferenceMonitor m_srm; // security reference monitor private MenuProvider m_menu_prov; // menu provider private String m_frame_template; // frame template parameter private HashMap m_globals = new HashMap(); // globals fed to Velocity @@ -227,7 +227,7 @@ public class FrameAssembler logger.info("FrameAssembler initializing"); XMLLoader loader = XMLLoader.get(); - String gprops = null, name_menu = null; + String gprops = null, name_srm = null, name_menu = null; try { // verify the right node name loader.verifyNodeName(config_root,"object"); @@ -242,6 +242,7 @@ public class FrameAssembler // get the name of the menu manager foo = loader.getSubElement(config_root_h,"providers"); + name_srm = loader.getAttribute(foo,"security"); name_menu = loader.getAttribute(foo,"menu"); } // end try @@ -285,6 +286,10 @@ public class FrameAssembler m_base_params = new BaseParams(); // create base parameter object + // Get the security reference monitor. + m_srm = + (SecurityReferenceMonitor)(GetObjectUtils.getDynamoComponent(services,SecurityReferenceMonitor.class, + name_srm)); // Load the menu provider. m_menu_prov = (MenuProvider)(GetObjectUtils.getDynamoComponent(services,MenuProvider.class,name_menu)); @@ -350,9 +355,11 @@ public class FrameAssembler Boolean display_login = (Boolean)(r.getObject(SessionInfoParams.REQ_NAMESPACE, SessionInfoParams.RATTR_DISPLAY_LOGIN)); - // get the menus + // get the fixed menu + int[] acls = new int[1]; + acls[0] = m_srm.getGlobalAcl().getAclID(); MenuRenderObject fixed_menu = m_menu_prov.getLeftMenu(user,VeniceNamespaces.FRAME_LAF_NAMESPACE, - "fixed.menu",NO_ACLS); + "fixed.menu",acls); // get the footer and optionally insert line breaks String footer = (String)(m_blocks.getObject(NAMESPACE,BLOCK_FOOTER)); @@ -433,6 +440,8 @@ public class FrameAssembler tmp2.put(PARAM_FAVICON_URL,String.class); tmp.put(PARAM_FAVICON_URL_TYPE,"favicon_ltyp"); tmp2.put(PARAM_FAVICON_URL_TYPE,String.class); + tmp.put(PARAM_LEFT_BAR_WIDTH,"lbar_width"); + tmp2.put(PARAM_LEFT_BAR_WIDTH,Integer.class); PROP_TO_VELOCITY = Collections.unmodifiableMap(tmp); PROP_TO_TYPE = Collections.unmodifiableMap(tmp2); diff --git a/src/venice-base/com/silverwrist/venice/frame/FrameParameters.java b/src/venice-base/com/silverwrist/venice/frame/FrameParameters.java index b95672a..7825d41 100644 --- a/src/venice-base/com/silverwrist/venice/frame/FrameParameters.java +++ b/src/venice-base/com/silverwrist/venice/frame/FrameParameters.java @@ -11,7 +11,7 @@ * * The Initial Developer of the Original Code is Eric J. Bowersox , * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are - * Copyright (C) 2002 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. + * Copyright (C) 2002-03 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. * * Contributor(s): */ @@ -51,6 +51,8 @@ public interface FrameParameters public static final String PARAM_FAVICON_URL_TYPE = "page.favicon.url.type"; + public static final String PARAM_LEFT_BAR_WIDTH = "left.bar.width"; + public static final String BLOCK_FOOTER = "footer"; public static final int OPT_COMMENTS = 0; diff --git a/src/venice-base/com/silverwrist/venice/iface/Sidebox.java b/src/venice-base/com/silverwrist/venice/iface/Sidebox.java new file mode 100644 index 0000000..a81c62b --- /dev/null +++ b/src/venice-base/com/silverwrist/venice/iface/Sidebox.java @@ -0,0 +1,24 @@ +/* + * The contents of this file are subject to the Mozilla Public License Version 1.1 + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at . + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is the Venice Web Communities System. + * + * The Initial Developer of the Original Code is Eric J. Bowersox , + * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are + * Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. + * + * Contributor(s): + */ +package com.silverwrist.venice.iface; + +public interface Sidebox +{ + public String getSideboxTitle(); + +} // end interface Sidebox diff --git a/venice-data/dialogs/sysadmin/frame_laf.dlg.xml b/venice-data/dialogs/sysadmin/frame_laf.dlg.xml new file mode 100644 index 0000000..b8a3125 --- /dev/null +++ b/venice-data/dialogs/sysadmin/frame_laf.dlg.xml @@ -0,0 +1,52 @@ + + + + Frame Look-And-Feel Parameters + TODO +
+ + + + +
+ + + +
+ This image is displayed in the upper-left portion of the frame. +
+ + + + +
+ This is a small image file of any format used as a page icon by Mozilla and other browsers. +
+ + + +
+ This is a Microsoft-format .ICO file used by Internet Explorer. +
+ + +
diff --git a/venice-data/scripts/top.js b/venice-data/scripts/top.js index 00edcc4..ab505da 100644 --- a/venice-data/scripts/top.js +++ b/venice-data/scripts/top.js @@ -18,26 +18,60 @@ importPackage(java.util); importClass(Packages.com.silverwrist.dynamo.Namespaces); importPackage(Packages.com.silverwrist.dynamo.iface); importPackage(Packages.com.silverwrist.dynamo.util); +importClass(Packages.com.silverwrist.venice.VeniceNamespaces); +importPackage(Packages.com.silverwrist.venice.content); importPackage(Packages.com.silverwrist.venice.frame); req = bsf.lookupBean("request"); req_help = bsf.lookupBean("request_help"); +user = vlib.getUser(req); +globals = vcast.getGlobalPropertiesStore(req); -// N.B. THIS IS ALL TEMPORARY +// Create the page content. +// BEGIN TEMPORARY STUFF // Find the standard content supplier. -tmp = req_help.getRequestObject(Namespaces.DYNAMO_OBJECT_NAMESPACE,"venice-content"); -scs = vcast.queryContentBlockProvider(tmp); +scs = vcast.queryContentBlockProvider(req_help.getRequestObject(Namespaces.DYNAMO_OBJECT_NAMESPACE,"venice-content")); // Get an instance of the content block representing the page title. cblk = scs.getContentBlock("content.header"); cblk.setContentParameter("title","Content Title"); cblk.setContentParameter("subtitle","Content Subtitle"); -// Put together a list of objects to render in order. -rc = new ArrayList(); -rc.add(cblk); -rc.add("Temporary second return value"); +lipsum = "

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore " + + "et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut " + + "aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum " + + "dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui " + + "officia deserunt mollit anim id est laborum.

"; -// We're outta here. -dynamo.scriptReturn(new TempFramedContent(rc)); +// Put together a list of objects to render in order. +page_content = new ArrayList(); +page_content.add(cblk); +page_content.add(lipsum); + +// END TEMPORARY STUFF + +// Create the sidebox list. +// BEGIN TEMPORARY STUFF + +sidebox_list = new ArrayList(); +tmp = new StringSidebox("The quick brown fox jumped over the lazy dog.","Number One"); +sidebox_list.add(tmp); +tmp = new StringSidebox("
  • First
  • Second
  • Third
","List Test"); +sidebox_list.add(tmp); + +// END TEMPORARY STUFF + +// Create the master view and return it. +rc = new SideboxView(page_content,sidebox_list); +//rc.menuSelector = "top"; +rc.pageTitle = globals.getObject(VeniceNamespaces.FRAME_LAF_NAMESPACE,"frontpage.title").toString(); +rc.pageQID = "top"; +if (!(user.isAnonymous())) +{ // they only get to configure if they're logged in + rc.configureURL = "TODO"; + rc.configureURLType = "ABSOLUTE"; + +} // end if + +dynamo.scriptOutput(rc); diff --git a/venice-data/velocity/common/sideboxview.vm b/venice-data/velocity/common/sideboxview.vm new file mode 100644 index 0000000..9e7126a --- /dev/null +++ b/venice-data/velocity/common/sideboxview.vm @@ -0,0 +1,52 @@ +#* + The contents of this file are subject to the Mozilla Public License Version 1.1 + (the "License"); you may not use this file except in compliance with the License. + You may obtain a copy of the License at . + + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + WARRANTY OF ANY KIND, either express or implied. See the License for the specific + language governing rights and limitations under the License. + + The Original Code is the Venice Web Communities System. + + The Initial Developer of the Original Code is Eric J. Bowersox , + for Silverwrist Design Studios. Portions created by Eric J. Bowersox are + Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. + + Contributor(s): +*# +#* + Parameters: + content = The actual page content + sideboxes = The list of defined sideboxes + config_URL = The URL the "Configure" button should point to (may be null to omit) + config_type = The URL type of the configure URL (may be null, assumed "SERVLET" if so) + width = The width of the sideboxes + margins = The margins around the sideboxes +*# + + #comment( "BEGIN CONTENT INSIDE SIDEBOX VIEW" ) + + #comment( "END CONTENT INSIDE SIDEBOX VIEW" ) + #set( $tmp = $margins * 2 ) + #set( $fullwidth = $width + $tmp ) + +
+ #render( $content ) +
+ #comment( "BEGIN SIDEBOX LIST" ) + #foreach( $box in $sideboxes ) + + + +
#encodeHTML( $box.SideboxTitle )

+ #end + #comment( "END SIDEBOX LIST" ) + #if( $config_URL ) + #if( !$config_type ) + #set( $config_type = "SERVLET" ) + #end +
+ #button( "IMAGE" "configure" ) + #end +
diff --git a/venice-data/velocity/frame.vm b/venice-data/velocity/frame.vm index 0a6beb4..51b792f 100644 --- a/venice-data/velocity/frame.vm +++ b/venice-data/velocity/frame.vm @@ -11,10 +11,36 @@ The Initial Developer of the Original Code is Eric J. Bowersox , for Silverwrist Design Studios. Portions created by Eric J. Bowersox are - Copyright (C) 2002 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. + Copyright (C) 2002-03 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. Contributor(s): *# +#* + Parameters: + content = The framed page content + pagetitle = Title for the page within the frame + qid = Page "quick ID" + user = The current DynamoUser object + unverified = True if the current user has not had E-mail address verified + location = Current page location string + display_login = True if we should display the "Log In | Create Account" or "Log Out | Profile" links + fixed_menu = The "fixed" menu + footer_text = The text of the page footer + sitetitle = Site title (from global properties) + siteurl = URL to the site + logourl = URL to the site logo + logourltype = Linkage type for the site URL + logowidth = Width of the site logo in pixels + logoheight = Height of the site logo in pixels + flogoscale = Scaling to apply to footer logo, in percentage points + pgicon_url = URL to the Mozilla-type page icon + pgicon_ltyp = Linkage type for the Mozilla-type page icon + pgicon_mime = MIME type of the Mozilla-type page icon + favicon_url = URL to the MSIE-style FAVICON + favicon_ltyp = Linkage type of the MSIE-style FAVICON + lbar_width = Left bar width in pixels + ms_copyright_violations = True to prevent adding anti-Smart Tags META tag +*# @@ -32,7 +58,6 @@ - #comment( "BEGIN PAGE HEADER" ) @@ -86,7 +111,7 @@
- -
+ #comment( "BEGIN LEFT SIDEBAR" )
Top/community menu thingee @@ -104,7 +129,6 @@
  #comment( "PAGE FOOTER" )
diff --git a/venice-data/velocity/stylesheets/adv_base.vm b/venice-data/velocity/stylesheets/adv_base.vm index bef03da..6dcb9b1 100644 --- a/venice-data/velocity/stylesheets/adv_base.vm +++ b/venice-data/velocity/stylesheets/adv_base.vm @@ -11,7 +11,7 @@ The Initial Developer of the Original Code is Eric J. Bowersox , for Silverwrist Design Studios. Portions created by Eric J. Bowersox are - Copyright (C) 2002 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. + Copyright (C) 2002-03 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. Contributor(s): *# @@ -66,6 +66,13 @@ body td.errorhead, body td.errorbody { font-size: medium; } +body td.sideboxtop, body div.sideboxtop, body p.sideboxtop { + font-size: small; + voice-family: "\"}\""; + voice-family: inherit; + font-size: medium; + } + html>body, html>body div, html>body p, html>body th, html>body td, html>body li, html>body dd { font-size: small; /* be nice to Opera */ } @@ -94,6 +101,10 @@ html>body td.errorhead, html>body td.errorbody { font-size: medium; } +html>body td.sideboxtop, html>body div.sideboxtop, html>body p.sideboxtop { + font-size: medium; + } + ## these are styles for inline menu lists div.imenu { padding: 5px; diff --git a/venice-data/velocity/stylesheets/normal_base.vm b/venice-data/velocity/stylesheets/normal_base.vm index 5b60fd2..5dd86c3 100644 --- a/venice-data/velocity/stylesheets/normal_base.vm +++ b/venice-data/velocity/stylesheets/normal_base.vm @@ -11,7 +11,7 @@ The Initial Developer of the Original Code is Eric J. Bowersox , for Silverwrist Design Studios. Portions created by Eric J. Bowersox are - Copyright (C) 2002 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. + Copyright (C) 2002-03 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. Contributor(s): *# @@ -102,3 +102,23 @@ td.errorbody { color: #3333aa; font-weight: bold; } + +.sideboxtop { + color: #ffffff; + background-color: #6666cc; + font-size: 13px; + font-weight: bold; + } + +td.sideboxtop { + padding: 2px; + } + +.sidebox { + color: #000000; + background-color: #9999ff; + } + +td.sidebox { + padding: 2px; + }