added controls for Invite from the conference and topic levels
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user