diff --git a/etc/ui-config.xml b/etc/ui-config.xml index 69ff501..882c721 100644 --- a/etc/ui-config.xml +++ b/etc/ui-config.xml @@ -12,7 +12,7 @@ The Initial Developer of the Original Code is Eric J. Bowersox , 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): --> @@ -341,8 +341,8 @@ Text of this agreement is TBD. Community Administration: ${name} Community Profile - Set Community Category - Set Community Services + Set Community Category + Set Community Services Membership Control E-Mail To All Members Display Audit Records @@ -353,7 +353,7 @@ Text of this agreement is TBD. System Administration Edit Global Properties - View/Edit Banned Users + View/Edit Banned Users User Account Management System Audit Logs Import User Accounts @@ -584,6 +584,7 @@ the community's host, or via an invitation e-mail message. Please enter it in th
+
diff --git a/etc/web.xml b/etc/web.xml index 8f6afb8..badc1eb 100644 --- a/etc/web.xml +++ b/etc/web.xml @@ -15,7 +15,7 @@ The Initial Developer of the Original Code is Eric J. Bowersox , 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): --> @@ -209,6 +209,11 @@ /WEB-INF/tlds/frame-taglib.tld + + /tlds/global + /WEB-INF/tlds/global-taglib.tld + + /tlds/user /WEB-INF/tlds/user-taglib.tld diff --git a/scripts/comm/admin_menu.js b/scripts/comm/admin_menu.js index 6c87295..209be91 100644 --- a/scripts/comm/admin_menu.js +++ b/scripts/comm/admin_menu.js @@ -10,7 +10,7 @@ // // The Initial Developer of the Original Code is Eric J. Bowersox , // 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); diff --git a/scripts/find.js b/scripts/find.js index 0852c60..8bc2bb8 100644 --- a/scripts/find.js +++ b/scripts/find.js @@ -10,7 +10,7 @@ // // The Initial Developer of the Original Code is Eric J. Bowersox , // 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) diff --git a/scripts/sysadmin/global.js b/scripts/sysadmin/global.js index 5b53b5e..c4bac37 100644 --- a/scripts/sysadmin/global.js +++ b/scripts/sysadmin/global.js @@ -10,7 +10,7 @@ // // The Initial Developer of the Original Code is Eric J. Bowersox , // 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 diff --git a/src/com/silverwrist/venice/core/GlobalProperties.java b/src/com/silverwrist/venice/core/GlobalProperties.java index fd02b7d..d56c63e 100644 --- a/src/com/silverwrist/venice/core/GlobalProperties.java +++ b/src/com/silverwrist/venice/core/GlobalProperties.java @@ -11,7 +11,7 @@ * * The Initial Developer of the Original Code is Eric J. Bowersox , * 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): */ @@ -33,6 +33,7 @@ public final class GlobalProperties private int audit_records_per_page; private int community_create_level; private boolean display_post_pictures; + private boolean disable_categories; /*-------------------------------------------------------------------------------- * Constructor @@ -50,6 +51,7 @@ public final class GlobalProperties audit_records_per_page = 100; community_create_level = 1000; // this is actually the "normal user" security level display_post_pictures = false; + disable_categories = false; } // end constructor @@ -166,4 +168,16 @@ public final class GlobalProperties } // end setDisplayPostPictures + public final boolean getDisableCategories() + { + return disable_categories; + + } // end getDisableCategories + + public final void setDisableCategories(boolean b) + { + disable_categories = b; + + } // end setDisableCategories + } // end class GlobalProperties diff --git a/src/com/silverwrist/venice/core/VeniceEngine.java b/src/com/silverwrist/venice/core/VeniceEngine.java index 341026b..9fb5fbd 100644 --- a/src/com/silverwrist/venice/core/VeniceEngine.java +++ b/src/com/silverwrist/venice/core/VeniceEngine.java @@ -11,7 +11,7 @@ * * The Initial Developer of the Original Code is Eric J. Bowersox , * 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): */ @@ -89,4 +89,6 @@ public interface VeniceEngine extends SearchMode, ServiceGroup public abstract SecurityInfo getSecurityInfo(); + public abstract boolean useCategories(); + } // end interface VeniceEngine diff --git a/src/com/silverwrist/venice/core/impl/CommunityUserContextImpl.java b/src/com/silverwrist/venice/core/impl/CommunityUserContextImpl.java index 0827b4b..98a9755 100644 --- a/src/com/silverwrist/venice/core/impl/CommunityUserContextImpl.java +++ b/src/com/silverwrist/venice/core/impl/CommunityUserContextImpl.java @@ -334,6 +334,8 @@ class CommunityUserContextImpl implements CommunityContext, CommunityBackend public int getCategoryID() { + if (env.getEngine().getParamBoolean(EngineBackend.BP_NOCATEGORIES)) + return 0; CommunityData d = getDataNE(); if (d!=null) return d.getCategoryID(); @@ -344,6 +346,8 @@ class CommunityUserContextImpl implements CommunityContext, CommunityBackend public CategoryDescriptor getCategory() throws DataException { + if (env.getEngine().getParamBoolean(EngineBackend.BP_NOCATEGORIES)) + throw new DataException("The category system has been disabled on this site."); if (deleted) throw new DataException("This community has been deleted."); return new CategoryDescriptorImpl(env,getData().getCategoryID(), @@ -571,6 +575,8 @@ class CommunityUserContextImpl implements CommunityContext, CommunityBackend public void setCategoryID(int catid) throws DataException, AccessError { + if (env.getEngine().getParamBoolean(EngineBackend.BP_NOCATEGORIES)) + throw new DataException("The category system has been disabled on this site."); getData().testMembership(level,is_member); if (!(getData().canModifyCommunityProfile(level))) { // this user can't modify the community feature set diff --git a/src/com/silverwrist/venice/core/impl/UserContextImpl.java b/src/com/silverwrist/venice/core/impl/UserContextImpl.java index d4e0554..9aa43bc 100644 --- a/src/com/silverwrist/venice/core/impl/UserContextImpl.java +++ b/src/com/silverwrist/venice/core/impl/UserContextImpl.java @@ -865,12 +865,16 @@ class UserContextImpl implements UserContext, UserBackend public List getRootCategoryList() throws DataException { + if (env.getEngine().getParamBoolean(EngineBackend.BP_NOCATEGORIES)) + throw new DataException("The category system has been disabled on this site."); return CategoryDescriptorImpl.getTopLevelCategoryList(env,env.testPermission(EnvUser.PERM_SHOWHIDDENCATS)); } // end getRootCategoryList public CategoryDescriptor getCategoryDescriptor(int catid) throws DataException { + if (env.getEngine().getParamBoolean(EngineBackend.BP_NOCATEGORIES)) + throw new DataException("The category system has been disabled on this site."); return new CategoryDescriptorImpl(env,catid,!(env.testPermission(EnvUser.PERM_SHOWHIDDENCATS))); } // end getCategoryDescriptor @@ -890,30 +894,40 @@ class UserContextImpl implements UserContext, UserBackend public List getCommunitiesInCategory(int catid, int offset, int count) throws DataException { + if (env.getEngine().getParamBoolean(EngineBackend.BP_NOCATEGORIES)) + throw new DataException("The category system has been disabled on this site."); return CommunityUserContextImpl.getCommunitiesInCategory(env,catid,offset,count); } // end getCommunitiesInCategory public List getCommunitiesInCategory(CategoryDescriptor cat, int offset, int count) throws DataException { + if (env.getEngine().getParamBoolean(EngineBackend.BP_NOCATEGORIES)) + throw new DataException("The category system has been disabled on this site."); return CommunityUserContextImpl.getCommunitiesInCategory(env,cat.getLinkedCategoryID(),offset,count); } // end getCommunitiesInCategory public int getNumCommunitiesInCategory(int catid) throws DataException { + if (env.getEngine().getParamBoolean(EngineBackend.BP_NOCATEGORIES)) + throw new DataException("The category system has been disabled on this site."); return CommunityUserContextImpl.getNumCommunitiesInCategory(env,catid); } // end getNumCommunitiessInCategory public int getNumCommunitiesInCategory(CategoryDescriptor cat) throws DataException { + if (env.getEngine().getParamBoolean(EngineBackend.BP_NOCATEGORIES)) + throw new DataException("The category system has been disabled on this site."); return CommunityUserContextImpl.getNumCommunitiesInCategory(env,cat.getLinkedCategoryID()); } // end getNumCommunitiesInCategory public List searchForCategories(int mode, String term, int offset, int count) throws DataException { + if (env.getEngine().getParamBoolean(EngineBackend.BP_NOCATEGORIES)) + throw new DataException("The category system has been disabled on this site."); return CategoryDescriptorImpl.searchForCategories(env,env.testPermission(EnvUser.PERM_SHOWHIDDENCATS), env.testPermission(EnvUser.PERM_SEARCHHIDDENCATS),mode, term,offset,count); @@ -922,6 +936,8 @@ class UserContextImpl implements UserContext, UserBackend public int getSearchCategoryCount(int mode, String term) throws DataException { + if (env.getEngine().getParamBoolean(EngineBackend.BP_NOCATEGORIES)) + throw new DataException("The category system has been disabled on this site."); return CategoryDescriptorImpl.getSearchCategoryCount(env,env.testPermission(EnvUser.PERM_SHOWHIDDENCATS), env.testPermission(EnvUser.PERM_SEARCHHIDDENCATS), mode,term); diff --git a/src/com/silverwrist/venice/core/impl/VeniceEngineImpl.java b/src/com/silverwrist/venice/core/impl/VeniceEngineImpl.java index b14127c..82ed7b3 100644 --- a/src/com/silverwrist/venice/core/impl/VeniceEngineImpl.java +++ b/src/com/silverwrist/venice/core/impl/VeniceEngineImpl.java @@ -11,7 +11,7 @@ * * The Initial Developer of the Original Code is Eric J. Bowersox , * 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): */ @@ -441,6 +441,7 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend rc.setAuditRecordsPerPage(gp_ints[IP_NUMAUDITRECSPERPAGE]); rc.setCommunityCreateLevel(gp_ints[IP_CREATECOMMUNITYLVL]); rc.setDisplayPostPictures(global_flags.get(BP_POSTPICTURES)); + rc.setDisableCategories(global_flags.get(BP_NOCATEGORIES)); return rc; } // end createProperties @@ -450,6 +451,8 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend BitSet rc = new BitSet(); if (global_flags.assign(BP_POSTPICTURES,props.getDisplayPostPictures())) rc.set(PROP_FLAGS); + if (global_flags.assign(BP_NOCATEGORIES,props.getDisableCategories())) + rc.set(PROP_FLAGS); if (gp_ints[IP_POSTSPERPAGE]!=props.getPostsPerPage()) { // record variable change gp_ints[IP_POSTSPERPAGE] = props.getPostsPerPage(); @@ -1085,6 +1088,8 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend checkInitialized(); if (catid==-1) return true; // valid by definition, it means "Top" + if (global_flags.get(BP_NOCATEGORIES)) + return (catid==0); // EJB 1/16/2001 - if categories are disabled, the only valid one is "unclassified" Connection conn = null; try @@ -1477,6 +1482,12 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend } // end getSecurityInfo + public boolean useCategories() + { + return !(global_flags.get(BP_NOCATEGORIES)); + + } // end useCategories + /*-------------------------------------------------------------------------------- * Implementations from interface EngineBackend *-------------------------------------------------------------------------------- diff --git a/src/com/silverwrist/venice/core/internals/EngineBackend.java b/src/com/silverwrist/venice/core/internals/EngineBackend.java index 3a76086..8f45f58 100644 --- a/src/com/silverwrist/venice/core/internals/EngineBackend.java +++ b/src/com/silverwrist/venice/core/internals/EngineBackend.java @@ -11,7 +11,7 @@ * * The Initial Developer of the Original Code is Eric J. Bowersox , * 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): */ @@ -51,6 +51,7 @@ public interface EngineBackend // Boolean parameter indexes public static final int BP_POSTPICTURES = 0; + public static final int BP_NOCATEGORIES = 1; // role parameter indexes public static final int ROLEP_CREATECOMMUNITY = 0; diff --git a/src/com/silverwrist/venice/ui/jsp/GlobalCategoriesDisabledTag.java b/src/com/silverwrist/venice/ui/jsp/GlobalCategoriesDisabledTag.java new file mode 100644 index 0000000..5b61689 --- /dev/null +++ b/src/com/silverwrist/venice/ui/jsp/GlobalCategoriesDisabledTag.java @@ -0,0 +1,38 @@ +/* + * The contents of this file are subject to the Mozilla Public License Version 1.1 + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at . + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is the Venice Web Communities System. + * + * The Initial Developer of the Original Code is Eric J. Bowersox , + * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are + * Copyright (C) 2002 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. + * + * Contributor(s): + */ +package com.silverwrist.venice.ui.jsp; + +import javax.servlet.jsp.*; +import javax.servlet.jsp.tagext.*; +import com.silverwrist.venice.core.*; +import com.silverwrist.venice.ui.*; + +public class GlobalCategoriesDisabledTag extends VeniceTagSupport +{ + /*-------------------------------------------------------------------------------- + * Overrides from class TagSupport + *-------------------------------------------------------------------------------- + */ + + public int doStartTag() throws JspException + { + return (getRequestInput().getEngine().useCategories() ? SKIP_BODY : EVAL_BODY_INCLUDE); + + } // end doStartTag + +} // end class GlobalCategoriesDisabledTag diff --git a/src/com/silverwrist/venice/ui/jsp/GlobalCategoriesEnabledTag.java b/src/com/silverwrist/venice/ui/jsp/GlobalCategoriesEnabledTag.java new file mode 100644 index 0000000..a1029af --- /dev/null +++ b/src/com/silverwrist/venice/ui/jsp/GlobalCategoriesEnabledTag.java @@ -0,0 +1,38 @@ +/* + * The contents of this file are subject to the Mozilla Public License Version 1.1 + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at . + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is the Venice Web Communities System. + * + * The Initial Developer of the Original Code is Eric J. Bowersox , + * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are + * Copyright (C) 2002 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. + * + * Contributor(s): + */ +package com.silverwrist.venice.ui.jsp; + +import javax.servlet.jsp.*; +import javax.servlet.jsp.tagext.*; +import com.silverwrist.venice.core.*; +import com.silverwrist.venice.ui.*; + +public class GlobalCategoriesEnabledTag extends VeniceTagSupport +{ + /*-------------------------------------------------------------------------------- + * Overrides from class TagSupport + *-------------------------------------------------------------------------------- + */ + + public int doStartTag() throws JspException + { + return (getRequestInput().getEngine().useCategories() ? EVAL_BODY_INCLUDE : SKIP_BODY); + + } // end doStartTag + +} // end class GlobalCategoriesEnabledTag diff --git a/src/com/silverwrist/venice/ui/menus/CommunityMenu.java b/src/com/silverwrist/venice/ui/menus/CommunityMenu.java index d8b14b8..324a6cf 100644 --- a/src/com/silverwrist/venice/ui/menus/CommunityMenu.java +++ b/src/com/silverwrist/venice/ui/menus/CommunityMenu.java @@ -11,7 +11,7 @@ * * The Initial Developer of the Original Code is Eric J. Bowersox , * 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): */ @@ -70,6 +70,12 @@ public class CommunityMenu implements MenuComponent, ColorSelectors, LinkTypes */ public void render(RequestOutput out, Writer wr) throws IOException + { + this.render(out,wr,Collections.EMPTY_SET); + + } // end render + + public void render(RequestOutput out, Writer wr, Set defines) throws IOException { if (wr==null) wr = out.getWriter(); @@ -86,7 +92,7 @@ public class CommunityMenu implements MenuComponent, ColorSelectors, LinkTypes while (it.hasNext()) { // display each menu item in turn MenuComponent mc = (MenuComponent)(it.next()); - mc.render(out,wr); + mc.render(out,wr,defines); } // end while @@ -100,6 +106,12 @@ public class CommunityMenu implements MenuComponent, ColorSelectors, LinkTypes } // end render public void renderOnLeft(RequestOutput out, Writer wr) throws IOException + { + this.renderOnLeft(out,wr,Collections.EMPTY_SET); + + } // end renderOnLeft + + public void renderOnLeft(RequestOutput out, Writer wr, Set defines) throws IOException { if (wr==null) wr = out.getWriter(); @@ -114,7 +126,7 @@ public class CommunityMenu implements MenuComponent, ColorSelectors, LinkTypes while (it.hasNext()) { // display each menu item in turn MenuComponent mc = (MenuComponent)(it.next()); - mc.renderOnLeft(out,wr); + mc.renderOnLeft(out,wr,defines); } // end while diff --git a/src/com/silverwrist/venice/ui/menus/HeaderItem.java b/src/com/silverwrist/venice/ui/menus/HeaderItem.java index 1920723..d98ff5f 100644 --- a/src/com/silverwrist/venice/ui/menus/HeaderItem.java +++ b/src/com/silverwrist/venice/ui/menus/HeaderItem.java @@ -11,7 +11,7 @@ * * The Initial Developer of the Original Code is Eric J. Bowersox , * 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): */ @@ -19,6 +19,7 @@ package com.silverwrist.venice.ui.menus; import java.io.IOException; import java.io.Writer; +import java.util.Set; import org.w3c.dom.*; import com.silverwrist.util.DOMElementHelper; import com.silverwrist.venice.ui.RequestOutput; @@ -50,21 +51,33 @@ class HeaderItem implements MenuComponent */ public void render(RequestOutput out, Writer wr) throws IOException + { + this.render(out,wr,java.util.Collections.EMPTY_SET); + + } // end render + + public void render(RequestOutput out, Writer wr, Set defines) throws IOException { if (wr==null) wr = out.getWriter(); wr.write(""); - subitem.render(out,wr); + subitem.render(out,wr,defines); wr.write("
\n"); } // end render public void renderOnLeft(RequestOutput out, Writer wr) throws IOException + { + this.renderOnLeft(out,wr,java.util.Collections.EMPTY_SET); + + } // end renderOnLeft + + public void renderOnLeft(RequestOutput out, Writer wr, Set defines) throws IOException { if (wr==null) wr = out.getWriter(); wr.write(""); - subitem.renderOnLeft(out,wr); + subitem.renderOnLeft(out,wr,defines); wr.write("
\n"); } // end renderOnLeft diff --git a/src/com/silverwrist/venice/ui/menus/ImageItem.java b/src/com/silverwrist/venice/ui/menus/ImageItem.java index c8cf01c..79aaaf6 100644 --- a/src/com/silverwrist/venice/ui/menus/ImageItem.java +++ b/src/com/silverwrist/venice/ui/menus/ImageItem.java @@ -11,7 +11,7 @@ * * The Initial Developer of the Original Code is Eric J. Bowersox , * 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): */ @@ -19,6 +19,7 @@ package com.silverwrist.venice.ui.menus; import java.io.IOException; import java.io.Writer; +import java.util.Set; import org.w3c.dom.*; import com.silverwrist.util.DOMElementHelper; import com.silverwrist.venice.except.ConfigException; @@ -72,6 +73,12 @@ class ImageItem implements MenuComponent */ public void render(RequestOutput out, Writer wr) throws IOException + { + this.render(out,wr,java.util.Collections.EMPTY_SET); + + } // end render + + public void render(RequestOutput out, Writer wr, Set defines) throws IOException { if (wr==null) wr = out.getWriter(); @@ -94,7 +101,13 @@ class ImageItem implements MenuComponent public void renderOnLeft(RequestOutput out, Writer wr) throws IOException { - this.render(out,wr); + this.render(out,wr,java.util.Collections.EMPTY_SET); + + } // end renderOnLeft + + public void renderOnLeft(RequestOutput out, Writer wr, Set defines) throws IOException + { + this.render(out,wr,defines); } // end renderOnLeft diff --git a/src/com/silverwrist/venice/ui/menus/LinkItem.java b/src/com/silverwrist/venice/ui/menus/LinkItem.java index 4030642..78761b9 100644 --- a/src/com/silverwrist/venice/ui/menus/LinkItem.java +++ b/src/com/silverwrist/venice/ui/menus/LinkItem.java @@ -20,6 +20,7 @@ package com.silverwrist.venice.ui.menus; import java.io.IOException; import java.io.Writer; import java.util.Map; +import java.util.Set; import org.apache.log4j.*; import org.w3c.dom.*; import com.silverwrist.util.*; @@ -48,6 +49,8 @@ class LinkItem implements MenuComponent, ColorSelectors, LinkTypes private String target = null; // target window for the link private String title = null; // title (tooltip) for the link private String on_click = null; // onClick JavaScript for the link + private String ifdef_sym = null; // include only if defined + private String ifndef_sym = null; // include only if NOT defined private int indent = 0; // how many spaces do we indent this link? private MenuComponent contents; // what does this link contain? (image vs. text) @@ -87,6 +90,12 @@ class LinkItem implements MenuComponent, ColorSelectors, LinkTypes if (h.hasAttribute("onClick")) on_click = elt.getAttribute("onClick"); + // load the "ifdef" and "ifndef" symbols + if (h.hasAttribute("ifdef")) + ifdef_sym = elt.getAttribute("ifdef"); + if (h.hasAttribute("ifndef")) + ifndef_sym = elt.getAttribute("ifndef"); + // load the "disabled" attribute if (h.hasAttribute("disabled")) enabled = false; @@ -120,6 +129,8 @@ class LinkItem implements MenuComponent, ColorSelectors, LinkTypes this.target = other.target; this.title = other.title; this.on_click = StringUtil.replaceAllVariables(other.on_click,vars); + this.ifdef_sym = other.ifdef_sym; + this.ifndef_sym = other.ifndef_sym; this.indent = other.indent; this.contents = other.contents; @@ -132,6 +143,16 @@ class LinkItem implements MenuComponent, ColorSelectors, LinkTypes public void render(RequestOutput out, Writer wr) throws IOException { + this.render(out,wr,java.util.Collections.EMPTY_SET); + + } // end render + + public void render(RequestOutput out, Writer wr, Set defines) throws IOException + { + if ((ifdef_sym!=null) && !(defines.contains(ifdef_sym))) + return; + if ((ifndef_sym!=null) && defines.contains(ifndef_sym)) + return; if (wr==null) wr = out.getWriter(); for (int i=0; i"); else @@ -163,6 +184,16 @@ class LinkItem implements MenuComponent, ColorSelectors, LinkTypes public void renderOnLeft(RequestOutput out, Writer wr) throws IOException { + this.renderOnLeft(out,wr,java.util.Collections.EMPTY_SET); + + } // end renderOnLeft + + public void renderOnLeft(RequestOutput out, Writer wr, Set defines) throws IOException + { + if ((ifdef_sym!=null) && !(defines.contains(ifdef_sym))) + return; + if ((ifndef_sym!=null) && defines.contains(ifndef_sym)) + return; if (wr==null) wr = out.getWriter(); for (int i=0; i"); if (enabled) wr.write(""); diff --git a/src/com/silverwrist/venice/ui/menus/Menu.java b/src/com/silverwrist/venice/ui/menus/Menu.java index cc5f3da..dccf09a 100644 --- a/src/com/silverwrist/venice/ui/menus/Menu.java +++ b/src/com/silverwrist/venice/ui/menus/Menu.java @@ -11,7 +11,7 @@ * * The Initial Developer of the Original Code is Eric J. Bowersox , * 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): */ @@ -137,6 +137,12 @@ public class Menu implements MenuComponent, ColorSelectors */ public void render(RequestOutput out, Writer wr) throws IOException + { + this.render(out,wr,Collections.EMPTY_SET); + + } // end render + + public void render(RequestOutput out, Writer wr, Set defines) throws IOException { if (title!=null) { // write the header @@ -160,7 +166,7 @@ public class Menu implements MenuComponent, ColorSelectors while (it.hasNext()) { // render each menu item in turn MenuComponent mc = (MenuComponent)(it.next()); - mc.render(out,wr); + mc.render(out,wr,defines); } // end while @@ -176,6 +182,12 @@ public class Menu implements MenuComponent, ColorSelectors } // end render public void renderOnLeft(RequestOutput out, Writer wr) throws IOException + { + this.renderOnLeft(out,wr,Collections.EMPTY_SET); + + } // end renderOnLeft + + public void renderOnLeft(RequestOutput out, Writer wr, Set defines) throws IOException { if (wr==null) wr = out.getWriter(); @@ -191,7 +203,7 @@ public class Menu implements MenuComponent, ColorSelectors while (it.hasNext()) { // render each menu item in turn MenuComponent mc = (MenuComponent)(it.next()); - mc.renderOnLeft(out,wr); + mc.renderOnLeft(out,wr,defines); } // end while diff --git a/src/com/silverwrist/venice/ui/menus/MenuComponent.java b/src/com/silverwrist/venice/ui/menus/MenuComponent.java index bf35ffa..e3e1db9 100644 --- a/src/com/silverwrist/venice/ui/menus/MenuComponent.java +++ b/src/com/silverwrist/venice/ui/menus/MenuComponent.java @@ -11,7 +11,7 @@ * * The Initial Developer of the Original Code is Eric J. Bowersox , * 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): */ @@ -19,14 +19,19 @@ package com.silverwrist.venice.ui.menus; import java.io.IOException; import java.io.Writer; +import java.util.Set; import com.silverwrist.venice.ui.RequestOutput; public interface MenuComponent { public abstract void render(RequestOutput out, Writer wr) throws IOException; + public abstract void render(RequestOutput out, Writer wr, Set defines) throws IOException; + public abstract void renderOnLeft(RequestOutput out, Writer wr) throws IOException; + public abstract void renderOnLeft(RequestOutput out, Writer wr, Set defines) throws IOException; + public abstract String getTitle(RequestOutput out); } // end interface MenuComponent diff --git a/src/com/silverwrist/venice/ui/menus/SeparatorItem.java b/src/com/silverwrist/venice/ui/menus/SeparatorItem.java index 3927c89..c479be5 100644 --- a/src/com/silverwrist/venice/ui/menus/SeparatorItem.java +++ b/src/com/silverwrist/venice/ui/menus/SeparatorItem.java @@ -11,7 +11,7 @@ * * The Initial Developer of the Original Code is Eric J. Bowersox , * 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): */ @@ -19,6 +19,7 @@ package com.silverwrist.venice.ui.menus; import java.io.IOException; import java.io.Writer; +import java.util.Set; import com.silverwrist.venice.ui.RequestOutput; class SeparatorItem implements MenuComponent @@ -54,9 +55,15 @@ class SeparatorItem implements MenuComponent */ public void render(RequestOutput out, Writer wr) throws IOException + { + this.render(out,wr,java.util.Collections.EMPTY_SET); + + } // end render + + public void render(RequestOutput out, Writer wr, Set defines) throws IOException { if (subitem!=null) - subitem.render(out,wr); + subitem.render(out,wr,defines); if (wr==null) wr = out.getWriter(); wr.write("
\n"); @@ -64,9 +71,15 @@ class SeparatorItem implements MenuComponent } // end render public void renderOnLeft(RequestOutput out, Writer wr) throws IOException + { + this.renderOnLeft(out,wr,java.util.Collections.EMPTY_SET); + + } // end renderOnLeft + + public void renderOnLeft(RequestOutput out, Writer wr, Set defines) throws IOException { if (subitem!=null) - subitem.renderOnLeft(out,wr); + subitem.renderOnLeft(out,wr,defines); if (wr==null) wr = out.getWriter(); wr.write("
\n"); diff --git a/src/com/silverwrist/venice/ui/menus/TextItem.java b/src/com/silverwrist/venice/ui/menus/TextItem.java index 21c983a..593a546 100644 --- a/src/com/silverwrist/venice/ui/menus/TextItem.java +++ b/src/com/silverwrist/venice/ui/menus/TextItem.java @@ -11,7 +11,7 @@ * * The Initial Developer of the Original Code is Eric J. Bowersox , * 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): */ @@ -19,6 +19,7 @@ package com.silverwrist.venice.ui.menus; import java.io.IOException; import java.io.Writer; +import java.util.Set; import com.silverwrist.util.StringUtil; import com.silverwrist.venice.ui.RequestOutput; @@ -48,6 +49,12 @@ class TextItem implements MenuComponent */ public void render(RequestOutput out, Writer wr) throws IOException + { + this.render(out,wr,java.util.Collections.EMPTY_SET); + + } // end render + + public void render(RequestOutput out, Writer wr, Set defines) throws IOException { if (wr==null) out.write(contents); @@ -58,10 +65,13 @@ class TextItem implements MenuComponent public void renderOnLeft(RequestOutput out, Writer wr) throws IOException { - if (wr==null) - out.write(contents); - else - wr.write(contents); + this.render(out,wr,java.util.Collections.EMPTY_SET); + + } // end renderOnLeft + + public void renderOnLeft(RequestOutput out, Writer wr, Set defines) throws IOException + { + this.render(out,wr,defines); } // end renderOnLeft diff --git a/src/com/silverwrist/venice/ui/view/MenuView.java b/src/com/silverwrist/venice/ui/view/MenuView.java index 87601b1..28e25b9 100644 --- a/src/com/silverwrist/venice/ui/view/MenuView.java +++ b/src/com/silverwrist/venice/ui/view/MenuView.java @@ -11,7 +11,7 @@ * * The Initial Developer of the Original Code is Eric J. Bowersox , * 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): */ @@ -33,6 +33,7 @@ public class MenuView implements ContentDirect private int menu_selector = MENU_SELECTOR_NOCHANGE; private String qid = null; private MenuComponent component; + private Set defines = Collections.EMPTY_SET; /*-------------------------------------------------------------------------------- * Constructor @@ -81,7 +82,7 @@ public class MenuView implements ContentDirect public void render(RequestOutput out) throws IOException { - component.render(out,null); + component.render(out,null,defines); } // end render @@ -102,4 +103,12 @@ public class MenuView implements ContentDirect } // end setPageQID + public final void define(String symbol) + { + if (defines==Collections.EMPTY_SET) + defines = new HashSet(); + defines.add(symbol); + + } // end define + } // end class MenuView diff --git a/tlds/global-taglib.tld b/tlds/global-taglib.tld new file mode 100644 index 0000000..7191836 --- /dev/null +++ b/tlds/global-taglib.tld @@ -0,0 +1,46 @@ + + + + + + + + 0.1 + 1.1 + global + + Tag library used to access various global elements. + + + categories_enabled + com.silverwrist.venice.ui.jsp.GlobalCategoriesEnabledTag + Includes its content if categories are enabled in the engine. + JSP + + + + categories_disabled + com.silverwrist.venice.ui.jsp.GlobalCategoriesDisabledTag + Includes its content if categories are disabled in the engine. + JSP + + + diff --git a/web/format/comm/profile.jsp b/web/format/comm/profile.jsp index 79d4ecc..b9ceaf6 100644 --- a/web/format/comm/profile.jsp +++ b/web/format/comm/profile.jsp @@ -11,7 +11,7 @@ The Initial Developer of the Original Code is Eric J. Bowersox , 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): --%> @@ -20,6 +20,7 @@ <%@ page import = "com.silverwrist.venice.ui.view.FindView" %> <%@ page import = "com.silverwrist.venice.ui.view.JSPView" %> <%@ taglib uri="/tlds/util" prefix="util" %> +<%@ taglib uri="/tlds/global" prefix="global" %> <%@ taglib uri="/tlds/user" prefix="user" %> <%@ taglib uri="/tlds/community" prefix="comm" %> <% @@ -66,17 +67,23 @@ - Public Community
- Private Community
- Category: - <% CategoryDescriptor cat = (CategoryDescriptor)(view.getRequestAttribute("category")); %> - <% for (int i=0; i - <% if (i>0) { %>: <% } %> - - find.js.vs?disp=<%= FindView.FD_COMMUNITIES %>&cat=<%= cat.getIDAtLevel(i) %> - <%= cat.getTitleAtLevel(i) %> - - <% } // end for %>

+ Public Community + Private Community + +
+ Category: + <% CategoryDescriptor cat = (CategoryDescriptor)(view.getRequestAttribute("category")); %> + <% for (int i=0; i + <% if (i>0) { %>: <% } %> + + + find.js.vs?disp=<%= FindView.FD_COMMUNITIES %>&cat=<%= cat.getIDAtLevel(i) %> + + <%= cat.getTitleAtLevel(i) %> + + <% } // end for %> +
+

<% UserProfile prof = (UserProfile)(view.getRequestAttribute("host.profile")); %> diff --git a/web/format/find.jsp b/web/format/find.jsp index cabbc40..5597087 100644 --- a/web/format/find.jsp +++ b/web/format/find.jsp @@ -11,7 +11,7 @@ The Initial Developer of the Original Code is Eric J. Bowersox , 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): --%> @@ -20,8 +20,10 @@ <%@ page import = "com.silverwrist.venice.core.*" %> <%@ page import = "com.silverwrist.venice.ui.view.FindView" %> <%@ taglib uri="/tlds/util" prefix="util" %> +<%@ taglib uri="/tlds/global" prefix="global" %> <% FindView data = FindView.get(request); + CategoryDescriptor cat = null; %> Find page @@ -47,17 +49,19 @@ Users <% } // end if %> - <% if (data.testDisplayMode(FindView.FD_CATEGORIES)) { %> - - find.js.vs?disp=<%= FindView.FD_CATEGORIES %> - Categories - - <% } else { %> - - find.js.vs?disp=<%= FindView.FD_CATEGORIES %> - Categories - - <% } // end if %> + + <% if (data.testDisplayMode(FindView.FD_CATEGORIES)) { %> + + find.js.vs?disp=<%= FindView.FD_CATEGORIES %> + Categories + + <% } else { %> + + find.js.vs?disp=<%= FindView.FD_CATEGORIES %> + Categories + + <% } // end if %> + <% if (data.testDisplayMode(FindView.FD_POSTS)) { %> find.js.vs?disp=<%= FindView.FD_POSTS %> @@ -113,11 +117,17 @@
<% } else if (data.testDisplayMode(FindView.FD_CATEGORIES)) { %> - Find Categories form - Find Categories: - - Display all categories whose name   - + + Find Categories form + Find Categories: + + Display all categories whose name   + + + + <%-- shouldn't get here --%> +

Display parameter invalid!

+ <% } else { %> <%-- shouldn't get here --%>

Display parameter invalid!

@@ -141,56 +151,64 @@ <%-- Display the current category --%> -<% CategoryDescriptor cat = data.getCategory(); %> -<% if (cat!=null) { %> - Display Category Name -
- Category: - <% if (cat.getCategoryID()<0) { %> - Top - <% } else { %> - - find.js.vs?disp=<%= FindView.FD_COMMUNITIES %> - Top - - <% for (int i=0; i - <% if (i<(cat.getNumLevels()-1)) { %> - : - - find.js.vs?disp=<%= FindView.FD_COMMUNITIES %>&cat=<%= cat.getIDAtLevel(i) %> - <%= cat.getTitleAtLevel(i) %> - - <% } else { %> - : <%= cat.getTitleAtLevel(i) %> - <% } // end if %> - <% } // end for %> - <% } // end if (displaying the subcategory tree) %> -

- - <%-- Display the subcategory list --%> - <% List subcats = data.getSubCategories(); %> - <% if ((subcats!=null) && (subcats.size()>0)) { %> - Display Subcategory List - Subcategories:
- - <% Iterator it = subcats.iterator(); %> - <% while (it.hasNext()) { %> - - - - - <% } // end while %> -
- <% CategoryDescriptor c = (CategoryDescriptor)(it.next()); %> - - find.js.vs?disp=<%= FindView.FD_COMMUNITIES %>&cat=<%= c.getLinkedCategoryID() %> - <%= c.getTitleAtLevel(c.getNumLevels()-1) %> + + <% cat = data.getCategory(); %> + <% if (cat!=null) { %> + Display Category Name +
+ Category: + <% if (cat.getCategoryID()<0) { %> + Top + <% } else { %> + + find.js.vs?disp=<%= FindView.FD_COMMUNITIES %> + Top + + <% for (int i=0; i + <% if (i<(cat.getNumLevels()-1)) { %> + : + + + find.js.vs?disp=<%= FindView.FD_COMMUNITIES %>&cat=<%= cat.getIDAtLevel(i) %> + + <%= cat.getTitleAtLevel(i) %> - <% if (c.isSymbolicLink()) { %>@<% } %> -
- <% } // end if (displaying subcategory list) %> - -<% } // end if (category specified) %> + <% } else { %> + : <%= cat.getTitleAtLevel(i) %> + <% } // end if %> + <% } // end for %> + <% } // end if (displaying the subcategory tree) %> +

+ + <%-- Display the subcategory list --%> + <% List subcats = data.getSubCategories(); %> + <% if ((subcats!=null) && (subcats.size()>0)) { %> + Display Subcategory List + Subcategories:
+ + <% Iterator it = subcats.iterator(); %> + <% while (it.hasNext()) { %> + + + + + <% } // end while %> +
+ <% CategoryDescriptor c = (CategoryDescriptor)(it.next()); %> + + + find.js.vs?disp=<%= FindView.FD_COMMUNITIES %>&cat=<%= c.getLinkedCategoryID() %> + + + <%= c.getTitleAtLevel(c.getNumLevels()-1) %> + + + <% if (c.isSymbolicLink()) { %>@<% } %> +
+ <% } // end if (displaying subcategory list) %> + + <% } // end if (category specified) %> + <%-- Display the search results --%> <% List results = data.getResults(); %> @@ -332,11 +350,15 @@
<%= uf.getDescription() %> <% } // end if %> <% } else if (data.testDisplayMode(FindView.FD_CATEGORIES)) { %> - <% CategoryDescriptor cd = (CategoryDescriptor)item; %> - - find.js.vs?disp=<%= FindView.FD_COMMUNITIES %>&cat=<%= cd.getLinkedCategoryID() %> - <%= cd.toString() %> - + + <% CategoryDescriptor cd = (CategoryDescriptor)item; %> + + + find.js.vs?disp=<%= FindView.FD_COMMUNITIES %>&cat=<%= cd.getLinkedCategoryID() %> + + <%= cd.toString() %> + + <% } // end if %> <% } // end if %>