ucEditGenerateFdf

Purpose

Used to generate an Adobe FDF file (PDF form data).

Applies To

Adobe Fdf screen

Signature

public FdfFile ucEditGenerateFdf (
      SesameSession s, 	// Session object
      Map params)	// Parameter map

Notes

Example

public FdfFile ucEditGeneratefdf(SesameSession session,
                                   Map values) throws Exception {

	  FdfFile f = new FdfFile();
	  f.setFileLocation(session);
	  Z.probe("entering FdfFile");
	  Connection dbconn = null;
	  String SYSDATE = Z.dbms.CURRENT_TIMESTAMP();
	  String today = "";
	  String sql = null;
	  SimpleDateFormat sdf = null;
	  String problemId = (String) values.get("ID");
	  HashMap udfHm = new HashMap();
	  try {
		dbconn = Z.pool.getConnection();
		Z.log.writeToLog(7, "PARAMS ARE >>>" + values);
		Z.log.writeToLog(7, "MDR problemId " + problemId);
		Z.log.writeToLog(7, "MDR udfHm " + udfHm);

        udfHm = setMDRValues (session, values, dbconn);
        
		f.setFields(udfHm);
		StringBuffer templateLocation = new StringBuffer(Z.extSiteURL);
		templateLocation.append("/pdf_templates/");
		templateLocation.append("Medwatch3500A.pdf");
		f.getFdfDoc().SetFile(templateLocation.toString());
		f.write();
	  } catch (SQLException sqle) {
		Z.log.writeToLog(Z.log.ERROR, "SQLException: " + sql);
		ErrorWriter.write(sqle, ErrorWriter.LOGERR);
	  } catch (Exception e) {
		ErrorWriter.write(e, 0);
	  } finally {
		if (dbconn != null) {
		  Z.pool.close(dbconn);
		}
	  }
	  return f;
	}