Home > Contents > Index >
Expanded TOC | Accordion TOC | Annotated TOC | Index
CatalogManager
Executes a CatalogManager command.
There are two variants of this method:
- CatalogManager (Variant 1)
:Executes a CatalogManager command.
- CatalogManager (Variant 2) : Executes a CatalogManager command and accepts a handle for a BatchContext object.
ICS.CatalogManager
Use this method to execute a CatalogManager command. The list of CatalogManager commands follows:
Syntax
public boolean CatalogManager(FTValList vIn)Parameters
vIn- List of name/value pairs passed to CatalogManager. The
ftcmdparameter is required and specifies the CatalogManager command to execute. Any other parameters depend on the CatalogManager command.Nullindicates that the required parameters are passed in existing Sites variables.
Returns
Returns a boolean value;
trueif CatalogManager was invoked successfully.Error Numbers
Use
to check the results of the specific CatalogManager command.GetErrnoExample
The following example deletes a row from the
Moviestable and then examines the return value to determine whether the method worked properly:
ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "deleterow"); inList.setValString("tablename", "Movies"); inList.setValString("contentname", "Ishtar"); inList.setValString("Delete uploaded file(s)", "yes"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Movie deleted. <br>" ); } else { //handle error }
ICS.CatalogManager
Use this method to execute a CatalogManager command. This variant accepts a handle for a BatchContext object.
Syntax
public boolean CatalogManager(FTValList vIn, Object oBatchContext)Parameters
vIn- List of name/value pairs passed to CatalogManager. The
ftcmdparameter is required and specifies the CatalogManager command to execute. Any other parameters depend on the CatalogManager command.Nullindicates that the required parameters are passed in existing Sites variables.
oBatchContext- Handle to the
BatchContextobject.
Description
Use this method to execute a CatalogManager command. This variant accepts a handle for a BatchContext object. The follwing is a list of the CatalogManager commands that accept a Batch Context object:
Returns
Returns
trueif CatalogManager was invoked successfully.Error Numbers
Use
to check the results of the specific CatalogManager command.GetErrnoExample
The following example deletes a row from the
Moviestable and then examines the return value to determine whether the method worked properly:
ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "deleterow"); inList.setValString("tablename", "Movies"); inList.setValString("contentname", "Ishtar"); inList.setValString("Delete uploaded file(s)", "yes"); ics.CatalogManager(inList); int err = ics.(); if( err==0 ) { ics.StreamEvalBytes( "Movie deleted. <br>" ); } else { //handle error }GetErrno
ICS.CatalogManager
Adds a row to a table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
addrow.
tablename (required)- Specify the name of the table to which you plan to add a row.
columnname_folder (optional)- Specify a subfolder name to store the uploaded file. The file is then stored under the upload folder and the subfolder. The upload folder is specified in the SystemInfo table's
defdircolumn. Note that you can have multiple upload columns.
- Upload columns are designated by the prefix
url. The column name in the table must begin withurl(for example,urltext). The argument name must include the table's column name with_folderappended to the column name (for example,urltext_folder).
columname_file(required for non-binary files)- Specify the name of the file you want to upload. The column name in the table must begin with
url(for example,urltext). The argument name must have_fileappended to the table's column name (for example,urltext_file).
columnname(optional)- Value of each column in the row to be added. The
columnnameparameter is a table column name.
Description
The
addrowcommand adds a row to a table. TheaddnodesTreeManager command can be committed in the same transaction.
Note
When adding a row to a table of type obj (an object catalog), the system will create
Variables.newid, which contains the system-assigned unique ID for the new record.Error Numbers
Possible values of
errnoinclude:
Value Description-103 No such table.-104 No table definition.-105 Database error.
Example
The following example adds a row to the Movies table:
ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "addrow"); inList.setValString("tablename", "Movies"); inList.setValString("Reviewer", "John Doe"); success = ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Movie added. <br>" ); } else { result = ics.GetErrno(); //handle error }See Also
ICS.CatalogManager
Adds multiple rows to a table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (Required)- Value must be set to
addrows.
tablename (Required)- Table name to add rows.
columnname_folder (Optional)- A subfolder name to store the uploaded file. The file is then stored under the upload folder and the subfolder. The upload folder is specified in the SystemInfo table's
defdircolumn. You can have multiple upload columns.
- Upload columns are designated by the prefix
url. The column name in the table must begin with url (for example,urltext). The argument name must include the table's column name with_folderappended to the column name (for example,urltext_folder).
columnname (Required for non-binary files)- The name of the file you want to upload. The
columnnameis a table column name. The column name in the table must begin withurl(for example,urltext). The argument name must include the table's column name with_folderappended to the column name (for example,urltext_folder)
Description
The addrows command adds multiple rows to a table.
Error Numbers
Possible values of
errnoinclude:
Value Description -103 No such table. -104 No table definition. -105 Database error.
Example
The following example adds two rows to the
Moviestable:ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "addrows"); inList.setValString("tablename", "Movies"); inList.setValString("urlIshtar_movieFolder", "Ishtar"); inList.setValString("urlCasablanca_movieFolder", "Casablanca"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Movies added. <br>" ); } else { //handle error
}See Also
addrow , addrows , addrowtext
ICS.CatalogManager
Adds a row to a table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
addrowtext.
tablename (required)- Name of the table to which to add text.
urlcolumnname_folder(optional)- For every file upload column (column name starts with
url), you can use a parameter namedurlcolumnname_folderto store the file in a subfolder under the default upload folder for the table.
columnname_file(optional)- Used to specify a name for a file that will be created on the server. If not provided, the system generates a file name and gives it the extension
.txt.
columnname(optional)- Value of each column in the row to be added.
columnnameis a table column name.
Description
The
addrowtextcommand adds a row to a table. If the table contains an upload column, instead of requiring a file upload, text can be uploaded and Sites automatically creates a file to store the uploaded text.Error Numbers
Possible values of
errnoinclude:
Value Description -103 No such table. -104 No table definition. -105 Database error.
Example
This example adds a row to the
reviewstable:ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "addrowtext"); inList.setValString("tablename", "reviews"); inList.setValString("id", "1234"); inList.setValString("title", "Ishtar"); inList.setValString("subhead", "A film that's lost in the desert."); ics.CatalogManager(inList) int err = ics.GetErrno(); if (err==0) { ics.StreamEvalBytes( "Movie added. <br>" ); } else { int result = ics.GetErrno(); //handle error }See Also
ICS.CatalogManager
Adds a user.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
addUser.
username (required)- Name of user to add.
password (required)- Password for the user. The password is stored in an encrypted format.
useracl (required)- Access Control List. Comma-separated list of groups.
Error Numbers
Possible value of
errno:
Value Description -105 Database error.
Example
This example adds the user
Editorwhose password isedit1234and gives the userContentEditorprivileges. These values can be modified when the form is displayed.FTValList inList = new FTValList(); ics.ClearErrno(); inList.setValString("ftcmd", "addUser"); inList.setValString("username", "Editor"); inList.setValString("password", "edit1234"); inList.setValString("useracl", "ContentEditor"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "User added. <br>" ); } else { //handle error }See Also
ICS.CatalogManager
Commits a record from a revision-tracked table into the Revision Tracking subsystem.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
commit.
tablename (required)- Name of the table.
asset (required)- Value of the primary key for the row to commit.
checkout (optional)- Indicates lock status of record after commit. Set value to
trueto indicate the record will still be locked by user after the commit.
annotation (optional)- Comment describing the new revision.
Description
The
commitcommand commits a record from a revision-tracked table into the Revision Tracking subsystem. The current user must have the record locked and have write access to the tracked table to perform this operation.Error Numbers
Possible values of
errnoinclude:
Value Description -103 No such table. -104 No table definition. -105 Database error.
Example
This example commits the currently locked record whose primary key value is
95137.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "commit"); inList.setValString("tablename", "reviews"); inList.setValString("asset", "95137"); inList.setValString("checkout", "true"); inList.setValString("annotation", "Fixed error."); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Record committed. <br>" ); } else { //handle error
}See Also
ICS.CatalogManager
Creates a table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
createtable.
tablename (required)- Name of the table to create.
systable (required)- Allows differentiation between ContentCatalog (
systable=no) and ObjectCatalog (systable=obj). This defaults to ContentCatalog (systable=no).
uploadDir (required)- Server-side folder path to contain uploaded files.
aclList (optional)- Comma-separated list of ACLs. When security is enabled, only members of the ACLs can access content in the table.
colvalueN(required)- Database-specific field type for column.
Nis 0 (zero) for the first column, 1 for the second column, etc.
colnameN(required)- Column field name. Each
colnameparameter corresponds to a column in the table.Nis 0 (zero) for the first column, 1 for the second column, and so forth.
Description
The
createtablecommand creates a table. The table's primary key field name is defined in the Sites properties file (futuretense.ini).The default primary key used by CatalogManager is defined in the property
cc.contentkey. Unlike a custom property for primary keys, thecc.contentkeyproperty does not restrict the name of the tables you create. The Object table column, version, is reserved for future use.Error Numbers
Possible values of
errnoinclude:
Value Description -22 Table already exists. -105 Database error.
Example
The following example uses the
cc.contentkeyproperty when creating a new table calledExampleTable:ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "createtable"); inList.setValString("tablename", "ExampleTable"); inList.setValString("systable", "no"); inList.setValString("checkout", "true"); inList.setValString("uploaddir", "/export/home/public"); inList.setValString("colname0", "CS.Property.cc.contentkey"); inList.setValString("colvalue0", "varchar(10)"); inList.setValString("colname1", "description"); inList.setValString("colvalue1", "varchar(24)"); inList.setValString("colname2", "quantity"); inList.setValString("colvalue2", "CS.Property.cc.integer"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Table created. <br>" ); } else { //handle error }To specify the primary key in the properties file (
futuretense.inifile), you must use the following syntax:
tablenameKeyThe
KinKeymust be capitalized; for example, the following is valid:
cc.TestKey = testnameNote that
tablenamemust also be namedTest; otherwise the table name will not get created.See Also
ICS.CatalogManager
Deletes the log file (
futuretenseip_address.txt) if per-IP address logging is enabled.Parameters
An
FTValListcontaining the following name/value pair:
ftcmd (required)- Value must be set to
deletelog.
Description
The
deletelogcommand deletes the log file (futuretenseip_address.txt) if per-IP address logging is enabled. Enable per-IP address logging by setting theft.dblproperty, found in the Sites properties file (futuretense.ini), toyes.This command is useful for removing the existing log file so that you can create a new one when debugging. When the application server restarts and Sites is called the first time, Sites attempts to delete all previous log files, regardless of whether per-IP address logging is enabled. This means that the Sites log file will be deleted as well as any other
.TXTfiles in the directory where the logs are stored.Error Numbers
Possible value of
errno:
Value Description -300 File not found.
Example
This example deletes the log via a URL:
ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "deletelog"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Log deleted. <br>" ); } else { //handle error
}See Also
ICS.CatalogManager
Deletes a revision of a row from a revision-tracked table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
deleterevision.
tablename (required)- Name of the tracked table.
asset (required)- Value of the primary key for the row to obtain history.
version (optional)- Possible values are:
first- history of earliest revision of record.last- history of most recent revision of record.#- history of a specific revision number.date- history of the record to whichever revision was current at the specified date. The date must be in SQL format (yyyy-mm-dd hh:mm:ss) and is expected to be GMT.Description
The
deleterevisioncommand deletes a revision of a row from a revision-tracked table. The current user must havertadminaccess to the tracked table to perform this operation.Error Numbers
Possible values of
errnoinclude:
Value Description-103 No such table.-104 No table definition.-105 Database error.
Example
This example deletes version
5of the row inmovieswhose primary key value is95137.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "deleterevision"); inList.setValString("tablename", "movies"); inList.setValString("asset", "95137"); inList.setValString("version", "5"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Revision deleted. <br>" ); } else { //handle error }See Also
ICS.CatalogManager
Deletes a row in a table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
deleterow.
tablename (required)- Name of the table containing the row to delete.
Delete uploaded file(s) (optional)- Value should be set to
"yes"if upload files associated with the row should be deleted. Default is "no".
primarykey (optional)primarykeyis the column name of the primary key column. The value is the value of row's primary key.
tablekey (optional)- Use the
tablekeyparameter if you want to delete rows based on a value other than the primary key. The value oftablekeyis the column name of the column you will use to perform the deletion. For example, if you want to delete a table based on the value in thetitlecolumn, thetablekeyparameter looks as follows:
inList.setValString("tablekey", "title");tablekeyvalue (optional)- Value in the
tablekeycolumn of the row you want to delete. For example, if you want to delete a row with a value ofJawsin thetitlecolumn, thetablekeyvalueparameter looks as follows:
inList.setValString("tablekeyvalue", "Jaws");- This parameter is required only if the
tablekeyparameter is used.
Description
The
deleterowcommand deletes a row in a table. TheaddnodesTreeManager command can be committed in the same transaction.There are two options you can use to delete a row with this command:
- If you want to delete using the primary key, you must set the following parameters:
ftcmdtablename[primarykey column name]- If the
primarykeyisid, you must have a variable calledid set.- If you want to delete zero or more rows that match some alternate column value, you must set the following parameters:
ftcmdtablenametablekeytablekeyvalue
Note
This is valid only if the
primarykeycolumn does not have a variable set.Error Numbers
Possible value of
errno:
Value Description -105 Database error.
Example
The following examples remove two rows from the
moviestable.
id (primary key) rating title 1 G Beauty and The Beast 2 PG The Princess Bride 3 R The Godfather
The first example uses the primary key column to delete a row:
ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "deleterow"); inList.setValString("tablename", "movies"); inList.setValString("id", "1"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Row deleted. <br>" ); } else { //handle error }Example using a column other than the primary key column to delete a row:
ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "deleterow"); inList.setValString("tablename", "movies"); inList.setValString("tablekey", "title"); inList.setValString("tablekeyvalue", "The Princess Bride"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Row deleted. <br>" ); } else { //handle error }After both rows have been removed, the resulting table will look as follows:
id (primary key) rating title 3 R The Godfather
See Also
ICS.CatalogManager
Deletes multiple rows in a table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Values must be set to "
deleterows".
tablename (required)- Name of the table containing the rows to delete.
primarykeyN (required)- Value of row's primary key. The
primarykeyparameter is the primary key's column name. The value ofNcorresponds to the row number--in the resultset--that you want to delete.
Delete uploaded file(s)(optional)- Value should be set to "
yes" if the upload files associated with the row should be deleted. Default is "no".
Description
The deleterows command deletes multiple rows in a table.
Error Numbers
Possible value of
errno:
Value Description -105 Database error.
Example
The following example deletes two rows from the
TopMoviestable:
id Director Title133Charlie ChaplinModern Times137Buster KeatonThe General145Clint EastwoodA Perfect World148Rob ReinerThe Princess Bride
ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "deleterows"); inList.setValString("tablename", "TopMovies"); inList.setValString("id0", "137"); inList.setValString("id1", "145"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Rows deleted. <br>" ); } else { //handle error }See Also
ICS.CatalogManager
Deletes a table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- The literal value
deletetable.
tablename (required)- The name of the table to delete.
Description
The
deletetablecommand deletes a table. This command does not delete the upload storage folder.Error Numbers
Possible values of
errno:
Value Description-103tablenamedoes not exist.-105 Database error.
Example
The following example deletes the table named
moviereviews.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "deletetable"); inList.setValString("tablename", "moviereviews"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Table deleted. <br>" ); } else { //handle error }See Also
ICS.CatalogManager
Deletes a user.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
delUser.
username (required)- Name of the user to delete.
Error Numbers
Possible value of
errno:
Value Description -105 Database error.
Example
The following example deletes the user
joe.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "delUser"); inList.setValString("username", "joe"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "User deleted. <br>" ); } else { //handle error }See Also
ICS.CatalogManager
Modifies the fields of a row in a table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to "
editrow".
tablename (required)- Name of the table whose row will be edited.
primarykey (required)- Value of row's primary key. The
primarykeyparameter is the primary key's column name.
columnname (optional)- The information in the field you are editing. The columnname parameter is the name of the column to be edited.
tablekey (optional)- Use the
tablekeyparameter if you want to update rows based on a value other than the primary key. The value oftablekeyis the column name of the column you will use to perform the update. For example, if you want to update a table based on the value in thetitlecolumn, thetablekeyparameter looks as follows:
inList.setValString("tablekey", "title");tablekeyvalue (optional)- Value in the
tablekeycolumn of the row you want to update. For example, if you want to update a row with a value ofJawsin thetitlecolumn, thetablekeyvalueparameter looks as follows:
inList.setValString("tablekeyvalue", "Jaws");- This parameter is required only if the
tablekeyparameter is used.
Description
The
editrowcommand modifies the fields of a row in a table. The fields in the row are modified with the new values. If a url field is edited, the content of the associated server-side upload file is modified to contain the new value. Thus, a user can pass text to update the back-end storage for a given url column value.Error Numbers
Possible values of
errnoinclude:
Value Description -103 No such table. -104 No table definition. -105 Database error.
Example
This example edits a movie title in the
moviestable.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "editrow"); inList.setValString("tablename", "movies"); inList.setValString("id", "2"); inList.setValString("title", "The African Queen"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Editing successful. <br>" ); } else { //handle error }See Also
addrowtext,editrow,replacerow,updaterow
ICS.CatalogManager
Modifies the fields for multiple rows in a table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
editrows.
tablename (required)- Name of the table containing rows to be edited.
primarykeynameN (optional)- The
primarykeynameparameter is the name of the column you want to use as the primary key. The value ofNcorresponds to the row number to be edited. For example, if you want to edit the values in row 0 of the table, you would use the following code:
inList.setValString("id0", "1");columnnameN(optional)- The
columnameparameter is the name of the column that you want to edit. The value ofNcorresponds to the row number--in the resultset--that you want to edit. For example, if you want to edit the value in thecommentsfield of row 0 of the table to read "miss it", you would use the following code:
inList.setValString("comments0", "miss it");Description
The
editrowscommand modifies the fields for multiple rows in a table. The fields in the row are modified with the new values. If a url field is edited, the content of the associated server-side upload file is modified to contain the new value.Error Numbers
Possible values of
errnoinclude:
Value Description -103 No such table. -104 No table definition. -105 Database error.
Example
This example edits the rows with
godzillaandtitanicin themoviestable, and changes the values of the comments column tomiss itandsee it, respectively.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "editrows"); inList.setValString("tablename", "movies"); inList.setValString("id0", "1"); inList.setValString("comments0", "miss it"); inList.setValString("id1", "2"); inList.setValString("comments1", "see it"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err == 0 ) { ics.StreamEvalBytes( "Rows edited. <br>"); } else { //handle error }See Also
editrow,replacerows,updaterows
ICS.CatalogManager
Displays a default HTML form for adding, deleting, modifying, or selecting rows from a table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
exportform.
tablename (required)- Name of the table that the form uses.
ftchoice (required)- Value must be set to
addrow,deleterow,updaterow, orreplacerow.
tablekeyvalue (optional)- If
ftchoiceisdeleterow,editrow, orupdaterow, the value for this input must be the primary key value for the record you want to delete or update. No value fortablekeyvaluecan be supplied whenftchoiceis set toaddrow.
Error Numbers
Possible value of
errno:
Value Description -105 Database error.
Example
The
updaterow,deleterow, andreplacerowoperations require that the specified row be selected by the value of its primary key. This example assumes that the column nameidis the primary key for any tablename specified.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "exportform"); inList.setValString("tablename", "SystemInfo"); inList.setValString("tablekeyvalue", "id"); inList.setValString("ftchoice", "updaterow"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Rows edited. <br>" ); } else { //handle error }See Also
addrow , deleterow , replacerow , selectrow(s) , updaterow
ICS.CatalogManager
Exports a per-IP address log.
Parameters
An
FTValListcontaining the following name/value pair:
ftcmd (required)- You must set the associated value to
exportlog.
Description
The
exportlogcommand exports a per-IP address log. You can enable per-IP address logging by setting theft.dblproperty, found in the Sites properties file (futuretense.ini), toyes.Error Numbers
Possible value of
errno:
Value Description -300 File not found.
Example
Although
exportlogcan be called from inside an element, it would be more commonly called as an argument to a URL. If your application server is WebLogic or WebSphere, the following URL will export the log:http://host:port/servlet/CatalogManager?ftcmd=exportlogIf your application server is iPlanet, the following URL will export the log:
http://host:port/NASapp/cs/CatalogManager?ftcmd=exportlogSee Also
ICS.CatalogManager
Flushes the internal memory cache for a table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
flushcatalog.
tablename (required)- Name of the table to flush.
Description
The
flushcatalogcommand flushes the internal memory cache for a table. This command is useful to clear a table's cache after a table update using a non-Sites mechanism.
flushcatalogcan also force cache clearing when the SQL used to select against a table has performed a join with other catalogs and the system may hold the cached information for either table.Error Numbers
Possible value of
errno:
Value Description -105 Database error.
Example
If your application server is WebLogic or WebSphere, the following URL flushes the cache for the
SystemInfotable.
http://host:port/servlet/CatalogManager?ftcmd=flushcatalog&tablename=SystemInfoIf your application server is iPlanet, the following URL flushes the cache for the
SystemInfotable.
http://host:port/NASapp/cs/CatalogManager?ftcmd=flushcatalog&tablename=SystemInfo
ICS.CatalogManager
Deletes all the page's cache file.
Parameters
Create an
FTValListcontaining the following name/value pairs:
ftcmd (required)- Specify
flushpage.
pagename (required)- Specify the name of page to be cleared from cache. The method will flush all pages having this name.
params (optional)- As of CS 5.0, these optional parameters no longer have any effect.
Example
The following example shows how to flush the page named
arts2from the disk cache.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "flushpage"); inList.setValString("pagename", "region/arts2"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Page flushed. <br>" ); } else { //handle error }
ICS.CatalogManager
Gets a revision history for rows in a revision-tracked table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
history.
tablename (required)- Name of the tracked table.
asset (required)- Value of the primary key for the row to obtain history.
version (optional)- Possible values are:
first- history of the earliest revision of the record.
last- history of the most recent revision of the record.
#- history of a specific revision number.
date- history of the record up to the revision current at the specified date. The date must be in SQL format (yyyy-mm-dd hh:mm:ss) and is expected to be GMT.
locker (optional)- Filters rows returned based on a user who has rows locked. If the current user does not have rtaudit privileges, you must specify a value for
LOCKER,CREATOR, or both. If you specify onlyLOCKER, the value must be the current user's name; otherwise, no data will be returned.
creator (optional)- Filters rows returned based on the user who created the row. If the current user does not have rtaudit privileges, you must specify a value for
LOCKER,CREATOR, or both. If you specify onlyCREATOR, the value must be the current user's name; otherwise, no data will be returned.
annotation (optional)- Filters rows returned based on the annotation of a row.
Description
The
historycommand gets a revision history for rows in a revision-tracked table.To obtain history for all rows, the current user must have
rtauditprivileges on the table. If the current user has read privileges on the table, only history on the revisions which the user has created or locked will be returned.Error Numbers
Possible values of
errnoinclude:
Value Description -103 No such table. -104 No table definition. -105 Database error.
Example
This example gets the history for the row in
movieswhose primary key value is95137.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "history"); inList.setValString("tablename", "movies"); inList.setValString("asset", "95137"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( success ) { //things to do if command is successful } else { //handle error }
ICS.CatalogManager
Locks a record for the current user in a revision-tracked table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
lock.
tablename (required)- Name of the tracked table.
asset (required)- Value of the primary key for the row to lock.
Description
The
lockcommand locks a record for the current user in a tracked table. Once a row is locked, the current user can modify fields in the row. The current user must have write access to the table.Error Numbers
Possible values of
errnoinclude:
Value Description -103 No such table. -104 No table definition. -105 Database error.
Example
This example locks the record whose primary key value is
95137inmovies.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "lock"); inList.setValString("tablename", "movies"); inList.setValString("asset", "95137"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Record locked. <br>" ); } else { //handle error }See Also
ICS.CatalogManager
Logs in, or authorizes, a user within an application.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
login.
username (required)- Name of existing user.
password (required)- Password of user.
system (optional)- Domain as hostname to validate with.
Error Numbers
Possible value of
errno:
Value Description -105 Database error.
Example
This example logs in user
Tomwith password ofoscar:ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "login"); inList.setValString("username", "Tom"); inList.setValString("password", "oscar"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "You are logged in. <br>" ); } else { //handle error }See Also
ICS.CatalogManager
Logs out a user from within an application.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd(required)- Value must be set to
logout.
killsession(optional)- If value is set to
true, destroys the session maintained on the server. This should only be done at the end of processing a given HTTP request since you can't recover or re-create a session until the next http connect is issued by the client. This is useful for web crawlers after they finish their crawl session.
Error Numbers
Possible value of
errno:
Value Description -105 Database error.
Example
The following example logs out the user.
ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "logout"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "You are logged out. <br>" ); } else { //handle error
}See Also
ICS.CatalogManager
Aborts a mirror operation in progress.
Parameters
An
FTValListcontaining the following name/value pair:
ftcmd (required)- Value must be set to
mirrorabort.
Error Numbers
Possible values of
errnoinclude:
Value Description0 Mirror operation succeeded.-105 Database error.-601 Returned frommirrorabortwhen a mirror operation is not currently in progress.-602 Mirror operation in progress.-603 Required variables are missing from themirrorrowsCatalogManager command.-604 The data (file) associated with a url column could not be found on the source machine.-605 The schema for a column on the source machine can not be determined.-606 No rows to mirror from the target system.-607 Current mirroring operation was aborted via themirrorabortcommand.-608 A connection could not be established to the mirror target server.-609 The network disconnected communication between the source and target machines.-610 An attempt was made to mirror from a machine where the database columns are mixed case to a system where the database columns are case-sensitive.-611 Mirror commit operation failed.-612 Target server returned an invalid configuration connection message.-613 Obsolete, will not be returned.-614 Could not create a temporary table on the target server.-615 Could not delete the temporary table.-616 Server does not support this mirror operation.-617 Table is not an Object table.-618 No tree nodes found matching thenidparameter ofFTTreeNode.
Example
The following example aborts a mirror operation.
ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "mirrorabort"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { //things to do if mirror abort is successful ); } else { //handle error }See Also
ICS.CatalogManager
Copies rows from a table in one database to a table in another database.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
mirrorrows.
tablename (required)- Name of the source table.
tablekey (required)- Name of the table column to perform a selection on. If the system does not find the key, it uses the primary key of the specified table as the selection column.
Contentnameis the default value. Seefuturetense.inito change this default.
tablekeyvalue (required)- Value in the
tablekeycolumn.
mirrorport (optional)- HTTP target port. Port 80 is used if a value is not specified.
mirrortarget (required)- Network name of the mirror target machine.
mirrorauthusername (optional)- Sites username to log into the target machine. Value is required if security is enabled on the mirror target.
mirrorauthpassword (optional)- Password associated with value of
mirrorauthusernameto log into the mirror target. Value is required if security is enabled on the mirror target.
useProxyServer (optional)- If value is
true, transmission should be routed through the proxy server. The proxy server and port to use are specified using thecs.mirrorproxyserverandcs.mirrorproxyportproperties.
cgiprefix (optional)- Specifies the application server type on the target system. For iPlanet Application Server, set it to:
/NASApp/CS/- For WebLogic and WebSphere, set it to:
/servletinimerge (optional)- Name of a property file on the target system that should be loaded before the mirroring operation proceeds. This parameter is used to define primary key values for tables on the target server.
secureCommunication (optional)- If
true, uses secure protocol (HTTPS) to transmit the data to the target server.
Error Numbers
Possible values of
errnoinclude:
Value Description0 Mirror operation succeeded.-105 Database error.-601 Returned frommirrorabortwhen a mirror operation is not currently in progress.-602 Mirror operation in progress.-603 Required variables are missing from themirrorrowscatalogmanagercommand.-604 The data (file) associated with a url column could not be found on the source machine.-605 The schema for a column on the source machine can not be determined.-606 No rows to mirror from the target system.-607 Current mirroring operation was aborted via themirrorabortcommand.-608 A connection could not be established to the mirror target server.-609 The network disconnected communication between the source and target machines.-610 An attempt was made to mirror from a machine where the database columns are mixed case to a system where the database columns are case-sensitive.-611 Mirror commit operation failed.-612 Target server returned an invalid configuration connection message.-613 Obsolete, will not be returned.-614 Could not create a temporary table on the target server.-615 Could not delete the temporary table.-616 Server does not support this mirror operation.-617 Table is not an Object table.-618 No tree nodes found matching thenidparameter ofFTTreeNode.
Example
This example passes mirror parameters that a user has entered in an HTML form to the
mirrorcommand.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "mirrorrows"); inList.setValString("tablename", "movies"); inList.setValString("tablekey", "id"); inList.setValString("tablekeyvalue", "your_server"); inList.setValString("mirrortarget", ""); inList.setValString("mirrorauthusername", "ContentServer"); inList.setValString("mirrorauthpassword", "FutureTense"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Mirroring successful. <br>" ); } else { //handle error }See Also
ICS.CatalogManager
Modifies a user.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
modifyUser.
username (required)- Name of the user to modify.
password (optional)- Password for the user. The password is stored in an encrypted format.
useracl (optional)- Access Control List. Comma-separated list of groups.
Error Numbers
Possible value of
errno:
Value Description -105 Database error.
Example
The following example modifies the user
Joe:FTValList inList = new FTValList(); ics.ClearErrno(); inList.setValString("ftcmd", "modifyuser"); inList.setValString("username", "joe"); inList.setValString("password", "fred"); inList.setValString("useracl", "ContentEditor"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "User modified. <br>" ); } else { //handle error }See Also
ICS.CatalogManager
Releases a lock on a row from a revision-tracked table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
release.
tablename (required)- Name of the tracked table.
asset (required)- Value of the primary key for the row to lock.
Description
The
releasecommand releases a lock on a row from a revision-tracked table. Only the user who has the row locked against the table may release it. This also reverts the row in the table to its last committed state, overwriting any changes the user made while the row was locked.Error Numbers
Possible values of
errnoinclude:
Value Description -103 No such table. -104 No table definition. -105 Database error.
Example
This example releases the locked record whose primary key value is
95137inmovies.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "release"); inList.setValString("tablename", "movies"); inList.setValString("asset", "95137"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Record released. <br>" ); } else { //handle error
}See Also
ICS.CatalogManager
Replaces an existing row in a table on a remote server by first deleting it, and then inserting the specified information into the row.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd(required)- Value must be set to
replacerow.
tablename (required)- Name of the table that contains the row to replace.
primarykey (optional)- Value of row's primary key. The
primarykeyparameter is the primary key's column name.
columnname (optional)- Each column in the row to be replaced.
columnnameis a table column name.
tablekey (optional)- Use the
tablekeyparameter if you want to update rows based on a value other than the primary key. The value oftablekeyis the column name of the column you will use to perform the update. For example, if you want to update a table based on the value in thetitlecolumn, thetablekeyparameter looks as follows:
inList.setValString("tablekey", "title");tablekeyvalue (optional)- Value in the
tablekeycolumn of the row you want to update. For example, if you want to update a row with a value ofJawsin thetitlecolumn, thetablekeyvalueparameter looks as follows:
inList.setValString("tablekeyvalue", "Jaws");- This parameter is required only if the
tablekeyparameter is used.
Description
The
replacerowcommand replaces an existing row in a table on a remote server by first deleting it, and then inserting the specified information into the row. Use thereplacerowcommand to clear the value of a column in a row.If the row specified by the
primarykeyvalue does not exist, then the row will be added to the table.Error Numbers
Possible values of
errnoinclude:
Value Description-103 No such table.-104 No table definition.-105 Database error.
Example
The following example replaces the existing row information for
Titanicwith information forThe Great Escape.
id title rating133Modern TimesG137The GeneralG145A Perfect WorldPG148The Princess BridePG 166 TitanicPG 13
ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "replacerow"); inList.setValString("tablename", "movies"); inList.setValString("id", "166"); inList.setValString("title", "The Great Escape"); inList.setValString("rating", "PG"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Row replaced. <br>" ); } else { //handle error }After the row has been replaced, the table looks as follows:
id title rating133Modern TimesG137The GeneralG145A Perfect WorldPG148The Princess BridePG 166 The Great EscapePG
See Also
editrow , updaterow , updaterow2
ICS.CatalogManager
Replaces multiple rows in a table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
replacerows.
tablename (required)- Name of the table that contains the rows to replace.
primarykeyN(optional)- Value of row's primary key. The
primarykeyparameter is the primary key's column name. The value ofNcorresponds to the row number--in the resultset--that you want to replace.
columnnameN(optional)- Each column in the row to be replaced.
columnnameis a table column name. The value ofNcorresponds to the row number--in the resultset--that you want to replace.
tablekeyN(optional)- Use the
tablekeyNparameter if you want to update rows based on a value other than the primary key. The value oftablekeyNis the column name of the column you will use to perform the update. The value ofNcorresponds to the row number--in the resultset--that you want to update. For example, if you want to update a table based on the value in thetitlecolumn, thetablekeyNparameter looks as follows:
inList.setValString("tablekey0", "title");tablekeyvalueN(optional)- Value in the
tablekeycolumn of the row you want to update. The value ofNcorresponds to the row number--in the resultset--that you want to update. For example, if you want to update a row with a value ofJawsin thetitlecolumn, thetablekeyvalueNparameter looks as follows:
inList.setValString("tablekeyvalue0", "Jaws");- This parameter is required only if the
tablekeyparameter is used.
Description
The
replacerowscommand replaces multiple rows in a table. If a value is not specified for a column, the column value is cleared.If the row specified by the
primarykeyNvalue does not exist, then the row will be added to the table.Error Numbers
Possible values of
errnoinclude:
Value Description-22 Table already exists.-103 No such table.-104 No table definition.-105 Database error.
Example
Consider a table named movies whose two rows contain the following information:
id Title Rating24Something About MaryR25The GodmotherR
The following example adds a third row and updates the second row of the preceding table:
movies:ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "replacerows"); inList.setValString("tablename", "movies"); inList.setValString("id0", "26"); inList.setValString("title0", "American Pie"); inList.setValString("rating0", "R"); inList.setValString("id1", "25"); inList.setValString("title1", "The Godfather"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Rows replaced. <br>" ); } else { //handle error }The modified table contains the following information; notice that the
Ratingfield for the modified title is left blank because it was not explicitly set in theupdaterowscommand:
id Title Rating24Something About MaryR25The Godfather26American PieR
See Also
ICS.CatalogManager
Reverts a row in a revision-tracked table to a previous revision.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
rollback.
tablename (required)- Name of the tracked table.
asset (required)- Value of the primary key for the row to roll back.
version (optional)- Possible values are:
first- roll back to earliest revision of record.last- roll back to most recent revision of record.#- roll back to a specific revision number.date- roll back the record to the revision that was current at the specified date. The date must be in SQL format (yyyy-mm-dd hh:mm:ss) and is expected to be GMT.Description
The
rollbackcommand reverts a row in a revision-tracked table to a previous revision. The current user must have the row locked and havertauditprivileges against the table to roll back the row. A row can be rolled back to its earliest revision, its most recent revision, a specific version number, or whatever revision was current at a specified date.Error Numbers
Possible values of
errnoinclude:
Value Description -103 No such table. -104 No table definition. -105 Database error.
Example
This example performs a rollback on the record whose primary key value is
95137to version5.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "rollback"); inList.setValString("tablename", "movies"); inList.setValString("asset", "95137"); inList.setValString("version", "5"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { ics.StreamEvalBytes( "Rollback successful. <br>" ); } else { //handle error }See Also
ICS.CatalogManager
Executes a query against a given table and displays records from a table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
selectrow(s).
tablename (required)- Name of the table to query.
tablekeyN (optional)- Name of the table column to perform a selection on, where
Nis a counter starting at 0 and ending at the number of rows -1. If the system does not find the key, it uses the primary key of the specified table as the selection column. The default primary key iscontentname. Change this default infuturetense.ini.
tablekeyvalue (required)- Value in the
tablekeycolumn of the row you want to select. For example, if you want to select a row with a value ofJawsin thetitlecolumn, thetablekeyvalueparameter looks as follows:
inList.setValString("tablekeyvalue", "Jaws");- This parameter can contain the
%wildcard.
Description
The
selectrow(s)command executes a query against a given table and displays records from a table. The rows displayed will match the criteria specified by the value of the parameters. CatalogManager assigns the returned HTML to thecshttpvariable.Example
This example selects the row whose
movienameisgodzilla.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "selectrow(s)"); inList.setValString("tablename", "Reviews"); inList.setValString("tablekey1", "title"); inList.setValString("tablekeyvalue", "Godzilla"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { //things to do when selectrow(s) is successful } else { //handle error }
ICS.CatalogManager
Sets the number of revisions stored for each row in a revision-tracked table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
setversions.
tablename (required)- Name of the tracked table.
numversions (required)- Number of revisions to be stored for each row in a tracked table.
Description
The
setversionscommand sets the number of revisions stored for each row in a revision-tracked table. The current user must havertadminprivileges for the table.Error Numbers
Possible values of
errnoinclude:
Value Description-103 No such table.-104 No table definition.-105 Database error.
Example
This example sets the maximum number of revisions for rows in the
moviestable to8.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "setversions"); inList.setValString("tablename", "movies"); inList.setValString("numversions", "8"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { //things to do when setversions is successful } else { //handle error }See Also
ICS.CatalogManager
Enables revision tracking operations for a table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
tracktable.
tablename (required)- Name of the table to track.
numversions (optional)- Maximum number of versions to store for each row. When the maximum is reached, the oldest version is removed. If the value of
numversionsis not specified or is set to 0, there is no limit to the number of revisions.
storage (optional)- Location to store revisions associated with a row in the table.
Description
The
tracktablecommand enables revision tracking operations for a table. The maximum number of revisions per row can be set, as well as the storage location for the revisions. Only users who havertadminprivileges for the table may track the table.Error Numbers
Possible values of
errnoinclude:
Value Description-103 No such table.-104 No table definition.-105 Database error.-1000 Revision tracking error. This error may be appearing because the user attempting to track the table does not havertadminprivileges.
Example
This example tracks the
reviewstable with a maximum of5versions for each row.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "tracktable"); inList.setValString("tablename", "Reviews"); inList.setValString("numversions", "5"); inList.setValString("storage", "c:/storage"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err == 0 ) { //things to do when tracktable is successful } else { //handle error }See Also
ICS.CatalogManager
Stops tracking a table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
untracktable.
tablename (required)- Name of the table to stop tracking.
Description
The
untracktablecommand stops tracking a table. Revision tracking operations will no longer be available on the table. Only users who havertadminprivileges for the table can stop tracking the table.Error Numbers
Possible values of
errnoinclude:
Value Description-103 No such table.-104 No table definition.-105 Database error.-1000 Revision tracking error. This error may appear because the user attempting to stop tracking the table does not havertadminprivileges.
Example
This example stops tracking on the
reviewstable.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "untracktable"); inList.setValString("tablename", "Reviews"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { //things to do when untracktable is successful } else { //handle error
}See Also
ICS.CatalogManager
Unlocks a locked row.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
unlockrecord.
tablename (required)- Name of the tracked table.
asset (required)- Value of the primary key for the row to unlock.
Description
The
unlockrecordcommand unlocks a locked row. Only the user who has the row locked or a user who hasrtadminprivileges for the table can unlock the row. Theunlockrecordcommand does not restore the row to its most recent revision.Error Numbers
Possible values of
errnoinclude:
Value Description -103 No such table. -104 No table definition. -105 Database error.
Example
This example unlocks the row in
movieswhose primary key value is95137.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "unlockrecord"); inList.setValString("tablename", "movies"); inList.setValString("asset", "95137"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { //things to do when unlockrecord is successful } else { //handle error }See Also
ICS.CatalogManager
Updates field values for a row in a table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
updaterow.
tablename (required)- Name of the table containing the row to be updated.
primarykey (optional)- Value of row's primary key. The
primarykeyparameter is the primary key's column name.
columnname (optional)- Each column in the row to be modified.
columnnameis a table column name.
tablekey (optional)- Use the
tablekeyparameter if you want to update rows based on a value other than the primary key. The value oftablekeyis the column name of the column you will use to perform the update. For example, if you want to update a table based on the value in thetitlecolumn, thetablekeyparameter looks as follows:
inList.setValString("tablekey", "title");tablekeyvalue (optional)- Value in the
tablekeycolumn of the row you want to update. For example, if you want to update a row with a value ofJawsin thetitlecolumn, thetablekeyvalueparameter looks as follows:
inList.setValString("tablekeyvalue", "Jaws");- This parameter is required only if the
tablekeyparameter is used.
Description
The
updaterowcommand updates field values for a row in a table. For each column and specified value, the existing column value is replaced with the incoming data for that column. Only the specified values are changed; you cannot clear a value in a table row or column by usingeditrowsorupdaterows. You must usereplaceroworupdaterow2.Error Numbers
Possible values of
errnoinclude:
Value Description -103 No such table. -104 No table definition. -105 Database error.
Example
The following example updates the comments in the
Moviestable for a given movie:ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "updaterow"); inList.setValString("tablename", "movies"); inList.setValString("id", "1234"); inList.setValString("comments", "three stars"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { //things to do when updaterow is successful } else { //handle error }See Also
editrow,replacerow,updaterow2
ICS.CatalogManager
Updates or clears values in columns for a row in a table
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
updaterow2.
tablename (required)- Name of the table containing the row to be updated.
primarykey (optional)- Value of row's primary key. The
primarykeyparameter name is the primary key's column name.
columnname(optional)- Each column in the row to be modified.
columnnameis a table column name.
tablekey (optional)- Use the
tablekeyparameter if you want to update rows based on a value other than the primary key. The value oftablekeyis the column name of the column you will use to perform the update. For example, if you want to update a table based on the value in thetitlecolumn, thetablekeyparameter looks as follows:
inList.setValString("tablekey", "title");tablekeyvalue (optional)- Value in the
tablekeycolumn of the row you want to update. For example, if you want to update a row with a value ofJawsin thetitlecolumn, thetablekeyvalueparameter looks as follows:
inList.setValString("tablekeyvalue", "Jaws");- This parameter is required only if the
tablekeyparameter is used.
updaterowNullColumns (optional)- A comma-separated list of columns that are to be cleared if no data is supplied when the user submits a form.
- Note that if this list is supplied, other columns are ignored and will not be cleared.
Description
Like the
updaterowcommand,updaterow2updates values in columns for a row in a table. However, where you cannot clear columns withupdaterow,updaterow2allows you to clear columns if there is no value for the specified column (for example, if there is no related field in the form, or if the field on the form was left blank).Error Numbers
Possible values of
errnoinclude:
Value Description -103 No such table. -104 No table definition. -105 Database error.
Example
The following example updates a row in the
moviestable:ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "updaterow2"); inList.setValString("tablename", "movies"); inList.setValString("id", "1234"); inList.setValString("comments", "three stars") ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { //things to do when updaterow2 is successful } else { result = ics.GetErrno(); //handle error
}See Also
editrow,editrows,replacerow
ICS.CatalogManager
Modifies field values for multiple rows in a table.
Parameters
An
FTValListcontaining the following name/value pairs:
ftcmd (required)- Value must be set to
updaterows.
tablename (required)- Name of the table containing rows to be updated.
primarykeyN(optional)- Value of row's primary key. The
primarykeyparameter is the primary key's column name. The value ofNcorresponds to the row number--in the resultset--that you want to update.
columnnameN(optional)- Each column in the row to be updated.
columnnameis a table column name. The value ofNcorresponds to the row number--in the resultset--that you want to update.
tablekeyN(optional)- Use the
tablekeyNparameter if you want to update rows based on a value other than the primary key. The value oftablekeyNis the column name of the column you will use to perform the update. The value ofNcorresponds to the row number--in the resultset--that you want to update. For example, if you want to update a table based on the value in thetitlecolumn, thetablekeyNparameter looks as follows:
inList.setValString("tablekey0", "title");tablekeyvalueN(optional)- Value in the
tablekeycolumn of the row you want to update. The value ofNcorresponds to the row number--in the resultset--that you want to update. For example, if you want to update a row with a value ofJawsin thetitlecolumn, thetablekeyvalueNparameter looks as follows:
inList.setValString("tablekeyvalue0", "Jaws");- This parameter is required only if the
tablekeyparameter is used.
Description
The
updaterowscommand modifies field values for multiple rows in a table. For fields other than url fields, the value of the field is modified. For url fields,updaterowsdeletes the file associated with the url field and modifies the url field to point to the newly uploaded file.Error Numbers
Possible values of
errnoinclude:
Value Description -103 No such table. -104 No table definition. -105 Database error.
Example
This example updates the rows with
godzillaandtitanicin themoviestable, and changes the values of the comments column tomiss itandsee it, respectively.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "updaterows"); inList.setValString("tablename", "movies"); inList.setValString("id0", "1"); inList.setValString("title0", "godzilla"); inList.setValString("comments0", "miss it"); inList.setValString("id1", "2"); inList.setValString("title1", "titanic"); inList.setValString("comments1", "see it"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { //things to do when updaterows is successful } else { //handle error }See Also
ICS.CatalogManager
Modifies field values or clears columns for multiple rows in a table.
Parameters
ftcmd (required)- Value must be set to "
updaterows2".
tablename (required)- Name of the table containing rows to be updated.
primarykeyN(required)- Value of row's primary key. The
primarykeyparameter is the primary key's column name. The value ofNcorresponds to the row number--in the resultset--that you want to update.
columnnameN(optional)- Each column in the row to be replaced.
columnnameis a table column name. The value ofNcorresponds to the row number--in the resultset--that you want to update.
tablekeyN(optional)- Use the
tablekeyNparameter if you want to update rows based on a value other than the primary key. The value oftablekeyNis the column name of the column you will use to perform the update. The value ofNcorresponds to the row number--in the resultset--that you want to update. For example, if you want to update a table based on the value in thetitlecolumn, thetablekeyNparameter looks as follows:
inList.setValString("tablekey0", "title");tablekeyvalueN(optional)- Value in the
tablekeycolumn of the row you want to update. The value ofNcorresponds to the row number--in the resultset--that you want to update. For example, if you want to update a row with a value ofJawsin thetitlecolumn, thetablekeyvalueNparameter looks as follows:
inList.setValString("tablekeyvalue0", "Jaws");- This parameter is required only if the
tablekeyparameter is used.
updaterowNullColumns (optional)- A comma-separated list of columns that are to be cleared if no data is supplied when the user submits a form. Note that If this list is supplied, other columns are ignored and will not be cleared.
Description
Like the
updaterowscommand, theupdaterows2command modifies field values for multiple rows in a table. However, where you cannot clear columns withupdaterows,updaterows2allows you to clear columns if there is no value for the specified column (for example, if there is no related field in the form). For url fields,updaterows2deletes the file associated with the url field and modifies the url field to point to the newly uploaded file.Error Numbers
Possible values of
errnoinclude:
Value Description -103 No such table. -104 No table definition. -105 Database error.
Example
This example updates the rows with
godzillaandtitanicin themoviestable, and changes the values of the comments column tomiss itandsee it, respectively.ics.ClearErrno(); FTValList inList = new FTValList(); inList.setValString("ftcmd", "updaterows2"); inList.setValString("tablename", "movies"); inList.setValString("id0", "2"); inList.setValString("title0", "godzilla"); inList.setValString("comments0", "miss it"); inList.setValString("id1", "8774"); inList.setValString("title"1, "titanic"); inList.setValString("comments1", "see it"); ics.CatalogManager(inList); int err = ics.GetErrno(); if( err==0 ) { //things to do when updaterows2 is successful } else { //handle error }See Also
Home > Contents > Index > ![]()
Oracle JAVA Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.