with one switch, a system administrator can now disable the category support

(no searching for categories, no getting communities by category,
no category display on community profile, no changing a community's category)
This commit is contained in:
Eric J. Bowersox
2002-01-16 21:17:05 +00:00
parent e3717ca62c
commit f24456e0a2
25 changed files with 465 additions and 123 deletions

View File

@@ -10,7 +10,7 @@
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
// Copyright (C) 2001-02 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
@@ -43,4 +43,6 @@ menu = rinput.getMenu("community.admin",vars);
// build a view around it and return it
rc = new MenuView(menu);
rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
if (rinput.engine.useCategories())
rc.define("USECAT");
vlib.output(rc);

View File

@@ -10,7 +10,7 @@
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
// Copyright (C) 2001-02 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
@@ -35,6 +35,13 @@ if (rinput.hasParameter("disp"))
} // end if
if ((disp==FindView.FD_CATEGORIES) && !(rinput.engine.useCategories()))
{ // the display parameter is not correct
vlib.output(new ErrorBox(null,"Invalid display parameter.","top.js.vs"));
vlib.done();
} // end if
// save off the session attribute
rinput.setSessionAttribute(FindView.DISPLAY_PARAM_ATTRIBUTE,new java.lang.Integer(disp));
@@ -107,9 +114,14 @@ try
if (disp==FindView.FD_COMMUNITIES)
{ // load the category ID and field parameters
catid = rinput.getParameterInt("cat",-1);
if (!(rinput.engine.isValidCategoryID(catid)))
throw new ValidationException("The category ID parameter is not valid.");
if (rinput.engine.useCategories())
{ // don't try to get the category unless we support such a thing
catid = rinput.getParameterInt("cat",-1);
if (!(rinput.engine.isValidCategoryID(catid)))
throw new ValidationException("The category ID parameter is not valid.");
} // end if
x = rinput.getParameterInt("field",SearchMode.FIELD_COMMUNITY_NAME);
if ((x!=SearchMode.FIELD_COMMUNITY_NAME) && (x!=SearchMode.FIELD_COMMUNITY_SYNOPSIS))
throw new ValidationException("The search field parameter is not valid.");
@@ -153,7 +165,7 @@ try
// run the actual search!
if (disp==FindView.FD_COMMUNITIES)
{ // need to work it differently if there's a category ID
if (catid>=0)
if (rinput.engine.useCategories() && (catid>=0))
{ // set up the category
view.category = rinput.user.getCategoryDescriptor(catid);
if (view.category.categoryID>=0)

View File

@@ -10,7 +10,7 @@
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
// Copyright (C) 2001-02 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
@@ -52,6 +52,8 @@ if ("GET"==rinput.verb)
dlg.setValue("conf_mbrs",props.conferenceMembersPerPage);
if (props.displayPostPictures)
dlg.setValue("pic_in_post",1);
if (props.disableCategories)
dlg.setValue("no_cats",1);
rc = dlg;
@@ -100,6 +102,7 @@ if (op=="update")
props.oldPostsAtTop = dlg.getValue("old_posts").intValue();
props.conferenceMembersPerPage = dlg.getValue("conf_mbrs").intValue();
props.displayPostPictures = dlg.getValue("pic_in_post").booleanValue();
props.disableCategories = dlg.getValue("no_cats").booleanValue();
adm.properties = props;
// done - bounce back to the menu