I did something like this in the past, if I understand what you need correctly.
I created a "super" table in the database that had 3 or 4 columns: primary key (unique), card type/name, table name, column name, column type, column size. Basically if you have card A, you would have records that look something like this:
1,A,Address,StreetOne,text,30 2,A,Address,StreetTwo,text,30 3,A,Address,City,text,20 4,A,Address,State,text,2 5,A,Address,ZipCode,text,10 6,A,Balance,BegBalance,number,9999.99 7,A,Balance,EndBalance,number,9999.99 ... ...
Then, when you are building your form, you query the database for all the records for that card type, and loop through them spitting out the HTML as needed.
I don't know about "fiendishly clever and simple" but it worked for me once I got it all arranged and setup.
John
On Tue, 01 Apr 2003 16:19:24 -0800, Sandra Patricia Hunter <[EMAIL PROTECTED]> wrote:
Thanks: I think just writing it down, Again, Helps me think it through. I've got the main steps you mention Mike, it's just that last little bit:
what do I do with this now?
I am going to play with string manipulation stuff and see where that gets
me.
Sandra Patricia Hunter Systems Development and Web Design
-----Original Message-----
From: mike jackson [mailto:[EMAIL PROTECTED] Sent: April 1, 2003 4:12 PM
To: 'Tomcat Users List'
Subject: RE: Getting pretty far off topic here
First things first, you need some standard way to determine the card type.
Then you need a configuration file which says do this for this card type.
This could be a series of rules to follow, or could be a list of objects to
instantiate to process the card type.
If it's going to go the object route you probably need to have a set of
interfaces that all different card handlers need to implement, and possibly
a super class of some sort.
Anyway, enjoy working on it.
--mikej -=----- mike jackson [EMAIL PROTECTED]
-----Original Message-----
From: Sandra Patricia Hunter [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 3:55 PM
To: 'Tomcat Users List'
Subject: RE: Getting pretty far off topic here
Here's some more info:
One database, several tables (about twenty).
The tables hold information about someone who uses the card, a cardholder.
Each card has a particular type.
Each card type uses different information, for example one card type may
need the cardholder's name and address, while another may only need to know
their number.
For the user (not to be confused with the cardholder) to use the system they
need to be able to work with each kind of card and ONLY the data that is
relevant to that card.
The user also needs to be able to add new card types that use particular
data. This is why I think I need to store the information about which fields
are relevant in a standard way. As new cards are added there needs to be a
process in place for storing the information about that card.
I don't know what a rule processor or a rules engine is.
My sense is that this is not a really complicated problem just one that needs a fiendishly clever and simple solution. That's all ;).
Sandra Patricia Hunter Systems Development and Web Design
-----Original Message-----
From: mike jackson [mailto:[EMAIL PROTECTED] Sent: April 1, 2003 3:42 PM
To: 'Tomcat Users List'
Subject: RE: Getting pretty far off topic here
1) Just to be sure, databases or tables? Or since it's Oracle, do you mean
different Schemas? If it's different schemas then I'd create synonyms into
a new schema for each of the different data sources (tables / schemas /
databases whatever).
2) Sounds like you need a rule processor. If it were me I'd look at what's
common between the different card types, and figure out how to determine
which card type you are working with. Then based on the card type you have
a rules engine, which may or may not load custom code for that card type.
Then again this sounds like you have a really elaborate need here, it's not
going to be really easy to point you in a direction unless we have a better
picture of what is going on.
--mikej -=----- mike jackson [EMAIL PROTECTED]
-----Original Message-----
From: Sandra Patricia Hunter [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 3:34 PM
To: 'Tomcat Users List'
Subject: Getting pretty far off topic here
I am stumped about how to manage a process.
Here is what I need to do:
I have several "cards". Each card accesses specific data from the database.
Each card accesses a different collection of data from different attributes
of different tables. For the user to work with the data (add, update, delete, search) the JSP
file must display the appropriate text boxes and drop down boxes for the
data relevant to that card. This will be different for each card.
There will be new cards created that will have their own collection of data.
The number of possible new cards is relatively infinite. That is why I can't
do a specific JSP file for each card type: the card types that exist now may
disappear and new ones may appear.
How do I store the names of fields that are relevant to that card so that I
can access them when I need to display data about that particular card? How
do I create new files of relevant fields when I create new cards?
I originally stored an SQL string that selects the relevant fields with the
table that holds other information about the card type. But what do I do
with it then? How do I take that SQL string and turn it into text boxes and
labels and drop down boxes?
Is there a better way of doing this that someone can think of?
Sandra Patricia Hunter Systems Development and Web Design
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]