[global] template=auto exportEnv=REQUEST_METHOD,REMOTE_ADDR type=db dbHost=localhost dbUser=username dbPassword=password dbDatabase=database formTitle=Extract [extract:Upload Extract] nextStep=commit label = { type=text width=40 label=Display label (40 characters max) verification=required maxLength=40 } comments = { type=textbox width=60 height=3 label=Comments verification=maxLength=4194304 dbNullValues=_blank_ } contact = { type=select allowNewValues valuesSource=db(localhost,username,password,database): label=Type of extract dbNullValues=- } dataGenStart = { type=date useCalendar useFreeform default=now label=Start of data generation } dataGenEnd = { type=date useCalendar useFreeform default=now label=End of data generation } refProtocol = { type=select valuesSource=db(localhost,username,password,database): label=Biomass production experiment ID dbNullValues=- } [load] script = { SELECT label, comments, contact_user_id AS contact, extract_type_id AS type, DATE_FORMAT(start_datagen, '%%#d-%%#b-%%#Y') AS dataGenStart, DATE_FORMAT(end_datagen, '%%#d-%%#b-%%#Y') AS dataGenEnd, reference_protocol_id AS refProtocol, other_protocol AS otherProtocol, detergent, other_detergent AS otherDetergent, volume, protein_concentration AS protConcentration, notebook_reference AS notebookRef, biomassexp_dbid AS biomassId FROM `extract` WHERE id = '%edit_id_' } [browse] fieldOrder=label,contact,type,dataGenStart,dataGenEnd,refProtocol,biomassId sort[dataGenStart]=start_datagen sort[dataGenEnd]=end_datagen fieldUrl[refProtocol]=%cgiUrl/%workflowViewCgi/protocol/%refProtocol_id maxRows=25 script = { SELECT e.id, e.label, e.comments, e.contact_user_id AS contact_id, u.name AS contact, ev.egval_value AS type, DATE_FORMAT(start_datagen, '%%#d-%%#b-%%#Y') AS dataGenStart, DATE_FORMAT(end_datagen, '%%#d-%%#b-%%#Y') AS dataGenEnd, p.id AS refProtocol_id, CONCAT(p.title,' ver ',p.version) AS refProtocol, other_protocol AS otherProtocol, detergent, other_detergent AS otherDetergent, volume, protein_concentration AS protConcentration, notebook_reference AS notebookRef, be.bm_dbid AS biomassId_Id, CONCAT(be.bm_date,' ',be.bm_localid,' - ',be.bm_title) AS biomassId FROM extract e LEFT JOIN user u ON (e.contact_user_id = u.id) LEFT JOIN enumvalue ev ON (e.extract_type_id = ev.egval_dbid) LEFT JOIN protocol p ON (e.reference_protocol_id = p.id) LEFT JOIN biomassexp be ON (e.biomassexp_dbid = be.bm_dbid) %sort_filters_ ORDER BY %sort_field_ %sort_direction_ LIMIT %start_record_, %maxRows } [view] fieldUrl[refProtocol]=%cgiUrl/%workflowViewCgi/protocol/%refProtocol_id script = { SELECT e.label, e.comments, e.contact_user_id AS contact_id, u.name AS contact, ev.egval_value AS type, DATE_FORMAT(start_datagen, '%%#d-%%#b-%%#Y') AS dataGenStart, DATE_FORMAT(end_datagen, '%%#d-%%#b-%%#Y') AS dataGenEnd, p.id AS refProtocol_id, CONCAT(p.title,' ver ',p.version) AS refProtocol, other_protocol AS otherProtocol, detergent, other_detergent AS otherDetergent, volume, protein_concentration AS protConcentration, notebook_reference AS notebookRef, be.bm_dbid AS biomassId_Id, CONCAT(be.bm_date,' ',be.bm_localid,' - ',be.bm_title) AS biomassId FROM extract e LEFT JOIN user u ON (e.contact_user_id = u.id) LEFT JOIN enumvalue ev ON (e.extract_type_id = ev.egval_dbid) LEFT JOIN protocol p ON (e.reference_protocol_id = p.id) LEFT JOIN biomassexp be ON (e.biomassexp_dbid = be.bm_dbid) WHERE e.id = '%view_id_' } [edit] template=editdone script = { UPDATE `extract` SET label = %label, comments = %comments, contact_user_id = %contact, extract_type_id = %type, start_datagen = STR_TO_DATE( %dataGenStart, '%%#e-%%#b-%%#Y' ), end_datagen = STR_TO_DATE( %dataGenEnd, '%%#e-%%#b-%%#Y' ), reference_protocol_id = %refProtocol, other_protocol = %otherProtocol, detergent = %detergent, other_detergent = %otherDetergent, volume = %volume, protein_concentration = %protConcentration, notebook_reference = %notebookRef, biomassexp_dbid = %biomassId WHERE `id` = %edit_id_ } [commit] template=done script = { INSERT INTO `extract` ( label, comments, contact_user_id, extract_type_id, start_datagen, end_datagen, reference_protocol_id, other_protocol, detergent, other_detergent, volume, protein_concentration, notebook_reference, biomassexp_dbid ) VALUES ( %label, %comments, %contact, %type, STR_TO_DATE( %dataGenStart, '%%#e-%%#b-%%#Y' ), STR_TO_DATE( %dataGenEnd, '%%#e-%%#b-%%#Y' ), %refProtocol, %otherProtocol, %detergent, %otherDetergent, %volume, %protConcentration, %notebookRef, %biomassId ) }