Page Index Toggle Pages: 1 [2] 
Topic Tools
Hot Topic (More than 10 Replies) Eblah (Read 11,585 times)
AK108
YaBB Legends (Inactive)
*
Offline



Posts: 3,321
Re: Eblah
Reply #15 - Sep 24th, 2005 at 9:33pm
Post Tools
We could establish accepted names for all things that are common (such as username, password, displayname, aim, iamadmin, iamgmod) and then have them translate in and out. You would indeed have to expand it whenever a board came out with a new feature, but the output driver should use regexes to verify that the data is the expected type (icq is all numbers, iamadmin is on or off).

Say Board X came out with a "GlobalX ID" for their profile. The Board X input converter could feed the UDO a "_global_x_id" field (preceding it with an underscore to indicate that it isn't standerd yet) and set the version of the field to "Board X 1.2.3". Then, an output converter can later try to understand it, and if it passes the version test and and the regex test, it could be converted. Otherwise, it'll be discarded.

So it might look something like this (input driver)
Code
Select All
# In the convertmembers sub
$memberin{$username}{'_global_x_id'} = $file[12];
$datasourcegen = 'Board X'; # Generic name
$datasourcever = '1.2.3'; # Specific version 



Output
Code
Select All
if($datasourcegen eq 'Board X') {
     $memberout{$username}{'globalx'} = $memberin{$username}{'_global_x_id'};
     if($memberout{$username}{'globalx'} =~ /[^A-Za-z0-9_\-]/) {undef $memberout{$username}{'globalx'};} # Not safe to accept it if there's even one bad character
} 



Just an idea.
« Last Edit: Sep 24th, 2005 at 9:34pm by AK108 »  

Do not PM me for support.
Back to top
WWW  
IP Logged
 
Matt Siegman
YaBB Legends (Inactive)
*
Offline



Posts: 3,380
Location: Wichita, KS
Re: Eblah
Reply #16 - Sep 25th, 2005 at 9:30am
Post Tools
I like the idea of prefixing non-standard names with _.  I'll add it to the doc soon.
  

-- Matt Siegman 8) Wish List
Back to top
 
IP Logged
 
Tea-Master
YaBB Legends (Active)
*
Offline



Posts: 3,628
Location: Germany
Re: Eblah
Reply #17 - Sep 26th, 2005 at 5:16pm
Post Tools
hm ak good point about the data validation. every board may expect the data being in an other format. i.e. what about usernames? the one board allows characters like $% and the other does not. replace them with an underscore and if it results into an other existing name add a number right behind it? what about telephone numbers? passwords? userid's (loginname instead of number)? and the list goes on... in some cases replacements will become a very big issue resulting in lots of changes (if the field is referenced several times in different places).
what ever the converter does it has to display a list of changes it made of course.

Quote:
I was thinking that maybe we should have an official Driver list, where the drivers conform to our standards, including naming in their UDOs.  This would be the best way to ensure that the user downloads quality/working software.

What do you think?

yes that should be established for sure.
  

--> also known as Agent Zed Wink
Back to top
 
IP Logged
 
AK108
YaBB Legends (Inactive)
*
Offline



Posts: 3,321
Re: Eblah
Reply #18 - Sep 27th, 2005 at 3:24am
Post Tools
The way I see it, there are three possible ways to handle variables that don't pass the test. The first way is to totally discard the data. I suggest that this is the way to handle non-standard data, as the UDO doesn't have an official format for it.
The second way is to do some replacements on the characters that aren't allowed, like removing or replaceing all invalid characters with, say, "Q".
The third way is to specially handle a data type from a specific board. This is the best way of the three (keeps the most data) but is the most impractical due to the sheer number of board types out there.

The second way is probably the best (and required pretty much for required fields) way to handle it. Maybe the converter should provide a few validation routines to make checking things easy? Or are regexs good enough?
« Last Edit: Sep 27th, 2005 at 3:24am by AK108 »  

Do not PM me for support.
Back to top
WWW  
IP Logged
 
Tea-Master
YaBB Legends (Active)
*
Offline



Posts: 3,628
Location: Germany
Re: Eblah
Reply #19 - Sep 27th, 2005 at 11:55am
Post Tools
regexs are great but i think there should be a validator class which provides methods to validate the data. regexs are always a point of failure and often misunderstood so we may end up with changing regexes often and in lots of places.
  

--> also known as Agent Zed Wink
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Topic Tools
 
  « Board Index ‹ Board  ^Top