added sidebox view, prep for sysadmin menu stuff

This commit is contained in:
Eric J. Bowersox 2003-05-24 09:40:17 +00:00
parent f933e4f88c
commit 0c7f518f3e
19 changed files with 805 additions and 34 deletions

View File

@ -144,7 +144,7 @@
<object name="venice-frame" classname="com.silverwrist.venice.frame.FrameAssembler" priority="101">
<global-properties object="globals"/>
<providers menu="venice-menus"/>
<providers security="srm" menu="venice-menus"/>
</object>
<object name="venice-content" classname="com.silverwrist.venice.content.StandardContentSupplier" priority="100">

View File

@ -143,7 +143,7 @@
<object name="venice-frame" classname="com.silverwrist.venice.frame.FrameAssembler" priority="101">
<global-properties object="globals"/>
<providers menu="venice-menus"/>
<providers security="srm" menu="venice-menus"/>
</object>
<object name="venice-content" classname="com.silverwrist.venice.content.StandardContentSupplier" priority="100">

View File

@ -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
@ -568,8 +574,10 @@ 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, 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)

View File

@ -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 <http://www.mozilla.org/MPL/>.
*
* 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 <erbo@silcom.com>,
* 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("<select name=\"" + getName() + "\" size=\"1\"");
if (!isEnabled())
wr.write(" disabled=\"disabled\"");
wr.write(">\n");
URLRewriter rewriter = (URLRewriter)(control.queryService(URLRewriter.class));
if (rewriter!=null)
{ // get the list of possible rewrite types and add them
Iterator it = rewriter.getRewriteTypes().iterator();
while (it.hasNext())
{ // render each choice name and display value in turn
String ch = (String)(it.next());
wr.write("<option value=\"" + ch + "\"");
if (ch.equals(m_value))
wr.write(" selected=\"selected\"");
wr.write(">" + StringUtils.encodeHTML(ch) + "</option>\n");
} // end while
} // end if
wr.write("</select>");
} // 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

View File

@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* 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"))

View File

@ -11,16 +11,20 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* 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

View File

@ -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

View File

@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* 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

View File

@ -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 <http://www.mozilla.org/MPL/>.
*
* 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 <erbo@silcom.com>,
* 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

View File

@ -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 <http://www.mozilla.org/MPL/>.
*
* 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 <erbo@silcom.com>,
* 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

View File

@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* 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);

View File

@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* 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;

View File

@ -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 <http://www.mozilla.org/MPL/>.
*
* 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 <erbo@silcom.com>,
* 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

View File

@ -0,0 +1,52 @@
<?xml version="1.0"?>
<!--
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 <http://www.mozilla.org/MPL/>.
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 <erbo@silcom.com>,
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):
-->
<dialog name="frame_laf" defaultbutton="update">
<title>Frame Look-And-Feel Parameters</title>
<action>TODO</action>
<header name="bas_hdr" caption="Basic Information"/>
<text name="sitetitle" caption="Site Title" required="true" size="32" maxlength="254"/>
<text name="siteurl" caption="Site Base URL" required="true" size="32" maxlength="254"/>
<text name="template" caption="Frame Template Resource" required="true" size="32" maxlength="254"
caption2="(Do NOT change this unless you know what you are doing!)"/>
<text name="fptitle" caption="Front Page Title" required="true" size="32" maxlength="254"/>
<header name="lay_hdr" caption="Layout Information"/>
<int name="lbarwidth" caption="Left Frame Bar Width" caption2="(in pixels)" required="true" min="1" max="512"/>
<checkbox name="comments" caption="Display optional HTML comments"/>
<checkbox name="smarttags" caption="Allow Microsoft Smart Tags to display on pages" caption2="(not recommended)"/>
<header name="logo_hdr" caption="Site Logo">
This image is displayed in the upper-left portion of the frame.
</header>
<text name="logourl" caption="Site Logo URL" required="true" size="32" maxlength="254"/>
<linktypelist name="logourltype" caption="Site Logo URL Type" required="true"/>
<int name="logowidth" caption="Site Logo Width" caption2="(in pixels)" required="true" min="1" max="1024"/>
<int name="logoheight" caption="Site Logo Height" caption2="(in pixels)" required="true" min="1" max="1024"/>
<header name="icon_hdr" caption="Page Icon">
This is a small image file of any format used as a page icon by Mozilla and other browsers.
</header>
<text name="pgi_url" caption="Page Icon URL" size="32" maxlength="254"/>
<linktypelist name="pgi_urltype" caption="Page Icon URL Type"/>
<text name="pgi_mime" caption="Page Icon MIME Type" size="32" maxlength="254"/>
<header name="fav_hdr" caption="Page FavIcon">
This is a Microsoft-format .ICO file used by Internet Explorer.
</header>
<text name="fav_url" caption="FavIcon URL" size="32" maxlength="254"/>
<linktypelist name="fav_urltype" caption="FavIcon URL Type"/>
<button name="update"/>
<button name="cancel"/>
</dialog>

View File

@ -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 = "<p>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.</p>";
// 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("<ul><li>First</li><li>Second</li><li>Third</li></ul>","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);

View File

@ -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 <http://www.mozilla.org/MPL/>.
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 <erbo@silcom.com>,
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
*#
<table border="0" width="100%" align="center" cellpadding="0" cellspacing="0"><tr valign="top">
#comment( "BEGIN CONTENT INSIDE SIDEBOX VIEW" )
<td align="left" class="framecontent"><div class="framecontent">
#render( $content )
</div></td>
#comment( "END CONTENT INSIDE SIDEBOX VIEW" )
#set( $tmp = $margins * 2 )
#set( $fullwidth = $width + $tmp )
<td align="center" width="$fullwidth">
#comment( "BEGIN SIDEBOX LIST" )
#foreach( $box in $sideboxes )
<table align="center" width="$width" border="0" cellpadding="0" cellspacing="0">
<tr valign="middle"><td class="sideboxtop">#encodeHTML( $box.SideboxTitle )</td></tr>
<tr valign="top"><td class="sidebox">#render( $box )</td></tr>
</table><br />
#end
#comment( "END SIDEBOX LIST" )
#if( $config_URL )
#if( !$config_type )
#set( $config_type = "SERVLET" )
#end
<br />
<a href="#formatURL( $config_type $config_URL )">#button( "IMAGE" "configure" )</a>
#end
</td>
</tr></table>

View File

@ -11,10 +11,36 @@
The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
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
*#
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
@ -32,7 +58,6 @@
</head>
<body>
#comment( "BEGIN PAGE HEADER" )
<table class="frametop" border="0" width="100%" cellpadding="2" cellspacing="0">
<tr valign="middle">
@ -86,7 +111,7 @@
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr valign="top">
<td align="left" width="120" class="frameleft">
<td align="left" width="$lbar_width" rowspan="2" class="frameleft">
#comment( "BEGIN LEFT SIDEBAR" )
<div class="frameleft">
Top/community menu thingee
@ -104,7 +129,6 @@
</tr>
<tr valign="top">
<td align="left" width="120" class="frameleft">&nbsp;</td>
<td align="left" width="100%" bgcolor="white" class="framefooter">
#comment( "PAGE FOOTER" )
<hr width="80%">

View File

@ -11,7 +11,7 @@
The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
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;

View File

@ -11,7 +11,7 @@
The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
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;
}