1  
     2  //!-- UTF8
     3  /*
     4   Oregano Multiuser Server - Version 1.2.0 - January 4th, 2005
     5   
     6  	Web:  www.oregano-server.org
     7  	Mail: info@oregano-server.org
     8   
     9  	Copyright 2003 - 2004 - 2004 Jens Halm / Cologne, Germany
    10   
    11   This library is free software; you can redistribute it and/or
    12   modify it under the terms of the GNU Lesser General Public
    13   License as published by the Free Software Foundation; either
    14   version 2.1 of the License, or (at your option) any later version.
    15   
    16   This library is distributed in the hope that it will be useful,
    17   but WITHOUT ANY WARRANTY; without even the implied warranty of
    18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    19   Lesser General Public License for more details.
    20   
    21   You should have received a copy of the GNU Lesser General Public
    22   License along with this library; if not, write to the Free Software
    23   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    24  */
    25  
    26  /*
    27   -------------------------------------------
    28  	Classe DbTransactionPart
    29   
    30  	@description :
    31  	Un élément de requête.
    32   
    33   
    34  	@author Jens Halm copyright http://www.spicefactory.org/
    35  	@author erixtekila copyleft http://www.v-i-a.net  
    36   -------------------------------------------
    37  	version history :
    38  	1.2.0 : 04/02/05
    39  			- Portage en actionscript 2 pour le
    40  			compile time type checking
    41   -------------------------------------------
    42   */
    43  
    44  import org.omus.util._Class;
    45  
    46  /**
    47   *	Cette classe générale pour les éléments de requête SQL.
    48   *
    49   *	@author Jens Halm copyright http://www.spicefactory.org/
    50   *	@author erixtekila copyleft http://www.v-i-a.net 
    51   *	@version 1.2.0
    52   */
    53  class org.omus.db.DbTransactionPart
    54  {
    55  	//--------------------
    56  	// PROPRIETES
    57  	//--------------------
    58  	/**
    59  	 *	Conteneur des paramètres de la requête.
    60  	 */
    61  	public var obj:Object;
    62  	
    63  	//--------------------
    64  	// CONSTRUCTEUR
    65  	//--------------------
    66  	/**
    67  	 *	TODO
    68  	 *
    69  	 *	@param configID		TODO
    70  	 *	@param	resultID	Identifiant pour l'objet dbResult.
    71  	 */
    72  	public function DbTransactionPart (configID:String, resultID:String)
    73  	{
    74  		// Propriétés
    75  		obj = new Object();
    76  		obj.configID = configID;
    77  		if (resultID != undefined) obj.resultID = resultID;
    78  		obj.params = new Object();
    79  		
    80  		// trace(this+ " installé.");
    81  	}
    82  	
    83  	
    84  	//--------------------
    85  	// METHODES PUBLIQUES
    86  	//--------------------
    87  	/**
    88  	 *	Utilisé dans un contexte littéral
    89  	 *	@return	Une chaine définissant l'objet
    90  	 */
    91  	public function toString():String
    92  	{
    93  		return "[Objet DbTransactionPart]";
    94  	}
    95  	
    96  	/**
    97  	 *	Définit un paramètre à soumettre à la base de donnée via dbCustom.xml.
    98  	 *	Ce paramètre doit correspondre au nœud <in>
    99  	 *	Il n'est valable que pour cet élément de requête, contrairement à DbTansaction
   100  	 *
   101  	 *	@param name			Nom du critère.
   102  	 *	@param value		Un objet appartenant au framework Oregano.
   103  	 *	@see org.omus.db.DbTransaction#setParam
   104  	 */
   105  	public function setParam (name:String, value:Object):Void
   106  	{
   107  		// TODO : Accès Singleton
   108  		var clazz = _Class.getInstance();
   109  		if (! clazz.checkArguments("org.omus.DbTransactionPart.setParam", [[name, "string", true]])) return;
   110  		var t = typeof(value);
   111  		if (t == "undefined" || t == "null" || t == "function" || t == "movieclip") 
   112  		{
   113  			// Logs internes
   114  			_global.oregano.iLog.error("clj-042","parameter name = " + name + " - value = " + value);
   115  			return;
   116  		}
   117  		obj.params[name] = value;
   118  	}
   119  	
   120  	//--------------------
   121  	// METHODES PRIVEES
   122  	//--------------------
   123  	
   124  	
   125  	//--------------------
   126  	// METHODES STATIQUES
   127  	//--------------------
   128  	/**
   129  	 *	Utilisé dans un contexte littéral
   130  	 *
   131  	 *	@return Une chaine définissant l'objet.
   132  	 */
   133  	public static function toLog():String
   134  	{
   135  		return "[Objet DbTransactionPart]";
   136  	}
   137  }
   138