001 package railo.runtime.tag; 002 003 import railo.runtime.exp.TagNotSupported; 004 import railo.runtime.ext.tag.TagImpl; 005 006 /** 007 * Used in a cfgrid, cfgridupdate allows you to perform updates to data sources directly from edited 008 * grid data. The cfgridupdate tag provides a direct interface with your data source. 009 * The cfgridupdate tag applies delete row actions first, then INSERT row actions, and then UPDATE row 010 * actions. If an error is encountered, row processing stops. 011 * 012 * 013 * 014 **/ 015 public final class GridUpdate extends TagImpl { 016 017 private String password; 018 private String datasource; 019 private String providerdsn; 020 private boolean keyonly; 021 private String tablename; 022 private String connectstring; 023 private String dbtype; 024 private String grid; 025 private String dbname; 026 private String username; 027 private String dbserver; 028 private String tableowner; 029 private String provider; 030 private String tablequalifier; 031 032 033 /** 034 * constructor for the tag class 035 **/ 036 public GridUpdate() throws TagNotSupported { 037 throw new TagNotSupported("GridUpdate"); 038 } 039 040 041 /** set the value password 042 * If specified, password overrides the password value specified in the ODBC setup. 043 * @param password value to set 044 **/ 045 public void setPassword(String password) { 046 this.password=password; 047 } 048 049 /** set the value datasource 050 * The name of the data source for the update action. 051 * @param datasource value to set 052 **/ 053 public void setDatasource(String datasource) { 054 this.datasource=datasource; 055 } 056 057 /** set the value providerdsn 058 * Data source name for the COM provider (OLE-DB only). 059 * @param providerdsn value to set 060 **/ 061 public void setProviderdsn(String providerdsn) { 062 this.providerdsn=providerdsn; 063 } 064 065 /** set the value keyonly 066 * Yes or No. Yes specifies that in the update action, the WHERE criteria is confined to the key 067 * values. No specifies that in addition to the key values, the original values of any changed fields 068 * are included in the WHERE criteria. Default is Yes. 069 * @param keyonly value to set 070 **/ 071 public void setKeyonly(boolean keyonly) { 072 this.keyonly=keyonly; 073 } 074 075 /** set the value tablename 076 * The name of the table to update. 077 * @param tablename value to set 078 **/ 079 public void setTablename(String tablename) { 080 this.tablename=tablename; 081 } 082 083 public void setConnectstring(String connectstring) { 084 this.connectstring=connectstring; 085 } 086 087 /** set the value dbtype 088 * The database driver type 089 * @param dbtype value to set 090 **/ 091 public void setDbtype(String dbtype) { 092 this.dbtype=dbtype; 093 } 094 095 /** set the value grid 096 * The name of the cfgrid form element that is the source for the update action. 097 * @param grid value to set 098 **/ 099 public void setGrid(String grid) { 100 this.grid=grid; 101 } 102 103 /** set the value dbname 104 * The database name (Sybase System 11 driver and SQLOLEDB provider only). If specified, 105 * dbName overrides the default database specified in the data source. 106 * @param dbname value to set 107 **/ 108 public void setDbname(String dbname) { 109 this.dbname=dbname; 110 } 111 112 /** set the value username 113 * If specified, username overrides the username value specified in the ODBC setup. 114 * @param username value to set 115 **/ 116 public void setUsername(String username) { 117 this.username=username; 118 } 119 120 /** set the value dbserver 121 * For native database drivers and the SQLOLEDB provider, specifies the name of the database 122 * server computer. If specified, dbServer overrides the server specified in the data source. 123 * @param dbserver value to set 124 **/ 125 public void setDbserver(String dbserver) { 126 this.dbserver=dbserver; 127 } 128 129 /** set the value tableowner 130 * For data sources that support table ownership (such as SQL Server, Oracle, and Sybase SQL 131 * Anywhere), use this field to specify the owner of the table. 132 * @param tableowner value to set 133 **/ 134 public void setTableowner(String tableowner) { 135 this.tableowner=tableowner; 136 } 137 138 /** set the value provider 139 * COM provider (OLE-DB only). 140 * @param provider value to set 141 **/ 142 public void setProvider(String provider) { 143 this.provider=provider; 144 } 145 146 /** set the value tablequalifier 147 * For data sources that support table qualifiers, use this field to specify the qualifier for the 148 * table. The purpose of table qualifiers varies across drivers. For SQL Server and Oracle, the qualifier 149 * refers to the name of the database that contains the table. For the Intersolv dBase driver, the qualifier 150 * refers to the directory where the DBF files are located. 151 * @param tablequalifier value to set 152 **/ 153 public void setTablequalifier(String tablequalifier) { 154 this.tablequalifier=tablequalifier; 155 } 156 157 158 /** 159 * @see javax.servlet.jsp.tagext.Tag#doStartTag() 160 */ 161 public int doStartTag() { 162 return SKIP_BODY; 163 } 164 165 /** 166 * @see javax.servlet.jsp.tagext.Tag#doEndTag() 167 */ 168 public int doEndTag() { 169 return EVAL_PAGE; 170 } 171 172 /** 173 * @see javax.servlet.jsp.tagext.Tag#release() 174 */ 175 public void release() { 176 super.release(); 177 password=""; 178 datasource=""; 179 providerdsn=""; 180 keyonly=false; 181 tablename=""; 182 connectstring=""; 183 dbtype=""; 184 grid=""; 185 dbname=""; 186 username=""; 187 dbserver=""; 188 tableowner=""; 189 provider=""; 190 tablequalifier=""; 191 } 192 }