added controls for Invite from the conference and topic levels
This commit is contained in:
@@ -208,8 +208,15 @@ public class CommunityOperations extends VeniceServlet
|
||||
return new ErrorBox("Community Error","You are not permitted to send an invitation.",
|
||||
"sig/" + comm.getAlias());
|
||||
|
||||
// get conference and topic parameters
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,false,"sig/" + comm.getAlias());
|
||||
TopicContext topic = null;
|
||||
if (conf!=null)
|
||||
topic = getTopicParameter(request,conf,false,
|
||||
"confops?cmd=Q&sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID());
|
||||
|
||||
// present the "Invitation" dialog
|
||||
return new Invitation(comm);
|
||||
return new Invitation(comm,conf,topic);
|
||||
|
||||
} // end if ("I" command)
|
||||
|
||||
@@ -369,6 +376,20 @@ public class CommunityOperations extends VeniceServlet
|
||||
setMyLocation(request,"sigops?cmd=I&sig=" + comm.getCommunityID());
|
||||
String on_error = "sig/" + comm.getAlias();
|
||||
|
||||
// get conference and topic parameters
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,false,on_error);
|
||||
if (conf!=null)
|
||||
on_error = "confops?cmd=Q&sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
TopicContext topic = null;
|
||||
if (conf!=null)
|
||||
{ // try and get a topic parameter
|
||||
topic = getTopicParameter(request,conf,false,on_error);
|
||||
if (topic!=null)
|
||||
on_error = "topicops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&top="
|
||||
+ topic.getTopicNumber();
|
||||
|
||||
} // end if
|
||||
|
||||
if (isImageButtonClicked(request,"cancel")) // cancel - go back to community opening page
|
||||
throw new RedirectResult(on_error);
|
||||
|
||||
@@ -376,7 +397,12 @@ public class CommunityOperations extends VeniceServlet
|
||||
{ // the "send" button was pressed
|
||||
try
|
||||
{ // send out the invitation
|
||||
comm.sendInvitation(request.getParameter("addr"),request.getParameter("pb"));
|
||||
if (topic!=null)
|
||||
topic.sendInvitation(request.getParameter("addr"),request.getParameter("pb"));
|
||||
else if (conf!=null)
|
||||
conf.sendInvitation(request.getParameter("addr"),request.getParameter("pb"));
|
||||
else
|
||||
comm.sendInvitation(request.getParameter("addr"),request.getParameter("pb"));
|
||||
|
||||
} // end try
|
||||
catch (AccessError ae)
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*/
|
||||
package com.silverwrist.venice.servlets.format;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import javax.servlet.ServletRequest;
|
||||
import com.silverwrist.util.StringUtil;
|
||||
import com.silverwrist.venice.core.*;
|
||||
@@ -37,15 +39,19 @@ public class Invitation implements JSPRender
|
||||
*/
|
||||
|
||||
private CommunityContext comm; // the community context
|
||||
private ConferenceContext conf; // the conference context
|
||||
private TopicContext topic; // the topic context
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public Invitation(CommunityContext comm)
|
||||
public Invitation(CommunityContext comm, ConferenceContext conf, TopicContext topic)
|
||||
{
|
||||
this.comm = comm;
|
||||
this.conf = conf;
|
||||
this.topic = topic;
|
||||
|
||||
} // end constructor
|
||||
|
||||
@@ -73,7 +79,16 @@ public class Invitation implements JSPRender
|
||||
|
||||
public String getPageQID()
|
||||
{
|
||||
return "sigops?cmd=I&sig=" + comm.getCommunityID();
|
||||
String rc = "sigops?cmd=I&sig=" + comm.getCommunityID();
|
||||
if (conf!=null)
|
||||
{ // add conference and topic parameters, as needed
|
||||
rc += ("&conf=" + conf.getConfID());
|
||||
if (topic!=null)
|
||||
rc += ("&top=" + topic.getTopicNumber());
|
||||
|
||||
} // end if
|
||||
|
||||
return rc;
|
||||
|
||||
} // end getPageQID
|
||||
|
||||
@@ -99,16 +114,36 @@ public class Invitation implements JSPRender
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public int getCommunityID()
|
||||
public final void writeHeader(Writer out, RenderData rdat) throws IOException
|
||||
{
|
||||
if (topic!=null)
|
||||
rdat.writeContentHeader(out,"Send Topic Invitation:",
|
||||
topic.getName() + " (in " + conf.getName() + ", in " + comm.getName() + ")");
|
||||
else if (conf!=null)
|
||||
rdat.writeContentHeader(out,"Send Conference Invitation:",
|
||||
conf.getName() + " (in " + comm.getName() + ")");
|
||||
else
|
||||
rdat.writeContentHeader(out,"Send Community Invitation:",comm.getName());
|
||||
|
||||
} // end writeHeader
|
||||
|
||||
public final int getCommunityID()
|
||||
{
|
||||
return comm.getCommunityID();
|
||||
|
||||
} // end getCommunityID
|
||||
|
||||
public String getCommunityName()
|
||||
public final String getParameters()
|
||||
{
|
||||
return comm.getName();
|
||||
String rc = "<INPUT TYPE=\"HIDDEN\" NAME=\"sig\" VALUE=\"" + comm.getCommunityID() + "\">";
|
||||
if (conf==null)
|
||||
return rc;
|
||||
rc += ("\n<INPUT TYPE=\"HIDDEN\" NAME=\"conf\" VALUE=\"" + conf.getConfID() + "\">");
|
||||
if (topic==null)
|
||||
return rc;
|
||||
rc += ("\n<INPUT TYPE=\"HIDDEN\" NAME=\"top\" VALUE=\"" + topic.getTopicNumber() + "\">");
|
||||
return rc;
|
||||
|
||||
} // end getCommunityName
|
||||
} // end getAdditionalParameters
|
||||
|
||||
} // end class Invitation
|
||||
|
||||
@@ -103,25 +103,25 @@ public class ManageConference implements JSPRender
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public int getCommunityID()
|
||||
public final int getCommunityID()
|
||||
{
|
||||
return comm.getCommunityID();
|
||||
|
||||
} // end getCommunityID
|
||||
|
||||
public int getConfID()
|
||||
public final int getConfID()
|
||||
{
|
||||
return conf.getConfID();
|
||||
|
||||
} // end getConfID
|
||||
|
||||
public String getConfName()
|
||||
public final String getConfName()
|
||||
{
|
||||
return conf.getName();
|
||||
|
||||
} // end getConfName
|
||||
|
||||
public String getLocator()
|
||||
public final String getLocator()
|
||||
{
|
||||
if (locator==null)
|
||||
locator = "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
@@ -129,13 +129,19 @@ public class ManageConference implements JSPRender
|
||||
|
||||
} // end getLocator
|
||||
|
||||
public String getDefaultPseud()
|
||||
public final String getDefaultPseud()
|
||||
{
|
||||
return conf.getDefaultPseud();
|
||||
|
||||
} // end getDefaultPseud
|
||||
|
||||
public boolean displayAdminSection()
|
||||
public final boolean displayInviteSection()
|
||||
{
|
||||
return conf.canSendInvitation();
|
||||
|
||||
} // end displayInviteSection
|
||||
|
||||
public final boolean displayAdminSection()
|
||||
{
|
||||
return conf.canChangeConference() || conf.canDeleteConference();
|
||||
|
||||
|
||||
@@ -128,31 +128,31 @@ public class ManageTopic implements JSPRender
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public int getCommunityID()
|
||||
public final int getCommunityID()
|
||||
{
|
||||
return comm.getCommunityID();
|
||||
|
||||
} // end getCommunityID
|
||||
|
||||
public int getConfID()
|
||||
public final int getConfID()
|
||||
{
|
||||
return conf.getConfID();
|
||||
|
||||
} // end getConfID
|
||||
|
||||
public int getTopicNumber()
|
||||
public final int getTopicNumber()
|
||||
{
|
||||
return topic.getTopicNumber();
|
||||
|
||||
} // end getTopicID
|
||||
|
||||
public String getTopicName()
|
||||
public final String getTopicName()
|
||||
{
|
||||
return topic.getName();
|
||||
|
||||
} // end getConfName
|
||||
|
||||
public String getLocator()
|
||||
public final String getLocator()
|
||||
{
|
||||
if (locator==null)
|
||||
locator = "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&top="
|
||||
@@ -161,22 +161,28 @@ public class ManageTopic implements JSPRender
|
||||
|
||||
} // end getLocator
|
||||
|
||||
public int getNumBozos()
|
||||
public final int getNumBozos()
|
||||
{
|
||||
return bozos_list.size();
|
||||
|
||||
} // end getNumBozos()
|
||||
|
||||
public Iterator getBozosIterator()
|
||||
public final Iterator getBozosIterator()
|
||||
{
|
||||
return bozos_list.iterator();
|
||||
|
||||
} // end getBozosIterator
|
||||
|
||||
public boolean isSubscribed()
|
||||
public final boolean isSubscribed()
|
||||
{
|
||||
return topic.isSubscribed();
|
||||
|
||||
} // end isSubscribed
|
||||
|
||||
public final boolean displayInviteSection()
|
||||
{
|
||||
return topic.canSendInvitation();
|
||||
|
||||
} // end displayInviteSection
|
||||
|
||||
} // end class ManageTopic
|
||||
|
||||
Reference in New Issue
Block a user