details: https://code.openbravo.com/erp/devel/pi/rev/4152ff6e040d changeset: 16899:4152ff6e040d user: Asier Lostalé <asier.lostale <at> openbravo.com> date: Fri Jun 22 08:58:59 2012 +0200 summary: fixed bug 20827: Not possible to add new columns to ad_column table related to bug 20365
Partially backed out fix #20365: field and element are not checked, just ad_column.columnname is checked with a different function to allow names that can be included for ad_colum.name. diffstat: src-db/database/model/functions/AD_ISJAVASCRIPTWORD.xml | 30 +++++++++++++++++ src-db/database/model/functions/AD_ISJAVAWORD.xml | 4 +- src-db/database/model/triggers/AD_COLUMN_TRG2.xml | 4 +- src-db/database/model/triggers/AD_ELEMENT_TRG.xml | 9 +---- src-db/database/model/triggers/AD_FIELD_TRG.xml | 6 +-- src-db/database/sourcedata/AD_MESSAGE.xml | 24 +------------- 6 files changed, 38 insertions(+), 39 deletions(-) diffs (166 lines): diff -r bdfd11161112 -r 4152ff6e040d src-db/database/model/functions/AD_ISJAVASCRIPTWORD.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src-db/database/model/functions/AD_ISJAVASCRIPTWORD.xml Fri Jun 22 08:58:59 2012 +0200 @@ -0,0 +1,30 @@ +<?xml version="1.0"?> + <database name="FUNCTION AD_ISJAVASCRIPTWORD"> + <function name="AD_ISJAVASCRIPTWORD" type="CHAR"> + <parameter name="word" type="VARCHAR" mode="in"> + <default/> + </parameter> + <body><![CDATA[/************************************************************************* +* The contents of this file are subject to the Openbravo Public License +* Version 1.1 (the "License"), being the Mozilla Public License +* Version 1.1 with a permitted attribution clause; you may not use this +* file except in compliance with the License. You may obtain a copy of +* the License at http://www.openbravo.com/legal/license.html +* Software distributed under the License is distributed on an "AS IS" +* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +* License for the specific language governing rights and limitations +* under the License. +* The Original Code is Openbravo ERP. +* The Initial Developer of the Original Code is Openbravo SLU +* All portions are Copyright (C) 2012 Openbravo SLU +* All Rights Reserved. +* Contributor(s): ______________________________________. +************************************************************************/ +BEGIN + --Prevents column names to generate conflicts with DAL's getters and setters + RETURN case when lower(WORD) in ('length') + THEN 'Y' ELSE 'N' END; +END AD_ISJAVASCRIPTWORD +]]></body> + </function> + </database> diff -r bdfd11161112 -r 4152ff6e040d src-db/database/model/functions/AD_ISJAVAWORD.xml --- a/src-db/database/model/functions/AD_ISJAVAWORD.xml Fri Jun 22 08:45:46 2012 +0200 +++ b/src-db/database/model/functions/AD_ISJAVAWORD.xml Fri Jun 22 08:58:59 2012 +0200 @@ -16,13 +16,13 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU -* All portions are Copyright (C) 2009-2012 Openbravo SLU +* All portions are Copyright (C) 2009-2010 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************/ BEGIN --Prevents column names to generate conflicts with DAL's getters and setters - RETURN case when lower(WORD) in ('class', 'length') + RETURN case when lower(WORD) in ('class') THEN 'Y' ELSE 'N' END; END AD_ISJAVAWORD ]]></body> diff -r bdfd11161112 -r 4152ff6e040d src-db/database/model/triggers/AD_COLUMN_TRG2.xml --- a/src-db/database/model/triggers/AD_COLUMN_TRG2.xml Fri Jun 22 08:45:46 2012 +0200 +++ b/src-db/database/model/triggers/AD_COLUMN_TRG2.xml Fri Jun 22 08:58:59 2012 +0200 @@ -57,9 +57,11 @@ IF AD_IsJavaWord(:new.Name)='Y' THEN RAISE_APPLICATION_ERROR(-20000, '@NotAllowedColumnName@ "'||:new.name||'" @ReservedJavaWord@') ; END IF; - IF AD_IsJavaWord(:new.ColumnName)='Y' THEN + + IF AD_IsJavaScriptWord(:new.ColumnName)='Y' THEN RAISE_APPLICATION_ERROR(-20000, '@NotAllowedDBColumnName@ "'||:new.ColumnName||'" @ReservedJavaWord@') ; END IF; + /** * Create Sequence for DocumentNo and Value columns diff -r bdfd11161112 -r 4152ff6e040d src-db/database/model/triggers/AD_ELEMENT_TRG.xml --- a/src-db/database/model/triggers/AD_ELEMENT_TRG.xml Fri Jun 22 08:45:46 2012 +0200 +++ b/src-db/database/model/triggers/AD_ELEMENT_TRG.xml Fri Jun 22 08:58:59 2012 +0200 @@ -17,7 +17,7 @@ * parts created by ComPiere are Copyright (C) ComPiere, Inc.; * All Rights Reserved. * Contributor(s): Openbravo SLU - * Contributions are Copyright (C) 2001-2012 Openbravo, S.L.U. + * Contributions are Copyright (C) 2001-2009 Openbravo, S.L.U. * * Specifically, this derivative work is based upon the following Compiere * file and version. @@ -35,13 +35,6 @@ IF AD_isTriggerEnabled()='N' THEN RETURN; END IF; - IF AD_IsJavaWord(:new.Name)='Y' THEN - RAISE_APPLICATION_ERROR(-20000, '@NotAllowedElementName@ "'||:new.Name||'" @ReservedJavaWord@') ; - END IF; - IF AD_IsJavaWord(:new.ColumnName)='Y' THEN - RAISE_APPLICATION_ERROR(-20000, '@NotAllowedDBColumnName@ "'||:new.ColumnName||'" @ReservedJavaWord@') ; - END IF; - -- Insert AD_Element Trigger IF INSERTING diff -r bdfd11161112 -r 4152ff6e040d src-db/database/model/triggers/AD_FIELD_TRG.xml --- a/src-db/database/model/triggers/AD_FIELD_TRG.xml Fri Jun 22 08:45:46 2012 +0200 +++ b/src-db/database/model/triggers/AD_FIELD_TRG.xml Fri Jun 22 08:58:59 2012 +0200 @@ -17,7 +17,7 @@ * parts created by ComPiere are Copyright (C) ComPiere, Inc.; * All Rights Reserved. * Contributor(s): Openbravo SLU - * Contributions are Copyright (C) 2001-2012 Openbravo, S.L.U. + * Contributions are Copyright (C) 2001-2008 Openbravo, S.L.U. * * Specifically, this derivative work is based upon the following Compiere * file and version. @@ -31,10 +31,6 @@ IF AD_isTriggerEnabled()='N' THEN RETURN; END IF; - IF AD_IsJavaWord(:new.Name)='Y' THEN - RAISE_APPLICATION_ERROR(-20000, '@NotAllowedFieldName@ "'||:new.Name||'" @ReservedJavaWord@') ; - END IF; - IF INSERTING THEN INSERT diff -r bdfd11161112 -r 4152ff6e040d src-db/database/sourcedata/AD_MESSAGE.xml --- a/src-db/database/sourcedata/AD_MESSAGE.xml Fri Jun 22 08:45:46 2012 +0200 +++ b/src-db/database/sourcedata/AD_MESSAGE.xml Fri Jun 22 08:58:59 2012 +0200 @@ -15677,7 +15677,7 @@ <!--31081540E4474C3FAD77A7117D2C9BA0--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> <!--31081540E4474C3FAD77A7117D2C9BA0--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> <!--31081540E4474C3FAD77A7117D2C9BA0--> <VALUE><![CDATA[ReservedJavaWord]]></VALUE> -<!--31081540E4474C3FAD77A7117D2C9BA0--> <MSGTEXT><![CDATA[is a reserved java keyword.]]></MSGTEXT> +<!--31081540E4474C3FAD77A7117D2C9BA0--> <MSGTEXT><![CDATA[is a reserved keyword.]]></MSGTEXT> <!--31081540E4474C3FAD77A7117D2C9BA0--> <MSGTYPE><![CDATA[I]]></MSGTYPE> <!--31081540E4474C3FAD77A7117D2C9BA0--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> <!--31081540E4474C3FAD77A7117D2C9BA0--></AD_MESSAGE> @@ -17422,17 +17422,6 @@ <!--785509D8468543F4AF2FE440D9511CF1--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> <!--785509D8468543F4AF2FE440D9511CF1--></AD_MESSAGE> -<!--7872761C619E485182E19AD8B06AA2F9--><AD_MESSAGE> -<!--7872761C619E485182E19AD8B06AA2F9--> <AD_MESSAGE_ID><![CDATA[7872761C619E485182E19AD8B06AA2F9]]></AD_MESSAGE_ID> -<!--7872761C619E485182E19AD8B06AA2F9--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> -<!--7872761C619E485182E19AD8B06AA2F9--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> -<!--7872761C619E485182E19AD8B06AA2F9--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> -<!--7872761C619E485182E19AD8B06AA2F9--> <VALUE><![CDATA[NotAllowedFieldName]]></VALUE> -<!--7872761C619E485182E19AD8B06AA2F9--> <MSGTEXT><![CDATA[Not allowed field name]]></MSGTEXT> -<!--7872761C619E485182E19AD8B06AA2F9--> <MSGTYPE><![CDATA[E]]></MSGTYPE> -<!--7872761C619E485182E19AD8B06AA2F9--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> -<!--7872761C619E485182E19AD8B06AA2F9--></AD_MESSAGE> - <!--788D557BF85D47B2A8C0365C0C14B004--><AD_MESSAGE> <!--788D557BF85D47B2A8C0365C0C14B004--> <AD_MESSAGE_ID><![CDATA[788D557BF85D47B2A8C0365C0C14B004]]></AD_MESSAGE_ID> <!--788D557BF85D47B2A8C0365C0C14B004--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> @@ -18340,17 +18329,6 @@ <!--98A052B862994F0BB4AA32BC78434C07--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> <!--98A052B862994F0BB4AA32BC78434C07--></AD_MESSAGE> -<!--99F2343EA0D34540AEE18D182EBBCD67--><AD_MESSAGE> -<!--99F2343EA0D34540AEE18D182EBBCD67--> <AD_MESSAGE_ID><![CDATA[99F2343EA0D34540AEE18D182EBBCD67]]></AD_MESSAGE_ID> -<!--99F2343EA0D34540AEE18D182EBBCD67--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> -<!--99F2343EA0D34540AEE18D182EBBCD67--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> -<!--99F2343EA0D34540AEE18D182EBBCD67--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> -<!--99F2343EA0D34540AEE18D182EBBCD67--> <VALUE><![CDATA[NotAllowedElementName]]></VALUE> -<!--99F2343EA0D34540AEE18D182EBBCD67--> <MSGTEXT><![CDATA[Not allowed element name]]></MSGTEXT> -<!--99F2343EA0D34540AEE18D182EBBCD67--> <MSGTYPE><![CDATA[E]]></MSGTYPE> -<!--99F2343EA0D34540AEE18D182EBBCD67--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> -<!--99F2343EA0D34540AEE18D182EBBCD67--></AD_MESSAGE> - <!--9A6B5D3A2FC544C79ABB21C6029DC24D--><AD_MESSAGE> <!--9A6B5D3A2FC544C79ABB21C6029DC24D--> <AD_MESSAGE_ID><![CDATA[9A6B5D3A2FC544C79ABB21C6029DC24D]]></AD_MESSAGE_ID> <!--9A6B5D3A2FC544C79ABB21C6029DC24D--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Openbravo-commits mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbravo-commits
