1 message in org.apache.perl.embperlRFC on new module
FromSent OnAttachments
Aaron JohnsonJan 16, 2002 2:25 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:RFC on new moduleActions
From:Aaron Johnson (solu@gina.net)
Date:Jan 16, 2002 2:25:38 pm
List:org.apache.perl.embperl

I am attempting to make some previous code more genric and release as a module. This email is a brief summary of what the moudle will do. I currently do all but one or two of these in the product I am abstracting this from.

This module is for easy generation of HTML tables add allowing the contents of results to be drilled down through to get to limited set of data quickly.

This module attempts to create dynamic tables that "fold" By fold it is infered that when clicking on a value in a column that the data source will be reread and only the values that match the clicked on item will be shown. We also allow for multiple folds, which means that if values from multiple columns are clicked on then the folds will build on top of each other.

This module will most likely not be generic enough to not require some advanced confirguration, either inside this file or via an external script. Most likely it will configured via a method as well.

This process attempts to not use cookies, this may change at some point, but presently a complex URL parsing system is used and works well.

The resulting table rows are set with an attribute on object creation and a paging system allow the user to move to a particular point.

There will be a limited search facility was well in the initial releases.

A hash for each column to be displayed/handled needs to be created with the following values:

action_and_fold - indicates that a field has an action* that can happen and it can also be folded ( 0 or 1 )

add_to_url - extra column values and name that should be added to the URL for a column. this covers special cases where additional values may be needed when a particular action is taken. this is an annon array

align - how should the column be aligned when displayed (center, left, right)

allows_direction - is the column sortable by asc/desc 1 or 0

key_columns - these are the columns that need to refereneced for a match when doing an update and in some cases a select

href - page other then present a column should link to, by default the "key" will be the URL for these along with the current values for folding so the "main" page can maintain state.

modify - this is a subroutine that is run on the values returned

regex - this is how it should be matched from a URL generally a base URL is created from the previous post, if a column has been folded it needs to remove the additional URL data from it so the fold is removed. multiple folds on a single column is NOT currently supported

special_colors (BAD NAME) - this is a hash of color with an array of values for a pattern match. if a column needs to be a particular color for all values matching "fish" this could be done here. each color MUST have a corresponding entry in your style sheet example entry: 'red' => [ 'hello','hi','greetings' ], 'blue' => [ 'bye','good bye','see ya' ],

table - what database table is the value of this column being read from. the database table name in correct case, it will be used in the creation of SQL queries(?)

column_header - the name of the header on the final output (defaults to the column name if null)

url_param - what to look for in the URL, this will most likely be discarded in favor for column name instead. (original code used abbreviated names in the URL)

Notes on the original idea that have yet to be worked through:

Column names need to be followed by ascend/desecending arrows

Previous folds sent must be remembered, that is all folds up to this point. This should NOT be done via session data.

* action - this is most likely a popup window that contains a small form from which you can modify the value of the column that it was clicked in. a screen refresh is froced after the form is completed to show the new data

I have modified the DBIx::XHTML_Table module to allow for some of the features mentioned above, but there is also the need for an query creation method/class. I have looked at Reltaions-Query are there others that someone might suggest?

This module will be stand alone, that is not based on a templating system or be mod_perl dependent.

The structure of the code is in an alpha/planning stage at this point.

Any feedback or questions are welcome.