modifications to ensure that Venice can operate without certain personal

information prompted for at registration time, if certain sites should elect
to omit that information
This commit is contained in:
Eric J. Bowersox
2004-07-10 22:54:15 +00:00
parent 5c0f841ab7
commit f0bf5e31ee
9 changed files with 431 additions and 348 deletions

View File

@@ -9,14 +9,15 @@
The Original Code is the Venice Web Communities System.
The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
The Initial Developer of the Original Code is Eric J. Bowersox <erbo@ricochet.com>,
for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
Copyright (C) 2001-02 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
Contributor(s):
--%>
<%@ page import = "java.util.Iterator" %>
<%@ page import = "java.util.List" %>
<%@ page import = "com.silverwrist.util.*" %>
<%@ page import = "com.silverwrist.venice.core.*" %>
<%@ page import = "com.silverwrist.venice.ui.view.FindView" %>
<%@ taglib uri="/tlds/util" prefix="util" %>
@@ -77,86 +78,92 @@
<%-- Display the search form --%>
<util:comment>Find form</util:comment>
<util:form action="find.js.vs" type="servlet"><DIV CLASS="content">
<INPUT TYPE=HIDDEN NAME="disp" VALUE="<%= data.getDisplayMode() %>">
<INPUT TYPE=HIDDEN NAME="ofs" VALUE="0">
<util:form action="find.js.vs" type="servlet"><div class="content">
<input type="hidden" name="disp" value="<%= data.getDisplayMode() %>" />
<input type="hidden" name="ofs" VALUE="0" />
<% if (data.testDisplayMode(FindView.FD_POSTS)) { %>
<util:comment>Find Posts form</util:comment>
<util:font color="content.fg" size="content-heading"><B>Find Posts:</B></util:font>
<util:font color="content.fg" size="content-heading"><b>Find Posts:</b></util:font>
<util:font color="content.fg" size="content">
Keywords: <SPAN CLASS="cinput"><INPUT TYPE=TEXT CLASS="cinput" NAME="term" SIZE=64 MAXLENGTH=255
VALUE="<%= data.getTerm() %>"></SPAN>
</util:font><BR>
Keywords: <span class="cinput"><input type="text" class="cinput" name="term" size="64" maxlength="255"
value="<%= data.getTerm() %>" /></span>
</util:font><br />
<% } else { %>
<% if (data.testDisplayMode(FindView.FD_COMMUNITIES)) { %>
<util:comment>Find Communities form</util:comment>
<util:font color="content.fg" size="content-heading"><B>Find Communities:</B></util:font>
<util:font color="content.fg" size="content-heading"><b>Find Communities:</b></util:font>
<util:font color="content.fg" size="content">
Display all communities whose&nbsp;&nbsp;
<SELECT NAME="field" SIZE=1>
<OPTION VALUE="<%= SearchMode.FIELD_COMMUNITY_NAME %>"
<% if (data.testField(SearchMode.FIELD_COMMUNITY_NAME)) { %>SELECTED<% } %> >name</OPTION>
<OPTION VALUE="<%= SearchMode.FIELD_COMMUNITY_SYNOPSIS %>"
<% if (data.testField(SearchMode.FIELD_COMMUNITY_SYNOPSIS)) { %>SELECTED<% } %> >synopsis</OPTION>
</SELECT><BR>
<select name="field" size="1">
<option value="<%= SearchMode.FIELD_COMMUNITY_NAME %>"
<% if (data.testField(SearchMode.FIELD_COMMUNITY_NAME)) { %>selected="selected"<% } %> >name</option>
<option value="<%= SearchMode.FIELD_COMMUNITY_SYNOPSIS %>"
<% if (data.testField(SearchMode.FIELD_COMMUNITY_SYNOPSIS)) { %>selected="selected"<% } %>
>synopsis</option>
</select><br />
</util:font>
<% } else if (data.testDisplayMode(FindView.FD_USERS)) { %>
<util:comment>Find Users form</util:comment>
<util:font color="content.fg" size="content-heading"><B>Find Users:</B></util:font>
<util:font color="content.fg" size="content-heading"><b>Find Users:</b></util:font>
<util:font color="content.fg" size="content">
Display all users whose&nbsp;&nbsp;
<SELECT NAME="field" SIZE=1>
<OPTION VALUE="<%= SearchMode.FIELD_USER_NAME %>"
<% if (data.testField(SearchMode.FIELD_USER_NAME)) { %>SELECTED<% } %> >user name</OPTION>
<OPTION VALUE="<%= SearchMode.FIELD_USER_DESCRIPTION %>"
<% if (data.testField(SearchMode.FIELD_USER_DESCRIPTION)) { %>SELECTED<% } %> >description</OPTION>
<OPTION VALUE="<%= SearchMode.FIELD_USER_GIVEN_NAME %>"
<% if (data.testField(SearchMode.FIELD_USER_GIVEN_NAME)) { %>SELECTED<% } %> >first name</OPTION>
<OPTION VALUE="<%= SearchMode.FIELD_USER_FAMILY_NAME %>"
<% if (data.testField(SearchMode.FIELD_USER_FAMILY_NAME)) { %>SELECTED<% } %> >last name</OPTION>
</SELECT><BR>
<select name="field" size="1">
<option value="<%= SearchMode.FIELD_USER_NAME %>"
<% if (data.testField(SearchMode.FIELD_USER_NAME)) { %>selected="selected"<% } %> >user name</option>
<option value="<%= SearchMode.FIELD_USER_DESCRIPTION %>"
<% if (data.testField(SearchMode.FIELD_USER_DESCRIPTION)) { %>selected="selected"<% } %>
>description</option>
<option value="<%= SearchMode.FIELD_USER_GIVEN_NAME %>"
<% if (data.testField(SearchMode.FIELD_USER_GIVEN_NAME)) { %>selected="selected"<% } %> >first
name</option>
<option value="<%= SearchMode.FIELD_USER_FAMILY_NAME %>"
<% if (data.testField(SearchMode.FIELD_USER_FAMILY_NAME)) { %>selected="selected"<% } %> >last
name</option>
</select><br />
</util:font>
<% } else if (data.testDisplayMode(FindView.FD_CATEGORIES)) { %>
<global:categories_enabled>
<util:comment>Find Categories form</util:comment>
<util:font color="content.fg" size="content-heading"><B>Find Categories:</B></util:font>
<util:font color="content.fg" size="content-heading"><b>Find Categories:</b></util:font>
<util:font color="content.fg" size="content">
Display all categories whose name&nbsp;&nbsp;
</util:font>
</global:categories_enabled>
<global:categories_disabled>
<%-- shouldn't get here --%>
<H1><FONT COLOR="red">Display parameter invalid!</FONT></H1>
<h1><font color="red">Display parameter invalid!</font></h1>
</global:categories_disabled>
<% } else { %>
<%-- shouldn't get here --%>
<H1><FONT COLOR="red">Display parameter invalid!</FONT></H1>
<h1><font color="red">Display parameter invalid!</font></h1>
<% } // end if %>
<util:font color="content.fg" size="content">
<SELECT NAME="mode" SIZE=1>
<OPTION VALUE="<%= SearchMode.SEARCH_PREFIX %>"
<% if (data.testMode(SearchMode.SEARCH_PREFIX)) { %>SELECTED<% } %> >starts with the string</OPTION>
<OPTION VALUE="<%= SearchMode.SEARCH_SUBSTRING %>"
<% if (data.testMode(SearchMode.SEARCH_SUBSTRING)) { %>SELECTED<% } %> >contains the string</OPTION>
<OPTION VALUE="<%= SearchMode.SEARCH_REGEXP %>"
<% if (data.testMode(SearchMode.SEARCH_REGEXP)) { %>SELECTED<% } %> >matches the regular
expression</OPTION>
</SELECT>
<% if (data.testDisplayMode(FindView.FD_CATEGORIES)) { %><BR><% } else { %>&nbsp;&nbsp;<% } %>
<SPAN CLASS="cinput"><INPUT TYPE=TEXT CLASS="cinput" NAME="term" SIZE=32 MAXLENGTH=255
VALUE="<%= data.getTerm() %>"></SPAN><BR>
<select name="mode" size="1">
<option value="<%= SearchMode.SEARCH_PREFIX %>"
<% if (data.testMode(SearchMode.SEARCH_PREFIX)) { %>selected="selected"<% } %> >starts with the
string</option>
<option value="<%= SearchMode.SEARCH_SUBSTRING %>"
<% if (data.testMode(SearchMode.SEARCH_SUBSTRING)) { %>selected="selected"<% } %> >contains the
string</option>
<option value="<%= SearchMode.SEARCH_REGEXP %>"
<% if (data.testMode(SearchMode.SEARCH_REGEXP)) { %>selected="selected"<% } %> >matches the regular
expression</option>
</select>
<% if (data.testDisplayMode(FindView.FD_CATEGORIES)) { %><br /><% } else { %>&nbsp;&nbsp;<% } %>
<span class="cinput"><input type="text" class="cinput" name="term" size="32" maxlength="255"
value="<%= data.getTerm() %>"></span><br />
</util:font>
<% } // end if %>
<util:button id="search" type="input"/>
</DIV></util:form>
</div></util:form>
<%-- Display the current category --%>
<global:categories_enabled>
<% cat = data.getCategory(); %>
<% if (cat!=null) { %>
<util:comment>Display Category Name</util:comment>
<HR><util:font color="content.fg" size="subhead">
<B>Category:
<hr /><util:font color="content.fg" size="subhead">
<b>Category:
<% if (cat.getCategoryID()<0) { %>
Top
<% } else { %>
@@ -178,21 +185,20 @@
<% } // end if %>
<% } // end for %>
<% } // end if (displaying the subcategory tree) %>
</B><P>
</b><P>
<%-- Display the subcategory list --%>
<% List subcats = data.getSubCategories(); %>
<% if ((subcats!=null) && (subcats.size()>0)) { %>
<util:comment>Display Subcategory List</util:comment>
<B>Subcategories:</B><BR>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=2>
<% Iterator it = subcats.iterator(); %>
<% while (it.hasNext()) { %>
<TR VALIGN=TOP>
<TD ALIGN=CENTER WIDTH=14><util:stdbullet/></TD>
<TD ALIGN=LEFT CLASS="content"><util:font color="content.fg" size="content">
<% CategoryDescriptor c = (CategoryDescriptor)(it.next()); %>
<B><util:xlink>
<b>Subcategories:</b><br />
<table border="0" cellpadding="0" cellspacing="2">
<% for (Iterator it = subcats.iterator(); it.hasNext(); ) { %>
<% CategoryDescriptor c = (CategoryDescriptor)(it.next()); %>
<tr valign="top">
<td align="center" width="14"><util:stdbullet/></td>
<td align="left" class="content"><util:font color="content.fg" size="content">
<b><util:xlink>
<util:href type="servlet">
find.js.vs?disp=<%= FindView.FD_COMMUNITIES %>&cat=<%= c.getLinkedCategoryID() %>
</util:href>
@@ -200,11 +206,11 @@
<util:escape><%= c.getTitleAtLevel(c.getNumLevels()-1) %></util:escape>
</util:text>
</util:xlink>
<% if (c.isSymbolicLink()) { %><EM>@</EM><% } %>
</util:font></TD>
</TR>
<% } // end while %>
</TABLE>
<% if (c.isSymbolicLink()) { %><i>@</i><% } %>
</util:font></td>
</tr>
<% } // end for %>
</table>
<% } // end if (displaying subcategory list) %>
</util:font>
<% } // end if (category specified) %>
@@ -225,29 +231,29 @@
} // end if
%>
<HR>
<TABLE WIDTH="100%" BORDER=0 ALIGN=CENTER><TR VALIGN=MIDDLE>
<TD WIDTH="50%" ALIGN=LEFT CLASS="content"><util:font color="content.fg" size="content">
<hr />
<table width="100%" border="0" align="center"><tr valign="middle">
<td width="50%" align="left" class="content"><util:font color="content.fg" size="content">
<%-- The initial search results --%>
<B><% if (cat!=null) { %>Communities in Category<% } else { %>Search Results<% } %></B>
<b><% if (cat!=null) { %>Communities in Category<% } else { %>Search Results<% } %></b>
<% if (data.getFindCount()>0) { %>
(Displaying <%= data.getOffset() + 1 %>-<%= data.getOffset() + dcount %> of
<%= data.getFindCount() %>)
<% } else { %>(None)<% } %>
</util:font></TD>
</util:font></td>
<TD WIDTH="50%" ALIGN=RIGHT CLASS="content">
<td width="50%" align="right" class="content">
<% if (go_next || (data.getOffset()>0)) { %>
<%-- The navigational form that allows us to page through the results --%>
<util:comment>Navigational form</util:comment>
<util:form action="find.js.vs" type="servlet"><DIV CLASS="content">
<INPUT TYPE=HIDDEN NAME="disp" VALUE="<%= data.getDisplayMode() %>">
<% if (cat!=null) { %><INPUT TYPE=HIDDEN NAME="cat" VALUE="<%= cat.getCategoryID() %>"><% } %>
<INPUT TYPE=HIDDEN NAME="ofs" VALUE="<%= data.getOffset() %>">
<INPUT TYPE=HIDDEN NAME="field" VALUE="<%= data.getField() %>">
<INPUT TYPE=HIDDEN NAME="mode" VALUE="<%= data.getMode() %>">
<INPUT TYPE=HIDDEN NAME="term" VALUE="<%= data.getTerm() %>">
<INPUT TYPE=HIDDEN NAME="fcount" VALUE="<%= data.getFindCount() %>">
<util:form action="find.js.vs" type="servlet"><div class="content">
<input type="hidden" name="disp" value="<%= data.getDisplayMode() %>" />
<% if (cat!=null) { %><input type="hidden" name="cat" value="<%= cat.getCategoryID() %>" /><% } %>
<input type="hidden" name="ofs" value="<%= data.getOffset() %>" />
<input type="hidden" name="field" value="<%= data.getField() %>" />
<input type="hidden" name="mode" value="<%= data.getMode() %>" />
<input type="hidden" name="term" value="<%= data.getTerm() %>" />
<input type="hidden" name="fcount" value="<%= data.getFindCount() %>" />
<% if (data.getOffset()>0) { %>
<util:button id="previous" type="input"/>
<% } else { %>
@@ -259,58 +265,58 @@
<% } else { %>
<util:button id="_null_"/>
<% } // end if %>
</DIV></util:form>
</div></util:form>
<% } else { %>&nbsp;<% } %>
</TD>
</TR></TABLE><BR>
</td>
</tr></table><br />
<%-- Display the results of the search --%>
<TABLE BORDER=0 ALIGN=LEFT CELLPADDING=0 CELLSPACING=4>
<table border="0" align="left" cellpadding="0" cellspacing="4">
<% if (data.testDisplayMode(FindView.FD_POSTS) && (dcount>0)) { %>
<TR VALIGN=TOP>
<TH ALIGN=LEFT CLASS="CONTENT">
<util:font color="content.fg" size="content"><B><U>Post Link</U></B></util:font>
</TH>
<TH ALIGN=LEFT CLASS="CONTENT">
<util:font color="content.fg" size="content"><B><U>Author</U></B></util:font>
</TH>
<TH ALIGN=LEFT CLASS="CONTENT">
<util:font color="content.fg" size="content"><B><U>Post Date</U></B></util:font>
</TH>
<TH ALIGN=LEFT CLASS="CONTENT">
<util:font color="content.fg" size="content"><B><U>Lines</U></B></util:font>
</TH>
<TH ALIGN=LEFT CLASS="CONTENT">&nbsp;</TH>
</TR>
<tr valign="top">
<th align="left" class="content">
<util:font color="content.fg" size="content"><b><u>Post Link</u></b></util:font>
</th>
<th align="left" class="content">
<util:font color="content.fg" size="content"><b><u>Author</u></b></util:font>
</th>
<th align="left" class="content">
<util:font color="content.fg" size="content"><b><u>Post Date</u></b></util:font>
</th>
<th align="left" class="content">
<util:font color="content.fg" size="content"><b><u>Lines</u></b></util:font>
</th>
<th align="left" class="content">&nbsp;</th>
</tr>
<% } // end if %>
<% for (int i=0; i<dcount; i++) { %>
<TR VALIGN=TOP>
<tr valign="top">
<% if (data.testDisplayMode(FindView.FD_POSTS)) { %>
<% TopicMessageFound post = (TopicMessageFound)(results.get(i)); %>
<TD ALIGN=LEFT CLASS="content"><util:font color="content.fg" size="content">
<td align="left" class="content"><util:font color="content.fg" size="content">
<util:xlink>
<util:href type="servlet">go/<%= post.getIdentifier() %></util:href>
<util:text><%= post.getIdentifier() %></util:text>
</util:xlink>
</util:font></TD>
<TD ALIGN=LEFT CLASS="content"><util:font color="content.fg" size="content">
</util:font></td>
<td align="left" class="content"><util:font color="content.fg" size="content">
<util:xlink>
<util:href type="servlet">user/<%= post.getAuthor() %></util:href>
<util:text><%= post.getAuthor() %></util:text>
</util:xlink>
</util:font></TD>
<TD ALIGN=LEFT CLASS="content" NOWRAP><util:font color="content.fg" size="content">
</util:font></td>
<td align="left" class="content" nowrap="nowrap"><util:font color="content.fg" size="content">
<%= data.formatDate(post.getPostDate()) %>
</util:font></TD>
<TD ALIGN=LEFT CLASS="content"><util:font color="content.fg" size="content">
</util:font></td>
<td align="left" class="content"><util:font color="content.fg" size="content">
<%= post.getLineCount() %>
</util:font></TD>
<TD ALIGN=LEFT CLASS="content"><util:font color="content.fg" size="content">
</util:font></td>
<td align="left" class="content"><util:font color="content.fg" size="content">
<util:escape><%= post.getText() %></util:escape>
</util:font></TD>
</util:font></td>
<% } else { %>
<TD ALIGN=CENTER WIDTH=14><util:stdbullet/></TD>
<TD ALIGN=LEFT CLASS="content"><util:font color="content.fg" size="content">
<td align="center" width="14"><util:stdbullet/></td>
<td align="left" class="content"><util:font color="content.fg" size="content">
<% Object item = results.get(i); %>
<% if (data.testDisplayMode(FindView.FD_COMMUNITIES)) { %>
<%
@@ -319,9 +325,9 @@
int members = FindView.getCommunityMemberCount(comm);
%>
<util:xlink>
<util:href type="servlet">sig/<%= comm.getAlias() %></util:href>
<util:href type="servlet">comm/<%= comm.getAlias() %></util:href>
<util:text><util:escape><%= comm.getName() %></util:escape></util:text>
</util:xlink><BR>
</util:xlink><br />
<% if (host_name!=null) { %>
Host:
<util:xlink>
@@ -333,21 +339,37 @@
<% if (host_name!=null) { %> - <% } %>
<%= members %> members
<% } // end if (got member count) %>
<% if ((host_name!=null) || (members>=0)) { %><BR><% } %>
Latest activity: <%= data.getActivityString(comm.getLastAccessDate()) %><BR>
<EM><util:escape><%= comm.getSynopsis() %></util:escape></EM>
<% if ((host_name!=null) || (members>=0)) { %><br /><% } %>
Latest activity: <%= data.getActivityString(comm.getLastAccessDate()) %><br />
<i><util:escape><%= comm.getSynopsis() %></util:escape><i>
<% } else if (data.testDisplayMode(FindView.FD_USERS)) { %>
<% UserFound uf = (UserFound)item; %>
<%
UserFound uf = (UserFound)item;
String fullname = uf.getGivenName() + " " + uf.getFamilyName();
fullname = fullname.trim();
if (StringUtil.isStringEmpty(fullname))
fullname = uf.getName();
String whence = "";
if (!(StringUtil.isStringEmpty(uf.getLocality())))
{ // combine locations
if (!(StringUtil.isStringEmpty(uf.getRegion())))
whence = uf.getLocality() + ", " + uf.getRegion();
else
whence = uf.getLocality();
} // end if
else if (!(StringUtil.isStringEmpty(uf.getRegion())))
whence = uf.getRegion();
%>
<util:xlink>
<util:href type="servlet">user/<%= uf.getName() %></util:href>
<util:text><%= uf.getName() %></util:text>
</util:xlink><BR>
<util:escape><%= uf.getGivenName() %></util:escape>
<util:escape><%= uf.getFamilyName() %></util:escape>,
from <util:escape><%= uf.getLocality() %></util:escape>,
<util:escape><%= uf.getRegion() %></util:escape> <%= uf.getCountry() %>
</util:xlink><br />
<util:escape><%= fullname %></util:escape>,
from <util:escape><%= whence %></util:escape>
<% if (!(uf.getCountry().equals("XX"))) { %><%= uf.getCountry() %><% } %>
<% if (uf.getDescription()!=null) { %>
<BR><EM><util:escape><%= uf.getDescription() %></util:escape></EM>
<br /><i><util:escape><%= uf.getDescription() %></util:escape></i>
<% } // end if %>
<% } else if (data.testDisplayMode(FindView.FD_CATEGORIES)) { %>
<global:categories_enabled>
@@ -360,9 +382,10 @@
</util:xlink>
</global:categories_enabled>
<% } // end if %>
</util:font></TD>
</util:font></td>
<% } // end if %>
</TR>
</tr>
<% } // end for %>
</TABLE><BR CLEAR=LEFT>
</table><br clear="left" />
<% } // end if (results found) %>
<%-- EOF --%>