Re: Food nutrition database

2019-02-20 Thread Wolfgang Paul Rauchholz
Thanks for pointing me to this solution. That works really great!

Quesiton I still have; what is the best usage of the tab 'Attributes'?

Wolfgang



On Mon, 2019-02-18 at 09:39 -0600, Paul Mandeltort wrote:
> You’ll want to use Features which already has units support built
> in. 
> 
> Add a broad feature Type for Nutrition
> https://demo-trunk.ofbiz.apache.org/catalog/control/EditFeatureTypes
>  trunk.ofbiz.apache.org/catalog/control/EditFeatureTypes>
> 
> And define the specific Nutrition things as features which live in
> Feature Categories:
>  
> https://demo-trunk.ofbiz.apache.org/catalog/control/EditFeatureCategories
>  <
> https://demo-trunk.ofbiz.apache.org/catalog/control/EditFeatureCategories
> >
> 
> Then you can manage specific features in the per-product features: 
> 
https://demo-trunk.ofbiz.apache.org/catalog/control/EditProductFeatures?productId=WG-9943
>  <
> https://demo-trunk.ofbiz.apache.org/catalog/control/EditProductFeatures?productId=WG-9943
> >
> 
> 
> --P
> --
> Paul Mandeltort,  Marco Specialties, Inc.  +1(512)394-8119  
> p...@marcospec.com 
> 
> > On Feb 18, 2019, at 3:51 AM, wp.rauchh...@gmail.com wrote:
> > 
> > Good day.
> > 
> > we want to use ofbiz for a food related business.
> > For tyhat we need to setup a database of ingredients and their
> > nutritional properties.
> > Is this best done hrough the 'Attributes' in the item master or is
> > there a better way?
> > Underneath an example of the data model for an apple.
> > 
> > Component Value UnitSource
> > Proximales  
> > alcohol (ethanol) 0 g   310
> > fat, total (total lipid)trace   g   258
> > protein, total  0.3 g   258
> > water (moisture)85.7g   258
> > Hidratos de Carbono 
> > carbohydrate12g 258
> > sucrose 2.4   g 341
> > fibre, total dietary2 g 258
> > 
> > Thanks, Wolfgang
> 
> 



Re: ofbiz and SSL & apache

2019-02-20 Thread Wolfgang Paul Rauchholz
I took a bit time, but what finally helped me to fix it was a
combination of this procedure

https://cwiki.apache.org/confluence/display/OFBiz/Apache+OFBiz+Technical+Production+Setup+Guide#ApacheOFBizTechnicalProductionSetupGuide-SSLCertificateSetup
 

and this 2nd one:
https://ilhicas.com/2018/04/08/How-to-use-letsencrypt-jks.html


Apache Proxy in from of Tomcat:
Has somebody here sucesfully implemented an apache proxy for tomcat
that redirects traffic to ofbiz as well to the other webser services
(all php based)?

Thanks for your help.



Wolfgang

On Tue, 2019-02-19 at 12:52 +0100, Michael Brohl wrote:
> You will need to store a certificate for the domain you want to use.
> 
> Maybe you should create your own keystore containing only your 
> certificate and point to this file instead of the original.
> 
> Regards,
> 
> Michael
> 
> 
> Am 19.02.19 um 12:22 schrieb Wolfgang Paul Rauchholz:
> > I am trying to get SSL working w/o apache for the time being.
> > 
> > I followed your procedure and could sucesfully import. Thanks.
> > Great!
> > 
> > I went the into the following file:
> > /usr/local/ofbiz/framework/catalina/ofbiz-component.xml and changed
> > the
> > following two lines:
> > 
> >   > value="framework/base/config/ofbiz.jks"/>
> >  
> > 
> > Which seems not to be the right, because firefox still complaints
> > When I call https:www.wo-lar.com:8443/myportal/control/main. I get
> > a
> > "Your connection is not secure". www.wo-lar.com:8443 uses an
> > invalid
> > security certificate.
> > 
> > 
> > When I run :8443:/myportal/control/main I get the
> > same
> > error message. But I can look at hte certificate and that tells me
> > that
> > it still points to the wrong certificate:
> > Common name: ofbiz-vm.apache.org
> > 
> > Any thoughts?
> > 
> > Wolfgang
> > 
> > 
> > 
> > 
> > On Tue, 2019-02-19 at 11:53 +0100, Michael Brohl wrote:
> > > Hi Wolfgang,
> > > 
> > > if you already have a ceritificate, you should skip steps 2 
> > > andhttps://cwiki.apache.org/confluence/display/OFBiz/Apache+OFBiz+Technical+Production+Setup+Guide#ApacheOFBizTechnicalProductionSetupGuide-SSLCertificateSetup
> > > 3!
> > > 
> > > If I understand the steps correctly, with the certreq command you
> > > now
> > > have a certificate request with alias "ssl" in your keystore.
> > > Later
> > > you
> > > try to import a certificate which is not based on your
> > > certificate
> > > request under the same alias "ssl".
> > > 
> > > Just import your certificate with another alias and you should be
> > > fine.
> > > 
> > > Remember: if you use an Apache Webserver before your OFBiz
> > > instance,
> > > you
> > > do not need to import the certificate in the keystore!
> > > 
> > > Regards,
> > > 
> > > Michael Brohl
> > > ecomify GmbH
> > > www.ecomify.de
> > > 
> > > 
> > > Am 19.02.19 um 11:26 schrieb Wolfgang Paul Rauchholz:
> > > > How does this procedure work in case of an existing letsencrypt
> > > > certificate?
> > > > 
> > > > Because I have an existing certificate, can I skip steps 3?
> > > > I continued directly with step 4, uploading and conveting
> > > > cert.pem
> > > > to
> > > > cert.der.
> > > > 
> > > > But importe step 5 throws out an error: keytool error:
> > > > java.lang.Exception: Public keys in reply and keystore don't
> > > > match:
> > > > 
> > > > 
> > > > 1. Run: "keytool -genkey -keyalg RSA -alias ssl -keystore
> > > > [keystore
> > > > name]"
> > > > 2. Run: "keytool -certreq -alias ssl -keyalg RSA -file
> > > > certreq.csr
> > > > -keystore [keystore name]"
> > > > 3. Submit the CSR to a signing authority (Thawte, Verisign,
> > > > etc)
> > > > 4. Download your certificate from the signing authority. Please
> > > > remember to download the Certificate in PKCS#7 format. If you
> > > > get a
> > > > certificate in pem format don't convert to PKCS#7/P7B Format
> > > > but
> > > > der
> > > > format
> > > > 5. Import the Certificate into the keystore by running:
> > > > "keytool -import -alias ssl -trustcacerts -file
> > > > mysignedcert.cer
> > > > -keystore [keystore name]"
> > > > 
> > > > 
> > > > Thanks, Wolfgang
> > > > 
> > > > On Mon, 2019-02-18 at 11:35 +0100, Michael Brohl wrote:
> > > > > You will have to import your certificate to the Java keystore
> > > > > and
> > > > > configure Tomcat to use it [1,2].
> > > > > 
> > > > > The standard way would be to run OFBiz behind an Apache
> > > > > webserver
> > > > > with
> > > > > the virtual hosts configured to use the certificate.
> > > > > 
> > > > > Regards,
> > > > > 
> > > > > Michael Brohl
> > > > > ecomify GmbH
> > > > > www.ecomify.de
> > > > > 
> > > > > [1] https://tomcat.apache.org/tomcat-8.5-doc/ssl-howto.html
> > > > > 
> > > > > [2]
> > > > > 
> > 
> > 
https://cwiki.apache.org/confluence/display/OFBiz/Apache+OFBiz+Technical+Production+Setup+Guide#ApacheOFBizTechnicalProductionSetupGuide-SSLCertificateSetup
> > > > > Am 18.02.19 um 10:53 schrieb wp.rauchh...@gmail.com:
> > > > > > Would you please point me 

Re: Integration of ofbiz with rest service

2019-02-20 Thread Girish Vasmatkar
I see couple issues -

   - You have not configured any JAX-RS implementation here. I would expect
   some configuration in web.xml for the JAX-RS runtime system to kick in and
   pick your requests.
   - You have to bypass controller servlet and filter. No need for control
   servlet here. Just get rid of it. This is a separate web module and you do
   not need your requests to go through control servlet.

Since no JAX-RS interceptor or filter or any servlet mapping is
found, @Path annotations won't work.

Best,
Girish

On Wed, Feb 20, 2019 at 12:31 PM snehil maurya 
wrote:

> Hi,
>
> This is a demo plugin we created and we were trying to do some testing in
> this.
> If you can find, in 'OfbizDemoServices' class I have tried to give @Path
> annotations for creating a rest endpoint and using the web.xml I was
> hitting the URL: https://localhost:8443/ofbizDemo/control/ofbizDemoTest/1
> .
>
> But it always returns with an error that the request cannot be found.
> Also, I have not used any request mapping in the controller for this
> endpoint.
>
> Please let us know what we are doing wrong in this case.
>
> Also, as I checked the version of javax.ws.rs-api version is 2.0.1.
>
> Thanks,
> Snehil
>
>
> On Tue, Feb 19, 2019 at 10:43 AM Girish Vasmatkar <
> girish.vasmat...@hotwaxsystems.com> wrote:
>
>> What you tried to do (creating a wrapper around ofbiz to delegate the
>> REST requests to ofbiz) is the way forward. This makes more sense. It needs
>> some tweaking because ofbiz does come up (inadvertently) with JAX-RS 1.0
>> dependency and if you try to use a JAX-RS implementation that bundles
>> JAX-RS 2.0, then you are in for some tough times.
>>
>> I presume that is the case with you. I am sure you'd have gotten some
>> exceptions during start-up as you try to register JAX-RS servlet with the
>> web application. It'd help if you can just paste here the exception
>> stacktrace and we'd be in a better position to help you out.
>>
>> Best,
>> Girish
>>
>> On Mon, Feb 18, 2019 at 8:12 PM snehil maurya 
>> wrote:
>>
>>> We tried to create a rest endpoint using JAX-RS, in one of the class in
>>> framework module but then when we ran the ofbiz application that endpoint
>>> was not found. if he can give more insight on how to do it it will help us
>>> greatly
>>>
>>> we were thinking to create a wrapper on top of ofbiz which will act as a
>>> endpoint, and that in turn will communicate with ofbiz code. Resulting both
>>> being on one server, and lesser network traffic.
>>> Will this help
>>>
>>> On Mon, 18 Feb 2019 at 6:45 PM, Girish Vasmatkar <
>>> girish.vasmat...@hotwaxsystems.com> wrote:
>>>
 This is going to be tricky and in my opinion will introduce overhead.
 Possible design decisions (High Level) -

 1. JMS - Have springboot app send JMS messages to a queue/topic and let
 ofbiz subscribe to them. This creates dependency on message broker's
 availability and if the broker is unavailable then your api can not serve
 requests.
 2. RMI - This is not a recommended way of doing the things. Too much
 complexity for a REST client.
 3. SOAP - Let ofbiz expose it's services through SOAP and springboot as
 SOAP client. That's just not a good approach.

 I can't think of any other way around this.

 On Mon, Feb 18, 2019 at 6:17 PM snehil maurya 
 wrote:

> Yes i am planning to launch the springboot app in a separate container.
>
> On Mon, 18 Feb 2019 at 5:58 PM, Girish Vasmatkar <
> girish.vasmat...@hotwaxsystems.com> wrote:
>
>> WINK is retired, but there're other frameworks too. Anyway, if you do
>> decide to take this approach, then you can consider Jersey/CXF/RESTEasy.
>> You can just use any JAX-RS compliant implementation instead of WINK.
>>
>> Coming to you specific requirement - You want to create a (REST)
>> springboot app to be able to communicate with ofbiz. Do you plan to 
>> launch
>> spring boot app in a separate container?
>>
>> Best,
>> Girish
>>
>>
>> On Mon, Feb 18, 2019 at 3:31 PM snehil maurya 
>> wrote:
>>
>>> Hi,
>>>
>>> I guess the component/ plugin for REST has been decommissioned, as I
>>> check on ofbiz official site. Earlier it used wink to do all the rest
>>> endpoint generation but it has been retired since april 2017
>>>
>>> My ask is : i want to develop a rest endpoint in springboot which
>>> can communicate with ofbiz
>>> I want to know a way to do it .
>>>
>>> Thanks,
>>> Snehil
>>>
>>> On Mon, 18 Feb 2019 at 2:32 PM, Girish Vasmatkar <
>>> girish.vasmat...@hotwaxsystems.com> wrote:
>>>
 Hey Snehil

 You can have a new component/plugin that could act as a REST web
 application. Have you figured out the framework to use to aid the API
 development?

 Best,
 Girish

 On Mon, Feb 18, 2019 at 10:54