null
if the parameter was not set.
+ */
+ public Object getParameter(String key)
+ {
+ return m_params.get(key);
+
+ } // end getParameter
+
+ /**
+ * Returns a java.util.Collection
of all parameter names currently defined on this object.
+ *
+ * @return A collection of all parameter names currently defined.
+ */
+ public Collection getParameterNames()
+ {
+ return Collections.unmodifiableSet(m_params.keySet());
+
+ } // end getParameterNames
+
+ /*====================================================================
+ * Implementations from interface VelocityRenderable
+ *====================================================================
+ */
+
+ /**
+ * Returns the MIME type of the output to be rendered. Usually, this will be "text/html".
+ *
+ * @return The MIME type of the output.
+ */
+ public String getMimeType()
+ {
+ return "text/html";
+
+ } // end getMimeType
+
+ /**
+ * Returns the resource name of the Velocity template to be used in rendering this object. This pathname
+ * is interpreted relative to the "resource root path" specified in the Velocity renderer's configuration.
+ * The template engine loads it via the standard
+ * {@link com.silverwrist.dynamo.iface.ResourceProvider ResourceProvider}, and then applies the parameters
+ * contained in this object to it.
+ *
+ * @return The resource pathname of the Velocity template to use.
+ */
+ public String getTemplateName()
+ {
+ return m_props.getObject(VeniceNamespaces.CONTENT_LAF_NAMESPACE,"velocity.template").toString();
+
+ } // end getTemplateName
+
+ } // end class MyBox
+
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private ObjectProvider m_props; // properties provider
+
+ /*--------------------------------------------------------------------------------
+ * Constructor
+ *--------------------------------------------------------------------------------
+ */
+
+ CommunityListSidebox(ObjectProvider properties)
+ {
+ m_props = properties;
+
+ } // end constructor
+
+ /*--------------------------------------------------------------------------------
+ * Implementations from interface SideboxFactory
+ *--------------------------------------------------------------------------------
+ */
+
+ public Sidebox createSidebox(Request req) throws DynamoException
+ {
+ // Get the user associated with this request.
+ SessionInfoProvider prov = (SessionInfoProvider)(req.queryService(SessionInfoProvider.class));
+ SessionInfo session = prov.getSessionInfo();
+ DynamoUser user = (DynamoUser)(session.getObject(SessionInfoParams.NAMESPACE,SessionInfoParams.ATTR_USER));
+
+ // Get the list of the user's communities.
+ String tmp_name = m_props.getObject(VeniceNamespaces.SESSION_CONTROL_NAMESPACE,"community.provider").toString();
+ ObjectProvider op = (ObjectProvider)(req.queryService(ObjectProvider.class));
+ CommunityService commsvc = (CommunityService)(op.getObject(Namespaces.DYNAMO_OBJECT_NAMESPACE,tmp_name));
+ List communities = commsvc.getMemberCommunities(user,user);
+
+ // Determine whether the user can actually create a community.
+ tmp_name = m_props.getObject(VeniceNamespaces.SESSION_CONTROL_NAMESPACE,"security.provider").toString();
+ SecurityReferenceMonitor srm = (SecurityReferenceMonitor)(op.getObject(Namespaces.DYNAMO_OBJECT_NAMESPACE,
+ tmp_name));
+ boolean can_create = false;
+ if (user.equals(srm.getAdminUser()))
+ can_create = true;
+ else
+ can_create = srm.getGlobalAcl().testPermission(user,VeniceNamespaces.COMMUNITY_PERMS_NAMESPACE,"create.new");
+
+ // We now have all the info we need to create the sidebox.
+ return new MyBox(user,communities,can_create);
+
+ } // end createSidebox
+
+} // end class CommunityListSidebox
diff --git a/src/venice-base/com/silverwrist/venice/sidebox/SideboxManager.java b/src/venice-base/com/silverwrist/venice/sidebox/SideboxManager.java
index 03672ec..42aa78e 100644
--- a/src/venice-base/com/silverwrist/venice/sidebox/SideboxManager.java
+++ b/src/venice-base/com/silverwrist/venice/sidebox/SideboxManager.java
@@ -155,6 +155,7 @@ public class SideboxManager implements NamedObject, ComponentInitialize, Compone
m_pk_to_fact = new ReferenceMap(ReferenceMap.HARD,ReferenceMap.SOFT);
m_id_to_type = new ReferenceMap(ReferenceMap.HARD,ReferenceMap.SOFT);
m_id_to_name = new ReferenceMap(ReferenceMap.HARD,ReferenceMap.SOFT);
+ m_ns_to_tf.put(StandardSideboxes.NAMESPACE,new StandardSideboxes());
m_ns_to_tf.put(TestSideboxes.NAMESPACE,new TestSideboxes());
} // end constructor
diff --git a/src/venice-base/com/silverwrist/venice/sidebox/SideboxMessages.properties b/src/venice-base/com/silverwrist/venice/sidebox/SideboxMessages.properties
index 09ba8c8..3bc18f8 100644
--- a/src/venice-base/com/silverwrist/venice/sidebox/SideboxMessages.properties
+++ b/src/venice-base/com/silverwrist/venice/sidebox/SideboxMessages.properties
@@ -22,3 +22,5 @@ no.sbtype=Unable to find sidebox type factory for type namespace {0}, name {1}.
sbox.not.in.list=The sidebox with ID #{0} does not exist in the current list.
sbox.already.in.list=The sidebox with ID #{0} already exists in the current list.
sbox.impermissible=The sidebox with ID #{0} is not permitted in the current list.
+std.badNamespace=The standard sidebox factory was called with an invalid type namespace "{0}."
+std.badName=The standard sidebox factory was called with an invalid type name "{0}."
diff --git a/src/venice-base/com/silverwrist/venice/sidebox/StandardSideboxes.java b/src/venice-base/com/silverwrist/venice/sidebox/StandardSideboxes.java
new file mode 100644
index 0000000..c8fd768
--- /dev/null
+++ b/src/venice-base/com/silverwrist/venice/sidebox/StandardSideboxes.java
@@ -0,0 +1,70 @@
+/*
+ * 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 #bullet() | ++ #encodeHTML( ${c.Name} ) + #if( ${c.isAdministrator($user)} ) + ## user is administrator, include the "Host!" graphic + + #end + | +
You are not a member of any communities.
+#end + +#if( !${user.isAnonymous()} ) +