added community home page - first step into community support
This commit is contained in:
66
venice-data/util/comm/homepage.js
Normal file
66
venice-data/util/comm/homepage.js
Normal file
@@ -0,0 +1,66 @@
|
||||
// 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):
|
||||
|
||||
importPackage(Packages.com.silverwrist.dynamo.iface);
|
||||
importPackage(Packages.com.silverwrist.dynamo.util);
|
||||
importPackage(Packages.com.silverwrist.venice.iface);
|
||||
|
||||
req = bsf.lookupBean("request");
|
||||
req_help = bsf.lookupBean("request_help");
|
||||
user = vlib.getUser(req);
|
||||
comm = vlib.getCommunity(req);
|
||||
|
||||
// Create the page content.
|
||||
// BEGIN TEMPORARY STUFF
|
||||
|
||||
// Find the standard content supplier.
|
||||
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","Home Page");
|
||||
cblk.setContentParameter("subtitle",comm.getName());
|
||||
|
||||
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>";
|
||||
|
||||
// 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.
|
||||
sideboxes = vcast.querySideboxService(req_help.getRequestObject(Namespaces.DYNAMO_OBJECT_NAMESPACE,"venice-sidebox"));
|
||||
sidebox_list = sideboxes.getSideboxes(req,VeniceNamespaces.SIDEBOX_CONTEXT_NAMESPACE,"community",comm);
|
||||
|
||||
// Create the master view and return it.
|
||||
rc = new SideboxView(page_content,sidebox_list);
|
||||
//rc.menuSelector = "community";
|
||||
rc.pageTitle = comm.getName() + ": Home";
|
||||
rc.pageQID = "community/" + comm.getAlias();
|
||||
if (!(user.isAnonymous()))
|
||||
{ // they only get to configure if they're logged in
|
||||
rc.configureURL = "TODO";
|
||||
rc.configureURLType = "SERVLET";
|
||||
|
||||
} // end if
|
||||
|
||||
dynamo.scriptOutput(rc);
|
||||
@@ -27,7 +27,7 @@
|
||||
<tr valign="middle">
|
||||
<td align="center" width="14">#bullet()</td>
|
||||
<td align="left">
|
||||
<b><a href="#formatURL( "SERVLET" "TODO" )">#encodeHTML( ${c.Name} )</a></b>
|
||||
<b><a href="#formatURL( "SERVLET" "community/${c.Alias}" )">#encodeHTML( ${c.Name} )</a></b>
|
||||
#if( ${c.isAdministrator($user)} )
|
||||
## user is administrator, include the "Host!" graphic
|
||||
<img src="#formatURL( "IMAGE" "tag_host.gif" )" alt="Host!" width="40" height="20" border="0" />
|
||||
|
||||
Reference in New Issue
Block a user