THE GREAT RENAMING! All that was "SIG" should now be "community," except for

the database and the URLs (for backward compatibility).  Do a full rebuild
after browsing this one!
This commit is contained in:
Eric J. Bowersox
2001-11-07 08:43:09 +00:00
parent fe352efbd1
commit dde12bdf2e
131 changed files with 2573 additions and 2503 deletions

View File

@@ -58,12 +58,12 @@ public class Attachment extends VeniceServlet
UserContext user, RenderData rdat)
throws ServletException, IOException, VeniceServletResult
{
// get the SIG
SIGContext sig = getSIGParameter(request,user,true,"top");
changeMenuSIG(request,sig);
// get the community
CommunityContext comm = getCommunityParameter(request,user,true,"top");
changeMenuCommunity(request,comm);
// get the conference
ConferenceContext conf = getConferenceParameter(request,sig,true,"top");
ConferenceContext conf = getConferenceParameter(request,comm,true,"top");
// get the message we want to use
TopicMessageContext msg = getMessageParameter(request,conf,true,"top");
@@ -125,14 +125,14 @@ public class Attachment extends VeniceServlet
} // end if
// get the SIG
SIGContext sig = getSIGParameter(mphandler,user,true,"top");
// get the community
CommunityContext comm = getCommunityParameter(mphandler,user,true,"top");
if (logger.isDebugEnabled())
logger.debug("SIG param: #" + sig.getSIGID());
changeMenuSIG(request,sig);
logger.debug("community param: #" + comm.getCommunityID());
changeMenuCommunity(request,comm);
// get the conference
ConferenceContext conf = getConferenceParameter(mphandler,sig,true,"top");
ConferenceContext conf = getConferenceParameter(mphandler,comm,true,"top");
if (logger.isDebugEnabled())
logger.debug("Conference param: #" + conf.getConfID());

View File

@@ -27,56 +27,56 @@ import com.silverwrist.venice.ValidationException;
import com.silverwrist.venice.core.*;
import com.silverwrist.venice.servlets.format.*;
public class SIGAdmin extends VeniceServlet
public class CommunityAdmin extends VeniceServlet
{
/*--------------------------------------------------------------------------------
* Static data members
*--------------------------------------------------------------------------------
*/
private static final String DELETE_CONFIRM_ATTR = "servlets.SIGAdmin.delete.confirm";
private static final String DELETE_CONFIRM_ATTR = "servlets.CommunityAdmin.delete.confirm";
private static final String DELETE_CONFIRM_PARAM = "confirm";
private static Category logger = Category.getInstance(SIGAdmin.class.getName());
private static Category logger = Category.getInstance(CommunityAdmin.class);
/*--------------------------------------------------------------------------------
* Internal functions
*--------------------------------------------------------------------------------
*/
private SIGAdminTop makeSIGAdminTop() throws ServletException
private CommunityAdminTop makeCommunityAdminTop() throws ServletException
{
final String desired_name = "SIGAdminTop";
final String desired_name = "CommunityAdminTop";
MenuPanelCache cache = MenuPanelCache.getMenuPanelCache(getServletContext());
if (!(cache.isCached(desired_name)))
{ // create a template and save it off
SIGAdminTop template = new SIGAdminTop();
CommunityAdminTop template = new CommunityAdminTop();
cache.saveTemplate(template);
} // end if
// return a new copy
return (SIGAdminTop)(cache.getNewMenuPanel(desired_name));
return (CommunityAdminTop)(cache.getNewMenuPanel(desired_name));
} // end makeSIGAdminTop
} // end makeCommunityAdminTop
private EditSIGProfileDialog makeEditSIGProfileDialog() throws ServletException
private EditCommunityProfileDialog makeEditCommunityProfileDialog() throws ServletException
{
final String desired_name = "EditSIGProfileDialog";
final String desired_name = "EditCommunityProfileDialog";
DialogCache cache = DialogCache.getDialogCache(getServletContext());
if (!(cache.isCached(desired_name)))
{ // create a template and save it off
EditSIGProfileDialog template = new EditSIGProfileDialog(getCountryList(),getLanguageList());
EditCommunityProfileDialog template = new EditCommunityProfileDialog(getCountryList(),getLanguageList());
cache.saveTemplate(template);
} // end if
// return a new copy
return (EditSIGProfileDialog)(cache.getNewDialog(desired_name));
return (EditCommunityProfileDialog)(cache.getNewDialog(desired_name));
} // end makeEditSIGProfileDialog
} // end makeEditCommunityProfileDialog
/*--------------------------------------------------------------------------------
* Overrides from class HttpServlet
@@ -85,7 +85,7 @@ public class SIGAdmin extends VeniceServlet
public String getServletInfo()
{
String rc = "SIGAdmin servlet - Administrative functions for SIGs\n"
String rc = "CommunityAdmin servlet - Administrative functions for communities\n"
+ "Part of the Venice Web Communities System\n";
return rc;
@@ -100,47 +100,50 @@ public class SIGAdmin extends VeniceServlet
UserContext user, RenderData rdat)
throws ServletException, IOException, VeniceServletResult
{
// get the SIG context
SIGContext sig = getSIGParameter(request,user,true,"top");
changeMenuSIG(request,sig);
// get the community context
CommunityContext comm = getCommunityParameter(request,user,true,"top");
changeMenuCommunity(request,comm);
setMyLocation(request,"sigadmin?" + request.getQueryString());
String on_error = "sigadmin?sig=" + sig.getSIGID();
String on_error = "sigadmin?sig=" + comm.getCommunityID();
if (logger.isDebugEnabled())
logger.debug("SIGAdmin/doGet operating on SIG \"" + sig.getName() + "\" (" + sig.getSIGID() + ")");
logger.debug("CommunityAdmin/doGet operating on community \"" + comm.getName() + "\" ("
+ comm.getCommunityID() + ")");
// now decide what to do based on the "cmd" parameter
String cmd = getStandardCommandParam(request);
if (logger.isDebugEnabled())
logger.debug("SIGAdmin/doGet command value = " + cmd);
logger.debug("CommunityAdmin/doGet command value = " + cmd);
if (cmd.equals("P"))
{ // "P" = "Edit Profile"
if (!(sig.canModifyProfile()))
if (!(comm.canModifyProfile()))
{ // no access - sorry, dude
logger.error("tried to call up SIG profile screen without access...naughty naughty!");
return new ErrorBox("Unauthorized","You do not have access to modify this SIG's profile.",on_error);
logger.error("tried to call up community profile screen without access...naughty naughty!");
return new ErrorBox("Unauthorized","You do not have access to modify this community's profile.",
on_error);
} // end if
// construct the edit profile dialog and load it up for use
EditSIGProfileDialog dlg = makeEditSIGProfileDialog();
EditCommunityProfileDialog dlg = makeEditCommunityProfileDialog();
try
{ // load the values for this dialog
dlg.setupDialog(engine,sig);
dlg.setupDialog(engine,comm);
} // end try
catch (DataException de)
{ // we could not load the values because of a data exception
logger.error("DB error loading SIG profile: " + de.getMessage(),de);
logger.error("DB error loading community profile: " + de.getMessage(),de);
return new ErrorBox("Database Error","Database error retrieving profile: " + de.getMessage(),on_error);
} // end catch
catch (AccessError ae)
{ // we don't have enough privilege
logger.error("Access error loading SIG profile: " + ae.getMessage(),ae);
return new ErrorBox("Unauthorized","You do not have access to modify this SIG's profile.",on_error);
logger.error("Access error loading community profile: " + ae.getMessage(),ae);
return new ErrorBox("Unauthorized","You do not have access to modify this community's profile.",
on_error);
} // end catch
@@ -150,10 +153,11 @@ public class SIGAdmin extends VeniceServlet
if (cmd.equals("T"))
{ // "T" = "Set Category"
if (!(sig.canModifyProfile()))
if (!(comm.canModifyProfile()))
{ // no access - sorry man
logger.error("tried to call up SIG category set screen without access...naughty naughty!");
return new ErrorBox("Unauthorized","You do not have access to modify this SIG's profile.",on_error);
logger.error("tried to call up community category set screen without access...naughty naughty!");
return new ErrorBox("Unauthorized","You do not have access to modify this community's profile.",
on_error);
} // end else
@@ -168,7 +172,7 @@ public class SIGAdmin extends VeniceServlet
throw new NumberFormatException(); // dump the category if it's not valid
// change the category ID
sig.setCategoryID(catid);
comm.setCategoryID(catid);
} // end try
catch (NumberFormatException nfe)
@@ -177,14 +181,15 @@ public class SIGAdmin extends VeniceServlet
} // end catch
catch (DataException de)
{ // unable to update the SIG properly
logger.error("DB error updating SIG: " + de.getMessage(),de);
return new ErrorBox("Database Error","Database error updating SIG: " + de.getMessage(),on_error);
{ // unable to update the community properly
logger.error("DB error updating community: " + de.getMessage(),de);
return new ErrorBox("Database Error","Database error updating community: " + de.getMessage(),
on_error);
} // end catch
catch (AccessError ae)
{ // database access error - display an error box
logger.error("Access error updating SIG: " + ae.getMessage(),ae);
logger.error("Access error updating community: " + ae.getMessage(),ae);
return new ErrorBox("Access Error",ae.getMessage(),on_error);
} // end catch
@@ -200,7 +205,7 @@ public class SIGAdmin extends VeniceServlet
p = request.getParameter("go");
int curr_catid;
if (StringUtil.isStringEmpty(p))
curr_catid = sig.getCategoryID();
curr_catid = comm.getCategoryID();
else
curr_catid = Integer.parseInt(p);
@@ -208,7 +213,7 @@ public class SIGAdmin extends VeniceServlet
throw new NumberFormatException(); // dump the category if it's not valid
// create the browser panel and let it rip
return new SIGCategoryBrowseData(user,sig,curr_catid);
return new CommunityCategoryBrowseData(user,comm,curr_catid);
} // end try
catch (NumberFormatException nfe)
@@ -230,24 +235,25 @@ public class SIGAdmin extends VeniceServlet
if (cmd.equals("M"))
{ // "M" = Set Membership
if (!(sig.canModifyProfile()))
if (!(comm.canModifyProfile()))
{ // no access - sorry man
logger.error("tried to call up membership set screen without access...naughty naughty!");
return new ErrorBox("Unauthorized","You do not have access to modify this SIG's membership.",on_error);
return new ErrorBox("Unauthorized","You do not have access to modify this community's membership.",
on_error);
} // end else
try
{ // display the conference member list!
SIGMembership m = new SIGMembership(engine,sig);
m.doSIGMemberList();
setMyLocation(request,"sigadmin?sig=" + sig.getSIGID() + "&cmd=M");
CommunityMembership m = new CommunityMembership(engine,comm);
m.doCommunityMemberList();
setMyLocation(request,"sigadmin?sig=" + comm.getCommunityID() + "&cmd=M");
return m;
} // end try
catch (DataException de)
{ // something wrong in the database
return new ErrorBox("Database Error","Database error listing SIG members: " + de.getMessage(),
return new ErrorBox("Database Error","Database error listing community members: " + de.getMessage(),
on_error);
} // end catch
@@ -273,12 +279,13 @@ public class SIGAdmin extends VeniceServlet
} // end catch
// generate the lists
List audit_list = sig.getAuditRecords(offset,engine.getNumAuditRecordsPerPage());
int audit_count = sig.getAuditRecordCount();
List audit_list = comm.getAuditRecords(offset,engine.getNumAuditRecordsPerPage());
int audit_count = comm.getAuditRecordCount();
// return the audit viewer
return new AuditDataViewer(engine,audit_list,offset,audit_count,"Audit Records for SIG \""
+ sig.getName() + "\"","sigadmin?sig=" + sig.getSIGID() + "&cmd=A&ofs=%");
return new AuditDataViewer(engine,audit_list,offset,audit_count,"Audit Records for Community \""
+ comm.getName() + "\"","sigadmin?sig=" + comm.getCommunityID()
+ "&cmd=A&ofs=%");
} // end try
catch (AccessError ae)
@@ -296,42 +303,44 @@ public class SIGAdmin extends VeniceServlet
} // end if ("A" command)
if (cmd.equals("DEL"))
{ // "DEL" = "Delete SIG" (requires a confirmation)
if (!(sig.canDelete()))
{ // we can't delete the SIG, so what are we doing here?
logger.error("you can't delete the SIG - not gonna do it, wouldn't be prudent");
return new ErrorBox("Access Error","You do not have permission to delete this SIG.",on_error);
{ // "DEL" = "Delete Community" (requires a confirmation)
if (!(comm.canDelete()))
{ // we can't delete the community, so what are we doing here?
logger.error("you can't delete the community - not gonna do it, wouldn't be prudent");
return new ErrorBox("Access Error","You do not have permission to delete this community.",on_error);
} // end if
if (ConfirmBox.isConfirmed(request,DELETE_CONFIRM_ATTR,DELETE_CONFIRM_PARAM))
{ // we are confirmed - delete the SIG!
{ // we are confirmed - delete the community!
try
{ // delete the SIG!
sig.delete();
{ // delete the community!
comm.delete();
} // end try
catch (DataException de)
{ // something wrong in the database
logger.error("Database error deleting SIG: " + de.getMessage(),de);
return new ErrorBox("Database Error","Database error deleting SIG: " + de.getMessage(),on_error);
logger.error("Database error deleting community: " + de.getMessage(),de);
return new ErrorBox("Database Error","Database error deleting community: " + de.getMessage(),
on_error);
} // end catch
catch (AccessError ae)
{ // access error changing the SIG values
logger.error("Access error deleting SIG: " + ae.getMessage(),ae);
{ // access error changing the community values
logger.error("Access error deleting community: " + ae.getMessage(),ae);
return new ErrorBox("Access Error",ae.getMessage(),on_error);
} // end catch
// the SIG is now GONE - there's noplace else to go but back to the Top page
// the community is now GONE - there's noplace else to go but back to the Top page
throw new RedirectResult("top");
} // end if
else
{ // throw up a confirm box to let the user think it over
String message = "You are about to permanently delete the \"" + sig.getName() + "\" SIG, including "
+ "all conferences and other resources it contains! Are you sure you want to do this?";
String message = "You are about to permanently delete the \"" + comm.getName() + "\" community, "
+ "including all conferences and other resources it contains! Are you sure you want "
+ "to do this?";
return new ConfirmBox(request,DELETE_CONFIRM_ATTR,DELETE_CONFIRM_PARAM,"Delete Conference",message,
on_error + "&cmd=DEL",on_error);
@@ -340,16 +349,16 @@ public class SIGAdmin extends VeniceServlet
} // end if ("DEL" command)
// all unknown requests get turned into menu display requests
if (!(sig.canAdministerSIG()))
if (!(comm.canAdministerCommunity()))
{ // no access - sorry buddy
logger.error("tried to call up SIG admin menu without access...naughty naughty!");
return new ErrorBox("Access Error","You do not have access to administer this SIG.",on_error);
logger.error("tried to call up community admin menu without access...naughty naughty!");
return new ErrorBox("Access Error","You do not have access to administer this community.",on_error);
} // end if
// create a SIG administration menu
SIGAdminTop menu = makeSIGAdminTop();
menu.setSIG(sig);
// create a community administration menu
CommunityAdminTop menu = makeCommunityAdminTop();
menu.setCommunity(comm);
return menu;
} // end doVeniceGet
@@ -358,43 +367,45 @@ public class SIGAdmin extends VeniceServlet
UserContext user, RenderData rdat)
throws ServletException, IOException, VeniceServletResult
{
// get the SIG context
SIGContext sig = getSIGParameter(request,user,true,"top");
changeMenuSIG(request,sig);
String on_error = "sigadmin?sig=" + sig.getSIGID();
// get the community context
CommunityContext comm = getCommunityParameter(request,user,true,"top");
changeMenuCommunity(request,comm);
String on_error = "sigadmin?sig=" + comm.getCommunityID();
setMyLocation(request,on_error);
if (logger.isDebugEnabled())
logger.debug("SIGAdmin/doPost operating on SIG \"" + sig.getName() + "\" (" + sig.getSIGID() + ")");
logger.debug("CommunityAdmin/doPost operating on community \"" + comm.getName() + "\" ("
+ comm.getCommunityID() + ")");
// now decide what to do based on the "cmd" parameter
String cmd = getStandardCommandParam(request);
if (logger.isDebugEnabled())
logger.debug("SIGAdmin/doPost command value = " + cmd);
logger.debug("CommunityAdmin/doPost command value = " + cmd);
if (cmd.equals("P"))
{ // "P" = "Edit Profile"
if (!(sig.canModifyProfile()))
if (!(comm.canModifyProfile()))
{ // no access - sorry, dude
logger.error("tried to call up SIG profile screen without access...naughty naughty!");
return new ErrorBox("Unauthorized","You do not have access to modify this SIG's profile.",on_error);
logger.error("tried to call up community profile screen without access...naughty naughty!");
return new ErrorBox("Unauthorized","You do not have access to modify this community's profile.",
on_error);
} // end if
// construct the edit profile dialog and load it up for use
EditSIGProfileDialog dlg = makeEditSIGProfileDialog();
dlg.setupDialogBasic(engine,sig);
EditCommunityProfileDialog dlg = makeEditCommunityProfileDialog();
dlg.setupDialogBasic(engine,comm);
if (dlg.isButtonClicked(request,"cancel"))
throw new RedirectResult(on_error); // go back - they canceled out
if (dlg.isButtonClicked(request,"update"))
{ // begin updating the SIG's contents
{ // begin updating the community's contents
dlg.loadValues(request); // do value loading now
try
{ // attempt to change the SIG profile now...
dlg.doDialog(sig);
{ // attempt to change the community profile now...
dlg.doDialog(comm);
// now jump back to the main menu
clearMenu(request);
@@ -405,18 +416,19 @@ public class SIGAdmin extends VeniceServlet
{ // simple validation exception
if (logger.isDebugEnabled())
logger.debug("validation failure: " + ve.getMessage());
dlg.resetOnError(sig,ve.getMessage() + " Please try again.");
dlg.resetOnError(comm,ve.getMessage() + " Please try again.");
} // end catch
catch (DataException de)
{ // database error updating the SIG values
logger.error("DB error updating SIG: " + de.getMessage(),de);
return new ErrorBox("Database Error","Database error updating SIG: " + de.getMessage(),on_error);
{ // database error updating the community values
logger.error("DB error updating community: " + de.getMessage(),de);
return new ErrorBox("Database Error","Database error updating community: " + de.getMessage(),
on_error);
} // end catch
catch (AccessError ae)
{ // access error changing the SIG values
logger.error("Access error updating SIG: " + ae.getMessage(),ae);
{ // access error changing the community values
logger.error("Access error updating community: " + ae.getMessage(),ae);
return new ErrorBox("Access Error",ae.getMessage(),on_error);
} // end catch
@@ -426,20 +438,21 @@ public class SIGAdmin extends VeniceServlet
} // end if ("update" pressed)
// what the hell was that button?
logger.error("no known button click on SIGAdmin.doPost, cmd=P");
logger.error("no known button click on CommunityAdmin.doPost, cmd=P");
return new ErrorBox("Internal Error","Unknown command button pressed",on_error);
} // end if ("P" command)
if (cmd.equals("M"))
{ // "M" = Modify SIG Membership
{ // "M" = Modify Community Membership
on_error += "&cmd=M";
setMyLocation(request,on_error);
if (!(sig.canModifyProfile()))
if (!(comm.canModifyProfile()))
{ // no access - sorry, dude
logger.error("tried to call up SIG membership screen without access...naughty naughty!");
return new ErrorBox("Unauthorized","You do not have access to modify this SIG's membership.",on_error);
logger.error("tried to call up community membership screen without access...naughty naughty!");
return new ErrorBox("Unauthorized","You do not have access to modify this community's membership.",
on_error);
} // end if
@@ -496,7 +509,7 @@ public class SIGAdmin extends VeniceServlet
Integer new_level = (Integer)(new_vals.get(uid));
if (new_level==null)
{ // whoops
logger.error("new SIG level not found for uid " + uid.intValue());
logger.error("new community level not found for uid " + uid.intValue());
return new ErrorBox(null,"Invalid new level parameter.",on_error);
} // end if
@@ -507,11 +520,11 @@ public class SIGAdmin extends VeniceServlet
// call down to set the membership level
if (org_level.intValue()!=new_level_x)
{ // we need to reset the SIG membership
{ // we need to reset the community membership
if (logger.isDebugEnabled())
logger.debug("resetting SIG member level for uid " + uid.intValue() + "(old = "
logger.debug("resetting community member level for uid " + uid.intValue() + "(old = "
+ org_level.intValue() + ", new = " + new_level_x + ")");
sig.setMembership(uid.intValue(),new_level_x);
comm.setMembership(uid.intValue(),new_level_x);
} // end if
@@ -520,19 +533,19 @@ public class SIGAdmin extends VeniceServlet
} // end try
catch (AccessError ae)
{ // some sort of access error - display an error dialog
logger.error("AccessError on sig.setMembership: " + ae.getMessage(),ae);
logger.error("AccessError on comm.setMembership: " + ae.getMessage(),ae);
return new ErrorBox("Access Error",ae.getMessage(),on_error);
} // end catch
catch (DataException de)
{ // database error creating the conference
logger.error("DataException on sig.setMembership: " + de.getMessage(),de);
logger.error("DataException on comm.setMembership: " + de.getMessage(),de);
return new ErrorBox("Database Error","Database error setting memberships: " + de.getMessage(),
on_error);
} // end catch
// trap back to the SIG membership display
// trap back to the community membership display
throw new RedirectResult(on_error);
} // end if ("update" clicked)
@@ -540,7 +553,7 @@ public class SIGAdmin extends VeniceServlet
if ( isImageButtonClicked(request,"search") || isImageButtonClicked(request,"previous")
|| isImageButtonClicked(request,"next"))
{ // create the new dialog box
SIGMembership m = new SIGMembership(engine,sig);
CommunityMembership m = new CommunityMembership(engine,comm);
try
{ // perform the search!
@@ -569,7 +582,7 @@ public class SIGAdmin extends VeniceServlet
} // end if (search function clicked)
// we don't know what button was pressed
logger.error("no known button click on SIGAdmin.doPost, cmd=M");
logger.error("no known button click on CommunityAdmin.doPost, cmd=M");
return new ErrorBox("Internal Error","Unknown command button pressed",on_error);
} // end if ("M" command)
@@ -579,4 +592,4 @@ public class SIGAdmin extends VeniceServlet
} // end doVenicePost
} // end class SIGAdmin
} // end class CommunityAdmin

View File

@@ -23,7 +23,7 @@ import javax.servlet.http.*;
import com.silverwrist.venice.core.*;
import com.silverwrist.venice.servlets.format.*;
public class SIGFrontEnd extends VeniceServlet
public class CommunityFrontEnd extends VeniceServlet
{
/*--------------------------------------------------------------------------------
* Overrides from class HttpServlet
@@ -32,7 +32,7 @@ public class SIGFrontEnd extends VeniceServlet
public String getServletInfo()
{
String rc = "SIGFrontEnd servlet - Redirects to the \"default feature\" of a SIG\n"
String rc = "CommunityFrontEnd servlet - Redirects to the \"default feature\" of a community\n"
+ "Part of the Venice Web Communities System\n";
return rc;
@@ -47,19 +47,19 @@ public class SIGFrontEnd extends VeniceServlet
UserContext user, RenderData rdat)
throws ServletException, IOException, VeniceServletResult
{
// get the SIG alias name from the request path info
String sigalias = request.getPathInfo().substring(1);
// get the community alias name from the request path info
String alias = request.getPathInfo().substring(1);
try
{ // get the SIG's context from the alias name
SIGContext sig = user.getSIGContext(sigalias);
{ // get the community's context from the alias name
CommunityContext comm = user.getCommunityContext(alias);
// get the default servlet from the SIG context
String def_servlet = sig.getDefaultApplet();
// get the default servlet from the community context
String def_servlet = comm.getDefaultApplet();
if (def_servlet==null)
{ // return the default servlet
changeMenuTop(request);
return new ErrorBox("Internal Error","unable to get SIG default servlet","top");
return new ErrorBox("Internal Error","unable to get community default servlet","top");
} // end if
@@ -70,10 +70,10 @@ public class SIGFrontEnd extends VeniceServlet
catch (DataException de)
{ // set up to display an ErrorBox
changeMenuTop(request);
return new ErrorBox("Database Error","Database error finding SIG: " + de.getMessage(),"top");
return new ErrorBox("Database Error","Database error finding community: " + de.getMessage(),"top");
} // end catch
} // end doVeniceGet
} // end class SIGFrontEnd
} // end class CommunityFrontEnd

View File

@@ -25,17 +25,17 @@ import com.silverwrist.venice.ValidationException;
import com.silverwrist.venice.core.*;
import com.silverwrist.venice.servlets.format.*;
public class SIGOperations extends VeniceServlet
public class CommunityOperations extends VeniceServlet
{
/*--------------------------------------------------------------------------------
* Static data members
*--------------------------------------------------------------------------------
*/
private static final String UNJOIN_CONFIRM_ATTR = "servlets.SIGOperations.unjoin.confirm";
private static final String UNJOIN_CONFIRM_ATTR = "servlets.CommunityOperations.unjoin.confirm";
private static final String UNJOIN_CONFIRM_PARAM = "confirm";
private static Category logger = Category.getInstance(SIGOperations.class.getName());
private static Category logger = Category.getInstance(CommunityOperations.class);
/*--------------------------------------------------------------------------------
* Internal functions
@@ -59,22 +59,22 @@ public class SIGOperations extends VeniceServlet
} // end makeJoinKeyDialog
private CreateSIGDialog makeCreateSIGDialog() throws ServletException
private CreateCommunityDialog makeCreateCommunityDialog() throws ServletException
{
final String desired_name = "CreateSIGDialog";
final String desired_name = "CreateCommunityDialog";
DialogCache cache = DialogCache.getDialogCache(getServletContext());
if (!(cache.isCached(desired_name)))
{ // create a template and save it off
CreateSIGDialog template = new CreateSIGDialog(getCountryList(),getLanguageList());
CreateCommunityDialog template = new CreateCommunityDialog(getCountryList(),getLanguageList());
cache.saveTemplate(template);
} // end if
// return a new copy
return (CreateSIGDialog)(cache.getNewDialog(desired_name));
return (CreateCommunityDialog)(cache.getNewDialog(desired_name));
} // end makeCreateSIGDialog
} // end makeCreateCommunityDialog
/*--------------------------------------------------------------------------------
* Overrides from class HttpServlet
@@ -83,7 +83,7 @@ public class SIGOperations extends VeniceServlet
public String getServletInfo()
{
String rc = "SIGOperations servlet - General SIG operations (join, unjoin, etc.)\n"
String rc = "CommunityOperations servlet - General community operations (join, unjoin, etc.)\n"
+ "Part of the Venice Web Communities System\n";
return rc;
@@ -103,70 +103,70 @@ public class SIGOperations extends VeniceServlet
setMyLocation(request,"sigops?" + request.getQueryString());
if (cmd.equals("J"))
{ // "J" = "Join" (requires SIG parameter)
SIGContext sig = getSIGParameter(request,user,true,"top");
{ // "J" = "Join" (requires community parameter)
CommunityContext comm = getCommunityParameter(request,user,true,"top");
if (!(sig.canJoin())) // not permitted to join!
return new ErrorBox("SIG Error","You are not permitted to join this SIG.","top");
if (!(comm.canJoin())) // not permitted to join!
return new ErrorBox("Community Error","You are not permitted to join this community.","top");
if (sig.isPublicSIG())
if (comm.isPublicCommunity())
{ // attempt to join right now! (no join key required)
try
{ // call down to join the SIG
sig.join(null);
{ // call down to join the community
comm.join(null);
// success! display the "welcome" page
clearMenu(request); // force the clear to regen the menus
changeMenuSIG(request,sig);
return new SIGWelcome(sig);
changeMenuCommunity(request,comm);
return new CommunityWelcome(comm);
} // end try
catch (AccessError ae)
{ // access error
return new ErrorBox("Access Error","Unable to join SIG: " + ae.getMessage(),"top");
return new ErrorBox("Access Error","Unable to join community: " + ae.getMessage(),"top");
} // end catch
catch (DataException de)
{ // data exception doing something
return new ErrorBox("Database Error","Database error joining SIG: " + de.getMessage(),"top");
return new ErrorBox("Database Error","Database error joining community: " + de.getMessage(),"top");
} // end catch
} // end if (public SIG)
} // end if (public community)
else
{ // we need to prompt them for the join key....
JoinKeyDialog dlg = makeJoinKeyDialog();
dlg.setupDialog(sig);
changeMenuSIG(request,sig);
dlg.setupDialog(comm);
changeMenuCommunity(request,comm);
return dlg;
} // end else (private SIG)
} // end else (private community)
} // end if ("J" command)
if (cmd.equals("U"))
{ // "U" = "Unjoin (requires SIG parameter)
SIGContext sig = getSIGParameter(request,user,true,"top");
{ // "U" = "Unjoin (requires community parameter)
CommunityContext comm = getCommunityParameter(request,user,true,"top");
if (!(sig.canUnjoin()))
return new ErrorBox("SIG Error","You cannot unjoin this SIG.","top");
if (!(comm.canUnjoin()))
return new ErrorBox("Community Error","You cannot unjoin this community.","top");
// OK, let's test for a confirmation...
if (ConfirmBox.isConfirmed(request,UNJOIN_CONFIRM_ATTR,UNJOIN_CONFIRM_PARAM))
{ // OK, if you say so, let's unjoin!
try
{ // do the unjoin now...
sig.unjoin();
comm.unjoin();
} // end try
catch (AccessError ae)
{ // access error
return new ErrorBox("Access Error","Unable to unjoin SIG: " + ae.getMessage(),"top");
return new ErrorBox("Access Error","Unable to unjoin community: " + ae.getMessage(),"top");
} // end catch
catch (DataException de)
{ // data exception doing something
return new ErrorBox("Database Error","Database error unjoining SIG: " + de.getMessage(),"top");
return new ErrorBox("Database Error","Database error unjoining community: " + de.getMessage(),"top");
} // end catch
@@ -177,21 +177,21 @@ public class SIGOperations extends VeniceServlet
} // end if
else
{ // not a proper confirmation - display the confirm box
String message = "Are you sure you want to unjoin the '" + sig.getName() + "' SIG?";
return new ConfirmBox(request,UNJOIN_CONFIRM_ATTR,UNJOIN_CONFIRM_PARAM,"Unjoining SIG",
message,"sigops?cmd=U&sig=" + sig.getSIGID(),"sig/" + sig.getAlias());
String message = "Are you sure you want to unjoin the '" + comm.getName() + "' community?";
return new ConfirmBox(request,UNJOIN_CONFIRM_ATTR,UNJOIN_CONFIRM_PARAM,"Unjoining community",
message,"sigops?cmd=U&sig=" + comm.getCommunityID(),"sig/" + comm.getAlias());
} // end else
} // end if ("U" command)
if (cmd.equals("C"))
{ // "C" - Create SIG (no parameters)
if (!(user.canCreateSIG()))
return new ErrorBox("SIG Error","You are not permitted to create SIGs.","top");
{ // "C" - Create community (no parameters)
if (!(user.canCreateCommunity()))
return new ErrorBox("Community Error","You are not permitted to create communities.","top");
// present the "Create New SIG" dialog
CreateSIGDialog dlg = makeCreateSIGDialog();
// present the "Create New Community" dialog
CreateCommunityDialog dlg = makeCreateCommunityDialog();
dlg.setupDialog(engine);
dlg.setFieldValue("language","en-US");
dlg.setFieldValue("country","US");
@@ -201,21 +201,21 @@ public class SIGOperations extends VeniceServlet
} // end if ("C" command)
if (cmd.equals("I"))
{ // "I" - Send Invitation (requires SIG parameter)
SIGContext sig = getSIGParameter(request,user,true,"top");
{ // "I" - Send Invitation (requires community parameter)
CommunityContext comm = getCommunityParameter(request,user,true,"top");
if (!(sig.canSendInvitation()))
return new ErrorBox("SIG Error","You are not permitted to send an invitation.",
"sig/" + sig.getAlias());
if (!(comm.canSendInvitation()))
return new ErrorBox("Community Error","You are not permitted to send an invitation.",
"sig/" + comm.getAlias());
// present the "Invitation" dialog
return new Invitation(sig);
return new Invitation(comm);
} // end if ("I" command)
// this is an error!
logger.error("invalid command to SIGOperations.doGet: " + cmd);
return new ErrorBox("Internal Error","Invalid command to SIGOperations.doGet","top");
logger.error("invalid command to CommunityOperations.doGet: " + cmd);
return new ErrorBox("Internal Error","Invalid command to CommunityOperations.doGet","top");
} // end doVeniceGet
@@ -228,45 +228,45 @@ public class SIGOperations extends VeniceServlet
setMyLocation(request,"sigops?cmd=" + cmd);
if (cmd.equals("J"))
{ // "J" = Join SIG (requires SIG parameter)
SIGContext sig = getSIGParameter(request,user,true,"top");
{ // "J" = Join Community (requires community parameter)
CommunityContext comm = getCommunityParameter(request,user,true,"top");
JoinKeyDialog dlg = makeJoinKeyDialog();
if (dlg.isButtonClicked(request,"cancel")) // cancel - go back to SIG opening page
throw new RedirectResult("sig/" + sig.getAlias());
if (dlg.isButtonClicked(request,"cancel")) // cancel - go back to community opening page
throw new RedirectResult("sig/" + comm.getAlias());
if (!(sig.canJoin())) // not permitted to join!
return new ErrorBox("SIG Error","You are not permitted to join this SIG.","top");
if (!(comm.canJoin())) // not permitted to join!
return new ErrorBox("Community Error","You are not permitted to join this community.","top");
if (dlg.isButtonClicked(request,"join"))
{ // OK, go join the SIG
{ // OK, go join the community
dlg.loadValues(request); // load the dialog
try
{ // attempt to join the SIG!
dlg.doDialog(sig);
{ // attempt to join the community!
dlg.doDialog(comm);
// success! display the "welcome" page
clearMenu(request); // force the clear to regen the menus
changeMenuSIG(request,sig);
return new SIGWelcome(sig);
changeMenuCommunity(request,comm);
return new CommunityWelcome(comm);
} // end try
catch (ValidationException ve)
{ // here, a validation exception causes us to recycle and retry
dlg.resetOnError(ve.getMessage() + " Please try again.");
changeMenuSIG(request,sig);
changeMenuCommunity(request,comm);
} // end catch
catch (AccessError ae)
{ // this is probably a bogus key - let them retry
dlg.resetOnError(ae.getMessage() + " Please try again.");
changeMenuSIG(request,sig);
changeMenuCommunity(request,comm);
} // end catch
catch (DataException de)
{ // database error joining something
return new ErrorBox("Database Error","Database error joining SIG: " + de.getMessage(),"top");
return new ErrorBox("Database Error","Database error joining community: " + de.getMessage(),"top");
} // end catch
@@ -275,34 +275,34 @@ public class SIGOperations extends VeniceServlet
} // end if ("join" clicked)
// error - don't know what button was clicked
logger.error("no known button click on SIGOperations.doPost, cmd=J");
logger.error("no known button click on CommunityOperations.doPost, cmd=J");
return new ErrorBox("Internal Error","Unknown command button pressed","top");
} // end if ("J" command)
if (cmd.equals("C"))
{ // "C" = Create New SIG
if (!(user.canCreateSIG()))
return new ErrorBox("SIG Error","You are not permitted to create SIGs.","top");
{ // "C" = Create New Community
if (!(user.canCreateCommunity()))
return new ErrorBox("Community Error","You are not permitted to create communities.","top");
// load the "Create SIG" dialog
CreateSIGDialog dlg = makeCreateSIGDialog();
// load the "Create Communities" dialog
CreateCommunityDialog dlg = makeCreateCommunityDialog();
dlg.setupDialog(engine);
if (dlg.isButtonClicked(request,"cancel")) // cancel - go back to top
throw new RedirectResult("top");
if (dlg.isButtonClicked(request,"create"))
{ // OK, they actually want to create the new SIG...
{ // OK, they actually want to create the new community...
dlg.loadValues(request); // load the form data
try
{ // attempt to create the SIG!
SIGContext sig = dlg.doDialog(user);
{ // attempt to create the community!
CommunityContext comm = dlg.doDialog(user);
// created successfully - display a "new SIG welcome" page
changeMenuSIG(request,sig); // display menus for the first time!
return new NewSIGWelcome(sig);
// created successfully - display a "new community welcome" page
changeMenuCommunity(request,comm); // display menus for the first time!
return new NewCommunityWelcome(comm);
} // end try
catch (ValidationException ve)
@@ -319,7 +319,7 @@ public class SIGOperations extends VeniceServlet
} // end catch
catch (DataException de)
{ // database error doing something
return new ErrorBox("Database Error","Database error creating SIG: " + de.getMessage(),"top");
return new ErrorBox("Database Error","Database error creating community: " + de.getMessage(),"top");
} // end catch
@@ -328,24 +328,24 @@ public class SIGOperations extends VeniceServlet
} // end if ("create" pressed)
// error - don't know what button was clicked
logger.error("no known button click on SIGOperations.doPost, cmd=C");
logger.error("no known button click on CommunityOperations.doPost, cmd=C");
return new ErrorBox("Internal Error","Unknown command button pressed","top");
} // end if ("C" command)
if (cmd.equals("I"))
{ // "I" = Send invitation (requires SIG parameter)
SIGContext sig = getSIGParameter(request,user,true,"top");
String on_error = "sig/" + sig.getAlias();
{ // "I" = Send invitation (requires community parameter)
CommunityContext comm = getCommunityParameter(request,user,true,"top");
String on_error = "sig/" + comm.getAlias();
if (isImageButtonClicked(request,"cancel")) // cancel - go back to SIG opening page
if (isImageButtonClicked(request,"cancel")) // cancel - go back to community opening page
throw new RedirectResult(on_error);
if (isImageButtonClicked(request,"send"))
{ // the "send" button was pressed
try
{ // send out the invitation
sig.sendInvitation(request.getParameter("addr"),request.getParameter("pb"));
comm.sendInvitation(request.getParameter("addr"),request.getParameter("pb"));
} // end try
catch (AccessError ae)
@@ -355,7 +355,8 @@ public class SIGOperations extends VeniceServlet
} // end catch
catch (DataException de)
{ // database error doing something
return new ErrorBox("Database Error","Database error creating SIG: " + de.getMessage(),on_error);
return new ErrorBox("Database Error","Database error sending invitation: " + de.getMessage(),
on_error);
} // end catch
catch (EmailException ee)
@@ -364,21 +365,21 @@ public class SIGOperations extends VeniceServlet
} // end catch
// all sent - go back to SIG profile display
// all sent - go back to community profile display
throw new RedirectResult(on_error);
} // end if ("send" pressed)
// error - don't know what button was clicked
logger.error("no known button click on SIGOperations.doPost, cmd=I");
logger.error("no known button click on CommunityOperations.doPost, cmd=I");
return new ErrorBox("Internal Error","Unknown command button pressed",on_error);
} // end if ("I" command)
// this is an error!
logger.error("invalid command to SIGOperations.doPost: " + cmd);
return new ErrorBox("Internal Error","Invalid command to SIGOperations.doPost","top");
logger.error("invalid command to CommunityOperations.doPost: " + cmd);
return new ErrorBox("Internal Error","Invalid command to CommunityOperations.doPost","top");
} // end doVenicePost
} // end class SIGOperations
} // end class CommunityOperations

View File

@@ -23,7 +23,7 @@ import javax.servlet.http.*;
import com.silverwrist.venice.core.*;
import com.silverwrist.venice.servlets.format.*;
public class SIGProfile extends VeniceServlet
public class CommunityProfile extends VeniceServlet
{
/*--------------------------------------------------------------------------------
* Overrides from class HttpServlet
@@ -32,7 +32,7 @@ public class SIGProfile extends VeniceServlet
public String getServletInfo()
{
String rc = "SIGProfile servlet - Displays the profile of a SIG\n"
String rc = "CommunityProfile servlet - Displays the profile of a community\n"
+ "Part of the Venice Web Communities System\n";
return rc;
@@ -47,22 +47,22 @@ public class SIGProfile extends VeniceServlet
UserContext user, RenderData rdat)
throws ServletException, IOException, VeniceServletResult
{
// get the SIG
SIGContext sig = getSIGParameter(request,user,true,"top");
setMyLocation(request,"sigprofile?sig=" + sig.getSIGID());
// get the community
CommunityContext comm = getCommunityParameter(request,user,true,"top");
setMyLocation(request,"sigprofile?sig=" + comm.getCommunityID());
try
{ // create the profile display
changeMenuSIG(request,sig);
return new SIGProfileData(engine,user,sig);
changeMenuCommunity(request,comm);
return new CommunityProfileData(engine,user,comm);
} // end try
catch (DataException de)
{ // in this case, we had database trouble
return new ErrorBox("Database Error","Database error accessing SIG: " + de.getMessage(),"top");
return new ErrorBox("Database Error","Database error accessing community: " + de.getMessage(),"top");
} // end catch
} // end doVeniceGet
} // end class SIGProfile
} // end class CommunityProfile

View File

@@ -340,12 +340,12 @@ public class ConfDisplay extends VeniceServlet
UserContext user, RenderData rdat)
throws ServletException, IOException, VeniceServletResult
{
// get the SIG
SIGContext sig = getSIGParameter(request,user,true,"top");
changeMenuSIG(request,sig);
// get the community
CommunityContext comm = getCommunityParameter(request,user,true,"top");
changeMenuCommunity(request,comm);
// get the conference
ConferenceContext conf = getConferenceParameter(request,sig,true,"top");
ConferenceContext conf = getConferenceParameter(request,comm,true,"top");
// get the topic, if we have it
TopicContext topic = getTopicParameter(request,conf,false,"top");
@@ -354,7 +354,7 @@ public class ConfDisplay extends VeniceServlet
{ // we're handling messages within a single topic
if (logger.isDebugEnabled())
logger.debug("MODE: display messages in topic");
String on_error = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
String on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
setMyLocation(request,on_error + "&topic=" + topic.getTopicNumber());
// if this request is restoring the number of unread posts in another topic, try to do so
@@ -369,7 +369,7 @@ public class ConfDisplay extends VeniceServlet
TopicPosts tpos = null;
try
{ // create the display
tpos = new TopicPosts(request,engine,sig,conf,topic,piv.getFirst(),piv.getLast(),read_new,show_adv);
tpos = new TopicPosts(request,engine,comm,conf,topic,piv.getFirst(),piv.getLast(),read_new,show_adv);
} // end try
catch (DataException de)
@@ -390,8 +390,8 @@ public class ConfDisplay extends VeniceServlet
{ // we're displaying the conference's topic list
if (logger.isDebugEnabled())
logger.debug("MODE: display topics in conference");
String on_error = "confops?sig=" + sig.getSIGID();
String my_location = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
String on_error = "confops?sig=" + comm.getCommunityID();
String my_location = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
boolean read_new = !(StringUtil.isStringEmpty(request.getParameter("rnm")));
if (read_new)
my_location += "&rn=1";
@@ -426,14 +426,14 @@ public class ConfDisplay extends VeniceServlet
} // end while
if (topic==null) // no suitable topic found - just create the topic listing
return new TopicListing(request,sig,conf,opts.getViewOption(conf.getConfID()),
return new TopicListing(request,comm,conf,opts.getViewOption(conf.getConfID()),
opts.getSortOption(conf.getConfID()));
// determine what the post interval is we want to display
PostInterval piv = getInterval(engine,request,topic,on_error);
// create the topic posts view
return new TopicPosts(request,engine,sig,conf,topic,piv.getFirst(),piv.getLast(),true,false);
return new TopicPosts(request,engine,comm,conf,topic,piv.getFirst(),piv.getLast(),true,false);
} // end try
catch (DataException de)
@@ -452,8 +452,8 @@ public class ConfDisplay extends VeniceServlet
{ // topic listing only...
TopicListing tl = null;
try
{ // create the topic lict
tl = new TopicListing(request,sig,conf,opts.getViewOption(conf.getConfID()),
{ // create the topic list
tl = new TopicListing(request,comm,conf,opts.getViewOption(conf.getConfID()),
opts.getSortOption(conf.getConfID()));
} // end try

View File

@@ -166,31 +166,31 @@ public class ConfOperations extends VeniceServlet
* SH = Hide/show conference from sequence manager menu
* SS = Change conference sequence from sequence manager menu
* T = Create topic (requires conference parameter)
* Other = Display list of conferences in SIG
* Other = Display list of conferences in community
*/
protected VeniceContent doVeniceGet(HttpServletRequest request, VeniceEngine engine,
UserContext user, RenderData rdat)
throws ServletException, IOException, VeniceServletResult
{
// get the SIG
SIGContext sig = getSIGParameter(request,user,true,"top");
changeMenuSIG(request,sig);
String on_error = "confops?sig=" + sig.getSIGID();
// get the community
CommunityContext comm = getCommunityParameter(request,user,true,"top");
changeMenuCommunity(request,comm);
String on_error = "confops?sig=" + comm.getCommunityID();
// get the command we want to use
String cmd = getStandardCommandParam(request);
if (cmd.equals("S"))
{ // "S" = Manage conferences sequence
if (!(sig.canManageConferences()))
return new ErrorBox("Access Error","You are not permitted to manage conferences in this SIG.",
if (!(comm.canManageConferences()))
return new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
on_error);
try
{ // display the Conference Sequence screen
setMyLocation(request,"confops?cmd=S&sig=" + sig.getSIGID());
return new ConferenceSequence(sig);
setMyLocation(request,"confops?cmd=S&sig=" + comm.getCommunityID());
return new ConferenceSequence(comm);
} // end try
catch (DataException de)
@@ -209,12 +209,12 @@ public class ConfOperations extends VeniceServlet
if (cmd.equals("SH"))
{ // "SH" = Hide/show conference (requires conference parameter)
if (!(sig.canManageConferences()))
return new ErrorBox("Access Error","You are not permitted to manage conferences in this SIG.",
if (!(comm.canManageConferences()))
return new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
on_error);
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confops?sig=" + sig.getSIGID() + "&cmd=S";
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
on_error = "confops?sig=" + comm.getCommunityID() + "&cmd=S";
if (!(conf.canChangeConference()))
return new ErrorBox("Access Error","You do not have permission to modify this conference.",on_error);
@@ -244,15 +244,15 @@ public class ConfOperations extends VeniceServlet
if (cmd.equals("SS"))
{ // "SS" = Change conference sequence (requires conference parameter)
if (!(sig.canManageConferences()))
return new ErrorBox("Access Error","You are not permitted to manage conferences in this SIG.",
if (!(comm.canManageConferences()))
return new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
on_error);
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confops?sig=" + sig.getSIGID() + "&cmd=S";
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
on_error = "confops?sig=" + comm.getCommunityID() + "&cmd=S";
// we need a second conference parameter to exchange with
ConferenceContext other_conf = getConferenceParameter(request.getParameter("oc"),sig,true,on_error);
ConferenceContext other_conf = getConferenceParameter(request.getParameter("oc"),comm,true,on_error);
if (!(conf.canChangeConference()) || !(other_conf.canChangeConference()))
return new ErrorBox("Access Error","You do not have permission to modify this conference.",on_error);
@@ -297,12 +297,12 @@ public class ConfOperations extends VeniceServlet
if (cmd.equals("SDEL"))
{ // "SDEL" = Delete conference (requires conference parameter)
if (!(sig.canManageConferences()))
return new ErrorBox("Access Error","You are not permitted to manage conferences in this SIG.",
if (!(comm.canManageConferences()))
return new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
on_error);
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confops?sig=" + sig.getSIGID() + "&cmd=S";
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
on_error = "confops?sig=" + comm.getCommunityID() + "&cmd=S";
if (!(conf.canDeleteConference()))
return new ErrorBox("Access Error","You do not have permission to delete this conference.",on_error);
@@ -335,7 +335,7 @@ public class ConfOperations extends VeniceServlet
String message = "You are about to permanently delete the \"" + conf.getName() + "\" conference! "
+ "Are you sure you want to do this?";
return new ConfirmBox(request,DELETE_CONFIRM_ATTR,DELETE_CONFIRM_PARAM,"Delete Conference",message,
"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=SDEL",
"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=SDEL",
on_error);
} // end else
@@ -344,13 +344,13 @@ public class ConfOperations extends VeniceServlet
if (cmd.equals("C"))
{ // "C" = "Create conference"
if (!(sig.canCreateConference()))
return new ErrorBox("Access Error","You are not permitted to create conferences in this SIG.",
if (!(comm.canCreateConference()))
return new ErrorBox("Access Error","You are not permitted to create conferences in this community.",
on_error);
// make the "create" dialog
CreateConferenceDialog dlg = makeCreateConferenceDialog();
dlg.setupDialog(engine,sig);
dlg.setupDialog(engine,comm);
setMyLocation(request,on_error + "&cmd=C");
return dlg;
@@ -358,32 +358,32 @@ public class ConfOperations extends VeniceServlet
if (cmd.equals("T"))
{ // "T" = "Create topic" (requires conference parameter)
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
// Create the new topic form.
NewTopicForm ntf = new NewTopicForm(sig,conf);
NewTopicForm ntf = new NewTopicForm(comm,conf);
ntf.setupNewRequest();
setMyLocation(request,"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=T");
setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=T");
return ntf;
} // end if ("T" command)
if (cmd.equals("Q"))
{ // "Q" = display Manage menu (requires conference parameter)
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
// display the "Manage Conference" display
setMyLocation(request,"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q");
return new ManageConference(sig,conf);
setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q");
return new ManageConference(comm,conf);
} // end if ("Q" command)
if (cmd.equals("FX"))
{ // "FX" = the dreaded fixseen :-) - catches up the entire conference
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
try
{ // do the fixseen operation
@@ -408,8 +408,8 @@ public class ConfOperations extends VeniceServlet
if (cmd.equals("E"))
{ // "E" = "Edit Conference Settings" (requires conference parameter)
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q";
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
if (!(conf.canChangeConference()))
return new ErrorBox("Access Error","You are not permitted to change this conference's settings.",
@@ -419,8 +419,8 @@ public class ConfOperations extends VeniceServlet
EditConferenceDialog dlg = makeEditConferenceDialog();
try
{ // set up and return the dialog
dlg.setupDialog(sig,conf);
setMyLocation(request,"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=E");
dlg.setupDialog(comm,conf);
setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=E");
return dlg;
} // end try
@@ -440,8 +440,8 @@ public class ConfOperations extends VeniceServlet
if (cmd.equals("A"))
{ // "A" = "Manage Aliases" (requires conference parameter)
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q";
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
if (!(conf.canChangeConference()))
return new ErrorBox("Access Error","You are not permitted to change this conference's aliases.",
@@ -473,8 +473,8 @@ public class ConfOperations extends VeniceServlet
// display the "Manage Conference Aliases" display
try
{ // generate the display box
setMyLocation(request,"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=A");
return new ManageConferenceAliases(sig,conf);
setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=A");
return new ManageConferenceAliases(comm,conf);
} // end try
catch (DataException de)
@@ -488,13 +488,13 @@ public class ConfOperations extends VeniceServlet
if (cmd.equals("QR"))
{ // "QR" = "Reports Menu" (requires conference parameter)
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q";
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
try
{ // display the "Conference Reports" display
setMyLocation(request,"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=QR");
return new ReportConferenceMenu(sig,conf);
setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=QR");
return new ReportConferenceMenu(comm,conf);
} // end try
catch (DataException de)
@@ -512,17 +512,17 @@ public class ConfOperations extends VeniceServlet
if (cmd.equals("RP") || cmd.equals("RR"))
{ // "RP" = "Report Posters," "RR" = "Report Readers" (requires conference parameter, optional topic)
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
TopicContext topic = getTopicParameter(request,conf,false,on_error);
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=QR";
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=QR";
try
{ // generate the listing on this page
String my_loc = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
String my_loc = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
if (topic!=null)
my_loc += ("&top=" + topic.getTopicNumber());
setMyLocation(request,my_loc + "&cmd=" + cmd);
return new ConferenceActivity(sig,conf,topic,cmd.equals("RP"));
return new ConferenceActivity(comm,conf,topic,cmd.equals("RP"));
} // end try
catch (DataException de)
@@ -541,14 +541,14 @@ public class ConfOperations extends VeniceServlet
if (cmd.equals("M"))
{ // "M" - Manage Conference Membership (requires conference parameter)
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q";
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
try
{ // display the conference member list!
ConferenceMembership m = new ConferenceMembership(engine,sig,conf);
ConferenceMembership m = new ConferenceMembership(engine,comm,conf);
m.doConferenceMemberList();
setMyLocation(request,"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=M");
setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=M");
return m;
} // end try
@@ -568,8 +568,8 @@ public class ConfOperations extends VeniceServlet
if (cmd.equals("H"))
{ // "H" = "Add Conference To Hotlist" (requires conference parameter)
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
try
{ // add to the hotlist
@@ -590,8 +590,8 @@ public class ConfOperations extends VeniceServlet
if (cmd.equals("DEL"))
{ // "DEL" = "Delete Conference (requires conference parameter)
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q";
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
if (!(conf.canDeleteConference()))
return new ErrorBox("Access Error","You do not have permission to delete this conference.",on_error);
@@ -616,7 +616,7 @@ public class ConfOperations extends VeniceServlet
} // end catch
// that's it - trap back to the main conference list
throw new RedirectResult("confops?sig=" + sig.getSIGID());
throw new RedirectResult("confops?sig=" + comm.getCommunityID());
} // end if
else
@@ -624,7 +624,7 @@ public class ConfOperations extends VeniceServlet
String message = "You are about to permanently delete the \"" + conf.getName() + "\" conference! "
+ "Are you sure you want to do this?";
return new ConfirmBox(request,DELETE_CONFIRM_ATTR,DELETE_CONFIRM_PARAM,"Delete Conference",message,
"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=DEL",
"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=DEL",
on_error);
} // end else
@@ -632,11 +632,11 @@ public class ConfOperations extends VeniceServlet
} // end if ("DEL" command)
// Any unrecognized command shows us the conference list.
on_error = "sigprofile?sig=" + sig.getSIGID();
on_error = "sigprofile?sig=" + comm.getCommunityID();
try
{ // make a conference listing
setMyLocation(request,"confops?sig=" + sig.getSIGID());
return new ConferenceListing(sig);
setMyLocation(request,"confops?sig=" + comm.getCommunityID());
return new ConferenceListing(comm);
} // end try
catch (DataException de)
@@ -656,23 +656,23 @@ public class ConfOperations extends VeniceServlet
UserContext user, RenderData rdat)
throws ServletException, IOException, VeniceServletResult
{
// get the SIG
SIGContext sig = getSIGParameter(request,user,true,"top");
changeMenuSIG(request,sig);
String on_error = "confops?sig=" + sig.getSIGID();
// get the community
CommunityContext comm = getCommunityParameter(request,user,true,"top");
changeMenuCommunity(request,comm);
String on_error = "confops?sig=" + comm.getCommunityID();
// get the command we want to use
String cmd = getStandardCommandParam(request);
if (cmd.equals("C"))
{ // "C" = "Create Conference"
if (!(sig.canCreateConference()))
return new ErrorBox("Access Error","You are not permitted to create conferences in this SIG.",
if (!(comm.canCreateConference()))
return new ErrorBox("Access Error","You are not permitted to create conferences in this community.",
on_error);
// load up the create conference dialog!
CreateConferenceDialog dlg = makeCreateConferenceDialog();
dlg.setupDialog(engine,sig);
dlg.setupDialog(engine,comm);
if (dlg.isButtonClicked(request,"cancel"))
throw new RedirectResult(on_error); // they chickened out - go back to the conference list
@@ -683,10 +683,10 @@ public class ConfOperations extends VeniceServlet
try
{ // attempt to create the conference!
ConferenceContext conf = dlg.doDialog(sig);
ConferenceContext conf = dlg.doDialog(comm);
// success! redirect to the conference's topic list
throw new RedirectResult("confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID());
throw new RedirectResult("confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID());
} // end try
catch (ValidationException ve)
@@ -719,8 +719,8 @@ public class ConfOperations extends VeniceServlet
if (cmd.equals("T"))
{ // "T" command = Create New Topic (requires conference parameter)
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
// determine what to do based on the button pressed
if (isImageButtonClicked(request,"cancel"))
@@ -728,7 +728,7 @@ public class ConfOperations extends VeniceServlet
if (isImageButtonClicked(request,"preview"))
{ // generate a preview and redisplay the form
NewTopicForm ntf = new NewTopicForm(sig,conf);
NewTopicForm ntf = new NewTopicForm(comm,conf);
try
{ // generate a preview display
@@ -747,7 +747,7 @@ public class ConfOperations extends VeniceServlet
return null; // no title or text specified - "204 No Content"
-- end removed code */
setMyLocation(request,"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=T");
setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=T");
return ntf;
} // end if ("preview" clicked)
@@ -766,7 +766,7 @@ public class ConfOperations extends VeniceServlet
if (yes.equals(request.getParameter("attach")))
{ // we need to upload an attachment for this post
setMyLocation(request,on_error);
return new AttachmentForm(sig,conf,topic.getMessage(0),on_error);
return new AttachmentForm(comm,conf,topic.getMessage(0),on_error);
} // end if
@@ -795,8 +795,8 @@ public class ConfOperations extends VeniceServlet
if (cmd.equals("P"))
{ // "P" = Set default pseud (requires conference parameter)
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
try
{ // go set the pseud!
@@ -817,8 +817,8 @@ public class ConfOperations extends VeniceServlet
if (cmd.equals("E"))
{ // "E" = "Edit Conference Settings" (requires conference parameter)
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q";
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
if (!(conf.canChangeConference()))
return new ErrorBox("Access Error","You are not permitted to change this conference's settings.",
@@ -844,7 +844,7 @@ public class ConfOperations extends VeniceServlet
} // end try
catch (ValidationException ve)
{ // validation error - throw it back to the user
dlg.resetOnError(sig,conf,ve.getMessage() + " Please try again.");
dlg.resetOnError(comm,conf,ve.getMessage() + " Please try again.");
} // end catch
catch (AccessError ae)
@@ -859,7 +859,7 @@ public class ConfOperations extends VeniceServlet
} // end catch
setMyLocation(request,"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=E");
setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=E");
return dlg; // redisplay the dialog
} // end if
@@ -868,8 +868,8 @@ public class ConfOperations extends VeniceServlet
if (cmd.equals("A"))
{ // "A" = "Add Alias" (requires conference parameter)
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q";
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
if (!(conf.canChangeConference()))
return new ErrorBox("Access Error","You are not permitted to change this conference's settings.",
@@ -879,7 +879,7 @@ public class ConfOperations extends VeniceServlet
if (StringUtil.isStringEmpty(new_alias))
return null; // this is a no-op
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=A";
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=A";
String error_message = null;
if (IDUtils.isValidVeniceID(new_alias))
@@ -909,13 +909,13 @@ public class ConfOperations extends VeniceServlet
try
{ // generate the display box
setMyLocation(request,on_error);
return new ManageConferenceAliases(sig,conf);
return new ManageConferenceAliases(comm,conf);
} // end try
catch (DataException de)
{ // error generating the display box
return new ErrorBox("Database Error","Database error displaying aliases: " + de.getMessage(),
"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q");
"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q");
} // end catch
@@ -923,8 +923,8 @@ public class ConfOperations extends VeniceServlet
if (cmd.equals("M"))
{ // "M" - Manage Conference Membership (requires conference parameter)
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=M";
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=M";
if (isImageButtonClicked(request,"update"))
{ // the "update" command that changes all the security levels
@@ -1004,7 +1004,7 @@ public class ConfOperations extends VeniceServlet
if ( isImageButtonClicked(request,"search") || isImageButtonClicked(request,"previous")
|| isImageButtonClicked(request,"next"))
{ // create the new dialog box
ConferenceMembership m = new ConferenceMembership(engine,sig,conf);
ConferenceMembership m = new ConferenceMembership(engine,comm,conf);
try
{ // perform the search!

View File

@@ -126,7 +126,7 @@ public class Find extends VeniceServlet
// figure out the category ID parameter
int cat = -1;
if (disp==FindData.FD_SIGS)
if (disp==FindData.FD_COMMUNITIES)
cat = getCategoryParam(engine,request);
try

View File

@@ -81,17 +81,17 @@ public class PostMessage extends VeniceServlet
UserContext user, RenderData rdat)
throws ServletException, IOException, VeniceServletResult
{
// get the SIG
SIGContext sig = getSIGParameter(request,user,true,"top");
changeMenuSIG(request,sig);
// get the community
CommunityContext comm = getCommunityParameter(request,user,true,"top");
changeMenuCommunity(request,comm);
// get the conference
ConferenceContext conf = getConferenceParameter(request,sig,true,"top");
ConferenceContext conf = getConferenceParameter(request,comm,true,"top");
// get the topic
TopicContext topic = getTopicParameter(request,conf,true,"top");
String on_error = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&top="
String on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&top="
+ topic.getTopicNumber();
if (isImageButtonClicked(request,"cancel"))
@@ -110,7 +110,7 @@ public class PostMessage extends VeniceServlet
final String yes = "Y";
if (isImageButtonClicked(request,"preview")) // generate a preview
return new PostPreview(engine,sig,conf,topic,request.getParameter("pseud"),raw_postdata,
return new PostPreview(engine,comm,conf,topic,request.getParameter("pseud"),raw_postdata,
request.getParameter("next"),getPostNumber(request,on_error),
yes.equals(request.getParameter("attach")),
yes.equals(request.getParameter("slip")));
@@ -125,7 +125,7 @@ public class PostMessage extends VeniceServlet
try
{ // first check for slippage
if (pn!=topic.getTotalMessages()) // slippage detected! display the slippage screen
return new PostSlippage(engine,sig,conf,topic,pn,request.getParameter("next"),
return new PostSlippage(engine,comm,conf,topic,pn,request.getParameter("next"),
request.getParameter("pseud"),raw_postdata,
yes.equals(request.getParameter("attach")));
@@ -138,7 +138,7 @@ public class PostMessage extends VeniceServlet
// where do we want to go now?
String target;
if (go_topics)
target = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
target = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
else
{ // figure out what topic to go to next
short next;
@@ -163,13 +163,13 @@ public class PostMessage extends VeniceServlet
} // end catch
target = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&top="
target = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&top="
+ next + "&rnm=1";
} // end else
if (yes.equals(request.getParameter("attach")))
return new AttachmentForm(sig,conf,msg,target); // go to upload an attachment
return new AttachmentForm(comm,conf,msg,target); // go to upload an attachment
// no attachment - redirect where we need to go
throw new RedirectResult(target);

View File

@@ -61,14 +61,14 @@ public class PostOperations extends VeniceServlet
UserContext user, RenderData rdat)
throws ServletException, IOException, VeniceServletResult
{
// get the SIG
SIGContext sig = getSIGParameter(request,user,true,"top");
changeMenuSIG(request,sig);
String locator = "sig=" + sig.getSIGID();
// get the community
CommunityContext comm = getCommunityParameter(request,user,true,"top");
changeMenuCommunity(request,comm);
String locator = "sig=" + comm.getCommunityID();
String location = "sigprofile?" + locator;
// get the conference
ConferenceContext conf = getConferenceParameter(request,sig,true,location);
ConferenceContext conf = getConferenceParameter(request,comm,true,location);
locator += "&conf=" + conf.getConfID();
location = "confdisp?" + locator;

View File

@@ -64,30 +64,30 @@ public class PostShortcut extends VeniceServlet
} // end catch
if (decoder.getSIG()==null) // it must include the SIG
if (decoder.getCommunity()==null) // it must include the community
return new ErrorBox("Invalid Post Link","Invalid post link \"" + raw_link
+ "\": ambiguous post link (no SIG)",null);
+ "\": ambiguous post link (no community)",null);
SIGContext sig;
CommunityContext comm;
try
{ // get the SIG represented by that alias
sig = user.getSIGContext(decoder.getSIG());
{ // get the community represented by that alias
comm = user.getCommunityContext(decoder.getCommunity());
} // end try
catch (DataException e)
{ // can't find the SIG - we're screwed
return new ErrorBox("Invalid Post Link","Invalid post link \"" + raw_link + "\": cannot find SIG: "
{ // can't find the community - we're screwed
return new ErrorBox("Invalid Post Link","Invalid post link \"" + raw_link + "\": cannot find community: "
+ e.getMessage(),null);
} // end catch
if (decoder.getConference()==null) // it's a SIG link only - redirect to the SIG's default page
throw new RedirectResult("sig/" + decoder.getSIG());
if (decoder.getConference()==null) // it's a community link only - redirect to the default page
throw new RedirectResult("sig/" + decoder.getCommunity());
ConferenceContext conf;
try
{ // get the conference represented by that alias
conf = sig.getConferenceContext(decoder.getConference());
conf = comm.getConferenceContext(decoder.getConference());
} // end try
catch (DataException e)
@@ -103,7 +103,7 @@ public class PostShortcut extends VeniceServlet
} // end catch
// compute an elementary "locator"
String locator = "sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
String locator = "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
if (decoder.getTopic()==-1) // just a conference link - go to the top-level display
throw new RedirectResult("confdisp?" + locator);

View File

@@ -47,10 +47,10 @@ public class Settings extends VeniceServlet
String foo = request.getParameter("sig");
if (foo==null)
throw new ErrorBox(null,"Parameter not specified!","settings?cmd=H");
int sigid;
int cid;
try
{ // this is the SIG id of the hotlist entry
sigid = Integer.parseInt(foo);
{ // this is the community id of the hotlist entry
cid = Integer.parseInt(foo);
} // end try
catch (NumberFormatException nfe)
@@ -78,7 +78,7 @@ public class Settings extends VeniceServlet
{ // look at the hotlist entries to find the right index
ConferenceHotlistEntry hle = (ConferenceHotlistEntry)(hotlist.get(i));
if ( (hle.getConference().getConfID()==confid)
&& (hle.getConference().getEnclosingSIG().getSIGID()==sigid))
&& (hle.getConference().getEnclosingCommunity().getCommunityID()==cid))
return i;
} // end for
@@ -220,44 +220,45 @@ public class Settings extends VeniceServlet
} // end if (one of the "H" subcommands)
if (cmd.equals("S"))
{ // "S" - display the user's SIG list
{ // "S" - display the user's community list
try
{ // return the SIG list viewer
{ // return the community list viewer
setMyLocation(request,"settings?cmd=S");
return new UserSIGList(user);
return new UserCommunityList(user);
} // end try
catch (DataException de)
{ // oops...can't get it!
return new ErrorBox("Database Error","Error getting SIGs list: " + de.getMessage(),"top");
return new ErrorBox("Database Error","Error getting communities list: " + de.getMessage(),"top");
} // end catch
} // end if ("S" command)
if (cmd.equals("SX"))
{ // "SX" - unjoin the specified SIG
SIGContext sig = getSIGParameter(request,user,true,"settings?cmd=S");
{ // "SX" - unjoin the specified community
CommunityContext comm = getCommunityParameter(request,user,true,"settings?cmd=S");
if (!(sig.canUnjoin()))
return new ErrorBox("SIG Error","You cannot unjoin this SIG.","settings?cmd=S");
if (!(comm.canUnjoin()))
return new ErrorBox("Community Error","You cannot unjoin this community.","settings?cmd=S");
// OK, let's test for a confirmation...
if (ConfirmBox.isConfirmed(request,UNJOIN_CONFIRM_ATTR,UNJOIN_CONFIRM_PARAM))
{ // OK, if you say so, let's unjoin!
try
{ // do the unjoin now...
sig.unjoin();
comm.unjoin();
} // end try
catch (AccessError ae)
{ // access error
return new ErrorBox("Access Error","Unable to unjoin SIG: " + ae.getMessage(),"settings?cmd=S");
return new ErrorBox("Access Error","Unable to unjoin community: " + ae.getMessage(),
"settings?cmd=S");
} // end catch
catch (DataException de)
{ // data exception doing something
return new ErrorBox("Database Error","Database error unjoining SIG: " + de.getMessage(),
return new ErrorBox("Database Error","Database error unjoining community: " + de.getMessage(),
"settings?cmd=S");
} // end catch
@@ -268,9 +269,9 @@ public class Settings extends VeniceServlet
} // end if
else
{ // not a proper confirmation - display the confirm box
String message = "Are you sure you want to unjoin the '" + sig.getName() + "' SIG?";
return new ConfirmBox(request,UNJOIN_CONFIRM_ATTR,UNJOIN_CONFIRM_PARAM,"Unjoining SIG",
message,"settings?cmd=SX&sig=" + sig.getSIGID(),"settings?cmd=S");
String message = "Are you sure you want to unjoin the '" + comm.getName() + "' community?";
return new ConfirmBox(request,UNJOIN_CONFIRM_ATTR,UNJOIN_CONFIRM_PARAM,"Unjoining Community",
message,"settings?cmd=SX&sig=" + comm.getCommunityID(),"settings?cmd=S");
} // end else

View File

@@ -34,7 +34,7 @@ public class SystemAdmin extends VeniceServlet
*--------------------------------------------------------------------------------
*/
private static Category logger = Category.getInstance(SIGAdmin.class.getName());
private static Category logger = Category.getInstance(SystemAdmin.class);
/*--------------------------------------------------------------------------------
* Internal functions

View File

@@ -60,14 +60,14 @@ public class TopicOperations extends VeniceServlet
UserContext user, RenderData rdat)
throws ServletException, IOException, VeniceServletResult
{
// get the SIG
SIGContext sig = getSIGParameter(request,user,true,"top");
changeMenuSIG(request,sig);
String locator = "sig=" + sig.getSIGID();
// get the community
CommunityContext comm = getCommunityParameter(request,user,true,"top");
changeMenuCommunity(request,comm);
String locator = "sig=" + comm.getCommunityID();
String location = "sigprofile?" + locator;
// get the conference
ConferenceContext conf = getConferenceParameter(request,sig,true,location);
ConferenceContext conf = getConferenceParameter(request,comm,true,location);
locator += "&conf=" + conf.getConfID();
location = "confdisp?" + locator;
@@ -150,7 +150,7 @@ public class TopicOperations extends VeniceServlet
{ // Delete Topic requires a confirmation!
if (ConfirmBox.isConfirmed(request,DELETE_CONFIRM_ATTR,DELETE_CONFIRM_PARAM))
{ // OK, go ahead, delete the topic!
location = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
location = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
try
{ // delete the bloody topic!

View File

@@ -255,27 +255,27 @@ public class Variables
} // end setMenuTop
public static void setMenuSIG(HttpSession session, SIGContext sig)
public static void setMenuCommunity(HttpSession session, CommunityContext comm)
{
Object obj = session.getAttribute(MENU_ATTRIBUTE);
boolean do_change;
if ((obj==null) || !(obj instanceof MenuSIG))
if ((obj==null) || !(obj instanceof MenuCommunity))
do_change = true;
else
{ // look at the actual SIGIDs underlying the MenuSIG
MenuSIG tmp = (MenuSIG)obj;
do_change = (tmp.getID()!=sig.getSIGID());
{ // look at the actual community IDs underlying the MenuCommunity
MenuCommunity tmp = (MenuCommunity)obj;
do_change = (tmp.getID()!=comm.getCommunityID());
} // end else
if (do_change)
{ // switch to the appropriate MenuSIG
MenuSIG ms = new MenuSIG(sig);
session.setAttribute(MENU_ATTRIBUTE,ms);
{ // switch to the appropriate MenuCommunity
MenuCommunity mc = new MenuCommunity(comm);
session.setAttribute(MENU_ATTRIBUTE,mc);
} // end if
} // end setMenuSIG
} // end setMenuCommunity
public static void clearMenu(HttpSession session)
{

View File

@@ -54,57 +54,58 @@ public abstract class VeniceServlet extends HttpServlet
} // end notSupported
private static final SIGContext getSIGParameter(String str, UserContext user, boolean required,
String on_error) throws ErrorBox
private static final CommunityContext getCommunityParameter(String str, UserContext user, boolean required,
String on_error) throws ErrorBox
{
if (StringUtil.isStringEmpty(str))
{ // there's no SIG parameter
{ // there's no community parameter
if (required)
{ // no SIG parameter - bail out now!
logger.error("SIG parameter not specified!");
throw new ErrorBox(null,"No SIG specified.",on_error);
{ // no communty parameter - bail out now!
logger.error("community parameter not specified!");
throw new ErrorBox(null,"No community specified.",on_error);
} // end if
else
{ // a null SIGContext is permitted
logger.debug("no SIG specified");
{ // a null CommunityContext is permitted
logger.debug("no community specified");
return null;
} // end else
} // end if
SIGContext rc = null;
CommunityContext rc = null;
try
{ // turn the string into a SIGID, and thence to a SIGContext
{ // turn the string into a community ID, and thence to a CommunityContext
int tmp_id = Integer.parseInt(str);
rc = user.getSIGContext(tmp_id);
rc = user.getCommunityContext(tmp_id);
if (rc==null)
{ // trap any null results (may not be possible with SIGs, but you never know)
logger.error("SIG #" + tmp_id + " was not found!");
throw new ErrorBox(null,"The specified SIG (#" + tmp_id + ") was not found in the database.",on_error);
{ // trap any null results (may not be possible with communities, but you never know)
logger.error("Community #" + tmp_id + " was not found!");
throw new ErrorBox(null,"The specified community (#" + tmp_id + ") was not found in the database.",
on_error);
} // end if
if (logger.isDebugEnabled())
logger.debug("found SIG #" + rc.getSIGID());
logger.debug("found community #" + rc.getCommunityID());
} // end try
catch (NumberFormatException nfe)
{ // error in Integer.parseInt
logger.error("Cannot convert SIG parameter '" + str + "'!");
throw new ErrorBox(null,"Invalid SIG parameter.",on_error);
logger.error("Cannot convert community parameter '" + str + "'!");
throw new ErrorBox(null,"Invalid community parameter.",on_error);
} // end catch
catch (DataException de)
{ // error looking up the SIG
throw new ErrorBox("Database Error","Database error finding SIG: " + de.getMessage(),on_error);
{ // error looking up the community
throw new ErrorBox("Database Error","Database error finding community: " + de.getMessage(),on_error);
} // end catch
return rc;
} // end getSIGParameter
} // end getCommunityParameter
private static TopicContext getTopicParameter(String str, ConferenceContext conf, boolean required,
String on_error) throws ErrorBox
@@ -341,11 +342,11 @@ public abstract class VeniceServlet extends HttpServlet
} // end changeMenuTop
protected final void changeMenuSIG(HttpServletRequest request, SIGContext sig)
protected final void changeMenuCommunity(HttpServletRequest request, CommunityContext comm)
{
Variables.setMenuSIG(request.getSession(true),sig);
Variables.setMenuCommunity(request.getSession(true),comm);
} // end changeMenuSIG
} // end changeMenuCommunity
protected final void clearMenu(HttpServletRequest request)
{
@@ -369,24 +370,26 @@ public abstract class VeniceServlet extends HttpServlet
} // end setMyLocation
protected final static SIGContext getSIGParameter(ServletRequest request, UserContext user, boolean required,
String on_error) throws ErrorBox
protected final static CommunityContext getCommunityParameter(ServletRequest request, UserContext user,
boolean required, String on_error)
throws ErrorBox
{
return getSIGParameter(request.getParameter("sig"),user,required,on_error);
return getCommunityParameter(request.getParameter("sig"),user,required,on_error);
} // end getSIGParameter
} // end getCommunityParameter
protected final static SIGContext getSIGParameter(ServletMultipartHandler mphandler, UserContext user,
boolean required, String on_error) throws ErrorBox
protected final static CommunityContext getCommunityParameter(ServletMultipartHandler mphandler,
UserContext user, boolean required,
String on_error) throws ErrorBox
{
if (mphandler.isFileParam("sig"))
throw new ErrorBox(null,"Internal Error: SIG should be a normal param",on_error);
return getSIGParameter(mphandler.getValue("sig"),user,required,on_error);
throw new ErrorBox(null,"Internal Error: community should be a normal param",on_error);
return getCommunityParameter(mphandler.getValue("sig"),user,required,on_error);
} // end getSIGParameter
} // end getCommunityParameter
protected static ConferenceContext getConferenceParameter(String str, SIGContext sig, boolean required,
String on_error) throws ErrorBox
protected static ConferenceContext getConferenceParameter(String str, CommunityContext comm,
boolean required, String on_error) throws ErrorBox
{
if (StringUtil.isStringEmpty(str))
{ // there's no conference parameter
@@ -409,12 +412,12 @@ public abstract class VeniceServlet extends HttpServlet
try
{ // turn the string into a ConfID, and thence to a ConferenceContext
int tmp_id = Integer.parseInt(str);
rc = sig.getConferenceContext(tmp_id);
rc = comm.getConferenceContext(tmp_id);
if (rc==null)
{ // couldn't find the conference
logger.error("SIG #" + sig.getSIGID() + " does not contain conference #" + tmp_id);
throw new ErrorBox(null,"The conference #" + tmp_id + " could not be found in the '" + sig.getName()
+ "' SIG.",on_error);
logger.error("community #" + comm.getCommunityID() + " does not contain conference #" + tmp_id);
throw new ErrorBox(null,"The conference #" + tmp_id + " could not be found in the '" + comm.getName()
+ "' community.",on_error);
} // end if
@@ -443,21 +446,21 @@ public abstract class VeniceServlet extends HttpServlet
} // end getConferenceParameter
protected final static ConferenceContext getConferenceParameter(ServletRequest request, SIGContext sig,
boolean required, String on_error)
throws ErrorBox
protected final static ConferenceContext getConferenceParameter(ServletRequest request,
CommunityContext comm, boolean required,
String on_error) throws ErrorBox
{
return getConferenceParameter(request.getParameter("conf"),sig,required,on_error);
return getConferenceParameter(request.getParameter("conf"),comm,required,on_error);
} // end getConferenceParameter
protected final static ConferenceContext getConferenceParameter(ServletMultipartHandler mphandler,
SIGContext sig, boolean required,
CommunityContext comm, boolean required,
String on_error) throws ErrorBox
{
if (mphandler.isFileParam("conf"))
throw new ErrorBox(null,"Internal Error: conference should be a normal param",on_error);
return getConferenceParameter(mphandler.getValue("conf"),sig,required,on_error);
return getConferenceParameter(mphandler.getValue("conf"),comm,required,on_error);
} // end getConferenceParameter

View File

@@ -39,7 +39,7 @@ public class AttachmentForm implements JSPRender
*--------------------------------------------------------------------------------
*/
private int sigid;
private int cid;
private int confid;
private long postid;
private String target;
@@ -49,9 +49,9 @@ public class AttachmentForm implements JSPRender
*--------------------------------------------------------------------------------
*/
public AttachmentForm(SIGContext sig, ConferenceContext conf, TopicMessageContext msg, String target)
public AttachmentForm(CommunityContext comm, ConferenceContext conf, TopicMessageContext msg, String target)
{
this.sigid = sig.getSIGID();
this.cid = comm.getCommunityID();
this.confid = conf.getConfID();
this.postid = msg.getPostID();
this.target = target;
@@ -108,11 +108,11 @@ public class AttachmentForm implements JSPRender
*--------------------------------------------------------------------------------
*/
public int getSIGID()
public int getCommunityID()
{
return sigid;
return cid;
} // end getSIGID
} // end getCommunityID
public int getConfID()
{

View File

@@ -118,7 +118,7 @@ public class AuditDataViewer implements ContentRender, ColorSelectors
+ tb_font + "<B>Date/Time</B></FONT></TH>\n<TH ALIGN=LEFT CLASS=\"content\" NOWRAP>"
+ tb_font + "<B>Description</B></FONT></TH>\n<TH ALIGN=LEFT CLASS=\"content\" NOWRAP>"
+ tb_font + "<B>User</B></FONT></TH>\n<TH ALIGN=LEFT CLASS=\"content\" NOWRAP>" + tb_font
+ "<B>SIG</B></FONT></TH>\n<TH ALIGN=LEFT CLASS=\"content\" NOWRAP>" + tb_font
+ "<B>Community</B></FONT></TH>\n<TH ALIGN=LEFT CLASS=\"content\" NOWRAP>" + tb_font
+ "<B>IP Address</B></FONT></TH>\n<TH ALIGN=LEFT CLASS=\"content\" COLSPAN=4 NOWRAP>"
+ tb_font + "<B>Additional Data</B></FONT></TH>\n</TR>\n");
Iterator it = audit_list.iterator();
@@ -132,7 +132,7 @@ public class AuditDataViewer implements ContentRender, ColorSelectors
+ "</FONT></TD>\n<TD ALIGN=LEFT CLASS=\"content\" NOWRAP>" + tb_font
+ StringUtil.encodeHTML(dat.getUserName())
+ "</FONT></TD>\n<TD ALIGN=LEFT CLASS=\"content\" NOWRAP>" + tb_font
+ StringUtil.encodeHTML(dat.getSIGName())
+ StringUtil.encodeHTML(dat.getCommunityName())
+ "</FONT></TD>\n<TD ALIGN=LEFT CLASS=\"content\" NOWRAP>" + tb_font
+ StringUtil.encodeHTML(dat.getIPAddress()) + "</FONT></TD>\n");
for (int i=0; i<AuditData.DATA_COUNT; i++)

View File

@@ -20,29 +20,29 @@ package com.silverwrist.venice.servlets.format;
import java.util.*;
import java.io.Writer;
import java.io.IOException;
import com.silverwrist.venice.core.SIGContext;
import com.silverwrist.venice.core.CommunityContext;
public class SIGAdminTop extends ContentMenuPanel
public class CommunityAdminTop extends ContentMenuPanel
{
/*--------------------------------------------------------------------------------
* Constructors
*--------------------------------------------------------------------------------
*/
public SIGAdminTop()
public CommunityAdminTop()
{
super("SIG Administration:",null);
addChoice("SIG Profile","sigadmin?sig=$s&cmd=P");
addChoice("Set SIG Category","sigadmin?sig=$s&cmd=T");
addChoice("Set SIG Features","sigadmin?sig=$s&cmd=F");
super("Community Administration:",null);
addChoice("Community Profile","sigadmin?sig=$s&cmd=P");
addChoice("Set Community Category","sigadmin?sig=$s&cmd=T");
addChoice("Set Community Features","sigadmin?sig=$s&cmd=F");
addChoice("Membership Control","sigadmin?sig=$s&cmd=M");
addChoice("Display Audit Records","sigadmin?sig=$s&cmd=A");
// TODO: More options
addChoice("Delete SIG","sigadmin?sig=$s&cmd=DEL");
addChoice("Delete Community","sigadmin?sig=$s&cmd=DEL");
} // end constructor
protected SIGAdminTop(SIGAdminTop other)
protected CommunityAdminTop(CommunityAdminTop other)
{
super(other);
@@ -53,17 +53,17 @@ public class SIGAdminTop extends ContentMenuPanel
*--------------------------------------------------------------------------------
*/
public void setSIG(SIGContext sig)
public void setCommunity(CommunityContext comm)
{
setSubtitle(sig.getName());
setParameter("s",String.valueOf(sig.getSIGID()));
setSubtitle(comm.getName());
setParameter("s",String.valueOf(comm.getCommunityID()));
} // end setSIG
} // end setCommunity
public Object clone()
{
return new SIGAdminTop(this);
return new CommunityAdminTop(this);
} // end clone
} // end class SIGAdminTop
} // end class CommunityAdminTop

View File

@@ -21,7 +21,7 @@ import java.util.*;
import javax.servlet.ServletRequest;
import com.silverwrist.venice.core.*;
public class SIGCategoryBrowseData implements JSPRender
public class CommunityCategoryBrowseData implements JSPRender
{
/*--------------------------------------------------------------------------------
* Static data members
@@ -29,7 +29,7 @@ public class SIGCategoryBrowseData implements JSPRender
*/
// Attribute name for request attribute
protected static final String ATTR_NAME = "com.silverwrist.venice.content.SIGCategoryBrowseData";
protected static final String ATTR_NAME = "com.silverwrist.venice.content.CommunityCategoryBrowseData";
/*--------------------------------------------------------------------------------
* Attributes
@@ -47,11 +47,12 @@ public class SIGCategoryBrowseData implements JSPRender
*--------------------------------------------------------------------------------
*/
public SIGCategoryBrowseData(UserContext user, SIGContext sig, int current_id) throws DataException
public CommunityCategoryBrowseData(UserContext user, CommunityContext comm, int current_id)
throws DataException
{
name = sig.getName();
base_applet = "sigadmin?sig=" + String.valueOf(sig.getSIGID());
prev_cat = sig.getCategory();
name = comm.getName();
base_applet = "sigadmin?sig=" + String.valueOf(comm.getCommunityID());
prev_cat = comm.getCategory();
if (prev_cat.getCategoryID()==current_id)
curr_cat = prev_cat;
else
@@ -65,9 +66,9 @@ public class SIGCategoryBrowseData implements JSPRender
*--------------------------------------------------------------------------------
*/
public static SIGCategoryBrowseData retrieve(ServletRequest request)
public static CommunityCategoryBrowseData retrieve(ServletRequest request)
{
return (SIGCategoryBrowseData)(request.getAttribute(ATTR_NAME));
return (CommunityCategoryBrowseData)(request.getAttribute(ATTR_NAME));
} // end retrieve
@@ -78,7 +79,7 @@ public class SIGCategoryBrowseData implements JSPRender
public String getPageTitle(RenderData rdat)
{
return "Set SIG Category";
return "Set Community Category";
} // end getPageTitle
@@ -101,7 +102,7 @@ public class SIGCategoryBrowseData implements JSPRender
public String getTargetJSPName()
{
return "sigcatbrowser.jsp";
return "commcatbrowser.jsp";
} // end getTargetJSPName
@@ -110,7 +111,7 @@ public class SIGCategoryBrowseData implements JSPRender
*--------------------------------------------------------------------------------
*/
public String getSIGName()
public String getCommunityName()
{
return name;
@@ -158,4 +159,4 @@ public class SIGCategoryBrowseData implements JSPRender
} // end hasSubcategories
} // end class SIGCategoryBrowseData
} // end class CommunityCategoryBrowseData

View File

@@ -26,7 +26,7 @@ import com.silverwrist.venice.ValidationException;
import com.silverwrist.venice.security.Role;
import com.silverwrist.venice.core.*;
public class SIGMembership implements JSPRender, SearchMode
public class CommunityMembership implements JSPRender, SearchMode
{
/*--------------------------------------------------------------------------------
* Static data members
@@ -34,7 +34,7 @@ public class SIGMembership implements JSPRender, SearchMode
*/
// Attribute name for request attribute
protected static final String ATTR_NAME = "com.silverwrist.venice.content.ConferenceMembership";
protected static final String ATTR_NAME = "com.silverwrist.venice.content.CommunityMembership";
/*--------------------------------------------------------------------------------
* Attributes
@@ -42,28 +42,28 @@ public class SIGMembership implements JSPRender, SearchMode
*/
private VeniceEngine engine; // reference to the engine
private SIGContext sig; // the SIG we're in
private CommunityContext comm; // the community we're in
private List display_list = null; // list of members to display
private boolean sig_members = false; // is this a list of SIG members?
private boolean comm_members = false; // is this a list of community members?
private int field = -1; // search field
private int mode = -1; // search mode
private String term = null; // search term
private int offset = 0; // search result offset
private int find_count = -1; // search results count
private List role_choices; // the list of security roles
private Role role_sig_host; // the "SIG Host" security role
private Role role_comm_host; // the "Community Host" security role
/*--------------------------------------------------------------------------------
* Constructors
*--------------------------------------------------------------------------------
*/
public SIGMembership(VeniceEngine engine, SIGContext sig)
public CommunityMembership(VeniceEngine engine, CommunityContext comm)
{
this.engine = engine;
this.sig = sig;
this.role_choices = Role.getSIGMemberLevelChoices();
this.role_sig_host = Role.getSIGHostRole();
this.comm = comm;
this.role_choices = Role.getCommunityMemberLevelChoices();
this.role_comm_host = Role.getCommunityHostRole();
} // end constructor
@@ -103,9 +103,9 @@ public class SIGMembership implements JSPRender, SearchMode
*--------------------------------------------------------------------------------
*/
public static SIGMembership retrieve(ServletRequest request)
public static CommunityMembership retrieve(ServletRequest request)
{
return (SIGMembership)(request.getAttribute(ATTR_NAME));
return (CommunityMembership)(request.getAttribute(ATTR_NAME));
} // end retrieve
@@ -116,7 +116,7 @@ public class SIGMembership implements JSPRender, SearchMode
public String getPageTitle(RenderData rdat)
{
return "Membership in SIG " + sig.getName();
return "Membership in Community " + comm.getName();
} // end getPageTitle
@@ -139,7 +139,7 @@ public class SIGMembership implements JSPRender, SearchMode
public String getTargetJSPName()
{
return "sig_member.jsp";
return "comm_member.jsp";
} // end getTargetJSPName
@@ -148,13 +148,13 @@ public class SIGMembership implements JSPRender, SearchMode
*--------------------------------------------------------------------------------
*/
public void doSIGMemberList() throws DataException
public void doCommunityMemberList() throws DataException
{
this.display_list = sig.getMemberList();
this.sig_members = true;
this.display_list = comm.getMemberList();
this.comm_members = true;
this.term = "";
} // end doSIGMemberList
} // end doCommunityMemberList
public void doSearch(ServletRequest request) throws ValidationException, DataException, AccessError
{
@@ -199,13 +199,13 @@ public class SIGMembership implements JSPRender, SearchMode
if (find_count<0)
find_count = engine.getSearchUserCount(field,mode,term);
// Create the real display list by getting the SIG security levels.
// Create the real display list by getting the community security levels.
Iterator it = intermediate.iterator();
Vector rc = new Vector(count+1);
while (it.hasNext())
{ // loop around and find the member level of every one
UserFound uf = (UserFound)(it.next());
int new_level = sig.getMemberLevel(uf.getUID());
int new_level = comm.getMemberLevel(uf.getUID());
if (new_level==-1)
new_level = 0;
rc.add(uf.createNewLevel(new_level));
@@ -216,21 +216,21 @@ public class SIGMembership implements JSPRender, SearchMode
} // end doSearch
public int getSIGID()
public int getCommunityID()
{
return sig.getSIGID();
return comm.getCommunityID();
} // end getSIGID
} // end getCommunityID
public String getSIGName()
public String getCommunityName()
{
return sig.getName();
return comm.getName();
} // end getSIGName
} // end getCommunityName
public String getLocator()
{
return "sig=" + sig.getSIGID();
return "sig=" + comm.getCommunityID();
} // end getLocator
@@ -238,17 +238,17 @@ public class SIGMembership implements JSPRender, SearchMode
{
if ((display_list==null) || (display_list.size()==0))
return false;
if (sig_members && (display_list.size()>engine.getMaxNumSIGMembersDisplay()))
if (comm_members && (display_list.size()>engine.getMaxNumCommunityMembersDisplay()))
return false;
return true;
} // end displayList
public boolean isSIGMemberList()
public boolean isCommunityMemberList()
{
return sig_members;
return comm_members;
} // end isSIGMemberList
} // end isCommunityMemberList
public int getSearchField()
{
@@ -314,9 +314,9 @@ public class SIGMembership implements JSPRender, SearchMode
{
out.write("<INPUT TYPE=HIDDEN NAME=\"zxcur_" + uid + "\" VALUE=\"" + cur_level + "\">\n");
out.write("<SELECT NAME=\"zxnew_" + uid + "\" SIZE=1>\n");
if (cur_level==role_sig_host.getLevel()) // cheat and put in just the host level
out.write("<OPTION VALUE=\"" + role_sig_host.getLevel() + "\" SELECTED>"
+ StringUtil.encodeHTML(role_sig_host.getName()) + "</OPTION>\n");
if (cur_level==role_comm_host.getLevel()) // cheat and put in just the host level
out.write("<OPTION VALUE=\"" + role_comm_host.getLevel() + "\" SELECTED>"
+ StringUtil.encodeHTML(role_comm_host.getName()) + "</OPTION>\n");
else
{ // display all the level choices properly
Iterator it = role_choices.iterator();
@@ -336,4 +336,4 @@ public class SIGMembership implements JSPRender, SearchMode
} // end outputDropDown
} // end class SIGMembership
} // end class CommunityMembership

View File

@@ -21,7 +21,7 @@ import javax.servlet.ServletRequest;
import com.silverwrist.util.StringUtil;
import com.silverwrist.venice.core.*;
public class SIGProfileData implements JSPRender
public class CommunityProfileData implements JSPRender
{
/*--------------------------------------------------------------------------------
* Static data members
@@ -29,7 +29,7 @@ public class SIGProfileData implements JSPRender
*/
// Attribute name for request attribute
protected static final String ATTR_NAME = "com.silverwrist.venice.content.SIGProfileData";
protected static final String ATTR_NAME = "com.silverwrist.venice.content.CommunityProfileData";
/*--------------------------------------------------------------------------------
* Attributes
@@ -38,21 +38,22 @@ public class SIGProfileData implements JSPRender
private VeniceEngine engine; // the Venice engine
private UserContext user; // the current user managing this
private SIGContext sig; // the SIG being displayed
private ContactInfo ci; // SIG's contact info
private UserProfile host_prof; // SIG host's user profile
private CategoryDescriptor cat; // SIG's full category descriptor
private CommunityContext comm; // the community being displayed
private ContactInfo ci; // community's contact info
private UserProfile host_prof; // community host's user profile
private CategoryDescriptor cat; // community's full category descriptor
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
public SIGProfileData(VeniceEngine engine, UserContext user, SIGContext ctxt) throws DataException
public CommunityProfileData(VeniceEngine engine, UserContext user, CommunityContext ctxt)
throws DataException
{
this.engine = engine;
this.user = user;
this.sig = ctxt;
this.comm = ctxt;
this.ci = ctxt.getContactInfo();
this.host_prof = ctxt.getHostProfile();
this.cat = ctxt.getCategory();
@@ -64,9 +65,9 @@ public class SIGProfileData implements JSPRender
*--------------------------------------------------------------------------------
*/
public static SIGProfileData retrieve(ServletRequest request)
public static CommunityProfileData retrieve(ServletRequest request)
{
return (SIGProfileData)(request.getAttribute(ATTR_NAME));
return (CommunityProfileData)(request.getAttribute(ATTR_NAME));
} // end retrieve
@@ -77,13 +78,13 @@ public class SIGProfileData implements JSPRender
public String getPageTitle(RenderData rdat)
{
return "SIG Profile: " + sig.getName();
return "Community Profile: " + comm.getName();
} // end getPageTitle
public String getPageQID()
{
return "go/" + sig.getAlias() + "!";
return "go/" + comm.getAlias() + "!";
} // end getPageQID
@@ -100,7 +101,7 @@ public class SIGProfileData implements JSPRender
public String getTargetJSPName()
{
return "sigprofile.jsp";
return "commprofile.jsp";
} // end getTargetJSPName
@@ -109,20 +110,20 @@ public class SIGProfileData implements JSPRender
*--------------------------------------------------------------------------------
*/
public SIGContext getSIGContext()
public CommunityContext getCommunityContext()
{
return sig;
return comm;
} // end getSIGContext
} // end getCommunityContext
public String getSIGLogoURL(RenderData rdat)
public String getCommunityLogoURL(RenderData rdat)
{
String tmp = ci.getPhotoURL();
if (StringUtil.isStringEmpty(tmp))
tmp = rdat.getFullImagePath("sig_other.jpg");
return tmp;
} // end getSIGLogoURL
} // end getCommunityLogoURL
public boolean isUserLoggedIn()
{
@@ -136,11 +137,11 @@ public class SIGProfileData implements JSPRender
} // end getHostUserName
public ContactInfo getSIGContactInfo()
public ContactInfo getCommunityContactInfo()
{
return ci;
} // end getSIGContactInfo
} // end getCommunityContactInfo
public String getAddressLastLine()
{
@@ -172,4 +173,4 @@ public class SIGProfileData implements JSPRender
} // end getCategory
} // end class SIGProfileData
} // end class CommunityProfileData

View File

@@ -18,9 +18,9 @@
package com.silverwrist.venice.servlets.format;
import javax.servlet.ServletRequest;
import com.silverwrist.venice.core.SIGContext;
import com.silverwrist.venice.core.CommunityContext;
public class SIGWelcome implements JSPRender
public class CommunityWelcome implements JSPRender
{
/*--------------------------------------------------------------------------------
* Static data members
@@ -28,7 +28,7 @@ public class SIGWelcome implements JSPRender
*/
// Attribute name for request attribute
protected static final String ATTR_NAME = "com.silverwrist.venice.content.SIGWelcome";
protected static final String ATTR_NAME = "com.silverwrist.venice.content.CommunityWelcome";
/*--------------------------------------------------------------------------------
* Attributes
@@ -43,10 +43,10 @@ public class SIGWelcome implements JSPRender
*--------------------------------------------------------------------------------
*/
public SIGWelcome(SIGContext sig)
public CommunityWelcome(CommunityContext comm)
{
name = sig.getName();
entry_url = "sig/" + sig.getAlias();
name = comm.getName();
entry_url = "sig/" + comm.getAlias();
} // end constructor
@@ -55,9 +55,9 @@ public class SIGWelcome implements JSPRender
*--------------------------------------------------------------------------------
*/
public static SIGWelcome retrieve(ServletRequest request)
public static CommunityWelcome retrieve(ServletRequest request)
{
return (SIGWelcome)(request.getAttribute(ATTR_NAME));
return (CommunityWelcome)(request.getAttribute(ATTR_NAME));
} // end retrieve
@@ -91,7 +91,7 @@ public class SIGWelcome implements JSPRender
public String getTargetJSPName()
{
return "sigwelcome.jsp";
return "commwelcome.jsp";
} // end getTargetJSPName
@@ -100,11 +100,11 @@ public class SIGWelcome implements JSPRender
*--------------------------------------------------------------------------------
*/
public String getSIGName()
public String getCommunityName()
{
return name;
} // end getSIGName
} // end getCommunityName
public String getEntryURL(RenderData rdat)
{
@@ -112,4 +112,4 @@ public class SIGWelcome implements JSPRender
} // end getEntryURL
} // end class SIGWelcome
} // end class CommunityWelcome

View File

@@ -37,7 +37,7 @@ public class ConferenceActivity implements JSPRender
*--------------------------------------------------------------------------------
*/
private SIGContext sig; // the SIG we're in
private CommunityContext comm; // the community we're in
private ConferenceContext conf; // the conference being listed
private TopicContext topic; // the topic being listed
private boolean posters; // is this a list of posters?
@@ -49,10 +49,10 @@ public class ConferenceActivity implements JSPRender
*--------------------------------------------------------------------------------
*/
public ConferenceActivity(SIGContext sig, ConferenceContext conf, TopicContext topic, boolean posters)
public ConferenceActivity(CommunityContext comm, ConferenceContext conf, TopicContext topic, boolean posters)
throws DataException, AccessError
{
this.sig = sig;
this.comm = comm;
this.conf = conf;
this.topic = topic;
this.posters = posters;
@@ -158,7 +158,7 @@ public class ConferenceActivity implements JSPRender
public String getLocator()
{
if (locator==null)
locator = "sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
locator = "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
return locator;
} // end getLocator

View File

@@ -36,7 +36,7 @@ public class ConferenceListing implements JSPRender
*--------------------------------------------------------------------------------
*/
private SIGContext sig;
private CommunityContext comm;
private List conferences;
private List[] hosts;
@@ -45,10 +45,10 @@ public class ConferenceListing implements JSPRender
*--------------------------------------------------------------------------------
*/
public ConferenceListing(SIGContext sig) throws DataException, AccessError
public ConferenceListing(CommunityContext comm) throws DataException, AccessError
{
this.sig = sig;
this.conferences = sig.getConferences();
this.comm = comm;
this.conferences = comm.getConferences();
this.hosts = new List[this.conferences.size()];
for (int i=0; i<this.conferences.size(); i++)
this.hosts[i] = ((ConferenceContext)(this.conferences.get(i))).getHosts();
@@ -73,13 +73,13 @@ public class ConferenceListing implements JSPRender
public String getPageTitle(RenderData rdat)
{
return "Conference Listing: " + sig.getName();
return "Conference Listing: " + comm.getName();
} // end getPageTitle
public String getPageQID()
{
return "go/" + sig.getAlias() + "!";
return "go/" + comm.getAlias() + "!";
} // end getPageQID
@@ -105,17 +105,17 @@ public class ConferenceListing implements JSPRender
*--------------------------------------------------------------------------------
*/
public int getSIGID()
public int getCommunityID()
{
return sig.getSIGID();
return comm.getCommunityID();
} // end getSIGID
} // end getCommunityID
public String getSIGName()
public String getCommunityName()
{
return sig.getName();
return comm.getName();
} // end getSIGName
} // end getCommunityName
public int getNumConferences()
{
@@ -167,13 +167,13 @@ public class ConferenceListing implements JSPRender
public boolean canCreateConference()
{
return sig.canCreateConference();
return comm.canCreateConference();
} // end canCreateConference
public boolean canManageConferences()
{
return sig.canManageConferences();
return comm.canManageConferences();
} // end canManageConferences

View File

@@ -42,7 +42,7 @@ public class ConferenceMembership implements JSPRender, SearchMode
*/
private VeniceEngine engine; // reference to the engine
private SIGContext sig; // the SIG we're in
private CommunityContext comm; // the community we're in
private ConferenceContext conf; // the conference being listed
private List display_list = null; // list of members to display
private boolean conf_members = false; // is this a list of conference members?
@@ -58,10 +58,10 @@ public class ConferenceMembership implements JSPRender, SearchMode
*--------------------------------------------------------------------------------
*/
public ConferenceMembership(VeniceEngine engine, SIGContext sig, ConferenceContext conf)
public ConferenceMembership(VeniceEngine engine, CommunityContext comm, ConferenceContext conf)
{
this.engine = engine;
this.sig = sig;
this.comm = comm;
this.conf = conf;
this.role_choices = Role.getConferenceMemberLevelChoices();
@@ -195,9 +195,9 @@ public class ConferenceMembership implements JSPRender, SearchMode
throw new ValidationException("Unable to determine what action triggered the form.");
// Perform the search!
List intermediate = sig.searchForMembers(field,mode,term,offset,count);
List intermediate = comm.searchForMembers(field,mode,term,offset,count);
if (find_count<0)
find_count = sig.getSearchMemberCount(field,mode,term);
find_count = comm.getSearchMemberCount(field,mode,term);
// Create the real display list by getting the conference security levels.
Iterator it = intermediate.iterator();
@@ -216,11 +216,11 @@ public class ConferenceMembership implements JSPRender, SearchMode
} // end doSearch
public int getSIGID()
public int getCommunityID()
{
return sig.getSIGID();
return comm.getCommunityID();
} // end getSIGID
} // end getCommunityID
public int getConfID()
{
@@ -228,11 +228,11 @@ public class ConferenceMembership implements JSPRender, SearchMode
} // end getConfID
public String getSIGName()
public String getCommunityName()
{
return sig.getName();
return comm.getName();
} // end getSIGName
} // end getCommunityName
public String getConfName()
{
@@ -242,7 +242,7 @@ public class ConferenceMembership implements JSPRender, SearchMode
public String getLocator()
{
return "sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
return "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
} // end getLocator

View File

@@ -37,7 +37,7 @@ public class ConferenceSequence implements JSPRender
*--------------------------------------------------------------------------------
*/
private SIGContext sig;
private CommunityContext comm;
private List conf_list;
private Hashtable hidden_stat = new Hashtable();
private Hashtable next_id = new Hashtable();
@@ -48,10 +48,10 @@ public class ConferenceSequence implements JSPRender
*--------------------------------------------------------------------------------
*/
public ConferenceSequence(SIGContext sig) throws DataException, AccessError
public ConferenceSequence(CommunityContext comm) throws DataException, AccessError
{
this.sig = sig;
this.conf_list = sig.getConferences();
this.comm = comm;
this.conf_list = comm.getConferences();
Integer last_id = null;
for (int i=0; i<conf_list.size(); i++)
@@ -125,11 +125,11 @@ public class ConferenceSequence implements JSPRender
*--------------------------------------------------------------------------------
*/
public int getSIGID()
public int getCommunityID()
{
return sig.getSIGID();
return comm.getCommunityID();
} // end getSIGID
} // end getCommunityID
public int getNumConferences()
{

View File

@@ -22,7 +22,7 @@ import com.silverwrist.util.StringUtil;
import com.silverwrist.venice.ValidationException;
import com.silverwrist.venice.core.*;
public class CreateSIGDialog extends ContentDialog
public class CreateCommunityDialog extends ContentDialog
{
/*--------------------------------------------------------------------------------
* Attributes
@@ -36,9 +36,9 @@ public class CreateSIGDialog extends ContentDialog
*--------------------------------------------------------------------------------
*/
public CreateSIGDialog(List country_list, List language_list)
public CreateCommunityDialog(List country_list, List language_list)
{
super("Create New SIG",null,"createsigform","sigops");
super("Create New Community",null,"createcommform","sigops");
setHiddenField("cmd","C");
Vector vec_pubpriv = new Vector(2);
@@ -47,14 +47,15 @@ public class CreateSIGDialog extends ContentDialog
vec_pubpriv.trimToSize();
Vector vec_hidemode = new Vector(3);
vec_hidemode.add(String.valueOf(SIGContext.HIDE_NONE) + "|Show in both directory and search");
vec_hidemode.add(String.valueOf(SIGContext.HIDE_DIRECTORY) + "|Hide in directory, but not in search");
vec_hidemode.add(String.valueOf(SIGContext.HIDE_BOTH) + "|Hide in both directory and search");
vec_hidemode.add(String.valueOf(CommunityContext.HIDE_NONE) + "|Show in both directory and search");
vec_hidemode.add(String.valueOf(CommunityContext.HIDE_DIRECTORY)
+ "|Hide in directory, but not in search");
vec_hidemode.add(String.valueOf(CommunityContext.HIDE_BOTH) + "|Hide in both directory and search");
vec_hidemode.trimToSize();
addFormField(new CDFormCategoryHeader("Basic Information"));
addFormField(new CDTextFormField("name","SIG Name",null,true,32,128));
addFormField(new CDVeniceIDFormField("alias","SIG Alias",null,true,32,32));
addFormField(new CDTextFormField("name","Community Name",null,true,32,128));
addFormField(new CDVeniceIDFormField("alias","Community Alias",null,true,32,32));
addFormField(new CDTextFormField("synopsis","Synopsis",null,false,32,255));
addFormField(new CDTextFormField("rules","Rules",null,false,32,255));
addFormField(new CDLanguageListFormField("language","Primary language",null,true,language_list));
@@ -64,19 +65,19 @@ public class CreateSIGDialog extends ContentDialog
addFormField(new CDTextFormField("pcode","Zip/Postal Code",null,true,32,64));
addFormField(new CDCountryListFormField("country","Country",null,true,country_list));
addFormField(new CDFormCategoryHeader("Security"));
addFormField(new CDSimplePickListFormField("comtype","SIG type:",null,true,vec_pubpriv,'|'));
addFormField(new CDTextFormField("joinkey","Join key","(for private SIGs)",false,32,64));
addFormField(new CDSimplePickListFormField("hidemode","SIG visibility:",null,true,vec_hidemode,'|'));
addFormField(new CDSimplePickListFormField("comtype","Community type:",null,true,vec_pubpriv,'|'));
addFormField(new CDTextFormField("joinkey","Join key","(for private communities)",false,32,64));
addFormField(new CDSimplePickListFormField("hidemode","Community visibility:",null,true,vec_hidemode,'|'));
addCommandButton(new CDImageButton("create","bn_create.gif","Create",80,24));
addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
} // end constructor
protected CreateSIGDialog(CreateSIGDialog other)
protected CreateCommunityDialog(CreateCommunityDialog other)
{
super(other);
} // end CreateSIGDialog
} // end CreateCommunityDialog
/*--------------------------------------------------------------------------------
* Overrides from class ContentDialog
@@ -86,12 +87,12 @@ public class CreateSIGDialog extends ContentDialog
protected void validateWholeForm() throws ValidationException
{
if (engine.aliasExists(getFieldValue("alias"),-1))
throw new ValidationException("That alias is already used by another SIG on the system.");
throw new ValidationException("That alias is already used by another community on the system.");
if (getFieldValue("comtype").equals("1"))
{ // make sure if they flagged it as Private that they specified a join key
if (StringUtil.isStringEmpty(getFieldValue("joinkey")))
throw new ValidationException("Private SIGs must specify a join key value.");
throw new ValidationException("Private communities must specify a join key value.");
} // end if
@@ -108,7 +109,7 @@ public class CreateSIGDialog extends ContentDialog
} // end setupDialog
public SIGContext doDialog(UserContext user) throws ValidationException, DataException, AccessError
public CommunityContext doDialog(UserContext user) throws ValidationException, DataException, AccessError
{
validate(); // validate the dialog entries
@@ -132,11 +133,12 @@ public class CreateSIGDialog extends ContentDialog
else
jkey = null;
// Create the new SIG context.
SIGContext rc = user.createSIG(getFieldValue("name"),getFieldValue("alias"),getFieldValue("language"),
getFieldValue("synopsis"),getFieldValue("rules"),jkey,hidemode);
// Create the new community context.
CommunityContext rc = user.createCommunity(getFieldValue("name"),getFieldValue("alias"),
getFieldValue("language"),getFieldValue("synopsis"),
getFieldValue("rules"),jkey,hidemode);
// Get the new SIG's contact record and fill in the pieces of info we know.
// Get the new community's contact record and fill in the pieces of info we know.
ContactInfo ci = rc.getContactInfo();
ci.setLocality(getFieldValue("loc"));
ci.setRegion(getFieldValue("reg"));
@@ -156,8 +158,8 @@ public class CreateSIGDialog extends ContentDialog
public Object clone()
{
return new CreateSIGDialog(this);
return new CreateCommunityDialog(this);
} // end clone
} // end class CreateSIGDialog
} // end class CreateCommunityDialog

View File

@@ -50,7 +50,8 @@ public class CreateConferenceDialog extends ContentDialog
addFormField(new CDVeniceIDFormField("alias","Conference Alias",null,true,32,64));
addFormField(new CDTextFormField("descr","Description",null,false,32,255));
addFormField(new CDSimplePickListFormField("ctype","Conference type",null,true,vec_pubpriv,'|'));
addFormField(new CDCheckBoxFormField("hide","Hide conference in the SIG's conference list",null,"Y"));
addFormField(new CDCheckBoxFormField("hide","Hide conference in the community's conference list",
null,"Y"));
addCommandButton(new CDImageButton("create","bn_create.gif","Create",80,24));
addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
@@ -79,14 +80,15 @@ public class CreateConferenceDialog extends ContentDialog
*--------------------------------------------------------------------------------
*/
public void setupDialog(VeniceEngine engine, SIGContext sig)
public void setupDialog(VeniceEngine engine, CommunityContext comm)
{
this.engine = engine;
setHiddenField("sig",String.valueOf(sig.getSIGID()));
setHiddenField("sig",String.valueOf(comm.getCommunityID()));
} // end setupDialog
public ConferenceContext doDialog(SIGContext sig) throws ValidationException, DataException, AccessError
public ConferenceContext doDialog(CommunityContext comm)
throws ValidationException, DataException, AccessError
{
validate(); // validate the form
@@ -96,7 +98,7 @@ public class CreateConferenceDialog extends ContentDialog
boolean hide_list = yes.equals(getFieldValue("hide"));
// create the conference!
return sig.createConference(getFieldValue("name"),getFieldValue("alias"),getFieldValue("descr"),pvt,
return comm.createConference(getFieldValue("name"),getFieldValue("alias"),getFieldValue("descr"),pvt,
hide_list);
} // end if

View File

@@ -23,7 +23,7 @@ import com.silverwrist.venice.ValidationException;
import com.silverwrist.venice.security.Role;
import com.silverwrist.venice.core.*;
public class EditSIGProfileDialog extends ContentDialog
public class EditCommunityProfileDialog extends ContentDialog
{
/*--------------------------------------------------------------------------------
* Attributes
@@ -31,16 +31,16 @@ public class EditSIGProfileDialog extends ContentDialog
*/
private VeniceEngine engine;
private int sigid;
private int cid;
/*--------------------------------------------------------------------------------
* Constructors
*--------------------------------------------------------------------------------
*/
public EditSIGProfileDialog(List country_list, List language_list)
public EditCommunityProfileDialog(List country_list, List language_list)
{
super("Edit SIG Profile:",null,"sigprofform","sigadmin");
super("Edit Community Profile:",null,"commprofform","sigadmin");
setHiddenField("cmd","P");
setHiddenField("sig","");
@@ -50,14 +50,15 @@ public class EditSIGProfileDialog extends ContentDialog
vec_pubpriv.trimToSize();
Vector vec_hidemode = new Vector(3);
vec_hidemode.add(String.valueOf(SIGContext.HIDE_NONE) + "|Show in both directory and search");
vec_hidemode.add(String.valueOf(SIGContext.HIDE_DIRECTORY) + "|Hide in directory, but not in search");
vec_hidemode.add(String.valueOf(SIGContext.HIDE_BOTH) + "|Hide in both directory and search");
vec_hidemode.add(String.valueOf(CommunityContext.HIDE_NONE) + "|Show in both directory and search");
vec_hidemode.add(String.valueOf(CommunityContext.HIDE_DIRECTORY)
+ "|Hide in directory, but not in search");
vec_hidemode.add(String.valueOf(CommunityContext.HIDE_BOTH) + "|Hide in both directory and search");
vec_hidemode.trimToSize();
addFormField(new CDFormCategoryHeader("Basic Information"));
addFormField(new CDTextFormField("name","SIG Name",null,true,32,128));
addFormField(new CDVeniceIDFormField("alias","SIG Alias",null,true,32,32));
addFormField(new CDTextFormField("name","Community Name",null,true,32,128));
addFormField(new CDVeniceIDFormField("alias","Community Alias",null,true,32,32));
addFormField(new CDTextFormField("synopsis","Synopsis",null,false,32,255));
addFormField(new CDTextFormField("rules","Rules",null,false,32,255));
addFormField(new CDLanguageListFormField("language","Primary language",null,true,language_list));
@@ -71,27 +72,28 @@ public class EditSIGProfileDialog extends ContentDialog
addFormField(new CDTextFormField("pcode","Zip/Postal Code",null,true,32,64));
addFormField(new CDCountryListFormField("country","Country",null,true,country_list));
addFormField(new CDFormCategoryHeader("Security"));
addFormField(new CDSimplePickListFormField("comtype","SIG type",null,true,vec_pubpriv,'|'));
addFormField(new CDTextFormField("joinkey","Join key","(for private SIGs)",false,32,64));
addFormField(new CDCheckBoxFormField("membersonly","Allow only members to access this SIG",null,"Y"));
addFormField(new CDSimplePickListFormField("hidemode","SIG visibility",null,true,vec_hidemode,'|'));
addFormField(new CDSimplePickListFormField("comtype","Communty type",null,true,vec_pubpriv,'|'));
addFormField(new CDTextFormField("joinkey","Join key","(for private communities)",false,32,64));
addFormField(new CDCheckBoxFormField("membersonly","Allow only members to access this community",
null,"Y"));
addFormField(new CDSimplePickListFormField("hidemode","Community visibility",null,true,vec_hidemode,'|'));
addFormField(new CDRoleListFormField("read_lvl","Security level required to read contents",null,true,
Role.getSIGReadList()));
Role.getCommunityReadList()));
addFormField(new CDRoleListFormField("write_lvl","Security level required to update profile",null,true,
Role.getSIGWriteList()));
Role.getCommunityWriteList()));
addFormField(new CDRoleListFormField("create_lvl","Security level required to create new subobjects",
null,true,Role.getSIGCreateList()));
addFormField(new CDRoleListFormField("delete_lvl","Security level required to delete SIG",null,true,
Role.getSIGDeleteList()));
addFormField(new CDRoleListFormField("join_lvl","Security level required to join SIG",null,true,
Role.getSIGJoinList()));
null,true,Role.getCommunityCreateList()));
addFormField(new CDRoleListFormField("delete_lvl","Security level required to delete community",null,true,
Role.getCommunityDeleteList()));
addFormField(new CDRoleListFormField("join_lvl","Security level required to join community",null,true,
Role.getCommunityJoinList()));
// TODO: add logo selection/uploading method here
addCommandButton(new CDImageButton("update","bn_update.gif","Update",80,24));
addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
} // end EditSIGProfileDialog
} // end EditCommunityProfileDialog
protected EditSIGProfileDialog(EditSIGProfileDialog other)
protected EditCommunityProfileDialog(EditCommunityProfileDialog other)
{
super(other);
@@ -102,10 +104,10 @@ public class EditSIGProfileDialog extends ContentDialog
*--------------------------------------------------------------------------------
*/
private void doDisable(SIGContext sig)
private void doDisable(CommunityContext comm)
{
if (sig.isAdminSIG())
{ // make sure certain fields are disabled for admin SIGs
if (comm.isAdminCommunity())
{ // make sure certain fields are disabled for admin community
setFieldEnabled("comtype",false);
setFieldEnabled("joinkey",false);
setFieldEnabled("membersonly",false);
@@ -127,13 +129,13 @@ public class EditSIGProfileDialog extends ContentDialog
protected void validateWholeForm() throws ValidationException
{
if (engine.aliasExists(getFieldValue("alias"),sigid))
throw new ValidationException("That alias is already used by another SIG on the system.");
if (engine.aliasExists(getFieldValue("alias"),cid))
throw new ValidationException("That alias is already used by another community on the system.");
if (getFieldValue("comtype").equals("1"))
{ // make sure if they flagged it as Private that they specified a join key
if (StringUtil.isStringEmpty(getFieldValue("joinkey")))
throw new ValidationException("Private SIGs must specify a join key value.");
throw new ValidationException("Private communities must specify a join key value.");
} // end if
@@ -144,24 +146,24 @@ public class EditSIGProfileDialog extends ContentDialog
*--------------------------------------------------------------------------------
*/
public void setupDialogBasic(VeniceEngine engine, SIGContext sig)
public void setupDialogBasic(VeniceEngine engine, CommunityContext comm)
{
this.engine = engine;
this.sigid = sig.getSIGID();
this.cid = comm.getCommunityID();
} // end setupDialogBasic
public void setupDialog(VeniceEngine engine, SIGContext sig) throws DataException, AccessError
public void setupDialog(VeniceEngine engine, CommunityContext comm) throws DataException, AccessError
{
setupDialogBasic(engine,sig);
ContactInfo ci = sig.getContactInfo();
setupDialogBasic(engine,comm);
ContactInfo ci = comm.getContactInfo();
setHiddenField("sig",String.valueOf(sig.getSIGID()));
setFieldValue("name",sig.getName());
setFieldValue("alias",sig.getAlias());
setFieldValue("synopsis",sig.getSynopsis());
setFieldValue("rules",sig.getRules());
setFieldValue("language",sig.getLanguageCode());
setHiddenField("sig",String.valueOf(comm.getCommunityID()));
setFieldValue("name",comm.getName());
setFieldValue("alias",comm.getAlias());
setFieldValue("synopsis",comm.getSynopsis());
setFieldValue("rules",comm.getRules());
setFieldValue("language",comm.getLanguageCode());
setFieldValue("url",ci.getURL());
setFieldValue("company",ci.getCompany());
setFieldValue("addr1",ci.getAddressLine1());
@@ -170,33 +172,33 @@ public class EditSIGProfileDialog extends ContentDialog
setFieldValue("reg",ci.getRegion());
setFieldValue("pcode",ci.getPostalCode());
setFieldValue("country",ci.getCountry());
if (sig.isPublicSIG())
{ // public SIG - no join key
if (comm.isPublicCommunity())
{ // public community - no join key
setFieldValue("comtype","0");
setFieldValue("joinkey","");
} // end if
else
{ // private SIG - display the join key
{ // private community - display the join key
setFieldValue("comtype","1");
setFieldValue("joinkey",sig.getJoinKey());
setFieldValue("joinkey",comm.getJoinKey());
} // end else
if (sig.getMembersOnly())
if (comm.getMembersOnly())
setFieldValue("membersonly","Y");
setFieldValue("hidemode",String.valueOf(sig.getHideMode()));
setFieldValue("read_lvl",String.valueOf(sig.getReadLevel()));
setFieldValue("write_lvl",String.valueOf(sig.getWriteLevel()));
setFieldValue("create_lvl",String.valueOf(sig.getCreateLevel()));
setFieldValue("delete_lvl",String.valueOf(sig.getDeleteLevel()));
setFieldValue("join_lvl",String.valueOf(sig.getJoinLevel()));
setFieldValue("hidemode",String.valueOf(comm.getHideMode()));
setFieldValue("read_lvl",String.valueOf(comm.getReadLevel()));
setFieldValue("write_lvl",String.valueOf(comm.getWriteLevel()));
setFieldValue("create_lvl",String.valueOf(comm.getCreateLevel()));
setFieldValue("delete_lvl",String.valueOf(comm.getDeleteLevel()));
setFieldValue("join_lvl",String.valueOf(comm.getJoinLevel()));
doDisable(sig);
doDisable(comm);
} // end setupDialog
public void doDialog(SIGContext sig) throws ValidationException, DataException, AccessError
public void doDialog(CommunityContext comm) throws ValidationException, DataException, AccessError
{
final String yes = "Y"; // the "yes" string
validate(); // validate the dialog entries
@@ -219,7 +221,7 @@ public class EditSIGProfileDialog extends ContentDialog
} // end catch
// save off the ContactInfo-related fields first
ContactInfo ci = sig.getContactInfo();
ContactInfo ci = comm.getContactInfo();
ci.setURL(getFieldValue("url"));
ci.setCompany(getFieldValue("company"));
ci.setAddressLine1(getFieldValue("addr1"));
@@ -228,43 +230,43 @@ public class EditSIGProfileDialog extends ContentDialog
ci.setRegion(getFieldValue("reg"));
ci.setPostalCode(getFieldValue("pcode"));
ci.setCountry(getFieldValue("country"));
sig.putContactInfo(ci);
comm.putContactInfo(ci);
// now save the big text fields
sig.setName(getFieldValue("name"));
sig.setAlias(getFieldValue("alias"));
sig.setSynopsis(getFieldValue("synopsis"));
sig.setRules(getFieldValue("rules"));
sig.setLanguage(getFieldValue("language"));
comm.setName(getFieldValue("name"));
comm.setAlias(getFieldValue("alias"));
comm.setSynopsis(getFieldValue("synopsis"));
comm.setRules(getFieldValue("rules"));
comm.setLanguage(getFieldValue("language"));
if (!(sig.isAdminSIG()))
if (!(comm.isAdminCommunity()))
{ // save off the security information
String jkey;
if (getFieldValue("comtype").equals("1"))
jkey = getFieldValue("joinkey");
else
jkey = null;
sig.setJoinKey(jkey);
sig.setMembersOnly(yes.equals(getFieldValue("membersonly")));
sig.setHideMode(hidemode);
sig.setSecurityLevels(read_lvl,write_lvl,create_lvl,delete_lvl,join_lvl);
comm.setJoinKey(jkey);
comm.setMembersOnly(yes.equals(getFieldValue("membersonly")));
comm.setHideMode(hidemode);
comm.setSecurityLevels(read_lvl,write_lvl,create_lvl,delete_lvl,join_lvl);
} // end if
} // end doDialog
public void resetOnError(SIGContext sig, String message)
public void resetOnError(CommunityContext comm, String message)
{
setErrorMessage(message);
doDisable(sig);
doDisable(comm);
} // end resetOnError
public Object clone()
{
return new EditSIGProfileDialog(this);
return new EditCommunityProfileDialog(this);
} // end clone
} // end class EditSIGProfileDialog
} // end class EditCommunityProfileDialog

View File

@@ -40,7 +40,8 @@ public class EditConferenceDialog extends ContentDialog
addFormField(new CDFormCategoryHeader("Basic Information"));
addFormField(new CDTextFormField("name","Conference Name",null,true,32,128));
addFormField(new CDTextFormField("descr","Description",null,false,32,255));
addFormField(new CDCheckBoxFormField("hide","Hide conference in the SIG's conference list",null,"Y"));
addFormField(new CDCheckBoxFormField("hide","Hide conference in the community's conference list",
null,"Y"));
addFormField(new CDFormCategoryHeader("Security Information"));
addFormField(new CDRoleListFormField("read_lvl","Security level required to read conference",null,true,
Role.getConferenceReadList()));
@@ -79,9 +80,9 @@ public class EditConferenceDialog extends ContentDialog
*--------------------------------------------------------------------------------
*/
public void setupDialog(SIGContext sig, ConferenceContext conf) throws DataException, AccessError
public void setupDialog(CommunityContext comm, ConferenceContext conf) throws DataException, AccessError
{
setHiddenField("sig",String.valueOf(sig.getSIGID()));
setHiddenField("sig",String.valueOf(comm.getCommunityID()));
setHiddenField("conf",String.valueOf(conf.getConfID()));
setTitle("Edit Conference: " + conf.getName());
setFieldValue("name",conf.getName());
@@ -131,9 +132,9 @@ public class EditConferenceDialog extends ContentDialog
} // end doDialog
public void resetOnError(SIGContext sig, ConferenceContext conf, String message)
public void resetOnError(CommunityContext comm, ConferenceContext conf, String message)
{
setHiddenField("sig",String.valueOf(sig.getSIGID()));
setHiddenField("sig",String.valueOf(comm.getCommunityID()));
setHiddenField("conf",String.valueOf(conf.getConfID()));
setTitle("Edit Conference: " + conf.getName());
setErrorMessage(message);

View File

@@ -36,7 +36,7 @@ public class FindData implements JSPRender, SearchMode
protected static final String ATTR_NAME = "com.silverwrist.venice.content.FindData";
// The various display categories
public static final int FD_SIGS = 0;
public static final int FD_COMMUNITIES = 0;
public static final int FD_USERS = 1;
public static final int FD_CATEGORIES = 2;
@@ -75,13 +75,13 @@ public class FindData implements JSPRender, SearchMode
if (header_titles==null)
{ // construct the title and URL vectors
header_titles = new Vector();
header_titles.add("SIGs");
header_titles.add("Communities");
header_titles.add("Users");
header_titles.add("Categories");
header_titles.trimToSize();
header_urls = new Vector();
header_urls.add("find?disp=" + String.valueOf(FD_SIGS));
header_urls.add("find?disp=" + String.valueOf(FD_COMMUNITIES));
header_urls.add("find?disp=" + String.valueOf(FD_USERS));
header_urls.add("find?disp=" + String.valueOf(FD_CATEGORIES));
header_urls.trimToSize();
@@ -257,17 +257,17 @@ public class FindData implements JSPRender, SearchMode
public void loadGet(int catid) throws DataException
{
if (disp==FD_SIGS)
{ // fill in the list of subcategories and of SIGs in this category
if (disp==FD_COMMUNITIES)
{ // fill in the list of subcategories and of communities in this category
cat = user.getCategoryDescriptor(catid);
subcats = cat.getSubCategories();
if (cat.getCategoryID()>=0)
{ // fill in the SIGs that are in this category
results = user.getSIGsInCategory(cat,offset,getNumResultsDisplayed());
find_count = user.getNumSIGsInCategory(cat);
{ // fill in the communities that are in this category
results = user.getCommunitiesInCategory(cat,offset,getNumResultsDisplayed());
find_count = user.getNumCommunitiesInCategory(cat);
} // end if
field = FIELD_SIG_NAME;
field = FIELD_COMMUNITY_NAME;
} // end if
else if (disp==FD_USERS)
@@ -286,12 +286,12 @@ public class FindData implements JSPRender, SearchMode
// category ID (if specified) and the field identifier.
switch (disp)
{
case FD_SIGS:
case FD_COMMUNITIES:
catid = getParamInt(request,"cat",-1);
if (!engine.isValidCategoryID(catid))
throw new ValidationException("The category ID parameter is not valid.");
field = getParamInt(request,"field",FIELD_SIG_NAME);
if ((field!=FIELD_SIG_NAME) && (field!=FIELD_SIG_SYNOPSIS))
field = getParamInt(request,"field",FIELD_COMMUNITY_NAME);
if ((field!=FIELD_COMMUNITY_NAME) && (field!=FIELD_COMMUNITY_SYNOPSIS))
throw new ValidationException("The field search parameter is not valid.");
break;
@@ -344,25 +344,25 @@ public class FindData implements JSPRender, SearchMode
// Run the actual search.
switch (disp)
{
case FD_SIGS:
case FD_COMMUNITIES:
if (catid>=0)
{ // retrieve the category descriptor and the subcategory list
cat = user.getCategoryDescriptor(catid);
subcats = cat.getSubCategories();
if (cat.getCategoryID()>=0)
{ // fill in the SIGs that are in this category
results = user.getSIGsInCategory(cat,offset,count);
{ // fill in the communities that are in this category
results = user.getCommunitiesInCategory(cat,offset,count);
if (find_count<0)
find_count = user.getNumSIGsInCategory(cat);
find_count = user.getNumCommunitiesInCategory(cat);
} // end if
} // end if
else
{ // retrieve the SIG search data
results = user.searchForSIGs(field,mode,term,offset,count);
{ // retrieve the community search data
results = user.searchForCommunities(field,mode,term,offset,count);
if (find_count<0)
find_count = user.getSearchSIGCount(field,mode,term);
find_count = user.getSearchCommunityCount(field,mode,term);
} // end else
break;
@@ -385,7 +385,7 @@ public class FindData implements JSPRender, SearchMode
public static String getCatJumpLink(RenderData rdat, int catid)
{
return rdat.getEncodedServletPath("find?disp=" + String.valueOf(FD_SIGS) + "&cat="
return rdat.getEncodedServletPath("find?disp=" + String.valueOf(FD_COMMUNITIES) + "&cat="
+ String.valueOf(catid));
} // end getCatJumpLink

View File

@@ -36,16 +36,16 @@ public class Invitation implements JSPRender
*--------------------------------------------------------------------------------
*/
private SIGContext sig; // the SIG context
private CommunityContext comm; // the community context
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
public Invitation(SIGContext sig)
public Invitation(CommunityContext comm)
{
this.sig = sig;
this.comm = comm;
} // end constructor
@@ -73,7 +73,7 @@ public class Invitation implements JSPRender
public String getPageQID()
{
return "sigops?cmd=I&sig=" + sig.getSIGID();
return "sigops?cmd=I&sig=" + comm.getCommunityID();
} // end getPageQID
@@ -99,16 +99,16 @@ public class Invitation implements JSPRender
*--------------------------------------------------------------------------------
*/
public int getSIGID()
public int getCommunityID()
{
return sig.getSIGID();
return comm.getCommunityID();
} // end getSIGID
} // end getCommunityID
public String getSIGName()
public String getCommunityName()
{
return sig.getName();
return comm.getName();
} // end getSIGName
} // end getCommunityName
} // end class Invitation

View File

@@ -33,8 +33,8 @@ public class JoinKeyDialog extends ContentDialog
super("Join Key Required",null,"joinkeyform","sigops");
setHiddenField("cmd","J");
setHiddenField("sig","");
setInstructions("You must specify a join key before you can join this SIG. You might have received "
+ "the join key from the SIG's host, or via an invitation e-mail message. Please "
setInstructions("You must specify a join key before you can join this community. You might have received "
+ "the join key from the community's host, or via an invitation e-mail message. Please "
+ "enter it in the box below.");
addFormField(new CDTextFormField("key","Join key",null,false,32,64));
addCommandButton(new CDImageButton("join","bn_join_now.gif","Join Now",80,24));
@@ -65,16 +65,16 @@ public class JoinKeyDialog extends ContentDialog
*--------------------------------------------------------------------------------
*/
public void setupDialog(SIGContext sig)
public void setupDialog(CommunityContext comm)
{
setHiddenField("sig",String.valueOf(sig.getSIGID()));
setHiddenField("sig",String.valueOf(comm.getCommunityID()));
} // end setupDialog
public void doDialog(SIGContext sig) throws ValidationException, DataException, AccessError
public void doDialog(CommunityContext comm) throws ValidationException, DataException, AccessError
{
validate();
sig.join(getFieldValue("key"));
comm.join(getFieldValue("key"));
} // end doDialog

View File

@@ -37,7 +37,7 @@ public class ManageConference implements JSPRender
*--------------------------------------------------------------------------------
*/
private SIGContext sig; // the SIG we're in
private CommunityContext comm; // the community we're in
private ConferenceContext conf; // the conference being listed
private String locator = null; // the locator we use
@@ -46,9 +46,9 @@ public class ManageConference implements JSPRender
*--------------------------------------------------------------------------------
*/
public ManageConference(SIGContext sig, ConferenceContext conf)
public ManageConference(CommunityContext comm, ConferenceContext conf)
{
this.sig = sig;
this.comm = comm;
this.conf = conf;
} // end constructor
@@ -103,11 +103,11 @@ public class ManageConference implements JSPRender
*--------------------------------------------------------------------------------
*/
public int getSIGID()
public int getCommunityID()
{
return sig.getSIGID();
return comm.getCommunityID();
} // end getSIGID
} // end getCommunityID
public int getConfID()
{
@@ -124,7 +124,7 @@ public class ManageConference implements JSPRender
public String getLocator()
{
if (locator==null)
locator = "sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
locator = "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
return locator;
} // end getLocator

View File

@@ -37,7 +37,7 @@ public class ManageConferenceAliases implements JSPRender
*--------------------------------------------------------------------------------
*/
private SIGContext sig; // the SIG we're in
private CommunityContext comm; // the community we're in
private ConferenceContext conf; // the conference being listed
private List aliases; // list of aliases generated
private String error_message; // error message to display
@@ -47,18 +47,19 @@ public class ManageConferenceAliases implements JSPRender
*--------------------------------------------------------------------------------
*/
public ManageConferenceAliases(SIGContext sig, ConferenceContext conf) throws DataException
public ManageConferenceAliases(CommunityContext comm, ConferenceContext conf) throws DataException
{
this.sig = sig;
this.comm = comm;
this.conf = conf;
this.aliases = conf.getAliases();
this.error_message = null;
} // end constructor
public ManageConferenceAliases(SIGContext sig, ConferenceContext conf, String message) throws DataException
public ManageConferenceAliases(CommunityContext comm, ConferenceContext conf, String message)
throws DataException
{
this.sig = sig;
this.comm = comm;
this.conf = conf;
this.aliases = conf.getAliases();
this.error_message = message;
@@ -115,11 +116,11 @@ public class ManageConferenceAliases implements JSPRender
*--------------------------------------------------------------------------------
*/
public int getSIGID()
public int getCommunityID()
{
return sig.getSIGID();
return comm.getCommunityID();
} // end getSIGID
} // end getCommunityID
public int getConfID()
{
@@ -135,7 +136,7 @@ public class ManageConferenceAliases implements JSPRender
public String getLocator()
{
return "sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
return "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
} // end getLocator

View File

@@ -23,7 +23,7 @@ import java.util.*;
import com.silverwrist.util.StringUtil;
import com.silverwrist.venice.core.*;
public class MenuSIG implements ComponentRender, ColorSelectors
public class MenuCommunity implements ComponentRender, ColorSelectors
{
/*--------------------------------------------------------------------------------
* Attributes
@@ -34,7 +34,7 @@ public class MenuSIG implements ComponentRender, ColorSelectors
private boolean image_url_needs_fixup = false; // do we need to fix image path up?
private String title; // title for menu
private List items_list; // list of menu items
private int sigid; // SIG ID
private int cid; // community ID
private boolean show_unjoin; // show the "Unjoin" menu choice?
/*--------------------------------------------------------------------------------
@@ -42,7 +42,7 @@ public class MenuSIG implements ComponentRender, ColorSelectors
*--------------------------------------------------------------------------------
*/
public MenuSIG(SIGContext ctxt)
public MenuCommunity(CommunityContext ctxt)
{
try
{ // retrieve the contact info for this puppy
@@ -63,8 +63,8 @@ public class MenuSIG implements ComponentRender, ColorSelectors
} // end catch
title = ctxt.getName();
items_list = ctxt.getSIGFeaturesList();
sigid = ctxt.getSIGID();
items_list = ctxt.getCommunityFeaturesList();
cid = ctxt.getCommunityID();
show_unjoin = ctxt.canUnjoin();
} // end constructor
@@ -95,19 +95,19 @@ public class MenuSIG implements ComponentRender, ColorSelectors
// display the menu items
Iterator it = items_list.iterator();
String sigparm = "sig=" + sigid;
String cparm = "sig=" + cid;
while (it.hasNext())
{ // display each menu item in turn
SIGFeature ftr = (SIGFeature)(it.next());
CommunityFeature ftr = (CommunityFeature)(it.next());
out.write("<BR>\n<A CLASS=\"lbar\" HREF=\""
+ rdat.getEncodedServletPath(ftr.getApplet() + "?" + sigparm) + "\">" + hilite
+ rdat.getEncodedServletPath(ftr.getApplet() + "?" + cparm) + "\">" + hilite
+ StringUtil.encodeHTML(ftr.getName()) + "</FONT></A>\n");
} // end while
if (show_unjoin)
out.write("<P>\n<A CLASS=\"lbar\" HREF=\""
+ rdat.getEncodedServletPath("sigops?cmd=U&" + sigparm) + "\">"
+ rdat.getEncodedServletPath("sigops?cmd=U&" + cparm) + "\">"
+ hilite + "Unjoin</FONT></A>\n");
out.write("\n"); // all done...
@@ -121,8 +121,8 @@ public class MenuSIG implements ComponentRender, ColorSelectors
public int getID()
{
return sigid;
return cid;
} // end getID
} // end class MenuTop
} // end class MenuCommunity

View File

@@ -18,9 +18,9 @@
package com.silverwrist.venice.servlets.format;
import javax.servlet.ServletRequest;
import com.silverwrist.venice.core.SIGContext;
import com.silverwrist.venice.core.CommunityContext;
public class NewSIGWelcome implements JSPRender
public class NewCommunityWelcome implements JSPRender
{
/*--------------------------------------------------------------------------------
* Static data members
@@ -28,7 +28,7 @@ public class NewSIGWelcome implements JSPRender
*/
// Attribute name for request attribute
protected static final String ATTR_NAME = "com.silverwrist.venice.content.NewSIGWelcome";
protected static final String ATTR_NAME = "com.silverwrist.venice.content.NewCommunityWelcome";
/*--------------------------------------------------------------------------------
* Attributes
@@ -37,16 +37,18 @@ public class NewSIGWelcome implements JSPRender
private String name;
private String entry_url;
private String invite_url;
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
public NewSIGWelcome(SIGContext sig)
public NewCommunityWelcome(CommunityContext comm)
{
name = sig.getName();
entry_url = "sig/" + sig.getAlias();
name = comm.getName();
entry_url = "sig/" + comm.getAlias();
invite_url = "sigops?cmd=I&sig=" + comm.getCommunityID();
} // end constructor
@@ -55,9 +57,9 @@ public class NewSIGWelcome implements JSPRender
*--------------------------------------------------------------------------------
*/
public static NewSIGWelcome retrieve(ServletRequest request)
public static NewCommunityWelcome retrieve(ServletRequest request)
{
return (NewSIGWelcome)(request.getAttribute(ATTR_NAME));
return (NewCommunityWelcome)(request.getAttribute(ATTR_NAME));
} // end retrieve
@@ -68,7 +70,7 @@ public class NewSIGWelcome implements JSPRender
public String getPageTitle(RenderData rdat)
{
return "New SIG Created";
return "New Community Created";
} // end getPageTitle
@@ -91,7 +93,7 @@ public class NewSIGWelcome implements JSPRender
public String getTargetJSPName()
{
return "newsigwelcome.jsp";
return "newcommwelcome.jsp";
} // end getTargetJSPName
@@ -100,11 +102,11 @@ public class NewSIGWelcome implements JSPRender
*--------------------------------------------------------------------------------
*/
public String getSIGName()
public String getCommunityName()
{
return name;
} // end getSIGName
} // end getCommunityName
public String getEntryURL(RenderData rdat)
{
@@ -118,4 +120,10 @@ public class NewSIGWelcome implements JSPRender
} // end getEntryURL
} // end class NewSIGWelcome
public String getInviteURL(RenderData rdat)
{
return rdat.getEncodedServletPath(invite_url);
} // end getInviteURL
} // end class NewCommunityWelcome

View File

@@ -38,7 +38,7 @@ public class NewTopicForm implements JSPRender
*--------------------------------------------------------------------------------
*/
private SIGContext sig; // the SIG we're in
private CommunityContext comm; // the community we're in
private ConferenceContext conf; // the conference being created in
private String topic_name; // the initial topic name
private String pseud; // the pseud to display
@@ -52,9 +52,9 @@ public class NewTopicForm implements JSPRender
*--------------------------------------------------------------------------------
*/
public NewTopicForm(SIGContext sig, ConferenceContext conf)
public NewTopicForm(CommunityContext comm, ConferenceContext conf)
{
this.sig = sig;
this.comm = comm;
this.conf = conf;
} // end constrcutor
@@ -173,11 +173,11 @@ public class NewTopicForm implements JSPRender
} // end generatePreview
public int getSIGID()
public int getCommunityID()
{
return sig.getSIGID();
return comm.getCommunityID();
} // end getSIGID
} // end getCommunityID
public int getConfID()
{

View File

@@ -18,7 +18,7 @@
package com.silverwrist.venice.servlets.format;
import javax.servlet.ServletRequest;
import com.silverwrist.venice.core.SIGContext;
import com.silverwrist.venice.core.CommunityContext;
public class PasswordChanged implements JSPRender
{

View File

@@ -39,7 +39,7 @@ public class PostPreview implements JSPRender
*--------------------------------------------------------------------------------
*/
private SIGContext sig;
private CommunityContext comm;
private ConferenceContext conf;
private TopicContext topic;
private String next;
@@ -56,10 +56,10 @@ public class PostPreview implements JSPRender
*--------------------------------------------------------------------------------
*/
public PostPreview(VeniceEngine engine, SIGContext sig, ConferenceContext conf, TopicContext topic,
public PostPreview(VeniceEngine engine, CommunityContext comm, ConferenceContext conf, TopicContext topic,
String pseud, String data, String next, int msgs, boolean attach, boolean slippage)
{
this.sig = sig;
this.comm = comm;
this.conf = conf;
this.topic = topic;
this.next = next;
@@ -158,11 +158,11 @@ public class PostPreview implements JSPRender
} // end getPreviewData
public int getSIGID()
public int getCommunityID()
{
return sig.getSIGID();
return comm.getCommunityID();
} // end getSIGID
} // end getCommunityID
public int getConfID()
{

View File

@@ -39,7 +39,7 @@ public class PostSlippage implements JSPRender
*--------------------------------------------------------------------------------
*/
private SIGContext sig;
private CommunityContext comm;
private ConferenceContext conf;
private TopicContext topic;
private List messages;
@@ -54,11 +54,11 @@ public class PostSlippage implements JSPRender
*--------------------------------------------------------------------------------
*/
public PostSlippage(VeniceEngine engine, SIGContext sig, ConferenceContext conf, TopicContext topic,
public PostSlippage(VeniceEngine engine, CommunityContext comm, ConferenceContext conf, TopicContext topic,
int lastval, String next, String pseud, String text, boolean attach)
throws DataException, AccessError
{
this.sig = sig;
this.comm = comm;
this.conf = conf;
this.topic = topic;
this.messages = topic.getMessages(lastval,topic.getTotalMessages()-1);
@@ -167,11 +167,11 @@ public class PostSlippage implements JSPRender
} // end getMessageBodyText
public int getSIGID()
public int getCommunityID()
{
return sig.getSIGID();
return comm.getCommunityID();
} // end getSIGID
} // end getCommunityID
public int getConfID()
{

View File

@@ -37,7 +37,7 @@ public class ReportConferenceMenu implements JSPRender
*--------------------------------------------------------------------------------
*/
private SIGContext sig; // the SIG we're in
private CommunityContext comm; // the community we're in
private ConferenceContext conf; // the conference being listed
private List topics; // the topics in this conference
private String locator = null; // the locator
@@ -47,9 +47,9 @@ public class ReportConferenceMenu implements JSPRender
*--------------------------------------------------------------------------------
*/
public ReportConferenceMenu(SIGContext sig, ConferenceContext conf) throws DataException, AccessError
public ReportConferenceMenu(CommunityContext comm, ConferenceContext conf) throws DataException, AccessError
{
this.sig = sig;
this.comm = comm;
this.conf = conf;
this.topics = conf.getTopicList(ConferenceContext.GET_ALL,ConferenceContext.SORT_NUMBER);
@@ -120,7 +120,7 @@ public class ReportConferenceMenu implements JSPRender
public String getLocator()
{
if (locator==null)
locator = "sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
locator = "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
return locator;
} // end getLocator

View File

@@ -37,7 +37,7 @@ public class TopicListing implements JSPRender
*--------------------------------------------------------------------------------
*/
private SIGContext sig; // the SIG we're in
private CommunityContext comm; // the community we're in
private ConferenceContext conf; // the conference being listed
private int view_opt; // the view option used
private int sort_opt; // the sort option used
@@ -50,17 +50,17 @@ public class TopicListing implements JSPRender
*--------------------------------------------------------------------------------
*/
public TopicListing(HttpServletRequest request, SIGContext sig, ConferenceContext conf, int view_opt,
public TopicListing(HttpServletRequest request, CommunityContext comm, ConferenceContext conf, int view_opt,
int sort_opt) throws DataException, AccessError
{
this.sig = sig;
this.comm = comm;
this.conf = conf;
this.view_opt = view_opt;
this.sort_opt = sort_opt;
this.topic_list = conf.getTopicList(view_opt,sort_opt);
this.visit_order = TopicVisitOrder.initialize(request.getSession(true),conf.getConfID(),this.topic_list);
List aliases = conf.getAliases();
this.qid = "go/" + sig.getAlias() + "!" + (String)(aliases.get(0));
this.qid = "go/" + comm.getAlias() + "!" + (String)(aliases.get(0));
} // end constructor
@@ -114,11 +114,11 @@ public class TopicListing implements JSPRender
*--------------------------------------------------------------------------------
*/
public int getSIGID()
public int getCommunityID()
{
return sig.getSIGID();
return comm.getCommunityID();
} // end getSIGID
} // end getCommunityID
public int getConfID()
{
@@ -129,7 +129,7 @@ public class TopicListing implements JSPRender
public String getLocator()
{
StringBuffer buf = new StringBuffer("sig=");
buf.append(sig.getSIGID()).append("&conf=").append(conf.getConfID());
buf.append(comm.getCommunityID()).append("&conf=").append(conf.getConfID());
return buf.toString();
} // end getLocator
@@ -149,7 +149,7 @@ public class TopicListing implements JSPRender
public String getNextLocator()
{
StringBuffer buf = new StringBuffer("sig=");
buf.append(sig.getSIGID()).append("&conf=").append(conf.getConfID()).append("&top=");
buf.append(comm.getCommunityID()).append("&conf=").append(conf.getConfID()).append("&top=");
buf.append(visit_order.getNext());
return buf.toString();

View File

@@ -42,7 +42,7 @@ public class TopicPosts implements JSPRender
*/
private VeniceEngine engine;
private SIGContext sig;
private CommunityContext comm;
private ConferenceContext conf;
private TopicContext topic;
private int first;
@@ -60,16 +60,16 @@ public class TopicPosts implements JSPRender
*--------------------------------------------------------------------------------
*/
public TopicPosts(HttpServletRequest request, VeniceEngine engine, SIGContext sig, ConferenceContext conf,
TopicContext topic, int first, int last, boolean read_new, boolean show_advanced)
throws DataException, AccessError
public TopicPosts(HttpServletRequest request, VeniceEngine engine, CommunityContext comm,
ConferenceContext conf, TopicContext topic, int first, int last, boolean read_new,
boolean show_advanced) throws DataException, AccessError
{
if (logger.isDebugEnabled())
logger.debug("TopicPosts: sig=" + sig.getSIGID() + ", conf=" + conf.getConfID() + ", topic="
logger.debug("TopicPosts: comm=" + comm.getCommunityID() + ", conf=" + conf.getConfID() + ", topic="
+ topic.getTopicNumber() + ", range=[" + first + ", " + last + "], rnm=" + read_new
+ ", shac=" + show_advanced);
this.engine = engine;
this.sig = sig;
this.comm = comm;
this.conf = conf;
this.topic = topic;
this.first = first;
@@ -86,7 +86,7 @@ public class TopicPosts implements JSPRender
visit_order.visit(topic.getTopicNumber());
List aliases = conf.getAliases();
topic_stem = (String)(aliases.get(0)) + "." + topic.getTopicNumber() + ".";
topic_qid = "go/" + sig.getAlias() + "!" + (String)(aliases.get(0)) + "." + topic.getTopicNumber();
topic_qid = "go/" + comm.getAlias() + "!" + (String)(aliases.get(0)) + "." + topic.getTopicNumber();
} // end constructor
@@ -171,11 +171,11 @@ public class TopicPosts implements JSPRender
} // end getMessageBodyText
public int getSIGID()
public int getCommunityID()
{
return sig.getSIGID();
return comm.getCommunityID();
} // end getSIGID
} // end getCommunityID
public int getConfID()
{
@@ -201,7 +201,7 @@ public class TopicPosts implements JSPRender
public String getConfLocator()
{
StringBuffer buf = new StringBuffer("sig=");
buf.append(sig.getSIGID()).append("&conf=").append(conf.getConfID());
buf.append(comm.getCommunityID()).append("&conf=").append(conf.getConfID());
return buf.toString();
} // end getConfLocator
@@ -211,7 +211,7 @@ public class TopicPosts implements JSPRender
if (cache_locator==null)
{ // build up the standard locator
StringBuffer buf = new StringBuffer("sig=");
buf.append(sig.getSIGID()).append("&conf=").append(conf.getConfID()).append("&top=");
buf.append(comm.getCommunityID()).append("&conf=").append(conf.getConfID()).append("&top=");
buf.append(topic.getTopicNumber());
cache_locator = buf.toString();
@@ -224,7 +224,7 @@ public class TopicPosts implements JSPRender
public String getNextLocator()
{
StringBuffer buf = new StringBuffer("sig=");
buf.append(sig.getSIGID()).append("&conf=").append(conf.getConfID());
buf.append(comm.getCommunityID()).append("&conf=").append(conf.getConfID());
if (visit_order!=null)
buf.append("&top=").append(visit_order.getNext());
return buf.toString();

View File

@@ -22,7 +22,7 @@ import javax.servlet.*;
import javax.servlet.http.*;
import com.silverwrist.venice.core.*;
public class UserSIGList implements JSPRender
public class UserCommunityList implements JSPRender
{
/*--------------------------------------------------------------------------------
* Static data members
@@ -30,7 +30,7 @@ public class UserSIGList implements JSPRender
*/
// Attribute name for request attribute
protected static final String ATTR_NAME = "com.silverwrist.venice.content.Hotlist";
protected static final String ATTR_NAME = "com.silverwrist.venice.content.UserCommunityList";
/*--------------------------------------------------------------------------------
* Attributes
@@ -38,17 +38,17 @@ public class UserSIGList implements JSPRender
*/
private UserContext uc;
private List sig_list;
private List comm_list;
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
public UserSIGList(UserContext uc) throws DataException
public UserCommunityList(UserContext uc) throws DataException
{
this.uc = uc;
this.sig_list = uc.getMemberSIGs();
this.comm_list = uc.getMemberCommunities();
} // end constructor
@@ -57,9 +57,9 @@ public class UserSIGList implements JSPRender
*--------------------------------------------------------------------------------
*/
public static UserSIGList retrieve(ServletRequest request)
public static UserCommunityList retrieve(ServletRequest request)
{
return (UserSIGList)(request.getAttribute(ATTR_NAME));
return (UserCommunityList)(request.getAttribute(ATTR_NAME));
} // end retrieve
@@ -70,7 +70,7 @@ public class UserSIGList implements JSPRender
public String getPageTitle(RenderData rdat)
{
return "Your SIGs";
return "Your Communities";
} // end getPageTitle
@@ -93,7 +93,7 @@ public class UserSIGList implements JSPRender
public String getTargetJSPName()
{
return "siglist.jsp";
return "communitylist.jsp";
} // end getTargetJSPName
@@ -102,16 +102,16 @@ public class UserSIGList implements JSPRender
*--------------------------------------------------------------------------------
*/
public int getNumSIGs()
public int getNumCommunities()
{
return sig_list.size();
return comm_list.size();
} // end getNumSIGs
} // end getNumCommunities
public SIGContext getSIG(int ndx)
public CommunityContext getCommunity(int ndx)
{
return (SIGContext)(sig_list.get(ndx));
return (CommunityContext)(comm_list.get(ndx));
} // end getSIG
} // end getCommunity
} // end class UserSIGList
} // end class UserCommunityList

View File

@@ -25,22 +25,22 @@ import com.silverwrist.util.StringUtil;
import com.silverwrist.venice.core.*;
import com.silverwrist.venice.servlets.format.*;
public class SIGBox implements SideBoxFactory
public class CommunityBox implements SideBoxFactory
{
/*--------------------------------------------------------------------------------
* Internal class that implements the actual sidebox
*--------------------------------------------------------------------------------
*/
class SIGBoxImpl implements ContentRender, ColorSelectors
class CommunityBoxImpl implements ContentRender, ColorSelectors
{
private UserContext uc;
private List sig_list;
private List comm_list;
SIGBoxImpl(UserContext uc) throws DataException
CommunityBoxImpl(UserContext uc) throws DataException
{
this.uc = uc;
this.sig_list = uc.getMemberSIGs();
this.comm_list = uc.getMemberCommunities();
} // end constructor
@@ -69,20 +69,20 @@ public class SIGBox implements SideBoxFactory
public void renderHere(Writer out, RenderData rdat) throws IOException
{
if (sig_list.size()>0)
if (comm_list.size()>0)
{ // load up the rendering data and render the contents of the list
String link_font = rdat.getStdFontTag(SIDEBOX_CONTENT_LINK,2);
out.write("<TABLE ALIGN=CENTER BORDER=0 CELLPADDING=0 CELLSPACING=2>\n");
Iterator it = sig_list.iterator();
Iterator it = comm_list.iterator();
while (it.hasNext())
{ // write each SIG out in turn
SIGContext sig = (SIGContext)(it.next());
{ // write each community out in turn
CommunityContext comm = (CommunityContext)(it.next());
out.write("<TR VALIGN=MIDDLE>\n<TD ALIGN=CENTER WIDTH=" + bullet.getWidth() + ">");
bullet.renderHere(out,rdat);
out.write("</TD>\n<TD ALIGN=LEFT CLASS=\"sidebox\">\n<A CLASS=\"sidebox\" HREF=\""
+ rdat.getEncodedServletPath("sig/" + sig.getAlias()) + "\">" + link_font + "<B>"
+ StringUtil.encodeHTML(sig.getName()) + "</B></FONT></A>\n");
if (sig.isAdmin())
+ rdat.getEncodedServletPath("sig/" + comm.getAlias()) + "\">" + link_font + "<B>"
+ StringUtil.encodeHTML(comm.getName()) + "</B></FONT></A>\n");
if (comm.isAdmin())
{ // write the host tag at the end
out.write("&nbsp;");
host.renderHere(out,rdat);
@@ -96,7 +96,7 @@ public class SIGBox implements SideBoxFactory
out.write("</TABLE>\n");
} // end if
else // write the "no SIGs" message
else // write the "no communities" message
out.write(rdat.getStdFontTag(SIDEBOX_CONTENT_FOREGROUND,2) + "<EM>" + null_message + "</EM></FONT>\n");
if (uc.isLoggedIn())
@@ -105,7 +105,7 @@ public class SIGBox implements SideBoxFactory
out.write("<P>" + rdat.getStdFontTag(SIDEBOX_CONTENT_FOREGROUND,1)
+ "<B>[ <A CLASS=\"sidebox\" HREF=\"" + rdat.getEncodedServletPath("settings?cmd=S")
+ "\">" + hilite + manage_link + "</FONT></A> ");
if (uc.canCreateSIG())
if (uc.canCreateCommunity())
out.write("| <A CLASS=\"sidebox\" HREF=\"" + rdat.getEncodedServletPath("sigops?cmd=C") + "\">"
+ hilite + create_new_link + "</FONT></A> ");
out.write("]</B></FONT>");
@@ -114,7 +114,7 @@ public class SIGBox implements SideBoxFactory
} // end renderHere
} // end class SIGBoxImpl
} // end class CommunityBoxImpl
/*--------------------------------------------------------------------------------
* Attributes
@@ -125,7 +125,7 @@ public class SIGBox implements SideBoxFactory
private ImageHandler anon_title_image; // title image for sidebox for not-logged-in users
private String title; // title of sidebox for logged-in users
private String anon_title; // title of sidebox for not-logged-in users
private String null_message; // message if they're not a member of any SIGs
private String null_message; // message if they're not a member of any communities
private String manage_link; // "Manage" link text
private String create_new_link; // "Create New" link text
private ImageHandler bullet; // bullet image
@@ -136,7 +136,7 @@ public class SIGBox implements SideBoxFactory
*--------------------------------------------------------------------------------
*/
public SIGBox()
public CommunityBox()
{ // do nothing
} // end constructor
@@ -162,7 +162,7 @@ public class SIGBox implements SideBoxFactory
title_image = anon_title_image = null;
title = cfg_h.getSubElementText("title");
if (title==null)
throw new ConfigException("no <title/> specified for SIG list sidebox",cfg);
throw new ConfigException("no <title/> specified for community list sidebox",cfg);
title += ":";
anon_title = cfg_h.getSubElementText("anon-title");
if (anon_title==null)
@@ -174,7 +174,7 @@ public class SIGBox implements SideBoxFactory
null_message = cfg_h.getSubElementText("null-msg");
if (null_message==null)
null_message = "You are not a member of any SIGs.";
null_message = "You are not a member of any communities.";
manage_link = cfg_h.getSubElementText("manage-link");
if (manage_link==null)
@@ -191,8 +191,8 @@ public class SIGBox implements SideBoxFactory
public VeniceContent create(VeniceEngine engine, UserContext uc) throws DataException
{
return new SIGBoxImpl(uc);
return new CommunityBoxImpl(uc);
} // end create
} // end class SIGBox
} // end class CommunityBox

View File

@@ -79,13 +79,14 @@ public class ConferenceBox implements SideBoxFactory
{ // get the next hotlist entry and add it to the display
ConferenceHotlistEntry hle = (ConferenceHotlistEntry)(it.next());
ConferenceContext conf = hle.getConference();
String href = "confdisp?sig=" + conf.getEnclosingSIG().getSIGID() + "&conf=" + conf.getConfID();
String href = "confdisp?sig=" + conf.getEnclosingCommunity().getCommunityID() + "&conf="
+ conf.getConfID();
out.write("<TR VALIGN=MIDDLE>\n<TD ALIGN=CENTER WIDTH=" + bullet.getWidth() + ">");
bullet.renderHere(out,rdat);
out.write("</TD>\n<TD ALIGN=LEFT CLASS=\"sidebox\">\n" + norm_font
+ "<B><A CLASS=\"sidebox\" HREF=\"" + rdat.getEncodedServletPath(href) + "\">" + hilite
+ StringUtil.encodeHTML(conf.getName()) + "</FONT></A></B> ("
+ StringUtil.encodeHTML(conf.getEnclosingSIG().getName()) + ")</FONT>\n");
+ StringUtil.encodeHTML(conf.getEnclosingCommunity().getName()) + ")</FONT>\n");
if (conf.anyUnread())
{ // write out the new-messages tag and its enclosing link
out.write("&nbsp;<A HREF=\"" + rdat.getEncodedServletPath(href + "&rnm=1") + "\">");
@@ -173,7 +174,7 @@ public class ConferenceBox implements SideBoxFactory
null_message = cfg_h.getSubElementText("null-msg");
if (null_message==null)
null_message = "You are not a member of any SIGs.";
null_message = "You have no conferences in your hotlist.";
manage_link = cfg_h.getSubElementText("manage-link");
if (manage_link==null)