Approving user account.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
86 messages Options
12345
Reply | Threaded
Open this post in threaded view
|

Approving user account.

Rupinder
Hi
    In the ecommerce product store ("Catalog -> Stores -> OFBiz E-Commerce Store [9000]" in catalog application), I have set  "Allow Password " option to "N". By doing this, When a user opens a  new registration form (create new user) in a ecommerce application, instead of displaying "Password" and "Confirm Password" text box fields, it displays the following message:  "You will receive a password by email when your new account is approved".

 Friends Please tell how we will enable/approve  that account and how  email will be send to user containing his password.

 I have already configured  "general.properties"  according to my SMTP MAIL SERVER.


Regards,

Rupinder
Voltix Software Pvt. Ltd.
Reply | Threaded
Open this post in threaded view
|

Re: Approving user account.

BJ Freeman
you have to create a email template in the stores email section.
it has to have a PRDS_CUST_REGISTER type and points to
ftl that is a template for the emailing the password.
not sure which template to use but there are a couple already.

Rupinder sent the following on 9/27/2007 10:33 PM:

> Hi
>     In the ecommerce product store ("Catalog -> Stores -> OFBiz E-Commerce
> Store [9000]" in catalog application), I have set  "Allow Password " option
> to "N". By doing this, When a user opens a  new registration form (create
> new user) in a ecommerce application, instead of displaying "Password" and
> "Confirm Password" text box fields, it displays the following message:  "You
> will receive a password by email when your new account is approved".
>
>  Friends Please tell how we will enable/approve  that account and how  email
> will be send to user containing his password.
>
>  I have already configured  "general.properties"  according to my SMTP MAIL
> SERVER.
>
>
> regards
> Rupinder
Reply | Threaded
Open this post in threaded view
|

Re: Approving user account.

BJ Freeman
In reply to this post by Rupinder
look at
https://issues.apache.org/jira/browse/OFBIZ-1274

Rupinder sent the following on 9/27/2007 10:59 PM:

> Hi
>     In the ecommerce product store ("Catalog -> Stores -> OFBiz E-Commerce
> Store [9000]" in catalog application), I have set  "Allow Password " option
> to "N". By doing this, When a user opens a  new registration form (create
> new user) in a ecommerce application, instead of displaying "Password" and
> "Confirm Password" text box fields, it displays the following message:  "You
> will receive a password by email when your new account is approved".
>
>  Friends Please tell how we will enable/approve  that account and how  email
> will be send to user containing his password.
>
>  I have already configured  "general.properties"  according to my SMTP MAIL
> SERVER.
>
>
> Regards,
>
> Rupinder
> Voltix Software Pvt. Ltd.
Reply | Threaded
Open this post in threaded view
|

In case anyone is interested

SkipDever
In reply to this post by BJ Freeman
Yesterday, I sent out this email:

Stumped on a complicated question:

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 have solved the problem and the solution was fairly simple.  I was
prepared to do a reflection call to addURL on the ClassLoader, but the the
solution turned out to be even simpler than that.

When Ofbiz instantiated my container, I simply grabbed the class loader it
used to start me up and then passed it to the Ofbiz connection layer like
this:

ClassLoader loader = Thread.currentThread().getContextClassLoader();
if(loader instanceof URLClassLoader)
{
        URLClassLoader urlLoader = (URLClassLoader)loader;
        connection.setClassLoader (urlLoader);

}


In the connection layer, I have this code:

void resetClassLoader()
{
        if(this.loader == null)
                return;

        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        if(loader != this.loader)
        Thread.currentThread().setContextClassLoader(this.loader);

}

I then simply call resetClassLoader() every time before I call an Ofbiz
service.

Works a charm.

Skip

Reply | Threaded
Open this post in threaded view
|

Re: In case anyone is interested

Jacques Le Roux
Administrator
Thanks Skip

Put in my notes, maybe useful later. Not sure there is not a better practice for that, though. Like using something similar than
the -pos parameter in command line ?

Jacques

----- Message d'origine -----
De : "skip@theDevers" <[hidden email]>
À : <[hidden email]>
Envoyé : samedi 29 septembre 2007 03:11
Objet : In case anyone is interested


> Yesterday, I sent out this email:
>
> Stumped on a complicated question:
>
> 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 have solved the problem and the solution was fairly simple.  I was
> prepared to do a reflection call to addURL on the ClassLoader, but the the
> solution turned out to be even simpler than that.
>
> When Ofbiz instantiated my container, I simply grabbed the class loader it
> used to start me up and then passed it to the Ofbiz connection layer like
> this:
>
> ClassLoader loader = Thread.currentThread().getContextClassLoader();
> if(loader instanceof URLClassLoader)
> {
> URLClassLoader urlLoader = (URLClassLoader)loader;
> connection.setClassLoader (urlLoader);
>
> }
>
>
> In the connection layer, I have this code:
>
> void resetClassLoader()
> {
> if(this.loader == null)
> return;
>
> ClassLoader loader = Thread.currentThread().getContextClassLoader();
> if(loader != this.loader)
>         Thread.currentThread().setContextClassLoader(this.loader);
>
> }
>
> I then simply call resetClassLoader() every time before I call an Ofbiz
> service.
>
> Works a charm.
>
> Skip
>

Reply | Threaded
Open this post in threaded view
|

RE: In case anyone is interested

SkipDever
Jacques

That is exactly what I did, I added a -soe (and soe.properties, etc) and my
own container, almost identical to the XUIContainer.  However, this was a
pure java app and when the GUI thread had control I could not call any Ofbiz
services because of the class not found error.

Didnt have a problem when called from the container thread, only when called
by the GUI thread.

Skip

-----Original Message-----
From: Jacques Le Roux [mailto:[hidden email]]
Sent: Saturday, September 29, 2007 2:01 PM
To: [hidden email]
Subject: Re: In case anyone is interested


Thanks Skip

Put in my notes, maybe useful later. Not sure there is not a better practice
for that, though. Like using something similar than
the -pos parameter in command line ?

Jacques

----- Message d'origine -----
De : "skip@theDevers" <[hidden email]>
À : <[hidden email]>
Envoyé : samedi 29 septembre 2007 03:11
Objet : In case anyone is interested


> Yesterday, I sent out this email:
>
> Stumped on a complicated question:
>
> 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 have solved the problem and the solution was fairly simple.  I was
> prepared to do a reflection call to addURL on the ClassLoader, but the the
> solution turned out to be even simpler than that.
>
> When Ofbiz instantiated my container, I simply grabbed the class loader it
> used to start me up and then passed it to the Ofbiz connection layer like
> this:
>
> ClassLoader loader = Thread.currentThread().getContextClassLoader();
> if(loader instanceof URLClassLoader)
> {
> URLClassLoader urlLoader = (URLClassLoader)loader;
> connection.setClassLoader (urlLoader);
>
> }
>
>
> In the connection layer, I have this code:
>
> void resetClassLoader()
> {
> if(this.loader == null)
> return;
>
> ClassLoader loader = Thread.currentThread().getContextClassLoader();
> if(loader != this.loader)
>         Thread.currentThread().setContextClassLoader(this.loader);
>
> }
>
> I then simply call resetClassLoader() every time before I call an Ofbiz
> service.
>
> Works a charm.
>
> Skip
>


Reply | Threaded
Open this post in threaded view
|

Complicated pricing

SkipDever
In reply to this post by BJ Freeman
I have had another discussion about pricing with my customer today and the
pricing is more complicated that I remembered.  Their pricing is based on a
percentage above cost and package quantity, i.e. 30% above cost for one
package (12 pieces), 25% above cost for 2 packages (24 pieces), and 100
percent above cost for any broken package plus a fixed abount depending on
cost, i.e. + a buck for all below 1 dollar, + 2 for all below 5 and nothing
for above 10.

This is outside what I see in the ofbiz pricing module in
PriceServices.java, and so it appears as if I will have to write my own
price calculation service.

What I would like to do is write a subclass of PriceServices so my
"calculateProductPrice" subclass gets called whenever
runSync("calculateProductPrice") gets called.  I would like to do this in
such a way that I don't bother the core Ofbiz code as I'll still be using
the shoppingcart, etc.

Can anyone offer any advice or point me to samples?

Skip

Reply | Threaded
Open this post in threaded view
|

Re: In case anyone is interested

Jacques Le Roux
Administrator
In reply to this post by SkipDever
Skip,

Thanks for comment, definitively in my notes :o)

Jacques

De : "skip@theDevers" <[hidden email]>

> Jacques
>
> That is exactly what I did, I added a -soe (and soe.properties, etc) and my
> own container, almost identical to the XUIContainer.  However, this was a
> pure java app and when the GUI thread had control I could not call any Ofbiz
> services because of the class not found error.
>
> Didnt have a problem when called from the container thread, only when called
> by the GUI thread.
>
> Skip
>
> -----Original Message-----
> From: Jacques Le Roux [mailto:[hidden email]]
> Sent: Saturday, September 29, 2007 2:01 PM
> To: [hidden email]
> Subject: Re: In case anyone is interested
>
>
> Thanks Skip
>
> Put in my notes, maybe useful later. Not sure there is not a better practice
> for that, though. Like using something similar than
> the -pos parameter in command line ?
>
> Jacques
>
> ----- Message d'origine -----
> De : "skip@theDevers" <[hidden email]>
> À : <[hidden email]>
> Envoyé : samedi 29 septembre 2007 03:11
> Objet : In case anyone is interested
>
>
> > Yesterday, I sent out this email:
> >
> > Stumped on a complicated question:
> >
> > 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 have solved the problem and the solution was fairly simple.  I was
> > prepared to do a reflection call to addURL on the ClassLoader, but the the
> > solution turned out to be even simpler than that.
> >
> > When Ofbiz instantiated my container, I simply grabbed the class loader it
> > used to start me up and then passed it to the Ofbiz connection layer like
> > this:
> >
> > ClassLoader loader = Thread.currentThread().getContextClassLoader();
> > if(loader instanceof URLClassLoader)
> > {
> > URLClassLoader urlLoader = (URLClassLoader)loader;
> > connection.setClassLoader (urlLoader);
> >
> > }
> >
> >
> > In the connection layer, I have this code:
> >
> > void resetClassLoader()
> > {
> > if(this.loader == null)
> > return;
> >
> > ClassLoader loader = Thread.currentThread().getContextClassLoader();
> > if(loader != this.loader)
> >         Thread.currentThread().setContextClassLoader(this.loader);
> >
> > }
> >
> > I then simply call resetClassLoader() every time before I call an Ofbiz
> > service.
> >
> > Works a charm.
> >
> > Skip
> >
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Complicated pricing

jonwimp
In reply to this post by SkipDever
Yes, overriding that method will mean you won't touch the OFBiz codes. That could mean you can
continue to use your custom method, while still conveniently watching the community's updates to
the original method.

Such a method override will also kinda "document" your custom method as "being related to some
original OFBiz method", so you know what original OFBiz codes to use for side-by-side comparisons
of your codes. Making huge overhauls to the original method can make it difficult to do such
comparisons.

One gotcha here. Make sure you fully understand the original method you're overriding, so that you
don't break any dependencies on that method.

As far as possible, I do try to touch as few OFBiz codes as possible. If any OFBiz codes need to
be enhanced, it is possibly to make them more generic and more base-level or more fine-grained or
more customizable building blocks.

Jonathon

skip@theDevers wrote:

> I have had another discussion about pricing with my customer today and the
> pricing is more complicated that I remembered.  Their pricing is based on a
> percentage above cost and package quantity, i.e. 30% above cost for one
> package (12 pieces), 25% above cost for 2 packages (24 pieces), and 100
> percent above cost for any broken package plus a fixed abount depending on
> cost, i.e. + a buck for all below 1 dollar, + 2 for all below 5 and nothing
> for above 10.
>
> This is outside what I see in the ofbiz pricing module in
> PriceServices.java, and so it appears as if I will have to write my own
> price calculation service.
>
> What I would like to do is write a subclass of PriceServices so my
> "calculateProductPrice" subclass gets called whenever
> runSync("calculateProductPrice") gets called.  I would like to do this in
> such a way that I don't bother the core Ofbiz code as I'll still be using
> the shoppingcart, etc.
>
> Can anyone offer any advice or point me to samples?
>
> Skip
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Complicated pricing

sharad bhushan
Hi,

Just To support the comments below we also customized the services like shippingcosts service ,mail service.. and to do that customization remeber that this service changes will be used by the frame work at all levels (i mean calls).
You can customize this just by writing the service and giving the location to your class.Service name have to be retained as they are now.....so that ofbiz takes care of handling calls
Service framework is great and is configurable tooo...(For whatever contexts we used the we were comfortable).

Regards
Sharad

Jonathon -- Improov <[hidden email]> wrote: Yes, overriding that method will mean you won't touch the OFBiz codes. That could mean you can
continue to use your custom method, while still conveniently watching the community's updates to
the original method.

Such a method override will also kinda "document" your custom method as "being related to some
original OFBiz method", so you know what original OFBiz codes to use for side-by-side comparisons
of your codes. Making huge overhauls to the original method can make it difficult to do such
comparisons.

One gotcha here. Make sure you fully understand the original method you're overriding, so that you
don't break any dependencies on that method.

As far as possible, I do try to touch as few OFBiz codes as possible. If any OFBiz codes need to
be enhanced, it is possibly to make them more generic and more base-level or more fine-grained or
more customizable building blocks.

Jonathon

skip@theDevers wrote:

> I have had another discussion about pricing with my customer today and the
> pricing is more complicated that I remembered.  Their pricing is based on a
> percentage above cost and package quantity, i.e. 30% above cost for one
> package (12 pieces), 25% above cost for 2 packages (24 pieces), and 100
> percent above cost for any broken package plus a fixed abount depending on
> cost, i.e. + a buck for all below 1 dollar, + 2 for all below 5 and nothing
> for above 10.
>
> This is outside what I see in the ofbiz pricing module in
> PriceServices.java, and so it appears as if I will have to write my own
> price calculation service.
>
> What I would like to do is write a subclass of PriceServices so my
> "calculateProductPrice" subclass gets called whenever
> runSync("calculateProductPrice") gets called.  I would like to do this in
> such a way that I don't bother the core Ofbiz code as I'll still be using
> the shoppingcart, etc.
>
> Can anyone offer any advice or point me to samples?
>
> Skip
>
>



       
---------------------------------
 Download prohibited? No problem. CHAT from any browser, without download.
Reply | Threaded
Open this post in threaded view
|

RE: Complicated pricing

SkipDever
In reply to this post by jonwimp
Jonathon

Thanks for the input.  However, I guess I didn't ask the question right.
"calculateProductPrice" is defined as a service in services_pricepromo.xml
as:

    <service name="calculateProductPrice" engine="java"
                location="org.ofbiz.product.price.PriceServices"
invoke="calculateProductPrice" auth="false" use-transaction="false">
...

and this is loaded from ...product/ofbiz-component.xml as
    <service-resource type="model" loader="main"
location="servicedef/services_pricepromo.xml"/>

The question is, how can I override the original definition without
modifying Ofbiz code.  i.e. can I put an identically named service
definition in hot-deploy or somewhere and have all of Ofbiz use my new
calculateProductPrice?

Skip


-----Original Message-----
From: Jonathon -- Improov [mailto:[hidden email]]
Sent: Sunday, September 30, 2007 2:39 AM
To: [hidden email]
Subject: Re: Complicated pricing


Yes, overriding that method will mean you won't touch the OFBiz codes. That
could mean you can
continue to use your custom method, while still conveniently watching the
community's updates to
the original method.

Such a method override will also kinda "document" your custom method as
"being related to some
original OFBiz method", so you know what original OFBiz codes to use for
side-by-side comparisons
of your codes. Making huge overhauls to the original method can make it
difficult to do such
comparisons.

One gotcha here. Make sure you fully understand the original method you're
overriding, so that you
don't break any dependencies on that method.

As far as possible, I do try to touch as few OFBiz codes as possible. If any
OFBiz codes need to
be enhanced, it is possibly to make them more generic and more base-level or
more fine-grained or
more customizable building blocks.

Jonathon

skip@theDevers wrote:
> I have had another discussion about pricing with my customer today and the
> pricing is more complicated that I remembered.  Their pricing is based on
a
> percentage above cost and package quantity, i.e. 30% above cost for one
> package (12 pieces), 25% above cost for 2 packages (24 pieces), and 100
> percent above cost for any broken package plus a fixed abount depending on
> cost, i.e. + a buck for all below 1 dollar, + 2 for all below 5 and
nothing

> for above 10.
>
> This is outside what I see in the ofbiz pricing module in
> PriceServices.java, and so it appears as if I will have to write my own
> price calculation service.
>
> What I would like to do is write a subclass of PriceServices so my
> "calculateProductPrice" subclass gets called whenever
> runSync("calculateProductPrice") gets called.  I would like to do this in
> such a way that I don't bother the core Ofbiz code as I'll still be using
> the shoppingcart, etc.
>
> Can anyone offer any advice or point me to samples?
>
> Skip
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Complicated pricing

BJ Freeman
it would seem the easiest to so put your service in your module
/specilized/skipdever/servicedefs
and call it calculateProductPrice_mod
you code can then call it.
should your code be accepted by the community
then change it to calculateProductPrice send a patch
via the jira

skip@theDevers sent the following on 9/30/2007 10:50 AM:

> Jonathon
>
> Thanks for the input.  However, I guess I didn't ask the question right.
> "calculateProductPrice" is defined as a service in services_pricepromo.xml
> as:
>
>     <service name="calculateProductPrice" engine="java"
>                 location="org.ofbiz.product.price.PriceServices"
> invoke="calculateProductPrice" auth="false" use-transaction="false">
> ...
>
> and this is loaded from ...product/ofbiz-component.xml as
>     <service-resource type="model" loader="main"
> location="servicedef/services_pricepromo.xml"/>
>
> The question is, how can I override the original definition without
> modifying Ofbiz code.  i.e. can I put an identically named service
> definition in hot-deploy or somewhere and have all of Ofbiz use my new
> calculateProductPrice?
>
> Skip
>
>
> -----Original Message-----
> From: Jonathon -- Improov [mailto:[hidden email]]
> Sent: Sunday, September 30, 2007 2:39 AM
> To: [hidden email]
> Subject: Re: Complicated pricing
>
>
> Yes, overriding that method will mean you won't touch the OFBiz codes. That
> could mean you can
> continue to use your custom method, while still conveniently watching the
> community's updates to
> the original method.
>
> Such a method override will also kinda "document" your custom method as
> "being related to some
> original OFBiz method", so you know what original OFBiz codes to use for
> side-by-side comparisons
> of your codes. Making huge overhauls to the original method can make it
> difficult to do such
> comparisons.
>
> One gotcha here. Make sure you fully understand the original method you're
> overriding, so that you
> don't break any dependencies on that method.
>
> As far as possible, I do try to touch as few OFBiz codes as possible. If any
> OFBiz codes need to
> be enhanced, it is possibly to make them more generic and more base-level or
> more fine-grained or
> more customizable building blocks.
>
> Jonathon
>
> skip@theDevers wrote:
>> I have had another discussion about pricing with my customer today and the
>> pricing is more complicated that I remembered.  Their pricing is based on
> a
>> percentage above cost and package quantity, i.e. 30% above cost for one
>> package (12 pieces), 25% above cost for 2 packages (24 pieces), and 100
>> percent above cost for any broken package plus a fixed abount depending on
>> cost, i.e. + a buck for all below 1 dollar, + 2 for all below 5 and
> nothing
>> for above 10.
>>
>> This is outside what I see in the ofbiz pricing module in
>> PriceServices.java, and so it appears as if I will have to write my own
>> price calculation service.
>>
>> What I would like to do is write a subclass of PriceServices so my
>> "calculateProductPrice" subclass gets called whenever
>> runSync("calculateProductPrice") gets called.  I would like to do this in
>> such a way that I don't bother the core Ofbiz code as I'll still be using
>> the shoppingcart, etc.
>>
>> Can anyone offer any advice or point me to samples?
>>
>> Skip
>>
>>
>
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Complicated pricing

BJ Freeman
or /hotdeploy/skipdever/servicedefs

BJ Freeman sent the following on 9/30/2007 11:16 AM:

> it would seem the easiest to so put your service in your module
> /specilized/skipdever/servicedefs
> and call it calculateProductPrice_mod
> you code can then call it.
> should your code be accepted by the community
> then change it to calculateProductPrice send a patch
> via the jira
>
> skip@theDevers sent the following on 9/30/2007 10:50 AM:
>> Jonathon
>>
>> Thanks for the input.  However, I guess I didn't ask the question right.
>> "calculateProductPrice" is defined as a service in services_pricepromo.xml
>> as:
>>
>>     <service name="calculateProductPrice" engine="java"
>>                 location="org.ofbiz.product.price.PriceServices"
>> invoke="calculateProductPrice" auth="false" use-transaction="false">
>> ...
>>
>> and this is loaded from ...product/ofbiz-component.xml as
>>     <service-resource type="model" loader="main"
>> location="servicedef/services_pricepromo.xml"/>
>>
>> The question is, how can I override the original definition without
>> modifying Ofbiz code.  i.e. can I put an identically named service
>> definition in hot-deploy or somewhere and have all of Ofbiz use my new
>> calculateProductPrice?
>>
>> Skip
>>
>>
>> -----Original Message-----
>> From: Jonathon -- Improov [mailto:[hidden email]]
>> Sent: Sunday, September 30, 2007 2:39 AM
>> To: [hidden email]
>> Subject: Re: Complicated pricing
>>
>>
>> Yes, overriding that method will mean you won't touch the OFBiz codes. That
>> could mean you can
>> continue to use your custom method, while still conveniently watching the
>> community's updates to
>> the original method.
>>
>> Such a method override will also kinda "document" your custom method as
>> "being related to some
>> original OFBiz method", so you know what original OFBiz codes to use for
>> side-by-side comparisons
>> of your codes. Making huge overhauls to the original method can make it
>> difficult to do such
>> comparisons.
>>
>> One gotcha here. Make sure you fully understand the original method you're
>> overriding, so that you
>> don't break any dependencies on that method.
>>
>> As far as possible, I do try to touch as few OFBiz codes as possible. If any
>> OFBiz codes need to
>> be enhanced, it is possibly to make them more generic and more base-level or
>> more fine-grained or
>> more customizable building blocks.
>>
>> Jonathon
>>
>> skip@theDevers wrote:
>>> I have had another discussion about pricing with my customer today and the
>>> pricing is more complicated that I remembered.  Their pricing is based on
>> a
>>> percentage above cost and package quantity, i.e. 30% above cost for one
>>> package (12 pieces), 25% above cost for 2 packages (24 pieces), and 100
>>> percent above cost for any broken package plus a fixed abount depending on
>>> cost, i.e. + a buck for all below 1 dollar, + 2 for all below 5 and
>> nothing
>>> for above 10.
>>>
>>> This is outside what I see in the ofbiz pricing module in
>>> PriceServices.java, and so it appears as if I will have to write my own
>>> price calculation service.
>>>
>>> What I would like to do is write a subclass of PriceServices so my
>>> "calculateProductPrice" subclass gets called whenever
>>> runSync("calculateProductPrice") gets called.  I would like to do this in
>>> such a way that I don't bother the core Ofbiz code as I'll still be using
>>> the shoppingcart, etc.
>>>
>>> Can anyone offer any advice or point me to samples?
>>>
>>> Skip
>>>
>>>
>>
>>
>>
>>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Complicated pricing

jonwimp
In reply to this post by SkipDever
Skip,

Create a hot-deploy app (you can skip the webapp creation). Insert a service definition (in say
servicedef/services.xml), service name "skip.calculateProductPrice".

Extend the class of original Java method "calculateProductPrice", in case that method uses any
class members. In your new class (extended from original class), do your new Java method
"calculateProductPrice". The point here is to clearly document for yourself which OFBiz method you
are cloning and modifying.

Java extension mechanisms (eg class extends, method overrides) make for clean codes that avoid
redundancies. Same for OFBiz extension mechanisms.

By the way, you can "implement" (think Java's "implement" for interfaces) a service definition,
kind of. I'm not sure if you can "implement" a fully-defined service definition like service
"calculateProductPrice". You can try it.

For egs, see in Accounting module folder servicedef. See services_authorizedotnet.xml service
"AIMCCAuthCapture", and services_paymentmethod.xml service "ccAuthInterface" and service
"paymentProcessInterface".

Jonathon

skip@theDevers wrote:

> Jonathon
>
> Thanks for the input.  However, I guess I didn't ask the question right.
> "calculateProductPrice" is defined as a service in services_pricepromo.xml
> as:
>
>     <service name="calculateProductPrice" engine="java"
>                 location="org.ofbiz.product.price.PriceServices"
> invoke="calculateProductPrice" auth="false" use-transaction="false">
> ...
>
> and this is loaded from ...product/ofbiz-component.xml as
>     <service-resource type="model" loader="main"
> location="servicedef/services_pricepromo.xml"/>
>
> The question is, how can I override the original definition without
> modifying Ofbiz code.  i.e. can I put an identically named service
> definition in hot-deploy or somewhere and have all of Ofbiz use my new
> calculateProductPrice?
>
> Skip
>
>
> -----Original Message-----
> From: Jonathon -- Improov [mailto:[hidden email]]
> Sent: Sunday, September 30, 2007 2:39 AM
> To: [hidden email]
> Subject: Re: Complicated pricing
>
>
> Yes, overriding that method will mean you won't touch the OFBiz codes. That
> could mean you can
> continue to use your custom method, while still conveniently watching the
> community's updates to
> the original method.
>
> Such a method override will also kinda "document" your custom method as
> "being related to some
> original OFBiz method", so you know what original OFBiz codes to use for
> side-by-side comparisons
> of your codes. Making huge overhauls to the original method can make it
> difficult to do such
> comparisons.
>
> One gotcha here. Make sure you fully understand the original method you're
> overriding, so that you
> don't break any dependencies on that method.
>
> As far as possible, I do try to touch as few OFBiz codes as possible. If any
> OFBiz codes need to
> be enhanced, it is possibly to make them more generic and more base-level or
> more fine-grained or
> more customizable building blocks.
>
> Jonathon
>
> skip@theDevers wrote:
>> I have had another discussion about pricing with my customer today and the
>> pricing is more complicated that I remembered.  Their pricing is based on
> a
>> percentage above cost and package quantity, i.e. 30% above cost for one
>> package (12 pieces), 25% above cost for 2 packages (24 pieces), and 100
>> percent above cost for any broken package plus a fixed abount depending on
>> cost, i.e. + a buck for all below 1 dollar, + 2 for all below 5 and
> nothing
>> for above 10.
>>
>> This is outside what I see in the ofbiz pricing module in
>> PriceServices.java, and so it appears as if I will have to write my own
>> price calculation service.
>>
>> What I would like to do is write a subclass of PriceServices so my
>> "calculateProductPrice" subclass gets called whenever
>> runSync("calculateProductPrice") gets called.  I would like to do this in
>> such a way that I don't bother the core Ofbiz code as I'll still be using
>> the shoppingcart, etc.
>>
>> Can anyone offer any advice or point me to samples?
>>
>> Skip
>>
>>
>
>
>

Reply | Threaded
Open this post in threaded view
|

RE: Complicated pricing

SkipDever
Jonathon

Thanks - thanks.  This is exactly what I needed and you saved me hours on
trial and error.  Equally important, this is exactly what I hoped I could
do.

Thanks again.  I'll add this email to my important notes.

Skip

-----Original Message-----
From: Jonathon -- Improov [mailto:[hidden email]]
Sent: Sunday, September 30, 2007 7:54 PM
To: [hidden email]
Subject: Re: Complicated pricing


Skip,

Create a hot-deploy app (you can skip the webapp creation). Insert a service
definition (in say
servicedef/services.xml), service name "skip.calculateProductPrice".

Extend the class of original Java method "calculateProductPrice", in case
that method uses any
class members. In your new class (extended from original class), do your new
Java method
"calculateProductPrice". The point here is to clearly document for yourself
which OFBiz method you
are cloning and modifying.

Java extension mechanisms (eg class extends, method overrides) make for
clean codes that avoid
redundancies. Same for OFBiz extension mechanisms.

By the way, you can "implement" (think Java's "implement" for interfaces) a
service definition,
kind of. I'm not sure if you can "implement" a fully-defined service
definition like service
"calculateProductPrice". You can try it.

For egs, see in Accounting module folder servicedef. See
services_authorizedotnet.xml service
"AIMCCAuthCapture", and services_paymentmethod.xml service "ccAuthInterface"
and service
"paymentProcessInterface".

Jonathon

skip@theDevers wrote:

> Jonathon
>
> Thanks for the input.  However, I guess I didn't ask the question right.
> "calculateProductPrice" is defined as a service in services_pricepromo.xml
> as:
>
>     <service name="calculateProductPrice" engine="java"
>                 location="org.ofbiz.product.price.PriceServices"
> invoke="calculateProductPrice" auth="false" use-transaction="false">
> ...
>
> and this is loaded from ...product/ofbiz-component.xml as
>     <service-resource type="model" loader="main"
> location="servicedef/services_pricepromo.xml"/>
>
> The question is, how can I override the original definition without
> modifying Ofbiz code.  i.e. can I put an identically named service
> definition in hot-deploy or somewhere and have all of Ofbiz use my new
> calculateProductPrice?
>
> Skip
>
>
> -----Original Message-----
> From: Jonathon -- Improov [mailto:[hidden email]]
> Sent: Sunday, September 30, 2007 2:39 AM
> To: [hidden email]
> Subject: Re: Complicated pricing
>
>
> Yes, overriding that method will mean you won't touch the OFBiz codes.
That

> could mean you can
> continue to use your custom method, while still conveniently watching the
> community's updates to
> the original method.
>
> Such a method override will also kinda "document" your custom method as
> "being related to some
> original OFBiz method", so you know what original OFBiz codes to use for
> side-by-side comparisons
> of your codes. Making huge overhauls to the original method can make it
> difficult to do such
> comparisons.
>
> One gotcha here. Make sure you fully understand the original method you're
> overriding, so that you
> don't break any dependencies on that method.
>
> As far as possible, I do try to touch as few OFBiz codes as possible. If
any
> OFBiz codes need to
> be enhanced, it is possibly to make them more generic and more base-level
or
> more fine-grained or
> more customizable building blocks.
>
> Jonathon
>
> skip@theDevers wrote:
>> I have had another discussion about pricing with my customer today and
the
>> pricing is more complicated that I remembered.  Their pricing is based on
> a
>> percentage above cost and package quantity, i.e. 30% above cost for one
>> package (12 pieces), 25% above cost for 2 packages (24 pieces), and 100
>> percent above cost for any broken package plus a fixed abount depending
on

>> cost, i.e. + a buck for all below 1 dollar, + 2 for all below 5 and
> nothing
>> for above 10.
>>
>> This is outside what I see in the ofbiz pricing module in
>> PriceServices.java, and so it appears as if I will have to write my own
>> price calculation service.
>>
>> What I would like to do is write a subclass of PriceServices so my
>> "calculateProductPrice" subclass gets called whenever
>> runSync("calculateProductPrice") gets called.  I would like to do this in
>> such a way that I don't bother the core Ofbiz code as I'll still be using
>> the shoppingcart, etc.
>>
>> Can anyone offer any advice or point me to samples?
>>
>> Skip
>>
>>
>
>
>


Reply | Threaded
Open this post in threaded view
|

RE: Complicated pricing

SkipDever
In reply to this post by sharad bhushan
Sharad

Thanks to you as well, I think I am beginning to understand this service
extension.

Skip

-----Original Message-----
From: sharad bhushan [mailto:[hidden email]]
Sent: Sunday, September 30, 2007 9:24 AM
To: [hidden email]
Subject: Re: Complicated pricing


Hi,

Just To support the comments below we also customized the services like
shippingcosts service ,mail service.. and to do that customization remeber
that this service changes will be used by the frame work at all levels (i
mean calls).
You can customize this just by writing the service and giving the location
to your class.Service name have to be retained as they are now.....so that
ofbiz takes care of handling calls
Service framework is great and is configurable tooo...(For whatever contexts
we used the we were comfortable).

Regards
Sharad

Jonathon -- Improov <[hidden email]> wrote: Yes, overriding that method
will mean you won't touch the OFBiz codes. That could mean you can
continue to use your custom method, while still conveniently watching the
community's updates to
the original method.

Such a method override will also kinda "document" your custom method as
"being related to some
original OFBiz method", so you know what original OFBiz codes to use for
side-by-side comparisons
of your codes. Making huge overhauls to the original method can make it
difficult to do such
comparisons.

One gotcha here. Make sure you fully understand the original method you're
overriding, so that you
don't break any dependencies on that method.

As far as possible, I do try to touch as few OFBiz codes as possible. If any
OFBiz codes need to
be enhanced, it is possibly to make them more generic and more base-level or
more fine-grained or
more customizable building blocks.

Jonathon

skip@theDevers wrote:
> I have had another discussion about pricing with my customer today and the
> pricing is more complicated that I remembered.  Their pricing is based on
a
> percentage above cost and package quantity, i.e. 30% above cost for one
> package (12 pieces), 25% above cost for 2 packages (24 pieces), and 100
> percent above cost for any broken package plus a fixed abount depending on
> cost, i.e. + a buck for all below 1 dollar, + 2 for all below 5 and
nothing

> for above 10.
>
> This is outside what I see in the ofbiz pricing module in
> PriceServices.java, and so it appears as if I will have to write my own
> price calculation service.
>
> What I would like to do is write a subclass of PriceServices so my
> "calculateProductPrice" subclass gets called whenever
> runSync("calculateProductPrice") gets called.  I would like to do this in
> such a way that I don't bother the core Ofbiz code as I'll still be using
> the shoppingcart, etc.
>
> Can anyone offer any advice or point me to samples?
>
> Skip
>
>




---------------------------------
 Download prohibited? No problem. CHAT from any browser, without download.

Reply | Threaded
Open this post in threaded view
|

RE: Complicated pricing

SkipDever
In reply to this post by BJ Freeman
BJ

Not much chance this bit of code will be useful to the extended community.
This is pretty weird from most of my customers.  But, I hang on to it just
in case.

Skip

-----Original Message-----
From: BJ Freeman [mailto:[hidden email]]
Sent: Sunday, September 30, 2007 11:17 AM
To: [hidden email]
Subject: Re: Complicated pricing


it would seem the easiest to so put your service in your module
/specilized/skipdever/servicedefs
and call it calculateProductPrice_mod
you code can then call it.
should your code be accepted by the community
then change it to calculateProductPrice send a patch
via the jira

skip@theDevers sent the following on 9/30/2007 10:50 AM:

> Jonathon
>
> Thanks for the input.  However, I guess I didn't ask the question right.
> "calculateProductPrice" is defined as a service in services_pricepromo.xml
> as:
>
>     <service name="calculateProductPrice" engine="java"
>                 location="org.ofbiz.product.price.PriceServices"
> invoke="calculateProductPrice" auth="false" use-transaction="false">
> ...
>
> and this is loaded from ...product/ofbiz-component.xml as
>     <service-resource type="model" loader="main"
> location="servicedef/services_pricepromo.xml"/>
>
> The question is, how can I override the original definition without
> modifying Ofbiz code.  i.e. can I put an identically named service
> definition in hot-deploy or somewhere and have all of Ofbiz use my new
> calculateProductPrice?
>
> Skip
>
>
> -----Original Message-----
> From: Jonathon -- Improov [mailto:[hidden email]]
> Sent: Sunday, September 30, 2007 2:39 AM
> To: [hidden email]
> Subject: Re: Complicated pricing
>
>
> Yes, overriding that method will mean you won't touch the OFBiz codes.
That

> could mean you can
> continue to use your custom method, while still conveniently watching the
> community's updates to
> the original method.
>
> Such a method override will also kinda "document" your custom method as
> "being related to some
> original OFBiz method", so you know what original OFBiz codes to use for
> side-by-side comparisons
> of your codes. Making huge overhauls to the original method can make it
> difficult to do such
> comparisons.
>
> One gotcha here. Make sure you fully understand the original method you're
> overriding, so that you
> don't break any dependencies on that method.
>
> As far as possible, I do try to touch as few OFBiz codes as possible. If
any
> OFBiz codes need to
> be enhanced, it is possibly to make them more generic and more base-level
or
> more fine-grained or
> more customizable building blocks.
>
> Jonathon
>
> skip@theDevers wrote:
>> I have had another discussion about pricing with my customer today and
the
>> pricing is more complicated that I remembered.  Their pricing is based on
> a
>> percentage above cost and package quantity, i.e. 30% above cost for one
>> package (12 pieces), 25% above cost for 2 packages (24 pieces), and 100
>> percent above cost for any broken package plus a fixed abount depending
on

>> cost, i.e. + a buck for all below 1 dollar, + 2 for all below 5 and
> nothing
>> for above 10.
>>
>> This is outside what I see in the ofbiz pricing module in
>> PriceServices.java, and so it appears as if I will have to write my own
>> price calculation service.
>>
>> What I would like to do is write a subclass of PriceServices so my
>> "calculateProductPrice" subclass gets called whenever
>> runSync("calculateProductPrice") gets called.  I would like to do this in
>> such a way that I don't bother the core Ofbiz code as I'll still be using
>> the shoppingcart, etc.
>>
>> Can anyone offer any advice or point me to samples?
>>
>> Skip
>>
>>
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Approving user account.

prateek-2
In reply to this post by BJ Freeman
Hi
 I have red detail in the link provided by u.  
please tell me from where in "http:\\localhost:8443\webtools"  , I will approve the  user account so  that a mail would be sent to user email id containing  "password "

Thanks
Rupinder
 
BJ Freeman wrote
look at
https://issues.apache.org/jira/browse/OFBIZ-1274

Rupinder sent the following on 9/27/2007 10:59 PM:
> Hi
>     In the ecommerce product store ("Catalog -> Stores -> OFBiz E-Commerce
> Store [9000]" in catalog application), I have set  "Allow Password " option
> to "N". By doing this, When a user opens a  new registration form (create
> new user) in a ecommerce application, instead of displaying "Password" and
> "Confirm Password" text box fields, it displays the following message:  "You
> will receive a password by email when your new account is approved".
>
>  Friends Please tell how we will enable/approve  that account and how  email
> will be send to user containing his password.
>
>  I have already configured  "general.properties"  according to my SMTP MAIL
> SERVER.
>
>
> Regards,
>
> Rupinder
> Voltix Software Pvt. Ltd.
Reply | Threaded
Open this post in threaded view
|

Re: Approving user account.

Jacques Le Roux
Administrator
Pratek,

It seems that there are still some problems, please have a look at  https://issues.apache.org/jira/browse/OFBIZ-1274

Jacques

De : "Prateek" <[hidden email]>

>
> Hi
>  I have red detail in the link provided by u.  
> please tell me from where in "http:\\localhost:8443\webtools"  , I will
> approve the  user account so  that a mail would be sent to user email id
> containing  "password "
>
> Thanks
> Rupinder
>  
>
> BJ Freeman wrote:
> >
> > look at
> > https://issues.apache.org/jira/browse/OFBIZ-1274
> >
> > Rupinder sent the following on 9/27/2007 10:59 PM:
> >> Hi
> >>     In the ecommerce product store ("Catalog -> Stores -> OFBiz
> >> E-Commerce
> >> Store [9000]" in catalog application), I have set  "Allow Password "
> >> option
> >> to "N". By doing this, When a user opens a  new registration form (create
> >> new user) in a ecommerce application, instead of displaying "Password"
> >> and
> >> "Confirm Password" text box fields, it displays the following message:
> >> "You
> >> will receive a password by email when your new account is approved".
> >>
> >>  Friends Please tell how we will enable/approve  that account and how
> >> email
> >> will be send to user containing his password.
> >>
> >>  I have already configured  "general.properties"  according to my SMTP
> >> MAIL
> >> SERVER.
> >>
> >>
> >> Regards,
> >>
> >> Rupinder
> >> Voltix Software Pvt. Ltd.
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Approving-user-account.-tf4532568.html#a12974551
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Complicated pricing

Jacques Le Roux
Administrator
In reply to this post by jonwimp
Jonathon, Skip,

I'm not sure of what Jonathon means (have not time to look at services_authorizedotnet.xml right now); maybe he wants to allude that
there is an interface mechanism for services too. Just look for the word "interface" in services definitions.

Jacques

De : "Jonathon -- Improov" <[hidden email]>

> Skip,
>
> Create a hot-deploy app (you can skip the webapp creation). Insert a service definition (in say
> servicedef/services.xml), service name "skip.calculateProductPrice".
>
> Extend the class of original Java method "calculateProductPrice", in case that method uses any
> class members. In your new class (extended from original class), do your new Java method
> "calculateProductPrice". The point here is to clearly document for yourself which OFBiz method you
> are cloning and modifying.
>
> Java extension mechanisms (eg class extends, method overrides) make for clean codes that avoid
> redundancies. Same for OFBiz extension mechanisms.
>
> By the way, you can "implement" (think Java's "implement" for interfaces) a service definition,
> kind of. I'm not sure if you can "implement" a fully-defined service definition like service
> "calculateProductPrice". You can try it.
>
> For egs, see in Accounting module folder servicedef. See services_authorizedotnet.xml service
> "AIMCCAuthCapture", and services_paymentmethod.xml service "ccAuthInterface" and service
> "paymentProcessInterface".
>
> Jonathon
>
> skip@theDevers wrote:
> > Jonathon
> >
> > Thanks for the input.  However, I guess I didn't ask the question right.
> > "calculateProductPrice" is defined as a service in services_pricepromo.xml
> > as:
> >
> >     <service name="calculateProductPrice" engine="java"
> >                 location="org.ofbiz.product.price.PriceServices"
> > invoke="calculateProductPrice" auth="false" use-transaction="false">
> > ...
> >
> > and this is loaded from ...product/ofbiz-component.xml as
> >     <service-resource type="model" loader="main"
> > location="servicedef/services_pricepromo.xml"/>
> >
> > The question is, how can I override the original definition without
> > modifying Ofbiz code.  i.e. can I put an identically named service
> > definition in hot-deploy or somewhere and have all of Ofbiz use my new
> > calculateProductPrice?
> >
> > Skip
> >
> >
> > -----Original Message-----
> > From: Jonathon -- Improov [mailto:[hidden email]]
> > Sent: Sunday, September 30, 2007 2:39 AM
> > To: [hidden email]
> > Subject: Re: Complicated pricing
> >
> >
> > Yes, overriding that method will mean you won't touch the OFBiz codes. That
> > could mean you can
> > continue to use your custom method, while still conveniently watching the
> > community's updates to
> > the original method.
> >
> > Such a method override will also kinda "document" your custom method as
> > "being related to some
> > original OFBiz method", so you know what original OFBiz codes to use for
> > side-by-side comparisons
> > of your codes. Making huge overhauls to the original method can make it
> > difficult to do such
> > comparisons.
> >
> > One gotcha here. Make sure you fully understand the original method you're
> > overriding, so that you
> > don't break any dependencies on that method.
> >
> > As far as possible, I do try to touch as few OFBiz codes as possible. If any
> > OFBiz codes need to
> > be enhanced, it is possibly to make them more generic and more base-level or
> > more fine-grained or
> > more customizable building blocks.
> >
> > Jonathon
> >
> > skip@theDevers wrote:
> >> I have had another discussion about pricing with my customer today and the
> >> pricing is more complicated that I remembered.  Their pricing is based on
> > a
> >> percentage above cost and package quantity, i.e. 30% above cost for one
> >> package (12 pieces), 25% above cost for 2 packages (24 pieces), and 100
> >> percent above cost for any broken package plus a fixed abount depending on
> >> cost, i.e. + a buck for all below 1 dollar, + 2 for all below 5 and
> > nothing
> >> for above 10.
> >>
> >> This is outside what I see in the ofbiz pricing module in
> >> PriceServices.java, and so it appears as if I will have to write my own
> >> price calculation service.
> >>
> >> What I would like to do is write a subclass of PriceServices so my
> >> "calculateProductPrice" subclass gets called whenever
> >> runSync("calculateProductPrice") gets called.  I would like to do this in
> >> such a way that I don't bother the core Ofbiz code as I'll still be using
> >> the shoppingcart, etc.
> >>
> >> Can anyone offer any advice or point me to samples?
> >>
> >> Skip
> >>
> >>
> >
> >
> >
>

12345