Download Latest Version fieldgate_dm3_reporter_v-0-3a_2013-0125_PUBLIC.tar (92.2 kB)
Email in envelope

Get an email when there's a new version of fieldgate_dm3_reporter

Home
Name Modified Size InfoDownloads / Week
fieldgate_dm3_reporter_v-0-3a_2013-0125_PUBLIC.tar 2013-01-25 92.2 kB
Z_REVISION_HISTORY.txt 2013-01-25 2.4 kB
Z_README.txt 2011-01-06 7.7 kB
Z_LICENSE.txt 2011-01-06 35.1 kB
fieldgate_dm3_reporter_v-0-3_2011-0106_PUBLIC.tar 2011-01-06 92.2 kB
Z_how_to_mimic_a_fieldgate_in_xml.pdf 2010-06-11 33.1 kB
fieldgate_dm3_reporter_v-0-2_2010-0604_PUBLIC.tar 2010-06-11 71.7 kB
Totals: 7 Items   334.4 kB 0
fieldgate_dm3_reporter
---------------------------------------------------------------------
# ... quick and dirty export of system data to fieldgate xml via email
---------------------------------------------------------------------
---------------------------------------------------------------------
COPYRIGHT

 THE FOLLOWING 10 LINES MAY NOT BE REMOVED, but may be
     appended with additional contributor info.
 fieldgate_dm3_reporter Copyright (C) 2009, 2010
 V. Spinelli for Sorrento Lactalis American Group
 This program comes with ABSOLUTELY NO WARRANTY;
 As this program is based on [and has dependancies]
 the content of GPL and LGPL works, GPL is preserved.
 This is open software, released under GNU GPL v3,
 and you are welcome to redistribute it, with this
 tag in tact.
	... http://www.sorrentolactalis.com
	... http://www.spinellicreations.com
 A copy of the GPL should be included with this work.
 If you did not receive a copy, see...
 http://www.gnu.org/licenses/gpl-3.0.txt
---------------------------------------------------------------------
---------------------------------------------------------------------
CONTACT		
		Author			V. Spinelli
				Email:	Vince@SpinelliCreations.com
				Site:	http://spinellicreations.com
				Handle:	PoweredByDodgeV8

		Copyright Holder	Sorrento Lactalis American Group
				Email:	http://www.sorrentocheese.com/about/contact.html
				Site:	http://www.sorrentolactalis.com
---------------------------------------------------------------------
README...
---------------------------------------------------------------------
---------------------------------------------------------------------

REQUIREMENTS
------------

1- Python version 2.5 or greater

2- MySQLDb library for Python (http://sourceforge.net/projects/mysql-python/)

3- py-setproctitle library version 1.0 or greater (http://pypi.python.org/pypi/setproctitle

4- Linux (Preferred) / Unix / BSD / Windows ... whatever ...

5- mod_openopc (not really a requirement, as you can pull from any database, but
	we would hope that you would use this tool to export data gathered by
	mod_openopc!)

INSTALL
-------

1- unzip / untar the package and copy to ...
	- /opt/fieldgate_dm3_reporter
	- c:\fieldgate_dm3_reporter

2- edit the global options file (./options/options.opt)...
	# --------------------- RUNTIME -------------------------------------
	[global_runtime]
	FLAVOR:UNIX
	# operating system 
	# -- use UNIX for Linux, Unix, Solaris, BSD, etc, etc...
	# -- use WIN for Windows
	# --------------------- DATABASES -----------------------------------
	[global_mysql]
	DBIP:localhost
	# IPADDRESS, should be "localhost" or actual IP address
	# -- USE "QUOTES" FOR IF RUNNING THIS PROGRAM UNDER UNIX
	# -- DO NOT USE QUOTES IF RUNNING UNDER WIN
	DBUSERNAME:mysql
	DBPASSWORD:mysqlpassword
	# -- username and password for local db access (root)
	COMMITTRANSACTIONS:YES
	# -- for InnoDB and newer MyISAM databases, they are transactional,
	#    which requires commit statements after each query... valid
	#    answers are "YES" or "NO".
	DATABASE:mod_openopc
	# -- databases containing table to query...
	DATABASE_TABLE:BULKMODEL
	# -- table to query...
	# -------------------- MAILSERVER -----------------------------------
	[global_mail]
	MAIL_SERVER:192.168.2.1
	# -- IP address or DNS name of mail server... must be an open relay!
	MAIL_FROM:dirge@dirge.lactalis.us
	# -- email address of sender... it could be a real address or just one
	#    that is descriptive of the sending machine.
	MAIL_LOGIN_REQUIRED:NO
	# -- some mailservers require login to send mail.  If so, set this
	#    variable to "YES"... otherwise "NO".  
	# -- if login is required, we utilize STARTTLS authentication.
	MAIL_USERNAME:none
	MAIL_PASSWORD:none
	# -- credentials for sender if required, else, set to "none" and "none"
	# -------------------------------------------------------------------

3- for fieldgate dm3 server presets...

	copy template_EXPORT.fg3 to the 'options' folder, and edit as follows:

		# --------------------- FIELDGATE DM3 EXPORT PRESET -----------------
		#
		# --------------------- DATABASES -----------------------------------
		[preset_mysql]
		DATABASE_FIELD_DATESTAMP:DATESTAMP
		# -- field containing datestamp in standard format (from mod_openopc)
		DATABASE_FIELD_ID:BULKNAME
		# -- identifying field, that which makes each item unique
		DATABASE_FIELD_ID_SEARCH:CHEM_BLDG_
		# -- unique part of search string (beginning) that ID's the items you 
		#    want to search for.
		DATABASE_FIELD_ID_SEARCH_QUANTITY:7
		# -- number of unique items that you wish to export
		DATABASE_FIELD_REPORT:INVENTORY_QUANTITY
		# -- field containing result, or what we want to return
		DATABASE_FIELD_COMMENT:gal
		# -- comment or unit of measure that we wish to append to the
		#    returned value / result
		# --------------------- EXPORT --------------------------------------
		[preset_export]
		EXPORT_HEADER:<?xml version="1.0" encoding="iso-8859-1" ?><fieldgate ser="06021001" tag="Sorrento Lactalis USA Buffalo NY" type="full" devices="all">
		# -- content to include at top of export file, always
		EXPORT_FOOTER:</fieldgate>
		# -- content to include at bottom of export file, always
		EXPORT_TIME_FORMAT:UTC
		# -- valid options are UTC (for GMT with no offset) or LOCAL
		#    for local time, which may include daylight savings time if you
		#    have a system that is running it
		EXPORT_TIME_FORMAT_DETAILS:%Y%m%d-%H%M%S
		# -- python datetime.* friendly datestamp format... see manpage for
		#    python datetime for help.
		# -- "%Y%m%d-%H%M%S" will yield (ex) 20100502-072433
		#    for Year = 2010, Month = 05, Day = 02, Hour = 07 (AM),
		#    Minute = 24, Seconds = 33.
		# -------------------- MAILSERVER -----------------------------------
		[preset_mail]
		MAIL_TO:fg@endressdm3.com
		# -- REAL email address of recipient of export data.
		MAIL_SUBJECT:Fieldgate Inventory Report - MY COMPANY NAME - TOPIC OF MY REPORT
		# -- subject line of email... what do you wnat to call it.
		# -------------------------------------------------------------------

4- for webpage auto reporting presets...

	copy template_WEB_AUTO_REPORT.web to the 'options' folder, and edit as follows:

		# --------------------- WEB AUTO REPORT PRESET ----------------------
		#
		# --------------------- EXPORT --------------------------------------
		[preset_export]
		EXPORT_BASE_URL:http://dirge.lactalis.us
		# -- base URL of the HTTP Server, without trailing slash
		#    for example... http://myserver.com.
		EXPORT_URL:http://dirge.lactalis.us/seer_2/index.php
		# -- URL of the report page you wish to export
		#    for example... http://myserver.com/seer_2/index.php
		# -------------------- MAILSERVER -----------------------------------
		[preset_mail]
		MAIL_TO:vincent.spinelli@lactalis.us
		# -- REAL email address of recipient of export data.
		MAIL_SUBJECT:Web Auto Report - Sorrento Lactalis USA Buffalo - Test
		# -- subject line of email... what do you wnat to call it.
		# -------------------------------------------------------------------

EXPORT
------

1- simply call "fieldgate_dm3_reporter.py EXPORT [preset-name]" and your chosen items will be 
   rolled into an email, in XML format, which is parseable by the Endress-Hauser Supply 
   Care DM3 servers.

WEB_AUTO_REPORT
---------------

1- simply call "fieldgate_dm3_reporter.py WEB_AUTO_REPORT [preset-name]" and your chosen
   webpage will be emailed, in HTML-WEBMAIL format, to the clients listed in the preset
   file.

HELP
----

1- simply call "fieldgate_dm3.py HELP" and the help dialogue will popup.

---------------------------------------------------------------------
---------------------------------------------------------------------
Source: Z_README.txt, updated 2011-01-06