Merge of the NewUI changes into the trunk
This commit is contained in:
		
							parent
							
								
									b86ef1c3b0
								
							
						
					
					
						commit
						c3e2870572
					
				
							
								
								
									
										50
									
								
								build.xml
									
									
									
									
									
								
							
							
						
						
									
										50
									
								
								build.xml
									
									
									
									
									
								
							@ -21,27 +21,52 @@
 | 
			
		||||
 | 
			
		||||
  <!-- Global property names -->
 | 
			
		||||
  <property name="app.name" value="venice"/>
 | 
			
		||||
  <property name="deploy.home" value="../../${app.name}"/>
 | 
			
		||||
  <property name="deploy.home" value="/home/erbo/newui"/>
 | 
			
		||||
  <property name="dist.home" value="${deploy.home}"/>
 | 
			
		||||
  <property name="dist.src" value="${app.name}.jar"/>
 | 
			
		||||
  <property name="dist.war" value="${app.name}.war"/>
 | 
			
		||||
  <property name="javadoc.home" value="${deploy.home}/javadoc"/>
 | 
			
		||||
 | 
			
		||||
  <!-- Prepare directory for build -->
 | 
			
		||||
  <target name="prepare">
 | 
			
		||||
    <mkdir  dir="${deploy.home}"/>
 | 
			
		||||
    <copy todir="${deploy.home}">
 | 
			
		||||
  <!-- Build the base directories that fastupdate requires. -->
 | 
			
		||||
  <target name="mkbasedirs">
 | 
			
		||||
    <mkdir dir="${deploy.home}"/>
 | 
			
		||||
    <mkdir dir="${deploy.home}/WEB-INF"/>
 | 
			
		||||
    <mkdir dir="${deploy.home}/WEB-INF/scripts"/>
 | 
			
		||||
  </target>
 | 
			
		||||
 | 
			
		||||
  <!-- Copy everything to the application directory that can be updated without a restart. -->
 | 
			
		||||
  <target name="fastupdate" depends="mkbasedirs">
 | 
			
		||||
    <copy todir="${deploy.home}"> <!-- this copies all the JSP files and stuff -->
 | 
			
		||||
      <fileset dir="web"/>
 | 
			
		||||
    </copy>
 | 
			
		||||
    <mkdir  dir="${deploy.home}/WEB-INF"/>
 | 
			
		||||
    <copy todir="${deploy.home}/WEB-INF/scripts">  <!-- this copies all the scripts -->
 | 
			
		||||
      <fileset dir="scripts"/>
 | 
			
		||||
    </copy>
 | 
			
		||||
  </target>
 | 
			
		||||
 | 
			
		||||
  <!-- Prepare directory for build (copy everything that requires a restart to take effect) -->
 | 
			
		||||
  <target name="prepare" depends="mkbasedirs">
 | 
			
		||||
    <copy todir="${deploy.home}/WEB-INF">
 | 
			
		||||
      <fileset dir="etc"/>
 | 
			
		||||
      <fileset dir="etc">
 | 
			
		||||
	<include name="*.xml"/>
 | 
			
		||||
	<include name="*.css"/>
 | 
			
		||||
        <include name="*.dict"/>
 | 
			
		||||
      </fileset>
 | 
			
		||||
    </copy>
 | 
			
		||||
    <mkdir  dir="${deploy.home}/WEB-INF/classes"/>
 | 
			
		||||
    <mkdir  dir="${deploy.home}/WEB-INF/lib"/>
 | 
			
		||||
    <copy todir="${deploy.home}/WEB-INF/lib">
 | 
			
		||||
      <fileset dir="lib"/>
 | 
			
		||||
      <fileset dir="lib">
 | 
			
		||||
        <include name="*.jar"/>
 | 
			
		||||
      </fileset>
 | 
			
		||||
    </copy>
 | 
			
		||||
    <mkdir  dir="${deploy.home}/WEB-INF/tlds"/>
 | 
			
		||||
    <copy todir="${deploy.home}/WEB-INF/tlds">
 | 
			
		||||
      <fileset dir="tlds">
 | 
			
		||||
        <include name="*.tld"/>
 | 
			
		||||
      </fileset>
 | 
			
		||||
    </copy>
 | 
			
		||||
    <mkdir  dir="${deploy.home}/WEB-INF/temp"/>
 | 
			
		||||
    <mkdir  dir="${javadoc.home}"/>
 | 
			
		||||
  </target>
 | 
			
		||||
 | 
			
		||||
@ -51,7 +76,7 @@
 | 
			
		||||
  </target>
 | 
			
		||||
 | 
			
		||||
  <!-- Compile all the Java source -->
 | 
			
		||||
  <target name="compile" depends="prepare">
 | 
			
		||||
  <target name="compile" depends="prepare,fastupdate">
 | 
			
		||||
    <javac srcdir="src" destdir="${deploy.home}/WEB-INF/classes" debug="on" optimize="off" deprecation="on">
 | 
			
		||||
      <classpath>
 | 
			
		||||
	<fileset dir="${deploy.home}/WEB-INF/lib">
 | 
			
		||||
@ -65,17 +90,16 @@
 | 
			
		||||
    </copy>
 | 
			
		||||
  </target>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  <!-- Create Javadocs -->
 | 
			
		||||
  <target name="javadoc" depends="prepare">
 | 
			
		||||
  <target name="javadoc" depends="mkbasedirs,prepare">
 | 
			
		||||
    <javadoc sourcepath="src" packagenames="*" destdir="${javadoc.home}"/>
 | 
			
		||||
  </target>
 | 
			
		||||
 | 
			
		||||
  <!-- Build it all, man -->
 | 
			
		||||
  <target name="all" depends="clean,prepare,compile,javadoc"/>
 | 
			
		||||
  <target name="all" depends="clean,mkbasedirs,prepare,fastupdate,compile,javadoc"/>
 | 
			
		||||
 | 
			
		||||
  <!-- Build the distribution .WAR file and JAR up the source code -->
 | 
			
		||||
  <target name="dist" depends="prepare,compile">
 | 
			
		||||
  <target name="dist" depends="mkbasedirs,prepare,fastupdate,compile">
 | 
			
		||||
    <jar jarfile="${dist.home}/${dist.src}" basedir="."/>
 | 
			
		||||
    <jar jarfile="${dist.home}/${dist.war}" basedir="${deploy.home}"/>
 | 
			
		||||
  </target>
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								doc/buttons/gelcap_green.xcf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								doc/buttons/gelcap_green.xcf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								doc/buttons/gelcap_pink.xcf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								doc/buttons/gelcap_pink.xcf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								doc/buttons/gelcap_red.xcf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								doc/buttons/gelcap_red.xcf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								doc/buttons/gelcap_teal.xcf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								doc/buttons/gelcap_teal.xcf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								doc/buttons/gelcap_violet.xcf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								doc/buttons/gelcap_violet.xcf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								doc/buttons/gelcap_yellow.xcf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								doc/buttons/gelcap_yellow.xcf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							@ -30,12 +30,6 @@
 | 
			
		||||
    </layout>
 | 
			
		||||
  </appender>
 | 
			
		||||
 | 
			
		||||
  <!-- Define the root configuration for logging. -->
 | 
			
		||||
  <root>
 | 
			
		||||
    <priority value="debug"/>
 | 
			
		||||
    <appender-ref ref="STDLOG"/>
 | 
			
		||||
  </root>
 | 
			
		||||
 | 
			
		||||
  <!-- Turn down the standard detail in some areas -->
 | 
			
		||||
  <category name="com.silverwrist.util.ServletMultipartHandler">
 | 
			
		||||
    <priority value="debug"/>
 | 
			
		||||
@ -44,6 +38,12 @@
 | 
			
		||||
    <priority value="fatal"/>
 | 
			
		||||
  </category>
 | 
			
		||||
 | 
			
		||||
  <!-- Define the root configuration for logging. -->
 | 
			
		||||
  <root>
 | 
			
		||||
    <priority value="debug"/>
 | 
			
		||||
    <appender-ref ref="STDLOG"/>
 | 
			
		||||
  </root>
 | 
			
		||||
 | 
			
		||||
</log4j:configuration>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,163 +0,0 @@
 | 
			
		||||
<?xml version="1.0"?>
 | 
			
		||||
<!--
 | 
			
		||||
    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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
 | 
			
		||||
    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 <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.
 | 
			
		||||
 | 
			
		||||
    Contributor(s): 
 | 
			
		||||
-->
 | 
			
		||||
<render-config>
 | 
			
		||||
 | 
			
		||||
  <!-- The name of the site; included in the HTML title of the page. -->
 | 
			
		||||
  <site-name>Venice Test</site-name>
 | 
			
		||||
 | 
			
		||||
  <!-- Used to specify general rendering parameters -->
 | 
			
		||||
  <rendering>
 | 
			
		||||
    <!-- If this is specified, servlets will include HTML comments in their output. -->
 | 
			
		||||
    <html-comments/>
 | 
			
		||||
 | 
			
		||||
    <!-- If this is specified, pages will be transfer-encoded in GZIP if the browser
 | 
			
		||||
         allows it. -->
 | 
			
		||||
    <!-- <gzip-output/> -->
 | 
			
		||||
 | 
			
		||||
    <!-- If this is specified, the site will allow Microsoft Internet Explorer 6.0+ Smart
 | 
			
		||||
         Tags to be inserted into site text.  This is considered rude by many, and is quite
 | 
			
		||||
         possibly a copyright violation by Microsoft (changing the site's text as viewed through
 | 
			
		||||
         their browser, without consent of either the author or the end user).  The default setting
 | 
			
		||||
         inserts a META tag into the page which *should* prevent this (but may not, if MS provides
 | 
			
		||||
         a setting to override site author preferences, which would be despicable). -->
 | 
			
		||||
    <!-- <ms-copyright-violations/> -->
 | 
			
		||||
 | 
			
		||||
    <!-- Specifies the default <FONT FACE=""> to use for all text. -->
 | 
			
		||||
    <font>Arial, Helvetica</font>
 | 
			
		||||
 | 
			
		||||
    <!-- Specifies the location of the stylesheet template file. -->
 | 
			
		||||
    <stylesheet>WEB-INF/template.css</stylesheet>
 | 
			
		||||
 | 
			
		||||
    <!-- Various HTML colors to render portions of the interface in. Note that these may either be
 | 
			
		||||
         standard HTML color names or #RRGGBB color values. -->
 | 
			
		||||
    <colors>
 | 
			
		||||
      <frame-bg>#9999FF</frame-bg>                      <!-- outer frame background -->
 | 
			
		||||
      <title-bg>#6666CC</title-bg>                      <!-- title background -->
 | 
			
		||||
      <title-fg>white</title-fg>                        <!-- title foreground -->
 | 
			
		||||
      <title-link>yellow</title-link>                   <!-- title links -->
 | 
			
		||||
      <left-bg>#9999FF</left-bg>                        <!-- left menu bar background -->
 | 
			
		||||
      <left-fg>black</left-fg>                          <!-- left menu bar foreground -->
 | 
			
		||||
      <left-link>blue</left-link>                       <!-- left menu bar links -->
 | 
			
		||||
      <content-bg>white</content-bg>                    <!-- content background -->
 | 
			
		||||
      <content-fg>black</content-fg>                    <!-- content text -->
 | 
			
		||||
      <content-hdr>#3333AA</content-hdr>                <!-- content header text -->
 | 
			
		||||
      <content-disabled>silver</content-disabled>       <!-- disabled text -->
 | 
			
		||||
      <content-error>#660000</content-error>            <!-- error message text -->
 | 
			
		||||
      <sidebox-title-bg>#6666CC</sidebox-title-bg>      <!-- background of sidebox title (front page) -->
 | 
			
		||||
      <sidebox-title-fg>white</sidebox-title-fg>        <!-- foreground of sidebox title (front page) -->
 | 
			
		||||
      <sidebox-content-bg>#9999FF</sidebox-content-bg>  <!-- background of sidebox content (front page) -->
 | 
			
		||||
      <sidebox-content-fg>black</sidebox-content-fg>    <!-- foreground of sidebox content (front page) -->
 | 
			
		||||
      <sidebox-content-link>blue</sidebox-content-link> <!-- links in sidebox content (front page) -->
 | 
			
		||||
      <confirm-title-bg>#006600</confirm-title-bg>      <!-- background of confirm box title bar -->
 | 
			
		||||
      <confirm-title-fg>white</confirm-title-fg>        <!-- foreground of confirm box title bar -->
 | 
			
		||||
      <error-title-bg>#660000</error-title-bg>          <!-- background of error box title bar -->
 | 
			
		||||
      <error-title-fg>white</error-title-fg>            <!-- foreground of error box title bar --> 
 | 
			
		||||
    </colors>
 | 
			
		||||
 | 
			
		||||
    <!-- Footer logo scaling expressed as a percentage of full size. -->
 | 
			
		||||
    <footer-logo-scale>100</footer-logo-scale>
 | 
			
		||||
 | 
			
		||||
  </rendering>
 | 
			
		||||
 | 
			
		||||
  <!-- Used to configure URL paths to various global resources. -->
 | 
			
		||||
  <paths>
 | 
			
		||||
    <!-- Base URL for all images loaded by the server code.  MUST include the trailing slash. -->
 | 
			
		||||
    <image>/venice/images/</image>
 | 
			
		||||
 | 
			
		||||
    <!-- Base URL for all static pages linked to by the engine.  MUST include the trailing slash. -->
 | 
			
		||||
    <static>/venice/static/</static>
 | 
			
		||||
 | 
			
		||||
    <!-- The site-relative URL to the site logo.  The image should be 140x80 pixels, unless overridden
 | 
			
		||||
         by the "width" and "height" attributes. The optional "href" attribute is where clicking on
 | 
			
		||||
         the site logo should link to. -->
 | 
			
		||||
    <site-logo width="140" height="80"
 | 
			
		||||
               href="http://venice.sourceforge.net">/venice/images/powered-by-venice.gif</site-logo>
 | 
			
		||||
 | 
			
		||||
    <!-- The location of the sidebox configuration file, relative to the application root. -->
 | 
			
		||||
    <sidebox-config>WEB-INF/sidebox-config.xml</sidebox-config>
 | 
			
		||||
 | 
			
		||||
    <!-- The location of the "photo not available" image, relative to either the main
 | 
			
		||||
         images directory (if the "fixup" attribute is present) or the site (if it is not).
 | 
			
		||||
         Image should be 100x100 pixels. -->
 | 
			
		||||
    <photo-not-avail fixup="true">photo_not_avail.gif</photo-not-avail>
 | 
			
		||||
 | 
			
		||||
    <!-- The location of the services configuration file, relative to the application root. -->
 | 
			
		||||
    <services-config>WEB-INF/services-config.xml</services-config>
 | 
			
		||||
 | 
			
		||||
  </paths>
 | 
			
		||||
 | 
			
		||||
  <!-- Contains standard messages displayed by front end -->
 | 
			
		||||
  <messages>
 | 
			
		||||
    <!-- The message displayed at the top of "top" when you're not logged in (HTML). -->
 | 
			
		||||
    <welcome>
 | 
			
		||||
      <![CDATA[
 | 
			
		||||
Welcome to the <B>Venice Web Communities System</B>.  To get the most out of this site, you should log in
 | 
			
		||||
or create an account, using one of the links above.
 | 
			
		||||
      ]]>
 | 
			
		||||
    </welcome>
 | 
			
		||||
 | 
			
		||||
    <!-- The headline for the welcome message. -->
 | 
			
		||||
    <welcome-top>Welcome to Venice</welcome-top>
 | 
			
		||||
 | 
			
		||||
    <!-- The headline for the "currents" box. -->
 | 
			
		||||
    <currents-top>Venice Currents</currents-top>
 | 
			
		||||
 | 
			
		||||
    <!-- The text displayed within the page footer (HTML). -->
 | 
			
		||||
    <footer-text>
 | 
			
		||||
      <![CDATA[
 | 
			
		||||
All trademarks and copyrights on this page are owned by their respective companies.<BR>
 | 
			
		||||
All messages posted by users on this page are owned by those users.<BR>
 | 
			
		||||
The rest: Copyright © 2001 <A HREF="http://www.silverwrist.com">Silverwrist Design Studios</A>,
 | 
			
		||||
All Rights Reserved.<BR>
 | 
			
		||||
See our <A HREF="/TODO">Policy Page</A> for our copyright and privacy policies.
 | 
			
		||||
      ]]>
 | 
			
		||||
    </footer-text>
 | 
			
		||||
 | 
			
		||||
    <!-- The thing that users must click on "I Accept" for before they can create an account -->
 | 
			
		||||
    <user-agreement>
 | 
			
		||||
      <![CDATA[
 | 
			
		||||
Text of this agreement is TBD.
 | 
			
		||||
      ]]>
 | 
			
		||||
    </user-agreement>
 | 
			
		||||
 | 
			
		||||
    <!-- Title displayed for above. -->
 | 
			
		||||
    <user-agreement-title>Venice User Agreement</user-agreement-title>
 | 
			
		||||
 | 
			
		||||
  </messages>
 | 
			
		||||
 | 
			
		||||
  <!-- Menu definitions for the base page -->
 | 
			
		||||
  <menu-definitions>
 | 
			
		||||
 | 
			
		||||
    <!-- Definition for the "top" menu (when not in a community) -->
 | 
			
		||||
    <menudef id="top">
 | 
			
		||||
      <header>Front Page</header>
 | 
			
		||||
      <link href="TODO" type="absolute" disabled="true">Calendar</link>
 | 
			
		||||
      <link href="TODO" type="absolute" disabled="true">Chat</link>
 | 
			
		||||
    </menudef>
 | 
			
		||||
 | 
			
		||||
    <!-- Definition for the "fixed" menu (always displayed under the "top" or "community" menus) -->
 | 
			
		||||
    <menudef id="fixed">
 | 
			
		||||
      <header>About This Site</header>
 | 
			
		||||
      <link href="TODO" type="absolute" disabled="true">Documentation</link>
 | 
			
		||||
      <link href="about-venice.html" type="frame">About Venice</link>
 | 
			
		||||
    </menudef>
 | 
			
		||||
 | 
			
		||||
  </menu-definitions>
 | 
			
		||||
 | 
			
		||||
</render-config>
 | 
			
		||||
@ -26,37 +26,37 @@
 | 
			
		||||
    <service id="Profile" index="0">
 | 
			
		||||
      <setup default="true" locked="true"/>
 | 
			
		||||
      <access/>
 | 
			
		||||
      <link sequence="4900" href="sigprofile?sig=${cid}" type="servlet">Profile</link>
 | 
			
		||||
      <link sequence="4900" href="comm/show.js.vs?cc=${cid}" type="servlet">Profile</link>
 | 
			
		||||
    </service>
 | 
			
		||||
 | 
			
		||||
    <!-- Community administration service -->
 | 
			
		||||
    <service id="Admin" index="1">
 | 
			
		||||
      <setup default="true" locked="true"/>
 | 
			
		||||
      <access permission="Community.Read" role="Community.AnyAdmin"/>
 | 
			
		||||
      <link sequence="5000" href="sigadmin?sig=${cid}" type="servlet">Administration</link>
 | 
			
		||||
      <link sequence="5000" href="comm/admin_menu.js.vs?cc=${cid}" type="servlet">Administration</link>
 | 
			
		||||
    </service>
 | 
			
		||||
 | 
			
		||||
    <!-- System administration service -->
 | 
			
		||||
    <service id="SysAdmin" index="2">
 | 
			
		||||
      <setup locked="true"/>
 | 
			
		||||
      <access permission="Global.SysAdminAccess"/>
 | 
			
		||||
      <link sequence="10000" href="sysadmin" type="servlet">System Administration</link>
 | 
			
		||||
      <link sequence="10000" href="sysadmin/menu.js.vs" type="servlet">System Administration</link>
 | 
			
		||||
    </service>
 | 
			
		||||
 | 
			
		||||
    <!-- Conferences service -->
 | 
			
		||||
    <service id="Conference" index="3">
 | 
			
		||||
      <setup default="true"/>
 | 
			
		||||
      <access permission="Community.Read"/>
 | 
			
		||||
      <link sequence="500" href="confops?sig=${cid}" type="servlet">Conferences</link>
 | 
			
		||||
      <link sequence="500" href="conf/conferences.js.vs?cc=${cid}" type="servlet">Conferences</link>
 | 
			
		||||
    </service>
 | 
			
		||||
 | 
			
		||||
    <!-- Members service -->
 | 
			
		||||
    <service id="Members" index="4">
 | 
			
		||||
      <setup default="true" locked="true"/>
 | 
			
		||||
      <access permission="Community.Read" role="Community.Member"/>
 | 
			
		||||
      <link sequence="4800" href="members?sig=${cid}" type="servlet">Members</link>
 | 
			
		||||
      <link sequence="4800" href="comm/members.js.vs?cc=${cid}" type="servlet">Members</link>
 | 
			
		||||
    </service>
 | 
			
		||||
 | 
			
		||||
  </community>
 | 
			
		||||
 | 
			
		||||
</services-config>
 | 
			
		||||
</services-config>
 | 
			
		||||
 | 
			
		||||
@ -22,7 +22,7 @@
 | 
			
		||||
  <sidebox id="1">
 | 
			
		||||
    <title>Your Communities</title>
 | 
			
		||||
    <anon-title>Featured Communities</anon-title>
 | 
			
		||||
    <factory-class>com.silverwrist.venice.servlets.format.sideboxes.CommunityBox</factory-class>
 | 
			
		||||
    <factory-class>com.silverwrist.venice.ui.sidebox.CommunityBox</factory-class>
 | 
			
		||||
    <null-msg>You are not a member of any communities.</null-msg>
 | 
			
		||||
    <manage-link>Manage</manage-link>
 | 
			
		||||
    <create-new-link>Create New</create-new-link>
 | 
			
		||||
@ -33,7 +33,7 @@
 | 
			
		||||
  <sidebox id="2">
 | 
			
		||||
    <title>Your Conference Hotlist</title>
 | 
			
		||||
    <anon-title>Featured Conferences</anon-title>
 | 
			
		||||
    <factory-class>com.silverwrist.venice.servlets.format.sideboxes.ConferenceBox</factory-class>
 | 
			
		||||
    <factory-class>com.silverwrist.venice.ui.sidebox.ConferenceBox</factory-class>
 | 
			
		||||
    <null-msg>You have no conferences in your hotlist.</null-msg>
 | 
			
		||||
    <manage-link>Manage</manage-link>
 | 
			
		||||
    <bullet width="14" height="14" fixup="true">purple-ball.gif</bullet>
 | 
			
		||||
@ -44,7 +44,7 @@
 | 
			
		||||
  <!--
 | 
			
		||||
  <sidebox id="-1">
 | 
			
		||||
    <title>Test Sidebox</title>
 | 
			
		||||
    <factory-class>com.silverwrist.venice.servlets.format.sideboxes.JSPSideBoxFactory</factory-class>
 | 
			
		||||
    <factory-class>com.silverwrist.venice.ui.sidebox.JSPSideBoxFactory</factory-class>
 | 
			
		||||
    <format-jsp>test/test_sidebox.jsp</format-jsp>
 | 
			
		||||
    <strings>
 | 
			
		||||
      <test1>This is a test.</test1>
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										679
									
								
								etc/ui-config.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										679
									
								
								etc/ui-config.xml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,679 @@
 | 
			
		||||
<?xml version="1.0"?>
 | 
			
		||||
<!--
 | 
			
		||||
    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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
 | 
			
		||||
    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 <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.
 | 
			
		||||
 | 
			
		||||
    Contributor(s): 
 | 
			
		||||
-->
 | 
			
		||||
<ui-config>
 | 
			
		||||
  <!-- Paths of files that are to be loaded by the user interface. -->
 | 
			
		||||
  <file-paths>
 | 
			
		||||
    <!-- The location of the sidebox configuration file, relative to the application root. -->
 | 
			
		||||
    <sidebox-config>WEB-INF/sidebox-config.xml</sidebox-config>
 | 
			
		||||
 | 
			
		||||
    <!-- The location of the services configuration file, relative to the application root. -->
 | 
			
		||||
    <services-config>WEB-INF/services-config.xml</services-config>
 | 
			
		||||
 | 
			
		||||
    <!-- The location of the scripts directory, relative to the application root. -->
 | 
			
		||||
    <script-dir>WEB-INF/scripts</script-dir>
 | 
			
		||||
 | 
			
		||||
    <!-- The temporary directory for script compilation, relative to the application root. -->
 | 
			
		||||
    <temp-dir>WEB-INF/temp</temp-dir>
 | 
			
		||||
 | 
			
		||||
  </file-paths>
 | 
			
		||||
 | 
			
		||||
  <!-- Paths of resources referred to by their URIs in the user interface. -->
 | 
			
		||||
  <uri-paths>
 | 
			
		||||
    <!-- Base URL for all images loaded by the server code.  -->
 | 
			
		||||
    <image>/newui/images</image>
 | 
			
		||||
 | 
			
		||||
    <!-- Base URL for all static pages linked to by the engine.  -->
 | 
			
		||||
    <static>/static</static>
 | 
			
		||||
 | 
			
		||||
    <!-- Base URL for all external static pages linked to by the engine.  -->
 | 
			
		||||
    <external-static>/newui/static</external-static>
 | 
			
		||||
 | 
			
		||||
    <!-- Base URL for JSP pages loaded by the formatter, relative to the context root. -->
 | 
			
		||||
    <format-jsp>/format</format-jsp>
 | 
			
		||||
 | 
			
		||||
    <!-- The location of the "photo not available" image, relative to either the main
 | 
			
		||||
         images directory (if the "fixup" attribute is present) or the site (if it is not).
 | 
			
		||||
         Image should be 100x100 pixels. -->
 | 
			
		||||
    <photo-not-avail fixup="true">photo_not_avail.gif</photo-not-avail>
 | 
			
		||||
 | 
			
		||||
  </uri-paths>
 | 
			
		||||
 | 
			
		||||
  <!-- Settings related to the outer frame. -->
 | 
			
		||||
  <frame>
 | 
			
		||||
    <!-- The name of the JSP page that implements the outer frame. -->
 | 
			
		||||
    <jsp-name>frame.jsp</jsp-name>
 | 
			
		||||
 | 
			
		||||
    <!-- The title for the site. Optional. -->
 | 
			
		||||
    <site-title>Venice Test</site-title>
 | 
			
		||||
 | 
			
		||||
    <!-- The default <BASEFONT> font size.  Optional. -->
 | 
			
		||||
    <basefont-size>3</basefont-size>
 | 
			
		||||
 | 
			
		||||
    <!-- Specifies the location of the stylesheet template file.  Optional. -->
 | 
			
		||||
    <stylesheet>WEB-INF/template.css</stylesheet>
 | 
			
		||||
 | 
			
		||||
    <!-- If this is specified, the site will allow Microsoft Internet Explorer 6.0+ Smart
 | 
			
		||||
         Tags to be inserted into site text.  This is considered rude by many, and is quite
 | 
			
		||||
         possibly a copyright violation by Microsoft (changing the site's text as viewed through
 | 
			
		||||
         their browser, without consent of either the author or the end user).  The default setting
 | 
			
		||||
         inserts a META tag into the page which *should* prevent this (but may not, if MS provides
 | 
			
		||||
         a setting to override site author preferences, which would be despicable). -->
 | 
			
		||||
    <!-- <ms-copyright-violations/> -->
 | 
			
		||||
 | 
			
		||||
    <!-- The site-relative URL to the site logo.  The image should be 140x80 pixels, unless overridden
 | 
			
		||||
         by the "width" and "height" attributes. The optional "href" attribute is where clicking on
 | 
			
		||||
         the site logo should link to. -->
 | 
			
		||||
    <site-logo width="140" height="80" hspace="2" vspace="2" type="absolute"
 | 
			
		||||
               href="http://venice.sourceforge.net">/newui/images/powered-by-venice.gif</site-logo>
 | 
			
		||||
 | 
			
		||||
    <!-- Footer logo scaling expressed as a percentage of full size. -->
 | 
			
		||||
    <footer-logo-scale>100</footer-logo-scale>
 | 
			
		||||
 | 
			
		||||
    <!-- The site-relative URL to the page icon.  This image should be 16x16 pixels, and the type=
 | 
			
		||||
         attribute specifies the MIME type of the image. -->
 | 
			
		||||
    <page-icon type="image/png">/newui/images/venice-icon.png</page-icon>
 | 
			
		||||
 | 
			
		||||
    <!-- The site-relative URL to the "favorites icon" (in Windows .ICO format).  May be specified
 | 
			
		||||
         in addition to, or instead of, page-icon. -->
 | 
			
		||||
    <favicon>/newui/images/venice-favicon.ico</favicon>
 | 
			
		||||
 | 
			
		||||
  </frame>
 | 
			
		||||
 | 
			
		||||
  <!-- Settings related to site rendering. -->
 | 
			
		||||
  <rendering>
 | 
			
		||||
    <!-- Specifies the default <FONT FACE=""> to use for all text. -->
 | 
			
		||||
    <font>Arial, Helvetica</font>
 | 
			
		||||
 | 
			
		||||
    <!-- Specifies some "stock" font sizes. -->
 | 
			
		||||
    <font-sizes>
 | 
			
		||||
      <top>3</top>
 | 
			
		||||
      <left>2</left>
 | 
			
		||||
      <header>5</header>
 | 
			
		||||
      <subhead>3</subhead>
 | 
			
		||||
      <content>2</content>
 | 
			
		||||
      <sidebox>2</sidebox>
 | 
			
		||||
      <sidebox-footer>1</sidebox-footer>
 | 
			
		||||
      <sidebox-title>3</sidebox-title>
 | 
			
		||||
      <dlg-error>3</dlg-error>
 | 
			
		||||
      <content-heading>4</content-heading>
 | 
			
		||||
      <profile-dates>1</profile-dates>
 | 
			
		||||
      <errorbox>3</errorbox>
 | 
			
		||||
      <confirmbox>3</confirmbox>
 | 
			
		||||
      <post-reference>1</post-reference>
 | 
			
		||||
    </font-sizes>
 | 
			
		||||
 | 
			
		||||
    <!-- Various HTML colors to render portions of the interface in. Note that these may either be
 | 
			
		||||
         standard HTML color names or #RRGGBB color values. -->
 | 
			
		||||
    <colors>
 | 
			
		||||
      <frame-bg>#9999FF</frame-bg>                      <!-- outer frame background -->
 | 
			
		||||
      <title-bg>#6666CC</title-bg>                      <!-- title background -->
 | 
			
		||||
      <title-fg>white</title-fg>                        <!-- title foreground -->
 | 
			
		||||
      <title-link>yellow</title-link>                   <!-- title links -->
 | 
			
		||||
      <left-bg>#9999FF</left-bg>                        <!-- left menu bar background -->
 | 
			
		||||
      <left-fg>black</left-fg>                          <!-- left menu bar foreground -->
 | 
			
		||||
      <left-link>blue</left-link>                       <!-- left menu bar links -->
 | 
			
		||||
      <content-bg>white</content-bg>                    <!-- content background -->
 | 
			
		||||
      <content-fg>black</content-fg>                    <!-- content text -->
 | 
			
		||||
      <content-hdr>#3333AA</content-hdr>                <!-- content header text -->
 | 
			
		||||
      <content-disabled>silver</content-disabled>       <!-- disabled text -->
 | 
			
		||||
      <content-error>#660000</content-error>            <!-- error message text -->
 | 
			
		||||
      <sidebox-title-bg>#6666CC</sidebox-title-bg>      <!-- background of sidebox title (front page) -->
 | 
			
		||||
      <sidebox-title-fg>white</sidebox-title-fg>        <!-- foreground of sidebox title (front page) -->
 | 
			
		||||
      <sidebox-content-bg>#9999FF</sidebox-content-bg>  <!-- background of sidebox content (front page) -->
 | 
			
		||||
      <sidebox-content-fg>black</sidebox-content-fg>    <!-- foreground of sidebox content (front page) -->
 | 
			
		||||
      <sidebox-content-link>blue</sidebox-content-link> <!-- links in sidebox content (front page) -->
 | 
			
		||||
      <confirm-title-bg>#006600</confirm-title-bg>      <!-- background of confirm box title bar -->
 | 
			
		||||
      <confirm-title-fg>white</confirm-title-fg>        <!-- foreground of confirm box title bar -->
 | 
			
		||||
      <error-title-bg>#660000</error-title-bg>          <!-- background of error box title bar -->
 | 
			
		||||
      <error-title-fg>white</error-title-fg>            <!-- foreground of error box title bar --> 
 | 
			
		||||
    </colors>
 | 
			
		||||
 | 
			
		||||
    <!-- If this is specified, servlets will include HTML comments in their output. -->
 | 
			
		||||
    <html-comments/>
 | 
			
		||||
 | 
			
		||||
    <!-- Descriptors for the various graphical buttons. -->
 | 
			
		||||
    <buttons width="80" height="24">
 | 
			
		||||
      <button id="add" caption="Add" fixup="true">bn_add.gif</button>
 | 
			
		||||
      <button id="add_to_hotlist" caption="Add To Hotlist" fixup="true">bn_add_to_hotlist.gif</button>
 | 
			
		||||
      <button id="add_topic" caption="Add Topic" fixup="true">bn_add_topic.gif</button>
 | 
			
		||||
      <button id="archive_topic" caption="Archive Topic" fixup="true">bn_archive_topic.gif</button>
 | 
			
		||||
      <button id="cancel" caption="Cancel" fixup="true">bn_cancel.gif</button>
 | 
			
		||||
      <button id="conf_list" caption="Conference List" fixup="true">bn_conference_list.gif</button>
 | 
			
		||||
      <button id="configure" caption="Configure" fixup="true">bn_configure.gif</button>
 | 
			
		||||
      <button id="create" caption="Create" fixup="true">bn_create.gif</button>
 | 
			
		||||
      <button id="createnew" caption="Create New" fixup="true">bn_create_new.gif</button>
 | 
			
		||||
      <button id="delete_topic" caption="Delete Topic" fixup="true">bn_delete_topic.gif</button>
 | 
			
		||||
      <button id="filter_user" caption="Filter User" fixup="true">bn_filter_user.gif</button>
 | 
			
		||||
      <button id="find" caption="Find" fixup="true">bn_find.gif</button>
 | 
			
		||||
      <button id="freeze_topic" caption="Freeze Topic" fixup="true">bn_freeze_topic.gif</button>
 | 
			
		||||
      <button id="go" caption="Go" fixup="true">bn_go.gif</button>
 | 
			
		||||
      <button id="hide" caption="Hide" fixup="true">bn_hide.gif</button>
 | 
			
		||||
      <button id="hide_topic" caption="Hide Topic" fixup="true">bn_hide_topic.gif</button>
 | 
			
		||||
      <button id="invite" caption="Invite" fixup="true">bn_invite.gif</button>
 | 
			
		||||
      <button id="join_now" caption="Join Now" fixup="true">bn_join_now.gif</button>
 | 
			
		||||
      <button id="login" caption="Log In" fixup="true">bn_log_in.gif</button>
 | 
			
		||||
      <button id="manage" caption="Manage" fixup="true">bn_manage.gif</button>
 | 
			
		||||
      <button id="next" caption="Next" fixup="true">bn_ar_next.gif</button>
 | 
			
		||||
      <button id="next_topic" caption="Next Topic" fixup="true">bn_next_topic.gif</button>
 | 
			
		||||
      <button id="next_topic_keep" caption="Next & Keep New" fixup="true">bn_next_keep_new.gif</button>
 | 
			
		||||
      <button id="no" caption="No" fixup="true">bn_no.gif</button>
 | 
			
		||||
      <button id="nuke" caption="Nuke" fixup="true">bn_nuke.gif</button>
 | 
			
		||||
      <button id="ok" caption="OK" fixup="true">bn_ok.gif</button>
 | 
			
		||||
      <button id="post" caption="Post & Reload" fixup="true">bn_post_reload.gif</button>
 | 
			
		||||
      <button id="post1" caption="Post" fixup="true">bn_post.gif</button>
 | 
			
		||||
      <button id="postnext" caption="Post & Go Next" fixup="true">bn_post_go_next.gif</button>
 | 
			
		||||
      <button id="posttopics" caption="Post & Go Topics" fixup="true">bn_post_go_topics.gif</button>
 | 
			
		||||
      <button id="preview" caption="Preview" fixup="true">bn_preview.gif</button>
 | 
			
		||||
      <button id="previous" caption="Previous" fixup="true">bn_ar_previous.gif</button>
 | 
			
		||||
      <button id="publish" caption="Publish" fixup="true">bn_publish.gif</button>
 | 
			
		||||
      <button id="read_new" caption="Read New" fixup="true">bn_read_new.gif</button>
 | 
			
		||||
      <button id="remind" caption="Password Reminder" fixup="true">bn_reminder.gif</button>
 | 
			
		||||
      <button id="remove" caption="Remove" fixup="true">bn_remove.gif</button>
 | 
			
		||||
      <button id="scribble" caption="Scribble" fixup="true">bn_scribble.gif</button>
 | 
			
		||||
      <button id="search" caption="Search" fixup="true">bn_search.gif</button>
 | 
			
		||||
      <button id="send" caption="Send E-Mail" fixup="true">bn_send_email.gif</button>
 | 
			
		||||
      <button id="sendagain" caption="Send Again" fixup="true">bn_send_again.gif</button>
 | 
			
		||||
      <button id="set" caption="Set" fixup="true">bn_set.gif</button>
 | 
			
		||||
      <button id="show" caption="Show" fixup="true">bn_show.gif</button>
 | 
			
		||||
      <button id="show_topic" caption="Show Topic" fixup="true">bn_show_topic.gif</button>
 | 
			
		||||
      <button id="topic_list" caption="Topic List" fixup="true">bn_topic_list.gif</button>
 | 
			
		||||
      <button id="ua_accept" caption="I Accept" fixup="true">bn_i_accept.gif</button>
 | 
			
		||||
      <button id="ua_decline" caption="I Decline" fixup="true">bn_i_decline.gif</button>
 | 
			
		||||
      <button id="unarchive_topic" caption="Unarchive Topic" fixup="true">bn_unarchive_topic.gif</button>
 | 
			
		||||
      <button id="unfreeze_topic" caption="Unfreeze Topic" fixup="true">bn_unfreeze_topic.gif</button>
 | 
			
		||||
      <button id="update" caption="Update" fixup="true">bn_update.gif</button>
 | 
			
		||||
      <button id="upload" caption="Upload" fixup="true">bn_upload.gif</button>
 | 
			
		||||
      <button id="yes" caption="Yes" fixup="true">bn_yes.gif</button>
 | 
			
		||||
      <button id="_null_" fixup="true">bn_transparent.gif</button>
 | 
			
		||||
    </buttons>
 | 
			
		||||
 | 
			
		||||
    <!-- Uncomment this section and comment the above section out to use the new "gelcap" buttons
 | 
			
		||||
    <buttons width="80" height="24">
 | 
			
		||||
      <button id="add" caption="Add" fixup="true">gelcap/add.jpg</button>
 | 
			
		||||
      <button id="add_to_hotlist" caption="Add To Hotlist" fixup="true">gelcap/add_to_hotlist.jpg</button>
 | 
			
		||||
      <button id="add_topic" caption="Add Topic" fixup="true">gelcap/add_topic.jpg</button>
 | 
			
		||||
      <button id="archive_topic" caption="Archive Topic" fixup="true">gelcap/archive_topic.jpg</button>
 | 
			
		||||
      <button id="cancel" caption="Cancel" fixup="true">gelcap/cancel.jpg</button>
 | 
			
		||||
      <button id="conf_list" caption="Conference List" fixup="true">gelcap/conference_list.jpg</button>
 | 
			
		||||
      <button id="configure" caption="Configure" fixup="true">gelcap/configure.jpg</button>
 | 
			
		||||
      <button id="create" caption="Create" fixup="true">gelcap/create.jpg</button>
 | 
			
		||||
      <button id="createnew" caption="Create New" fixup="true">gelcap/create_new.jpg</button>
 | 
			
		||||
      <button id="delete_topic" caption="Delete Topic" fixup="true">gelcap/delete_topic.jpg</button>
 | 
			
		||||
      <button id="filter_user" caption="Filter User" fixup="true">gelcap/filter_user.jpg</button>
 | 
			
		||||
      <button id="find" caption="Find" fixup="true">gelcap/find.jpg</button>
 | 
			
		||||
      <button id="freeze_topic" caption="Freeze Topic" fixup="true">gelcap/freeze_topic.jpg</button>
 | 
			
		||||
      <button id="go" caption="Go" fixup="true">gelcap/go.jpg</button>
 | 
			
		||||
      <button id="hide" caption="Hide" fixup="true">gelcap/hide.jpg</button>
 | 
			
		||||
      <button id="hide_topic" caption="Hide Topic" fixup="true">gelcap/hide_topic.jpg</button>
 | 
			
		||||
      <button id="invite" caption="Invite" fixup="true">gelcap/invite.jpg</button>
 | 
			
		||||
      <button id="join_now" caption="Join Now" fixup="true">gelcap/join_now.jpg</button>
 | 
			
		||||
      <button id="login" caption="Log In" fixup="true">gelcap/login.jpg</button>
 | 
			
		||||
      <button id="manage" caption="Manage" fixup="true">gelcap/manage.jpg</button>
 | 
			
		||||
      <button id="next" caption="Next" fixup="true">gelcap/arrow_next.jpg</button>
 | 
			
		||||
      <button id="next_topic" caption="Next Topic" fixup="true">gelcap/next_topic.jpg</button>
 | 
			
		||||
      <button id="next_topic_keep" caption="Next & Keep New" fixup="true">gelcap/next_keep_new.jpg</button>
 | 
			
		||||
      <button id="no" caption="No" fixup="true">gelcap/no.jpg</button>
 | 
			
		||||
      <button id="nuke" caption="Nuke" fixup="true">gelcap/nuke.jpg</button>
 | 
			
		||||
      <button id="ok" caption="OK" fixup="true">gelcap/ok.jpg</button>
 | 
			
		||||
      <button id="post" caption="Post & Reload" fixup="true">gelcap/post_reload.jpg</button>
 | 
			
		||||
      <button id="post1" caption="Post" fixup="true">gelcap/post.jpg</button>
 | 
			
		||||
      <button id="postnext" caption="Post & Go Next" fixup="true">gelcap/post_go_next.jpg</button>
 | 
			
		||||
      <button id="posttopics" caption="Post & Go Topics" fixup="true">gelcap/post_go_topics.jpg</button>
 | 
			
		||||
      <button id="preview" caption="Preview" fixup="true">gelcap/preview.jpg</button>
 | 
			
		||||
      <button id="previous" caption="Previous" fixup="true">gelcap/arrow_previous.jpg</button>
 | 
			
		||||
      <button id="publish" caption="Publish" fixup="true">gelcap/publish.jpg</button>
 | 
			
		||||
      <button id="read_new" caption="Read New" fixup="true">gelcap/read_new.jpg</button>
 | 
			
		||||
      <button id="remind" caption="Password Reminder" fixup="true">gelcap/reminder.jpg</button>
 | 
			
		||||
      <button id="remove" caption="Remove" fixup="true">gelcap/remove.jpg</button>
 | 
			
		||||
      <button id="scribble" caption="Scribble" fixup="true">gelcap/scribble.jpg</button>
 | 
			
		||||
      <button id="search" caption="Search" fixup="true">gelcap/search.jpg</button>
 | 
			
		||||
      <button id="send" caption="Send E-Mail" fixup="true">gelcap/send_email.jpg</button>
 | 
			
		||||
      <button id="sendagain" caption="Send Again" fixup="true">gelcap/send_again.jpg</button>
 | 
			
		||||
      <button id="set" caption="Set" fixup="true">gelcap/set.jpg</button>
 | 
			
		||||
      <button id="show" caption="Show" fixup="true">gelcap/show.jpg</button>
 | 
			
		||||
      <button id="show_topic" caption="Show Topic" fixup="true">gelcap/show_topic.jpg</button>
 | 
			
		||||
      <button id="topic_list" caption="Topic List" fixup="true">gelcap/topic_list.jpg</button>
 | 
			
		||||
      <button id="ua_accept" caption="I Accept" fixup="true">gelcap/user_accept.jpg</button>
 | 
			
		||||
      <button id="ua_decline" caption="I Decline" fixup="true">gelcap/user_decline.jpg</button>
 | 
			
		||||
      <button id="unarchive_topic" caption="Unarchive Topic" fixup="true">gelcap/unarchive_topic.jpg</button>
 | 
			
		||||
      <button id="unfreeze_topic" caption="Unfreeze Topic" fixup="true">gelcap/unfreeze_topic.jpg</button>
 | 
			
		||||
      <button id="update" caption="Update" fixup="true">gelcap/update.jpg</button>
 | 
			
		||||
      <button id="upload" caption="Upload" fixup="true">gelcap/upload.jpg</button>
 | 
			
		||||
      <button id="yes" caption="Yes" fixup="true">gelcap/yes.jpg</button>
 | 
			
		||||
      <button id="_null_" fixup="true">bn_transparent.gif</button>
 | 
			
		||||
    </buttons>
 | 
			
		||||
    -->
 | 
			
		||||
 | 
			
		||||
  </rendering>
 | 
			
		||||
 | 
			
		||||
  <!-- Configuration for the Remapper servlet, which can remap a called URL to another one. -->
 | 
			
		||||
  <remapper>
 | 
			
		||||
    <remap path="/verifyemail">
 | 
			
		||||
      <param name="tgt">top.js.vs</param>
 | 
			
		||||
      <target type="servlet">verify_email.js.vs?tgt=${tgt}</target>
 | 
			
		||||
    </remap>
 | 
			
		||||
  </remapper>
 | 
			
		||||
 | 
			
		||||
  <!-- Contains standard messages displayed by front end -->
 | 
			
		||||
  <messages>
 | 
			
		||||
    <!-- The message displayed at the top of "top" when you're not logged in (HTML). -->
 | 
			
		||||
    <welcome><![CDATA[
 | 
			
		||||
Welcome to the <B>Venice Web Communities System</B>.  To get the most out of this site, you should log in
 | 
			
		||||
or create an account, using one of the links above.
 | 
			
		||||
    ]]></welcome>
 | 
			
		||||
 | 
			
		||||
    <!-- The headline for the welcome message. -->
 | 
			
		||||
    <welcome-top>Welcome to Venice</welcome-top>
 | 
			
		||||
 | 
			
		||||
    <!-- The headline for the "currents" box. -->
 | 
			
		||||
    <currents-top>Venice Currents</currents-top>
 | 
			
		||||
 | 
			
		||||
    <!-- The text displayed within the page footer (HTML). -->
 | 
			
		||||
    <footer-text><![CDATA[
 | 
			
		||||
All trademarks and copyrights on this page are owned by their respective companies.<BR>
 | 
			
		||||
All messages posted by users on this page are owned by those users.<BR>
 | 
			
		||||
The rest: Copyright © 2001 <A HREF="http://www.silverwrist.com">Silverwrist Design Studios</A>,
 | 
			
		||||
All Rights Reserved.<BR>
 | 
			
		||||
See our <A HREF="/TODO">Policy Page</A> for our copyright and privacy policies.
 | 
			
		||||
    ]]></footer-text>
 | 
			
		||||
 | 
			
		||||
    <!-- The thing that users must click on "I Accept" for before they can create an account -->
 | 
			
		||||
    <user-agreement><![CDATA[
 | 
			
		||||
Text of this agreement is TBD.
 | 
			
		||||
    ]]></user-agreement>
 | 
			
		||||
 | 
			
		||||
    <!-- Title displayed for above. -->
 | 
			
		||||
    <user-agreement-title>Venice User Agreement</user-agreement-title>
 | 
			
		||||
 | 
			
		||||
  </messages>
 | 
			
		||||
 | 
			
		||||
  <!-- Menu definitions for the base page -->
 | 
			
		||||
  <menu-definitions>
 | 
			
		||||
 | 
			
		||||
    <!-- Definition for the "top" menu (when not in a community) -->
 | 
			
		||||
    <menudef id="top">
 | 
			
		||||
      <title>Front Page</title>
 | 
			
		||||
      <link href="TODO" type="absolute" disabled="true">Calendar</link>
 | 
			
		||||
      <link href="TODO" type="absolute" disabled="true">Chat</link>
 | 
			
		||||
    </menudef>
 | 
			
		||||
 | 
			
		||||
    <!-- Definition for the "fixed" menu (always displayed under the "top" or "community" menus) -->
 | 
			
		||||
    <menudef id="fixed">
 | 
			
		||||
      <title>About This Site</title>
 | 
			
		||||
      <link href="TODO" type="absolute" disabled="true">Documentation</link>
 | 
			
		||||
      <link href="about-venice.html" type="frame">About Venice</link>
 | 
			
		||||
    </menudef>
 | 
			
		||||
 | 
			
		||||
    <!-- Community administration menu -->
 | 
			
		||||
    <menudef id="community.admin">
 | 
			
		||||
      <title>Community Administration:</title>
 | 
			
		||||
      <subtitle>${name}</subtitle>
 | 
			
		||||
      <link href="comm/profile.js.vs?cc=${cid}" type="servlet">Community Profile</link>
 | 
			
		||||
      <link href="comm/category.js.vs?cc=${cid}" type="servlet">Set Community Category</link>
 | 
			
		||||
      <link href="TODO?cc=${cid}" type="servlet">Set Community Services</link>
 | 
			
		||||
      <link href="comm/set_member.js.vs?cc=${cid}" type="servlet">Membership Control</link>
 | 
			
		||||
      <link href="comm/email.js.vs?cc=${cid}" type="servlet">E-Mail To All Members</link>
 | 
			
		||||
      <link href="comm/audit.js.vs?cc=${cid}" type="servlet">Display Audit Records</link>
 | 
			
		||||
      <link href="comm/delete.js.vs?cc=${cid}" type="servlet">Delete Community</link>
 | 
			
		||||
    </menudef>
 | 
			
		||||
 | 
			
		||||
    <!-- System administration menu -->
 | 
			
		||||
    <menudef id="system.admin">
 | 
			
		||||
      <title>System Administration</title>
 | 
			
		||||
      <link href="sysadmin/global.js.vs" type="servlet">Edit Global Properties</link>
 | 
			
		||||
      <link href="TODO" type="servlet">View/Edit Banned Users</link>
 | 
			
		||||
      <link href="sysadmin/find_user.js.vs" type="servlet">User Account Management</link>
 | 
			
		||||
      <link href="sysadmin/audit.js.vs" type="servlet">System Audit Logs</link>
 | 
			
		||||
      <link href="sysadmin/import.js.vs" type="servlet">Import User Accounts</link>
 | 
			
		||||
    </menudef>
 | 
			
		||||
 | 
			
		||||
    <!-- Conference Host Tools menu -->
 | 
			
		||||
    <menudef id="conf.host.tools">
 | 
			
		||||
      <title>Host Tools</title>
 | 
			
		||||
      <link href="conf/edit.js.vs?cc=${cid}&conf=${confid}"
 | 
			
		||||
            type="servlet">Change Conference Information</link>
 | 
			
		||||
      <link href="conf/aliases.js.vs?cc=${cid}&conf=${confid}"
 | 
			
		||||
            type="servlet">Manage Conference Aliases</link>
 | 
			
		||||
      <link href="conf/membership.js.vs?cc=${cid}&conf=${confid}"
 | 
			
		||||
            type="servlet">Manage Conference Members</link>
 | 
			
		||||
      <link href="conf/custom.js.vs?cc=${cid}&conf=${confid}"
 | 
			
		||||
            type="servlet">Customize Conference Appearance</link>
 | 
			
		||||
      <link href="conf/conf_reports.js.vs?cc=${cid}&conf=${confid}"
 | 
			
		||||
            type="servlet">Conference Activity Reports</link>
 | 
			
		||||
      <link href="conf/email.js.vs?cc=${cid}&conf=${confid}" type="servlet">Conference E-Mail</link>
 | 
			
		||||
      <link href="conf/delete.js.vs?cc=${cid}&conf=${confid}" type="servlet">Delete Conference</link>
 | 
			
		||||
    </menudef>
 | 
			
		||||
 | 
			
		||||
  </menu-definitions>
 | 
			
		||||
 | 
			
		||||
  <!-- Definitions for dialog boxes -->
 | 
			
		||||
  <dialog-definitions>
 | 
			
		||||
 | 
			
		||||
    <dialog name="login" formname="loginform" menusel="top">
 | 
			
		||||
      <title>Log In</title>
 | 
			
		||||
      <action>login.js.vs</action>
 | 
			
		||||
      <instructions><![CDATA[
 | 
			
		||||
Forgot your password?  Enter your user name and click the <B>Reminder</B> button to receive a password
 | 
			
		||||
reminder via E-mail.
 | 
			
		||||
      ]]></instructions>
 | 
			
		||||
      <hidden name="tgt" value=""/>
 | 
			
		||||
      <veniceid name="user" capt="User name" size="32" maxlength="64"/>
 | 
			
		||||
      <password name="pass" capt="Password" size="32" maxlength="128"/>
 | 
			
		||||
      <checkbox name="saveme" capt="Remember me for next time so I can log in automatically"/>
 | 
			
		||||
      <imagebutton id="login"/>
 | 
			
		||||
      <imagebutton id="remind"/>
 | 
			
		||||
      <imagebutton id="cancel"/>
 | 
			
		||||
    </dialog>
 | 
			
		||||
 | 
			
		||||
    <dialog name="newacct" formname="createform" menusel="top">
 | 
			
		||||
      <title>Create Account</title>
 | 
			
		||||
      <action>new_account_2.js.vs</action>
 | 
			
		||||
      <instructions><![CDATA[
 | 
			
		||||
To create a new account, please enter your information below.
 | 
			
		||||
      ]]></instructions>
 | 
			
		||||
      <hidden name="tgt" value=""/>
 | 
			
		||||
      <header capt="Name"/>
 | 
			
		||||
      <text name="prefix" capt="Prefix" capt2="(Mr., Ms., etc.)" size="8" maxlength="8"/>
 | 
			
		||||
      <text name="first" capt="First Name" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <text name="mid" capt="Middle initial" size="1" maxlength="1"/>
 | 
			
		||||
      <text name="last" capt="Last Name" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <text name="suffix" capt="Suffix" capt2="(Jr., III, etc.)" size="16" maxlength="16"/>
 | 
			
		||||
      <header capt="Location"/>
 | 
			
		||||
      <text name="loc" capt="City" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <text name="reg" capt="State/Province" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <text name="pcode" capt="Zip/Postal Code" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <countrylist name="country" capt="Country" required="true"/>
 | 
			
		||||
      <header capt="E-Mail"/>
 | 
			
		||||
      <email name="email" capt="E-mail address" required="true" size="32" maxlength="255"/>
 | 
			
		||||
      <header capt="Account Information"/>
 | 
			
		||||
      <veniceid name="user" capt="User name" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <password name="pass1" capt="Password" required="true" size="32" maxlength="128"/>
 | 
			
		||||
      <password name="pass2" capt="Password" capt2="(retype)" required="true" size="32" maxlength="128"/>
 | 
			
		||||
      <text name="remind" capt="Password reminder phrase" size="32" maxlength="255"/>
 | 
			
		||||
      <imagebutton id="create"/>
 | 
			
		||||
      <imagebutton id="cancel"/>
 | 
			
		||||
    </dialog>
 | 
			
		||||
 | 
			
		||||
    <dialog name="verify" formname="verifyform" menusel="top">
 | 
			
		||||
      <title>Verify E-mail Address</title>
 | 
			
		||||
      <action>verify_email.js.vs</action>
 | 
			
		||||
      <instructions><![CDATA[
 | 
			
		||||
Check your E-mail, then enter the confirmation number that was E-mailed to you in the field below.
 | 
			
		||||
(The E-mail might take a few minutes or so to get to you, so be patient.) Once you do so, your account
 | 
			
		||||
will be fully validated.  If you have not received your confirmation within a few minutes, click on the
 | 
			
		||||
<B>Send Again</B> button below.
 | 
			
		||||
      ]]></instructions>
 | 
			
		||||
      <hidden name="tgt" value=""/>
 | 
			
		||||
      <int name="num" capt="Confirmation Number" min="1000000" max="9999999"/>
 | 
			
		||||
      <imagebutton id="ok"/>
 | 
			
		||||
      <imagebutton id="sendagain"/>
 | 
			
		||||
      <imagebutton id="cancel"/>
 | 
			
		||||
    </dialog>
 | 
			
		||||
 | 
			
		||||
    <dialog name="profile" formname="profform" menusel="nochange">
 | 
			
		||||
      <title>Edit Your Profile</title>
 | 
			
		||||
      <action>profile.js.vs</action>
 | 
			
		||||
      <hidden name="tgt" value=""/>
 | 
			
		||||
      <header capt="Password">To change your password, enter a new password into the fields below.</header>
 | 
			
		||||
      <password name="pass1" capt="Password" size="32" maxlength="128"/>
 | 
			
		||||
      <password name="pass2" capt="Password" capt2="(retype)" size="32" maxlength="128"/>
 | 
			
		||||
      <text name="remind" capt="Password reminder phrase" size="32" maxlength="255"/>
 | 
			
		||||
      <header capt="Name"/>
 | 
			
		||||
      <text name="prefix" capt="Prefix" capt2="(Mr., Ms., etc.)" size="8" maxlength="8"/>
 | 
			
		||||
      <text name="first" capt="First Name" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <text name="mid" capt="Middle initial" size="1" maxlength="1"/>
 | 
			
		||||
      <text name="last" capt="Last Name" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <text name="suffix" capt="Suffix" capt2="(Jr., III, etc.)" size="16" maxlength="16"/>
 | 
			
		||||
      <header capt="Location"/>
 | 
			
		||||
      <text name="company" capt="Company" size="32" maxlength="255"/>
 | 
			
		||||
      <text name="addr1" capt="Address" size="32" maxlength="255"/>
 | 
			
		||||
      <text name="addr2" capt="Address" capt2="(line 2)" size="32" maxlength="255"/>
 | 
			
		||||
      <checkbox name="pvt_addr" capt="Hide address in profile"/>
 | 
			
		||||
      <text name="loc" capt="City" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <text name="reg" capt="State/Province" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <text name="pcode" capt="Zip/Postal Code" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <countrylist name="country" capt="Country" required="true"/>
 | 
			
		||||
      <header capt="Phone Numbers"/>
 | 
			
		||||
      <text name="phone" capt="Telephone" size="32" maxlength="32"/>
 | 
			
		||||
      <text name="mobile" capt="Mobile/cellphone" size="32" maxlength="32"/>
 | 
			
		||||
      <checkbox name="pvt_phone" capt="Hide phone/mobile numbers in profile"/>
 | 
			
		||||
      <text name="fax" capt="Fax" size="32" maxlength="32"/>
 | 
			
		||||
      <checkbox name="pvt_fax" capt="Hide fax number in profile"/>
 | 
			
		||||
      <header capt="Internet"/>
 | 
			
		||||
      <email name="email" capt="E-mail address" required="true" size="32" maxlength="255"/>
 | 
			
		||||
      <checkbox name="pvt_email" capt="Hide E-mail address in profile"/>
 | 
			
		||||
      <text name="url" capt="Home Page" capt2="(URL)" size="32" maxlength="255"/>
 | 
			
		||||
      <header capt="Personal"/>
 | 
			
		||||
      <text name="descr" capt="Personal description" size="32" maxlength="255"/>
 | 
			
		||||
      <userphoto name="photo" capt="User Photo" link="profile_photo.js.vs" type="servlet"/>
 | 
			
		||||
      <header capt="User Preferences"/>
 | 
			
		||||
      <checkbox name="pic_in_post" capt="Display user photos next to conference posts"
 | 
			
		||||
                capt2="(where applicable)"/>
 | 
			
		||||
      <checkbox name="no_mass_mail" capt="Don't send me mass E-mail from community/conference hosts"/>
 | 
			
		||||
      <localelist name="locale" capt="Default locale" capt2="(for formatting dates/times)" required="true"/>
 | 
			
		||||
      <tzlist name="tz" capt="Default time zone" required="true"/>
 | 
			
		||||
      <imagebutton id="update"/>
 | 
			
		||||
      <imagebutton id="cancel"/>
 | 
			
		||||
    </dialog>
 | 
			
		||||
 | 
			
		||||
    <dialog name="join" formname="joinkeyform" menusel="community">
 | 
			
		||||
      <title>Join Key Required</title>
 | 
			
		||||
      <action>comm/join_key.js.vs</action>
 | 
			
		||||
      <instructions><![CDATA[
 | 
			
		||||
You must specify a join key before you can join this community.  You might have received the join key from
 | 
			
		||||
the community's host, or via an invitation e-mail message. Please enter it in the box below.
 | 
			
		||||
      ]]></instructions>
 | 
			
		||||
      <hidden name="cc" value=""/>
 | 
			
		||||
      <text name="key" capt="Join key" size="32" maxlength="64"/>
 | 
			
		||||
      <imagebutton id="join_now"/>
 | 
			
		||||
      <imagebutton id="cancel"/>
 | 
			
		||||
    </dialog>
 | 
			
		||||
 | 
			
		||||
    <dialog name="create.community" formname="createcommform" menusel="top">
 | 
			
		||||
      <title>Create New Community</title>
 | 
			
		||||
      <action>comm/create.js.vs</action>
 | 
			
		||||
      <header capt="Basic Information"/>
 | 
			
		||||
      <text name="name" capt="Community Name" required="true" size="32" maxlength="128"/>
 | 
			
		||||
      <veniceid name="alias" capt="Community Alias" required="true" size="32" maxlength="32"/>
 | 
			
		||||
      <text name="synopsis" capt="Synopsis" size="32" maxlength="255"/>
 | 
			
		||||
      <text name="rules" capt="Rules" size="32" maxlength="255"/>
 | 
			
		||||
      <languagelist name="language" capt="Primary Language" required="true"/>
 | 
			
		||||
      <header capt="Location"/>
 | 
			
		||||
      <text name="loc" capt="City" size="32" maxlength="64"/>
 | 
			
		||||
      <text name="reg" capt="State/Province" size="32" maxlength="64"/>
 | 
			
		||||
      <text name="pcode" capt="Zip/Postal Code" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <countrylist name="country" capt="Country" required="true"/>
 | 
			
		||||
      <header capt="Security"/>
 | 
			
		||||
      <list name="comtype" capt="Community type" required="true">
 | 
			
		||||
        <choice id="0">Public</choice>
 | 
			
		||||
        <choice id="1">Private</choice>
 | 
			
		||||
      </list>
 | 
			
		||||
      <text name="joinkey" capt="Join key" capt2="(for private communities)" size="32" maxlength="64"/>
 | 
			
		||||
      <list name="hidemode" capt="Community visibility" required="true">
 | 
			
		||||
        <choice id="0">Show in both directory and search</choice>
 | 
			
		||||
        <choice id="1">Hide in directory, but not in search</choice>
 | 
			
		||||
        <choice id="2">Hide in both directory and search</choice>
 | 
			
		||||
      </list>
 | 
			
		||||
      <imagebutton id="create"/>
 | 
			
		||||
      <imagebutton id="cancel"/>
 | 
			
		||||
    </dialog>
 | 
			
		||||
 | 
			
		||||
    <dialog name="community.profile" formname="commprofform" menusel="community">
 | 
			
		||||
      <title>Edit Community Profile:</title>
 | 
			
		||||
      <action>comm/profile.js.vs</action>
 | 
			
		||||
      <hidden name="cc" value=""/>
 | 
			
		||||
      <header capt="Basic Information"/>
 | 
			
		||||
      <text name="name" capt="Community Name" required="true" size="32" maxlength="128"/>
 | 
			
		||||
      <veniceid name="alias" capt="Community Alias" required="true" size="32" maxlength="32"/>
 | 
			
		||||
      <text name="synopsis" capt="Synopsis" size="32" maxlength="255"/>
 | 
			
		||||
      <text name="rules" capt="Rules" size="32" maxlength="255"/>
 | 
			
		||||
      <languagelist name="language" capt="Primary Language" required="true"/>
 | 
			
		||||
      <text name="url" capt="Home Page" size="32" maxlength="255"/>
 | 
			
		||||
      <communitylogo name="logo" capt="Community logo" link="comm/photo.js.vs" type="servlet"/>
 | 
			
		||||
      <header capt="Location"/>
 | 
			
		||||
      <text name="company" capt="Company" size="32" maxlength="255"/>
 | 
			
		||||
      <text name="addr1" capt="Address" size="32" maxlength="255"/>
 | 
			
		||||
      <text name="addr2" capt="Address" capt2="(line 2)" size="32" maxlength="255"/>
 | 
			
		||||
      <text name="loc" capt="City" size="32" maxlength="64"/>
 | 
			
		||||
      <text name="reg" capt="State/Province" size="32" maxlength="64"/>
 | 
			
		||||
      <text name="pcode" capt="Zip/Postal Code" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <countrylist name="country" capt="Country" required="true"/>
 | 
			
		||||
      <header capt="Security"/>
 | 
			
		||||
      <list name="comtype" capt="Community type" required="true">
 | 
			
		||||
        <choice id="0">Public</choice>
 | 
			
		||||
        <choice id="1">Private</choice>
 | 
			
		||||
      </list>
 | 
			
		||||
      <text name="joinkey" capt="Join key" capt2="(for private communities)" size="32" maxlength="64"/>
 | 
			
		||||
      <checkbox name="membersonly" capt="Allow only members to access this community"/>
 | 
			
		||||
      <list name="hidemode" capt="Community visibility" required="true">
 | 
			
		||||
        <choice id="0">Show in both directory and search</choice>
 | 
			
		||||
        <choice id="1">Hide in directory, but not in search</choice>
 | 
			
		||||
        <choice id="2">Hide in both directory and search</choice>
 | 
			
		||||
      </list>
 | 
			
		||||
      <rolelist name="read_lvl" capt="Security level required to read contents" required="true"/>
 | 
			
		||||
      <rolelist name="write_lvl" capt="Security level required to update profile" required="true"/>
 | 
			
		||||
      <rolelist name="create_lvl" capt="Security level required to create new subobjects" required="true"/>
 | 
			
		||||
      <rolelist name="delete_lvl" capt="Security level required to delete community" required="true"/>
 | 
			
		||||
      <rolelist name="join_lvl" capt="Security level required to join community" required="true"/>
 | 
			
		||||
      <header capt="Conferencing Options"/>
 | 
			
		||||
      <checkbox name="pic_in_post" capt="Display user pictures next to posts in conferences"
 | 
			
		||||
                capt2="(by default; user can override)"/>
 | 
			
		||||
      <imagebutton id="update"/>
 | 
			
		||||
      <imagebutton id="cancel"/>
 | 
			
		||||
    </dialog>
 | 
			
		||||
 | 
			
		||||
    <dialog name="global.properties" formname="globpropform" menusel="nochange">
 | 
			
		||||
      <title>Edit Global Properties</title>
 | 
			
		||||
      <action>sysadmin/global.js.vs</action>
 | 
			
		||||
      <header capt="System Properties"/>
 | 
			
		||||
      <int name="search_items" capt="Number of search items to display per page" min="5" max="100"/>
 | 
			
		||||
      <int name="fp_posts" capt="Number of published posts to display on front page" min="1" max="50"/>
 | 
			
		||||
      <int name="audit_recs" capt="Number of audit records to display per page" min="10" max="500"/>
 | 
			
		||||
      <rolelist name="create_lvl" capt="Security level required to create a new community" required="true"/>
 | 
			
		||||
      <header capt="Community Properties"/>
 | 
			
		||||
      <int name="comm_mbrs" capt="Number of community members to display per page" min="10" max="100"/>
 | 
			
		||||
      <header capt="Conferencing Properties"/>
 | 
			
		||||
      <int name="posts_page" capt="Maximum number of posts to display per page" min="5" max="100"/>
 | 
			
		||||
      <int name="old_posts" capt='Number of "old" posts to display at top of page' min="1" max="5"/>
 | 
			
		||||
      <int name="conf_mbrs" capt="Number of conference members to display per page" min="10" max="100"/>
 | 
			
		||||
      <checkbox name="pic_in_post" capt="Display user pictures next to posts in conferences"
 | 
			
		||||
                capt2="(by default; user can override)"/>
 | 
			
		||||
      <imagebutton id="update"/>
 | 
			
		||||
      <imagebutton id="cancel"/>
 | 
			
		||||
    </dialog>
 | 
			
		||||
 | 
			
		||||
    <dialog name="admin.modify.user" formname="moduserform" menusel="nochange">
 | 
			
		||||
      <title>Modify User Account</title>
 | 
			
		||||
      <action>sysadmin/modify_user.js.vs</action>
 | 
			
		||||
      <hidden name="uid" value=""/>
 | 
			
		||||
      <header capt="Security Information">
 | 
			
		||||
        To change the user's password, enter a new password into the fields below.
 | 
			
		||||
      </header>
 | 
			
		||||
      <password name="pass1" capt="Password" size="32" maxlength="128"/>
 | 
			
		||||
      <password name="pass2" capt="Password" capt2="(retype)" size="32" maxlength="128"/>
 | 
			
		||||
      <text name="remind" capt="Password reminder phrase" size="32" maxlength="255"/>
 | 
			
		||||
      <rolelist name="base_lvl" capt="Base security level" required="true"/>
 | 
			
		||||
      <checkbox name="verify_email" capt="E-mail address verified"/>
 | 
			
		||||
      <checkbox name="lockout" capt="Account locked out"/>
 | 
			
		||||
      <checkbox name="nophoto" capt="Disallow photo upload for this user"/>
 | 
			
		||||
      <header capt="Name"/>
 | 
			
		||||
      <text name="prefix" capt="Prefix" capt2="(Mr., Ms., etc.)" size="8" maxlength="8"/>
 | 
			
		||||
      <text name="first" capt="First Name" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <text name="mid" capt="Middle initial" size="1" maxlength="1"/>
 | 
			
		||||
      <text name="last" capt="Last Name" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <text name="suffix" capt="Suffix" capt2="(Jr., III, etc.)" size="16" maxlength="16"/>
 | 
			
		||||
      <header capt="Location"/>
 | 
			
		||||
      <text name="company" capt="Company" size="32" maxlength="255"/>
 | 
			
		||||
      <text name="addr1" capt="Address" size="32" maxlength="255"/>
 | 
			
		||||
      <text name="addr2" capt="Address" capt2="(line 2)" size="32" maxlength="255"/>
 | 
			
		||||
      <checkbox name="pvt_addr" capt="Hide address in profile"/>
 | 
			
		||||
      <text name="loc" capt="City" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <text name="reg" capt="State/Province" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <text name="pcode" capt="Zip/Postal Code" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <countrylist name="country" capt="Country" required="true"/>
 | 
			
		||||
      <header capt="Phone Numbers"/>
 | 
			
		||||
      <text name="phone" capt="Telephone" size="32" maxlength="32"/>
 | 
			
		||||
      <text name="mobile" capt="Mobile/cellphone" size="32" maxlength="32"/>
 | 
			
		||||
      <checkbox name="pvt_phone" capt="Hide phone/mobile numbers in profile"/>
 | 
			
		||||
      <text name="fax" capt="Fax" size="32" maxlength="32"/>
 | 
			
		||||
      <checkbox name="pvt_fax" capt="Hide fax number in profile"/>
 | 
			
		||||
      <header capt="Internet"/>
 | 
			
		||||
      <email name="email" capt="E-mail address" required="true" size="32" maxlength="255"/>
 | 
			
		||||
      <checkbox name="pvt_email" capt="Hide E-mail address in profile"/>
 | 
			
		||||
      <text name="url" capt="Home Page" capt2="(URL)" size="32" maxlength="255"/>
 | 
			
		||||
      <header capt="Personal"/>
 | 
			
		||||
      <text name="descr" capt="Personal description" size="32" maxlength="255"/>
 | 
			
		||||
      <userphoto name="photo" capt="User Photo" link="sysadmin/modify_photo.js.vs" type="servlet"/>
 | 
			
		||||
      <header capt="User Preferences"/>
 | 
			
		||||
      <checkbox name="pic_in_post" capt="Display user photos next to conference posts"
 | 
			
		||||
                capt2="(where applicable)"/>
 | 
			
		||||
      <checkbox name="no_mass_mail" capt="Don't send user mass E-mail from community/conference hosts"/>
 | 
			
		||||
      <localelist name="locale" capt="Default locale" capt2="(for formatting dates/times)" required="true"/>
 | 
			
		||||
      <tzlist name="tz" capt="Default time zone" required="true"/>
 | 
			
		||||
      <imagebutton id="update"/>
 | 
			
		||||
      <imagebutton id="cancel"/>
 | 
			
		||||
    </dialog>
 | 
			
		||||
 | 
			
		||||
    <dialog name="conf.create" formname="newconfform" menusel="community">
 | 
			
		||||
      <title>Create New Conference</title>
 | 
			
		||||
      <action>conf/create.js.vs</action>
 | 
			
		||||
      <hidden name="cc" value=""/>
 | 
			
		||||
      <text name="name" capt="Conference Name" required="true" size="32" maxlength="128"/>
 | 
			
		||||
      <veniceid name="alias" capt="Conference Alias" required="true" size="32" maxlength="64"/>
 | 
			
		||||
      <text name="descr" capt="Description" size="32" maxlength="255"/>
 | 
			
		||||
      <list name="ctype" capt="Conference type" required="true">
 | 
			
		||||
        <choice id="0">Public</choice>
 | 
			
		||||
        <choice id="1">Private</choice>
 | 
			
		||||
      </list>
 | 
			
		||||
      <checkbox name="hide" capt="Hide conference in the community's conference list"/>
 | 
			
		||||
      <imagebutton id="create"/>
 | 
			
		||||
      <imagebutton id="cancel"/>
 | 
			
		||||
    </dialog>
 | 
			
		||||
 | 
			
		||||
    <dialog name="conf.edit" formname="editconfform" menusel="community">
 | 
			
		||||
      <title>Edit Conference:</title>
 | 
			
		||||
      <action>conf/edit.js.vs</action>
 | 
			
		||||
      <hidden name="cc" value=""/>
 | 
			
		||||
      <hidden name="conf" value=""/>
 | 
			
		||||
      <header capt="Basic Information"/>
 | 
			
		||||
      <text name="name" capt="Conference Name" required="true" size="32" maxlength="128"/>
 | 
			
		||||
      <text name="descr" capt="Description" size="32" maxlength="255"/>
 | 
			
		||||
      <checkbox name="hide" capt="Hide conference in the community's conference list"/>
 | 
			
		||||
      <header capt="Security Information"/>
 | 
			
		||||
      <rolelist name="read_lvl" capt="Security level required to read conference" required="true"/>
 | 
			
		||||
      <rolelist name="post_lvl" capt="Security level required to post to conference" required="true"/>
 | 
			
		||||
      <rolelist name="create_lvl" capt="Security level required to create new topics in conference"
 | 
			
		||||
                required="true"/>
 | 
			
		||||
      <rolelist name="hide_lvl" capt="Security level required to archive or freeze topics"
 | 
			
		||||
                capt2="(or to hide posts of which you are not the owner)" required="true"/>
 | 
			
		||||
      <rolelist name="nuke_lvl" capt="Security level required to delete topics or nuke posts"
 | 
			
		||||
                capt2="(or to scribble posts of which you are not the owner)" required="true"/>
 | 
			
		||||
      <rolelist name="change_lvl" capt="Security level required to change conference attributes"
 | 
			
		||||
                required="true"/>
 | 
			
		||||
      <rolelist name="delete_lvl" capt="Security level required to delete conference" required="true"/>
 | 
			
		||||
      <header capt="Conference Properties"/>
 | 
			
		||||
      <checkbox name="pic_in_post" capt="Display users' pictures next to their posts"
 | 
			
		||||
                capt2="(user can override)"/>
 | 
			
		||||
      <imagebutton id="update"/>
 | 
			
		||||
      <imagebutton id="cancel"/>
 | 
			
		||||
    </dialog>
 | 
			
		||||
 | 
			
		||||
  </dialog-definitions>
 | 
			
		||||
 | 
			
		||||
</ui-config>
 | 
			
		||||
@ -327,16 +327,13 @@
 | 
			
		||||
       be fed to emailed output. -->
 | 
			
		||||
  <messages>
 | 
			
		||||
    <!-- A "signature" that gets appended to emailed messages. -->
 | 
			
		||||
    <signature>
 | 
			
		||||
      <![CDATA[
 | 
			
		||||
    <signature><![CDATA[
 | 
			
		||||
Venice - community services, conferencing and more.  <http://venice.sourceforge.net>
 | 
			
		||||
      ]]>
 | 
			
		||||
    </signature>
 | 
			
		||||
    ]]></signature>
 | 
			
		||||
 | 
			
		||||
    <!-- This is the message sent out with the email confirmation number. -->
 | 
			
		||||
    <!-- Parameters: username - account user name, confnum - confirmation number -->
 | 
			
		||||
    <email-confirm>
 | 
			
		||||
      <![CDATA[
 | 
			
		||||
    <email-confirm><![CDATA[
 | 
			
		||||
Welcome to the Venice conferencing system!  In order to fully activate your
 | 
			
		||||
account after you register or change your E-mail address, you must provide a
 | 
			
		||||
confirmation number to the system.  Please enter this number into the "Confirm
 | 
			
		||||
@ -344,19 +341,19 @@ E-mail Address" dialog on the system when indicated.
 | 
			
		||||
 | 
			
		||||
Your confirmation number for your account "${username}" is ${confnum}.
 | 
			
		||||
 | 
			
		||||
Access the E-mail verification dialog at <http://delenn/venice/verifyemail>.
 | 
			
		||||
 | 
			
		||||
Thank you, and enjoy the Venice conferencing system!
 | 
			
		||||
 | 
			
		||||
-- The Management
 | 
			
		||||
      ]]>
 | 
			
		||||
    </email-confirm>
 | 
			
		||||
    ]]></email-confirm>
 | 
			
		||||
 | 
			
		||||
    <!-- The subject of the message with the email confirmation number. -->
 | 
			
		||||
    <email-confirm-subject>Venice Email Confirmation</email-confirm-subject>
 | 
			
		||||
 | 
			
		||||
    <!-- This is the "password reminder" message. -->
 | 
			
		||||
    <!-- Parameters: username - account user name, reminder - password reminder -->
 | 
			
		||||
    <reminder>
 | 
			
		||||
      <![CDATA[
 | 
			
		||||
    <reminder><![CDATA[
 | 
			
		||||
Here is the password reminder for your account "${username}" as you requested:
 | 
			
		||||
 | 
			
		||||
${reminder}
 | 
			
		||||
@ -373,13 +370,11 @@ attempting to access your account without your knowledge.  Do not panic!  Nothin
 | 
			
		||||
happened to your account or password yet, but please do notify the system administrator.
 | 
			
		||||
 | 
			
		||||
-- The Management
 | 
			
		||||
      ]]>
 | 
			
		||||
    </reminder>
 | 
			
		||||
    ]]></reminder>
 | 
			
		||||
 | 
			
		||||
    <reminder-subject>Venice Password Reminder Message</reminder-subject>
 | 
			
		||||
 | 
			
		||||
    <password-change>
 | 
			
		||||
      <![CDATA[
 | 
			
		||||
    <password-change><![CDATA[
 | 
			
		||||
The password for your account "${username}" has been changed.  The new password is "${password}".
 | 
			
		||||
 | 
			
		||||
You should log into Venice immediately and change the password to something else.  You can change the
 | 
			
		||||
@ -389,8 +384,7 @@ If you did NOT request a password change on your account, please notify the syst
 | 
			
		||||
IMMEDIATELY.
 | 
			
		||||
 | 
			
		||||
-- The Management
 | 
			
		||||
      ]]>
 | 
			
		||||
    </password-change>
 | 
			
		||||
    ]]></password-change>
 | 
			
		||||
 | 
			
		||||
    <password-change-subject>Venice Password Changed</password-change-subject>
 | 
			
		||||
 | 
			
		||||
@ -398,8 +392,7 @@ IMMEDIATELY.
 | 
			
		||||
    <!-- Parameters: community.name = name of community, community.alias = alias of community,
 | 
			
		||||
                     personal = personal message, fullname = name of inviter,
 | 
			
		||||
                     username = user name of inviter -->
 | 
			
		||||
    <invite-public>
 | 
			
		||||
      <![CDATA[
 | 
			
		||||
    <invite-public><![CDATA[
 | 
			
		||||
Hi! I would like to invite you to join the "${community.name}" community on the Venice conferencing system.
 | 
			
		||||
To do so, you must register as a user, which is absolutely free!  Just point your Web browser at
 | 
			
		||||
<http://delenn/venice/sig/${community.alias}> and click the "Create Account" link at the top of the page,
 | 
			
		||||
@ -412,15 +405,13 @@ ${personal}
 | 
			
		||||
Hope to see you in "${community.name}" soon!
 | 
			
		||||
 | 
			
		||||
-- ${fullname} (Venice user ID: ${username})
 | 
			
		||||
      ]]>
 | 
			
		||||
    </invite-public>
 | 
			
		||||
    ]]></invite-public>
 | 
			
		||||
 | 
			
		||||
    <!-- Invitation message to a private community -->
 | 
			
		||||
    <!-- Parameters: community.name = name of community, community.alias = alias of community,
 | 
			
		||||
                     joinkey = join key for community, personal = personal message,
 | 
			
		||||
                     fullname = name of inviter, username = user name of inviter -->
 | 
			
		||||
    <invite-private>
 | 
			
		||||
      <![CDATA[
 | 
			
		||||
    <invite-private><![CDATA[
 | 
			
		||||
Hi! I would like to invite you to join the "${community.name}" community on the Venice conferencing system.
 | 
			
		||||
To do so, you must register as a user, which is absolutely free!  Just point your Web browser at
 | 
			
		||||
<http://delenn/venice/sig/${community.alias}> and click the "Create Account" link at the top of the page,
 | 
			
		||||
@ -433,8 +424,7 @@ ${personal}
 | 
			
		||||
Hope to see you in "${community.name}" soon!
 | 
			
		||||
 | 
			
		||||
-- ${fullname} (Venice user ID: ${username})
 | 
			
		||||
      ]]>
 | 
			
		||||
    </invite-private>
 | 
			
		||||
    ]]></invite-private>
 | 
			
		||||
 | 
			
		||||
    <!-- Subject line for invitation messages -->
 | 
			
		||||
    <!-- Parameters: community.name = name of community -->
 | 
			
		||||
@ -459,27 +449,23 @@ on the "${topic.name}" topic name in the topic list.
 | 
			
		||||
 | 
			
		||||
    <!-- Template used for E-mailing posts to users (top half of E-mail) -->
 | 
			
		||||
    <!-- Parameters: message.poster, topic.name, topic.locator, conference.name, community.name -->
 | 
			
		||||
    <mail-post-top>
 | 
			
		||||
      <![CDATA[
 | 
			
		||||
    <mail-post-top><![CDATA[
 | 
			
		||||
The following message was just posted by "${message.poster}" to the
 | 
			
		||||
"${topic.name}" topic in the "${conference.name}" conference
 | 
			
		||||
of the "${community.name}" community on the Venice community system.
 | 
			
		||||
--------------------------------------------------------------------------
 | 
			
		||||
      ]]>
 | 
			
		||||
    </mail-post-top>
 | 
			
		||||
    ]]></mail-post-top>
 | 
			
		||||
 | 
			
		||||
    <!-- Template used for E-mailing posts to users (bottom half of E-mail) -->
 | 
			
		||||
    <!-- Parameters: message.poster, topic.name, topic.locator, conference.name, community.name -->
 | 
			
		||||
    <mail-post-bottom>
 | 
			
		||||
      <![CDATA[
 | 
			
		||||
    <mail-post-bottom><![CDATA[
 | 
			
		||||
--------------------------------------------------------------------------
 | 
			
		||||
Join the ongoing discussion at:
 | 
			
		||||
http://delenn/venice/go/${topic.locator}
 | 
			
		||||
 | 
			
		||||
To stop receiving new posts in this topic by E-mail, visit the above URL,
 | 
			
		||||
click the "Manage" button, and click the "Stop Subscribing To This Topic" link.
 | 
			
		||||
      ]]>
 | 
			
		||||
    </mail-post-bottom>
 | 
			
		||||
    ]]></mail-post-bottom>
 | 
			
		||||
 | 
			
		||||
    <!-- Subject line for posts that are E-mailed to users -->
 | 
			
		||||
    <!-- Parameters: message.poster, topic.name, topic.locator, conference.name, community.name -->
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										464
									
								
								etc/web.xml
									
									
									
									
									
								
							
							
						
						
									
										464
									
								
								etc/web.xml
									
									
									
									
									
								
							@ -49,408 +49,178 @@
 | 
			
		||||
  </context-param>
 | 
			
		||||
 | 
			
		||||
  <context-param>
 | 
			
		||||
    <param-name>render.config</param-name>
 | 
			
		||||
    <param-value>WEB-INF/render-config.xml</param-value>
 | 
			
		||||
    <param-name>ui.config</param-name>
 | 
			
		||||
    <param-value>WEB-INF/ui-config.xml</param-value>
 | 
			
		||||
    <description>
 | 
			
		||||
      The path and file name, relative to the application root directory, of the Venice rendering
 | 
			
		||||
      configuration file, which needs to be loaded into the Venice rendering system at start-up.
 | 
			
		||||
      The path and file name, relative to the application root directory, of the Venice user interface
 | 
			
		||||
      configuration file, which needs to be loaded into the Venice UI at start-up.
 | 
			
		||||
    </description>
 | 
			
		||||
  </context-param>
 | 
			
		||||
 | 
			
		||||
  <!-- Venice servlet definitions -->
 | 
			
		||||
  <!-- Servlet definitions -->
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>top</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Displays the top-level page of the Venice application.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.Top</servlet-class>
 | 
			
		||||
    <!-- The Top servlet needs to be loaded first at startup, as it initializes the
 | 
			
		||||
         Venice system engine -->
 | 
			
		||||
    <load-on-startup>3</load-on-startup>
 | 
			
		||||
    <servlet-name>ScriptExec</servlet-name>
 | 
			
		||||
    <description>Executes a scripting language file as a servlet.</description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.ui.servlet.ScriptExecServlet</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>framestatic</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Displays static content inside the Venice frame.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.FrameStatic</servlet-class>
 | 
			
		||||
    <servlet-name>StyleSheet</servlet-name>
 | 
			
		||||
    <description>Generates the stylesheet included by the frame JSP file.</description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.ui.servlet.StyleSheetServlet</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>account</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Account management operations - login, logout, create, verify email, enter profile.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.Account</servlet-class>
 | 
			
		||||
    <servlet-name>Frame</servlet-name>
 | 
			
		||||
    <description>Displays static content inside the Venice frame.</description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.ui.servlet.FrameServlet</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>systemadmin</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      System administration operations.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.SystemAdmin</servlet-class>
 | 
			
		||||
    <servlet-name>GetImage</servlet-name>
 | 
			
		||||
    <description>Retrieves images from the database image store and displays them.</description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.ui.servlet.GetImageServlet</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>settings</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      User customization and settings operations.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.Settings</servlet-class>
 | 
			
		||||
    <servlet-name>User</servlet-name>
 | 
			
		||||
    <description>Displays user profiles.</description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.ui.servlet.UserServlet</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>userdisplay</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Displays Venice user profiles.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.UserDisplay</servlet-class>
 | 
			
		||||
    <servlet-name>CommunityDispatch</servlet-name>
 | 
			
		||||
    <description>Redirects the user to the "default" service page for a community.</description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.ui.servlet.CommunityDispatchServlet</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>communityfrontend</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      The "front end" for community display; it redirects the user to whatever page has
 | 
			
		||||
      been defined as the "default" for that community.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.CommunityFrontEnd</servlet-class>
 | 
			
		||||
    <servlet-name>PostShortcut</servlet-name>
 | 
			
		||||
    <description>Redirects the user to a comunity, conference, topic, or message.</description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.ui.conf.PostShortcutServlet</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>communityprofile</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Displays the profile for a given community.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.CommunityProfile</servlet-class>
 | 
			
		||||
    <servlet-name>PasswordRecovery</servlet-name>
 | 
			
		||||
    <description>Performs a password change operation for a user that's forgotten their password.</description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.ui.servlet.PasswordRecoveryServlet</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>communityadmin</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Community administration functions.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.CommunityAdmin</servlet-class>
 | 
			
		||||
    <servlet-name>Gateway</servlet-name>
 | 
			
		||||
    <description>Gateways access to a specific URL through the Venice login screen.</description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.ui.servlet.GatewayServlet</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>communityoperations</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      General community operations.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.CommunityOperations</servlet-class>
 | 
			
		||||
    <servlet-name>Remapper</servlet-name>
 | 
			
		||||
    <description>Remaps calls from one URL to another.</description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.ui.servlet.RemapperServlet</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>find</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      The main Find page.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.Find</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
  <!-- Servlet mappings -->
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>confoperations</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      General conference operations.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.ConfOperations</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>confdisplay</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Conference topic list and topic display.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.ConfDisplay</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>postmessage</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Posting messages to a conference.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.PostMessage</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>attachment</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Andles downloading and uploading attachments.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.Attachment</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>topicoperations</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      General topic operations.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.TopicOperations</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>postoperations</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      General post operations.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.PostOperations</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>postshortcut</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Processes post links and redirects to the appropriate page.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.PostShortcut</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>imageretrieve</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Retrieves images from the database image store and displays them.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.ImageRetrieve</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>userphoto</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Changes the photo in a user's profile (uploads a new one).
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.UserPhoto</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>stylesheet</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Generates the stylesheet included by the top-level JSP file).
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.StyleSheet</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>passrecovery</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Performs a password change operation for a user that's forgotten their password.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.PasswordRecovery</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>communitylogo</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Changes the logo for a community (uploads a new one).
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.CommunityLogo</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>gateway</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Gateways access to a specific URL through the Venice login screen.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.Gateway</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>memberredirect</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Displays the members list for a community (internal redirect to CommunityOperations).
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.MemberRedirect</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>adminuserphoto</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Changes the photo in a user's profile (uploads a new one).
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.AdminUserPhoto</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>findpost</servlet-name>
 | 
			
		||||
    <description>
 | 
			
		||||
      Searches for posts in communities, conferences, or topics.
 | 
			
		||||
    </description>
 | 
			
		||||
    <servlet-class>com.silverwrist.venice.servlets.FindPost</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <!-- the following are test servlets, they should go away -->
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>testformdata</servlet-name>
 | 
			
		||||
    <servlet-class>com.silverwrist.util.test.FormDataTest</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <servlet>
 | 
			
		||||
    <servlet-name>dumpall</servlet-name>
 | 
			
		||||
    <servlet-class>com.silverwrist.util.test.DumpAll</servlet-class>
 | 
			
		||||
  </servlet>
 | 
			
		||||
 | 
			
		||||
  <!-- Mappings from URLs in the server to Venice servlets. -->
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>top</servlet-name>
 | 
			
		||||
    <url-pattern>/top</url-pattern>
 | 
			
		||||
    <servlet-name>ScriptExec</servlet-name>
 | 
			
		||||
    <url-pattern>*.vs</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>framestatic</servlet-name>
 | 
			
		||||
    <url-pattern>/frame/*</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>account</servlet-name>
 | 
			
		||||
    <url-pattern>/account</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>systemadmin</servlet-name>
 | 
			
		||||
    <url-pattern>/sysadmin</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>settings</servlet-name>
 | 
			
		||||
    <url-pattern>/settings</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>userdisplay</servlet-name>
 | 
			
		||||
    <url-pattern>/user/*</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>communityfrontend</servlet-name>
 | 
			
		||||
    <url-pattern>/sig/*</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>communityprofile</servlet-name>
 | 
			
		||||
    <url-pattern>/sigprofile</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>communityadmin</servlet-name>
 | 
			
		||||
    <url-pattern>/sigadmin</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>communityoperations</servlet-name>
 | 
			
		||||
    <url-pattern>/sigops</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>find</servlet-name>
 | 
			
		||||
    <url-pattern>/find</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>confoperations</servlet-name>
 | 
			
		||||
    <url-pattern>/confops</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>confdisplay</servlet-name>
 | 
			
		||||
    <url-pattern>/confdisp</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>postmessage</servlet-name>
 | 
			
		||||
    <url-pattern>/post</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>attachment</servlet-name>
 | 
			
		||||
    <url-pattern>/attachment</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>topicoperations</servlet-name>
 | 
			
		||||
    <url-pattern>/topicops</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>postoperations</servlet-name>
 | 
			
		||||
    <url-pattern>/postops</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>postshortcut</servlet-name>
 | 
			
		||||
    <url-pattern>/go/*</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>imageretrieve</servlet-name>
 | 
			
		||||
    <url-pattern>/imagedata/*</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>userphoto</servlet-name>
 | 
			
		||||
    <url-pattern>/userphoto</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>stylesheet</servlet-name>
 | 
			
		||||
    <servlet-name>StyleSheet</servlet-name>
 | 
			
		||||
    <url-pattern>/stylesheet</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>passrecovery</servlet-name>
 | 
			
		||||
    <servlet-name>Frame</servlet-name>
 | 
			
		||||
    <url-pattern>/frame/*</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>GetImage</servlet-name>
 | 
			
		||||
    <url-pattern>/imagedata/*</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>User</servlet-name>
 | 
			
		||||
    <url-pattern>/user/*</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>CommunityDispatch</servlet-name>
 | 
			
		||||
    <url-pattern>/community/*</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>CommunityDispatch</servlet-name>
 | 
			
		||||
    <url-pattern>/sig/*</url-pattern>  <!-- the backwards-compatible mapping -->
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>PostShortcut</servlet-name>
 | 
			
		||||
    <url-pattern>/go/*</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>PasswordRecovery</servlet-name>
 | 
			
		||||
    <url-pattern>/passrecovery/*</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>communitylogo</servlet-name>
 | 
			
		||||
    <url-pattern>/commlogo</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>gateway</servlet-name>
 | 
			
		||||
    <url-pattern>/gw</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>memberredirect</servlet-name>
 | 
			
		||||
    <url-pattern>/members</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>adminuserphoto</servlet-name>
 | 
			
		||||
    <url-pattern>/adminuserphoto</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>findpost</servlet-name>
 | 
			
		||||
    <url-pattern>/findpost</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <!-- the following are test servlets, they should go away -->
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>testformdata</servlet-name>
 | 
			
		||||
    <url-pattern>/testformdata</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>dumpall</servlet-name>
 | 
			
		||||
    <url-pattern>/dumpall</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>dumpall</servlet-name>
 | 
			
		||||
    <url-pattern>/dump/*</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <!-- The list of "welcome files" for the application -->
 | 
			
		||||
  <welcome-file-list>
 | 
			
		||||
    <welcome-file>default.jsp</welcome-file>
 | 
			
		||||
    <welcome-file>index.html</welcome-file>
 | 
			
		||||
  </welcome-file-list>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>Gateway</servlet-name>
 | 
			
		||||
    <url-pattern>/gw</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <servlet-mapping>
 | 
			
		||||
    <servlet-name>Remapper</servlet-name>
 | 
			
		||||
    <url-pattern>/verifyemail</url-pattern>
 | 
			
		||||
  </servlet-mapping>
 | 
			
		||||
 | 
			
		||||
  <!-- Global parameters for the HTTP session -->
 | 
			
		||||
  <session-config>
 | 
			
		||||
    <session-timeout>60</session-timeout>    <!-- 1 hour -->
 | 
			
		||||
  </session-config>
 | 
			
		||||
 | 
			
		||||
  <!-- Tag library URL definitions. -->
 | 
			
		||||
  <taglib>
 | 
			
		||||
    <taglib-uri>/tlds/util</taglib-uri>
 | 
			
		||||
    <taglib-location>/WEB-INF/tlds/utils-taglib.tld</taglib-location>
 | 
			
		||||
  </taglib>
 | 
			
		||||
 | 
			
		||||
  <taglib>
 | 
			
		||||
    <taglib-uri>/tlds/frame</taglib-uri>
 | 
			
		||||
    <taglib-location>/WEB-INF/tlds/frame-taglib.tld</taglib-location>
 | 
			
		||||
  </taglib>
 | 
			
		||||
 | 
			
		||||
  <taglib>
 | 
			
		||||
    <taglib-uri>/tlds/user</taglib-uri>
 | 
			
		||||
    <taglib-location>/WEB-INF/tlds/user-taglib.tld</taglib-location>
 | 
			
		||||
  </taglib>
 | 
			
		||||
 | 
			
		||||
  <taglib>
 | 
			
		||||
    <taglib-uri>/tlds/community</taglib-uri>
 | 
			
		||||
    <taglib-location>/WEB-INF/tlds/community-taglib.tld</taglib-location>
 | 
			
		||||
  </taglib>
 | 
			
		||||
 | 
			
		||||
  <taglib>
 | 
			
		||||
    <taglib-uri>/tlds/conference</taglib-uri>
 | 
			
		||||
    <taglib-location>/WEB-INF/tlds/conference-taglib.tld</taglib-location>
 | 
			
		||||
  </taglib>
 | 
			
		||||
 | 
			
		||||
  <taglib>
 | 
			
		||||
    <taglib-uri>/tlds/topic</taglib-uri>
 | 
			
		||||
    <taglib-location>/WEB-INF/tlds/topic-taglib.tld</taglib-location>
 | 
			
		||||
  </taglib>
 | 
			
		||||
 | 
			
		||||
  <taglib>
 | 
			
		||||
    <taglib-uri>/tlds/post</taglib-uri>
 | 
			
		||||
    <taglib-location>/WEB-INF/tlds/post-taglib.tld</taglib-location>
 | 
			
		||||
  </taglib>
 | 
			
		||||
 | 
			
		||||
</web-app>
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										5
									
								
								lib/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								lib/.gitignore
									
									
									
									
										vendored
									
									
								
							@ -1,2 +1,7 @@
 | 
			
		||||
bsf.jar
 | 
			
		||||
jacl.jar
 | 
			
		||||
js.jar
 | 
			
		||||
log4j.jar
 | 
			
		||||
mysql.jar
 | 
			
		||||
mm.mysql*.jar
 | 
			
		||||
tcljava.jar
 | 
			
		||||
@ -7,6 +7,8 @@ compatible with the versions specified here.
 | 
			
		||||
Library                         Version  File Name(s)                      Install To
 | 
			
		||||
-------------------------------------------------------------------------------------------------
 | 
			
		||||
Apache LOG4J                    1.1.3    log4j.jar                         Venice "lib" subdirectory
 | 
			
		||||
Bean Scripting Framework        2.2      bsf.jar                           Venice "lib" subdirectory
 | 
			
		||||
Jacl (Tcl interpreter)          1.3(CVS) jacl.jar, tcljava.jar             Venice "lib" subdirectory
 | 
			
		||||
Java Activation Framework       1.0.1    activation.jar                    JRE "ext" subdirectory
 | 
			
		||||
Java Advanced Imaging API       1.1.1    jai_core.jar, jai_codec.jar,      JRE "ext" subdirectory
 | 
			
		||||
                                         mlibwrapper_jai.jar
 | 
			
		||||
@ -15,6 +17,7 @@ JavaMail                        1.2      imap.jar, mailapi.jar, mail.jar,  JRE "
 | 
			
		||||
                                         pop3.jar, smtp.jar
 | 
			
		||||
Java Secure Socket Extensions   1.0.2    jcert.jar, jnet.jar, jsse.jar     JRE "ext" subdirectory
 | 
			
		||||
MySQL JDBC Driver               2.0.2    mysql.jar                         Venice "lib" subdirectory
 | 
			
		||||
Rhino (JavaScript interpreter)  1.5R2    js.jar                            Venice "lib" subdirectory
 | 
			
		||||
 | 
			
		||||
NOTES
 | 
			
		||||
=====
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										46
									
								
								scripts/comm/admin_menu.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								scripts/comm/admin_menu.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,46 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
if (!(comm.canAdministerCommunity()))
 | 
			
		||||
{ // no access - sorry buddy
 | 
			
		||||
  logger.error("tried to call up community admin menu without access...naughty naughty!");
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You do not have access to administer this community.",
 | 
			
		||||
                           "community/" + comm.alias));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// build the community admin menu
 | 
			
		||||
vars = new HashMap();
 | 
			
		||||
vars.put("cid",comm.communityID + "");
 | 
			
		||||
vars.put("name",comm.name);
 | 
			
		||||
menu = rinput.getMenu("community.admin",vars);
 | 
			
		||||
 | 
			
		||||
// build a view around it and return it
 | 
			
		||||
rc = new MenuView(menu);
 | 
			
		||||
rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										59
									
								
								scripts/comm/audit.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								scripts/comm/audit.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,59 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // read off the offset parameter
 | 
			
		||||
  offset = rinput.getParameterInt("ofs",0);
 | 
			
		||||
  
 | 
			
		||||
  // generate the audit lists
 | 
			
		||||
  audit_list = comm.getAuditRecords(offset,rinput.engine.getNumAuditRecordsPerPage());
 | 
			
		||||
  audit_count = comm.getAuditRecordCount();
 | 
			
		||||
 | 
			
		||||
  // output the audit data view
 | 
			
		||||
  rc = new AuditView(rinput.engine,audit_list,offset,audit_count,
 | 
			
		||||
                     "Audit Records for Community \"" + comm.name + "\"",
 | 
			
		||||
		     "comm/audit.js.vs?cc=" + comm.communityID + "&ofs=${offset}",
 | 
			
		||||
                     "comm/admin_menu.js.vs?cc=" + comm.communityID,
 | 
			
		||||
                     "Return to Community Administration Menu");
 | 
			
		||||
  rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // display an error
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error getting audit records: " + e.message,
 | 
			
		||||
                      "comm/admin_menu.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,"comm/admin_menu.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										114
									
								
								scripts/comm/category.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										114
									
								
								scripts/comm/category.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,114 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
if (!(comm.canModifyProfile()))
 | 
			
		||||
{ // no access - sorry, dude
 | 
			
		||||
  logger.error("tried to call up community profile screen without access...naughty naughty!");
 | 
			
		||||
  vlib.output(new ErrorBox("Unauthorized","You do not have access to modify this community's profile.",
 | 
			
		||||
			   "comm/admin_menu.js.vs?cc=" + comm.communityID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if (rinput.hasParameter("set"))
 | 
			
		||||
{ // OK...they're actually setting the category here - change it and bail out
 | 
			
		||||
  catid = rinput.getParameterInt("set",-1);
 | 
			
		||||
  if (engine.isValidCategoryID(catid))
 | 
			
		||||
  { // try setting the category ID
 | 
			
		||||
    try
 | 
			
		||||
    { // set the category ID and bounce back to the menu
 | 
			
		||||
      comm.categoryID = catid;
 | 
			
		||||
      rc = new Redirect("comm/admin_menu.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
    } // end try
 | 
			
		||||
    catch (e)
 | 
			
		||||
    { // exception setting category
 | 
			
		||||
      etype = vlib.exceptionType(e) + "";
 | 
			
		||||
      if (etype.match("DataException"))
 | 
			
		||||
        rc = new ErrorBox("Database Error","Database error updating community: " + e.message,
 | 
			
		||||
			  "comm/admin_menu.js.vs?cc=" + comm.communityID);
 | 
			
		||||
      else if (etype.match("AccessError"))
 | 
			
		||||
        rc = new ErrorBox("Access Error",e.message,"comm/admin_menu.js.vs?cc=" + comm.communityID);
 | 
			
		||||
      else
 | 
			
		||||
        rc = e;
 | 
			
		||||
 | 
			
		||||
    } // end catch
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
  else  // invalid category ID
 | 
			
		||||
    rc = new ErrorBox("Invalid Input","Invalid category ID passed to category browser.",
 | 
			
		||||
                      "comm/admin_menu.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
  vlib.output(rc);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// we must be browsing - try and figure out what category we're supposed to be browsing
 | 
			
		||||
curr_catid = 0;
 | 
			
		||||
if (rinput.hasParameter("go"))
 | 
			
		||||
  curr_catid = rinput.getParameterInt("go",-1);
 | 
			
		||||
else
 | 
			
		||||
  curr_catid = comm.categoryID;
 | 
			
		||||
if (!(engine.isValidCategoryID(curr_catid)))
 | 
			
		||||
{ // this is not a valid category ID
 | 
			
		||||
  vlib.output(new ErrorBox("Invalid Input","Invalid category ID passed to category browser.",
 | 
			
		||||
                           "comm/admin_menu.js.vs?cc=" + comm.communityID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
try
 | 
			
		||||
{ // get the categories
 | 
			
		||||
  prev_cat = comm.category;
 | 
			
		||||
  rinput.setRequestAttribute("category.previous",prev_cat);
 | 
			
		||||
  curr_cat = null;
 | 
			
		||||
  if (prev_cat.categoryID!=curr_catid)
 | 
			
		||||
    curr_cat = rinput.user.getCategoryDescriptor(curr_catid);
 | 
			
		||||
  else
 | 
			
		||||
    curr_cat = prev_cat;
 | 
			
		||||
  rinput.setRequestAttribute("category.current",curr_cat);
 | 
			
		||||
  rinput.setRequestAttribute("category.subcats",curr_cat.getSubCategories());
 | 
			
		||||
 | 
			
		||||
  // create a view and return it
 | 
			
		||||
  rc = new JSPView("Set Community Category","comm/category.jsp");
 | 
			
		||||
  rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // caught an exception here...
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error browsing categories: " + e.message,
 | 
			
		||||
                      "comm/admin_menu.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										124
									
								
								scripts/comm/create.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										124
									
								
								scripts/comm/create.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,124 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.dlg);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
 | 
			
		||||
if (!(rinput.user.canCreateCommunity()))
 | 
			
		||||
{ // can't create communities - bye!
 | 
			
		||||
  if (rinput.user.isLoggedIn())
 | 
			
		||||
    vlib.output(new ErrorBox("Community Error","You are not permitted to create communities.","top.js.vs"));
 | 
			
		||||
  else
 | 
			
		||||
    vlib.output(new LogInOrCreate());
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
dlg = rinput.getDialog("create.community");
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // just output the dialog
 | 
			
		||||
  dlg.setValue("language","en-US");
 | 
			
		||||
  dlg.setValue("country","US");
 | 
			
		||||
  vlib.output(dlg);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// everything following is for a POST
 | 
			
		||||
op = dlg.whichButton(rinput) + "";
 | 
			
		||||
if (op=="cancel")
 | 
			
		||||
{ // user cancelled - bail out
 | 
			
		||||
  vlib.output(new Redirect("top.js.vs",LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if (op=="create")
 | 
			
		||||
{ // actually creating a community
 | 
			
		||||
  dlg.load(rinput);  // load the dialog values
 | 
			
		||||
 | 
			
		||||
  try
 | 
			
		||||
  { // start by validating the dialog
 | 
			
		||||
    dlg.validate();
 | 
			
		||||
 | 
			
		||||
    // validate some extra stuff
 | 
			
		||||
    my_alias = dlg.getValue("alias");
 | 
			
		||||
    if (rinput.engine.aliasExists(my_alias,-1))
 | 
			
		||||
      throw new ValidationException("That alias is already used by another community on the system.");
 | 
			
		||||
    my_comtype = dlg.getValue("comtype") + "";
 | 
			
		||||
    my_joinkey = null;
 | 
			
		||||
    if (my_comtype=="1")
 | 
			
		||||
    { // get the join key for this private community
 | 
			
		||||
      my_joinkey = dlg.getValue("joinkey");
 | 
			
		||||
      if (vlib.emptyString(my_joinkey))
 | 
			
		||||
        throw new ValidationException("Private communities must specify a join key value.");
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
 | 
			
		||||
    my_hidemode = parseInt(dlg.getValue("hidemode"),10);  // get the hide mode
 | 
			
		||||
 | 
			
		||||
    // Create the new community context.
 | 
			
		||||
    new_comm = rinput.user.createCommunity(dlg.getValue("name"),my_alias,dlg.getValue("language"),
 | 
			
		||||
                                           dlg.getValue("synopsis"),dlg.getValue("rules"),my_joinkey,
 | 
			
		||||
                                           my_hidemode);
 | 
			
		||||
 | 
			
		||||
    // Get the new community's contact record and fill in the pieces of info we know.
 | 
			
		||||
    ci = new_comm.getContactInfo();
 | 
			
		||||
    ci.locality = dlg.getValue("loc");
 | 
			
		||||
    ci.region = dlg.getValue("reg");
 | 
			
		||||
    ci.postalCode = dlg.getValue("pcode");
 | 
			
		||||
    ci.country = dlg.getValue("country");
 | 
			
		||||
    new_comm.putContactInfo(ci);
 | 
			
		||||
    
 | 
			
		||||
    // create the return view
 | 
			
		||||
    rinput.setRequestAttribute("new.community",new_comm);
 | 
			
		||||
    rc = new JSPView("New Community Created","comm/new.jsp");
 | 
			
		||||
    rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // exception creating the community
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("ValidationException") || etype.match("AccessError"))
 | 
			
		||||
    { // reset the dialog and let them try again
 | 
			
		||||
      dlg.setErrorMessage(e.message + " Please try again.");
 | 
			
		||||
      rc = dlg;
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error creating community: " + e.message,"top.js.vs");
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else
 | 
			
		||||
{ // don't know what button was pressed
 | 
			
		||||
  logger.error("no known button click on POST to comm/create.js.vs");
 | 
			
		||||
  rc = new ErrorBox("Internal Error","Unknown command button pressed","top.js.vs");
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										74
									
								
								scripts/comm/delete.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								scripts/comm/delete.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,74 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
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 (!(comm.canDelete()))
 | 
			
		||||
{ // we can't delete the community, so what are we doing here?
 | 
			
		||||
  logger.error("you can't delete the community - not gonna do it, wouldn't be prudent");
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You do not have permission to delete this community.",
 | 
			
		||||
                           "comm/admin_menu.js.vs?cc=" + comm.communityID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
CONFIRM_attr = "community.delete.confirm";
 | 
			
		||||
CONFIRM_param = "confirm";
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
 | 
			
		||||
if (ConfirmBox.isConfirmed(rinput,CONFIRM_attr,CONFIRM_param))
 | 
			
		||||
{ // we are confirmed - delete the community!
 | 
			
		||||
  try
 | 
			
		||||
  { // delete the community
 | 
			
		||||
    comm.deleteCommunity();
 | 
			
		||||
 | 
			
		||||
    // the community is now GONE - go back to the top
 | 
			
		||||
    rc = new Redirect("top.js.vs",LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // caught an exception while unjoining
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,"comm/admin_menu.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error deleting community: " + e.message,
 | 
			
		||||
			"comm/admin_menu.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else
 | 
			
		||||
{ // need to get confirmation
 | 
			
		||||
  message = "You are about to permanently delete the \"" + comm.name + "\" community, including all "
 | 
			
		||||
	  + "conferences and other resources it contains! Are you sure you want to do this?";
 | 
			
		||||
  rc = new ConfirmBox(rinput,CONFIRM_attr,CONFIRM_param,"Delete Community",message,
 | 
			
		||||
                      "comm/delete.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET,
 | 
			
		||||
                      "comm/admin_menu.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										86
									
								
								scripts/comm/email.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								scripts/comm/email.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,86 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
if (!(comm.canMassMail()))
 | 
			
		||||
{ // we can't send mass mail to the community, so what are we doing here?
 | 
			
		||||
  logger.error("you can't mass-mail the community - not gonna do it, wouldn't be prudent");
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You do not have permission to sent mass mail to this community.",
 | 
			
		||||
			   "comm/admin_menu.js.vs?cc=" + comm.communityID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // display the view
 | 
			
		||||
  view = new JSPView("Community E-Mail: " + comm.name,"comm/email.jsp");
 | 
			
		||||
  view.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
  vlib.output(view);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (rinput.isImageButtonClicked("cancel"))
 | 
			
		||||
{ // user cancelled - go back to the menu
 | 
			
		||||
  vlib.output(new Redirect("comm/admin_menu.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if (rinput.isImageButtonClicked("send"))
 | 
			
		||||
{ // actually send the E-mail!
 | 
			
		||||
  try
 | 
			
		||||
  { // do it!
 | 
			
		||||
    comm.massMail(rinput.getParameter("subj"),rinput.getParameter("pb"));
 | 
			
		||||
 | 
			
		||||
    // now bounce back to the menu
 | 
			
		||||
    rc = new Redirect("comm/admin_menu.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // exception caught in the mass mailing
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error getting mailing list: " + e.message,
 | 
			
		||||
			"comm/admin_menu.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,"comm/admin_menu.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
else
 | 
			
		||||
{ // what the hell was that button
 | 
			
		||||
  logger.error("no known button click on POST to comm/email.js");
 | 
			
		||||
  rc = new ErrorBox("Internal Error","Unknown command button pressed",
 | 
			
		||||
                    "comm/admin_menu.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										93
									
								
								scripts/comm/invite.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										93
									
								
								scripts/comm/invite.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,93 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
if (!(comm.canSendInvitation()))
 | 
			
		||||
{ // you can't send an invitation
 | 
			
		||||
  vlib.output(new ErrorBox("Community Error","You are not permitted to send an invitation.",
 | 
			
		||||
                           "community/" + comm.alias));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
locator = "cc=" + comm.communityID;
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // set up the invitation screen parameters
 | 
			
		||||
  rinput.setRequestAttribute("invitation.title","Send Community Invitation:");
 | 
			
		||||
  rinput.setRequestAttribute("invitation.subtitle",comm.name);
 | 
			
		||||
  rinput.setRequestAttribute("invitation.action",rinput.formatURL("comm/invite.js.vs",LinkTypes.SERVLET));
 | 
			
		||||
  rinput.setRequestAttribute("invitation.params",
 | 
			
		||||
                             "<INPUT TYPE=\"HIDDEN\" NAME=\"cc\" VALUE=\"" + comm.communityID + "\">");
 | 
			
		||||
 | 
			
		||||
  // create the invitation and display it
 | 
			
		||||
  view = new JSPView("Send Invitation","comm/invite.jsp");
 | 
			
		||||
  view.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
  view.pageQID = "comm/invite.js.vs?" + locator;
 | 
			
		||||
  vlib.output(view);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (rinput.isImageButtonClicked("cancel"))
 | 
			
		||||
{ // bounce back to the base page
 | 
			
		||||
  vlib.output(new Redirect("comm/show.js.vs?" + locator,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if (rinput.isImageButtonClicked("send"))
 | 
			
		||||
{ // do the actual send!
 | 
			
		||||
  try
 | 
			
		||||
  { // send out the invitation and then redirect back
 | 
			
		||||
    comm.sendInvitation(rinput.getParameter("addr"),rinput.getParameter("pb"));
 | 
			
		||||
    rc = new Redirect("comm/show.js.vs?" + locator,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // exception sending the invitation
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,"comm/show.js.vs?" + locator);
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error sending invitation: " + e.message,
 | 
			
		||||
                        "comm/show.js.vs?" + locator);
 | 
			
		||||
    else if (etype.match("EmailException"))
 | 
			
		||||
      rc = new ErrorBox("E-Mail Error","Error sending E-mail: " + e.message,"comm/show.js.vs?" + locator);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else
 | 
			
		||||
{ // no known button pressed
 | 
			
		||||
  logger.error("no known button click on POST to comm/invite.js");
 | 
			
		||||
  rc = new ErrorBox("Internal Error","Unknown command button pressed","comm/show.js.vs?" + locator);
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										70
									
								
								scripts/comm/join.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										70
									
								
								scripts/comm/join.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,70 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.dlg);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
if (!(comm.canJoin()))
 | 
			
		||||
{ // you can't join the community
 | 
			
		||||
  vlib.output(new ErrorBox("Community Error","You are not permitted to join this community.","top.js.vs"));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (comm.isPublicCommunity())
 | 
			
		||||
{ // the community is public - attempt to join right away
 | 
			
		||||
  rc = null;
 | 
			
		||||
  try
 | 
			
		||||
  { // join the community!
 | 
			
		||||
    comm.join(null);
 | 
			
		||||
 | 
			
		||||
    // force the menus to be redrawn
 | 
			
		||||
    rinput.setSessionAttribute(RequestInput.LEFT_MENU_SESSION_ATTR,null);
 | 
			
		||||
 | 
			
		||||
    // create a return view
 | 
			
		||||
    rc = new JSPView("Welcome to " + comm.name,"comm/welcome.jsp");
 | 
			
		||||
    rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // exception when we tried to join the community
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error","Unable to join community: " + e.message,"top.js.vs");
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error joining community: " + e.message,"top.js.vs");
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
  vlib.output(rc);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// Get the "join key" dialog.
 | 
			
		||||
dlg = rinput.getDialog("join");
 | 
			
		||||
dlg.setValue("cc",comm.communityID + "");
 | 
			
		||||
vlib.output(dlg);
 | 
			
		||||
							
								
								
									
										98
									
								
								scripts/comm/join_key.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										98
									
								
								scripts/comm/join_key.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,98 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.dlg);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
if (!(comm.canJoin()))
 | 
			
		||||
{ // you can't join the community
 | 
			
		||||
  vlib.output(new ErrorBox("Community Error","You are not permitted to join this community.","top.js.vs"));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (comm.isPublicCommunity())
 | 
			
		||||
{ // we shouldn't have gotten here!
 | 
			
		||||
  vlib.output(new ErrorBox("Internal Error","This community should already have been joined.",
 | 
			
		||||
                           "comm/show.js.vs?cc=" + comm.communityID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// Get the "join key" dialog.
 | 
			
		||||
dlg = rinput.getDialog("join");
 | 
			
		||||
op = dlg.whichButton(rinput) + "";
 | 
			
		||||
 | 
			
		||||
if (op=="cancel")
 | 
			
		||||
{ // cancel the join and bounce back to the profile
 | 
			
		||||
  vlib.output(new Redirect("comm/show.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if (op=="join_now")
 | 
			
		||||
{ // go ahead and join up, if we can
 | 
			
		||||
  dlg.load(rinput);
 | 
			
		||||
 | 
			
		||||
  try
 | 
			
		||||
  { // get the join key
 | 
			
		||||
    key = dlg.getValue("key");
 | 
			
		||||
    if (vlib.emptyString("key"))
 | 
			
		||||
      throw new ValidationException("No join key specified.");
 | 
			
		||||
 | 
			
		||||
    comm.join(key);  // join the community!
 | 
			
		||||
 | 
			
		||||
    // force the menus to be redrawn
 | 
			
		||||
    rinput.setSessionAttribute(RequestInput.LEFT_MENU_SESSION_ATTR,null);
 | 
			
		||||
 | 
			
		||||
    // create a return view
 | 
			
		||||
    rc = new JSPView("Welcome to " + comm.name,"comm/welcome.jsp");
 | 
			
		||||
    rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // exception when we tried to join the community
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("ValidationException") || etype.match("AccessError"))
 | 
			
		||||
    { // reset the dialog and try again
 | 
			
		||||
      dlg.setErrorMessage(e.message + " Please try again.");
 | 
			
		||||
      dlg.setValue("key",null);
 | 
			
		||||
      rc = dlg;
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error joining community: " + e.message,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else
 | 
			
		||||
{ // we don't know what button was clicked
 | 
			
		||||
  logger.error("no known button click on POST to comm.join_key.js");
 | 
			
		||||
  rc = new ErrorBox("Internal Error","Unknown command button pressed","top.js.vs");
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										133
									
								
								scripts/comm/members.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										133
									
								
								scripts/comm/members.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,133 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// create the view object
 | 
			
		||||
view = new MembersView(rinput.engine.getStdNumSearchResults(),comm.name);
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // set up the member list
 | 
			
		||||
  if ("GET"==rinput.verb)
 | 
			
		||||
  { // initial GET of the member list - just get the start of the list
 | 
			
		||||
    mbr_list = comm.getMemberList();
 | 
			
		||||
    view.simple = true;
 | 
			
		||||
    view.results = mbr_list;
 | 
			
		||||
    view.findCount = mbr_list.size();
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
  else
 | 
			
		||||
  { // this is a more complicated operation...
 | 
			
		||||
    if ("1"==rinput.getParameter("sl"))
 | 
			
		||||
    { // Set up some of the easy initial parameters.
 | 
			
		||||
      view.simple = true;
 | 
			
		||||
 | 
			
		||||
      // Retrieve the offset and find count.
 | 
			
		||||
      view.offset = rinput.getParameterInt("ofs",0);
 | 
			
		||||
      view.findCount = rinput.getParameterInt("fcount",-1);
 | 
			
		||||
 
 | 
			
		||||
      // Adjust the offset based on the button clicked.
 | 
			
		||||
      if (rinput.isImageButtonClicked("search"))
 | 
			
		||||
        throw new ValidationException("Invalid button clicked."); // can't happen
 | 
			
		||||
      else if (rinput.isImageButtonClicked("previous"))
 | 
			
		||||
        view.offset = Math.max(view.offset-view.maxResults,0);
 | 
			
		||||
      else if (rinput.isImageButtonClicked("next"))
 | 
			
		||||
        view.offset += view.maxResults;
 | 
			
		||||
      else
 | 
			
		||||
        throw new ValidationException("Unable to determine what action triggered the form.");
 | 
			
		||||
 | 
			
		||||
      // Get the list and subset it if necessary.
 | 
			
		||||
      mbr_list = comm.getMemberList();
 | 
			
		||||
      if (view.findCount<0)
 | 
			
		||||
        view.findCount = mbr_list.size();
 | 
			
		||||
      if (view.offset==0)
 | 
			
		||||
        view.results = mbr_list;
 | 
			
		||||
      else
 | 
			
		||||
        view.results = mbr_list.subList(offset,mbr_list.size());
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
    else
 | 
			
		||||
    { // This is a search operation...
 | 
			
		||||
      view.simple = false;
 | 
			
		||||
 | 
			
		||||
      // Get the search field parameter.
 | 
			
		||||
      x = rinput.getParameterInt("field",SearchMode.FIELD_USER_NAME);
 | 
			
		||||
      if (   (x!=SearchMode.FIELD_USER_NAME) && (x!=SearchMode.FIELD_USER_DESCRIPTION)
 | 
			
		||||
          && (x!=SearchMode.FIELD_USER_GIVEN_NAME) && (x!=SearchMode.FIELD_USER_FAMILY_NAME))
 | 
			
		||||
        throw new ValidationException("The search field parameter is not valid.");
 | 
			
		||||
      view.field = x;
 | 
			
		||||
 | 
			
		||||
      // Get the search mode parameter.
 | 
			
		||||
      x = rinput.getParameterInt("mode",SearchMode.SEARCH_PREFIX);
 | 
			
		||||
      if (   (x!=SearchMode.SEARCH_PREFIX) && (x!=SearchMode.SEARCH_SUBSTRING)
 | 
			
		||||
          && (x!=SearchMode.SEARCH_REGEXP))
 | 
			
		||||
        throw new ValidationException("The search mode parameter is not valid.");
 | 
			
		||||
      view.mode = x;
 | 
			
		||||
 | 
			
		||||
      // Get the search term parameter.
 | 
			
		||||
      view.term = rinput.getParameter("term");
 | 
			
		||||
      if (view.term==null)
 | 
			
		||||
        view.term = "";
 | 
			
		||||
 | 
			
		||||
      // Retrieve the offset and find count.
 | 
			
		||||
      view.offset = rinput.getParameterInt("ofs",0);
 | 
			
		||||
      view.findCount = rinput.getParameterInt("fcount",-1);
 | 
			
		||||
 
 | 
			
		||||
      // Adjust the offset based on the button clicked.
 | 
			
		||||
      if (rinput.isImageButtonClicked("search"))
 | 
			
		||||
        view.offset = 0;  // begin a new search
 | 
			
		||||
      else if (rinput.isImageButtonClicked("previous"))
 | 
			
		||||
        view.offset = Math.max(view.offset-view.maxResults,0);
 | 
			
		||||
      else if (rinput.isImageButtonClicked("next"))
 | 
			
		||||
        view.offset += view.maxResults;
 | 
			
		||||
      else
 | 
			
		||||
        throw new ValidationException("Unable to determine what action triggered the form.");
 | 
			
		||||
 | 
			
		||||
      // Perform the search!
 | 
			
		||||
      view.results = comm.searchForMembers(view.field,view.mode,view.term,view.offset,view.maxResults);
 | 
			
		||||
      if (view.findCount<0)
 | 
			
		||||
	view.findCount = comm.getSearchMemberCount(view.field,view.mode,view.term);
 | 
			
		||||
 | 
			
		||||
    } // end else (search operation)
 | 
			
		||||
 | 
			
		||||
  } // end else (POST)
 | 
			
		||||
 | 
			
		||||
  rc = view;
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // exception in the find operation
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("ValidationException"))
 | 
			
		||||
    rc = new ErrorBox("Find Error",e.message,"comm/members.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  else if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error getting member list: " + e.message,
 | 
			
		||||
                      "community/" + comm.alias);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										136
									
								
								scripts/comm/photo.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										136
									
								
								scripts/comm/photo.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,136 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importClass(java.awt.Dimension);
 | 
			
		||||
importPackage(Packages.com.silverwrist.util);
 | 
			
		||||
importPackage(Packages.com.silverwrist.util.image);
 | 
			
		||||
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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
if (!(comm.canModifyProfile()))
 | 
			
		||||
{ // no access - sorry, dude
 | 
			
		||||
  logger.error("tried to call up community profile screen without access...naughty naughty!");
 | 
			
		||||
  vlib.output(new ErrorBox("Unauthorized","You do not have access to modify this community's profile.",
 | 
			
		||||
			   "comm/admin_menu.js.vs?cc=" + comm.communityID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // create a PhotoUploader to do the photo uploading
 | 
			
		||||
  try
 | 
			
		||||
  { // create and initialize the PhotoUploader
 | 
			
		||||
    rc = new PhotoUploader("Upload Community Logo","comm/photo.js.vs",LinkTypes.SERVLET);
 | 
			
		||||
    rc.addHiddenParameter("cc",comm.communityID);
 | 
			
		||||
    rc.photoTag = rinput.getCommunityLogoTag(comm.getContactInfo().photoURL);
 | 
			
		||||
    rc.label = "New community logo";
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // an exception in the output...
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error generating display: " + e.message,
 | 
			
		||||
                        "comm/profile.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else if (etype.match("Access Error"))
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,"comm/profile.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
  vlib.output(rc);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// If the cancel button was clicked, bounce out of here.
 | 
			
		||||
if (rinput.isImageButtonClicked("cancel"))
 | 
			
		||||
{ // user elected to cancel upload - bounce us out of here
 | 
			
		||||
  vlib.output(new Redirect("comm/profile.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (rinput.isImageButtonClicked("upload"))
 | 
			
		||||
{ // do some shorts-checking in the parameters
 | 
			
		||||
  if (!(rinput.isFileParam("thepic")))
 | 
			
		||||
  { // bogus file parameter
 | 
			
		||||
    logger.error("Internal Error: 'thepic' should be a file param");
 | 
			
		||||
    vlib.output(new ErrorBox(null,"Internal Error: 'thepic' should be a file param",
 | 
			
		||||
			     "comm/profile.js.vs?cc=" + comm.communityID));
 | 
			
		||||
    vlib.done();
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  mimetype = rinput.getParameterType("thepic") + "";
 | 
			
		||||
  if (!(mimetype.match("image/")))
 | 
			
		||||
  { // not an image file type that got uploaded
 | 
			
		||||
    logger.error("Error: 'thepic' not an image type");
 | 
			
		||||
    vlib.output(new ErrorBox(null,"You did not upload an image file.  Try again.",
 | 
			
		||||
                             "comm/photo.js.vs?cc=" + comm.communityID));
 | 
			
		||||
    vlib.done();
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  try
 | 
			
		||||
  { // normalize the photo to 100x100 pixels
 | 
			
		||||
    real_pic = ImageNormalizer.normalizeImage(rinput.getParameterDataStream("thepic"),
 | 
			
		||||
                                              rinput.engine.getCommunityLogoSize(),"jpeg");
 | 
			
		||||
 | 
			
		||||
    // set the community logo data!
 | 
			
		||||
    ci = comm.getContactInfo();
 | 
			
		||||
    ci.setPhotoData(rinput.contextPath + "/imagedata/","image/jpeg",real_pic.length,real_pic.data);
 | 
			
		||||
    comm.putContactInfo(ci);
 | 
			
		||||
 | 
			
		||||
    // Jump back to the profile form.
 | 
			
		||||
    rinput.setSessionAttribute(RequestInput.LEFT_MENU_SESSION_ATTR,null);
 | 
			
		||||
    rc = new Redirect("comm/profile.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // exception while setting community logo
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("ServletMultipartException"))
 | 
			
		||||
      rc = new ErrorBox(null,"Internal Error: " + e.message,"comm/profile.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else if (etype.match("ImageNormalizerException"))
 | 
			
		||||
      rc = new ErrorBox(null,e.message,"comm/photo.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error storing community logo: " + e.message,
 | 
			
		||||
			"comm/profile.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else
 | 
			
		||||
{ // don't know the command button!
 | 
			
		||||
  logger.error("no known button click on POST to comm/photo.js");
 | 
			
		||||
  rc = new ErrorBox("Internal Error","Unknown command button pressed",
 | 
			
		||||
                    "comm/profile.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);   // all done!
 | 
			
		||||
							
								
								
									
										237
									
								
								scripts/comm/profile.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										237
									
								
								scripts/comm/profile.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,237 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.dlg);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
 | 
			
		||||
// Define a simple function to set up the dialog stuff.
 | 
			
		||||
function setupDialog(dlg,comm)
 | 
			
		||||
{
 | 
			
		||||
  dlg.setSubtitle(comm.name);
 | 
			
		||||
  dlg.sendMessage("logo","setLinkURL","comm/photo.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  sinf = comm.securityInfo;
 | 
			
		||||
  dlg.sendMessage("read_lvl","setRoleList",sinf.getRoleList("Community.Read"));
 | 
			
		||||
  dlg.sendMessage("write_lvl","setRoleList",sinf.getRoleList("Community.Write"));
 | 
			
		||||
  dlg.sendMessage("create_lvl","setRoleList",sinf.getRoleList("Community.Create"));
 | 
			
		||||
  dlg.sendMessage("delete_lvl","setRoleList",sinf.getRoleList("Community.Delete"));
 | 
			
		||||
  dlg.sendMessage("join_lvl","setRoleList",sinf.getRoleList("Community.Join"));
 | 
			
		||||
 | 
			
		||||
  if (comm.isAdminCommunity())
 | 
			
		||||
  { // need to disable a bunch of crap if this is the admin community
 | 
			
		||||
    dlg.setEnabled("comtype",false);
 | 
			
		||||
    dlg.setEnabled("joinkey",false);
 | 
			
		||||
    dlg.setEnabled("membersonly",false);
 | 
			
		||||
    dlg.setEnabled("hidemode",false);
 | 
			
		||||
    dlg.setEnabled("read_lvl",false);
 | 
			
		||||
    dlg.setEnabled("write_lvl",false);
 | 
			
		||||
    dlg.setEnabled("create_lvl",false);
 | 
			
		||||
    dlg.setEnabled("delete_lvl",false);
 | 
			
		||||
    dlg.setEnabled("join_lvl",false);
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
} // end setupDialog
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
if (!(comm.canModifyProfile()))
 | 
			
		||||
{ // no access - sorry, dude
 | 
			
		||||
  logger.error("tried to call up community profile screen without access...naughty naughty!");
 | 
			
		||||
  vlib.output(new ErrorBox("Unauthorized","You do not have access to modify this community's profile.",
 | 
			
		||||
			   "comm/admin_menu.js.vs?cc=" + comm.communityID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
dlg = rinput.getDialog("community.profile");
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // set up the dialog and return
 | 
			
		||||
  setupDialog(dlg,comm);
 | 
			
		||||
  dlg.setValue("cc",comm.communityID + "");
 | 
			
		||||
 | 
			
		||||
  try
 | 
			
		||||
  { // load the parameters of the dialog
 | 
			
		||||
    ci = comm.getContactInfo();
 | 
			
		||||
    props = comm.properties;
 | 
			
		||||
    dlg.setValue("name",comm.name);
 | 
			
		||||
    dlg.setValue("alias",comm.alias);
 | 
			
		||||
    dlg.setValue("synopsis",comm.synopsis);
 | 
			
		||||
    dlg.setValue("rules",comm.rules);
 | 
			
		||||
    dlg.setValue("language",comm.getLanguageCode());
 | 
			
		||||
    dlg.setValue("url",ci.URL);
 | 
			
		||||
    dlg.setValue("logo",ci.photoURL);
 | 
			
		||||
    dlg.setValue("company",ci.company);
 | 
			
		||||
    dlg.setValue("addr1",ci.addressLine1);
 | 
			
		||||
    dlg.setValue("addr2",ci.addressLine2);
 | 
			
		||||
    dlg.setValue("loc",ci.locality);
 | 
			
		||||
    dlg.setValue("reg",ci.region);
 | 
			
		||||
    dlg.setValue("pcode",ci.postalCode);
 | 
			
		||||
    dlg.setValue("country",ci.country);
 | 
			
		||||
    if (comm.isPublicCommunity())
 | 
			
		||||
    { // public community - has no join key
 | 
			
		||||
      dlg.setValue("comtype","0");
 | 
			
		||||
      dlg.setValue("joinkey","");
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
    else
 | 
			
		||||
    { // private community - display the join key
 | 
			
		||||
      dlg.setValue("comtype","1");
 | 
			
		||||
      dlg.setValue("joinkey",comm.joinKey);
 | 
			
		||||
 | 
			
		||||
    } // end else
 | 
			
		||||
 | 
			
		||||
    if (comm.membersOnly)
 | 
			
		||||
      dlg.setValue("membersonly",1);
 | 
			
		||||
    dlg.setValue("hidemode",comm.hideMode);
 | 
			
		||||
    dlg.setValue("read_lvl",comm.readLevel);
 | 
			
		||||
    dlg.setValue("write_lvl",comm.writeLevel);
 | 
			
		||||
    dlg.setValue("create_lvl",comm.createLevel);
 | 
			
		||||
    dlg.setValue("delete_lvl",comm.deleteLevel);
 | 
			
		||||
    dlg.setValue("join_lvl",comm.joinLevel);
 | 
			
		||||
    if (props.displayPostPictures)
 | 
			
		||||
      dlg.setValue("pic_in_post",1);
 | 
			
		||||
 | 
			
		||||
    rc = dlg;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // exception in dialog initialization
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error retrieving profile: " + e.message,
 | 
			
		||||
                        "comm/admin_menu.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Unauthorized","You do not have access to modify this community's profile.",
 | 
			
		||||
			"comm/admin_menu.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
  vlib.output(rc);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// everything that follows is for a POST operation
 | 
			
		||||
op = dlg.whichButton(rinput) + "";
 | 
			
		||||
if (op=="cancel")
 | 
			
		||||
{ // user cancelled profile update - bounce back to the target
 | 
			
		||||
  vlib.output(new Redirect("comm/admin_menu.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (op=="update")
 | 
			
		||||
{ // OK, we can update the dialog!
 | 
			
		||||
  dlg.load(rinput);        // load the dialog parameters
 | 
			
		||||
 | 
			
		||||
  try
 | 
			
		||||
  { // start by validating the dialog
 | 
			
		||||
    dlg.validate();
 | 
			
		||||
 | 
			
		||||
    // validate some other stuff we didn't pick up in the fixed validation
 | 
			
		||||
    if (rinput.engine.aliasExists(dlg.getValue("alias"),comm.communityID))
 | 
			
		||||
      throw new ValidationException("That alias is already used by another community on the system.");
 | 
			
		||||
 | 
			
		||||
    if ("1"==dlg.getValue("comtype"))
 | 
			
		||||
    { // make sure if they flagged it as Private that they specified a join key
 | 
			
		||||
      if (vlib.emptyString(dlg.getValue("joinkey")))
 | 
			
		||||
	throw new ValidationException("Private communities must specify a join key value.");
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
 | 
			
		||||
    // save off the ContactInfo-related fields first
 | 
			
		||||
    ci = comm.getContactInfo();
 | 
			
		||||
    ci.URL = dlg.getValue("url");
 | 
			
		||||
    ci.company = dlg.getValue("company");
 | 
			
		||||
    ci.addressLine1 = dlg.getValue("addr1");
 | 
			
		||||
    ci.addressLine2 = dlg.getValue("addr2");
 | 
			
		||||
    ci.locality = dlg.getValue("loc");
 | 
			
		||||
    ci.region = dlg.getValue("reg");
 | 
			
		||||
    ci.postalCode = dlg.getValue("pcode");
 | 
			
		||||
    ci.country = dlg.getValue("country");
 | 
			
		||||
    comm.putContactInfo(ci);
 | 
			
		||||
 | 
			
		||||
    // now save off the property-related fields
 | 
			
		||||
    props = comm.properties;
 | 
			
		||||
    props.displayPostPictures = dlg.getValue("pic_in_post").booleanValue();
 | 
			
		||||
    comm.properties = props;
 | 
			
		||||
 | 
			
		||||
    // now save the big text fields
 | 
			
		||||
    comm.name = dlg.getValue("name");
 | 
			
		||||
    comm.alias = dlg.getValue("alias");
 | 
			
		||||
    comm.synopsis = dlg.getValue("synopsis");
 | 
			
		||||
    comm.rules = dlg.getValue("rules");
 | 
			
		||||
    comm.setLanguage(dlg.getValue("language"));
 | 
			
		||||
 | 
			
		||||
    if (!(comm.isAdminCommunity()))
 | 
			
		||||
    { // save off the security information
 | 
			
		||||
      if ("1"==dlg.getValue("comtype"))
 | 
			
		||||
        comm.joinKey = dlg.getValue("joinkey");
 | 
			
		||||
      else
 | 
			
		||||
        comm.joinKey = null;
 | 
			
		||||
 | 
			
		||||
      comm.membersOnly = dlg.getValue("membersonly").booleanValue();
 | 
			
		||||
      comm.setHideMode(parseInt(dlg.getValue("hidemode"),10));
 | 
			
		||||
      comm.setSecurityLevels(parseInt(dlg.getValue("read_lvl"),10),parseInt(dlg.getValue("write_lvl"),10),
 | 
			
		||||
                             parseInt(dlg.getValue("create_lvl"),10),parseInt(dlg.getValue("delete_lvl"),10),
 | 
			
		||||
                             parseInt(dlg.getValue("join_lvl"),10));
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
 | 
			
		||||
    // bounce back to the admin menu
 | 
			
		||||
    rinput.setSessionAttribute(RequestInput.LEFT_MENU_SESSION_ATTR,null);
 | 
			
		||||
    rc = new Redirect("comm/admin_menu.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // exception setting the profile
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("ValidationException"))
 | 
			
		||||
    { // validation error - redisplay the dialog
 | 
			
		||||
      dlg.setErrorMessage(e.message + " Please try again.");
 | 
			
		||||
      setupDialog(dlg,comm);
 | 
			
		||||
      rc = dlg;
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error updating community: " + e.message,
 | 
			
		||||
			"comm/admin_menu.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,"comm/admin_menu.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
else
 | 
			
		||||
{ // what the hell was that button?
 | 
			
		||||
  logger.error("no known button click on POST to comm/profile.js");
 | 
			
		||||
  rc = new ErrorBox("Internal Error","Unknown command button pressed",
 | 
			
		||||
                    "comm/admin_menu.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										46
									
								
								scripts/comm/sb_list.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								scripts/comm/sb_list.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,46 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get and save the member communities list
 | 
			
		||||
  rinput.setRequestAttribute("communities.list",rinput.user.getMemberCommunities());
 | 
			
		||||
 | 
			
		||||
  rc = new JSPView("Your Communities","comm/sb_list.jsp");
 | 
			
		||||
  rc.menuSelector = Content.MENU_SELECTOR_TOP;
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // try to catch an exception
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Error getting communities list: " + e.message,"top.js.vs");
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										72
									
								
								scripts/comm/sb_unjoin.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										72
									
								
								scripts/comm/sb_unjoin.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,72 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
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,"comm/sb_list.js.vs");
 | 
			
		||||
 | 
			
		||||
if (!(comm.canUnjoin()))
 | 
			
		||||
{ // you can't unjoin the community
 | 
			
		||||
  vlib.output(new ErrorBox("Community Error","You are not permitted to unjoin this community.",
 | 
			
		||||
                           "comm/sb_list.js.vs"));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// the names of the confirmation attribute and parameter
 | 
			
		||||
CONFIRM_attr = "confirmbox.unjoin";
 | 
			
		||||
CONFIRM_param = "confirm";
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if (ConfirmBox.isConfirmed(rinput,CONFIRM_attr,CONFIRM_param))
 | 
			
		||||
{ // we are confirmed - unjoin us!
 | 
			
		||||
  try
 | 
			
		||||
  { // do the unjoin
 | 
			
		||||
    comm.unjoin();
 | 
			
		||||
 | 
			
		||||
    // force the menus to be redrawn
 | 
			
		||||
    rinput.setSessionAttribute(RequestInput.LEFT_MENU_SESSION_ATTR,null);
 | 
			
		||||
 | 
			
		||||
    // after which, return to the top
 | 
			
		||||
    rc = new Redirect("comm/sb_list.js.vs",LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // caught an exception while unjoining
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error","Unable to unjoin community: " + e.message,"comm/sb_list.js.vs");
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error unjoining community: " + e.message,
 | 
			
		||||
                        "comm/sb_list.js.vs");
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else // not yet confirmed - display the confirmation box
 | 
			
		||||
  rc = new ConfirmBox(rinput,CONFIRM_attr,CONFIRM_param,"Unjoining Community",
 | 
			
		||||
		      "Are you sure you want to unjoin the '" + comm.name + "' community?",
 | 
			
		||||
                      "comm/sb_unjoin.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET,
 | 
			
		||||
                      "comm/sb_list.js.vs",LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										219
									
								
								scripts/comm/set_member.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										219
									
								
								scripts/comm/set_member.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,219 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// Function which sets the correct community access level onto each entry of the input list.
 | 
			
		||||
function augmentList(comm,list)
 | 
			
		||||
{
 | 
			
		||||
  var rl = new ArrayList(list.size());
 | 
			
		||||
  var it = list.iterator();
 | 
			
		||||
  while (it.hasNext())
 | 
			
		||||
  { // get the community level and add it to the UserFound object
 | 
			
		||||
    var uf = vlib.castUserFound(it.next());
 | 
			
		||||
    var level = comm.getMemberLevel(uf.UID);
 | 
			
		||||
    rl.add(uf.createNewLevel(level));
 | 
			
		||||
 | 
			
		||||
  } // end while
 | 
			
		||||
 | 
			
		||||
  return rl;
 | 
			
		||||
 | 
			
		||||
} // end augmentList
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
if (!(comm.canModifyProfile()))
 | 
			
		||||
{ // no access - sorry, dude
 | 
			
		||||
  logger.error("tried to call up membership screen without access...naughty naughty!");
 | 
			
		||||
  vlib.output(new ErrorBox("Unauthorized","You do not have access to modify this community's membership.",
 | 
			
		||||
			   "comm/admin_menu.js.vs?cc=" + comm.communityID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// create the view object
 | 
			
		||||
view = new SetMemberView(rinput.engine.getStdNumSearchResults(),comm);
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // set up the initial state of the view
 | 
			
		||||
  try
 | 
			
		||||
  { // get the community membership list
 | 
			
		||||
    mbr_list = comm.getMemberList();
 | 
			
		||||
    view.simple = true;
 | 
			
		||||
    view.results = mbr_list;
 | 
			
		||||
    view.findCount = mbr_list.size();
 | 
			
		||||
    rc = view;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // we can get at least one exception here
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error retrieving membership list: " + e.message,
 | 
			
		||||
                        "comm/admin_menu.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
  vlib.output(rc);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (rinput.isImageButtonClicked("update"))
 | 
			
		||||
{ // do an update of privileges in this community
 | 
			
		||||
  list_uids = vlib.splitList(rinput.getParameter("listuids"),":");
 | 
			
		||||
  try
 | 
			
		||||
  { // loop through the defined UIDs and check the level...
 | 
			
		||||
    it = list_uids.iterator();
 | 
			
		||||
    while (it.hasNext())
 | 
			
		||||
    { // get the current and new levels, compare them, and reset if needed
 | 
			
		||||
      x = it.next();
 | 
			
		||||
      cur_level = rinput.getParameterInt("zxcur_" + x,-1);
 | 
			
		||||
      new_level = rinput.getParameterInt("zxnew_" + x,-1);
 | 
			
		||||
      if (cur_level!=new_level)
 | 
			
		||||
        comm.setMembership(parseInt(x,10),new_level);
 | 
			
		||||
 | 
			
		||||
    } // end while
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // the update might throw an error message
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error adjusting permissions: " + e.message,
 | 
			
		||||
                        "comm/set_member.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,"comm/set_member.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
    vlib.output(rc);  // bail out now with the error message
 | 
			
		||||
    vlib.done();
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// Carry on with the search operation now.
 | 
			
		||||
try
 | 
			
		||||
{ // handle the actual search
 | 
			
		||||
  if ("1"==rinput.getParameter("sl"))
 | 
			
		||||
  { // Set up some of the easy initial parameters.
 | 
			
		||||
    view.simple = true;
 | 
			
		||||
 | 
			
		||||
    // Retrieve the offset and find count.
 | 
			
		||||
    view.offset = rinput.getParameterInt("ofs",0);
 | 
			
		||||
    // view.findCount = rinput.getParameterInt("fcount",-1); (N.B.: will get reassigned below)
 | 
			
		||||
 
 | 
			
		||||
    // Adjust the offset based on the button clicked.
 | 
			
		||||
    if (rinput.isImageButtonClicked("search"))
 | 
			
		||||
      throw new ValidationException("Invalid button clicked."); // can't happen
 | 
			
		||||
    else if (rinput.isImageButtonClicked("previous"))
 | 
			
		||||
      view.offset = Math.max(view.offset-view.maxResults,0);
 | 
			
		||||
    else if (rinput.isImageButtonClicked("next"))
 | 
			
		||||
      view.offset += view.maxResults;
 | 
			
		||||
    else if (!(rinput.isImageButtonClicked("update")))
 | 
			
		||||
      throw new ValidationException("Unable to determine what action triggered the form.");
 | 
			
		||||
 | 
			
		||||
    // Get the list and subset it if necessary.
 | 
			
		||||
    // N.B.: Since the update function can reduce the size of the member list, we need to take into account
 | 
			
		||||
    // that the find count will need updating and the offset may be in the wrong place for the list now.
 | 
			
		||||
    mbr_list = comm.getMemberList();
 | 
			
		||||
    view.findCount = mbr_list.size();
 | 
			
		||||
    while ((view.offset>0) && (view.offset>=view.findCount))
 | 
			
		||||
      view.offset = Math.max(view.offset-view.maxResults,0);
 | 
			
		||||
    if (view.offset==0)
 | 
			
		||||
      view.results = mbr_list;
 | 
			
		||||
    else
 | 
			
		||||
      view.results = mbr_list.subList(offset,mbr_list.size());
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
  else
 | 
			
		||||
  { // This is a search operation...
 | 
			
		||||
    view.simple = false;
 | 
			
		||||
 | 
			
		||||
    // Get the search field parameter.
 | 
			
		||||
    x = rinput.getParameterInt("field",SearchMode.FIELD_USER_NAME);
 | 
			
		||||
    if (   (x!=SearchMode.FIELD_USER_NAME) && (x!=SearchMode.FIELD_USER_DESCRIPTION)
 | 
			
		||||
        && (x!=SearchMode.FIELD_USER_GIVEN_NAME) && (x!=SearchMode.FIELD_USER_FAMILY_NAME))
 | 
			
		||||
      throw new ValidationException("The search field parameter is not valid.");
 | 
			
		||||
    view.field = x;
 | 
			
		||||
 | 
			
		||||
    // Get the search mode parameter.
 | 
			
		||||
    x = rinput.getParameterInt("mode",SearchMode.SEARCH_PREFIX);
 | 
			
		||||
    if (   (x!=SearchMode.SEARCH_PREFIX) && (x!=SearchMode.SEARCH_SUBSTRING)
 | 
			
		||||
        && (x!=SearchMode.SEARCH_REGEXP))
 | 
			
		||||
      throw new ValidationException("The search mode parameter is not valid.");
 | 
			
		||||
    view.mode = x;
 | 
			
		||||
 | 
			
		||||
    // Get the search term parameter.
 | 
			
		||||
    view.term = rinput.getParameter("term");
 | 
			
		||||
    if (view.term==null)
 | 
			
		||||
      view.term = "";
 | 
			
		||||
 | 
			
		||||
    // Retrieve the offset and find count.
 | 
			
		||||
    view.offset = rinput.getParameterInt("ofs",0);
 | 
			
		||||
    view.findCount = rinput.getParameterInt("fcount",-1);
 | 
			
		||||
 
 | 
			
		||||
    // Adjust the offset based on the button clicked.
 | 
			
		||||
    if (rinput.isImageButtonClicked("search"))
 | 
			
		||||
      view.offset = 0;  // begin a new search
 | 
			
		||||
    else if (rinput.isImageButtonClicked("previous"))
 | 
			
		||||
      view.offset = Math.max(view.offset-view.maxResults,0);
 | 
			
		||||
    else if (rinput.isImageButtonClicked("next"))
 | 
			
		||||
      view.offset += view.maxResults;
 | 
			
		||||
    else if (!(rinput.isImageButtonClicked("update")))
 | 
			
		||||
      throw new ValidationException("Unable to determine what action triggered the form.");
 | 
			
		||||
 | 
			
		||||
    // Perform the search!  (Note that we search on USERS, not MEMBERS, as this is the way that we
 | 
			
		||||
    // add additional members to a community.)
 | 
			
		||||
    tmp_results = rinput.engine.searchForUsers(view.field,view.mode,view.term,view.offset,view.maxResults);
 | 
			
		||||
    view.results = augmentList(comm,tmp_results);
 | 
			
		||||
    if (view.findCount<0)
 | 
			
		||||
      view.findCount = rinput.engine.getSearchUserCount(view.field,view.mode,view.term);
 | 
			
		||||
 | 
			
		||||
  } // end else (search operation)
 | 
			
		||||
 | 
			
		||||
  rc = view;
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // handle an error in search
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("ValidationException"))
 | 
			
		||||
    rc = new ErrorBox("Find Error",e.message + " Please try again.",
 | 
			
		||||
                      "comm/set_member.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  else if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error getting member list: " + e.message,
 | 
			
		||||
                      "comm/set_member.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,"comm/set_member.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										88
									
								
								scripts/comm/show.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										88
									
								
								scripts/comm/show.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,88 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // retrieve certain possibly problematic data items and save them as attributes
 | 
			
		||||
  ci = comm.getContactInfo();
 | 
			
		||||
  rinput.setRequestAttribute("contact.info",ci);
 | 
			
		||||
  rinput.setRequestAttribute("host.profile",comm.getHostProfile());
 | 
			
		||||
  rinput.setRequestAttribute("category",comm.getCategory());
 | 
			
		||||
 | 
			
		||||
  // determine the last line of the address and save it off
 | 
			
		||||
  buf = null;
 | 
			
		||||
  if (vlib.emptyString(ci.locality))
 | 
			
		||||
  { // allocate stringbuffer based on region
 | 
			
		||||
    if (vlib.emptyString(ci.region))
 | 
			
		||||
      buf = new java.lang.StringBuffer();
 | 
			
		||||
    else
 | 
			
		||||
      buf = new java.lang.StringBuffer(ci.region);
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
  else if (vlib.emptyString(ci.region))
 | 
			
		||||
    buf = new java.lang.StringBuffer(ci.locality);
 | 
			
		||||
  else
 | 
			
		||||
  { // tack together both locality and region
 | 
			
		||||
    buf = new java.lang.StringBuffer(ci.locality);
 | 
			
		||||
    buf.append(", ");
 | 
			
		||||
    buf.append(ci.region);
 | 
			
		||||
 | 
			
		||||
  } // end else
 | 
			
		||||
 | 
			
		||||
  if (!(vlib.emptyString(ci.postalCode)))
 | 
			
		||||
  { // append the postal code
 | 
			
		||||
    buf.append(" ");
 | 
			
		||||
    buf.append(ci.postalCode);
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  rinput.setRequestAttribute("address.lastline",buf.toString());
 | 
			
		||||
 | 
			
		||||
  // get the full country name and save it off
 | 
			
		||||
  ce = Packages.com.silverwrist.util.International.get().getCountryForCode(ci.country);
 | 
			
		||||
  if (ce!=null)
 | 
			
		||||
    rinput.setRequestAttribute("address.country",ce.name);
 | 
			
		||||
 | 
			
		||||
  // Save off the community logo tag.
 | 
			
		||||
  rinput.setRequestAttribute("community.logo",rinput.getCommunityLogoTag(ci.photoURL));
 | 
			
		||||
 | 
			
		||||
  // create the view object
 | 
			
		||||
  rc = new JSPView("Community Profile: " + comm.name,"comm/profile.jsp");
 | 
			
		||||
  rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
  rc.pageQID = "go/" + comm.alias + "!";
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // handle an exception thrown by the profile code
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error accessing community: " + e.message,"top.js.vs");
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										70
									
								
								scripts/comm/unjoin.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										70
									
								
								scripts/comm/unjoin.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,70 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
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 (!(comm.canUnjoin()))
 | 
			
		||||
{ // you can't unjoin the community
 | 
			
		||||
  vlib.output(new ErrorBox("Community Error","You are not permitted to unjoin this community.","top.js.vs"));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// the names of the confirmation attribute and parameter
 | 
			
		||||
CONFIRM_attr = "confirmbox.unjoin";
 | 
			
		||||
CONFIRM_param = "confirm";
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if (ConfirmBox.isConfirmed(rinput,CONFIRM_attr,CONFIRM_param))
 | 
			
		||||
{ // we are confirmed - unjoin us!
 | 
			
		||||
  try
 | 
			
		||||
  { // do the unjoin
 | 
			
		||||
    comm.unjoin();
 | 
			
		||||
 | 
			
		||||
    // force the menus to be redrawn
 | 
			
		||||
    rinput.setSessionAttribute(RequestInput.LEFT_MENU_SESSION_ATTR,null);
 | 
			
		||||
 | 
			
		||||
    // after which, return to the top
 | 
			
		||||
    rc = new Redirect("top.js.vs",LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // caught an exception while unjoining
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error","Unable to unjoin community: " + e.message,"top.js.vs");
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error unjoining community: " + e.message,"top.js.vs");
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else // not yet confirmed - display the confirmation box
 | 
			
		||||
  rc = new ConfirmBox(rinput,CONFIRM_attr,CONFIRM_param,"Unjoining Community",
 | 
			
		||||
		      "Are you sure you want to unjoin the '" + comm.name + "' community?",
 | 
			
		||||
                      "comm/unjoin.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET,
 | 
			
		||||
                      "community/" + comm.alias,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										53
									
								
								scripts/conf/add_to_hotlist.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								scripts/conf/add_to_hotlist.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,53 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // add to the hotlist
 | 
			
		||||
  conf.addToHotlist();
 | 
			
		||||
 | 
			
		||||
  // trap back to the topics list
 | 
			
		||||
  rc = new Redirect("conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error doing the add
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error adding to hotlist: " + e.message,
 | 
			
		||||
                      "conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done...
 | 
			
		||||
							
								
								
									
										79
									
								
								scripts/conf/alias_add.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										79
									
								
								scripts/conf/alias_add.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,79 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
on_error = "conf/aliases.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
 | 
			
		||||
 | 
			
		||||
if (!(conf.canChangeConference()))
 | 
			
		||||
{ // you can't fiddle with this conference
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error",
 | 
			
		||||
                           "You do not have permission to change this conference's aliases.",on_error));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
alias = rinput.getParameter("alias");
 | 
			
		||||
if (vlib.emptyString(alias))
 | 
			
		||||
{ // this is a no-op
 | 
			
		||||
  vlib.output(new NullResponse());
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (!(vlib.validVeniceID(alias)))
 | 
			
		||||
{ // we're not a valid Venice ID
 | 
			
		||||
  on_error += ("&errmsg="
 | 
			
		||||
               + vlib.encodeURL("The alias you have entered is not a valid identifier.  Please try again."));
 | 
			
		||||
  vlib.output(new Redirect(on_error,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // add the alias
 | 
			
		||||
  conf.addAlias(alias);
 | 
			
		||||
 | 
			
		||||
  // bounce back to the aliases display
 | 
			
		||||
  rc = new Redirect(on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error in the alias definitions
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error adding alias: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done...
 | 
			
		||||
							
								
								
									
										70
									
								
								scripts/conf/alias_remove.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										70
									
								
								scripts/conf/alias_remove.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,70 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
on_error = "conf/aliases.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
 | 
			
		||||
 | 
			
		||||
if (!(conf.canChangeConference()))
 | 
			
		||||
{ // you can't fiddle with this conference
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error",
 | 
			
		||||
                           "You do not have permission to change this conference's aliases.",on_error));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
alias = rinput.getParameter("alias");
 | 
			
		||||
if (vlib.emptyString(alias))
 | 
			
		||||
{ // this is a no-op
 | 
			
		||||
  vlib.output(new NullResponse());
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // remove the alias
 | 
			
		||||
  conf.removeAlias(alias);
 | 
			
		||||
 | 
			
		||||
  // bounce back to the aliases display
 | 
			
		||||
  rc = new Redirect(on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error in the alias definitions
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error removing alias: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done...
 | 
			
		||||
							
								
								
									
										62
									
								
								scripts/conf/aliases.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								scripts/conf/aliases.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,62 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
on_error = "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
 | 
			
		||||
 | 
			
		||||
if (!(conf.canChangeConference()))
 | 
			
		||||
{ // you can't fiddle with this conference
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error",
 | 
			
		||||
                           "You do not have permission to change this conference's aliases.",on_error));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get the aliases list
 | 
			
		||||
  rinput.setRequestAttribute("conference.aliases.list",conf.aliases);
 | 
			
		||||
  rinput.setRequestAttribute("conference.aliases.error_message",rinput.getParameter("errmsg"));
 | 
			
		||||
 | 
			
		||||
  // create the resulting view
 | 
			
		||||
  rc = new JSPView("Manage Conference Aliases: " + conf.name,"conf/aliases.jsp");
 | 
			
		||||
  rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error in the alias definitions
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error getting aliases: " + e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done...
 | 
			
		||||
							
								
								
									
										56
									
								
								scripts/conf/archive_topic.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								scripts/conf/archive_topic.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,56 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
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");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the current topic
 | 
			
		||||
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber;
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get the flag and set the archived status
 | 
			
		||||
  flag = rinput.getParameterInt("flag",0);
 | 
			
		||||
  topic.setArchived(flag==1);
 | 
			
		||||
  rc = new Redirect(on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error setting the hide topic
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error setting archived status: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										57
									
								
								scripts/conf/conf_reports.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								scripts/conf/conf_reports.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,57 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
on_error = "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get a topic list from the conference
 | 
			
		||||
  topics = conf.getTopicList(ConferenceContext.GET_ALL,ConferenceContext.SORT_NUMBER);
 | 
			
		||||
  rinput.setRequestAttribute("conference.reports.topiclist",topics);
 | 
			
		||||
 | 
			
		||||
  // create the result view
 | 
			
		||||
  rc = new JSPView("Conference Reports: " + conf.name,"conf/report_menu.jsp");
 | 
			
		||||
  rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error generating the topic list
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error listing topics: " + e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done...
 | 
			
		||||
							
								
								
									
										71
									
								
								scripts/conf/conferences.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										71
									
								
								scripts/conf/conferences.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,71 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // generate the conference listing
 | 
			
		||||
  clist = comm.conferences;
 | 
			
		||||
 | 
			
		||||
  // get the list of hosts for each conference
 | 
			
		||||
  hlist = new ArrayList(clist.size());
 | 
			
		||||
  for (i=0; i<clist.size(); i++)
 | 
			
		||||
  { // load the hosts
 | 
			
		||||
    c = vlib.castConferenceContext(clist.get(i));
 | 
			
		||||
    hlist.add(c.hosts);
 | 
			
		||||
 | 
			
		||||
  } // end for
 | 
			
		||||
 | 
			
		||||
  // save them off as request attributes
 | 
			
		||||
  rinput.setRequestAttribute("conferences.list",clist);
 | 
			
		||||
  rinput.setRequestAttribute("conferences.hosts.list",hlist);
 | 
			
		||||
 | 
			
		||||
  // create the JSP view
 | 
			
		||||
  rc = new JSPView("Conference Listing: " + comm.name,"conf/conferences.jsp");
 | 
			
		||||
  rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
  rc.pageQID = "go/" + comm.alias + "!";
 | 
			
		||||
  
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // do something with the exception
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error finding conferences: " + e.message,
 | 
			
		||||
                      "comm/show.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
  { // an Access Error might be because we aren't logged in
 | 
			
		||||
    if (rinput.user.isLoggedIn())
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,"comm/show.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else
 | 
			
		||||
      rc = new LogInOrCreate();
 | 
			
		||||
 | 
			
		||||
  } // end else if
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										106
									
								
								scripts/conf/create.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										106
									
								
								scripts/conf/create.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,106 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.dlg);
 | 
			
		||||
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 (!(comm.canCreateConference()))
 | 
			
		||||
{ // can't create a conference
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You are not permitted to create conferences in this community.",
 | 
			
		||||
			   "conf/conferences.js.vs?cc=" + comm.communityID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
dlg = rinput.getDialog("conf.create");
 | 
			
		||||
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // return the dialog to be filled in
 | 
			
		||||
  dlg.setSubtitle("in Community: " + comm.name);
 | 
			
		||||
  dlg.setValue("cc",comm.communityID + "");
 | 
			
		||||
  vlib.output(dlg);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
op = dlg.whichButton(rinput) + "";
 | 
			
		||||
if (op=="cancel")
 | 
			
		||||
{ // they canceled - redirect back to the conferences list
 | 
			
		||||
  vlib.output(new Redirect("conf/conferences.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
dlg.load(rinput);  // load the dialog
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if (op=="create")
 | 
			
		||||
{ // we actually want to create the conference...
 | 
			
		||||
  try
 | 
			
		||||
  { // first validate the dialog
 | 
			
		||||
    dlg.validate();
 | 
			
		||||
 | 
			
		||||
    // now validate that the alias doesn't exist yet
 | 
			
		||||
    if (rinput.engine.confAliasExists(dlg.getValue("alias")))
 | 
			
		||||
      throw new ValidationException("That alias is already used by another conference on the system.");
 | 
			
		||||
 | 
			
		||||
    // OK, create the conference!
 | 
			
		||||
    pvt = ("1"==dlg.getValue("ctype"));
 | 
			
		||||
    conf = comm.createConference(dlg.getValue("name"),dlg.getValue("alias"),dlg.getValue("descr"),pvt,
 | 
			
		||||
                                 dlg.getValue("hide").booleanValue());
 | 
			
		||||
 | 
			
		||||
    // now bounce to the new conference's topic list so we can start setting it up
 | 
			
		||||
    rc = new Redirect("conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // error creating the conference
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("ValidationException"))
 | 
			
		||||
    { // reset the dialog and try again
 | 
			
		||||
      dlg.setErrorMessage(e.message + " Please try again.");
 | 
			
		||||
      dlg.setSubtitle("in Community: " + comm.name);
 | 
			
		||||
      rc = dlg;
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error creating conference: " + e.message,
 | 
			
		||||
			"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else
 | 
			
		||||
{ // error - don't know what button was clicked
 | 
			
		||||
  logger.error("no known button click on POST to conf/create.js");
 | 
			
		||||
  rc = new ErrorBox("Internal Error","Unknown command button pressed",
 | 
			
		||||
                    "conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										111
									
								
								scripts/conf/custom.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										111
									
								
								scripts/conf/custom.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,111 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
on_error = "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
 | 
			
		||||
 | 
			
		||||
if (!(conf.canChangeConference()))
 | 
			
		||||
{ // you can't fiddle with this conference
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error",
 | 
			
		||||
                           "You do not have permission to change this conference's customizations.",on_error));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // display the customization dialog
 | 
			
		||||
  try
 | 
			
		||||
  { // retrieve the existing customizations
 | 
			
		||||
    tmp = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_TOP);
 | 
			
		||||
    if (tmp==null)
 | 
			
		||||
      tmp = "";
 | 
			
		||||
    rinput.setRequestAttribute("conference.custom.top",tmp);
 | 
			
		||||
    tmp = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_BOTTOM);
 | 
			
		||||
    if (tmp==null)
 | 
			
		||||
      tmp = "";
 | 
			
		||||
    rinput.setRequestAttribute("conference.custom.bottom",tmp);
 | 
			
		||||
 | 
			
		||||
    // create the view
 | 
			
		||||
    rc = new JSPView("Customize Conference: " + conf.name,"conf/custom.jsp");
 | 
			
		||||
    rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // error in getting custom blocks
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error getting customization blocks: " + e.message,on_error);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
  vlib.output(rc);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (rinput.isImageButtonClicked("cancel"))
 | 
			
		||||
{ // cancelled - bail out!
 | 
			
		||||
  vlib.output(new Redirect(on_error,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (!(rinput.isImageButtonClicked("update")))
 | 
			
		||||
{ // what button got pressed?!?!?
 | 
			
		||||
  logger.error("no known button click on POST to conf/custom.js");
 | 
			
		||||
  vlib.output(new ErrorBox("Internal Error","Unknown command button pressed",on_error));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
try
 | 
			
		||||
{ // reset the custom blocks
 | 
			
		||||
  conf.setCustomBlock(ConferenceContext.CUST_BLOCK_TOP,rinput.getParameter("tx"));
 | 
			
		||||
  conf.setCustomBlock(ConferenceContext.CUST_BLOCK_BOTTOM,rinput.getParameter("bx"));
 | 
			
		||||
 | 
			
		||||
  // bounce back to the manage conference menu
 | 
			
		||||
  rc = new Redirect(on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error changing customizations
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error setting customizations: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done...
 | 
			
		||||
							
								
								
									
										62
									
								
								scripts/conf/custom_remove.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								scripts/conf/custom_remove.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,62 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
on_error = "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
 | 
			
		||||
 | 
			
		||||
if (!(conf.canChangeConference()))
 | 
			
		||||
{ // you can't fiddle with this conference
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error",
 | 
			
		||||
                           "You do not have permission to change this conference's customizations.",on_error));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // clear the custom blocks
 | 
			
		||||
  conf.removeCustomBlocks();
 | 
			
		||||
 | 
			
		||||
  // bounce back to the manage conference menu
 | 
			
		||||
  rc = new Redirect(on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error changing customizations
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error removing customizations: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done...
 | 
			
		||||
							
								
								
									
										84
									
								
								scripts/conf/delete.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										84
									
								
								scripts/conf/delete.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,84 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf);
 | 
			
		||||
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 (!(comm.canManageConferences()))
 | 
			
		||||
{ // can't manage conferences, bail out
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
 | 
			
		||||
			   "conf/conferences.js.vs?cc=" + comm.communityID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
if (!(conf.canDeleteConference()))
 | 
			
		||||
{ // you can't fiddle with this conference
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You do not have permission to delete this conference.",
 | 
			
		||||
                           "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
CONFIRM_attr = "conferences.manage.delete.ConfirmBox";
 | 
			
		||||
CONFIRM_param = "confirm";
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if (ConfirmBox.isConfirmed(rinput,CONFIRM_attr,CONFIRM_param))
 | 
			
		||||
{ // it is confirmed - we want to delete the conference!
 | 
			
		||||
  try
 | 
			
		||||
  { // delete the conference (using the alias function to avoid using the delete keyword)
 | 
			
		||||
    conf.deleteConference();
 | 
			
		||||
 | 
			
		||||
    // trap back to the conferences list
 | 
			
		||||
    rc = new Redirect("conf/conferences.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // handle error in deletion
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error deleting conference: " + e.message,
 | 
			
		||||
			"conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,
 | 
			
		||||
                        "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else // come up with the confirm box
 | 
			
		||||
  rc = new ConfirmBox(rinput,CONFIRM_attr,CONFIRM_param,"Delete Conference",
 | 
			
		||||
                      "You are about to permanently delete the '" + conf.name
 | 
			
		||||
                      + "' conference!  Are you sure you want to do this?",
 | 
			
		||||
                      "conf/delete.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID,LinkTypes.SERVLET,
 | 
			
		||||
                      "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID,
 | 
			
		||||
                      LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										70
									
								
								scripts/conf/delete_topic.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										70
									
								
								scripts/conf/delete_topic.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,70 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
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");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the current topic
 | 
			
		||||
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber;
 | 
			
		||||
 | 
			
		||||
CONFIRM_attr = "conferences.topic.delete.ConfirmBox";
 | 
			
		||||
CONFIRM_param = "confirm";
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if (ConfirmBox.isConfirmed(rinput,CONFIRM_attr,CONFIRM_param))
 | 
			
		||||
{ // it is confirmed - we want to delete the topic!
 | 
			
		||||
  try
 | 
			
		||||
  { // delete the bloody thing!
 | 
			
		||||
    topic.deleteTopic();
 | 
			
		||||
 | 
			
		||||
    // bounce back to the topic list on success
 | 
			
		||||
    rc = new Redirect("conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // error deleting
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error deleting topic: " + e.message,on_error);
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else  // come up with the confirm box
 | 
			
		||||
  rc = new ConfirmBox(rinput,CONFIRM_attr,CONFIRM_param,"Delete Topic",
 | 
			
		||||
                      "You are about to delete topic " + topic.topicNumber + " ('" + topic.name
 | 
			
		||||
	              + "') from the '" + conf.name + "' conference!  Are you sure you want to do this?",
 | 
			
		||||
                      "conf/delete_topic.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
 | 
			
		||||
                      + topic.topicNumber,LinkTypes.SERVLET,on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done...
 | 
			
		||||
							
								
								
									
										171
									
								
								scripts/conf/edit.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										171
									
								
								scripts/conf/edit.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,171 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.dlg);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
 | 
			
		||||
// Define a simple function to set up the dialog stuff.
 | 
			
		||||
function setupDialog(dlg,conf)
 | 
			
		||||
{
 | 
			
		||||
  dlg.setSubtitle(conf.name);
 | 
			
		||||
  sinf = conf.securityInfo;
 | 
			
		||||
  dlg.sendMessage("read_lvl","setRoleList",sinf.getRoleList("Conference.Read"));
 | 
			
		||||
  dlg.sendMessage("post_lvl","setRoleList",sinf.getRoleList("Conference.Post"));
 | 
			
		||||
  dlg.sendMessage("create_lvl","setRoleList",sinf.getRoleList("Conference.Create"));
 | 
			
		||||
  dlg.sendMessage("hide_lvl","setRoleList",sinf.getRoleList("Conference.Hide"));
 | 
			
		||||
  dlg.sendMessage("nuke_lvl","setRoleList",sinf.getRoleList("Conference.Nuke"));
 | 
			
		||||
  dlg.sendMessage("change_lvl","setRoleList",sinf.getRoleList("Conference.Change"));
 | 
			
		||||
  dlg.sendMessage("delete_lvl","setRoleList",sinf.getRoleList("Conference.Delete"));
 | 
			
		||||
  dlg.setEnabled("hide",conf.canSetHideList());
 | 
			
		||||
 | 
			
		||||
} // end setupDialog
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
on_error = "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
 | 
			
		||||
 | 
			
		||||
if (!(conf.canChangeConference()))
 | 
			
		||||
{ // you can't fiddle with this conference
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You do not have permission to change this conference's attributes.",
 | 
			
		||||
                           on_error));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
dlg = rinput.getDialog("conf.edit");
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // set up the dialog
 | 
			
		||||
  setupDialog(dlg,conf);
 | 
			
		||||
 | 
			
		||||
  try
 | 
			
		||||
  { // fill the dialog with the conference information
 | 
			
		||||
    dlg.setValue("cc",comm.communityID + "");
 | 
			
		||||
    dlg.setValue("conf",conf.confID + "");
 | 
			
		||||
    dlg.setValue("name",conf.name);
 | 
			
		||||
    dlg.setValue("descr",conf.description);
 | 
			
		||||
    if (conf.canSetHideList() && conf.getHideList())
 | 
			
		||||
      dlg.setValue("hide",1);
 | 
			
		||||
    dlg.setValue("read_lvl",conf.getReadLevel() + "");
 | 
			
		||||
    dlg.setValue("post_lvl",conf.getPostLevel() + "");
 | 
			
		||||
    dlg.setValue("create_lvl",conf.getCreateLevel() + "");
 | 
			
		||||
    dlg.setValue("hide_lvl",conf.getHideLevel() + "");
 | 
			
		||||
    dlg.setValue("nuke_lvl",conf.getNukeLevel() + "");
 | 
			
		||||
    dlg.setValue("change_lvl",conf.getChangeLevel() + "");
 | 
			
		||||
    dlg.setValue("delete_lvl",conf.getDeleteLevel() + "");
 | 
			
		||||
 | 
			
		||||
    props = conf.properties;
 | 
			
		||||
    if (props.displayPostPictures)
 | 
			
		||||
      dlg.setValue("pic_in_post",1);
 | 
			
		||||
 | 
			
		||||
    rc = dlg;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // error initializing dialog
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error setting up dialog: " + e.message,on_error);
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
  vlib.output(rc);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// everything that follows is for a POST operation
 | 
			
		||||
op = dlg.whichButton(rinput) + "";
 | 
			
		||||
if (op=="cancel")
 | 
			
		||||
{ // user cancelled profile update - bounce back to the target
 | 
			
		||||
  vlib.output(new Redirect(on_error,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (op!="update")
 | 
			
		||||
{ // what the hell was that button?
 | 
			
		||||
  logger.error("no known button click on POST to conf/edit.js");
 | 
			
		||||
  vlib.output(new ErrorBox("Internal Error","Unknown command button pressed",on_error));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
dlg.load(rinput);  // load the values into the dialog
 | 
			
		||||
 | 
			
		||||
try
 | 
			
		||||
{ // validate the dialog
 | 
			
		||||
  dlg.validate();
 | 
			
		||||
 | 
			
		||||
  // get all the levels out of the dialog
 | 
			
		||||
  read_lvl = dlg.getValue("read_lvl").intValue();
 | 
			
		||||
  post_lvl = dlg.getValue("post_lvl").intValue();
 | 
			
		||||
  create_lvl = dlg.getValue("create_lvl").intValue();
 | 
			
		||||
  hide_lvl = dlg.getValue("hide_lvl").intValue();
 | 
			
		||||
  nuke_lvl = dlg.getValue("nuke_lvl").intValue();
 | 
			
		||||
  change_lvl = dlg.getValue("change_lvl").intValue();
 | 
			
		||||
  delete_lvl = dlg.getValue("delete_lvl").intValue();
 | 
			
		||||
 | 
			
		||||
  // set the various conference attributes
 | 
			
		||||
  conf.setSecurityLevels(read_lvl,post_lvl,create_lvl,hide_lvl,nuke_lvl,change_lvl,delete_lvl);
 | 
			
		||||
  conf.name = dlg.getValue("name");
 | 
			
		||||
  conf.description = dlg.getValue("descr");
 | 
			
		||||
  if (conf.canSetHideList())
 | 
			
		||||
    conf.setHideList(dlg.getValue("hide").booleanValue());
 | 
			
		||||
 | 
			
		||||
  // set the conference properties
 | 
			
		||||
  props = conf.properties;
 | 
			
		||||
  props.displayPostPictures = dlg.getValue("pic_in_post").booleanValue();
 | 
			
		||||
  conf.properties = props;
 | 
			
		||||
 | 
			
		||||
  // bounce back to the manage display
 | 
			
		||||
  rc = new Redirect(on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error editing the conference
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("ValidationException"))
 | 
			
		||||
  { // reset the dialog and try again
 | 
			
		||||
    dlg.setErrorMessage(e.message + " Please try again.");
 | 
			
		||||
    setupDialog(dlg,conf);
 | 
			
		||||
    rc = dlg;
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error editing conference: " + e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done...
 | 
			
		||||
							
								
								
									
										113
									
								
								scripts/conf/email.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										113
									
								
								scripts/conf/email.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,113 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
on_error = "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // display the dialog
 | 
			
		||||
  try
 | 
			
		||||
  { // we need the topic list
 | 
			
		||||
    tlist = conf.getTopicList(ConferenceContext.DISPLAY_ALL,ConferenceContext.SORT_NAME);
 | 
			
		||||
    rinput.setRequestAttribute("topic.email.list",tlist);
 | 
			
		||||
 | 
			
		||||
    // create the dialog
 | 
			
		||||
    rc = new JSPView("Conference E-Mail: " + conf.name,"conf/email.jsp");
 | 
			
		||||
    rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // unable to get topic list
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error setting up dialog: " + e.message,on_error);
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
  vlib.output(rc);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (rinput.isImageButtonClicked("cancel"))
 | 
			
		||||
{ // cancelled - bail out!
 | 
			
		||||
  vlib.output(new Redirect(on_error,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (!(rinput.isImageButtonClicked("send")))
 | 
			
		||||
{ // what button got pressed?!?!?
 | 
			
		||||
  logger.error("no known button click on POST to conf/email.js");
 | 
			
		||||
  vlib.output(new ErrorBox("Internal Error","Unknown command button pressed",on_error));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
try
 | 
			
		||||
{ // retrieve the topic we want to send to
 | 
			
		||||
  topic = null;
 | 
			
		||||
  tnum = rinput.getParameterShort("top",0);
 | 
			
		||||
  if (tnum>0)
 | 
			
		||||
    topic = conf.getTopic(tnum);
 | 
			
		||||
 | 
			
		||||
  // retrieve other parameters
 | 
			
		||||
  posters = (rinput.getParameterInt("porl",0)==0)
 | 
			
		||||
  ndays = -1;
 | 
			
		||||
  if ("Y"==rinput.getParameter("xday"))
 | 
			
		||||
    ndays = rinput.getParameterInt("day",-1);
 | 
			
		||||
 | 
			
		||||
  // send the E-mail!
 | 
			
		||||
  if (topic!=null)
 | 
			
		||||
    topic.sendMailToParticipants(posters,ndays,rinput.getParameter("subj"),rinput.getParameter("pb"));
 | 
			
		||||
  else
 | 
			
		||||
    conf.sendMailToParticipants(posters,ndays,rinput.getParameter("subj"),rinput.getParameter("pb"));
 | 
			
		||||
 | 
			
		||||
  // bounce back to the manage conference menu
 | 
			
		||||
  rc = new Redirect(on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // exception sending the E-mail
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error sending E-mail: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);   // all done....
 | 
			
		||||
							
								
								
									
										117
									
								
								scripts/conf/find.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										117
									
								
								scripts/conf/find.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,117 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
on_error = "conf/conferences.js.vs?cc=" + comm.communityID;
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(false,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the topic
 | 
			
		||||
topic = null;
 | 
			
		||||
if (conf!=null)
 | 
			
		||||
{ // get the topic
 | 
			
		||||
  on_error = "conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
 | 
			
		||||
  topic = currc.getTopic(false,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
  if (topic!=null)
 | 
			
		||||
    on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
 | 
			
		||||
             + topic.topicNumber;
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
view = new FindPostsView(comm,conf,topic);
 | 
			
		||||
view.maxResults = rinput.engine.getStdNumSearchResults();
 | 
			
		||||
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // display the find dialog
 | 
			
		||||
  vlib.output(view);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// Retrieve the search term parameter.
 | 
			
		||||
tmp = rinput.getParameter("term");
 | 
			
		||||
if (tmp==null)
 | 
			
		||||
  view.term = "";
 | 
			
		||||
else
 | 
			
		||||
  view.term = tmp;
 | 
			
		||||
 | 
			
		||||
// Retrieve the offset and find count parameters.
 | 
			
		||||
view.offset = rinput.getParameterInt("ofs",0);
 | 
			
		||||
view.findCount = rinput.getParameterInt("fcount",-1);
 | 
			
		||||
 | 
			
		||||
// Adjust the search return offset based on the command button click.
 | 
			
		||||
if (rinput.isImageButtonClicked("search"))
 | 
			
		||||
  view.offset = 0;
 | 
			
		||||
else if (rinput.isImageButtonClicked("previous"))
 | 
			
		||||
  view.offset = Math.max(view.offset - view.maxResults,0);  // go backwards
 | 
			
		||||
else if (rinput.isImageButtonClicked("next"))
 | 
			
		||||
  view.offset += view.maxResults;  // go forwards instead
 | 
			
		||||
else
 | 
			
		||||
  throw new InternalStateError("Unable to determine what action triggered the form.");
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // do the search
 | 
			
		||||
  if (topic!=null)
 | 
			
		||||
  { // search the topic
 | 
			
		||||
    view.results = topic.searchPosts(term,offset,view.maxResults);
 | 
			
		||||
    if (view.findCount<0)
 | 
			
		||||
      view.findCount = topic.getSearchPostCount(term);
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
  else if (conf!=null)
 | 
			
		||||
  { // search the conference
 | 
			
		||||
    view.results = conf.searchPosts(term,offset,view.maxResults);
 | 
			
		||||
    if (view.findCount<0)
 | 
			
		||||
      view.findCount = conf.getSearchPostCount(term);
 | 
			
		||||
 | 
			
		||||
  } // end else if
 | 
			
		||||
  else
 | 
			
		||||
  { // search the community
 | 
			
		||||
    view.results = comm.searchPosts(term,offset,view.maxResults);
 | 
			
		||||
    if (view.findCount<0)
 | 
			
		||||
      view.findCount = comm.getSearchPostCount(term);
 | 
			
		||||
 | 
			
		||||
  } // end else
 | 
			
		||||
 | 
			
		||||
  rc = view;
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error doing the find
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error on find: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										54
									
								
								scripts/conf/fixseen.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								scripts/conf/fixseen.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,54 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf);
 | 
			
		||||
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");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/manage_conf.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // the dreaded fixseen :-)
 | 
			
		||||
  conf.fixSeen();
 | 
			
		||||
 | 
			
		||||
  // don't change the current view
 | 
			
		||||
  rc = new NullResponse();
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error resetting the pseud
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error catching up conference: " + e.message,
 | 
			
		||||
                      "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,
 | 
			
		||||
                      "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										56
									
								
								scripts/conf/freeze_topic.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								scripts/conf/freeze_topic.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,56 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
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");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the current topic
 | 
			
		||||
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber;
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get the flag and set the frozen status
 | 
			
		||||
  flag = rinput.getParameterInt("flag",0);
 | 
			
		||||
  topic.setFrozen(flag==1);
 | 
			
		||||
  rc = new Redirect(on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error setting the hide topic
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error setting frozen status: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										61
									
								
								scripts/conf/hide_message.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								scripts/conf/hide_message.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,61 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
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");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the current topic
 | 
			
		||||
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
 | 
			
		||||
// get the message under consideration
 | 
			
		||||
msg = currc.getTopicMessageParam("msg",true,"conf/posts.js.vs?cc=" + comm.communityID + "&conf="
 | 
			
		||||
                                           + conf.confID + "&top=" + topic.topicNumber);
 | 
			
		||||
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber
 | 
			
		||||
         + "&p1=" + msg.getPostNumber() + "&shac=1";
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get the flag and set the hide status
 | 
			
		||||
  flag = rinput.getParameterInt("flag",0);
 | 
			
		||||
  msg.setHidden(flag==1);
 | 
			
		||||
  rc = new Redirect(on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error setting the hide topic
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error setting hide status: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										56
									
								
								scripts/conf/hide_topic.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								scripts/conf/hide_topic.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,56 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
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");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the current topic
 | 
			
		||||
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber;
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get the flag and set the hide status
 | 
			
		||||
  flag = rinput.getParameterInt("flag",0);
 | 
			
		||||
  topic.setHidden(flag==1);
 | 
			
		||||
  rc = new Redirect(on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error setting the hide topic
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error setting hide status: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										47
									
								
								scripts/conf/hotlist.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								scripts/conf/hotlist.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,47 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get the hotlist and save it off for the display
 | 
			
		||||
  rinput.setRequestAttribute("user.conf.hotlist",rinput.user.getConferenceHotlist());
 | 
			
		||||
 | 
			
		||||
  // create a JSPView with the hot list
 | 
			
		||||
  rc = new JSPView("Your Conference Hotlist","conf/hotlist.jsp");
 | 
			
		||||
  rc.menuSelector = Content.MENU_SELECTOR_TOP;
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // unable to get the hotlist
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Error getting hotlist: " + e.message,"top.js.vs");
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										64
									
								
								scripts/conf/hotlist_delete.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								scripts/conf/hotlist_delete.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,64 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
 | 
			
		||||
// get the two index values
 | 
			
		||||
ndx = rinput.getParameterInt("ndx",-1);
 | 
			
		||||
if (ndx<0)
 | 
			
		||||
{ // index values out of range
 | 
			
		||||
  vlib.output(new ErrorBox(null,"Invalid index parameter.","conf/hotlist.js.vs"));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get the hotlist and further check the parameters
 | 
			
		||||
  hotlist = rinput.user.getConferenceHotlist();
 | 
			
		||||
  if (ndx>=hotlist.size())
 | 
			
		||||
    throw new ErrorBox(null,"Invalid index parameter.","conf/hotlist.js.vs");
 | 
			
		||||
 | 
			
		||||
  // get the hotlist entry and conference
 | 
			
		||||
  ntry = vlib.castConferenceHotlistEntry(hotlist.get(ndx));
 | 
			
		||||
  conf = ntry.getConference();
 | 
			
		||||
 | 
			
		||||
  // remove the conference
 | 
			
		||||
  conf.removeFromHotlist();
 | 
			
		||||
 | 
			
		||||
  // bounce back to the hotlist screen
 | 
			
		||||
  rc = new Redirect("conf/hotlist.js.vs",LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error adjusting the hotlist sequence
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Error adjusting hotlist: " + e.message,"conf/hotlist.js.vs");
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done
 | 
			
		||||
							
								
								
									
										82
									
								
								scripts/conf/hotlist_move.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										82
									
								
								scripts/conf/hotlist_move.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,82 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
 | 
			
		||||
// get the two index values
 | 
			
		||||
ndx = rinput.getParameterInt("ndx",-1);
 | 
			
		||||
ndx2 = rinput.getParameterInt("ndx2",-1);
 | 
			
		||||
if ((ndx<0) || (ndx2<0) || (ndx==ndx2))
 | 
			
		||||
{ // index values out of range
 | 
			
		||||
  vlib.output(new ErrorBox(null,"Invalid index parameters.","conf/hotlist.js.vs"));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get the hotlist and further check the parameters
 | 
			
		||||
  hotlist = rinput.user.getConferenceHotlist();
 | 
			
		||||
  if ((ndx>=hotlist.size()) || (ndx2>=hotlist.size()))
 | 
			
		||||
    throw new ErrorBox(null,"Invalid index parameters.","conf/hotlist.js.vs");
 | 
			
		||||
 | 
			
		||||
  // get the hotlist entries
 | 
			
		||||
  entry1 = vlib.castConferenceHotlistEntry(hotlist.get(ndx));
 | 
			
		||||
  entry2 = vlib.castConferenceHotlistEntry(hotlist.get(ndx2));
 | 
			
		||||
 | 
			
		||||
  // get the sequence numbers
 | 
			
		||||
  seq1 = entry1.getSequence();
 | 
			
		||||
  seq2 = entry2.getSequence();
 | 
			
		||||
 | 
			
		||||
  // now reassign the sequences
 | 
			
		||||
  entry1.setHotlistSequence(seq2);
 | 
			
		||||
  restore = true;
 | 
			
		||||
  try
 | 
			
		||||
  { // set the second sequence
 | 
			
		||||
    entry2.setHotlistSequence(seq1);
 | 
			
		||||
    restore = false;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  finally
 | 
			
		||||
  { // restore the first sequence on error
 | 
			
		||||
    if (restore)
 | 
			
		||||
      entry1.setHotlistSequence(seq1);
 | 
			
		||||
 | 
			
		||||
  } // end finally
 | 
			
		||||
 | 
			
		||||
  // bounce back to the hotlist screen
 | 
			
		||||
  rc = new Redirect("conf/hotlist.js.vs",LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error adjusting the hotlist sequence
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Error adjusting hotlist: " + e.message,"conf/hotlist.js.vs");
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done
 | 
			
		||||
							
								
								
									
										96
									
								
								scripts/conf/invite_conf.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										96
									
								
								scripts/conf/invite_conf.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,96 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
on_error = "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
 | 
			
		||||
 | 
			
		||||
if (!(conf.canSendInvitation()))
 | 
			
		||||
{ // you can't send an invitation
 | 
			
		||||
  vlib.output(new ErrorBox("Conference Error","You are not permitted to send an invitation.",on_error));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // set up the invitation screen parameters
 | 
			
		||||
  rinput.setRequestAttribute("invitation.title","Send Conference Invitation:");
 | 
			
		||||
  rinput.setRequestAttribute("invitation.subtitle",conf.name);
 | 
			
		||||
  rinput.setRequestAttribute("invitation.action",rinput.formatURL("conf/invite_conf.js.vs",LinkTypes.SERVLET));
 | 
			
		||||
  rinput.setRequestAttribute("invitation.params",
 | 
			
		||||
                             "<INPUT TYPE=\"HIDDEN\" NAME=\"cc\" VALUE=\"" + comm.communityID
 | 
			
		||||
                             + "\"><INPUT TYPE=\"HIDDEN\" NAME=\"conf\" VALUE=\"" + conf.confID + "\">");
 | 
			
		||||
 | 
			
		||||
  // create the invitation and display it
 | 
			
		||||
  view = new JSPView("Send Invitation","comm/invite.jsp");
 | 
			
		||||
  view.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
  view.pageQID = "conf/invite_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
 | 
			
		||||
  vlib.output(view);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (rinput.isImageButtonClicked("cancel"))
 | 
			
		||||
{ // bounce back to the base page
 | 
			
		||||
  vlib.output(new Redirect(on_error,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if (rinput.isImageButtonClicked("send"))
 | 
			
		||||
{ // do the actual send!
 | 
			
		||||
  try
 | 
			
		||||
  { // send out the invitation and then redirect back
 | 
			
		||||
    conf.sendInvitation(rinput.getParameter("addr"),rinput.getParameter("pb"));
 | 
			
		||||
    rc = new Redirect(on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // exception sending the invitation
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error sending invitation: " + e.message,on_error);
 | 
			
		||||
    else if (etype.match("EmailException"))
 | 
			
		||||
      rc = new ErrorBox("E-Mail Error","Error sending E-mail: " + e.message,on_error);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else
 | 
			
		||||
{ // no known button pressed
 | 
			
		||||
  logger.error("no known button click on POST to conf/invite_conf.js");
 | 
			
		||||
  rc = new ErrorBox("Internal Error","Unknown command button pressed",on_error);
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										103
									
								
								scripts/conf/invite_topic.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										103
									
								
								scripts/conf/invite_topic.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,103 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
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");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the current topic
 | 
			
		||||
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
on_error = "conf/manage_topic.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
 | 
			
		||||
         + topic.topicNumber;
 | 
			
		||||
 | 
			
		||||
if (!(topic.canSendInvitation()))
 | 
			
		||||
{ // you can't send an invitation
 | 
			
		||||
  vlib.output(new ErrorBox("Conference Error","You are not permitted to send an invitation.",on_error));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // set up the invitation screen parameters
 | 
			
		||||
  rinput.setRequestAttribute("invitation.title","Send Topic Invitation:");
 | 
			
		||||
  rinput.setRequestAttribute("invitation.subtitle",topic.name);
 | 
			
		||||
  rinput.setRequestAttribute("invitation.action",
 | 
			
		||||
                             rinput.formatURL("conf/invite_topic.js.vs",LinkTypes.SERVLET));
 | 
			
		||||
  rinput.setRequestAttribute("invitation.params",
 | 
			
		||||
                             "<INPUT TYPE=\"HIDDEN\" NAME=\"cc\" VALUE=\"" + comm.communityID
 | 
			
		||||
                             + "\"><INPUT TYPE=\"HIDDEN\" NAME=\"conf\" VALUE=\"" + conf.confID
 | 
			
		||||
                             + "\"><INPUT TYPE=\"HIDDEN\" NAME=\"top\" VALUE=\"" + topic.topicNumber + "\">");
 | 
			
		||||
 | 
			
		||||
  // create the invitation and display it
 | 
			
		||||
  view = new JSPView("Send Invitation","comm/invite.jsp");
 | 
			
		||||
  view.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
  view.pageQID = "conf/invite_topic.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
 | 
			
		||||
               + topic.topicNumber;
 | 
			
		||||
  vlib.output(view);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (rinput.isImageButtonClicked("cancel"))
 | 
			
		||||
{ // bounce back to the base page
 | 
			
		||||
  vlib.output(new Redirect(on_error,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if (rinput.isImageButtonClicked("send"))
 | 
			
		||||
{ // do the actual send!
 | 
			
		||||
  try
 | 
			
		||||
  { // send out the invitation and then redirect back
 | 
			
		||||
    topic.sendInvitation(rinput.getParameter("addr"),rinput.getParameter("pb"));
 | 
			
		||||
    rc = new Redirect(on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // exception sending the invitation
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error sending invitation: " + e.message,on_error);
 | 
			
		||||
    else if (etype.match("EmailException"))
 | 
			
		||||
      rc = new ErrorBox("E-Mail Error","Error sending E-mail: " + e.message,on_error);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else
 | 
			
		||||
{ // no known button pressed
 | 
			
		||||
  logger.error("no known button click on POST to conf/invite_topic.js");
 | 
			
		||||
  rc = new ErrorBox("Internal Error","Unknown command button pressed",on_error);
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										90
									
								
								scripts/conf/lurker_report.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										90
									
								
								scripts/conf/lurker_report.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,90 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
on_error = "conf/conf_reports.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
 | 
			
		||||
 | 
			
		||||
// get the current topic (where applicable)
 | 
			
		||||
topic = currc.getTopic(false,on_error);
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // construct the activity list
 | 
			
		||||
  my_list = null;
 | 
			
		||||
  my_title = null;
 | 
			
		||||
  title1 = null;
 | 
			
		||||
  title2 = null;
 | 
			
		||||
  nullmsg = null;
 | 
			
		||||
  if (topic!=null)
 | 
			
		||||
  { // get the reader list from the topic
 | 
			
		||||
    my_list = topic.getActiveReaders();
 | 
			
		||||
    if (my_list.isEmpty())
 | 
			
		||||
      nullmsg = "No readers in topic \"" + topic.name + "\" found.";
 | 
			
		||||
    my_title = "Users Reading Topic " + topic.name;
 | 
			
		||||
    title1 = "Readers in Topic:";
 | 
			
		||||
    title2 = topic.name;
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
  else
 | 
			
		||||
  { // get the reader list from the conference
 | 
			
		||||
    my_list = conf.getActiveReaders();
 | 
			
		||||
    if (my_list.isEmpty())
 | 
			
		||||
      nullmsg = "No readers in conference \"" + vlib.encodeHTML(conf.name) + "\" found.";
 | 
			
		||||
    my_title = "Users Reading Conference " + conf.name;
 | 
			
		||||
    title1 = "Readers in Conference:";
 | 
			
		||||
    title2 = conf.name;
 | 
			
		||||
 | 
			
		||||
  } // end else
 | 
			
		||||
 | 
			
		||||
  // save off the attributes
 | 
			
		||||
  rinput.setRequestAttribute("conference.activity.list",my_list);
 | 
			
		||||
  rinput.setRequestAttribute("conference.activity.nullmessage",nullmsg);
 | 
			
		||||
  rinput.setRequestAttribute("conference.activity.posters",Boolean.FALSE);
 | 
			
		||||
  rinput.setRequestAttribute("conference.activity.title",title1);
 | 
			
		||||
  rinput.setRequestAttribute("conference.activity.subtitle",title2);
 | 
			
		||||
 | 
			
		||||
  // create the view
 | 
			
		||||
  rc = new JSPView(my_title,"conf/activity_report.jsp");
 | 
			
		||||
  rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error getting the list of readers
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error getting reader list: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done...
 | 
			
		||||
							
								
								
									
										86
									
								
								scripts/conf/manage.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								scripts/conf/manage.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,86 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
if (!(comm.canManageConferences()))
 | 
			
		||||
{ // can't manage conferences, bail out
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
 | 
			
		||||
			   "conf/conferences.js.vs?cc=" + comm.communityID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get the conference list
 | 
			
		||||
  conf_list = comm.getConferences();
 | 
			
		||||
 | 
			
		||||
  // allocate arrays to hold the next/previous/hidden data
 | 
			
		||||
  a_next = vlib.createIntArray(conf_list.size());
 | 
			
		||||
  a_prev = vlib.createIntArray(conf_list.size());
 | 
			
		||||
  a_hidden = vlib.createBooleanArray(conf_list.size());
 | 
			
		||||
 | 
			
		||||
  // determine the next/previous/hidden data in advance
 | 
			
		||||
  prev_id = -1;
 | 
			
		||||
  for (i=0; i<conf_list.size(); i++)
 | 
			
		||||
  { // fill the various arrays
 | 
			
		||||
    conf = vlib.castConferenceContext(conf_list.get(i));
 | 
			
		||||
    a_hidden[i] = conf.hideList;
 | 
			
		||||
    a_prev[i] = prev_id;
 | 
			
		||||
    if (i>0)
 | 
			
		||||
      a_next[i-1] = conf.confID;
 | 
			
		||||
    prev_id = conf.confID;
 | 
			
		||||
 | 
			
		||||
  } // end for
 | 
			
		||||
 | 
			
		||||
  a_next[conf_list.size()-1] = -1;
 | 
			
		||||
 | 
			
		||||
  // save off the data for the JSP page
 | 
			
		||||
  rinput.setRequestAttribute("conference.list",conf_list);
 | 
			
		||||
  rinput.setRequestAttribute("conference.prev.array",a_prev);
 | 
			
		||||
  rinput.setRequestAttribute("conference.next.array",a_next);
 | 
			
		||||
  rinput.setRequestAttribute("conference.hidden.array",a_hidden);
 | 
			
		||||
 | 
			
		||||
  // create the return view
 | 
			
		||||
  rc = new JSPView("Manage Conference List","conf/manage_list.jsp");
 | 
			
		||||
  rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error in getting the conference sequence stuff
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error getting conference list: " + e.message,
 | 
			
		||||
                      "conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);   // all done!
 | 
			
		||||
							
								
								
									
										45
									
								
								scripts/conf/manage_conf.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								scripts/conf/manage_conf.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,45 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
if (conf.canChangeConference() || conf.canDeleteConference())
 | 
			
		||||
{ // create the host tools menu
 | 
			
		||||
  vars = new HashMap();
 | 
			
		||||
  vars.put("cid",comm.communityID + "");
 | 
			
		||||
  vars.put("confid",conf.confID + "");
 | 
			
		||||
  rinput.setRequestAttribute("conference.host.tools.menu",rinput.getMenu("conf.host.tools",vars));
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// create and output the view
 | 
			
		||||
view = new JSPView("Manage Conference: " + conf.name,"conf/manage_conf.jsp");
 | 
			
		||||
view.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
vlib.output(view);
 | 
			
		||||
							
								
								
									
										82
									
								
								scripts/conf/manage_list_delete.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										82
									
								
								scripts/conf/manage_list_delete.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,82 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf);
 | 
			
		||||
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 (!(comm.canManageConferences()))
 | 
			
		||||
{ // can't manage conferences, bail out
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
 | 
			
		||||
			   "conf/conferences.js.vs?cc=" + comm.communityID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/manage.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
if (!(conf.canDeleteConference()))
 | 
			
		||||
{ // you can't fiddle with this conference
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You do not have permission to delete this conference.",
 | 
			
		||||
                           "conf/manage.js.vs?cc=" + comm.communityID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
CONFIRM_attr = "conferences.manage_list.delete.ConfirmBox";
 | 
			
		||||
CONFIRM_param = "confirm";
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if (ConfirmBox.isConfirmed(rinput,CONFIRM_attr,CONFIRM_param))
 | 
			
		||||
{ // it is confirmed - we want to delete the conference!
 | 
			
		||||
  try
 | 
			
		||||
  { // delete the conference (using the alias function to avoid using the delete keyword)
 | 
			
		||||
    conf.deleteConference();
 | 
			
		||||
 | 
			
		||||
    // trap back to the manage display
 | 
			
		||||
    rc = new Redirect("conf/manage.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // handle error in deletion
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error deleting conference: " + e.message,
 | 
			
		||||
			"conf/manage.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,"conf/manage.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else // come up with the confirm box
 | 
			
		||||
  rc = new ConfirmBox(rinput,CONFIRM_attr,CONFIRM_param,"Delete Conference",
 | 
			
		||||
                      "You are about to permanently delete the '" + conf.name
 | 
			
		||||
                      + "' conference!  Are you sure you want to do this?",
 | 
			
		||||
                      "conf/manage_list_delete.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID,
 | 
			
		||||
                      LinkTypes.SERVLET,"conf/manage.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										72
									
								
								scripts/conf/manage_list_sethide.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										72
									
								
								scripts/conf/manage_list_sethide.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,72 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf);
 | 
			
		||||
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 (!(comm.canManageConferences()))
 | 
			
		||||
{ // can't manage conferences, bail out
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
 | 
			
		||||
			   "conf/conferences.js.vs?cc=" + comm.communityID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/manage.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
if (!(conf.canChangeConference()))
 | 
			
		||||
{ // you can't fiddle with this conference
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You do not have permission to modify this conference.",
 | 
			
		||||
                           "conf/manage.js.vs?cc=" + comm.communityID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// get the flag value
 | 
			
		||||
hide_flag = (rinput.getParameterInt("flag",0)==1);
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // set the hide flag
 | 
			
		||||
  conf.hideList = hide_flag;
 | 
			
		||||
 | 
			
		||||
  // trap back to the manage display
 | 
			
		||||
  rc = new Redirect("conf/manage.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // handle errors here
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error setting hide flag: " + e.message,
 | 
			
		||||
                      "conf/manage.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,"conf/manage.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										89
									
								
								scripts/conf/manage_list_swap.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										89
									
								
								scripts/conf/manage_list_swap.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,89 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf);
 | 
			
		||||
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 (!(comm.canManageConferences()))
 | 
			
		||||
{ // can't manage conferences, bail out
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
 | 
			
		||||
			   "conf/conferences.js.vs?cc=" + comm.communityID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/manage.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// we need another conference here - get that conference parameter
 | 
			
		||||
other_conf = currc.getConferenceParam("other",true,"conf/manage.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
if (!(conf.canChangeConference()) || !(other_conf.canChangeConference()))
 | 
			
		||||
{ // you can't fiddle with this conference
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You do not have permission to modify this conference.",
 | 
			
		||||
                           "conf/manage.js.vs?cc=" + comm.communityID));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get the two sequences for starters
 | 
			
		||||
  this_seq = conf.sequence;
 | 
			
		||||
  other_seq = other_conf.sequence;
 | 
			
		||||
 | 
			
		||||
  // now exchange them
 | 
			
		||||
  conf.sequence = other_seq;
 | 
			
		||||
  restore = true;
 | 
			
		||||
  try
 | 
			
		||||
  { // set the second conference sequence
 | 
			
		||||
    other_conf.sequence = this_seq;
 | 
			
		||||
    restore = false;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  finally
 | 
			
		||||
  { // undo first set on error
 | 
			
		||||
    if (restore)
 | 
			
		||||
      conf.sequence = this_seq;
 | 
			
		||||
 | 
			
		||||
  } // end finally
 | 
			
		||||
 | 
			
		||||
  // trap back to the manage display
 | 
			
		||||
  rc = new Redirect("conf/manage.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error in exchanging the conference positions
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error changing sequence: " + e.message,
 | 
			
		||||
                      "conf/manage.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,"conf/manage.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done...
 | 
			
		||||
							
								
								
									
										57
									
								
								scripts/conf/manage_topic.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								scripts/conf/manage_topic.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,57 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the current topic
 | 
			
		||||
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber;
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // save off the attributes we require
 | 
			
		||||
  rinput.setRequestAttribute("topic.bozos.list",topic.getBozos());
 | 
			
		||||
 | 
			
		||||
  // return the view
 | 
			
		||||
  rc = new JSPView("Manage Topic: " + topic.name,"conf/manage_topic.jsp");
 | 
			
		||||
  rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error in generating bozos list
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error getting filter list: " + e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done...
 | 
			
		||||
							
								
								
									
										222
									
								
								scripts/conf/membership.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										222
									
								
								scripts/conf/membership.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,222 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf.view);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
 | 
			
		||||
// Function which sets the correct conference access level onto each entry of the input list.
 | 
			
		||||
function augmentList(conf,list)
 | 
			
		||||
{
 | 
			
		||||
  var rl = new ArrayList(list.size());
 | 
			
		||||
  var it = list.iterator();
 | 
			
		||||
  while (it.hasNext())
 | 
			
		||||
  { // get the conference level and add it to the UserFound object
 | 
			
		||||
    var uf = vlib.castUserFound(it.next());
 | 
			
		||||
    var level = conf.getMemberLevel(uf.UID);
 | 
			
		||||
    rl.add(uf.createNewLevel(level));
 | 
			
		||||
 | 
			
		||||
  } // end while
 | 
			
		||||
 | 
			
		||||
  return rl;
 | 
			
		||||
 | 
			
		||||
} // end augmentList
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
on_error = "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
 | 
			
		||||
 | 
			
		||||
if (!(conf.canChangeConference()))
 | 
			
		||||
{ // you can't fiddle with this conference
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You do not have permission to change this conference's membership.",
 | 
			
		||||
                           on_error));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// create the view object
 | 
			
		||||
view = new ConfMemberView(rinput.engine.getStdNumSearchResults(),conf);
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // set up the initial state of the view
 | 
			
		||||
  try
 | 
			
		||||
  { // get the conference membership list
 | 
			
		||||
    mbr_list = conf.getMemberList();
 | 
			
		||||
    view.simple = true;
 | 
			
		||||
    view.results = mbr_list;
 | 
			
		||||
    view.findCount = mbr_list.size();
 | 
			
		||||
    rc = view;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // we can get at least one exception here
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error retrieving membership list: " + e.message,on_error);
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
  vlib.output(rc);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (rinput.isImageButtonClicked("update"))
 | 
			
		||||
{ // do an update of privileges in this conference
 | 
			
		||||
  list_uids = vlib.splitList(rinput.getParameter("listuids"),":");
 | 
			
		||||
  try
 | 
			
		||||
  { // loop through the defined UIDs and check the level...
 | 
			
		||||
    it = list_uids.iterator();
 | 
			
		||||
    while (it.hasNext())
 | 
			
		||||
    { // get the current and new levels, compare them, and reset if needed
 | 
			
		||||
      x = it.next();
 | 
			
		||||
      cur_level = rinput.getParameterInt("zxcur_" + x,-1);
 | 
			
		||||
      new_level = rinput.getParameterInt("zxnew_" + x,-1);
 | 
			
		||||
      if (cur_level!=new_level)
 | 
			
		||||
        conf.setMembership(parseInt(x,10),new_level);
 | 
			
		||||
 | 
			
		||||
    } // end while
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // the update might throw an error message
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error adjusting permissions: " + e.message,on_error);
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
    vlib.output(rc);  // bail out now with the error message
 | 
			
		||||
    vlib.done();
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// Carry on with the search operation now.
 | 
			
		||||
try
 | 
			
		||||
{ // handle the actual search
 | 
			
		||||
  if ("1"==rinput.getParameter("sl"))
 | 
			
		||||
  { // Set up some of the easy initial parameters.
 | 
			
		||||
    view.simple = true;
 | 
			
		||||
 | 
			
		||||
    // Retrieve the offset and find count.
 | 
			
		||||
    view.offset = rinput.getParameterInt("ofs",0);
 | 
			
		||||
    // view.findCount = rinput.getParameterInt("fcount",-1); (N.B.: will get reassigned below)
 | 
			
		||||
 
 | 
			
		||||
    // Adjust the offset based on the button clicked.
 | 
			
		||||
    if (rinput.isImageButtonClicked("search"))
 | 
			
		||||
      throw new ValidationException("Invalid button clicked."); // can't happen
 | 
			
		||||
    else if (rinput.isImageButtonClicked("previous"))
 | 
			
		||||
      view.offset = Math.max(view.offset-view.maxResults,0);
 | 
			
		||||
    else if (rinput.isImageButtonClicked("next"))
 | 
			
		||||
      view.offset += view.maxResults;
 | 
			
		||||
    else if (!(rinput.isImageButtonClicked("update")))
 | 
			
		||||
      throw new ValidationException("Unable to determine what action triggered the form.");
 | 
			
		||||
 | 
			
		||||
    // Get the list and subset it if necessary.
 | 
			
		||||
    // N.B.: Since the update function can reduce the size of the member list, we need to take into account
 | 
			
		||||
    // that the find count will need updating and the offset may be in the wrong place for the list now.
 | 
			
		||||
    mbr_list = conf.getMemberList();
 | 
			
		||||
    view.findCount = mbr_list.size();
 | 
			
		||||
    while ((view.offset>0) && (view.offset>=view.findCount))
 | 
			
		||||
      view.offset = Math.max(view.offset-view.maxResults,0);
 | 
			
		||||
    if (view.offset==0)
 | 
			
		||||
      view.results = mbr_list;
 | 
			
		||||
    else
 | 
			
		||||
      view.results = mbr_list.subList(offset,mbr_list.size());
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
  else
 | 
			
		||||
  { // This is a search operation...
 | 
			
		||||
    view.simple = false;
 | 
			
		||||
 | 
			
		||||
    // Get the search field parameter.
 | 
			
		||||
    x = rinput.getParameterInt("field",SearchMode.FIELD_USER_NAME);
 | 
			
		||||
    if (   (x!=SearchMode.FIELD_USER_NAME) && (x!=SearchMode.FIELD_USER_DESCRIPTION)
 | 
			
		||||
        && (x!=SearchMode.FIELD_USER_GIVEN_NAME) && (x!=SearchMode.FIELD_USER_FAMILY_NAME))
 | 
			
		||||
      throw new ValidationException("The search field parameter is not valid.");
 | 
			
		||||
    view.field = x;
 | 
			
		||||
 | 
			
		||||
    // Get the search mode parameter.
 | 
			
		||||
    x = rinput.getParameterInt("mode",SearchMode.SEARCH_PREFIX);
 | 
			
		||||
    if (   (x!=SearchMode.SEARCH_PREFIX) && (x!=SearchMode.SEARCH_SUBSTRING)
 | 
			
		||||
        && (x!=SearchMode.SEARCH_REGEXP))
 | 
			
		||||
      throw new ValidationException("The search mode parameter is not valid.");
 | 
			
		||||
    view.mode = x;
 | 
			
		||||
 | 
			
		||||
    // Get the search term parameter.
 | 
			
		||||
    view.term = rinput.getParameter("term");
 | 
			
		||||
    if (view.term==null)
 | 
			
		||||
      view.term = "";
 | 
			
		||||
 | 
			
		||||
    // Retrieve the offset and find count.
 | 
			
		||||
    view.offset = rinput.getParameterInt("ofs",0);
 | 
			
		||||
    view.findCount = rinput.getParameterInt("fcount",-1);
 | 
			
		||||
 
 | 
			
		||||
    // Adjust the offset based on the button clicked.
 | 
			
		||||
    if (rinput.isImageButtonClicked("search"))
 | 
			
		||||
      view.offset = 0;  // begin a new search
 | 
			
		||||
    else if (rinput.isImageButtonClicked("previous"))
 | 
			
		||||
      view.offset = Math.max(view.offset-view.maxResults,0);
 | 
			
		||||
    else if (rinput.isImageButtonClicked("next"))
 | 
			
		||||
      view.offset += view.maxResults;
 | 
			
		||||
    else if (!(rinput.isImageButtonClicked("update")))
 | 
			
		||||
      throw new ValidationException("Unable to determine what action triggered the form.");
 | 
			
		||||
 | 
			
		||||
    // Perform the search!  (Note that we search on COMMUNITY members, not CONFERENCE members, as this is the
 | 
			
		||||
    // way that we add additional members to a conference.)
 | 
			
		||||
    tmp_results = comm.searchForMembers(view.field,view.mode,view.term,view.offset,view.maxResults);
 | 
			
		||||
    view.results = augmentList(conf,tmp_results);
 | 
			
		||||
    if (view.findCount<0)
 | 
			
		||||
      view.findCount = comm.getSearchMemberCount(view.field,view.mode,view.term);
 | 
			
		||||
 | 
			
		||||
  } // end else (search operation)
 | 
			
		||||
 | 
			
		||||
  rc = view;
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // handle an error in search
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("ValidationException"))
 | 
			
		||||
    rc = new ErrorBox("Find Error",e.message + " Please try again.",on_error);
 | 
			
		||||
  else if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error getting member list: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										61
									
								
								scripts/conf/message_bozo.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								scripts/conf/message_bozo.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,61 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
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");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the current topic
 | 
			
		||||
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
 | 
			
		||||
// get the message under consideration
 | 
			
		||||
msg = currc.getTopicMessageParam("msg",true,"conf/posts.js.vs?cc=" + comm.communityID + "&conf="
 | 
			
		||||
                                           + conf.confID + "&top=" + topic.topicNumber);
 | 
			
		||||
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber
 | 
			
		||||
         + "&p1=" + msg.getPostNumber() + "&shac=1";
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get the flag and set the hide status
 | 
			
		||||
  flag = rinput.getParameterInt("flag",0);
 | 
			
		||||
  topic.setBozo(msg.creatorUID,(flag==1));
 | 
			
		||||
  rc = new Redirect(on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error setting the hide topic
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error setting hide status: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										145
									
								
								scripts/conf/new_topic.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										145
									
								
								scripts/conf/new_topic.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,145 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
on_error = "conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
 | 
			
		||||
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // create the blank "New Topic Form"
 | 
			
		||||
  rinput.setRequestAttribute("postbox.newtopic","");
 | 
			
		||||
  rinput.setRequestAttribute("postbox.pseud",conf.defaultPseud);
 | 
			
		||||
  rinput.setRequestAttribute("postbox.data","");
 | 
			
		||||
  view = new JSPView("Create New Topic","conf/new_topic.jsp");
 | 
			
		||||
  view.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
  vlib.output(view);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (rinput.isImageButtonClicked("cancel"))
 | 
			
		||||
{ // they cancelled - bail out
 | 
			
		||||
  vlib.output(new Redirect(on_error,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (rinput.isImageButtonClicked("preview"))
 | 
			
		||||
{ // generate a preview!  start by passing all the data through the HTML checker as needed
 | 
			
		||||
  try
 | 
			
		||||
  { // escape the title
 | 
			
		||||
    checker = rinput.engine.getEscapingChecker();
 | 
			
		||||
    checker.append(rinput.getParameter("title"));
 | 
			
		||||
    checker.finish();
 | 
			
		||||
    rinput.setRequestAttribute("postbox.newtopic",checker.getValue());
 | 
			
		||||
 | 
			
		||||
    // escape the pseud
 | 
			
		||||
    checker.reset();
 | 
			
		||||
    checker.append(rinput.getParameter("pseud"));
 | 
			
		||||
    checker.finish();
 | 
			
		||||
    rinput.setRequestAttribute("postbox.pseud",checker.getValue());
 | 
			
		||||
 | 
			
		||||
    // escape the data
 | 
			
		||||
    postdata = rinput.getParameter("pb");
 | 
			
		||||
    checker.reset();
 | 
			
		||||
    checker.append(postdata);
 | 
			
		||||
    checker.finish();
 | 
			
		||||
    rinput.setRequestAttribute("postbox.data",checker.getValue());
 | 
			
		||||
 | 
			
		||||
    // run the preview
 | 
			
		||||
    checker = conf.getNewTopicPreviewChecker();
 | 
			
		||||
    checker.append(postdata);
 | 
			
		||||
    checker.finish();
 | 
			
		||||
    rinput.setRequestAttribute("preview.text",checker.getValue());
 | 
			
		||||
    rinput.setRequestAttribute("preview.num_errors",new java.lang.Integer(checker.getCounter("spelling")));
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // watch out for spurious HTMLCheckerExceptions
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("HTMLCheckerException"))
 | 
			
		||||
      throw new InternalStateError("spurious HTMLCheckerException thrown");
 | 
			
		||||
    else
 | 
			
		||||
      throw new InternalStateError("unknown exception thrown in new_topic.js preview: " + e);
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
  // save off any additional parameters we need
 | 
			
		||||
  tmp = rinput.getParameter("attach");
 | 
			
		||||
  if (!(vlib.emptyString(tmp)))
 | 
			
		||||
    rinput.setRequestAttribute("postbox.attach","Y");
 | 
			
		||||
 | 
			
		||||
  // create a JSPView for the preview and output it
 | 
			
		||||
  view = new JSPView("Preview New Topic","conf/new_topic.jsp");
 | 
			
		||||
  view.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
  vlib.output(view);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (!(rinput.isImageButtonClicked("post1")))
 | 
			
		||||
{ // there were only the three buttons - bug out!
 | 
			
		||||
  logger.error("no known button click on POST to conf/new_topic.js");
 | 
			
		||||
  vlib.output(new ErrorBox("Internal Error","Unknown command button pressed",on_error));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // add the new topic!
 | 
			
		||||
  topic = conf.addTopic(rinput.getParameter("title"),rinput.getParameter("pseud"),rinput.getParameter("pb"));
 | 
			
		||||
 | 
			
		||||
  // decide where we go from here
 | 
			
		||||
  if (vlib.emptyString(rinput.getParameter("attach")))
 | 
			
		||||
    rc = new Redirect(on_error,LinkTypes.SERVLET);  // bounce straight to our new view!
 | 
			
		||||
  else
 | 
			
		||||
  { // we need to display the attachment form
 | 
			
		||||
    msg = topic.getMessage(0);  // the message the attachment gets hooked to
 | 
			
		||||
    rinput.setRequestAttribute("attachment.postid",msg.postID + "");
 | 
			
		||||
    rinput.setRequestAttribute("attachment.target",on_error);
 | 
			
		||||
    rc = new JSPView("Upload Attachment","conf/attachment.jsp");
 | 
			
		||||
    rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
 | 
			
		||||
  } // end else
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // new topic creation failed
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error creating topic: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										82
									
								
								scripts/conf/nuke_message.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										82
									
								
								scripts/conf/nuke_message.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,82 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
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");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the current topic
 | 
			
		||||
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
 | 
			
		||||
// get the message under consideration
 | 
			
		||||
msg = currc.getTopicMessageParam("msg",true,"conf/posts.js.vs?cc=" + comm.communityID + "&conf="
 | 
			
		||||
                                           + conf.confID + "&top=" + topic.topicNumber);
 | 
			
		||||
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber
 | 
			
		||||
         + "&p1=" + msg.getPostNumber() + "&shac=1";
 | 
			
		||||
 | 
			
		||||
CONFIRM_attr = "conferences.message.nuke.ConfirmBox";
 | 
			
		||||
CONFIRM_param = "confirm";
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // do the nuke here...
 | 
			
		||||
  if (ConfirmBox.isConfirmed(rinput,CONFIRM_attr,CONFIRM_param))
 | 
			
		||||
  { // it is confirmed - we want to nuke the message!
 | 
			
		||||
    msg.nuke();
 | 
			
		||||
 | 
			
		||||
    // bounce back to the topic display afterwards
 | 
			
		||||
    rc = new Redirect("conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
 | 
			
		||||
                      + topic.topicNumber,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
  else
 | 
			
		||||
  { // come up with the confirm box (this may throw exceptions too)
 | 
			
		||||
    aliases = conf.aliases;
 | 
			
		||||
    rc = new ConfirmBox(rinput,CONFIRM_attr,CONFIRM_param,"Nuke Message",
 | 
			
		||||
                        "You are about to nuke message <" + aliases.get(0).toString() + "." + topic.topicNumber
 | 
			
		||||
                        + "." + msg.postNumber + ">, originally composed by <" + msg.creatorName
 | 
			
		||||
                        + ">! Are you sure you want to do this?",
 | 
			
		||||
                        "conf/nuke_message.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
 | 
			
		||||
                        + topic.topicNumber + "&msg=" + msg.postNumber,LinkTypes.SERVLET,on_error,
 | 
			
		||||
                        LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end else
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error deleting
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error nuking message: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done...
 | 
			
		||||
							
								
								
									
										227
									
								
								scripts/conf/post_message.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										227
									
								
								scripts/conf/post_message.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,227 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(java.util);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.htmlcheck);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the current topic
 | 
			
		||||
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber;
 | 
			
		||||
 | 
			
		||||
if (rinput.isImageButtonClicked("cancel"))
 | 
			
		||||
{ // cancelling - go back where we came from
 | 
			
		||||
  vlib.output(new Redirect(on_error,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// get the current post number
 | 
			
		||||
post_num = rinput.getParameterInt("sd",-1);
 | 
			
		||||
if (post_num<0)
 | 
			
		||||
{ // this value is critical for slippage detection - we must have it
 | 
			
		||||
  vlib.output(new ErrorBox(null,"Invalid parameter.",on_error));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// get the raw post data
 | 
			
		||||
raw_postdata = rinput.getParameter("pb");
 | 
			
		||||
if (raw_postdata==null)
 | 
			
		||||
  raw_postdata = "";
 | 
			
		||||
 | 
			
		||||
if (rinput.isImageButtonClicked("preview"))
 | 
			
		||||
{ // generate a preview!  start by passing all the data through the HTML checker as needed
 | 
			
		||||
  try
 | 
			
		||||
  { // escape the pseud
 | 
			
		||||
    checker = rinput.engine.getEscapingChecker();
 | 
			
		||||
    checker.append(rinput.getParameter("pseud"));
 | 
			
		||||
    checker.finish();
 | 
			
		||||
    rinput.setRequestAttribute("postbox.pseud",checker.getValue());
 | 
			
		||||
 | 
			
		||||
    // escape the data
 | 
			
		||||
    checker.reset();
 | 
			
		||||
    checker.append(raw_postdata);
 | 
			
		||||
    checker.finish();
 | 
			
		||||
    rinput.setRequestAttribute("postbox.data",checker.getValue());
 | 
			
		||||
 | 
			
		||||
    // run the preview
 | 
			
		||||
    checker = topic.getPreviewChecker();
 | 
			
		||||
    checker.append(raw_postdata);
 | 
			
		||||
    checker.finish();
 | 
			
		||||
    rinput.setRequestAttribute("preview.text",checker.getValue());
 | 
			
		||||
    rinput.setRequestAttribute("preview.num_errors",new java.lang.Integer(checker.getCounter("spelling")));
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // watch out for spurious HTMLCheckerExceptions
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("HTMLCheckerException"))
 | 
			
		||||
      throw new InternalStateError("spurious HTMLCheckerException thrown");
 | 
			
		||||
    else
 | 
			
		||||
      throw new InternalStateError("unknown exception thrown in post_message.js preview: " + e);
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
  // save off any additional parameters we need
 | 
			
		||||
  tmp = rinput.getParameter("next");
 | 
			
		||||
  if (tmp!=null)
 | 
			
		||||
    rinput.setRequestAttribute("postbox.hidden.next",tmp);
 | 
			
		||||
  rinput.setRequestAttribute("postbox.hidden.sd",post_num + "");
 | 
			
		||||
  tmp = rinput.getParameter("attach");
 | 
			
		||||
  if (!(vlib.emptyString(tmp)))
 | 
			
		||||
    rinput.setRequestAttribute("postbox.attach","Y");
 | 
			
		||||
  tmp = rinput.getParameter("slip");
 | 
			
		||||
  if (!(vlib.emptyString(tmp)))
 | 
			
		||||
    rinput.setRequestAttribute("postbox.hidden.slip","Y");
 | 
			
		||||
 | 
			
		||||
  // create a JSPView for the preview and output it
 | 
			
		||||
  view = new JSPView("Previewing Message","conf/preview.jsp");
 | 
			
		||||
  view.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
  vlib.output(view);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (!(rinput.isImageButtonClicked("post") || rinput.isImageButtonClicked("postnext")
 | 
			
		||||
    || rinput.isImageButtonClicked("posttopics")))
 | 
			
		||||
{ // one of the three POST buttons MUST have been checked!
 | 
			
		||||
  logger.error("no known button click on POST to conf/post_message.js");
 | 
			
		||||
  vlib.output(new ErrorBox("Internal Error","Unknown command button pressed",on_error));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (post_num!=topic.getTotalMessages())
 | 
			
		||||
{ // slippage detected!  generate parameters for the Slippage view
 | 
			
		||||
  rc = null;
 | 
			
		||||
  try
 | 
			
		||||
  { // get the list of messages associated with the slippage
 | 
			
		||||
    rinput.setRequestAttribute("slippage.messages",topic.getMessages(post_num,topic.totalMessages-1));
 | 
			
		||||
 | 
			
		||||
    // generate the topic stem
 | 
			
		||||
    aliases = conf.aliases;
 | 
			
		||||
    rinput.setRequestAttribute("slippage.topic_stem",
 | 
			
		||||
                               aliases.get(0).toString() + "." + topic.topicNumber + ".");
 | 
			
		||||
 | 
			
		||||
    // escape the pseud
 | 
			
		||||
    checker = rinput.engine.getEscapingChecker();
 | 
			
		||||
    checker.append(rinput.getParameter("pseud"));
 | 
			
		||||
    checker.finish();
 | 
			
		||||
    rinput.setRequestAttribute("postbox.pseud",checker.getValue());
 | 
			
		||||
 | 
			
		||||
    // escape the data
 | 
			
		||||
    checker.reset();
 | 
			
		||||
    checker.append(raw_postdata);
 | 
			
		||||
    checker.finish();
 | 
			
		||||
    rinput.setRequestAttribute("postbox.data",checker.getValue());
 | 
			
		||||
 | 
			
		||||
    // save off any additional parameters we need
 | 
			
		||||
    tmp = rinput.getParameter("next");
 | 
			
		||||
    if (tmp!=null)
 | 
			
		||||
      rinput.setRequestAttribute("postbox.hidden.next",tmp);
 | 
			
		||||
    rinput.setRequestAttribute("postbox.hidden.sd",topic.totalMessages + "");
 | 
			
		||||
    tmp = rinput.getParameter("attach");
 | 
			
		||||
    if (!(vlib.emptyString(tmp)))
 | 
			
		||||
      rinput.setRequestAttribute("postbox.attach","Y");
 | 
			
		||||
 | 
			
		||||
    // create the slippage view
 | 
			
		||||
    rc = new JSPView("Slippage or Double-Click Detected","conf/slippage.jsp");
 | 
			
		||||
    rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // handle an exception generating the slippage view
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("HTMLCheckerException"))
 | 
			
		||||
      throw new InternalStateError("spurious HTMLCheckerException thrown");
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error generating slippage view: " + e.message,on_error);
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
  vlib.output(rc);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // actually post the darn thing!
 | 
			
		||||
  msg = topic.postNewMessage(0,rinput.getParameter("pseud"),raw_postdata);
 | 
			
		||||
 | 
			
		||||
  // If there was no slippage, make sure we mark the new post as "read."
 | 
			
		||||
  if (!(rinput.hasParameter("slip")))
 | 
			
		||||
    topic.fixSeen();
 | 
			
		||||
 | 
			
		||||
  // Where do we want to go now?
 | 
			
		||||
  tmp = "";
 | 
			
		||||
  if (rinput.isImageButtonClicked("posttopics"))
 | 
			
		||||
    tmp = "conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
 | 
			
		||||
  else
 | 
			
		||||
  { // find the topic number to go to next and compute the new URL
 | 
			
		||||
    my_topicnum = -1;
 | 
			
		||||
    if (rinput.isImageButtonClicked("postnext"))
 | 
			
		||||
      my_topicnum = rinput.getParameterShort("next",topic.topicNumber);
 | 
			
		||||
    else
 | 
			
		||||
      my_topicnum = topic.topicNumber;
 | 
			
		||||
    tmp = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + my_topicnum
 | 
			
		||||
        + "&rnm=1";
 | 
			
		||||
 | 
			
		||||
  } // end else
 | 
			
		||||
 | 
			
		||||
  if (vlib.emptyString(rinput.getParameter("attach")))
 | 
			
		||||
    rc = new Redirect(tmp,LinkTypes.SERVLET);  // bounce straight to our new view!
 | 
			
		||||
  else
 | 
			
		||||
  { // we need to display the attachment form
 | 
			
		||||
    rinput.setRequestAttribute("attachment.postid",msg.postID + "");
 | 
			
		||||
    rinput.setRequestAttribute("attachment.target",tmp);
 | 
			
		||||
    rc = new JSPView("Upload Attachment","conf/attachment.jsp");
 | 
			
		||||
    rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
 | 
			
		||||
  } // end else
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // handle an error in doing the post
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error posting message: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										90
									
								
								scripts/conf/poster_report.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										90
									
								
								scripts/conf/poster_report.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,90 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
on_error = "conf/conf_reports.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
 | 
			
		||||
 | 
			
		||||
// get the current topic (where applicable)
 | 
			
		||||
topic = currc.getTopic(false,on_error);
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // construct the activity list
 | 
			
		||||
  my_list = null;
 | 
			
		||||
  my_title = null;
 | 
			
		||||
  title1 = null;
 | 
			
		||||
  title2 = null;
 | 
			
		||||
  nullmsg = null;
 | 
			
		||||
  if (topic!=null)
 | 
			
		||||
  { // get the poster list from the topic
 | 
			
		||||
    my_list = topic.getActivePosters();
 | 
			
		||||
    if (my_list.isEmpty())
 | 
			
		||||
      nullmsg = "No posters to topic \"" + topic.name + "\" found.";
 | 
			
		||||
    my_title = "Users Posting in Topic " + topic.name;
 | 
			
		||||
    title1 = "Posters in Topic:";
 | 
			
		||||
    title2 = topic.name;
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
  else
 | 
			
		||||
  { // get the poster list from the conference
 | 
			
		||||
    my_list = conf.getActivePosters();
 | 
			
		||||
    if (my_list.isEmpty())
 | 
			
		||||
      nullmsg = "No posters to conference \"" + vlib.encodeHTML(conf.name) + "\" found.";
 | 
			
		||||
    my_title = "Users Posting in Conference " + conf.name;
 | 
			
		||||
    title1 = "Posters in Conference:";
 | 
			
		||||
    title2 = conf.name;
 | 
			
		||||
 | 
			
		||||
  } // end else
 | 
			
		||||
 | 
			
		||||
  // save off the attributes
 | 
			
		||||
  rinput.setRequestAttribute("conference.activity.list",my_list);
 | 
			
		||||
  rinput.setRequestAttribute("conference.activity.nullmessage",nullmsg);
 | 
			
		||||
  rinput.setRequestAttribute("conference.activity.posters",Boolean.TRUE);
 | 
			
		||||
  rinput.setRequestAttribute("conference.activity.title",title1);
 | 
			
		||||
  rinput.setRequestAttribute("conference.activity.subtitle",title2);
 | 
			
		||||
 | 
			
		||||
  // create the view
 | 
			
		||||
  rc = new JSPView(my_title,"conf/activity_report.jsp");
 | 
			
		||||
  rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error getting the list of posters
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error getting poster list: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done...
 | 
			
		||||
							
								
								
									
										143
									
								
								scripts/conf/posts.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										143
									
								
								scripts/conf/posts.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,143 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importClass(java.awt.Dimension);
 | 
			
		||||
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.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf.view);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
 | 
			
		||||
SCALING_NUM = 1;
 | 
			
		||||
SCALING_DENOM = 2;
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the current topic
 | 
			
		||||
on_error = "conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
 | 
			
		||||
topic = currc.getTopic(true,on_error);
 | 
			
		||||
 | 
			
		||||
// if we need to restore posts in another topic, do so
 | 
			
		||||
read_new = true;
 | 
			
		||||
if (rinput.hasParameter("rtop") && rinput.hasParameter("rct"))
 | 
			
		||||
{ // retrieve the "other topic"
 | 
			
		||||
  other_topic = currc.getOptionalTopic("rtop");
 | 
			
		||||
  if (other_topic!=null)
 | 
			
		||||
  { // get the number of unread messages
 | 
			
		||||
    nunread = rinput.getParameterInt("rct",0);
 | 
			
		||||
    if ((nunread>0) && (nunread<=other_topic.totalMessages))
 | 
			
		||||
    { // set the unread message count
 | 
			
		||||
      try
 | 
			
		||||
      { // reset the unread messages
 | 
			
		||||
        other_topic.unreadMessages = nunread;
 | 
			
		||||
 | 
			
		||||
      } // end try
 | 
			
		||||
      catch (e)
 | 
			
		||||
      { // it didn't work - ignore the error
 | 
			
		||||
        logger.warn("exception setting unread messages: " + e);
 | 
			
		||||
 | 
			
		||||
      } // end catch
 | 
			
		||||
 | 
			
		||||
      if (topic.topicID==other_topic.topicID)
 | 
			
		||||
        read_new = false;  // don't do a read new if we just restored this topic
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
    else  // ignore this
 | 
			
		||||
      logger.warn("number of unread messages out of range");
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// get the post interval
 | 
			
		||||
piv = currc.getPostInterval(on_error);
 | 
			
		||||
 | 
			
		||||
// get the "read new" parameter
 | 
			
		||||
if (read_new)
 | 
			
		||||
  read_new = rinput.hasParameter("rnm");
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // create the view
 | 
			
		||||
  rc = new PostsView(comm,currc);
 | 
			
		||||
  logger.debug(rc.unread + " unread messages");
 | 
			
		||||
 | 
			
		||||
  // fill in parameters
 | 
			
		||||
  rc.first = piv.first;
 | 
			
		||||
  rc.last = piv.last;
 | 
			
		||||
  rc.showAdvanced = rinput.hasParameter("shac");
 | 
			
		||||
  rc.noBozos = rinput.hasParameter("nbz");
 | 
			
		||||
  rc.messages = topic.getMessages(piv.first,piv.last);
 | 
			
		||||
  rc.topCustom = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_TOP);
 | 
			
		||||
  rc.bottomCustom = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_BOTTOM);
 | 
			
		||||
  rc.title = topic.name;
 | 
			
		||||
  rc.subtitle = topic.totalMessages + " Total; " + rc.unread + " New; Last: "
 | 
			
		||||
              + rinput.formatDate(topic.lastUpdateDate);
 | 
			
		||||
 | 
			
		||||
  // do a "read new" on this topic
 | 
			
		||||
  if (read_new)
 | 
			
		||||
    topic.unreadMessages = 0;
 | 
			
		||||
 | 
			
		||||
  // visit the topic
 | 
			
		||||
  visit_order = currc.getTopicVisitOrder();
 | 
			
		||||
  if (visit_order!=null)
 | 
			
		||||
    visit_order.visit(topic.topicNumber);
 | 
			
		||||
  rc.topicVisitOrder = visit_order;
 | 
			
		||||
 | 
			
		||||
  // get the aliases list and synthesize the topic stem and QID
 | 
			
		||||
  aliases = conf.aliases;
 | 
			
		||||
  tmp = aliases.get(0).toString() + "." + topic.topicNumber;
 | 
			
		||||
  rc.topicStem = tmp + ".";
 | 
			
		||||
  rc.pageQID = "go/" + comm.alias + "!" + tmp;
 | 
			
		||||
 | 
			
		||||
  if (conf.displayPostPictures() && rinput.user.displayPostPictures())
 | 
			
		||||
  { // set up the user p[hoto dimensions
 | 
			
		||||
    old_psz = rinput.engine.getUserPhotoSize();
 | 
			
		||||
    rc.photoDims = new Dimension((old_psz.width * SCALING_NUM) / SCALING_DENOM,
 | 
			
		||||
                                 (old_psz.height * SCALING_NUM) / SCALING_DENOM);
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  rc.buildInternals(rinput.user);  // build the bozo filter and user photo lists in compiled code
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // handle an exception here
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error listing messages: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
  { // unable to get message list - maybe we weren't logged in
 | 
			
		||||
    if (rinput.user.isLoggedIn())
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
    else
 | 
			
		||||
      rc = new LogInOrCreate();
 | 
			
		||||
 | 
			
		||||
  } // end else if
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										60
									
								
								scripts/conf/publish_message.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								scripts/conf/publish_message.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,60 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
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");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the current topic
 | 
			
		||||
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
 | 
			
		||||
// get the message under consideration
 | 
			
		||||
msg = currc.getTopicMessageParam("msg",true,"conf/posts.js.vs?cc=" + comm.communityID + "&conf="
 | 
			
		||||
                                           + conf.confID + "&top=" + topic.topicNumber);
 | 
			
		||||
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber
 | 
			
		||||
         + "&p1=" + msg.getPostNumber() + "&shac=1";
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // publish it!
 | 
			
		||||
  msg.publish();
 | 
			
		||||
  rc = new Redirect(on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error publishing
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error publishing message: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										66
									
								
								scripts/conf/read_new.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								scripts/conf/read_new.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,66 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
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");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get the topic list, using the current view and sort options
 | 
			
		||||
  topic_list = conf.getTopicList(currc.viewOption,currc.sortOption);
 | 
			
		||||
 | 
			
		||||
  // initialize and return the topic visit order
 | 
			
		||||
  ord = currc.newTopicVisitOrder(topic_list);
 | 
			
		||||
 | 
			
		||||
  if (ord.isNext()) // retrieve the first topic number from the list and bounce directly there
 | 
			
		||||
    rc = new Redirect("conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
 | 
			
		||||
                      + ord.getNext() + "&rnm=1",LinkTypes.SERVLET);
 | 
			
		||||
  else  // no unread messages - bounce to the topics list
 | 
			
		||||
    rc = new Redirect("conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error generating the topic list
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error listing topics: " + e.message,
 | 
			
		||||
                      "conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
  { // they might not be logged in, that's all
 | 
			
		||||
    if (rinput.user.isLoggedIn())
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else
 | 
			
		||||
      rc = new LogInOrCreate();
 | 
			
		||||
 | 
			
		||||
  } // end else if
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										58
									
								
								scripts/conf/remove_bozo.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								scripts/conf/remove_bozo.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,58 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
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");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the current topic
 | 
			
		||||
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
on_error = "conf/manage_topic.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
 | 
			
		||||
         + topic.topicNumber;
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get the UID and clear the bozo status
 | 
			
		||||
  uid = rinput.getParameterInt("u",-1);
 | 
			
		||||
  if (uid>0)
 | 
			
		||||
    topic.setBozo(uid,false);
 | 
			
		||||
 | 
			
		||||
  // bounce back to the Manage Topics display
 | 
			
		||||
  rc = new Redirect(on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // handle an error message
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error setting filter: " + e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done
 | 
			
		||||
							
								
								
									
										60
									
								
								scripts/conf/scribble_message.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								scripts/conf/scribble_message.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,60 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
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");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the current topic
 | 
			
		||||
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
 | 
			
		||||
// get the message under consideration
 | 
			
		||||
msg = currc.getTopicMessageParam("msg",true,"conf/posts.js.vs?cc=" + comm.communityID + "&conf="
 | 
			
		||||
                                           + conf.confID + "&top=" + topic.topicNumber);
 | 
			
		||||
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber
 | 
			
		||||
         + "&p1=" + msg.getPostNumber() + "&shac=1";
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // scribble it!
 | 
			
		||||
  msg.scribble();
 | 
			
		||||
  rc = new Redirect(on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error scribbling
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error scribbling message: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										53
									
								
								scripts/conf/set_pseud.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								scripts/conf/set_pseud.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,53 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.conf);
 | 
			
		||||
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");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/manage_conf.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // change the default pseud
 | 
			
		||||
  pseud = rinput.getParameter("pseud");
 | 
			
		||||
  if (pseud!=null)
 | 
			
		||||
    conf.defaultPseud = pseud;
 | 
			
		||||
 | 
			
		||||
  // don't change the current view
 | 
			
		||||
  rc = new NullResponse();
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error resetting the pseud
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error setting pseud: " + e.message,
 | 
			
		||||
                      "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										57
									
								
								scripts/conf/subscribe_topic.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								scripts/conf/subscribe_topic.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,57 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
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");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the current topic
 | 
			
		||||
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
on_error = "conf/manage_topic.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
 | 
			
		||||
         + topic.topicNumber;
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get the flag and set the archived status
 | 
			
		||||
  flag = rinput.getParameterInt("flag",0);
 | 
			
		||||
  topic.setSubscribed(flag==1);
 | 
			
		||||
  rc = new Redirect(on_error,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error setting the hide topic
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error setting subscription status: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										125
									
								
								scripts/conf/topics.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										125
									
								
								scripts/conf/topics.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,125 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the community
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
comm = rinput.getCommunity(true,"top.js.vs");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the view option
 | 
			
		||||
view_opt = currc.viewOption;
 | 
			
		||||
if (rinput.hasParameter("view"))
 | 
			
		||||
{ // get the new view option
 | 
			
		||||
  view_opt = rinput.getParameterInt("view",view_opt);
 | 
			
		||||
  if (   (view_opt!=ConferenceContext.DISPLAY_NEW) && (view_opt!=ConferenceContext.DISPLAY_ACTIVE)
 | 
			
		||||
      && (view_opt!=ConferenceContext.DISPLAY_ALL) && (view_opt!=ConferenceContext.DISPLAY_HIDDEN)
 | 
			
		||||
      && (view_opt!=ConferenceContext.DISPLAY_ARCHIVED))
 | 
			
		||||
  { // the view option is invalid
 | 
			
		||||
    vlib.output(new ErrorBox(null,"Invalid view parameter.","conf/conferences.js.vs?cc=" + comm.communityID));
 | 
			
		||||
    vlib.done();
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  currc.viewOption = view_opt;  // save the changed view option
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// get the sort option
 | 
			
		||||
sort_opt = currc.sortOption;
 | 
			
		||||
if (rinput.hasParameter("sort"))
 | 
			
		||||
{ // get and test the new sort option
 | 
			
		||||
  sort_opt = rinput.getParameterInt("sort",sort_opt);
 | 
			
		||||
  tmp_sort = ((sort_opt<0) ? -sort_opt : sort_opt);
 | 
			
		||||
  if (   (tmp_sort!=ConferenceContext.SORT_NUMBER) && (tmp_sort!=ConferenceContext.SORT_NAME)
 | 
			
		||||
      && (tmp_sort!=ConferenceContext.SORT_UNREAD) && (tmp_sort!=ConferenceContext.SORT_TOTAL)
 | 
			
		||||
      && (tmp_sort!=ConferenceContext.SORT_DATE))
 | 
			
		||||
  { // the sort option is invalid
 | 
			
		||||
    vlib.output(new ErrorBox(null,"Invalid sort parameter.","conf/conferences.js.vs?cc=" + comm.communityID));
 | 
			
		||||
    vlib.done();
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  currc.sortOption = sort_opt;  // save the changed sort option
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get the topic list
 | 
			
		||||
  topic_list = conf.getTopicList(view_opt,sort_opt);
 | 
			
		||||
 | 
			
		||||
  // initialize the visit order
 | 
			
		||||
  ord = currc.newTopicVisitOrder(topic_list);
 | 
			
		||||
 | 
			
		||||
  // get the aliases list...
 | 
			
		||||
  aliases = conf.aliases;
 | 
			
		||||
 | 
			
		||||
  // set the attributes we want to carry into the page
 | 
			
		||||
  rinput.setRequestAttribute("topics.list",topic_list);  
 | 
			
		||||
  tmp = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_TOP);
 | 
			
		||||
  if (tmp==null)
 | 
			
		||||
    tmp = "";
 | 
			
		||||
  rinput.setRequestAttribute("conference.custom.top",tmp);
 | 
			
		||||
  tmp = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_BOTTOM);
 | 
			
		||||
  if (tmp==null)
 | 
			
		||||
    tmp = "";
 | 
			
		||||
  rinput.setRequestAttribute("conference.custom.bottom",tmp);
 | 
			
		||||
  if (ord.isNext())
 | 
			
		||||
  { // precalculate the "Read New" link and pass it to the page
 | 
			
		||||
    tmp = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + ord.getNext()
 | 
			
		||||
                                 + "&rnm=1";
 | 
			
		||||
    rinput.setRequestAttribute("conference.readnew",tmp);
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  // create a JSPView to return
 | 
			
		||||
  rc = new JSPView("Topics in " + conf.name,"conf/topics.jsp");
 | 
			
		||||
  rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
  rc.pageQID = "go/" + comm.alias + "!" + aliases.get(0);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // error generating the topic list
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error listing topics: " + e.message,
 | 
			
		||||
                      "conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
  { // they might not be logged in, that's all
 | 
			
		||||
    if (rinput.user.isLoggedIn())
 | 
			
		||||
      rc = new ErrorBox("Access Error",e.message,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
    else
 | 
			
		||||
      rc = new LogInOrCreate();
 | 
			
		||||
 | 
			
		||||
  } // end else if
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										84
									
								
								scripts/conf/upload_attachment.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										84
									
								
								scripts/conf/upload_attachment.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,84 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(java.util);
 | 
			
		||||
importPackage(Packages.com.silverwrist.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.conf);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
 | 
			
		||||
// get the request object
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
 | 
			
		||||
if (rinput.isFileParam("target"))
 | 
			
		||||
{ // the target should be a normal parameter
 | 
			
		||||
  logger.error("Internal Error: 'target' should be a normal param");
 | 
			
		||||
  vlib.output(new ErrorBox(null,"Internal Error: 'target' should be a normal param","top.js.vs"));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// Get the operations target.
 | 
			
		||||
target = rinput.getParameter("target");
 | 
			
		||||
logger.debug("Target URL: " + target);
 | 
			
		||||
rinput.location = target;
 | 
			
		||||
 | 
			
		||||
// also check on file parameter status
 | 
			
		||||
if (!(rinput.isFileParam("thefile")))
 | 
			
		||||
{ // bogus file parameter
 | 
			
		||||
  logger.error("Internal Error: 'thefile' should be a file param");
 | 
			
		||||
  vlib.output(new ErrorBox(null,"Internal Error: 'thefile' should be a file param",target));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// get the community
 | 
			
		||||
comm = rinput.getCommunity(true,target);
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,target);
 | 
			
		||||
 | 
			
		||||
// get the message we're attaching to
 | 
			
		||||
msg = currc.getMessageParam("msg",true,target);
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // do the attachment!
 | 
			
		||||
  msg.attachData(rinput.getParameterType("thefile"),rinput.getParameter("thefile"),
 | 
			
		||||
                 rinput.getParameterSize("thefile"),rinput.getParameterDataStream("thefile"));
 | 
			
		||||
 | 
			
		||||
  // now bounce us where we wanted to go in the first place
 | 
			
		||||
  rc = new Redirect(target,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // failure in setting attachment
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error saving attachment: " + e.message,target);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,target);
 | 
			
		||||
  else if (etype.match("ServletMultipartException"))
 | 
			
		||||
    rc = new ErrorBox("Internal Error",e.message,target);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										56
									
								
								scripts/conf/view_attachment.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								scripts/conf/view_attachment.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,56 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.conf);
 | 
			
		||||
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");
 | 
			
		||||
 | 
			
		||||
// get the current conference
 | 
			
		||||
currc = new CurrentConference(rinput);
 | 
			
		||||
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
 | 
			
		||||
 | 
			
		||||
// get the message we're looking in
 | 
			
		||||
msg = currc.getMessageParam("msg",true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // retrieve the attachment data and send it out
 | 
			
		||||
  if (msg.hasAttachment())
 | 
			
		||||
    rc = new AttachmentContent(msg);
 | 
			
		||||
  else
 | 
			
		||||
    rc = new ErrorBox(null,"This message has no attachment.",null);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // failure in retrieving attachment
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error retrieving attachment: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										214
									
								
								scripts/find.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										214
									
								
								scripts/find.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,214 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
 | 
			
		||||
// Determine which Find display needs to be brought up.
 | 
			
		||||
disp = 0;
 | 
			
		||||
if (rinput.hasParameter("disp"))
 | 
			
		||||
{ // get the display parameter from the input
 | 
			
		||||
  disp = rinput.getParameterInt("disp",-1);
 | 
			
		||||
  if (   (disp!=FindView.FD_COMMUNITIES) && (disp!=FindView.FD_USERS) && (disp!=FindView.FD_CATEGORIES)
 | 
			
		||||
      && (disp!=FindView.FD_POSTS))
 | 
			
		||||
  { // 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));
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else
 | 
			
		||||
{ // get the display parameter from the session attributes
 | 
			
		||||
  tmp_disp = rinput.getSessionAttribute(FindView.DISPLAY_PARAM_ATTRIBUTE);
 | 
			
		||||
  if (tmp_disp==null)
 | 
			
		||||
  { // make a new entry and set it
 | 
			
		||||
    tmp_disp = new java.lang.Integer(FindView.FD_COMMUNITIES);
 | 
			
		||||
    rinput.setSessionAttribute(FindView.DISPLAY_PARAM_ATTRIBUTE,tmp_disp);
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  disp = tmp_disp.intValue();
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
max_results = rinput.engine.getStdNumSearchResults();
 | 
			
		||||
view = new FindView(disp,max_results);   // create the view object
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // set up the category parameter
 | 
			
		||||
  catid = -1;
 | 
			
		||||
  if (disp==FindView.FD_COMMUNITIES)
 | 
			
		||||
    catid = rinput.getParameterInt("cat",-1);
 | 
			
		||||
  
 | 
			
		||||
  try
 | 
			
		||||
  { // prep the view fields
 | 
			
		||||
    if (disp==FindView.FD_COMMUNITIES)
 | 
			
		||||
    { // set the category (which also sets up the subcategory list and contained communities)
 | 
			
		||||
      view.category = rinput.user.getCategoryDescriptor(catid);
 | 
			
		||||
      if (view.category.categoryID>=0)
 | 
			
		||||
      { // fill in the communities that are in this category
 | 
			
		||||
        view.results = rinput.user.getCommunitiesInCategory(view.category,view.offset,max_results);
 | 
			
		||||
        view.findCount = rinput.user.getNumCommunitiesInCategory(view.category);
 | 
			
		||||
 | 
			
		||||
      } // end if
 | 
			
		||||
 | 
			
		||||
      view.field = SearchMode.FIELD_COMMUNITY_NAME;
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
    else if (disp==FindView.FD_USERS)
 | 
			
		||||
      view.field = SearchMode.FIELD_USER_NAME;
 | 
			
		||||
    view.mode = SearchMode.SEARCH_PREFIX;
 | 
			
		||||
    view.term = "";
 | 
			
		||||
    rc = view;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // exception in initializing the view...
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error accessing category data: " + e.message,"top.js.vs");
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
  vlib.output(rc);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if ("GET" operation)
 | 
			
		||||
 | 
			
		||||
// Set up the form for a POST.
 | 
			
		||||
try
 | 
			
		||||
{ // load some of the parameters
 | 
			
		||||
  catid = -1;
 | 
			
		||||
 | 
			
		||||
  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.");
 | 
			
		||||
    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.");
 | 
			
		||||
    view.field = x;
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
  else if (disp==FindView.FD_USERS)
 | 
			
		||||
  { // load the field parameter
 | 
			
		||||
    x = rinput.getParameterInt("field",SearchMode.FIELD_USER_NAME);
 | 
			
		||||
    if (   (x!=SearchMode.FIELD_USER_NAME) && (x!=SearchMode.FIELD_USER_DESCRIPTION)
 | 
			
		||||
        && (x!=SearchMode.FIELD_USER_GIVEN_NAME) && (x!=SearchMode.FIELD_USER_FAMILY_NAME))
 | 
			
		||||
      throw new ValidationException("The search field parameter is not valid.");
 | 
			
		||||
    view.field = x;
 | 
			
		||||
    
 | 
			
		||||
  } // end else if
 | 
			
		||||
 | 
			
		||||
  if (disp!=FindView.FD_POSTS)
 | 
			
		||||
  { // load the search mode parameter
 | 
			
		||||
    x = rinput.getParameterInt("mode",SearchMode.SEARCH_PREFIX);
 | 
			
		||||
    if ((x!=SearchMode.SEARCH_PREFIX) && (x!=SearchMode.SEARCH_SUBSTRING) && (x!=SearchMode.SEARCH_REGEXP))
 | 
			
		||||
      throw new ValidationException("The search mode parameter is not valid.");
 | 
			
		||||
    view.mode = x;
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  // load the search term, offset and find count
 | 
			
		||||
  view.term = rinput.getParameter("term");
 | 
			
		||||
  view.offset = rinput.getParameterInt("ofs",0);
 | 
			
		||||
  view.findCount = rinput.getParameterInt("fcount",-1);
 | 
			
		||||
 | 
			
		||||
  // adjust the offset based on the command button click
 | 
			
		||||
  if (rinput.isImageButtonClicked("search"))
 | 
			
		||||
    view.offset = 0;
 | 
			
		||||
  else if (rinput.isImageButtonClicked("previous"))
 | 
			
		||||
    view.offset = Math.max(view_offset - max_results,0);
 | 
			
		||||
  else if (rinput.isImageButtonClicked("next"))
 | 
			
		||||
    view.offset = view.offset + max_results;
 | 
			
		||||
  else
 | 
			
		||||
    throw new ValidationException("Unable to determine what action triggered the form.");
 | 
			
		||||
 | 
			
		||||
  // run the actual search!
 | 
			
		||||
  if (disp==FindView.FD_COMMUNITIES)
 | 
			
		||||
  { // need to work it differently if there's a category ID
 | 
			
		||||
    if (catid>=0)
 | 
			
		||||
    { // set up the category
 | 
			
		||||
      view.category = rinput.user.getCategoryDescriptor(catid);
 | 
			
		||||
      if (view.category.categoryID>=0)
 | 
			
		||||
      { // fill in the communities that are in this category
 | 
			
		||||
        view.results = rinput.user.getCommunitiesInCategory(view.category,view.offset,max_results);
 | 
			
		||||
        view.findCount = rinput.user.getNumCommunitiesInCategory(view.category);
 | 
			
		||||
 | 
			
		||||
      } // end if
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
    else
 | 
			
		||||
    { // set the results as the community search data
 | 
			
		||||
      view.results = rinput.user.searchForCommunities(view.field,view.mode,view.term,view.offset,max_results);
 | 
			
		||||
      if (view.findCount<0)
 | 
			
		||||
        view.findCount = rinput.user.getSearchCommunityCount(view.field,view.mode,view.term);
 | 
			
		||||
 | 
			
		||||
    } // end else
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
  else if (disp==FindView.FD_USERS)
 | 
			
		||||
  { // search for users
 | 
			
		||||
    view.results = rinput.engine.searchForUsers(view.field,view.mode,view.term,view.offset,max_results);
 | 
			
		||||
    if (view.findCount<0)
 | 
			
		||||
      view.findCount = rinput.engine.getSearchUserCount(view.field,view.mode,view.term);
 | 
			
		||||
 | 
			
		||||
  } // end else if
 | 
			
		||||
  else if (disp==FindView.FD_CATEGORIES)
 | 
			
		||||
  { // search for categories
 | 
			
		||||
    view.results = rinput.user.searchForCategories(view.mode,view.term,view.offset,max_results);
 | 
			
		||||
    if (view.findCount<0)
 | 
			
		||||
      view.findCount = rinput.user.getSearchCategoryCount(view.mode,view.term);
 | 
			
		||||
 | 
			
		||||
  } // end else if
 | 
			
		||||
  else if (disp==FindView.FD_POSTS)
 | 
			
		||||
  { // search for posts
 | 
			
		||||
    view.results = rinput.user.searchPosts(view.term,view.offset,max_results);
 | 
			
		||||
    if (view.findCount<0)
 | 
			
		||||
      view.findCount = rinput.user.getSearchPostCount(view.term);
 | 
			
		||||
 | 
			
		||||
  } // end else if
 | 
			
		||||
 | 
			
		||||
  rinput.location = "find.js.vs?disp=" + disp;  // reset location for the POST
 | 
			
		||||
  rc = view;
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // exception thrown somewhere in the POST operation
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("ValidationException"))
 | 
			
		||||
    rc = new ErrorBox("Find Error",e.message,"top.js.vs");
 | 
			
		||||
  else if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error on find: " + e.message,"top.js.vs");
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										137
									
								
								scripts/login.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										137
									
								
								scripts/login.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,137 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.dlg);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
 | 
			
		||||
// Get the request object and the target URI.
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
target = rinput.getParameter("tgt");
 | 
			
		||||
if (target==null)
 | 
			
		||||
  target = "top.js.vs";
 | 
			
		||||
 | 
			
		||||
// If the user is already logged in, this script is a no-op - just bounce to the specified target.
 | 
			
		||||
user = rinput.user;
 | 
			
		||||
if (user.isLoggedIn())
 | 
			
		||||
{ // user already logged in - just bail on this
 | 
			
		||||
  vlib.output(new Redirect(target,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
dlg = rinput.getDialog("login");
 | 
			
		||||
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // display the dialog and have done with it
 | 
			
		||||
  dlg.setValue("tgt",target);
 | 
			
		||||
  rinput.location = target;
 | 
			
		||||
  vlib.output(dlg);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// everything that follows is for a POST operation
 | 
			
		||||
op = dlg.whichButton(rinput) + "";
 | 
			
		||||
if (op=="cancel")
 | 
			
		||||
{ // user cancelled login - bounce back to the target
 | 
			
		||||
  vlib.output(new Redirect(target,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
dlg.load(rinput);        // load the dialog parameters
 | 
			
		||||
rc = null;               // return from this script
 | 
			
		||||
if (op=="remind")
 | 
			
		||||
{ // send the login reminder
 | 
			
		||||
  try
 | 
			
		||||
  { // perform the reminder operation
 | 
			
		||||
    rinput.engine.sendPasswordReminder(dlg.getValue("user"));
 | 
			
		||||
 | 
			
		||||
    // recycle the dialog and output it again
 | 
			
		||||
    dlg.setErrorMessage("Password reminder has been sent to your e-mail address.");
 | 
			
		||||
    dlg.setValue("pass",null);
 | 
			
		||||
    rinput.location = target;
 | 
			
		||||
    rc = dlg;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // caught an exception here - what do we do about it?
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error finding user: " + e.getMessage(),target);
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("User E-mail Address Not Found",e.getMessage(),target);
 | 
			
		||||
    else if (etype.match("EmailException"))
 | 
			
		||||
      rc = new ErrorBox("E-mail Error","E-mail error sending reminder: " + e.getMessage(),target);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else if (op=="login")
 | 
			
		||||
{ // actually log in!
 | 
			
		||||
  try
 | 
			
		||||
  { // authenticate the user
 | 
			
		||||
    user.authenticate(dlg.getValue("user"),dlg.getValue("pass"));
 | 
			
		||||
 | 
			
		||||
    logger.debug("User \"" + user.userName + "\" logged in successfully");
 | 
			
		||||
 | 
			
		||||
    // If the user wants a cookie, give it to them!
 | 
			
		||||
    if (dlg.getValue("saveme").booleanValue())
 | 
			
		||||
      rinput.savePersistentCookie(RequestInput.LOGIN_COOKIE,user.getAuthenticationToken(),
 | 
			
		||||
                                  RequestInput.LOGIN_COOKIE_AGE);
 | 
			
		||||
 | 
			
		||||
    // Clear the left menus (to force recomputation) and bounce us back to whereever we were
 | 
			
		||||
    // supposed to go.
 | 
			
		||||
    logger.debug("Ready to bounce to \"" + target + "\"");
 | 
			
		||||
    rinput.setSessionAttribute(RequestInput.LEFT_MENU_SESSION_ATTR,null);
 | 
			
		||||
    if (user.isEmailVerified())
 | 
			
		||||
      rc = new Redirect(target,LinkTypes.SERVLET);
 | 
			
		||||
    else  // jump to the Verify dialog before we do anything else
 | 
			
		||||
      rc = new Redirect("verify_email.js.vs?tgt=" + vlib.encodeURL(target),LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // caught an exception here - what do we do about it?
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error logging in: " + e.message,target);
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
    { // this indicates a problem with the user account or password
 | 
			
		||||
      dlg.setErrorMessage(e.message);
 | 
			
		||||
      dlg.setValue("pass",null);
 | 
			
		||||
      rinput.location = target;
 | 
			
		||||
      rc = dlg;
 | 
			
		||||
 | 
			
		||||
    } // end else if
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end else if
 | 
			
		||||
else
 | 
			
		||||
{ // unknown button pressed!
 | 
			
		||||
  logger.error("no known button click on POST to login.js");
 | 
			
		||||
  rc = new ErrorBox("Internal Error","Unknown command button pressed",target);
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										41
									
								
								scripts/logout.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								scripts/logout.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,41 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
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 target URI.
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
target = rinput.getParameter("tgt");
 | 
			
		||||
if (target==null)
 | 
			
		||||
  target = "top.js.vs";
 | 
			
		||||
 | 
			
		||||
// If the user is not logged in, this script is a no-op - just bounce to the specified target.
 | 
			
		||||
user = rinput.user;
 | 
			
		||||
if (user.isLoggedIn())
 | 
			
		||||
{ // user is logged in - we want to log out
 | 
			
		||||
  // TODO: only remove the login cookie if it was actually set!
 | 
			
		||||
  rinput.deleteCookie(RequestInput.LOGIN_COOKIE);    // remove the login cookie
 | 
			
		||||
  rinput.replaceUser(null);                          // no more user context
 | 
			
		||||
  rinput.setSessionAttribute(RequestInput.LEFT_MENU_SESSION_ATTR,null);  // and clear menus too
 | 
			
		||||
 | 
			
		||||
  target = "top.js.vs";  // take 'em back to the top
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
vlib.output(new Redirect(target,LinkTypes.SERVLET));  // do the redirect!
 | 
			
		||||
							
								
								
									
										47
									
								
								scripts/new_account.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								scripts/new_account.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,47 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// Get the request object and the target URI.
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
target = rinput.getParameter("tgt");
 | 
			
		||||
if (target==null)
 | 
			
		||||
  target = "top.js.vs";
 | 
			
		||||
 | 
			
		||||
// If the user is already logged in, this is an error.
 | 
			
		||||
user = rinput.user;
 | 
			
		||||
if (user.isLoggedIn())
 | 
			
		||||
{ // user already logged in - just bail on this
 | 
			
		||||
  vlib.output(new ErrorBox(null,"You cannot create a new account while logged in on an existing one. "
 | 
			
		||||
	                   + "You must log out first.",target));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// Return the text of the User Agreement.
 | 
			
		||||
rinput.displayLogin = false;
 | 
			
		||||
rc = new TextMessage(rinput.getStockMessage("user-agreement-title"),
 | 
			
		||||
                     rinput.getStockMessage("user-agreement-subtitle"));
 | 
			
		||||
rc.text = rinput.getStockMessage("user-agreement");
 | 
			
		||||
rc.addButton(LinkTypes.SERVLET,"new_account_2.js.vs?tgt=" + vlib.encodeURL(target),"ua_accept");
 | 
			
		||||
rc.addButton(LinkTypes.SERVLET,"top.js.vs","ua_decline");
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										146
									
								
								scripts/new_account_2.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										146
									
								
								scripts/new_account_2.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,146 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.dlg);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
 | 
			
		||||
// Get the request object and the target URI.
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
target = rinput.getParameter("tgt");
 | 
			
		||||
if (target==null)
 | 
			
		||||
  target = "top.js.vs";
 | 
			
		||||
 | 
			
		||||
// If the user is already logged in, this is an error.
 | 
			
		||||
user = rinput.user;
 | 
			
		||||
if (user.isLoggedIn())
 | 
			
		||||
{ // user already logged in - just bail on this
 | 
			
		||||
  vlib.output(new ErrorBox(null,"You cannot create a new account while logged in on an existing one. "
 | 
			
		||||
	                   + "You must log out first.",target));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// create the new account dialog
 | 
			
		||||
dlg = rinput.getDialog("newacct");
 | 
			
		||||
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // display the dialog and have done with it
 | 
			
		||||
  dlg.setValue("tgt",target);
 | 
			
		||||
  rinput.location = target;
 | 
			
		||||
  rinput.displayLogin = false;
 | 
			
		||||
  vlib.output(dlg);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// everything that follows is for a POST operation
 | 
			
		||||
op = dlg.whichButton(rinput) + "";
 | 
			
		||||
if (op=="cancel")
 | 
			
		||||
{ // user cancelled create - bounce back to the target
 | 
			
		||||
  vlib.output(new Redirect(target,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if (op=="create")
 | 
			
		||||
{ // we actually want to create the new account
 | 
			
		||||
  dlg.load(rinput);
 | 
			
		||||
 | 
			
		||||
  try
 | 
			
		||||
  { // start by validating the dialog
 | 
			
		||||
    dlg.validate();
 | 
			
		||||
 | 
			
		||||
    // validate a couple of other issues
 | 
			
		||||
    if (!(dlg.getValue("pass1").equals(dlg.getValue("pass2"))))
 | 
			
		||||
      throw new ValidationException("The typed passwords do not match.");
 | 
			
		||||
    if (rinput.engine.isEmailAddressBanned(dlg.getValue("email")))
 | 
			
		||||
      throw new ValidationException("This email address may not register a new account.");
 | 
			
		||||
 | 
			
		||||
    // Create the new user account and set up its initial context.
 | 
			
		||||
    uc = rinput.engine.createNewAccount(rinput.sourceAddress,dlg.getValue("user"),dlg.getValue("pass1"),
 | 
			
		||||
                                        dlg.getValue("remind"));
 | 
			
		||||
 | 
			
		||||
    // Set up the account's contact info.
 | 
			
		||||
    ci = uc.getContactInfo();
 | 
			
		||||
    ci.namePrefix = dlg.getValue("prefix");
 | 
			
		||||
    ci.givenName = dlg.getValue("first");
 | 
			
		||||
    blort = dlg.getValue("mid") + "";
 | 
			
		||||
    if (blort.length<1)
 | 
			
		||||
      ci.middleInitial = " ";
 | 
			
		||||
    else
 | 
			
		||||
      ci.middleInitial = blort.substring(0,1);
 | 
			
		||||
    ci.familyName = dlg.getValue("last");
 | 
			
		||||
    ci.nameSuffix = dlg.getValue("suffix");
 | 
			
		||||
    ci.locality = dlg.getValue("loc");
 | 
			
		||||
    ci.region = dlg.getValue("reg");
 | 
			
		||||
    ci.postalCode = dlg.getValue("pcode");
 | 
			
		||||
    ci.country = dlg.getValue("country");
 | 
			
		||||
    ci.email = dlg.getValue("email");
 | 
			
		||||
 | 
			
		||||
    // save the contact info for the user (this also sends email confirmation messages as needed)
 | 
			
		||||
    uc.putContactInfo(ci);
 | 
			
		||||
 | 
			
		||||
    rinput.replaceUser(uc);   // this is now the user for this session!
 | 
			
		||||
 | 
			
		||||
    // Now bounce us immediately to the Verification dialog.
 | 
			
		||||
    rc = new Redirect("verify_email.js.vs?tgt=" + vlib.encodeURL(target),LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // we caught some sort of exception...but what is it?
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("ValidationException"))
 | 
			
		||||
    { // put the dialog back up on a validation error
 | 
			
		||||
      dlg.setErrorMessage(e.message + " Please try again.");
 | 
			
		||||
      dlg.setValue("pass1",null);
 | 
			
		||||
      dlg.setValue("pass2",null);
 | 
			
		||||
      rinput.location = target;
 | 
			
		||||
      rinput.displayLogin = false;
 | 
			
		||||
      rc = dlg;
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error creating account: " + e.message,target);
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
    { // put the dialog back up on an access error
 | 
			
		||||
      dlg.setErrorMessage(e.message);
 | 
			
		||||
      dlg.setValue("pass1",null);
 | 
			
		||||
      dlg.setValue("pass2",null);
 | 
			
		||||
      rinput.location = target;
 | 
			
		||||
      rinput.displayLogin = false;
 | 
			
		||||
      rc = dlg;
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
    else if (etype.match("EmailException"))
 | 
			
		||||
      rc = new ErrorBox("E-mail Error","E-mail error creating account: " + e.message,target);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else
 | 
			
		||||
{ // no dialog present
 | 
			
		||||
  logger.error("no known button click on POST to new_account_2.js");
 | 
			
		||||
  rc = new ErrorBox("Internal Error","Unknown command button pressed",target);
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										223
									
								
								scripts/profile.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										223
									
								
								scripts/profile.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,223 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.core);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.except);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.dlg);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
 | 
			
		||||
// Get the request object and the target URI.
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
target = rinput.getParameter("tgt");
 | 
			
		||||
if (target==null)
 | 
			
		||||
  target = "top.js.vs";
 | 
			
		||||
 | 
			
		||||
// If the user is not logged in, this is an error.
 | 
			
		||||
user = rinput.user;
 | 
			
		||||
if (!(user.isLoggedIn()))
 | 
			
		||||
{ // user not logged in - just bail on this
 | 
			
		||||
  vlib.output(new ErrorBox(null,"You must log in before you can modify the profile on your account."));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
dlg = rinput.getDialog("profile");
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // set up the dialog
 | 
			
		||||
  dlg.setValue("tgt",target);
 | 
			
		||||
 | 
			
		||||
  try
 | 
			
		||||
  { // pull the user data...
 | 
			
		||||
    ci = user.getContactInfo();   // get the main contact info
 | 
			
		||||
    props = user.properties;      // get the properties
 | 
			
		||||
 | 
			
		||||
    dlg.setEnabled("photo",ci.canSetPhoto());
 | 
			
		||||
    dlg.setValue("prefix",ci.namePrefix);
 | 
			
		||||
    dlg.setValue("first",ci.givenName);
 | 
			
		||||
    if (ci.middleInitial!=' ')
 | 
			
		||||
      dlg.setValue("mid",String.fromCharCode(ci.middleInitial));
 | 
			
		||||
    dlg.setValue("last",ci.familyName);
 | 
			
		||||
    dlg.setValue("suffix",ci.nameSuffix);
 | 
			
		||||
    dlg.setValue("company",ci.company);
 | 
			
		||||
    dlg.setValue("addr1",ci.addressLine1);
 | 
			
		||||
    dlg.setValue("addr2",ci.addressLine2);
 | 
			
		||||
    if (ci.privateAddress)
 | 
			
		||||
      dlg.setValue("pvt_addr",1);
 | 
			
		||||
    dlg.setValue("loc",ci.locality);
 | 
			
		||||
    dlg.setValue("reg",ci.region);
 | 
			
		||||
    dlg.setValue("pcode",ci.postalCode);
 | 
			
		||||
    dlg.setValue("country",ci.country);
 | 
			
		||||
    dlg.setValue("phone",ci.phone);
 | 
			
		||||
    dlg.setValue("mobile",ci.mobile);
 | 
			
		||||
    if (ci.privatePhone)
 | 
			
		||||
      dlg.setValue("pvt_phone",1);
 | 
			
		||||
    dlg.setValue("fax",ci.fax);
 | 
			
		||||
    if (ci.privateFax)
 | 
			
		||||
      dlg.setValue("pvt_fax",1);
 | 
			
		||||
    dlg.setValue("email",ci.email);
 | 
			
		||||
    if (ci.privateEmail)
 | 
			
		||||
      dlg.setValue("pvt_email",1);
 | 
			
		||||
    dlg.setValue("url",ci.URL);
 | 
			
		||||
    dlg.setValue("descr",user.description);
 | 
			
		||||
    dlg.setValue("photo",ci.photoURL);
 | 
			
		||||
    dlg.sendMessage("photo","setLinkURL","profile_photo.js.vs?tgt=" + vlib.encodeURL(target));
 | 
			
		||||
    if (props.displayPostPictures)
 | 
			
		||||
      dlg.setValue("pic_in_post",1);
 | 
			
		||||
    if (props.massMailOptOut)
 | 
			
		||||
      dlg.setValue("no_mass_mail",1);
 | 
			
		||||
    dlg.setValue("locale",user.locale);
 | 
			
		||||
    dlg.setValue("tz",user.timeZone);
 | 
			
		||||
    rinput.displayLogin = false;
 | 
			
		||||
    rc = dlg;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // exception setting up the dialog
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error retrieving profile: " + e.message,target);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
  vlib.output(rc);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// everything that follows is for a POST operation
 | 
			
		||||
op = dlg.whichButton(rinput) + "";
 | 
			
		||||
if (op=="cancel")
 | 
			
		||||
{ // user cancelled profile update - bounce back to the target
 | 
			
		||||
  vlib.output(new Redirect(target,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
dlg.load(rinput);        // load the dialog parameters
 | 
			
		||||
 | 
			
		||||
if (op=="update")
 | 
			
		||||
{ // attempt to update the user profile
 | 
			
		||||
  try
 | 
			
		||||
  { // start by validating the dialog
 | 
			
		||||
    dlg.validate();   // validate the dialog
 | 
			
		||||
 | 
			
		||||
    // check the passwords
 | 
			
		||||
    pass1 = dlg.getValue("pass1") + "";
 | 
			
		||||
    pass2 = dlg.getValue("pass2") + "";
 | 
			
		||||
 | 
			
		||||
    if (vlib.emptyString(pass1))
 | 
			
		||||
    { // empty must match empty
 | 
			
		||||
      if (!(vlib.emptyString(pass2)))
 | 
			
		||||
	throw new ValidationException("The typed passwords do not match.");
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
    else
 | 
			
		||||
    { // the two passwords must match
 | 
			
		||||
      if (pass1!=pass2)
 | 
			
		||||
	throw new ValidationException("The typed passwords do not match.");
 | 
			
		||||
 | 
			
		||||
    } // end else
 | 
			
		||||
 | 
			
		||||
    ci = user.getContactInfo();   // get the main contact info
 | 
			
		||||
    props = user.properties;      // get the properties
 | 
			
		||||
 | 
			
		||||
    // Reset the contact info fields.
 | 
			
		||||
    ci.namePrefix = dlg.getValue("prefix");
 | 
			
		||||
    ci.givenName = dlg.getValue("first");
 | 
			
		||||
    blort = dlg.getValue("mid") + "";
 | 
			
		||||
    if (blort.length<1)
 | 
			
		||||
      ci.middleInitial = " ";
 | 
			
		||||
    else
 | 
			
		||||
      ci.middleInitial = blort.substring(0,1);
 | 
			
		||||
    ci.familyName = dlg.getValue("last");
 | 
			
		||||
    ci.nameSuffix = dlg.getValue("suffix");
 | 
			
		||||
    ci.company = dlg.getValue("company");
 | 
			
		||||
    ci.addressLine1 = dlg.getValue("addr1");
 | 
			
		||||
    ci.addressLine2 = dlg.getValue("addr2");
 | 
			
		||||
    ci.privateAddress = dlg.getValue("pvt_addr").booleanValue();
 | 
			
		||||
    ci.locality = dlg.getValue("loc");
 | 
			
		||||
    ci.region = dlg.getValue("reg");
 | 
			
		||||
    ci.postalCode = dlg.getValue("pcode");
 | 
			
		||||
    ci.country = dlg.getValue("country");
 | 
			
		||||
    ci.phone = dlg.getValue("phone");
 | 
			
		||||
    ci.mobile = dlg.getValue("mobile");
 | 
			
		||||
    ci.privatePhone = dlg.getValue("pvt_phone").booleanValue();
 | 
			
		||||
    ci.fax = dlg.getValue("fax");
 | 
			
		||||
    ci.privateFax = dlg.getValue("pvt_fax").booleanValue();
 | 
			
		||||
    ci.email = dlg.getValue("email");
 | 
			
		||||
    ci.privateEmail = dlg.getValue("pvt_email").booleanValue();
 | 
			
		||||
    ci.URL = dlg.getValue("url");
 | 
			
		||||
 | 
			
		||||
    // Store the completed contact info.
 | 
			
		||||
    need_verify = user.putContactInfo(ci);
 | 
			
		||||
 | 
			
		||||
    // Save off the properties.
 | 
			
		||||
    props.displayPostPictures = dlg.getValue("pic_in_post").booleanValue();
 | 
			
		||||
    props.massMailOptOut = dlg.getValue("no_mass_mail").booleanValue();
 | 
			
		||||
    user.properties = props;
 | 
			
		||||
 | 
			
		||||
    // Save off the user's description and preferences.
 | 
			
		||||
    user.description = dlg.getValue("descr");
 | 
			
		||||
    user.locale = dlg.getValue("locale");
 | 
			
		||||
    user.timeZone = dlg.getValue("tz");
 | 
			
		||||
 | 
			
		||||
    // Finally, change the password if applicable.
 | 
			
		||||
    if (!(vlib.emptyString(pass1)))
 | 
			
		||||
      user.setPassword(pass1,dlg.getValue("remind"));
 | 
			
		||||
 | 
			
		||||
    // Bounce back to our desired target.
 | 
			
		||||
    if (need_verify)
 | 
			
		||||
      rc = new Redirect("verify_email.js.vs?tgt=" + vlib.encodeURL(target),LinkTypes.SERVLET);
 | 
			
		||||
    else
 | 
			
		||||
      rc = new Redirect(target,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // exception changing the user profile
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("ValidationException"))
 | 
			
		||||
    { // redisplay the dialog on validation error
 | 
			
		||||
      dlg.setErrorMessage(e.message + " Please try again.");
 | 
			
		||||
      dlg.setEnabled("photo",user.canSetUserPhoto());
 | 
			
		||||
      dlg.setValue("pass1",null);
 | 
			
		||||
      dlg.setValue("pass2",null);
 | 
			
		||||
      rinput.displayLogin = false;
 | 
			
		||||
      rc = dlg;
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error updating profile: " + e.message,target);
 | 
			
		||||
    else if (etype.match("EmailException"))
 | 
			
		||||
      rc = new ErrorBox("E-mail Error","E-mail error sending confirmation: " + e.message,target);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else
 | 
			
		||||
{ // unknown button pressed...
 | 
			
		||||
  logger.error("no known button click on POST to profile.js");
 | 
			
		||||
  rc = new ErrorBox("Internal Error","Unknown command button pressed",target);
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);   // all done!
 | 
			
		||||
							
								
								
									
										137
									
								
								scripts/profile_photo.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										137
									
								
								scripts/profile_photo.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,137 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importClass(java.awt.Dimension);
 | 
			
		||||
importPackage(Packages.com.silverwrist.util);
 | 
			
		||||
importPackage(Packages.com.silverwrist.util.image);
 | 
			
		||||
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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// Get the request object and the target URI.
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
target = rinput.getParameter("tgt");
 | 
			
		||||
if (target==null)
 | 
			
		||||
  target = "top.js.vs";
 | 
			
		||||
 | 
			
		||||
// If the user is not logged in, this is an error.
 | 
			
		||||
user = rinput.user;
 | 
			
		||||
if (!(user.isLoggedIn()))
 | 
			
		||||
{ // user not logged in - just bail on this
 | 
			
		||||
  vlib.output(new ErrorBox(null,"You must log in before you can modify the profile on your account."));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // create a PhotoUploader to do the photo uploading
 | 
			
		||||
  try
 | 
			
		||||
  { // create and initialize the PhotoUploader
 | 
			
		||||
    rc = new PhotoUploader("Upload User Photo","profile_photo.js.vs",LinkTypes.SERVLET);
 | 
			
		||||
    rc.addHiddenParameter("tgt",target);
 | 
			
		||||
    rc.photoTag = rinput.getUserPhotoTag(user.getContactInfo().photoURL);
 | 
			
		||||
    rc.label = "New user photo";
 | 
			
		||||
    rinput.displayLogin = false;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // an exception in the output...
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error generating display: " + e.message,target);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
  vlib.output(rc);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// If the cancel button was clicked, bounce out of here.
 | 
			
		||||
if (rinput.isImageButtonClicked("cancel"))
 | 
			
		||||
{ // user elected to cancel upload - bounce us out of here
 | 
			
		||||
  vlib.output(new Redirect("profile.js.vs?tgt=" + vlib.encodeURL(target),LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (rinput.isImageButtonClicked("upload"))
 | 
			
		||||
{ // do some shorts-checking in the parameters
 | 
			
		||||
  if (!(rinput.isFileParam("thepic")))
 | 
			
		||||
  { // bogus file parameter
 | 
			
		||||
    logger.error("Internal Error: 'thepic' should be a file param");
 | 
			
		||||
    vlib.output(new ErrorBox(null,"Internal Error: 'thepic' should be a file param",
 | 
			
		||||
			     "profile.js.vs?tgt=" + vlib.encodeURL(target)));
 | 
			
		||||
    vlib.done();
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  mimetype = rinput.getParameterType("thepic") + "";
 | 
			
		||||
  if (!(mimetype.match("image/")))
 | 
			
		||||
  { // not an image file type that got uploaded
 | 
			
		||||
    logger.error("Error: 'thepic' not an image type");
 | 
			
		||||
    vlib.output(new ErrorBox(null,"You did not upload an image file.  Try again.",
 | 
			
		||||
                             "profile_photo.js.vs?tgt=" + vlib.encodeURL(target)));
 | 
			
		||||
    vlib.done();
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  try
 | 
			
		||||
  { // normalize the photo to 100x100 pixels
 | 
			
		||||
    real_pic = ImageNormalizer.normalizeImage(rinput.getParameterDataStream("thepic"),
 | 
			
		||||
                                              rinput.engine.getUserPhotoSize(),"jpeg");
 | 
			
		||||
 | 
			
		||||
    // set the user photo data!
 | 
			
		||||
    ci = user.getContactInfo();
 | 
			
		||||
    ci.setPhotoData(rinput.contextPath + "/imagedata/","image/jpeg",real_pic.length,real_pic.data);
 | 
			
		||||
    user.putContactInfo(ci);
 | 
			
		||||
 | 
			
		||||
    // Jump back to the profile form.
 | 
			
		||||
    rc = new Redirect("profile.js.vs?tgt=" + vlib.encodeURL(target),LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // exception while setting user photo
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("ServletMultipartException"))
 | 
			
		||||
      rc = new ErrorBox(null,"Internal Error: " + e.message,"profile.js.vs?tgt=" + vlib.encodeURL(target));
 | 
			
		||||
    else if (etype.match("ImageNormalizerException"))
 | 
			
		||||
      rc = new ErrorBox(null,e.message,"profile_photo.js.vs?tgt=" + vlib.encodeURL(target));
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error storing user photo: " + e.message,
 | 
			
		||||
			"profile.js.vs?tgt=" + vlib.encodeURL(target));
 | 
			
		||||
    else if (etype.match("EmailException"))
 | 
			
		||||
      rc = new ErrorBox(null,"Internal Error: " + e.message,"profile.js.vs?tgt=" + vlib.encodeURL(target));
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else
 | 
			
		||||
{ // don't know the command button!
 | 
			
		||||
  logger.error("no known button click on POST to profile_photo.js");
 | 
			
		||||
  rc = new ErrorBox("Internal Error","Unknown command button pressed",
 | 
			
		||||
                    "profile.js.vs?tgt=" + vlib.encodeURL(target));
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);   // all done!
 | 
			
		||||
							
								
								
									
										62
									
								
								scripts/quick_email.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								scripts/quick_email.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,62 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
 | 
			
		||||
to_uid = rinput.getParameterInt("to_uid",-1);
 | 
			
		||||
if (to_uid<=0)
 | 
			
		||||
{ // the user ID is not present
 | 
			
		||||
  vlib.output(new ErrorBox(null,"Invalid user ID parameter.",null));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
on_error = "top.js.vs";
 | 
			
		||||
try
 | 
			
		||||
{ // retrieve the user profile
 | 
			
		||||
  prof = rinput.user.getProfile(to_uid);
 | 
			
		||||
  on_error = "user/" + prof.userName;
 | 
			
		||||
  logger.debug("sending quick email message to " + prof.userName);
 | 
			
		||||
 | 
			
		||||
  // send the actual E-mail message
 | 
			
		||||
  prof.sendQuickEmail(rinput.getParameter("subj"),rinput.getParameter("pb"));
 | 
			
		||||
 | 
			
		||||
  // redirect to the user profile page
 | 
			
		||||
  rc = new Redirect("user/" + prof.userName,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // determine what to do with an exception
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error sending message: " + e.message,on_error);
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,on_error);
 | 
			
		||||
  else if (etype.match("EmailException"))
 | 
			
		||||
    rc = new ErrorBox("E-Mail Error","Error sending e-mail: " + e.message,on_error);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										107
									
								
								scripts/showuser.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										107
									
								
								scripts/showuser.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,107 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object and the username
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
username = rinput.getRequestAttribute("username");
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // retrieve the user profile and save it off
 | 
			
		||||
  prof = rinput.user.getProfile(username);
 | 
			
		||||
  rinput.setRequestAttribute("profile",prof);
 | 
			
		||||
 | 
			
		||||
  // determine the full name of the user and save it off
 | 
			
		||||
  buf = new java.lang.StringBuffer(prof.givenName);
 | 
			
		||||
  if (!(vlib.emptyString(prof.namePrefix)))
 | 
			
		||||
  { // insert the prefix at the beginning of the string
 | 
			
		||||
    buf.insert(0," ");
 | 
			
		||||
    buf.insert(0,prof.namePrefix);
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  tmp = String.fromCharCode(prof.middleInitial);
 | 
			
		||||
  if (tmp!=" ")
 | 
			
		||||
  { // append the middle initial
 | 
			
		||||
    buf.append(" ");
 | 
			
		||||
    buf.append(tmp);
 | 
			
		||||
    buf.append(".");
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  buf.append(" ");
 | 
			
		||||
  buf.append(prof.familyName);
 | 
			
		||||
  if (!(vlib.emptyString(prof.nameSuffix)))
 | 
			
		||||
  { // append the name suffix
 | 
			
		||||
    buf.append(" ");
 | 
			
		||||
    buf.append(prof.nameSuffix);
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  rinput.setRequestAttribute("fullname",buf.toString());
 | 
			
		||||
 | 
			
		||||
  // determine the last line of the address and save it off
 | 
			
		||||
  if (vlib.emptyString(prof.locality))
 | 
			
		||||
  { // allocate stringbuffer based on region
 | 
			
		||||
    if (vlib.emptyString(prof.region))
 | 
			
		||||
      buf = new java.lang.StringBuffer();
 | 
			
		||||
    else
 | 
			
		||||
      buf = new java.lang.StringBuffer(prof.region);
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
  else if (vlib.emptyString(prof.region))
 | 
			
		||||
    buf = new java.lang.StringBuffer(prof.locality);
 | 
			
		||||
  else
 | 
			
		||||
  { // tack together both locality and region
 | 
			
		||||
    buf = new java.lang.StringBuffer(prof.locality);
 | 
			
		||||
    buf.append(", ");
 | 
			
		||||
    buf.append(prof.region);
 | 
			
		||||
 | 
			
		||||
  } // end else
 | 
			
		||||
 | 
			
		||||
  if (!(vlib.emptyString(prof.postalCode)))
 | 
			
		||||
  { // append the postal code
 | 
			
		||||
    buf.append(" ");
 | 
			
		||||
    buf.append(prof.postalCode);
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  rinput.setRequestAttribute("address.lastline",buf.toString());
 | 
			
		||||
 | 
			
		||||
  // Save off the user photo tag.
 | 
			
		||||
  rinput.setRequestAttribute("user.photo",rinput.getUserPhotoTag(prof.photoURL));
 | 
			
		||||
 | 
			
		||||
  // Create a view object and send it out.
 | 
			
		||||
  rc = new JSPView("User Profile - " + username,"user_profile.jsp");
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // handle an exception thrown by the profile code
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error finding user: " + e.message,"top.js.vs");
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										59
									
								
								scripts/sysadmin/audit.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								scripts/sysadmin/audit.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,59 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // get the admin interface
 | 
			
		||||
  adm = rinput.user.adminInterface;
 | 
			
		||||
 | 
			
		||||
  // read off the offset parameter
 | 
			
		||||
  offset = rinput.getParameterInt("ofs",0);
 | 
			
		||||
  
 | 
			
		||||
  // generate the audit lists
 | 
			
		||||
  audit_list = adm.getAuditRecords(offset,rinput.engine.getNumAuditRecordsPerPage());
 | 
			
		||||
  audit_count = adm.getAuditRecordCount();
 | 
			
		||||
 | 
			
		||||
  // output the audit data view
 | 
			
		||||
  rc = new AuditView(rinput.engine,audit_list,offset,audit_count,"System Audit Records",
 | 
			
		||||
		     "sysadmin/audit.js.vs?ofs=${offset}","sysadmin/menu.js.vs",
 | 
			
		||||
                     "Return to System Administration Menu");
 | 
			
		||||
  rc.menuSelector = Content.MENU_SELECTOR_NOCHANGE;
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // display an error
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error getting audit records: " + e.message,
 | 
			
		||||
                      "sysadmin/menu.js.vs");
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error",e.message,"sysadmin/menu.js.vs");
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										96
									
								
								scripts/sysadmin/find_user.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										96
									
								
								scripts/sysadmin/find_user.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,96 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
 | 
			
		||||
if (!(rinput.user.hasAdminAccess()))
 | 
			
		||||
{ // no admin access - we can't do this
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You do not have permission to administer the system.",null));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// Create the new view.
 | 
			
		||||
view = new AdminFindUserView(rinput.engine.getStdNumSearchResults());
 | 
			
		||||
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // initialize the field, mode, and term and do the search
 | 
			
		||||
  view.field = SearchMode.FIELD_USER_NAME;
 | 
			
		||||
  view.mode = SearchMode.SEARCH_PREFIX;
 | 
			
		||||
  view.term = "";
 | 
			
		||||
  vlib.output(view);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// everything here on is for a POST
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // load the search field parameter
 | 
			
		||||
  x = rinput.getParameterInt("field",SearchMode.FIELD_USER_NAME);
 | 
			
		||||
  if (   (x!=SearchMode.FIELD_USER_NAME) && (x!=SearchMode.FIELD_USER_DESCRIPTION)
 | 
			
		||||
      && (x!=SearchMode.FIELD_USER_GIVEN_NAME) && (x!=SearchMode.FIELD_USER_FAMILY_NAME))
 | 
			
		||||
    throw new ValidationException("The search field parameter is not valid.");
 | 
			
		||||
  view.field = x;
 | 
			
		||||
 | 
			
		||||
  // load the search mode parameter    
 | 
			
		||||
  x = rinput.getParameterInt("mode",SearchMode.SEARCH_PREFIX);
 | 
			
		||||
  if ((x!=SearchMode.SEARCH_PREFIX) && (x!=SearchMode.SEARCH_SUBSTRING) && (x!=SearchMode.SEARCH_REGEXP))
 | 
			
		||||
    throw new ValidationException("The search mode parameter is not valid.");
 | 
			
		||||
  view.mode = x;
 | 
			
		||||
 | 
			
		||||
  // load the search term, offset, and find count
 | 
			
		||||
  view.term = rinput.getParameter("term");
 | 
			
		||||
  view.offset = rinput.getParameterInt("ofs",0);
 | 
			
		||||
  view.findCount = rinput.getParameterInt("fcount",-1);
 | 
			
		||||
 | 
			
		||||
  // adjust the offset based on the command button click
 | 
			
		||||
  if (rinput.isImageButtonClicked("search"))
 | 
			
		||||
    view.offset = 0;
 | 
			
		||||
  else if (rinput.isImageButtonClicked("previous"))
 | 
			
		||||
    view.offset = Math.max(view_offset - view.maxResults,0);
 | 
			
		||||
  else if (rinput.isImageButtonClicked("next"))
 | 
			
		||||
    view.offset += view.maxResults;
 | 
			
		||||
  else
 | 
			
		||||
    throw new ValidationException("Unable to determine what action triggered the form.");
 | 
			
		||||
 | 
			
		||||
  // get the user results
 | 
			
		||||
  view.results = rinput.engine.searchForUsers(view.field,view.mode,view.term,view.offset,view.maxResults);
 | 
			
		||||
  if (view.findCount<0)
 | 
			
		||||
    view.findCount = rinput.engine.getSearchUserCount(view.field,view.mode,view.term);
 | 
			
		||||
 | 
			
		||||
  rc = view;
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // get the exception type
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("DataException"))
 | 
			
		||||
    rc = new ErrorBox("Database Error","Database error on find: " + e.message,"sysadmin/find_user.js.vs");
 | 
			
		||||
  else if (etype.match("ValidationException"))
 | 
			
		||||
    rc = new ErrorBox("Find Error",e.message,"sysadmin/find_user.js.vs");
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										137
									
								
								scripts/sysadmin/global.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										137
									
								
								scripts/sysadmin/global.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,137 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.dlg);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
 | 
			
		||||
// small function to setup the global properties dialog
 | 
			
		||||
function setupDialog(dlg,engine)
 | 
			
		||||
{
 | 
			
		||||
  sinf = engine.securityInfo;
 | 
			
		||||
  dlg.sendMessage("create_lvl","setRoleList",sinf.getRoleList("Global.CreateCommunity"));
 | 
			
		||||
 | 
			
		||||
} // end setupDialog
 | 
			
		||||
 | 
			
		||||
// get the request object
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
 | 
			
		||||
dlg = rinput.getDialog("global.properties");
 | 
			
		||||
rc = null;
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // set up the dialog
 | 
			
		||||
  setupDialog(dlg,rinput.engine);
 | 
			
		||||
 | 
			
		||||
  try
 | 
			
		||||
  { // get the administrative interface
 | 
			
		||||
    adm = user.adminInterface;
 | 
			
		||||
    props = adm.properties;
 | 
			
		||||
    dlg.setValue("search_items",props.searchItemsPerPage);
 | 
			
		||||
    dlg.setValue("fp_posts",props.postsOnFrontPage);
 | 
			
		||||
    dlg.setValue("audit_recs",props.auditRecordsPerPage);
 | 
			
		||||
    dlg.setValue("create_lvl",props.communityCreateLevel);
 | 
			
		||||
    dlg.setValue("comm_mbrs",props.communityMembersPerPage);
 | 
			
		||||
    dlg.setValue("posts_page",props.postsPerPage);
 | 
			
		||||
    dlg.setValue("old_posts",props.oldPostsAtTop);
 | 
			
		||||
    dlg.setValue("conf_mbrs",props.conferenceMembersPerPage);
 | 
			
		||||
    if (props.displayPostPictures)
 | 
			
		||||
      dlg.setValue("pic_in_post",1);
 | 
			
		||||
 | 
			
		||||
    rc = dlg;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // exception setting up dialog
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error","You do not have permission to administer the system.",null);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
  vlib.output(rc);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// everything that follows is for a POST operation
 | 
			
		||||
op = dlg.whichButton(rinput) + "";
 | 
			
		||||
if (op=="cancel")
 | 
			
		||||
{ // user cancelled profile update - bounce back to the menu
 | 
			
		||||
  vlib.output(new Redirect("sysadmin/menu.js.vs",LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (op=="update")
 | 
			
		||||
{ // load the values from the dialog
 | 
			
		||||
  dlg.load(rinput);
 | 
			
		||||
 | 
			
		||||
  try
 | 
			
		||||
  { // validate the dialog first
 | 
			
		||||
    dlg.validate();
 | 
			
		||||
 | 
			
		||||
    // set all the properties correctly
 | 
			
		||||
    adm = user.adminInterface;
 | 
			
		||||
    props = adm.properties;
 | 
			
		||||
    props.searchItemsPerPage = dlg.getValue("search_items").intValue();
 | 
			
		||||
    props.postsOnFrontPage = dlg.getValue("fp_posts").intValue();
 | 
			
		||||
    props.auditRecordsPerPage = dlg.getValue("audit_recs").intValue();
 | 
			
		||||
    props.communityCreateLevel = dlg.getValue("create_lvl").intValue();
 | 
			
		||||
    props.communityMembersPerPage = dlg.getValue("comm_mbrs").intValue();
 | 
			
		||||
    props.postsPerPage = dlg.getValue("posts_page").intValue();
 | 
			
		||||
    props.oldPostsAtTop = dlg.getValue("old_posts").intValue();
 | 
			
		||||
    props.conferenceMembersPerPage = dlg.getValue("conf_mbrs").intValue();
 | 
			
		||||
    props.displayPostPictures = dlg.getValue("pic_in_post").booleanValue();
 | 
			
		||||
    adm.properties = props;
 | 
			
		||||
 | 
			
		||||
    // done - bounce back to the menu
 | 
			
		||||
    rc = new Redirect("sysadmin/menu.js.vs",LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // caught an exception - figure out what to do
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("ValidationException"))
 | 
			
		||||
    { // validation error - reset the dialog and try again
 | 
			
		||||
      dlg.setErrorMessage(e.message + " Please try again.");
 | 
			
		||||
      setupDialog(dlg,rinput.engine);
 | 
			
		||||
      rc = dlg;
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error","You do not have permission to administer the system.",null);
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Unable to update global properties: " + e.message,
 | 
			
		||||
                        "sysadmin/menu.js.vs");
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else
 | 
			
		||||
{ // what the hell got clicked?
 | 
			
		||||
  logger.error("no known button click on POST to sysadmin/global.js");
 | 
			
		||||
  rc = new ErrorBox("Internal Error","Unknown command button pressed","sysadmin/menu.js.vs");
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										85
									
								
								scripts/sysadmin/import.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										85
									
								
								scripts/sysadmin/import.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,85 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
 | 
			
		||||
if (!(rinput.user.hasAdminAccess()))
 | 
			
		||||
{ // no admin access - we can't do this
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You do not have permission to administer the system.",null));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // build a JSPView to hold the upload form
 | 
			
		||||
  vlib.output(new JSPView("Import User Accounts","sysadmin/import_form.jsp"));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// the following assumes a POST
 | 
			
		||||
if (rinput.isImageButtonClicked("cancel"))
 | 
			
		||||
{ // redirect back to the admin menu
 | 
			
		||||
  vlib.output(new Redirect("sysadmin/menu.js.vs",LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (!(rinput.isImageButtonClicked("upload")))
 | 
			
		||||
{ // the buttons must be wrong!
 | 
			
		||||
  logger.error("no known button click on POST, to sysadmin/import.js");
 | 
			
		||||
  vlib.output(new ErrorBox("Internal Error","Unknown command button pressed","sysadmin/menu.js.vs"));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (!(rinput.isFileParam("idata")))
 | 
			
		||||
{ // the idata parameter MUST be a file parameter!
 | 
			
		||||
  vlib.output(new ErrorBox("Internal Error","Invalid input file parameter.","sysadmin/menu.js.vs"));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
try
 | 
			
		||||
{ // prepare and load the XML file
 | 
			
		||||
  ihelper = new ImportHelper(rinput.user.adminInterface,rinput.getParameterDataStream("idata"));
 | 
			
		||||
 | 
			
		||||
  // set up the return value
 | 
			
		||||
  rinput.setRequestAttribute("import.helper",ihelper);
 | 
			
		||||
  rc = new JSPView("Import User Accounts","sysadmin/import_results.jsp");
 | 
			
		||||
 | 
			
		||||
} // end try
 | 
			
		||||
catch (e)
 | 
			
		||||
{ // translate the various exception types here
 | 
			
		||||
  etype = vlib.exceptionType(e) + "";
 | 
			
		||||
  if (etype.match("ServletMultipartException"))
 | 
			
		||||
    rc = new ErrorBox("Internal Error","Error loading post data: " + e.message,"sysadmin/menu.js.vs");
 | 
			
		||||
  else if (etype.match("AccessError"))
 | 
			
		||||
    rc = new ErrorBox("Access Error","You do not have permission to administer the system.",null);
 | 
			
		||||
  else
 | 
			
		||||
    rc = e;
 | 
			
		||||
 | 
			
		||||
} // end catch
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										37
									
								
								scripts/sysadmin/menu.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								scripts/sysadmin/menu.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,37 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// get the request object
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
 | 
			
		||||
if (!(rinput.user.hasAdminAccess()))
 | 
			
		||||
{ // you don't have permission to administer the system
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You do not have permission to administer the system.",null));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// build a view around it and return it
 | 
			
		||||
rc = new MenuView(rinput.getMenu("system.admin"));
 | 
			
		||||
rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										148
									
								
								scripts/sysadmin/modify_photo.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										148
									
								
								scripts/sysadmin/modify_photo.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,148 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// Contributor(s): 
 | 
			
		||||
 | 
			
		||||
importClass(java.awt.Dimension);
 | 
			
		||||
importPackage(Packages.com.silverwrist.util);
 | 
			
		||||
importPackage(Packages.com.silverwrist.util.image);
 | 
			
		||||
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);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.view);
 | 
			
		||||
 | 
			
		||||
// Get the request object.
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
 | 
			
		||||
if (!(rinput.user.hasAdminAccess()))
 | 
			
		||||
{ // no admin access - we can't do this
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You do not have permission to administer the system.",null));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
uid = rinput.getParameterInt("uid",0);
 | 
			
		||||
if (uid==0)
 | 
			
		||||
{ // user ID not found
 | 
			
		||||
  vlib.output(new ErrorBox(null,"User ID parameter not found.","sysadmin/find_user.js.vs"));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // create a PhotoUploader to do the photo uploading
 | 
			
		||||
  try
 | 
			
		||||
  { // create and initialize the PhotoUploader
 | 
			
		||||
    adm = rinput.user.adminInterface;
 | 
			
		||||
    admuser = adm.getUserContext(uid);
 | 
			
		||||
    rc = new PhotoUploader("Upload User Photo","sysadmin/modify_photo.js.vs",LinkTypes.SERVLET);
 | 
			
		||||
    rc.addHiddenParameter("uid",uid);
 | 
			
		||||
    rc.photoTag = rinput.getUserPhotoTag(admuser.getContactInfo().photoURL);
 | 
			
		||||
    rc.label = "New user photo";
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // an exception in the output...
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error generating display: " + e.message,
 | 
			
		||||
                        "sysadmin/find_user.js.vs");
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox(null,"User ID parameter not found.","sysadmin/find_user.js.vs");
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
  vlib.output(rc);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// If the cancel button was clicked, bounce out of here.
 | 
			
		||||
if (rinput.isImageButtonClicked("cancel"))
 | 
			
		||||
{ // user elected to cancel upload - bounce us out of here
 | 
			
		||||
  vlib.output(new Redirect("sysadmin/modify_user.js.vs?uid=" + uid,LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
if (rinput.isImageButtonClicked("upload"))
 | 
			
		||||
{ // do some shorts-checking in the parameters
 | 
			
		||||
  if (!(rinput.isFileParam("thepic")))
 | 
			
		||||
  { // bogus file parameter
 | 
			
		||||
    logger.error("Internal Error: 'thepic' should be a file param");
 | 
			
		||||
    vlib.output(new ErrorBox(null,"Internal Error: 'thepic' should be a file param",
 | 
			
		||||
			     "sysadmin/modify_user.js.vs?uid=" + uid));
 | 
			
		||||
    vlib.done();
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  mimetype = rinput.getParameterType("thepic") + "";
 | 
			
		||||
  if (!(mimetype.match("image/")))
 | 
			
		||||
  { // not an image file type that got uploaded
 | 
			
		||||
    logger.error("Error: 'thepic' not an image type");
 | 
			
		||||
    vlib.output(new ErrorBox(null,"You did not upload an image file.  Try again.",
 | 
			
		||||
                             "sysadmin/modify_photo.js.vs?uid=" + uid));
 | 
			
		||||
    vlib.done();
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  try
 | 
			
		||||
  { // normalize the photo to 100x100 pixels
 | 
			
		||||
    real_pic = ImageNormalizer.normalizeImage(rinput.getParameterDataStream("thepic"),
 | 
			
		||||
                                              rinput.engine.getUserPhotoSize(),"jpeg");
 | 
			
		||||
 | 
			
		||||
    // set the user photo data!
 | 
			
		||||
    adm = rinput.user.adminInterface;
 | 
			
		||||
    admuser = adm.getUserContext(uid);
 | 
			
		||||
    ci = admuser.getContactInfo();
 | 
			
		||||
    ci.setPhotoData(rinput.contextPath + "/imagedata/","image/jpeg",real_pic.length,real_pic.data);
 | 
			
		||||
    admuser.putContactInfo(ci);
 | 
			
		||||
 | 
			
		||||
    // Jump back to the profile form.
 | 
			
		||||
    rc = new Redirect("sysadmin/modify_user.js.vs?uid=" + uid,LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // exception while setting user photo
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("ServletMultipartException"))
 | 
			
		||||
      rc = new ErrorBox(null,"Internal Error: " + e.message,"sysadmin/modify_user.js.vs?uid=" + uid);
 | 
			
		||||
    else if (etype.match("ImageNormalizerException"))
 | 
			
		||||
      rc = new ErrorBox(null,e.message,"sysadmin/modify_photo.js.vs?uid=" + uid);
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Database error storing user photo: " + e.message,
 | 
			
		||||
			"sysadmin/modify_user.js.vs?uid=" + uid);
 | 
			
		||||
    else if (etype.match("EmailException"))
 | 
			
		||||
      rc = new ErrorBox(null,"Internal Error: " + e.message,"sysadmin/modify_user.js.vs?uid=" + uid);
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error","You do not have permission to administer the system.",null);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else
 | 
			
		||||
{ // don't know the command button!
 | 
			
		||||
  logger.error("no known button click on POST to sysadmin/modify_photo.js");
 | 
			
		||||
  rc = new ErrorBox("Internal Error","Unknown command button pressed",
 | 
			
		||||
                    "sysadmin/modify_user.js.vs?uid=" + uid);
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);   // all done!
 | 
			
		||||
							
								
								
									
										283
									
								
								scripts/sysadmin/modify_user.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										283
									
								
								scripts/sysadmin/modify_user.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,283 @@
 | 
			
		||||
// 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 <http://www.mozilla.org/MPL/>.
 | 
			
		||||
// 
 | 
			
		||||
// 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 <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.
 | 
			
		||||
// 
 | 
			
		||||
// 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.dlg);
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui.helpers);
 | 
			
		||||
 | 
			
		||||
function setupDialog(dlg,adm,user)
 | 
			
		||||
{
 | 
			
		||||
  dlg.setSubtitle("User: " + user.userName);
 | 
			
		||||
  var role_list = adm.getAllowedRoleList();
 | 
			
		||||
  dlg.sendMessage("base_lvl","setRoleList",role_list);
 | 
			
		||||
 | 
			
		||||
  // See if this level was found on the list.
 | 
			
		||||
  var my_role = user.baseRole;
 | 
			
		||||
  var found = false;
 | 
			
		||||
  var it = role_list.iterator();
 | 
			
		||||
  while (it.hasNext())
 | 
			
		||||
  { // seek each role in turn
 | 
			
		||||
    var r = it.next();
 | 
			
		||||
    if (r.equals(my_role))
 | 
			
		||||
    { // found it!
 | 
			
		||||
      found = true;
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
    } // end if
 | 
			
		||||
 | 
			
		||||
  } // end while
 | 
			
		||||
 | 
			
		||||
  if (!found)  // role not found - set the defined role list to be a singleton
 | 
			
		||||
    dlg.sendMessage("base_lvl","setRoleList",Collections.singletonList(my_role));
 | 
			
		||||
  dlg.sendMessage("photo","setLinkURL","sysadmin/modify_photo.js.vs?uid=" + admuser.UID);
 | 
			
		||||
 | 
			
		||||
} // end setupDialog
 | 
			
		||||
 | 
			
		||||
rinput = bsf.lookupBean("request");
 | 
			
		||||
 | 
			
		||||
if (!(rinput.user.hasAdminAccess()))
 | 
			
		||||
{ // no admin access - we can't do this
 | 
			
		||||
  vlib.output(new ErrorBox("Access Error","You do not have permission to administer the system.",null));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
dlg = rinput.getDialog("admin.modify.user");
 | 
			
		||||
 | 
			
		||||
rc = null;
 | 
			
		||||
if ("GET"==rinput.verb)
 | 
			
		||||
{ // set up the dialog
 | 
			
		||||
  uid = rinput.getParameterInt("uid",0);
 | 
			
		||||
  if (uid==0)
 | 
			
		||||
  { // user ID not found
 | 
			
		||||
    vlib.output(new ErrorBox(null,"User ID parameter not found.","sysadmin/find_user.js.vs"));
 | 
			
		||||
    vlib.done();
 | 
			
		||||
 | 
			
		||||
  } // end if
 | 
			
		||||
 | 
			
		||||
  try
 | 
			
		||||
  { // load the user's data and populate the dialog box
 | 
			
		||||
    adm = rinput.user.adminInterface;
 | 
			
		||||
    admuser = adm.getUserContext(uid);
 | 
			
		||||
    setupDialog(dlg,adm,admuser);  // set up the dialog box
 | 
			
		||||
    dlg.setValue("uid",admuser.UID);
 | 
			
		||||
 | 
			
		||||
    dlg.setValue("base_lvl",admuser.baseLevel);
 | 
			
		||||
    if (admuser.isEmailVerified())
 | 
			
		||||
      dlg.setValue("verify_email",1);
 | 
			
		||||
    if (admuser.isLockedOut())
 | 
			
		||||
      dlg.setValue("lockout",1);
 | 
			
		||||
 | 
			
		||||
    ci = admuser.getContactInfo();  // get the main contact info
 | 
			
		||||
    props = admuser.properties;
 | 
			
		||||
 | 
			
		||||
    if (props.disallowPhoto)
 | 
			
		||||
      dlg.setValue("nophoto",1);
 | 
			
		||||
    dlg.setValue("prefix",ci.namePrefix);
 | 
			
		||||
    dlg.setValue("first",ci.givenName);
 | 
			
		||||
    if (ci.middleInitial!=' ')
 | 
			
		||||
      dlg.setValue("mid",String.fromCharCode(ci.middleInitial));
 | 
			
		||||
    dlg.setValue("last",ci.familyName);
 | 
			
		||||
    dlg.setValue("suffix",ci.nameSuffix);
 | 
			
		||||
    dlg.setValue("company",ci.company);
 | 
			
		||||
    dlg.setValue("addr1",ci.addressLine1);
 | 
			
		||||
    dlg.setValue("addr2",ci.addressLine2);
 | 
			
		||||
    if (ci.privateAddress)
 | 
			
		||||
      dlg.setValue("pvt_addr",1);
 | 
			
		||||
    dlg.setValue("loc",ci.locality);
 | 
			
		||||
    dlg.setValue("reg",ci.region);
 | 
			
		||||
    dlg.setValue("pcode",ci.postalCode);
 | 
			
		||||
    dlg.setValue("country",ci.country);
 | 
			
		||||
    dlg.setValue("phone",ci.phone);
 | 
			
		||||
    dlg.setValue("mobile",ci.mobile);
 | 
			
		||||
    if (ci.privatePhone)
 | 
			
		||||
      dlg.setValue("pvt_phone",1);
 | 
			
		||||
    dlg.setValue("fax",ci.fax);
 | 
			
		||||
    if (ci.privateFax)
 | 
			
		||||
      dlg.setValue("pvt_fax",1);
 | 
			
		||||
    dlg.setValue("email",ci.email);
 | 
			
		||||
    if (ci.privateEmail)
 | 
			
		||||
      dlg.setValue("pvt_email",1);
 | 
			
		||||
    dlg.setValue("url",ci.URL);
 | 
			
		||||
    dlg.setValue("descr",admuser.description);
 | 
			
		||||
    dlg.setValue("photo",ci.photoURL);
 | 
			
		||||
    if (props.displayPostPictures)
 | 
			
		||||
      dlg.setValue("pic_in_post",1);
 | 
			
		||||
    if (props.massMailOptOut)
 | 
			
		||||
      dlg.setValue("no_mass_mail",1);
 | 
			
		||||
    dlg.setValue("locale",admuser.locale);
 | 
			
		||||
    dlg.setValue("tz",admuser.timeZone);
 | 
			
		||||
 | 
			
		||||
    rc = dlg;
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // exception initializing dialog
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Unable to retrieve user information: " + e.message,
 | 
			
		||||
			"sysadmin/find_user.js.vs");
 | 
			
		||||
    else if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error","You do not have permission to administer the system.",null);
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
  vlib.output(rc);
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
// everything that follows is for a POST operation
 | 
			
		||||
op = dlg.whichButton(rinput) + "";
 | 
			
		||||
if (op=="cancel")
 | 
			
		||||
{ // user cancelled profile update - bounce back to the target
 | 
			
		||||
  vlib.output(new Redirect("sysadmin/find_user.js.vs",LinkTypes.SERVLET));
 | 
			
		||||
  vlib.done();
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
 | 
			
		||||
dlg.load(rinput);        // load the dialog parameters
 | 
			
		||||
 | 
			
		||||
if (op=="update")
 | 
			
		||||
{ // we're updating the user
 | 
			
		||||
  try
 | 
			
		||||
  { // get the admin interface and the user information
 | 
			
		||||
    uid = parseInt(dlg.getValue("uid"),10);
 | 
			
		||||
    adm = rinput.user.adminInterface;
 | 
			
		||||
    admuser = adm.getUserContext(uid);
 | 
			
		||||
 | 
			
		||||
    try
 | 
			
		||||
    { // validate the dialog
 | 
			
		||||
      dlg.validate();
 | 
			
		||||
 | 
			
		||||
      // check the passwords
 | 
			
		||||
      pass1 = dlg.getValue("pass1") + "";
 | 
			
		||||
      pass2 = dlg.getValue("pass2") + "";
 | 
			
		||||
 | 
			
		||||
      if (vlib.emptyString(pass1))
 | 
			
		||||
      { // empty must match empty
 | 
			
		||||
        if (!(vlib.emptyString(pass2)))
 | 
			
		||||
	  throw new ValidationException("The typed passwords do not match.");
 | 
			
		||||
 | 
			
		||||
      } // end if
 | 
			
		||||
      else
 | 
			
		||||
      { // the two passwords must match
 | 
			
		||||
        if (pass1!=pass2)
 | 
			
		||||
	  throw new ValidationException("The typed passwords do not match.");
 | 
			
		||||
 | 
			
		||||
      } // end else
 | 
			
		||||
 | 
			
		||||
      // reset the base level
 | 
			
		||||
      admuser.baseLevel = dlg.getValue("base_lvl").intValue();
 | 
			
		||||
 | 
			
		||||
      // Change the password if applicable.
 | 
			
		||||
      if (!(vlib.emptyString(pass1)))
 | 
			
		||||
        admuser.setPassword(pass1,dlg.getValue("remind"));
 | 
			
		||||
 | 
			
		||||
      admuser.setEmailVerified(dlg.getValue("verify_email").booleanValue());
 | 
			
		||||
      admuser.setLockedOut(dlg.getValue("lockout").booleanValue());
 | 
			
		||||
 | 
			
		||||
      ci = admuser.getContactInfo();  // get the main contact info
 | 
			
		||||
      props = admuser.properties;
 | 
			
		||||
 | 
			
		||||
      // Reset all the contact info fields.
 | 
			
		||||
      props.disallowPhoto = dlg.getValue("nophoto").booleanValue();
 | 
			
		||||
      ci.namePrefix = dlg.getValue("prefix");
 | 
			
		||||
      ci.givenName = dlg.getValue("first");
 | 
			
		||||
      blort = dlg.getValue("mid") + "";
 | 
			
		||||
      if (blort.length<1)
 | 
			
		||||
        ci.middleInitial = " ";
 | 
			
		||||
      else
 | 
			
		||||
        ci.middleInitial = blort.substring(0,1);
 | 
			
		||||
      ci.familyName = dlg.getValue("last");
 | 
			
		||||
      ci.nameSuffix = dlg.getValue("suffix");
 | 
			
		||||
      ci.company = dlg.getValue("company");
 | 
			
		||||
      ci.addressLine1 = dlg.getValue("addr1");
 | 
			
		||||
      ci.addressLine2 = dlg.getValue("addr2");
 | 
			
		||||
      ci.privateAddress = dlg.getValue("pvt_addr").booleanValue();
 | 
			
		||||
      ci.locality = dlg.getValue("loc");
 | 
			
		||||
      ci.region = dlg.getValue("reg");
 | 
			
		||||
      ci.postalCode = dlg.getValue("pcode");
 | 
			
		||||
      ci.country = dlg.getValue("country");
 | 
			
		||||
      ci.phone = dlg.getValue("phone");
 | 
			
		||||
      ci.mobile = dlg.getValue("mobile");
 | 
			
		||||
      ci.privatePhone = dlg.getValue("pvt_phone").booleanValue();
 | 
			
		||||
      ci.fax = dlg.getValue("fax");
 | 
			
		||||
      ci.privateFax = dlg.getValue("pvt_fax").booleanValue();
 | 
			
		||||
      ci.email = dlg.getValue("email");
 | 
			
		||||
      ci.privateEmail = dlg.getValue("pvt_email").booleanValue();
 | 
			
		||||
      ci.URL = dlg.getValue("url");
 | 
			
		||||
      props.displayPostPictures = dlg.getValue("pic_in_post").booleanValue();
 | 
			
		||||
      props.massMailOptOut = dlg.getValue("no_mass_mail").booleanValue();
 | 
			
		||||
 | 
			
		||||
      // Store the completed contact info.
 | 
			
		||||
      admuser.putContactInfo(ci);
 | 
			
		||||
      admuser.properties = props;
 | 
			
		||||
 | 
			
		||||
      // Save off the user's description and preferences.
 | 
			
		||||
      admuser.description = dlg.getValue("descr");
 | 
			
		||||
      admuser.locale = dlg.getValue("locale");
 | 
			
		||||
      admuser.timeZone = dlg.getValue("tz");
 | 
			
		||||
 | 
			
		||||
      // redirect back to the Find User page
 | 
			
		||||
      rc = new Redirect("sysadmin/find_user.js.vs",LinkTypes.SERVLET);
 | 
			
		||||
 | 
			
		||||
    } // end try
 | 
			
		||||
    catch (e)
 | 
			
		||||
    { // catch ValidationExceptions here and redisplay the dialog
 | 
			
		||||
      etype = vlib.exceptionType(e) + "";
 | 
			
		||||
      if (etype.match("ValidationException"))
 | 
			
		||||
      { // on a ValidationException, redisplay the dialog and try again
 | 
			
		||||
        dlg.setErrorMessage(e.message + " Please try again.");
 | 
			
		||||
        setupDialog(dlg,adm,admuser);  // set up the dialog box
 | 
			
		||||
        dlg.setValue("pass1",null);
 | 
			
		||||
        dlg.setValue("pass2",null);
 | 
			
		||||
        rc = dlg;
 | 
			
		||||
 | 
			
		||||
      } // end if
 | 
			
		||||
      else  // propagate other types of exceptions
 | 
			
		||||
        throw e;
 | 
			
		||||
 | 
			
		||||
    } // end catch
 | 
			
		||||
 | 
			
		||||
  } // end try
 | 
			
		||||
  catch (e)
 | 
			
		||||
  { // this is used to catch the hard exceptions
 | 
			
		||||
    etype = vlib.exceptionType(e) + "";
 | 
			
		||||
    if (etype.match("AccessError"))
 | 
			
		||||
      rc = new ErrorBox("Access Error","You do not have permission to administer the system.",null);
 | 
			
		||||
    else if (etype.match("DataException"))
 | 
			
		||||
      rc = new ErrorBox("Database Error","Unable to retrieve user information: " + e.message,
 | 
			
		||||
                        "sysadmin/find_user.js.vs");
 | 
			
		||||
    else
 | 
			
		||||
      rc = e;
 | 
			
		||||
 | 
			
		||||
  } // end catch
 | 
			
		||||
 | 
			
		||||
} // end if
 | 
			
		||||
else
 | 
			
		||||
{ // bogus button indicated
 | 
			
		||||
  logger.error("no known button click on POST to sysadmin/modify_user.js");
 | 
			
		||||
  rc = new ErrorBox("Internal Error","Unknown command button pressed","sysadmin/find_user.js.vs");
 | 
			
		||||
 | 
			
		||||
} // end else
 | 
			
		||||
 | 
			
		||||
vlib.output(rc);  // all done!
 | 
			
		||||
							
								
								
									
										14
									
								
								scripts/test/test1.jacl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								scripts/test/test1.jacl
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,14 @@
 | 
			
		||||
# Script for testing the new UI framework
 | 
			
		||||
package require java
 | 
			
		||||
 | 
			
		||||
set request [bsf lookupBean "request"]
 | 
			
		||||
 | 
			
		||||
if {[$request hasParameter "p"]} {
 | 
			
		||||
  $logger debug "Got the parameter value!"
 | 
			
		||||
  set tmp [$request getParameter "p"]
 | 
			
		||||
  set part1 "Requested parameter: $tmp<P>"
 | 
			
		||||
} else {
 | 
			
		||||
  set part1 ""
 | 
			
		||||
} ;# end if
 | 
			
		||||
 | 
			
		||||
$vlib output "$part1 <B>In the house!</B>"
 | 
			
		||||
							
								
								
									
										10
									
								
								scripts/test/test2.jacl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								scripts/test/test2.jacl
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,10 @@
 | 
			
		||||
# Script for testing the View mechanism
 | 
			
		||||
package require java
 | 
			
		||||
java::import com.silverwrist.venice.ui.LinkTypes
 | 
			
		||||
 | 
			
		||||
set rc [java::new com.silverwrist.venice.ui.view.TextMessage "Test Display" "subtitle"]
 | 
			
		||||
set blort "If this had been an actual emergency we would all be dead by now."
 | 
			
		||||
java::prop $rc text "This is a test.<BR>This is only a test.<BR>$blort"
 | 
			
		||||
$rc addButton [java::field LinkTypes ABSOLUTE] "TODO" "ok"
 | 
			
		||||
$rc addButton [java::field LinkTypes ABSOLUTE] "TODO" "cancel"
 | 
			
		||||
$vlib output $rc
 | 
			
		||||
							
								
								
									
										12
									
								
								scripts/test/test2.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								scripts/test/test2.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,12 @@
 | 
			
		||||
// Script for testing the View mechanism
 | 
			
		||||
// Translation of test2.jacl
 | 
			
		||||
 | 
			
		||||
importPackage(Packages.com.silverwrist.venice.ui);
 | 
			
		||||
importClass(Packages.com.silverwrist.venice.ui.view.TextMessage);
 | 
			
		||||
 | 
			
		||||
rc = new TextMessage("Test Display","JavaScript subtitle");
 | 
			
		||||
blort = "If this had been an actual emergency we would all be dead by now."
 | 
			
		||||
rc.text = "This is a test.<BR>This is only a test.<BR>" + blort;
 | 
			
		||||
rc.addButton(LinkTypes.ABSOLUTE,"TODO","ok");
 | 
			
		||||
rc.addButton(LinkTypes.ABSOLUTE,"TODO","cancel");
 | 
			
		||||
vlib.output(rc);
 | 
			
		||||
							
								
								
									
										17
									
								
								scripts/test/test3.jacl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								scripts/test/test3.jacl
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,17 @@
 | 
			
		||||
# Script for testing the sidebox framework
 | 
			
		||||
# Translated from test3.js
 | 
			
		||||
 | 
			
		||||
package require java
 | 
			
		||||
java::import com.silverwrist.venice.ui.LinkTypes
 | 
			
		||||
java::import com.silverwrist.venice.ui.view.SideBoxNestedView
 | 
			
		||||
java::import com.silverwrist.venice.ui.view.TextMessage
 | 
			
		||||
 | 
			
		||||
set rinput [bsf lookupBean "request"]
 | 
			
		||||
set rc [java::new TextMessage "Test Display" "Jacl subtitle"]
 | 
			
		||||
set blort "If this had been an actual emergency we would all be dead by now."
 | 
			
		||||
java::prop $rc text "This is a test.<BR>This is only a test.<BR>$blort"
 | 
			
		||||
$rc addButton [java::field LinkTypes ABSOLUTE] "TODO" "ok"
 | 
			
		||||
$rc addButton [java::field LinkTypes ABSOLUTE] "TODO" "cancel"
 | 
			
		||||
 | 
			
		||||
set rc2 [java::new SideBoxNestedView $rinput $rc]
 | 
			
		||||
$vlib output $rc2
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user