You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by "skip@theDevers" <sk...@thedevers.org> on 2007/09/28 02:29:23 UTC

Quantity discount pricing

Can someone tell me how to implement quantity price breaks?  I somehow
thought there a "minOrderQuantity" field and "QTY_DISCOUNT_PRICE", and
"QTY_DISCOUNT_PERCENTAGE"  productPriceTypeIds, in ProductPrice, but I can't
seem to find them now.

I am looking in PriceServices.java and there seems to be some support for
quantity breaks using ProductPriceRule, but because
"optimizeForLargeRuleSet" is hardcoded "false" with no way to change it, it
looks to me like it will be impossibly slow because EVERY product for the
current customer has two price breaks (thats a total of 140,000+ price rules
to sort through).

Can someone offer guidance or should I modify ProductPrice to suite my needs
and hope that you guys will roll it back in.

Skip


RE: Quantity discount pricing

Posted by "skip@theDevers" <sk...@thedevers.org>.
They are not random. Mostly like < 10 = list, 10 - 50 = price y, 51+ = price
z, and then a few odd balls.  However, I am betting that the resulting price
breaks are based on an underlying percentage.   I am importing price1 - 3,
and qty1 - qty3.

List, y and z vary greatly from one product to the next.

Too bad it's not a fixed percentage, that would be pretty easy.


More importantly, I have to import these prices into Ofbiz along with my
inventory import, so it would be helpful to know the entities involved.

I was thinking of adding a fromQty and thruQty to PriceRule.  That would
make it dead simple.  Alternatively, I could add a QuantityBreak entity
similiar to page 88 of the Data Model Resource Book, but it seems sensless
to create a whole new entity when two fields in ProductPrice would do it.

-----Original Message-----
From: Walter Vaughan [mailto:wvaughan@steelerubber.com]
Sent: Thursday, September 27, 2007 7:19 PM
To: user@ofbiz.apache.org
Subject: Re: Quantity discount pricing


skip@theDevers wrote:

> Can someone tell me how to implement quantity price breaks?  I somehow
> thought there a "minOrderQuantity" field and "QTY_DISCOUNT_PRICE", and
> "QTY_DISCOUNT_PERCENTAGE"  productPriceTypeIds, in ProductPrice, but I
can't
> seem to find them now.
>
> I am looking in PriceServices.java and there seems to be some support for
> quantity breaks using ProductPriceRule, but because
> "optimizeForLargeRuleSet" is hardcoded "false" with no way to change it,
it
> looks to me like it will be impossibly slow because EVERY product for the
> current customer has two price breaks (thats a total of 140,000+ price
rules
> to sort through).

I'm guessing Price Rules could work. Are the quantity breaks random, or is
logical? I mean 1-5qty Full Price, 6-9qty 10% off, 10 or more 15% off?
Or is it more insane like productId A is 1-5, productId B is 1-3? Z 1-500?
Even if appears random, is there some sort of pattern from which you could
create groups (Product Classifications)?
Product Classifications can be your friend. We have thousands of Product
Classifications, yet only a handful of price rules.

In case you didn't realize it price rules add together, and you may have to
create offseting rules to get the price where you want it.

> Can someone offer guidance or should I modify ProductPrice to suite my
needs
> and hope that you guys will roll it back in.
>
> Skip
>
>
>



RE: Stumped on a complicated question

Posted by Skip <sk...@thedevers.org>.
For those of you who are interested in this low level stuff, here is a
solution to the classpath issue.  If anyone wants ClassPathUpdate class,
just shoot me an email:

public class main
{
	public main(String[] args)
	{

		ClassLoader loader = ClassLoader.getSystemClassLoader();
		if(loader instanceof URLClassLoader)
		{
			//For convenience so we don't have to cast everything
			URLClassLoader urlLoader = (URLClassLoader)loader;

			//Get the existing jars in the class path and show them
			URL [] urls = urlLoader.getURLs();
			showUrls(urls, "Before");

			System.out.println("Trying to add url
C:\\jdk1.5\\jre\\lib\\ext.sav\\servlet.jar");
			try
			{
				//Add a new one
				ClassPathUpdater.addFile("C:\\jdk1.5\\jre\\lib\\ext.sav\\servlet.jar",
urlLoader);
				System.out.println("!!!!!Success");

				//Show the results after
				urls = urlLoader.getURLs();
				showUrls(urls, "\nAfter");
			}
			catch(Exception e)
			{
				e.printStackTrace();
			}

		}
		else
		{
			System.out.println(loader.getClass().getName() + " is not a
URLClassLoader");
		}
	}
	....


And here is the results of the run,  Note that the added file "servlet.jar"
is now in the classpath in the "After" block:

...test>java -cp test.jar main
Before, Got 1 URLs = :
URL[0] = file:/D:/JavaProjects/ClassLoader/test/test.jar

Trying to add url C:\jdk1.5\jre\lib\ext.sav\servlet.jar
!!!!!Success

After, Got 2 URLs = :
URL[0] = file:/D:/JavaProjects/ClassLoader/test/test.jar
URL[1] = file:/C:/jdk1.5/jre/lib/ext.sav/servlet.jar





> skip@theDevers sent the following on 9/27/2007 10:30 PM:
>> I am getting the following error:
>>
>> java.lang.ClassNotFoundException:
>> org.ofbiz.service.engine.StandardJavaEngine
>>
>> On this line 81 of
>> org.ofbiz.service.engine.GenericEngineFactory.getGenericEngine:
>>
>>   Class c = loader.loadClass(className);
>>
>>
>> I am running ofbiz as a standalone app, similiar to java ofbiz.jar -pos
>>
>> I don't get this problem when I run Ofbiz normally using the same "login"
>> service.
>>
>> Somehow, it appears as if ofbiz-service.jar is not on the class path or
>> cannot be accessed.  I even went so far as to copy it into my lib
> directory
>> with my jar file where it is referenced by my ofbiz-component.xml as:
>>
>>     <classpath type="jar" location="dist/*"/>
>>     <classpath type="jar" location="dist/lib/*"/>
>>
>> No joy.  I am referencing lots of other Ofbiz jar files and they all load
>> just fine, for example ofbiz-base.jar, ofbiz-security.jar, and
>> ofbiz-party.jar.  For some reason, the class loader will not load the
>> service engine.  I only get a problem when I try to call a service with
>> "dispatcher.runSync()".  I have been successfully reading and writing the
>> the database via GenericDelegator without problem.  Just when I try to
run
> a
>> service.
>>
>> This is running under windows, jdk 1.5 and the Ofbiz version of a week
> ago.
>> For completeness, here is my containers.xml file:
>>
>> <ofbiz-containers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>
>>
>
xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/ofbiz-containers.xs
>> d">
>>     <!-- load the ofbiz component container (always first) -->
>>     <container name="component-container"
>> class="org.ofbiz.base.container.ComponentContainer"/>
>>
>>     <!-- load the cached classloader container (always second) -->
>>     <container name="classloader-container"
>> class="org.ofbiz.base.container.ClassLoaderContainer"/>
>>
>>     <!-- load the FS Sales Order Entry GUI -->
>>     <container name="fssoe-container" class="com.fs.FSSoeContainer">
>>         <property name="startup-directory"
>> value="/specialpurpose/fs/config/"/>
>>         <property name="dispatcher-name" value="FSSoeDispatcher"/>
>>         <property name="delegator-name" value="default"/>
>>     </container>
>>
>> </ofbiz-containers>
>>
>> Anyone have a clue.  I'd hate to do this thing entirely without using the
>> Ofbiz services.
>>
>> Skip
>>
>>
>>
>>
>>
>
>
>
>


Re: Stumped on a complicated question

Posted by BJ Freeman <bj...@free-man.net>.
Oh your doing custom stuff.
can't help there.

Skip sent the following on 9/28/2007 9:15 AM:
> BJ
> 
> I'll check this, but I think I have figured out a way.  The classloader of
> the thread that instantiates my container has the necessary url's.  However,
> because this is a java -jar startup, classpath is ignored by the default
> classloader.
> 
> So, (I think), all I gotta do is call ClassLoader.getURLs() from the Ofbiz
> thread, save them away, then call addURL(URL url) on the gui thread to add
> them in.  I know addURL(URL url) is protected, but I am pretty sure I know
> how to get around that.  Unfortunately, I am at my main job now and cant try
> it out.  Can't wait to get home to give it a go.
> 
> Skip
> 
> -----Original Message-----
> From: BJ Freeman [mailto:bjfree@free-man.net]
> Sent: Friday, September 28, 2007 8:22 AM
> To: user@ofbiz.apache.org
> Subject: Re: Stumped on a complicated question
> 
> 
> did you check the log to see of services is getting loaded.
> (main) [            UtilXml.java:243:DEBUG] XML Read 0.047s:
> file:/C:/projects/java/digiresourcesllc/framework/service/ofbiz-component.xm
> l
> (main) [ ComponentContainer.java:207:INFO ] Loading component : [service]
> 
> 
> skip@theDevers sent the following on 9/28/2007 6:25 AM:
>> Yep, I gathered that.  Note that the class loader is retrieved with:
>>
>>  ClassLoader loader = Thread.currentThread().getContextClassLoader();
>>
>> I am guessing that the GUI thread does not have the application classpath.
>> The question is, how to give it.  At runtime, I know exactly where all
> these
>> jar file are.
>>
>> Skip
>>
>> -----Original Message-----
>> From: BJ Freeman [mailto:bjfree@free-man.net]
>> Sent: Friday, September 28, 2007 1:44 AM
>> To: user@ofbiz.apache.org
>> Subject: Re: Stumped on a complicated question
>>
>>
>> would seem you don't have a classpath to the service engine.
>>
>> skip@theDevers sent the following on 9/27/2007 10:30 PM:
>>> I am getting the following error:
>>>
>>> java.lang.ClassNotFoundException:
>>> org.ofbiz.service.engine.StandardJavaEngine
>>>
>>> On this line 81 of
>>> org.ofbiz.service.engine.GenericEngineFactory.getGenericEngine:
>>>
>>>   Class c = loader.loadClass(className);
>>>
>>>
>>> I am running ofbiz as a standalone app, similiar to java ofbiz.jar -pos
>>>
>>> I don't get this problem when I run Ofbiz normally using the same "login"
>>> service.
>>>
>>> Somehow, it appears as if ofbiz-service.jar is not on the class path or
>>> cannot be accessed.  I even went so far as to copy it into my lib
>> directory
>>> with my jar file where it is referenced by my ofbiz-component.xml as:
>>>
>>>     <classpath type="jar" location="dist/*"/>
>>>     <classpath type="jar" location="dist/lib/*"/>
>>>
>>> No joy.  I am referencing lots of other Ofbiz jar files and they all load
>>> just fine, for example ofbiz-base.jar, ofbiz-security.jar, and
>>> ofbiz-party.jar.  For some reason, the class loader will not load the
>>> service engine.  I only get a problem when I try to call a service with
>>> "dispatcher.runSync()".  I have been successfully reading and writing the
>>> the database via GenericDelegator without problem.  Just when I try to
> run
>> a
>>> service.
>>>
>>> This is running under windows, jdk 1.5 and the Ofbiz version of a week
>> ago.
>>> For completeness, here is my containers.xml file:
>>>
>>> <ofbiz-containers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>
>>>
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/ofbiz-containers.xs
>>> d">
>>>     <!-- load the ofbiz component container (always first) -->
>>>     <container name="component-container"
>>> class="org.ofbiz.base.container.ComponentContainer"/>
>>>
>>>     <!-- load the cached classloader container (always second) -->
>>>     <container name="classloader-container"
>>> class="org.ofbiz.base.container.ClassLoaderContainer"/>
>>>
>>>     <!-- load the FS Sales Order Entry GUI -->
>>>     <container name="fssoe-container" class="com.fs.FSSoeContainer">
>>>         <property name="startup-directory"
>>> value="/specialpurpose/fs/config/"/>
>>>         <property name="dispatcher-name" value="FSSoeDispatcher"/>
>>>         <property name="delegator-name" value="default"/>
>>>     </container>
>>>
>>> </ofbiz-containers>
>>>
>>> Anyone have a clue.  I'd hate to do this thing entirely without using the
>>> Ofbiz services.
>>>
>>> Skip
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
> 
> 
> 
> 

RE: Stumped on a complicated question

Posted by Skip <sk...@thedevers.org>.
BJ

I'll check this, but I think I have figured out a way.  The classloader of
the thread that instantiates my container has the necessary url's.  However,
because this is a java -jar startup, classpath is ignored by the default
classloader.

So, (I think), all I gotta do is call ClassLoader.getURLs() from the Ofbiz
thread, save them away, then call addURL(URL url) on the gui thread to add
them in.  I know addURL(URL url) is protected, but I am pretty sure I know
how to get around that.  Unfortunately, I am at my main job now and cant try
it out.  Can't wait to get home to give it a go.

Skip

-----Original Message-----
From: BJ Freeman [mailto:bjfree@free-man.net]
Sent: Friday, September 28, 2007 8:22 AM
To: user@ofbiz.apache.org
Subject: Re: Stumped on a complicated question


did you check the log to see of services is getting loaded.
(main) [            UtilXml.java:243:DEBUG] XML Read 0.047s:
file:/C:/projects/java/digiresourcesllc/framework/service/ofbiz-component.xm
l
(main) [ ComponentContainer.java:207:INFO ] Loading component : [service]


skip@theDevers sent the following on 9/28/2007 6:25 AM:
> Yep, I gathered that.  Note that the class loader is retrieved with:
>
>  ClassLoader loader = Thread.currentThread().getContextClassLoader();
>
> I am guessing that the GUI thread does not have the application classpath.
> The question is, how to give it.  At runtime, I know exactly where all
these
> jar file are.
>
> Skip
>
> -----Original Message-----
> From: BJ Freeman [mailto:bjfree@free-man.net]
> Sent: Friday, September 28, 2007 1:44 AM
> To: user@ofbiz.apache.org
> Subject: Re: Stumped on a complicated question
>
>
> would seem you don't have a classpath to the service engine.
>
> skip@theDevers sent the following on 9/27/2007 10:30 PM:
>> I am getting the following error:
>>
>> java.lang.ClassNotFoundException:
>> org.ofbiz.service.engine.StandardJavaEngine
>>
>> On this line 81 of
>> org.ofbiz.service.engine.GenericEngineFactory.getGenericEngine:
>>
>>   Class c = loader.loadClass(className);
>>
>>
>> I am running ofbiz as a standalone app, similiar to java ofbiz.jar -pos
>>
>> I don't get this problem when I run Ofbiz normally using the same "login"
>> service.
>>
>> Somehow, it appears as if ofbiz-service.jar is not on the class path or
>> cannot be accessed.  I even went so far as to copy it into my lib
> directory
>> with my jar file where it is referenced by my ofbiz-component.xml as:
>>
>>     <classpath type="jar" location="dist/*"/>
>>     <classpath type="jar" location="dist/lib/*"/>
>>
>> No joy.  I am referencing lots of other Ofbiz jar files and they all load
>> just fine, for example ofbiz-base.jar, ofbiz-security.jar, and
>> ofbiz-party.jar.  For some reason, the class loader will not load the
>> service engine.  I only get a problem when I try to call a service with
>> "dispatcher.runSync()".  I have been successfully reading and writing the
>> the database via GenericDelegator without problem.  Just when I try to
run
> a
>> service.
>>
>> This is running under windows, jdk 1.5 and the Ofbiz version of a week
> ago.
>> For completeness, here is my containers.xml file:
>>
>> <ofbiz-containers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>
>>
>
xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/ofbiz-containers.xs
>> d">
>>     <!-- load the ofbiz component container (always first) -->
>>     <container name="component-container"
>> class="org.ofbiz.base.container.ComponentContainer"/>
>>
>>     <!-- load the cached classloader container (always second) -->
>>     <container name="classloader-container"
>> class="org.ofbiz.base.container.ClassLoaderContainer"/>
>>
>>     <!-- load the FS Sales Order Entry GUI -->
>>     <container name="fssoe-container" class="com.fs.FSSoeContainer">
>>         <property name="startup-directory"
>> value="/specialpurpose/fs/config/"/>
>>         <property name="dispatcher-name" value="FSSoeDispatcher"/>
>>         <property name="delegator-name" value="default"/>
>>     </container>
>>
>> </ofbiz-containers>
>>
>> Anyone have a clue.  I'd hate to do this thing entirely without using the
>> Ofbiz services.
>>
>> Skip
>>
>>
>>
>>
>>
>
>
>
>


Re: Stumped on a complicated question

Posted by BJ Freeman <bj...@free-man.net>.
did you check the log to see of services is getting loaded.
(main) [            UtilXml.java:243:DEBUG] XML Read 0.047s:
file:/C:/projects/java/digiresourcesllc/framework/service/ofbiz-component.xml
(main) [ ComponentContainer.java:207:INFO ] Loading component : [service]


skip@theDevers sent the following on 9/28/2007 6:25 AM:
> Yep, I gathered that.  Note that the class loader is retrieved with:
> 
>  ClassLoader loader = Thread.currentThread().getContextClassLoader();
> 
> I am guessing that the GUI thread does not have the application classpath.
> The question is, how to give it.  At runtime, I know exactly where all these
> jar file are.
> 
> Skip
> 
> -----Original Message-----
> From: BJ Freeman [mailto:bjfree@free-man.net]
> Sent: Friday, September 28, 2007 1:44 AM
> To: user@ofbiz.apache.org
> Subject: Re: Stumped on a complicated question
> 
> 
> would seem you don't have a classpath to the service engine.
> 
> skip@theDevers sent the following on 9/27/2007 10:30 PM:
>> I am getting the following error:
>>
>> java.lang.ClassNotFoundException:
>> org.ofbiz.service.engine.StandardJavaEngine
>>
>> On this line 81 of
>> org.ofbiz.service.engine.GenericEngineFactory.getGenericEngine:
>>
>>   Class c = loader.loadClass(className);
>>
>>
>> I am running ofbiz as a standalone app, similiar to java ofbiz.jar -pos
>>
>> I don't get this problem when I run Ofbiz normally using the same "login"
>> service.
>>
>> Somehow, it appears as if ofbiz-service.jar is not on the class path or
>> cannot be accessed.  I even went so far as to copy it into my lib
> directory
>> with my jar file where it is referenced by my ofbiz-component.xml as:
>>
>>     <classpath type="jar" location="dist/*"/>
>>     <classpath type="jar" location="dist/lib/*"/>
>>
>> No joy.  I am referencing lots of other Ofbiz jar files and they all load
>> just fine, for example ofbiz-base.jar, ofbiz-security.jar, and
>> ofbiz-party.jar.  For some reason, the class loader will not load the
>> service engine.  I only get a problem when I try to call a service with
>> "dispatcher.runSync()".  I have been successfully reading and writing the
>> the database via GenericDelegator without problem.  Just when I try to run
> a
>> service.
>>
>> This is running under windows, jdk 1.5 and the Ofbiz version of a week
> ago.
>> For completeness, here is my containers.xml file:
>>
>> <ofbiz-containers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>
>>
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/ofbiz-containers.xs
>> d">
>>     <!-- load the ofbiz component container (always first) -->
>>     <container name="component-container"
>> class="org.ofbiz.base.container.ComponentContainer"/>
>>
>>     <!-- load the cached classloader container (always second) -->
>>     <container name="classloader-container"
>> class="org.ofbiz.base.container.ClassLoaderContainer"/>
>>
>>     <!-- load the FS Sales Order Entry GUI -->
>>     <container name="fssoe-container" class="com.fs.FSSoeContainer">
>>         <property name="startup-directory"
>> value="/specialpurpose/fs/config/"/>
>>         <property name="dispatcher-name" value="FSSoeDispatcher"/>
>>         <property name="delegator-name" value="default"/>
>>     </container>
>>
>> </ofbiz-containers>
>>
>> Anyone have a clue.  I'd hate to do this thing entirely without using the
>> Ofbiz services.
>>
>> Skip
>>
>>
>>
>>
>>
> 
> 
> 
> 

RE: Stumped on a complicated question

Posted by "skip@theDevers" <sk...@thedevers.org>.
Yep, I gathered that.  Note that the class loader is retrieved with:

 ClassLoader loader = Thread.currentThread().getContextClassLoader();

I am guessing that the GUI thread does not have the application classpath.
The question is, how to give it.  At runtime, I know exactly where all these
jar file are.

Skip

-----Original Message-----
From: BJ Freeman [mailto:bjfree@free-man.net]
Sent: Friday, September 28, 2007 1:44 AM
To: user@ofbiz.apache.org
Subject: Re: Stumped on a complicated question


would seem you don't have a classpath to the service engine.

skip@theDevers sent the following on 9/27/2007 10:30 PM:
> I am getting the following error:
>
> java.lang.ClassNotFoundException:
> org.ofbiz.service.engine.StandardJavaEngine
>
> On this line 81 of
> org.ofbiz.service.engine.GenericEngineFactory.getGenericEngine:
>
>   Class c = loader.loadClass(className);
>
>
> I am running ofbiz as a standalone app, similiar to java ofbiz.jar -pos
>
> I don't get this problem when I run Ofbiz normally using the same "login"
> service.
>
> Somehow, it appears as if ofbiz-service.jar is not on the class path or
> cannot be accessed.  I even went so far as to copy it into my lib
directory
> with my jar file where it is referenced by my ofbiz-component.xml as:
>
>     <classpath type="jar" location="dist/*"/>
>     <classpath type="jar" location="dist/lib/*"/>
>
> No joy.  I am referencing lots of other Ofbiz jar files and they all load
> just fine, for example ofbiz-base.jar, ofbiz-security.jar, and
> ofbiz-party.jar.  For some reason, the class loader will not load the
> service engine.  I only get a problem when I try to call a service with
> "dispatcher.runSync()".  I have been successfully reading and writing the
> the database via GenericDelegator without problem.  Just when I try to run
a
> service.
>
> This is running under windows, jdk 1.5 and the Ofbiz version of a week
ago.
>
> For completeness, here is my containers.xml file:
>
> <ofbiz-containers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
>
xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/ofbiz-containers.xs
> d">
>     <!-- load the ofbiz component container (always first) -->
>     <container name="component-container"
> class="org.ofbiz.base.container.ComponentContainer"/>
>
>     <!-- load the cached classloader container (always second) -->
>     <container name="classloader-container"
> class="org.ofbiz.base.container.ClassLoaderContainer"/>
>
>     <!-- load the FS Sales Order Entry GUI -->
>     <container name="fssoe-container" class="com.fs.FSSoeContainer">
>         <property name="startup-directory"
> value="/specialpurpose/fs/config/"/>
>         <property name="dispatcher-name" value="FSSoeDispatcher"/>
>         <property name="delegator-name" value="default"/>
>     </container>
>
> </ofbiz-containers>
>
> Anyone have a clue.  I'd hate to do this thing entirely without using the
> Ofbiz services.
>
> Skip
>
>
>
>
>


Re: Stumped on a complicated question

Posted by BJ Freeman <bj...@free-man.net>.
would seem you don't have a classpath to the service engine.

skip@theDevers sent the following on 9/27/2007 10:30 PM:
> I am getting the following error:
> 
> java.lang.ClassNotFoundException:
> org.ofbiz.service.engine.StandardJavaEngine
> 
> On this line 81 of
> org.ofbiz.service.engine.GenericEngineFactory.getGenericEngine:
> 
>   Class c = loader.loadClass(className);
> 
> 
> I am running ofbiz as a standalone app, similiar to java ofbiz.jar -pos
> 
> I don't get this problem when I run Ofbiz normally using the same "login"
> service.
> 
> Somehow, it appears as if ofbiz-service.jar is not on the class path or
> cannot be accessed.  I even went so far as to copy it into my lib directory
> with my jar file where it is referenced by my ofbiz-component.xml as:
> 
>     <classpath type="jar" location="dist/*"/>
>     <classpath type="jar" location="dist/lib/*"/>
> 
> No joy.  I am referencing lots of other Ofbiz jar files and they all load
> just fine, for example ofbiz-base.jar, ofbiz-security.jar, and
> ofbiz-party.jar.  For some reason, the class loader will not load the
> service engine.  I only get a problem when I try to call a service with
> "dispatcher.runSync()".  I have been successfully reading and writing the
> the database via GenericDelegator without problem.  Just when I try to run a
> service.
> 
> This is running under windows, jdk 1.5 and the Ofbiz version of a week ago.
> 
> For completeness, here is my containers.xml file:
> 
> <ofbiz-containers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/ofbiz-containers.xs
> d">
>     <!-- load the ofbiz component container (always first) -->
>     <container name="component-container"
> class="org.ofbiz.base.container.ComponentContainer"/>
> 
>     <!-- load the cached classloader container (always second) -->
>     <container name="classloader-container"
> class="org.ofbiz.base.container.ClassLoaderContainer"/>
> 
>     <!-- load the FS Sales Order Entry GUI -->
>     <container name="fssoe-container" class="com.fs.FSSoeContainer">
>         <property name="startup-directory"
> value="/specialpurpose/fs/config/"/>
>         <property name="dispatcher-name" value="FSSoeDispatcher"/>
>         <property name="delegator-name" value="default"/>
>     </container>
> 
> </ofbiz-containers>
> 
> Anyone have a clue.  I'd hate to do this thing entirely without using the
> Ofbiz services.
> 
> Skip
> 
> 
> 
> 
> 

Stumped on a complicated question

Posted by "skip@theDevers" <sk...@thedevers.org>.
I am getting the following error:

java.lang.ClassNotFoundException:
org.ofbiz.service.engine.StandardJavaEngine

On this line 81 of
org.ofbiz.service.engine.GenericEngineFactory.getGenericEngine:

  Class c = loader.loadClass(className);


I am running ofbiz as a standalone app, similiar to java ofbiz.jar -pos

I don't get this problem when I run Ofbiz normally using the same "login"
service.

Somehow, it appears as if ofbiz-service.jar is not on the class path or
cannot be accessed.  I even went so far as to copy it into my lib directory
with my jar file where it is referenced by my ofbiz-component.xml as:

    <classpath type="jar" location="dist/*"/>
    <classpath type="jar" location="dist/lib/*"/>

No joy.  I am referencing lots of other Ofbiz jar files and they all load
just fine, for example ofbiz-base.jar, ofbiz-security.jar, and
ofbiz-party.jar.  For some reason, the class loader will not load the
service engine.  I only get a problem when I try to call a service with
"dispatcher.runSync()".  I have been successfully reading and writing the
the database via GenericDelegator without problem.  Just when I try to run a
service.

This is running under windows, jdk 1.5 and the Ofbiz version of a week ago.

For completeness, here is my containers.xml file:

<ofbiz-containers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/ofbiz-containers.xs
d">
    <!-- load the ofbiz component container (always first) -->
    <container name="component-container"
class="org.ofbiz.base.container.ComponentContainer"/>

    <!-- load the cached classloader container (always second) -->
    <container name="classloader-container"
class="org.ofbiz.base.container.ClassLoaderContainer"/>

    <!-- load the FS Sales Order Entry GUI -->
    <container name="fssoe-container" class="com.fs.FSSoeContainer">
        <property name="startup-directory"
value="/specialpurpose/fs/config/"/>
        <property name="dispatcher-name" value="FSSoeDispatcher"/>
        <property name="delegator-name" value="default"/>
    </container>

</ofbiz-containers>

Anyone have a clue.  I'd hate to do this thing entirely without using the
Ofbiz services.

Skip



Re: Quantity discount pricing

Posted by Walter Vaughan <wv...@steelerubber.com>.
skip@theDevers wrote:

> Can someone tell me how to implement quantity price breaks?  I somehow
> thought there a "minOrderQuantity" field and "QTY_DISCOUNT_PRICE", and
> "QTY_DISCOUNT_PERCENTAGE"  productPriceTypeIds, in ProductPrice, but I can't
> seem to find them now.
> 
> I am looking in PriceServices.java and there seems to be some support for
> quantity breaks using ProductPriceRule, but because
> "optimizeForLargeRuleSet" is hardcoded "false" with no way to change it, it
> looks to me like it will be impossibly slow because EVERY product for the
> current customer has two price breaks (thats a total of 140,000+ price rules
> to sort through).

I'm guessing Price Rules could work. Are the quantity breaks random, or is 
logical? I mean 1-5qty Full Price, 6-9qty 10% off, 10 or more 15% off?
Or is it more insane like productId A is 1-5, productId B is 1-3? Z 1-500?
Even if appears random, is there some sort of pattern from which you could 
create groups (Product Classifications)?
Product Classifications can be your friend. We have thousands of Product 
Classifications, yet only a handful of price rules.

In case you didn't realize it price rules add together, and you may have to 
create offseting rules to get the price where you want it.

> Can someone offer guidance or should I modify ProductPrice to suite my needs
> and hope that you guys will roll it back in.
> 
> Skip
> 
> 
>