diff -crN scarab-1.0-b13.orig/src/conf/TurbineResources.properties scarab-1.0-b13/src/conf/TurbineResources.properties
*** scarab-1.0-b13.orig/src/conf/TurbineResources.properties	Fri Sep 20 14:53:29 2002
--- scarab-1.0-b13/src/conf/TurbineResources.properties	Sun Dec 29 19:38:38 2002
***************
*** 337,343 ****
  # Default: true
  # -------------------------------------------------------------------
  
! use.ssl=true
  
  
  # -------------------------------------------------------------------
--- 337,343 ----
  # Default: true
  # -------------------------------------------------------------------
  
! use.ssl=false
  
  
  # -------------------------------------------------------------------
***************
*** 360,366 ****
  services.PoolService.classname=org.apache.fulcrum.pool.TurbinePoolService
  services.MimeTypeService.classname=org.apache.fulcrum.mimetype.TurbineMimeTypeService
  services.SchedulerService.classname=org.apache.fulcrum.schedule.TurbineSchedulerService
! #services.XmlRpcService.classname=org.apache.fulcrum.xmlrpc.TurbineXmlRpcService
  services.UploadService.classname=org.apache.fulcrum.upload.TurbineUploadService
  services.SecurityService.classname=org.tigris.scarab.services.security.ScarabDBSecurityService
  #services.DatabaseService.classname=org.apache.fulcrum.db.TurbineDatabaseService
--- 360,366 ----
  services.PoolService.classname=org.apache.fulcrum.pool.TurbinePoolService
  services.MimeTypeService.classname=org.apache.fulcrum.mimetype.TurbineMimeTypeService
  services.SchedulerService.classname=org.apache.fulcrum.schedule.TurbineSchedulerService
! services.XmlRpcService.classname=org.apache.fulcrum.xmlrpc.TurbineXmlRpcService
  services.UploadService.classname=org.apache.fulcrum.upload.TurbineUploadService
  services.SecurityService.classname=org.tigris.scarab.services.security.ScarabDBSecurityService
  #services.DatabaseService.classname=org.apache.fulcrum.db.TurbineDatabaseService
***************
*** 774,780 ****
  #
  # Default: 12345
  
! ##services.XmlRpcService.port=12345
  
  # If any classes are specified here, the Service will create an 
  # instance of them here and start up a listener on the specified 
--- 774,780 ----
  #
  # Default: 12345
  
! services.XmlRpcService.port=12345
  
  # If any classes are specified here, the Service will create an 
  # instance of them here and start up a listener on the specified 
***************
*** 801,813 ****
  # running on separate servers.
  
  #services.XmlRpcService.handler.file = org.apache.fulcrum.xmlrpc.util.FileHandler
! ##services.XmlRpcService.paranoid = false
! ##services.XmlRpcService.acceptClient = 127.0.0.1
! ##services.XmlRpcService.denyClient = *
  
! # Do we want a secure server
  
! ##services.XmlRpcService.secure.server = false
  
  # Secure server options
  
--- 801,815 ----
  # running on separate servers.
  
  #services.XmlRpcService.handler.file = org.apache.fulcrum.xmlrpc.util.FileHandler
! services.XmlRpcService.handler.scm = org.tigris.scarab.util.ScmHandler
  
! services.XmlRpcService.paranoid = false
! services.XmlRpcService.acceptClient = 127.0.0.1
! services.XmlRpcService.denyClient = *
! services.XmlRpcService.earlyInit = true
  
! # Do we want a secure server
! services.XmlRpcService.secure.server = false
  
  # Secure server options
  
***************
*** 834,841 ****
  
  # These values should be set to 'all' for debugging purposes.
  
! ##services.XmlRpcService.secure.server.option.javax.net.debug = none
! ##services.XmlRpcService.secure.server.option.java.security.debug = none
  
  ##services.XmlRpcService.earlyInit = true
  
--- 836,843 ----
  
  # These values should be set to 'all' for debugging purposes.
  
! services.XmlRpcService.secure.server.option.javax.net.debug = none
! services.XmlRpcService.secure.server.option.java.security.debug = none
  
  ##services.XmlRpcService.earlyInit = true
  
diff -crN scarab-1.0-b13.orig/src/java/org/tigris/scarab/util/ScmHandler.java scarab-1.0-b13/src/java/org/tigris/scarab/util/ScmHandler.java
*** scarab-1.0-b13.orig/src/java/org/tigris/scarab/util/ScmHandler.java	Wed Dec 31 16:00:00 1969
--- scarab-1.0-b13/src/java/org/tigris/scarab/util/ScmHandler.java	Sun Dec 29 19:38:38 2002
***************
*** 0 ****
--- 1,194 ----
+ package org.tigris.scarab.util;
+ 
+ /* ================================================================
+  * Copyright (c) 2000 CollabNet.  All rights reserved.
+  * 
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions are
+  * met:
+  * 
+  * 1. Redistributions of source code must retain the above copyright
+  * notice, this list of conditions and the following disclaimer.
+  * 
+  * 2. Redistributions in binary form must reproduce the above copyright
+  * notice, this list of conditions and the following disclaimer in the
+  * documentation and/or other materials provided with the distribution.
+  * 
+  * 3. The end-user documentation included with the redistribution, if
+  * any, must include the following acknowlegement: "This product includes
+  * software developed by CollabNet (http://www.collab.net/)."
+  * Alternately, this acknowlegement may appear in the software itself, if
+  * and wherever such third-party acknowlegements normally appear.
+  * 
+  * 4. The hosted project names must not be used to endorse or promote
+  * products derived from this software without prior written
+  * permission. For written permission, please contact info@collab.net.
+  * 
+  * 5. Products derived from this software may not use the "Tigris" name
+  * nor may "Tigris" appear in their names without prior written
+  * permission of CollabNet.
+  * 
+  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+  * IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  *
+  * ====================================================================
+  * 
+  * This software consists of voluntary contributions made by many
+  * individuals on behalf of CollabNet.
+  */
+ 
+ import java.util.Hashtable;
+ import java.util.Iterator;
+ import java.util.Vector;
+ 
+ import org.tigris.scarab.om.Attachment;
+ import org.tigris.scarab.om.Attribute;
+ import org.tigris.scarab.om.AttributeValue;
+ import org.tigris.scarab.om.Issue;
+ import org.tigris.scarab.om.IssueManager;
+ import org.tigris.scarab.om.ScarabUser;
+ import org.tigris.scarab.om.ScarabUserManager;
+ import org.tigris.scarab.attribute.UserAttribute;
+ 
+ import org.apache.log4j.Category;
+ 
+ /**
+  * Handles XML-RPC requests from the SCM.
+  * 
+  * @author <a href="rob@ti.com">Rob Clark</a>
+  * @version $Id$
+  */
+ public class ScmHandler
+ {
+     protected static Category category = Category.getInstance(ScmHandler.class);
+     
+     private static void log( String str )
+     {
+         category.debug("ScmHandler: " + str);
+         System.err.println("ScmHandler: " + str);
+     }
+     
+     static {
+         log("loading");
+     }
+     
+     /**
+      * Get the array of usernames of users assigned to the specified issue.
+      * 
+      * @param issueId    the id of the issue to determine the assigned users of
+      * @return the array ({@link Vector}) of users ({@link String})
+      */
+     public Vector getAssignedUsers( String issueId )
+     {
+         log("getAssignedUsers:  issueId=" + issueId);
+         
+         // I think we need to do this:
+         log("clearing method result cache");
+         IssueManager.getMethodResult().clear();
+         
+         Vector users = new Vector();
+         Issue  issue = Issue.getIssueById(issueId);
+         
+         try
+         {
+             for( Iterator itr=issue.getUserAttributeValues().iterator(); itr.hasNext(); )
+             {
+                 ScarabUser user = ScarabUserManager.getInstance( ((UserAttribute)(itr.next())).getUserId() );
+                 users.add( user.getEmail() );
+             }
+         }
+         catch(Exception e)
+         {
+             e.printStackTrace();
+         }
+ 
+         log(" -> " + users);
+         
+         return users;
+     }
+ 
+     /**
+      * Get the value of the requested attribute.
+      * 
+      * @param issueId    the id of the issue to get the attribute value of
+      * @param attrname   the name of the attribute to fetch
+      * @return the array ({@link Vector}) of attribute values ({@link String})
+      */
+     public Vector getAttributeValues( String issueId, String attrname )
+     {
+         log("getAttribute:  issueId=" + issueId + ", attrname=\"" + attrname + "\"");
+         
+         Vector values = new Vector();
+         Issue  issue  = Issue.getIssueById(issueId);
+         
+         try
+         {
+             for( Iterator itr=issue.getAttributeValues( Attribute.getInstance(attrname) ).iterator(); itr.hasNext(); )
+                 values.add( ((AttributeValue)(itr.next())).getValue() );
+         }
+         catch(Exception e)
+         {
+             e.printStackTrace();
+         }
+ 
+         log(" -> " + values);
+         
+         return values;
+     }
+     
+     /**
+      * Append a comment to the specified issue.
+      *
+      * @param issueId    the id of the issue to add the comment to
+      * @param username   the username of the user who is adding the comment
+      * @param comment    the comment to append to the issue
+      * @param <code>true</code> if successful, else <code>false</code>
+      */
+     public boolean addComment( String issueId, String username, String comment )
+     {
+         log("addComment:  issueId=" + issueId + ", username=" + username + ", comment=\"" + comment + "\"");
+ 
+         try
+         {
+             Issue  issue = Issue.getIssueById(issueId);
+             ScarabUser user = ScarabUserManager.getInstance( username, null /*XXX???*/ );
+             
+             Attachment attachment = new Attachment();
+             attachment.setData(comment);
+             
+             issue.addComment( attachment, user );
+ 
+             /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+              * it seems like the old set of comment attachments is getting
+              * cached, and neither of the following seem to invalidate that
+              * cache... net result is comments don't always show up until
+              * something else happens to clear that cache.
+              * 
+              *    org.tigris.scarab.services.cache.ScarabCache.clear();
+              *    IssueManager.getMethodResult().clear();
+              *    ModuleManager.getMethodResult().clear();
+              *
+              * for now the solution is to scarab.torque.manager.cache to
+              * false
+              * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+              */
+             
+             return true;
+         }
+         catch(Exception e)
+         {
+             e.printStackTrace();
+             return false;
+         }
+     }
+ }
+ 

