mò )á¸Ec@s·dZddd!ZdkZdklZdklZdklZdk l Z d k l Z d „Z ed eƒƒZddd „Zd eiiiifd„ƒYZeeƒdS(s;SQL Methods $Id: SQL.py 40300 2005-11-21 16:54:03Z efge $s$Revision: 1.21 $i iþÿÿÿN(sDTMLFile(sInitializeClass(sClassSecurityInfo(schange_database_methods(sWriteLockInterfacecCs<h}|i}tdƒ}xø|dj oêt|dƒo³x°|iƒD]ž}t|dƒoˆ|i o~t|dƒon|i }t|ƒ|j o |ƒ}n||ƒp4t|dƒo|i ƒ}n|}|||1sN(tidsthas_keythave_idttypet StringTypetselftNonethasattrRtoRRRRtmaptitemstsort(RR R RR R((RtSQLConnectionIDss0    *      sdtml/addc Cs·|i|t|||||ƒƒ|dj o„y|i ƒ}Wn|d}nX|djod||f}n,|djod||f}n |d}|i i|ƒndS( s´Add an SQL Method The 'connection_id' argument is the id of a database connection that resides in the current folder or in a folder above the current folder. The database should understand SQL. The 'arguments' argument is a string containing an arguments specification, as would be given in the SQL method cration form. The 'template' argument is a string containing the source for the SQL Template. tURL1s Add and Edit s%s/%s/manage_mains Add and Test s%s/%s/manage_testForms /manage_mainRN(Rt _setObjectRtSQLttitlet connection_idt argumentsttemplatetREQUESTRtDestinationURLtutsubmittRESPONSEtredirect( RRRRRRRR R((Rtmanage_addZSQLMethod6s"    RcBsitZdZefZdZeƒZeie dƒeie dƒe de ƒƒZ Z e idƒRS(søSQL Database methods SQL Database methods are used to access external SQL databases. They support three important abstractions: - Method SQL Methods behave like methods of the folders they are accessed in. In particular, they can be used from other methods, like Documents, ExternalMethods, and even other SQL Methods. - Searchability Database methods support the Searchable Object Interface. Search interface wizards can be used to build user interfaces to them. They can be used in joins and unions. They provide meta-data about their input parameters and result data. For more information, see the searchable-object interface specification. - Containment Database methods support URL traversal to access and invoke methods on individual record objects. For example, suppose you had an 'employees' database method that took a single argument 'employee_id'. Suppose that employees had a 'service_record' method (defined in a record class or acquired from a folder). The 'service_record' method could be accessed with a URL like:: employees/employee_id/1234/service_record s Z SQL Methodtmanaget manage_mains dtml/edit(t__name__t __module__t__doc__tWriteLockInterfacet__implements__t meta_typetClassSecurityInfotsecuritytdeclareProtectedtchange_database_methodstDTMLFiletglobalsR$R%t_setName(((RRUs %  (R(t __version__tShared.DC.ZRDB.DAtSharedtGlobalsR0tInitializeClasst AccessControlR,tAccessControl.PermissionsR/twebdav.WriteLockInterfaceR)RR1tmanage_addZSQLMethodFormRR#tDCtZRDBtDAR( R;R)R,R#R7R0RR/RR5R3R(((Rt? s        "0