On a related note...

The problem Adam tried to fix is one of the problems I have with how the scripting language is used. Here are some examples:

<set field="someField" value="${someMap.someElement}"/>
<set field="someField" from-field="someMap.someElement"/>

Both of those set elements do the same thing. The first example is (in my opinion) a hack - it should throw an exception. The value attribute should contain a constant value - not an expression.

The specific problem Adam tried to fix was:

<set field="someField" value="${groovy:...}"/>

Again, I believe that use of the set element should throw an exception. David suggested adding an attribute to the script element that would accept scriptlets (or script fragments). My suggestion is to add a third choice to the set element: expression. So, the set element would look like this:

<set field="someField" expression="${groovy:...}"/>

To summarize, a field value can be assigned from a constant value, or from an existing field, or from an expression. Attempts to hack an attribute to make it behave like one of the others results in an exception.

That's my two cents.

-Adrian

Adam Heath wrote:
update your OFBiz instance to any version after the 912645, compile and
just try to login to
https://localhost:8443/ap/control/main or
https://localhost:8443/ar/control/main

The page will not be displayed, and the only thing you will see is this
message
 ERROR rendering error page [/error/error.jsp], but here is the error
text: org.ofbiz.widget.screen.ScreenRenderException: Error rendering
screen [component://accounting/widget/ar/CommonScreens.xml#main]:
org.ofbiz.base.util.GeneralException: Error running Groovy script at
location
[component://accounting/webapp/accounting/WEB-INF/actions/invoice/InvoiceReport.groovy]
(The current transaction is marked for rollback, not beginning a new
transaction and aborting current operation; the rollbackOnly was caused
by: Service [getPartyAccountingPreferences] threw an unexpected
exception/errororg.ofbiz.service.ServiceValidationException: The
following required parameter is missing:
[getPartyAccountingPreferences.organizationPartyId] (The following
required parameter is missing:
[getPartyAccountingPreferences.organizationPartyId])) (Error running
Groovy script at location
[component://accounting/webapp/accounting/WEB-INF/actions/invoice/InvoiceReport.groovy]
(The current transaction is marked for rollback, not beginning a new
transaction and aborting current operation; the rollbackOnly was caused
by: Service [getPartyAccountingPreferences] threw an unexpected
exception/errororg.ofbiz.service.ServiceValidationException: The
following required parameter is missing:
[getPartyAccountingPreferences.organizationPartyId] (The following
required parameter is missing:
[getPartyAccountingPreferences.organizationPartyId])))

Duplicated, checking...


Reply via email to