incubator-jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Louis.Mast...@log-net.com
Subject Re: accepting forms input in a wiki page
Date Thu, 05 Feb 2009 16:06:58 GMT
Bob:

I have this functioning in our wiki and our account managers love it.  It 
is a set of wiki forms that access our time tracking DB.  The form is 
pretty simple:

[{FormOpen form='wallydevtestingform'}]

! Developer Testing
__Release:__ [{FormInput type='text' name='release'}] \\
__Cutoff:__ [{FormInput type='text' name='cutoff'}] \\

[{FormInput type='checkbox' name='showDetails' value='showDetails' 
checked='true'}]Show Details\\
[{FormInput type='checkbox' name='useLinks' value='useLinks'}]Link WIDs\\
[{FormInput type='checkbox' name='plainTables' value='plainTables'}]Use 
Plain Tables\\

[{FormInput type='submit' name='submit' value='Submit'}]
[{FormOutput form='wallydevtestingform' 
handler='com.lognet.wiki.plugin.WallyWIDDevTestingPlugin'}]

[{FormClose}]

You need to make a custom plugin to handle the form request (
com.lognet.wiki.plugin.WallyWIDDevTestingPlugin).

The plugin is a bit long for this email, but I can send it to you if you 
like.  It basically gets the parms from the form, connects to the DB, gets 
the data and sends it back to the front-end.  There is an example of this 
(minus the DB interaction) at 
http://www.jspwiki.org/wiki/ContributedFormHandlers

It should take you less than an hour to implement.

-Lou



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOG-NET, Inc.
The Logistics Network Management System
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230 Half Mile Road
Third Floor
Red Bank, NJ 07701
PH: 732-758-6800
FAX: 732-747-7497
http://www.LOG-NET.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CONFIDENTIAL & PRIVILEGED
Unless otherwise indicated or if obvious from the nature of the content, 
the information contained herein is privileged and confidential 
information/work product. The communication is intended for the use of the 
individual or entity named above.  If the reader of this transmission is 
not the intended recipient, you are  hereby notified that any 
dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please 
notify the sender immediately by telephone (732-758-6800) or by electronic 
mail (postmaster@LOG-NET.com), and destroy any copies, electronic, paper 
or otherwise, which you may have of this communication.  Thank you.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Bob Paige <bobpaige@gmail.com> 
02/05/2009 10:29 AM
Please respond to
jspwiki-user@incubator.apache.org


To
jspwiki-user@incubator.apache.org
cc

Subject
accepting forms input in a wiki page






Can someone point me to how I could implement the following (and how
reasonable it might be):

I frequently get requests from our support people to look up something in
our transaction database. It is a relatively simple query for me, but I 
have
to use a SQL client to get the information. They ask me to do it because
they either don't know how or don't have access to the database and the
tools.

Is there some way I could build a wiki page with a couple data entry 
fields
that, when submitted, performs the required database query(s) and outputs
some formatted response? I don't need to update the page content at all; 
I'm
really just using it as a simple forms interface to a database.

The (typical) example I am looking at right now is like this:

Inputs:
* client ID
* unit ID

Outputs:
* batch in which it was processed
* date it was processed
* status (success/fail/error message)

There are more complicated examples, but this is a good start.

Is this doable with existing plugins (excellent!) or do I just need to 
write
a plugin (certainly doable; I've written several already).

-- 
Bobman


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message