<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-711820248987565503</id><updated>2011-07-30T10:54:09.226-06:00</updated><category term='entityengine'/><category term='services'/><category term='simple-method'/><category term='eclipse'/><category term='postgresql'/><category term='security'/><title type='text'>Ofbiz Trail Guide</title><subtitle type='html'>Ofbiz Notes, Tips and Experiments</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://learningofbiz.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>28</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-4171020469957632335</id><published>2007-12-06T12:10:00.000-06:00</published><updated>2007-12-06T13:05:47.062-06:00</updated><title type='text'>@ofbizUrl  tag = your ticket to hell</title><content type='html'>You are doing development locally and everything looks good, so you plop your code on the dev server and everything goes to shit.   Request parameters are all empty when they should be full.  You double check all the svn diffs and you didn't miss any code.&lt;br /&gt;&lt;br /&gt;Could you be using a mixture of http and https urls?  Could be, if you are using the @ofbizUrl tag to build your URLs.  Try doing your URLs without this tag.  Things might magically start working for you.  &lt;hints id="hah_hints"&gt;&lt;/hints&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-4171020469957632335?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningofbiz.blogspot.com/feeds/4171020469957632335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=711820248987565503&amp;postID=4171020469957632335' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/4171020469957632335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/4171020469957632335'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/12/ofbizurl-tag-your-ticket-to-hell.html' title='@ofbizUrl  tag = your ticket to hell'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-1888443748925528864</id><published>2007-11-02T10:08:00.000-06:00</published><updated>2007-11-02T10:19:29.115-06:00</updated><title type='text'>Using JDBC to take advantage of Database technology</title><content type='html'>abandoned the entity engine and Jumped into JDBC to do this.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Joins two views in a left outer join, meaning that it gets values from the first view even if there is no matching value in the second view.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Uses the COALESCE function of postgres to fill in default values (zero in this case) when values in the second view (the right hand view) are missing&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;SELECT query1.DIVID,TotalSub,COALESCE(TotalPassed,0) AS TotalPassed,COALESCE(100*(TotalPassed/TotalSub),0) as PERCENT&lt;br /&gt;FROM&lt;br /&gt;(SELECT DIVID, COUNT(t1.PARTY_ID) AS TotalSub&lt;br /&gt;FROM (public.USERS t1 INNER JOIN public.TABLE2 sub ON t1.PARTY_ID = sub.PARTY_ID)&lt;br /&gt;INNER JOIN public.TABLE3 t3 ON sub.PRODUCT_ID = t3.T_ID&lt;br /&gt;WHERE (sub.from_date + (days_to_complete||' days')::INTERVAL &gt; '2007-08-01'  AND sub.product_id = 'testCourseOne')&lt;br /&gt;GROUP BY t1.div_num) AS query1&lt;br /&gt;LEFT OUTER JOIN&lt;br /&gt;(SELECT DIVID, COUNT(t1.PARTY_ID) AS TotalPassed&lt;br /&gt;FROM (public.USERS t1 INNER JOIN public.TABLE2 sub ON t1.PARTY_ID = sub.PARTY_ID)&lt;br /&gt;INNER JOIN public.TABLE3 t3 ON sub.PRODUCT_ID = t3.T_ID&lt;br /&gt;WHERE (sub.from_date + (days_to_complete||' days')::INTERVAL &gt; '2007-08-01'&lt;br /&gt;AND sub.product_id = 'testCourseOne' AND sub.completed_date IS NOT NULL)&lt;br /&gt;GROUP BY t1.div_num) AS query2&lt;br /&gt;ON query1.DIVID = query2.DIVID&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-1888443748925528864?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningofbiz.blogspot.com/feeds/1888443748925528864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=711820248987565503&amp;postID=1888443748925528864' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/1888443748925528864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/1888443748925528864'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/11/abandoned-entity-engine-and-jumped-into.html' title='Using JDBC to take advantage of Database technology'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-5395828319183183693</id><published>2007-08-23T12:41:00.000-06:00</published><updated>2007-08-23T13:16:07.108-06:00</updated><title type='text'>adjust allowed login attempts</title><content type='html'>How do I adjust the number of allowed login attempts in ofbiz?&lt;br /&gt;&lt;br /&gt;Edit the value for  "max.failed.logins" in the file security.properties&lt;br /&gt;&lt;br /&gt;If a user is already locked out, you can unlock them in webtools--&gt;find--&gt;[enter user login] --&gt; Lookup Party--&gt; find disabled account --&gt;edit&lt;br /&gt;&lt;br /&gt;How do I turn this feature off altogether?&lt;br /&gt;&lt;br /&gt;Setting max.failed.logins to zero should disable this feature.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-5395828319183183693?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningofbiz.blogspot.com/feeds/5395828319183183693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=711820248987565503&amp;postID=5395828319183183693' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/5395828319183183693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/5395828319183183693'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/08/adjust-allowed-login-attempts.html' title='adjust allowed login attempts'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-5347093716000812340</id><published>2007-08-22T12:32:00.001-06:00</published><updated>2007-08-22T12:42:36.078-06:00</updated><title type='text'>Mixing AND and OR conditions in entityConditionList</title><content type='html'>How does one make a query using findByCondition that has both OR and AND clauses?&lt;br /&gt;&lt;br /&gt;hint:  do a search on .OR in your ofbiz code.  This will lead you to&lt;br /&gt;the file lookupBulkAddProducts.bsh&lt;br /&gt;&lt;br /&gt;with the following code:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;conditionList.add(new EntityExpr("productTypeId", EntityOperator.NOT_EQUAL, "AGGREGATED"));&lt;br /&gt; than isVirtual != "Y".&lt;br /&gt;// we consider those products to be non-virtual and hence addable to the order in bulk&lt;br /&gt;orConditionList.add(new EntityExpr("isVirtual", EntityOperator.NOT_EQUAL, "Y"));&lt;br /&gt;orConditionList.add(new EntityExpr("isVirtual", EntityOperator.EQUALS, "N"));&lt;br /&gt;orConditionList.add(new EntityExpr("isVirtual", EntityOperator.EQUALS, null));&lt;br /&gt;&lt;br /&gt;orConditions = new EntityConditionList(orConditionList, EntityOperator.OR);&lt;br /&gt;conditions = new EntityConditionList(conditionList, EntityOperator.AND);&lt;br /&gt;&lt;br /&gt;mainConditionList.add(orConditions);&lt;br /&gt;mainConditionList.add(conditions);&lt;br /&gt;mainConditions = new EntityConditionList(mainConditionList, EntityOperator.AND);&lt;br /&gt;&lt;br /&gt;productList = delegator.findByCondition("Product", mainConditions, UtilMisc.toList("productId", "brandName", "internalName"), UtilMisc.toList("productId"));&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;pretty self-explanatory.  Group the OR statements in their own entityConditionList, the AND statements in their own, and combine the two in a master EntityConditionList (using the EntityOperator.AND)&lt;br /&gt;so, the above would result in something like WHERE (a OR b OR c) AND d&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-5347093716000812340?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningofbiz.blogspot.com/feeds/5347093716000812340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=711820248987565503&amp;postID=5347093716000812340' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/5347093716000812340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/5347093716000812340'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/08/mixing-and-and-or-conditions-in.html' title='Mixing AND and OR conditions in entityConditionList'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-1519018224085372956</id><published>2007-08-04T06:18:00.001-06:00</published><updated>2007-08-06T07:29:18.598-06:00</updated><title type='text'>how to iterate maps in FTL</title><content type='html'>instead of &lt;span style="font-family:courier new;"&gt;&amp;lt;#list&amp;gt; ... &amp;lt;/#list&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;you can try&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;lt;#assign mList=courseMap.keySet()/&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&amp;lt;#list mList as key&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;...&lt;/span&gt;&lt;br /&gt;&amp;lt;/#list&amp;gt;&lt;br /&gt;&lt;br /&gt;and to address members of the map:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;lt;#list mList as key&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;${courseMap[key]}&lt;br /&gt;&lt;br /&gt;&amp;lt;/#list&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-1519018224085372956?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningofbiz.blogspot.com/feeds/1519018224085372956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=711820248987565503&amp;postID=1519018224085372956' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/1519018224085372956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/1519018224085372956'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/08/how-to-iterate-maps-in-ftl.html' title='how to iterate maps in FTL'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-2266285786891612684</id><published>2007-08-04T06:17:00.000-06:00</published><updated>2007-08-04T06:18:23.850-06:00</updated><title type='text'>FTL date formats</title><content type='html'>&lt;a href="http://freemarker.org/docs/ref_builtins_date.html"&gt;Here is a page of information on how to format dates in FTL:&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-2266285786891612684?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningofbiz.blogspot.com/feeds/2266285786891612684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=711820248987565503&amp;postID=2266285786891612684' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/2266285786891612684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/2266285786891612684'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/08/ftl-date-formats.html' title='FTL date formats'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-1430701117539651659</id><published>2007-08-02T11:46:00.000-06:00</published><updated>2007-08-02T12:01:48.568-06:00</updated><title type='text'>Postgresql Timestamp + interval</title><content type='html'>Jumping into SQL with Entity&lt;span style="font-family:georgia;"&gt;Where&lt;/span&gt;String, I was trying to do some date arithmetic.  I had a timestamp and an integer number of days.  I wanted to add the number of days to the timestamp and work with the resulting timestamp.&lt;br /&gt;&lt;br /&gt;the Postgresql syntax for this is&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;SELECT&lt;/span&gt; &lt;tt class="LITERAL"&gt;timestamp '2001-09-28 01:00' + interval '23 hours' from myReports&lt;br /&gt;&lt;br /&gt;&lt;/tt&gt;&lt;span class="LITERAL"  style="font-family:georgia;"&gt;so I got this far:&lt;/span&gt;&lt;tt class="LITERAL"&gt;&lt;br /&gt;&lt;br /&gt;select tx_stamp + interval '23 days' from myReports&lt;br /&gt;&lt;br /&gt;&lt;/tt&gt;&lt;span class="LITERAL"  style="font-family:georgia;"&gt;and that worked but when I tried using my integer column "days_to_complete" for the interval, the syntax wasn't clear.&lt;/span&gt;&lt;tt class="LITERAL"&gt;&lt;br /&gt;&lt;/tt&gt;&lt;span class="LITERAL"  style="font-family:georgia;"&gt;&lt;br /&gt;It turns out I needed to concatenate cast my days_to_complete into a string:&lt;/span&gt;&lt;tt class="LITERAL"&gt;&lt;br /&gt;days_to_complete||' days'&lt;br /&gt;&lt;/tt&gt;&lt;span class="LITERAL"  style="font-family:georgia;"&gt;and then cast the resulting string into an INTERVAL:&lt;/span&gt;&lt;tt class="LITERAL"&gt;&lt;br /&gt;&lt;br /&gt;select tx_stamp + (days_to_complete||' days')::INTERVAL from myReports&lt;br /&gt;&lt;/tt&gt;&lt;span class="LITERAL"  style="font-family:georgia;"&gt;and that worked.&lt;/span&gt;&lt;tt class="LITERAL"&gt;&lt;br /&gt;&lt;/tt&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-1430701117539651659?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningofbiz.blogspot.com/feeds/1430701117539651659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=711820248987565503&amp;postID=1430701117539651659' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/1430701117539651659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/1430701117539651659'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/08/postgresql-timestamp-interval.html' title='Postgresql Timestamp + interval'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-1564593916593262025</id><published>2007-07-20T14:42:00.000-06:00</published><updated>2007-08-07T07:00:51.318-06:00</updated><title type='text'>ofbiz to Excel</title><content type='html'>Export results from ofbiz to Excel:&lt;br /&gt;&lt;br /&gt;There is an example of how to do this in the Facilities application.&lt;br /&gt;the example is at https://localhost:8443/facility/control/ViewFacilityInventoryByProduct?facilityId=WebStoreWarehouse&lt;br /&gt;&lt;br /&gt;Excel can easily open a well formed XML document and preserve the color and style of the original report.&lt;br /&gt;To output in XML: In the view-map tag in controller.xml change "type=screen"  to "type=screenxml"  and you will get xml output!&lt;br /&gt;&lt;br /&gt;All your FTL code must be in valid XML.  That means that &amp;lt;link&amp;gt;&lt;pre id="line1"&gt;&lt;span class="start-tag"&gt;&amp;lt;link&lt;/span&gt;&lt;span class="attribute-name"&gt; rel&lt;/span&gt;=&lt;span class="attribute-value"&gt;'stylesheet' &lt;/span&gt;&lt;span class="attribute-name"&gt;href&lt;/span&gt;=&lt;span class="attribute-value"&gt;'/assets/css/style.css' &lt;/span&gt;&lt;span class="attribute-name"&gt;type&lt;/span&gt;=&lt;span class="attribute-value"&gt;'text/css'&amp;gt; &lt;span style="font-family:Georgia,serif;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span class="attribute-value"&gt;&lt;span style="font-family:Georgia,serif;"&gt;is not valid but &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre id="line1"&gt;&lt;span class="start-tag"&gt;&amp;lt;link&lt;/span&gt;&lt;span class="attribute-name"&gt; rel&lt;/span&gt;=&lt;span class="attribute-value"&gt;'stylesheet' &lt;/span&gt;&lt;span class="attribute-name"&gt;href&lt;/span&gt;=&lt;span class="attribute-value"&gt;'/assets/css/style.css' &lt;/span&gt;&lt;span class="attribute-name"&gt;type&lt;/span&gt;=&lt;span class="attribute-value"&gt;'text/css' /&amp;gt; &lt;/span&gt;&lt;/pre&gt; is valid.&lt;br /&gt;Other tags to check:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;area&lt;/li&gt;&lt;li&gt;input&lt;/li&gt;&lt;li&gt;img&lt;/li&gt;&lt;li&gt;param&lt;/li&gt;&lt;li&gt;  is not valid.  Use &amp;amp;160;instead&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;then, change the attribute content-type="text/xml"  to content-type="application/ms-excel"&lt;br /&gt;and users will be prompted to download a file instead of viewing it in the browser.  if you change the link and the view-map to control/myPage.xls instead of control/myPage, then windows will offer to open the file with MS Excel.&lt;br /&gt;Note:&lt;br /&gt;Using a https to do this in Internet Explorer may return the message that "Internet explorer cannot download [yourReport] from localhost".  If that is the case, you can turn off https for this request.  If that is not an option, you must add a header to the response somehow.  The view-map tag does not support other headers besides content-type, so this header gets set in the beanshell file with lines like:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;fileName = "courseSetCompletionReportsExcel.xls";&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    // the following instruction prompts the user with option to open report in Excel (instead of in the browser):&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    response.setHeader( "Content-disposition", "attachment; filename=\"" + fileName + "\"");&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    //the following seems to have no effect, probably because my headers are set this way somewhere else:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    response.setHeader("Cache-Control", "cache");&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;   // next two lines fixed the refusal to download issue:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    response.setHeader("Cache-Control", "must-revalidate");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    response.setHeader( "Pragma", "public" );&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-1564593916593262025?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningofbiz.blogspot.com/feeds/1564593916593262025/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=711820248987565503&amp;postID=1564593916593262025' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/1564593916593262025'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/1564593916593262025'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/07/ofbiz-to-excel.html' title='ofbiz to Excel'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-6522621413820659320</id><published>2007-07-17T18:14:00.001-06:00</published><updated>2007-07-17T19:51:40.043-06:00</updated><title type='text'>turn off ServerHitBin complaints</title><content type='html'>When ofbiz falls down a flight of stairs and then writes a novel about it, one of the themes is often ServerHitBin. Message associated with the ServerHitBin error:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;If you turn of persistance of visits you should also turn off persistence of hits.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I don't know how to configure persistance of either one, but I'd sure like to.  So, how?&lt;br /&gt;&lt;br /&gt;I see that this message comes from the ServerHitBin.saveHit method, as a result of checking UtilProperties.propertyValueEqualsIgnoreCase(serverstats ... something)&lt;br /&gt;which, after some grep practice, turns out to be in framework/webapp/config/serverstats.properties&lt;br /&gt;where you can adjust how carefully the webapp tracks visits and hits.   I notice some of these options were set to the mysterious troolean value of ftrue.&lt;br /&gt;&lt;br /&gt;Now that I turned all the stats collection off, I get no more ServerHitBin errors&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-6522621413820659320?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/6522621413820659320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/6522621413820659320'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/07/turn-off-serverhitbin-complaints.html' title='turn off ServerHitBin complaints'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-6559910064020919723</id><published>2007-07-16T10:46:00.000-06:00</published><updated>2007-08-02T10:51:11.136-06:00</updated><title type='text'>EntityWhereString</title><content type='html'>EntityWhereString simply allows you to add custom SQL syntax to the where clause for an entity operation.   It extends EntityCondition so it can be used in the same way.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;List pList = new ArrayList();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;EntityWhereString conditions = new EntityWhereString("char_length(last_Name)&gt;8");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;EntityConditionList assocExprList = new EntityConditionList(UtilMisc.toList(conditions),EntityOperator.AND);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;pList = delegator.findByCondition("Person",assocExprList,null,null);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;you must use database names and not entity engine names.  that is, if the column name in the database is "First_Name" then you can't use FirstName etc.&lt;br /&gt;you can use database specific functions like char_length(), substr(),  and the ever useful&lt;br /&gt;&lt;pre class="SCREEN"&gt;EXTRACT(CENTURY FROM TIMESTAMP '2001-02-16 20:38:40');&lt;/pre&gt;Custom functions could be used here as well.&lt;br /&gt;&lt;br /&gt;Consider that this would allow SQL-injection if your application did not adequately scrub parameters coming from the client.     This, I suppose, is the reason for this disclaimer in the source code:&lt;br /&gt;&lt;pre&gt; &lt;p&gt;Encapsulates SQL expressions used for where clause snippets.&lt;br /&gt;NOTE: This is UNSAFE and BREAKS the idea behind the Entity Engine where&lt;br /&gt;you avoid directly specifying SQL. So, KEEP IT MINIMAL and preferably replace&lt;br /&gt;it when the feature you are getting at is implemented in a more automatic way for you.&lt;/p&gt;&lt;/pre&gt;conditions with EntityWhereString can be strung &lt;span style="font-family:georgia;"&gt;together&lt;/span&gt; with other normal sorts of EntityConditions  in the  EntityConditionList:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;EntityConditionList assocExprList = new EntityConditionList(UtilMisc.toList(conditions,exp1),EntityOperator.AND);&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;where "conditions" is a EntityWhereString and exp1 is an EntityExpr&lt;br /&gt;&lt;br /&gt;Does EntityWhereString work on entity-views??&lt;br /&gt;Hell Yes!  Even though the entity-view does not exist as far as the database is concerned, ofbiz passes the SQL where string back to the underlying table.  Sweet.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-6559910064020919723?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/6559910064020919723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/6559910064020919723'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/07/entitywherestring.html' title='EntityWhereString'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-1710314002420056737</id><published>2007-07-13T09:44:00.000-06:00</published><updated>2007-07-13T10:00:32.874-06:00</updated><title type='text'>access huge entity-views in entity maintenance</title><content type='html'>My co-worker showed me this.&lt;br /&gt;&lt;br /&gt;Some of my views are too huge for the entity maintenance screen and there is no "find" link to go straight to a subset of one of these views (There is only a link to "all").  If I click "all", I get an "out of memory" error in OFBIZ.  Even if I didn't get that error, I don't want to wait 15 minutes for my view to show up.&lt;br /&gt;&lt;br /&gt;A way around this is to right-click on the "all" link and select "copy link location"  and paste the results into the address bar of the browser.  Then, delete the text after your entity name and press enter.  Then you will see a find screen with no records for your entity view and be able to look stuff up without calling up the entire view.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-1710314002420056737?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/1710314002420056737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/1710314002420056737'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/07/access-huge-entity-views-in-entity.html' title='access huge entity-views in entity maintenance'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-4972174009381226624</id><published>2007-07-09T14:30:00.000-06:00</published><updated>2007-07-09T14:57:02.238-06:00</updated><title type='text'>Increasing ViewSize in EntityEngine</title><content type='html'>10 records at a time when viewing an entity-view?  Why and how can I change this?&lt;br /&gt;&lt;br /&gt;Of course, you can change it in the address bar.  Just change the settings for VIEW_SIZE and VIEW_INDEX to navigate around your entity:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;https://localhost:8443/webtools/control/FindGeneric&lt;br /&gt;?entityName=CombinedView&amp;find=true&amp;amp;VIEW_SIZE=100&amp;VIEW_INDEX=7660&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;or, to change the default behavior, I did a search on VIEW_SIZE in *.xml in the ofbiz workspace and I found nothing.  A search for VIEW_SIZE in *.* led me to findGeneric.bsh, where I found the code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;String viewSizeString = (String)request.getParameter("VIEW_SIZE");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;if (viewSizeString == null || viewSizeString.length() == 0) { &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      viewSizeString = "10"; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and changed the "10" to "50" and now my view entities give me a nice fat 50 rows per page.  Of course, this will be blown away next time I update ofbiz, so it may be easier to just edit the address bar.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-4972174009381226624?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/4972174009381226624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/4972174009381226624'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/07/increasing-viewsize-in-entityengine.html' title='Increasing ViewSize in EntityEngine'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-4436981411701992054</id><published>2007-07-08T19:08:00.000-06:00</published><updated>2007-07-09T14:55:49.862-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='entityengine'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>SQL-injection and OFBIZ</title><content type='html'>One of the great things about the OFBIZ entity engine is that it is well nigh impossible to make SQL-injections against it.&lt;br /&gt;&lt;br /&gt;None of the web-application security scans I've done against OFBIZ applications have ever yielded a SQL injection vulnerability and it isn't because of careful parameter scrubbing.  Looking at the code, I can't really see how any SQL injection could work.   I'm not ready to declare that OFBIZ is completely free of SQL injection problems, but it is beyond me to find any.&lt;br /&gt;&lt;br /&gt;Of course, one gives this protection up when switching to JDBC and the limitations of the entity engine may just induce one to do that. Take security into consideration when making that decision.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-4436981411701992054?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/4436981411701992054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/4436981411701992054'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/07/sql-injection-and-ofbiz.html' title='SQL-injection and OFBIZ'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-5976709736825655861</id><published>2007-07-05T19:57:00.000-06:00</published><updated>2007-07-05T20:06:02.322-06:00</updated><title type='text'>GenericPK</title><content type='html'>A google search for ofbiz GenericPK will return the code for this class, but no explanation of what it is for.  All the code examples in the OFBIZ codebase seem to use it in conjuction with GenericValue so that one may use a GenericValue retrieved from the EntityEngine to populate a an arbitrary or Generic PK for use with an operation like FindByPrimaryKey or RemoveByPrimaryKey.  In other words, you got some data from somewhere and you would like to run a "PrimaryKey" operation.  So first convert the data to a GenericPK and then use that for your operation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-5976709736825655861?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/5976709736825655861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/5976709736825655861'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/07/genericpk.html' title='GenericPK'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-4583338489572447461</id><published>2007-07-05T19:31:00.000-06:00</published><updated>2007-07-05T19:56:56.358-06:00</updated><title type='text'>Can I Has Cursor?</title><content type='html'>There is something like a cursor in ofbiz.  It is known as an EntityListIterator.   When you do findAll or findByAnd() on an entity, it returns a list into memory and if the result set is too large, you will have performance problems.  That is, if you consider death to be a performance problem.  Instead of a List, you can get the equivalent of a cursor that you can loop through and retrieve your data.  EntityListIterators only work "byCondition".  That is, you have to write the command differently.&lt;br /&gt;&lt;br /&gt;personList = delegator.findByAnd("Person", utilMisc.toMap("lastName","Smith"));&lt;br /&gt;&lt;br /&gt;would become&lt;br /&gt;&lt;br /&gt;EntityExpr entityExpr = new EntityExpr("lastName",EntityOperator.EQUALS "Smith");&lt;br /&gt;personELI =  delegator.findListIteratorByCondition("Person",entityExpr);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-4583338489572447461?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/4583338489572447461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/4583338489572447461'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/07/can-i-has-cursor.html' title='Can I Has Cursor?'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-630839718808772229</id><published>2007-05-14T13:00:00.000-06:00</published><updated>2007-05-14T13:20:31.484-06:00</updated><title type='text'>how to deal with blank rows on multi-forms</title><content type='html'>If you use simple methods to create multi-row form, you might notice that if there is an error in one row, any blank rows in the form will cause validation errors.  You might think that the "if-not-empty" tag in the SimpleMethods.xml definition would cause the form to ignore blank rows, but it doesn't.  The reason is that by default, a multi-form is treated as one big transaction.   When one of the rows fails validation, they all do.&lt;br /&gt;&lt;br /&gt;The solution is to use the global-transaction="false" attribute in the event tag in controller.xml .  This tells the event called that you want the form to be processed as individual lines instead of as one big form.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-630839718808772229?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/630839718808772229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/630839718808772229'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/05/how-to-deal-with-blank-rows-on-multi.html' title='how to deal with blank rows on multi-forms'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-6250458466643140817</id><published>2007-05-09T12:56:00.000-06:00</published><updated>2007-05-09T16:23:31.746-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='services'/><title type='text'>Test your services</title><content type='html'>A great feature in webtools lets you fire off your services individually and give them parameters of your own choosing.&lt;br /&gt;&lt;br /&gt;go to webtools --&gt; schedule job --&gt;  fill in the name of your service (as defined in one of the xml files in the serviceDef directory of your application)&lt;br /&gt;&lt;br /&gt;the application will then ask you for the parameters that are defined as attributes in the service definition.  The job I scheduled is defined in groups.xml and calls three services that all have attributes defined.  When I run this job thru the webtools "schedule job" tool, it asks me for all the parameters for all three services.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-6250458466643140817?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/6250458466643140817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/6250458466643140817'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/05/test-your-services.html' title='Test your services'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-353809447144953647</id><published>2007-05-02T11:00:00.000-06:00</published><updated>2007-05-02T11:07:45.378-06:00</updated><title type='text'>blank src="" causes double request processing</title><content type='html'>Twice in the past month, I've been beplexed by http requests being processed twice or more, once with expected parameters, and then again with no parameters.  This caused all sorts of unexpected behavior.  Request processing even seemed to be triggered by trying to "view source" in Firefox.&lt;br /&gt;&lt;br /&gt;I visited my doctor to see if I needed my medication adjusted again, but all other aspects of reality seemed to be reasonable, so I looked for a solution by lobotimizing my application and adding pieces back in again until I noticed the behavior.  It came back after adding a chunk of code back into an ftl page.  It turns out that this behavior was caused by some image tags with blank src attributes.  If I have IMG SRC="" or even IMG SRC="#" the requests get called twice.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-353809447144953647?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/353809447144953647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/353809447144953647'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/05/blank-src-causes-double-request.html' title='blank src=&quot;&quot; causes double request processing'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-1316585884602834204</id><published>2007-02-14T14:04:00.000-06:00</published><updated>2007-02-14T14:08:49.577-06:00</updated><title type='text'>turning down the volume on logging messages</title><content type='html'>I had a overly chatty console log.  Messages I was interested in would zip by before I could read them because of some job poller logging thousands of INFO statements.&lt;br /&gt;&lt;br /&gt;To shut him up, I edited debug.properties  (ofbiz/framework/base/config/debug.properties)&lt;br /&gt;and replaced the ALL with WARN in the following lines:&lt;br /&gt;&lt;blockquote&gt;# Set root logger priority and appender&lt;br /&gt;log4j.rootLogger=WARN, stdout, file, css&lt;br /&gt;&lt;br /&gt;# Special OFBiz log4j configuration - set all top levels to true and set root to ALL&lt;br /&gt;log4j.logger.NoModule=WARN&lt;br /&gt;log4j.logger.org.ofbiz=WARN&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;ahhhhh.  peace and quiet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-1316585884602834204?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/1316585884602834204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/1316585884602834204'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/02/turning-down-volume-on-logging-messages.html' title='turning down the volume on logging messages'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-3563577922211754094</id><published>2007-02-09T11:24:00.000-06:00</published><updated>2007-02-09T11:26:41.573-06:00</updated><title type='text'>looping through context object</title><content type='html'>Set z = context.entrySet();&lt;br /&gt;Iterator it = z.iterator();&lt;br /&gt;while (it.hasNext()) {&lt;br /&gt;   Map.Entry pairs = (Map.Entry)it.next();&lt;br /&gt;   Debug.log(pairs.getKey() + " = " + pairs.getValue());&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-3563577922211754094?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/3563577922211754094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/3563577922211754094'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/02/looping-through-context-object.html' title='looping through context object'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-7164135878536477332</id><published>2007-01-08T11:28:00.000-06:00</published><updated>2007-01-08T11:34:15.875-06:00</updated><title type='text'>context and globalContext</title><content type='html'>What is the difference between context and global context?&lt;br /&gt;&lt;br /&gt;This applies to Screen Widgets and context and global context are alive while a screen is being built.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lists.ofbiz.org/pipermail/dev/2004-September/006611.html"&gt;This ofbiz developer put it well:&lt;/a&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Each piece of a screen has its own context, and there is also a global context &lt;br /&gt;available to all scopes. This is only available during the screen &lt;br /&gt;rendering process. Once the screen is rendered, there is no more &lt;br /&gt;context.&lt;br /&gt;&lt;br /&gt;In general the only way to keep variables across &lt;br /&gt;multiple requests is to use the session.&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-7164135878536477332?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/7164135878536477332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/7164135878536477332'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2007/01/context-and-globalcontext.html' title='context and globalContext'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-2772005987739841040</id><published>2006-12-18T18:26:00.000-06:00</published><updated>2006-12-18T19:35:53.701-06:00</updated><title type='text'>bypass authentication in local ofbiz development environment</title><content type='html'>I must spend 1 hour per day logging into my local ofbiz setup.  I never want to be asked again.&lt;br /&gt;&lt;br /&gt;To get around this, I edited LoginWorker.java and hard-coded the  username and password.&lt;br /&gt;&lt;br /&gt;Hard code the credentials in both the login() method and the checkLogin() method to totally bypass the login screen.&lt;br /&gt;&lt;br /&gt;hard-code only in the login method and the login screen will still appear, but will accept blank credentials, which might be what you want when testing for application flow.&lt;br /&gt;&lt;br /&gt;Code for checkLogin() method:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;if (userLogin == null) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            // added to circumvent login:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            username = "admin";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            password = "ofbiz";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;....&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Code for login() method:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;       // comment out existing username and password definition:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;       // String username = request.getParameter("USERNAME");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;       // String password = request.getParameter("PASSWORD");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        String username = "admin";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        String password = "ofbiz";&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;rebuild ofbiz and enjoy the extra seconds!&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-2772005987739841040?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/2772005987739841040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/2772005987739841040'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2006/12/bypass-authentication-in-local-ofbiz.html' title='bypass authentication in local ofbiz development environment'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-8404806134362006812</id><published>2006-12-08T11:37:00.000-06:00</published><updated>2007-01-05T16:02:39.509-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='postgresql'/><title type='text'>pg_dump problem solved</title><content type='html'>In setting up ofbiz and postgres on windows, I found that PGAdmin totally barfed when trying to run the SQL file that I had created from a pg_dump command.&lt;br /&gt;&lt;br /&gt;It returned errors like "ERROR: syntax error at or near "\" at character 387817 "&lt;br /&gt;&lt;br /&gt;This was the result of the default behaviour of pg_dump using COPY commands, which PGAdmin apparently can't stomach. The command line statement,&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;psql -U postgres -f pgdump.sql &lt;span style="font-family:georgia;"&gt;reported no errors but FAILED to load a significant portion of the data.&lt;/span&gt;&lt;/span&gt;   I find the limited error reporting very relaxing! &lt;br /&gt;&lt;br /&gt;I found there is a command line option to pg_dump to dump the data using INSERT statments instead:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:arial;" &gt;-d, --inserts dump data as INSERT, rather than COPY, commands&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;so, I did&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;font-family:arial;" &gt;&lt;span style="FONT-WEIGHT: bold"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;pg_dump -d -U postgres &gt; pgdump34.sql&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;font-family:arial;" &gt;&lt;span style="FONT-WEIGHT: bold"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;from the Windows cmd line and got SQL statements that where recognizable to me and to PGAdmin III&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-8404806134362006812?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/8404806134362006812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/8404806134362006812'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2006/12/pgdump-problem-solved.html' title='pg_dump problem solved'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-7285074958850199691</id><published>2006-12-07T21:55:00.000-06:00</published><updated>2007-01-05T16:02:09.621-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><title type='text'>ofbiz and eclipse</title><content type='html'>There are four basic things you might like to do in eclipse: manage svn tasks, Run Ant builds, start and stop ofbiz, and debug java files. All of these are within your reach, but the number of options might send you back to typing "startofbiz" at the command line. Ofbiz has a &lt;a href="http://ofbizwiki.go-integral.com/Wiki.jsp?page=OfbizInEclipse"&gt;wiki entry about using eclipse&lt;/a&gt; and that is a good starting point, even though it doesn't address all the painful hassles you may encounter.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;It is really nice to have svn commands right there in your eclipse file navigator. Here is how to&lt;a href="http://subclipse.tigris.org/install.html"&gt; install subclipse&lt;/a&gt;. Visit &lt;a href="http://subclipse.tigris.org/"&gt;http://subclipse.tigris.org/&lt;/a&gt;s to get the location of the update site and then open help --&gt; software updates--&gt;find and install --&gt; search for new features --&gt; new remote site --&gt; enter name and http address and follow steps.&lt;/li&gt;&lt;ol&gt;&lt;li&gt;which version? I have eclipse 3.2 and I installed subclipse 1.1.x and had no problems&lt;/li&gt;&lt;li&gt;how to connect to an existing project repository?  This couldn't be simpler.  Right click in navigation panel.  Select import from context menu.  Choose "Checkout projects from svn  and enter the svn url in the space provided&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt;ANT. Really all you need to do with ANT is load your project's build.xml file into eclipse's excellent ANT tool and run your ANT target from there.&lt;/li&gt;&lt;ol&gt;&lt;li&gt;open Ant view&lt;/li&gt;&lt;li&gt;browse to the build.xml file for ofbiz&lt;/li&gt;&lt;li&gt;click the green arrow to run the default target&lt;/li&gt;&lt;li&gt;double-click run-install or run install seed to set up the default passwords and other initialization stuff&lt;br /&gt;&lt;/li&gt;&lt;li&gt;browse to the build.xml file for your project&lt;/li&gt;&lt;li&gt;click the green arrow to run the default target for your project&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;starting and stopping the whole damn ofbiz server from within eclipse.  Follow the directions in the wiki and note that:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;all the classpath settings in your project's build path that allow you to EDIT your project in eclipse need to now show up in the project's run path to allow you to RUN your project in eclipse.  Classpath errors can either mean missing libraries or they can mean conflicting libraries.  &lt;/li&gt;&lt;li&gt;Your search - &lt;b&gt;ofbiz blooooody entityresolver2&lt;/b&gt; - did not match any documents.   Errors like "java.lang.NoClassDefFoundError: org/xml/sax/ext/EntityResolver2" could mean eclipse is finding a jar file with a package that is the same as the one that the missing class is really in.    It is finding the wrong jar file FIRST.  I got around my issue by changing the order of library imports in the classpath window.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;I had to copy  RemoteDispatcherImpl_Stub.class from  \ofbiz\framework\service\build\classes\org\ofbiz\service\rmi  &lt;span style="font-weight: bold;font-family:arial;" &gt;TO&lt;/span&gt;  \ofbiz\bin\org\ofbiz\service\rmi   &lt;/li&gt;&lt;/ol&gt;&lt;li&gt;debugging then comes fairly naturally after getting it running inside eclipse.  You can only debug java files.  I would love to know a way to debug minilang, bsh and ftl.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-7285074958850199691?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/7285074958850199691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/7285074958850199691'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2006/12/ofbiz-and-eclipse.html' title='ofbiz and eclipse'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-6150858242477176792</id><published>2006-12-06T15:45:00.000-06:00</published><updated>2006-12-07T20:25:54.019-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='entityengine'/><category scheme='http://www.blogger.com/atom/ns#' term='postgresql'/><title type='text'>running ofbiz with postgresql on windows</title><content type='html'>These are the steps I took to get ofbiz talking to a postgresql database running on Windows:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download + install postgres for Windows&lt;/li&gt;&lt;li&gt;update &lt;span&gt;&lt;span style="font-family:Arial,Helvetica,sans-serif;"&gt;/data/pg_hba.conf to include the following lines.  &lt;span style="font-family:courier new;"&gt;&lt;p&gt;local all all trust&lt;br /&gt;host all all 127.0.0.1 255.0.0.0 trust&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://jdbc.postgresql.org/download.html"&gt;Download appropriate driver&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;fix build.xml to add your driver's jar file to the classpath or replace existing postgres driver with correct one for the version you just installed.&lt;/li&gt;&lt;li&gt;Install postgres, making note of username and password.  The installation will allow you to name a postgres user.  I named mine "postgres".  The installation will give you a PGAdmin executable which is useful for doing operations which you aren't allowed to do as admin user.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;initialize database with ofbiz tables, preferably from a pgdump.sql file, alternatively by using the xml import tool.&lt;/li&gt;&lt;li&gt;change entityengine.xml to reflect your use of a local windows postgres&lt;/li&gt;&lt;ol&gt;&lt;li&gt;link to entityengine.xml example&lt;/li&gt;&lt;li&gt;url looks like:  &lt;span style="font-family:courier new;"&gt;jdbc:postgresql://127.0.0.1:5432/postgres&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;br /&gt;&lt;a href="http://www.postgresql.org/docs/8.1/interactive/client-authentication.html#AUTH-PG-HBA-CONF"&gt;Read this for instructions on configuring pg_hba.conf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;"&lt;span style="font-family:courier new;"&gt;host all all ... trust&lt;/span&gt;" means no password is checked at all for connects for the hosts indicated, so if you are getting "password failed" in your log files, it isn't reading pg_hba.conf correctly.&lt;br /&gt;&lt;br /&gt;For most changes to the .conf files, you can tell postgresql to read them again with the command &lt;span style="font-family:courier new;"&gt;pg_ctl reload -D D:\psql\data&lt;/span&gt;.  Certain settings in the .conf files require a postgresql restart which is best done from PGAdmin III.   Stopping the service and trying to start it again can turn into a major hassle because this amounts to starting postgresql with administrative privileges.  When I did it this way, I couldn't restart the service except by rebooting.&lt;br /&gt;&lt;br /&gt;You will also need to run a ant run-install-seed to put default passwords (admin,ofbiz)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-6150858242477176792?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/6150858242477176792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/6150858242477176792'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2006/12/running-ofbiz-with-postgresql-on.html' title='running ofbiz with postgresql on windows'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-9076245949075863959</id><published>2006-11-29T16:19:00.000-06:00</published><updated>2007-01-05T16:03:54.878-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='entityengine'/><title type='text'>getting your data</title><content type='html'>People learning ofbiz will probably first be looking for equivalents to the SQL select statements or hibernate calls they are used to. The GenericDelegator object does this. Reading this post requires your understanding that calls to delegator aren't really like select statements at all because these methods return a List of objects and not a cursor. and they aren't like hibernate calls either, because they don't return a List of the specific object type, but a List of GenericValue objects.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;select * from table&lt;/span&gt; : you are looking for &lt;span style="font-family:courier new;"&gt;delegator.findAll()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;List peopleList = delegator.findAll("PicnicPeople");&lt;/span&gt; will get every record in the PicnicPeople entity. It will come to you as a List of GenericValue objects.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;select * from table where... &lt;/span&gt;: When you want to limit the records returned, &lt;span style="font-family:courier new;"&gt;delegator.findByAnd()&lt;/span&gt; is what you want. findByAnd takes a Map (or List) of the field names and values you wish to add to the where clause. This is kind of nice because you don't have to worry about constructing Where... AND.... AND.... clauses. There is a utility called &lt;a href="http://www.ofbiz.eu/framework/base/build/javadocs/org/ofbiz/base/util/UtilMisc.html#toMap%28java.lang.String,%20java.lang.Object%29"&gt;UtilMisc.toMap()&lt;/a&gt; to construct this map that you will see used a lot.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Map fieldMap = UtilMisc.toMap("name","Fred"); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;List peopleNamedFred = delegator.findByAnd("PicnicPeople", fieldMap);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;select * from table1, table2 where table1.pk = table2.fk&lt;/span&gt; : outer joins can be accomplished by &lt;a href="http://www.ofbiz.eu/framework/entity/build/javadocs/org/ofbiz/entity/GenericDelegator.html#getRelated%28java.lang.String,%20java.util.Map,%20java.util.List,%20org.ofbiz.entity.GenericValue%29"&gt;delegator.getRelated() &lt;/a&gt;&lt;br /&gt;if you already have a peopleList populated from the previous example,&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;aPerson = (&lt;/span&gt;GenericValue&lt;span style="font-family:courier new;"&gt;)peopleList.get(1);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;List peopleDateList = delegator.getRelated("PicnicDates",aPerson);&lt;/span&gt;&lt;br /&gt;would get back a List containing all the picnic dates that aPerson.&lt;br /&gt;to get the entire list of dates for an entire List of people, you would do a loop through peopleList and perform delegator.getRelated(PicnicDates, (GenericValue)peopleList.get(x)) for each entry in the list. There are other ways to do joins: dynamic views and entity views, but I'm just talking about delegator today.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;select * from table1 where name LIKE 'Amy%' &lt;/strong&gt;wild card queries can be used with delegator.findByLike() as in :&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;delegator.findByLike(PicnicPeople", UtilMisc.toMap("name","Amy%"));&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-9076245949075863959?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningofbiz.blogspot.com/feeds/9076245949075863959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=711820248987565503&amp;postID=9076245949075863959' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/9076245949075863959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/9076245949075863959'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2006/11/getting-your-data.html' title='getting your data'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-90373314091647536</id><published>2006-11-29T09:44:00.000-06:00</published><updated>2006-11-29T10:50:42.508-06:00</updated><title type='text'>Which version of ofbiz am I running?</title><content type='html'>You'd expect the version number to be in the Readme file, but it isn't. &lt;br /&gt;One way to check the exact revision is to look in a file in the .svn directory called entries.  Each entry will show the revision number (467725) and a date for that revision.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-90373314091647536?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningofbiz.blogspot.com/feeds/90373314091647536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=711820248987565503&amp;postID=90373314091647536' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/90373314091647536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/90373314091647536'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2006/11/which-version-of-ofbiz-am-i-running.html' title='Which version of ofbiz am I running?'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-711820248987565503.post-3578664358568382946</id><published>2006-11-28T17:27:00.000-06:00</published><updated>2006-11-29T11:01:03.545-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='simple-method'/><title type='text'>How to issue a query from simple methods?</title><content type='html'>I am tasked with what seems like a simple form:  20 checkboxes based on a database lookup that updates a different database table.&lt;br /&gt;&lt;br /&gt;So, first step is to see if I can create a simple method that gets me a list of maps that represents all of the rows in my table.  Gotta stop saying "table".  Tables are called entities in OFBIZ.  The entity is Pmu and contains the fields PmuId, ecmId, and label.&lt;br /&gt;&lt;br /&gt;Simple question.  How do I do a query  " &lt;span style="font-family:courier new;"&gt;Select * from Pmu&lt;/span&gt; " ?&lt;br /&gt;the closest thing to a sql query is something called entity-condition:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  &amp;lt;simple-method name="getPmus" description="get pmu list"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      &amp;lt;entity-condition name="Pmu"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      &amp;lt;/entity-condition&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  &amp;lt;/simple-method&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;so, how do I do something like " &lt;span style="font-family:courier new;"&gt;Select * from Pmu where ecmId = 5 &lt;/span&gt;" ?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  &amp;lt;simple-method name="getPmus" description="get pmu list"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      &amp;lt;entity-condition name="Pmu"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;             &amp;lt;condition-expr name="ecmId" env-name="parameters.ecmId"  operator="equals"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      &amp;lt;/condition-expr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  &amp;lt;/entity-condition&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;where in the heck does the parameters object come from?&lt;br /&gt;well, in t&lt;a href="http://incubator.apache.org/ofbiz/docs/minilang.html"&gt;his documentation of minilang&lt;/a&gt;, it states that by default, the incoming context will be mapped to the "parameters" variable.  Nice.  So ecmId will come in with the context and everything will be fine.&lt;br /&gt;&lt;br /&gt;After I add the above code to simple-methods.xml, I will have available to me a List object containing a bunch of objects of type Pmu.  In my next post I will try and make use of those Pmu objects in my form widget!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/711820248987565503-3578664358568382946?l=learningofbiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningofbiz.blogspot.com/feeds/3578664358568382946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=711820248987565503&amp;postID=3578664358568382946' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/3578664358568382946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/711820248987565503/posts/default/3578664358568382946'/><link rel='alternate' type='text/html' href='http://learningofbiz.blogspot.com/2006/11/shifting-sands.html' title='How to issue a query from simple methods?'/><author><name>GrimTim</name><uri>http://www.blogger.com/profile/16633950963288386748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
