From: scottmk Date: Mon, 21 Dec 2009 15:44:40 +0000 (+0000) Subject: 1. It's okay for a virtual field not to have a datatype. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1e40b7cc4123ed3f0dab98576435b2151287c2b5;p=evergreen%2Ftadl.git 1. It's okay for a virtual field not to have a datatype. 2. The "array_position" attribute is flagged by a warning as deprecated. M Open-ILS/src/c-apps/idlval.c git-svn-id: svn://svn.open-ils.org/ILS/trunk@15206 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/c-apps/idlval.c b/Open-ILS/src/c-apps/idlval.c index 4ee5f089a4..1e25334e01 100644 --- a/Open-ILS/src/c-apps/idlval.c +++ b/Open-ILS/src/c-apps/idlval.c @@ -1038,9 +1038,17 @@ static int val_fields( Class* class, const char* id, xmlNodePtr fields ) { @return 1 if errors found, or 0 if not. Rules: - - id attribute must be present with a non-empty value. + - attribute names are limited to: "name", "virtual", "label", "datatype", "array_position", + "selector", "i18n", "primitive". + - "name" attribute is required. - label attribute, if present, must have a non-empty value. - - virtual attribute, if present, must have a value of "true" or "false". + - virtual and i18n attributes, if present, must have a value of "true" or "false". + - if the datatype attribute is present, its value must be one of: "bool", "float", "id", + "int", "interval", "link", "money", "number", "org_unit", "text", "timestamp". + + Warnings: + - A non-virtual field should have a datatype attribute. + - Attribute "array_position" is deprecated. */ static int val_one_field( Class* class, const char* id, xmlNodePtr field ) { int rc = 0; @@ -1087,7 +1095,9 @@ static int val_one_field( Class* class, const char* id, xmlNodePtr field ) { xmlFree( dt_str ); // To do: make sure that the namespace is reporter } else if( !strcmp( attr_name, "array_position" ) ) { - ; // Ignore for now, but it should be deprecated + printf( "Line %ld: WARNING: Deprecated array_position attribute " + "for field \"%s\" in class \"%s\"\n", + xmlGetLineNo( field ), ((char*) field_name ? : ""), id ); } else if( !strcmp( attr_name, "selector" ) ) { ; // Ignore for now } else if( !strcmp( attr_name, "i18n" ) ) { @@ -1116,7 +1126,7 @@ static int val_one_field( Class* class, const char* id, xmlNodePtr field ) { attr = attr->next; } - if( warn && DT_NONE == datatype ) { + if( warn && (!is_virtual) && DT_NONE == datatype ) { printf( "Line %ld: WARNING: No datatype attribute for field \"%s\" in class \"%s\"\n", xmlGetLineNo( field ), ((char*) field_name ? : ""), id ); }