@ tefigel interface(REQUEST,IDFLAG) ||||||| | | Implement mapping of sisendel field identifier to | the context-specific identifiers, according to the | project naming conventions. | | A good 90% of the complexity of this script is due to the | mixed-case identifiers like bookID and BookID (the difficulty | arises from the uppercase "D" after the lowercase "ook") | as opposed to identifiers like bookId or BOOK_ID or BookId or | book_id, which are used differently in different contexts. | | To conform to the project convention two adjusting | parameters (DB.table.column_id and DB.table.member_id) | have been defined. This is particularly useful for | acronyms like ISBN. | | | REQUEST should be either column_id, member_id, or column_id_uc | (uc = uppercase) | IDFLAG can be void or "localname" | ||||||| | | Handle column_id and column_id_uc, taking care of special id's | defined via adjusting parameters | if REQUEST~column_id eval HASSPECIALID MEMBEROF_DB_table=1 and HASSPECIALID FIELD_DB_table_column_id# if HASSPECIALID#1 | | No special id. | Things get more complex when the field is imported; | depending moreover on the context where it is used. | eval USEIMPORTID ISIMPORT=1 and USEIMPORTID IDFLAG#local_name if USEIMPORTID if REQUEST=column_id_uc set DBID=IMPORTFIELD_IdId else set DBID=IMPORTFIELD_idId endif else if REQUEST=column_id_uc set DBID=FIELD_IdId else set DBID=FIELD_idId endif endif else | | Special id - the commented out warning would warn entity | designers when they use ".....ID" identifiers | set DBID=FIELD_DB_table_column_id endif else | | Simple case of "member_id". Default is "AnIdentifier" unless the | adjusting parameter has been used | if REQUEST=member_id if FIELD_DB_table_member_id= set DBID=FIELD_IdId else set DBID=FIELD_DB_table_member_id endif else warning(~cur_input(): bad argument 'REQUEST') endif endif retvalue=DBID