#
#	action sequence for object action setTextfragAttribute
#
# determine SQL statement and key values
#
qexpression
	proc: {
		copycvars(this,"action,objtype,attribute,key,value");
		this.attmap = {
			type:			{ colname:	'type' },
			ident:			{ colname:	'ident' },
			version:		{ colname:	'version' },
			parent:			{ colname:	'parent' },
			child_index:	{ colname:	'child_index' },
			frag_index:		{ colname:	'frag_index' },
			data:			{ colname:	'data' }};
		this.attctl = this.attmap[this.attribute];
		if (!this.attctl) {
			this.errcoll.collect(null,"attribute "+this.attribute+" not defined in attribute control map for textfrag",this.attmap);
			break proc;
		}
		this.att_updatesql = "update CCTEXTFRAG set "+this.attctl.colname+"=::value:: where ident=::ident:: and child_index=::child_index:: and frag_index=::frag_index::";
		this.keyparts = this.key.split("%%%");
		if (this.keyparts.length!=3) {
			this.errcoll.collect(null,"object select key does not have 3 parts",{key: this.key});
			break proc;
		}
		this.ident = 		this.keyparts[0];
		this.child_index =	this.keyparts[1];
		this.frag_index =	this.keyparts[2];
	}

#
# perform the appropriate SQL
#
sql_varname		att_updatesql
named_params	value,ident,child_index,frag_index

# complete
goto done

#
# finally, set chain query to re-display all text fragments
#
done:
qexpression 
	this.query.chain_query = {dataname: "alltextFragInfo"};
	if (this.query.whereclause) {
		this.query.chain_query.whereclause = this.query.whereclause;
	}