added the global "enable use of categories" flag

This commit is contained in:
Eric J. Bowersox
2003-05-31 05:01:48 +00:00
parent b1d1f8e381
commit 15035c2fe6
5 changed files with 27 additions and 4 deletions

View File

@@ -94,6 +94,10 @@ if (rc==null)
menu = mprov.getInlineMenu(user,VeniceNamespaces.CONTENT_LAF_NAMESPACE,"find.menu",cast.newIntArray(0));
ndx = menu.getItemContainingLinkText("find_categories.js.vs");
menu.setSelectedIndex(ndx);
globals = vcast.getGlobalPropertiesStore(req);
opts = cast.toOptionSet(globals.getObject(VeniceNamespaces.COMMUNITY_GLOBALS_NAMESPACE,"options"));
if (opts.get(0))
menu.setVariable("use_categories",Boolean.TRUE);
rc.setParameter("menu",menu);
} // end if

View File

@@ -36,6 +36,11 @@ session.setObject("/find.js.vs","last.visited","find_communities.js.vs");
// Get the user's configured page size.
pagesize = cast.toInteger(user.getObject(VeniceNamespaces.USER_SETTINGS_NAMESPACE,"search.result.count"));
// Get the "use categories" flag.
globals = vcast.getGlobalPropertiesStore(req);
opts = cast.toOptionSet(globals.getObject(VeniceNamespaces.COMMUNITY_GLOBALS_NAMESPACE,"options"));
use_categories = opts.get(0);
field = CommunitySearchField.NAME;
mode = SearchMode.PREFIX;
term = "";
@@ -53,7 +58,7 @@ if (rhelp.isVerb("POST"))
ofs = rhelp.getParameterInt("ofs",0);
fcount = rhelp.getParameterInt("fcount",-1);
if (rhelp.hasParameter("cat"))
if (use_categories && rhelp.hasParameter("cat"))
{ // get the current category
catsvc = vcast.queryCategoryService(rhelp.getRequestObject(Namespaces.DYNAMO_OBJECT_NAMESPACE,"categories"));
category = catsvc.getCategory(rhelp.getParameterInt("cat",-1));
@@ -100,7 +105,7 @@ if (rhelp.isVerb("POST"))
} // end catch
} // end if
else
else if (use_categories)
{ // get the category we're loading
catsvc = vcast.queryCategoryService(rhelp.getRequestObject(Namespaces.DYNAMO_OBJECT_NAMESPACE,"categories"));
commsvc = vcast.queryCommunityService(rhelp.getRequestObject(Namespaces.DYNAMO_OBJECT_NAMESPACE,"communities"));
@@ -140,6 +145,8 @@ if (rc==null)
menu = mprov.getInlineMenu(user,VeniceNamespaces.CONTENT_LAF_NAMESPACE,"find.menu",cast.newIntArray(0));
ndx = menu.getItemContainingLinkText("find_communities.js.vs");
menu.setSelectedIndex(ndx);
if (use_categories)
menu.setVariable("use_categories",Boolean.TRUE);
rc.setParameter("menu",menu);
} // end if

View File

@@ -98,6 +98,10 @@ if (rc==null)
menu = mprov.getInlineMenu(user,VeniceNamespaces.CONTENT_LAF_NAMESPACE,"find.menu",cast.newIntArray(0));
ndx = menu.getItemContainingLinkText("find_users.js.vs");
menu.setSelectedIndex(ndx);
globals = vcast.getGlobalPropertiesStore(req);
opts = cast.toOptionSet(globals.getObject(VeniceNamespaces.COMMUNITY_GLOBALS_NAMESPACE,"options"));
if (opts.get(0))
menu.setVariable("use_categories",Boolean.TRUE);
rc.setParameter("menu",menu);
} // end if