Ruben Safir wrote:
>Are you trying to use PHP with M?

Matthew King wrote:
>No, but if there was an m_php gateway that worked with GT.M, I would try
>to write some reporting chores accessed by a browser.

If PHP is not a necessary component of the solution (and even if it is) then 
M2Web
probably is or should be. (http://vista.vmth.ucdavis.edu/) M2Web is intended as 
a general
foundation for web enabling MUMPS applications. M2Web includes many MUMPS 
functions and
routines for working with HTML, CSS, Javascript, XML, HTTP, CGI, etc.

M2Web includes a general CGI interface for GT.M that makes it easy to provide 
interactive
web oriented MUMPS applications directly from Apache or other general web 
server.

For instance, if you had Apache configured on Linux to run m2web.cgi in 
response to a
relative URL such as "/m2web.cgi" or a local URL like 
"http://localhost/m2web.cgi"; or
"http://vista/"; or "http://localhost/~vista/m2web.cgi/"; etc. and a mumps 
routine example.m
like the following:

example ;MUMPS routine with simple examples for m2web
  q
hello1 ; no frills CGI response - SET htReturn to HTML text
  s htReturn="Hello World. Today is "_%DATE
  q
hello2 ; no frills CGI response - SET multiple texts into htReturn array
  ; -- equivalent to hello1 --
  s htReturn(1)="Hello World."
  s htReturn(2)="Today is "_%DATE
  q
hello3 ; no frills CGI response - WRITE HTML text
  ; -- equivalent to hello2 --
  d startOut^htCGI ;(start output) sends initial headers for CGI protocol
  w "Hello World.",!
  w "Today is "_%DATE,!
  q
hello4 ; more complete HTML output with standard page title, heading, footing, 
etc.
  s htReturn=$$page^html("Hello World.",,"Today is "_%DATE)
  q

Then to enable the subroutine hello4^example to respond to a GET request for 
the relative
URL "/m2web.cgi/hello", you would make a CGI resource entry to map the two 
together. You
would generally do this by filling out a simple form given by the URL 
"/m2web.cgi/resedit"
or (for illustration) you could set that up from a MUMPS command:

  set ^htCGI("resource","hello","GET")="hello4^example"

M2Web applications are restricted by default to require users to be logged in. 
To remove
that restriction for this example, you would SET the "NOSEC" attribute (No 
Security) on
the GET method of the given resource:

  set ^htCGI("resource","hello","GET","NOSEC")=1

To restrict the example to users with the Fileman programmer access code ("@"), 
SET the
corresponding "ACCESS" attribute:

  set ^htCGI("resource","hello","GET","ACCESS")="@"


There is also a "query" resource already defined that will produce a great many 
reports
from VistA data based on simple query parameters including:

  dbfile - a database file identifier, a Fileman file number or file name
  index - a cross reference identifer such as "B" or "Name" or
          a composite such as Patient.Name where Patient is a cross referenced
          pointer field (API exposes more complex variations)
  find - user input pattern to match against the iteration variables of the 
index
  filter - conditional expressions based on field values in the target data 
records
  format - the name of a stored format specification or a list of field 
expressions in
           context of a target record with optional formatting attributes, such 
as for
           left/right/center alignment, field width, decimal places, etc.
  layout - HTML table with one row per record, captioned fields, JSON (arrays or
           objects), XML, XLS, or free-form explicit list of tags to apply at 
each
           level of (list, record, data element, caption, field value).

There are live examples on the web site and many more can be easily constructed.

---------------------------------------
Jim Self
Systems Architect, Lead Developer
VMTH Computer Services, UC Davis
(http://www.vmth.ucdavis.edu/us/jaself)


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Hardhats-members mailing list
Hardhats-members@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to