diff --git a/scripts/comm/member_export.js b/scripts/comm/member_export.js
new file mode 100644
index 0000000..5311576
--- /dev/null
+++ b/scripts/comm/member_export.js
@@ -0,0 +1,55 @@
+// 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) 2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
+//
+// Contributor(s):
+
+importPackage(java.util);
+importPackage(Packages.com.silverwrist.venice.core);
+importPackage(Packages.com.silverwrist.venice.except);
+importPackage(Packages.com.silverwrist.venice.ui);
+importPackage(Packages.com.silverwrist.venice.ui.helpers);
+
+// get the request object and the community
+rinput = bsf.lookupBean("request");
+comm = rinput.getCommunity(true,"top.js.vs");
+
+if (!(rinput.user.hasAdminAccess()))
+{ // no admin access - we can't do this
+ vlib.output(new ErrorBox("Access Error","You do not have permission to export a community's members",null));
+ vlib.done();
+
+} // end if
+
+rc = null;
+try
+{ // get the community member list
+ mbr_list = comm.getMemberList();
+
+ // perform the export and get the results
+ rc = new UserExportHelper(rinput.user.adminInterface,mbr_list);
+
+} // end try
+catch (e)
+{ // an error of some sort
+ etype = vlib.exceptionType(e) + "";
+ if (etype.match("DataException"))
+ rc = new ErrorBox("Database Error",e.message,"community/" + comm.alias);
+ else if (etype.match("IOException"))
+ rc = new ErrorBox("I/O Error",e.message,"community/" + comm.alias);
+ else
+ rc = e;
+
+} // end catch
+
+vlib.output(rc);
diff --git a/src/com/silverwrist/venice/core/impl/AdminUserContextImpl.java b/src/com/silverwrist/venice/core/impl/AdminUserContextImpl.java
index 9568a00..8a2b817 100644
--- a/src/com/silverwrist/venice/core/impl/AdminUserContextImpl.java
+++ b/src/com/silverwrist/venice/core/impl/AdminUserContextImpl.java
@@ -21,8 +21,7 @@ import java.io.*;
import java.sql.*;
import java.util.*;
import org.apache.log4j.*;
-import com.silverwrist.util.International;
-import com.silverwrist.util.OptionSet;
+import com.silverwrist.util.*;
import com.silverwrist.venice.core.*;
import com.silverwrist.venice.core.internals.*;
import com.silverwrist.venice.db.*;
@@ -685,11 +684,16 @@ class AdminUserContextImpl implements AdminUserContext
} // end finally
- xml.write("\n");
- xml.write("" + username + "\n");
- xml.write("" + hash + "\n");
- xml.write("" + reminder + "\n");
- xml.write("" + description + "\n");
+ xml.write("\n" + username
+ + "\n" + hash + "\n");
+ if (StringUtil.isStringEmpty(reminder))
+ xml.write("\n");
+ else
+ xml.write("" + reminder + "\n");
+ if (StringUtil.isStringEmpty(description))
+ xml.write("\n");
+ else
+ xml.write("" + description + "\n");
xml.write(" element afterwards.
ci.setPrivateAddress(hideaddr);
ci.setPrivatePhone(hidephone);
ci.setPrivateFax(hidefax);
ci.setPrivateEmail(hideemail);
- ci.importVCard(vcard);
uc.putContactInfo(ci);
// set up the locale
diff --git a/src/com/silverwrist/venice/ui/helpers/UserExportHelper.java b/src/com/silverwrist/venice/ui/helpers/UserExportHelper.java
index e847fac..db1778e 100644
--- a/src/com/silverwrist/venice/ui/helpers/UserExportHelper.java
+++ b/src/com/silverwrist/venice/ui/helpers/UserExportHelper.java
@@ -56,6 +56,8 @@ public class UserExportHelper implements ContentExecute
tmp.add(adm.getUserContext(((UserContext)o).getUID()));
else if (o instanceof UserProfile)
tmp.add(adm.getUserContext(((UserProfile)o).getUID()));
+ else if (o instanceof UserFound)
+ tmp.add(adm.getUserContext(((UserFound)o).getUID()));
else if (o instanceof Number)
tmp.add(adm.getUserContext(((Number)o).intValue()));
else
@@ -95,7 +97,7 @@ public class UserExportHelper implements ContentExecute
public void execute(RequestExec req) throws IOException
{
- req.sendBinary("text/xml","export-data.xml",m_length,m_stm);
+ req.sendBinary("text/xml","exported-users.xml",m_length,m_stm);
} // end execute
diff --git a/src/com/silverwrist/venice/ui/view/MembersView.java b/src/com/silverwrist/venice/ui/view/MembersView.java
index 8a32fc8..a303c41 100644
--- a/src/com/silverwrist/venice/ui/view/MembersView.java
+++ b/src/com/silverwrist/venice/ui/view/MembersView.java
@@ -9,9 +9,9 @@
*
* The Original Code is the Venice Web Communities System.
*
- * The Initial Developer of the Original Code is Eric J. Bowersox ,
+ * 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-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -230,6 +230,14 @@ public class MembersView implements ContentJSP
} // end isCommunityAdmin
+ public boolean canExportMembers()
+ {
+ if (rinput==null)
+ return false;
+ return rinput.getUser().hasAdminAccess();
+
+ } // end canExportMembers
+
/*--------------------------------------------------------------------------------
* External static operations
*--------------------------------------------------------------------------------
diff --git a/src/com/silverwrist/venice/util/BuildVCard.java b/src/com/silverwrist/venice/util/BuildVCard.java
index fb4e24c..23e2c17 100644
--- a/src/com/silverwrist/venice/util/BuildVCard.java
+++ b/src/com/silverwrist/venice/util/BuildVCard.java
@@ -18,6 +18,7 @@
package com.silverwrist.venice.util;
import java.util.*;
+import com.silverwrist.util.*;
public class BuildVCard
{
@@ -61,28 +62,28 @@ public class BuildVCard
private final String realFormattedName()
{
- if (formatted_name!=null)
+ if (!StringUtil.isStringEmpty(formatted_name))
return formatted_name;
StringBuffer buf = new StringBuffer();
- if (prefix!=null)
+ if (!StringUtil.isStringEmpty(prefix))
buf.append(prefix).append(' ');
- if (given_name!=null)
+ if (!StringUtil.isStringEmpty(given_name))
buf.append(given_name);
- if ((middle_name!=null) || (family_name!=null))
+ if (!StringUtil.isStringEmpty(middle_name) || !StringUtil.isStringEmpty(family_name))
buf.append(' ');
- if (middle_name!=null)
+ if (!StringUtil.isStringEmpty(middle_name))
{ // figure out the middle name
buf.append(middle_name);
if (middle_name.length()==1)
buf.append('.');
- if (family_name!=null)
+ if (!StringUtil.isStringEmpty(family_name))
buf.append(' ');
} // end if
- if (family_name!=null)
+ if (!StringUtil.isStringEmpty(family_name))
buf.append(family_name);
- if (suffix!=null)
+ if (!StringUtil.isStringEmpty(suffix))
buf.append(' ').append(suffix);
String s = buf.toString();
if (s.length()==0)
@@ -209,6 +210,13 @@ public class BuildVCard
public final void setTimeZone(TimeZone tz)
{
int ofs = tz.getRawOffset();
+ if (ofs==0)
+ { // we're dead-bang on Zulu time - recognize that fact
+ timezone = "Z";
+ return;
+
+ } // end if
+
StringBuffer buf = new StringBuffer();
if (ofs<0)
{ // negative offset
diff --git a/src/com/silverwrist/venice/util/VCard.java b/src/com/silverwrist/venice/util/VCard.java
index 37f10f8..d4391b2 100644
--- a/src/com/silverwrist/venice/util/VCard.java
+++ b/src/com/silverwrist/venice/util/VCard.java
@@ -588,26 +588,28 @@ public class VCard
public final void exportXML(Writer xml_writer) throws IOException
{
xml_writer.write("\n2.0\n");
- if (formatted_name!=null)
+ if (!StringUtil.isStringEmpty(formatted_name))
xml_writer.write("" + formatted_name + "\n");
- if ((family_name!=null) || (given_name!=null) || (middle_name!=null) || (prefix!=null) || (suffix!=null))
+ if ( !StringUtil.isStringEmpty(family_name) || !StringUtil.isStringEmpty(given_name)
+ || !StringUtil.isStringEmpty(middle_name) || !StringUtil.isStringEmpty(prefix)
+ || !StringUtil.isStringEmpty(suffix))
{ // write out the "N" block
xml_writer.write("");
- if (family_name!=null)
+ if (!StringUtil.isStringEmpty(family_name))
xml_writer.write("" + family_name + "");
- if (given_name!=null)
+ if (!StringUtil.isStringEmpty(given_name))
xml_writer.write("" + given_name + "");
- if (middle_name!=null)
+ if (!StringUtil.isStringEmpty(middle_name))
xml_writer.write("" + middle_name + "");
- if (prefix!=null)
+ if (!StringUtil.isStringEmpty(prefix))
xml_writer.write("" + prefix + "");
- if (suffix!=null)
+ if (!StringUtil.isStringEmpty(suffix))
xml_writer.write("" + suffix + "");
xml_writer.write("\n");
} // end if
- if (nickname!=null)
+ if (!StringUtil.isStringEmpty(nickname))
xml_writer.write("" + nickname + "\n");
Iterator it;
@@ -632,21 +634,21 @@ public class VCard
} // end for
- if (mailer!=null)
+ if (!StringUtil.isStringEmpty(mailer))
xml_writer.write("" + mailer + "\n");
- if (timezone!=null)
+ if (!StringUtil.isStringEmpty(timezone))
xml_writer.write("" + timezone + "\n");
- if (title!=null)
+ if (!StringUtil.isStringEmpty(title))
xml_writer.write("" + title + "\n");
- if (role!=null)
+ if (!StringUtil.isStringEmpty(role))
xml_writer.write("" + role + "\n");
- if (orgname!=null)
+ if (!StringUtil.isStringEmpty(orgname))
xml_writer.write("" + orgname + "\n");
- if (note!=null)
+ if (!StringUtil.isStringEmpty(note))
xml_writer.write("" + note + "\n");
- if (sort_string!=null)
+ if (!StringUtil.isStringEmpty(sort_string))
xml_writer.write("" + sort_string + "\n");
- if (url!=null)
+ if (!StringUtil.isStringEmpty(url))
xml_writer.write("" + url + "\n");
xml_writer.write("\n");
diff --git a/src/com/silverwrist/venice/util/VCardAddress.java b/src/com/silverwrist/venice/util/VCardAddress.java
index 8512e07..06a28b7 100644
--- a/src/com/silverwrist/venice/util/VCardAddress.java
+++ b/src/com/silverwrist/venice/util/VCardAddress.java
@@ -126,19 +126,19 @@ public class VCardAddress
if (preferred)
xml_writer.write("");
xml_writer.write("\n");
- if (pobox!=null)
+ if (!StringUtil.isStringEmpty(pobox))
xml_writer.write("" + pobox + "\n");
- if (ext_address!=null)
+ if (!StringUtil.isStringEmpty(ext_address))
xml_writer.write("" + ext_address + "\n");
- if (street!=null)
+ if (!StringUtil.isStringEmpty(street))
xml_writer.write("" + street + "\n");
- if (locality!=null)
+ if (!StringUtil.isStringEmpty(locality))
xml_writer.write("" + locality + "\n");
- if (region!=null)
+ if (!StringUtil.isStringEmpty(region))
xml_writer.write("" + region + "\n");
- if (postal_code!=null)
+ if (!StringUtil.isStringEmpty(postal_code))
xml_writer.write("" + postal_code + "\n");
- if (country!=null)
+ if (!StringUtil.isStringEmpty(country))
xml_writer.write("" + country + "\n");
xml_writer.write("\n");
diff --git a/src/com/silverwrist/venice/util/VCardEmail.java b/src/com/silverwrist/venice/util/VCardEmail.java
index dfc882b..00c3933 100644
--- a/src/com/silverwrist/venice/util/VCardEmail.java
+++ b/src/com/silverwrist/venice/util/VCardEmail.java
@@ -98,7 +98,7 @@ public class VCardEmail
xml_writer.write("");
if (preferred)
xml_writer.write("");
- if (address!=null)
+ if (!StringUtil.isStringEmpty(address))
xml_writer.write("" + address + "");
xml_writer.write("\n");
diff --git a/src/com/silverwrist/venice/util/VCardPhone.java b/src/com/silverwrist/venice/util/VCardPhone.java
index 74f5f64..3364881 100644
--- a/src/com/silverwrist/venice/util/VCardPhone.java
+++ b/src/com/silverwrist/venice/util/VCardPhone.java
@@ -137,7 +137,7 @@ public class VCardPhone
xml_writer.write("");
if (preferred)
xml_writer.write("");
- if (number!=null)
+ if (!StringUtil.isStringEmpty(number))
xml_writer.write("" + number + "");
xml_writer.write("\n");
diff --git a/web/format/comm/members.jsp b/web/format/comm/members.jsp
index 6579afa..319c2d4 100644
--- a/web/format/comm/members.jsp
+++ b/web/format/comm/members.jsp
@@ -9,9 +9,9 @@
The Original Code is the Venice Web Communities System.
- The Initial Developer of the Original Code is Eric J. Bowersox ,
+ 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-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
Contributor(s):
--%>
@@ -28,6 +28,14 @@
+<% if (view.canExportMembers()) { %>
+ [
+
+ comm/member_export.js.vs?cc=
+ Export Member List
+
+ ]