Send E-Mails

2018-05-08 Thread i...@agentur-m3.de
Hello,

here is a problem with my e-mail base-configuration.

I configured email according to the setup guide:

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


Unfortunately no email seems to be sent from server
(the send email button in partymgr works fine now (thanks to Jacques!),
but no email reaches client). No error message, no error in log.

Also I tried to register in the ecommerce system and send
an "Forgot Your Password" email, but none of the emails were sent.

To get more info about the problem, I wrote a groovy script and copied
parts of the sendEmail-code from EmailServices.java.
The script below surprisingly works fine and sends emails!

So I don't understand, why OFBiz itself does not send mails.
Is there any further configuration necessary?



The script (which sends mails):

import javax.mail.Session;

import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.SendFailedException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.stream.StreamSource;

import org.apache.fop.apps.Fop;
import org.apache.fop.apps.MimeConstants;
import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.GeneralException;
import org.apache.ofbiz.base.util.HttpClient;
import org.apache.ofbiz.base.util.HttpClientException;
import org.apache.ofbiz.base.util.UtilGenerics;
import org.apache.ofbiz.base.util.UtilMisc;
import org.apache.ofbiz.base.util.UtilProperties;
import org.apache.ofbiz.base.util.UtilValidate;
import org.apache.ofbiz.base.util.collections.MapStack;
import org.apache.ofbiz.base.util.string.FlexibleStringExpander;
import org.apache.ofbiz.entity.Delegator;
import org.apache.ofbiz.entity.GenericValue;
import org.apache.ofbiz.entity.util.EntityUtilProperties;
import org.apache.ofbiz.service.DispatchContext;
import org.apache.ofbiz.service.GenericServiceException;
import org.apache.ofbiz.service.LocalDispatcher;
import org.apache.ofbiz.service.ServiceUtil;
import org.apache.ofbiz.service.mail.MimeMessageWrapper;
import org.apache.ofbiz.webapp.view.ApacheFopWorker;
import org.apache.ofbiz.widget.renderer.macro.MacroScreenRenderer;
import org.apache.ofbiz.widget.renderer.ScreenRenderer;
import org.apache.ofbiz.widget.renderer.ScreenStringRenderer;
import org.xml.sax.SAXException;

def testMail() {
sendType = "mail.smtp.host"
sendVia = "smtp.myhost.com"
Properties props = System.getProperties()
props.put(sendType, sendVia)
Session session
session = Session.getInstance(props);
MimeMessage mail
mail = new MimeMessage(session);
Transport trans = null
sendFrom = "obfiz.example.com"
sendTo = "m...@myserver.de"
subject = "testMail from OFBiz"
mp = new MimeMultipart();

MimeBodyPart mbp = new MimeBodyPart();
mbp.setText("Content: a test mail from OFBiz system")

mp.addBodyPart(mbp);
mail.setContent(mp);

mail.setFrom(new InternetAddress(sendFrom));
mail.setSubject(subject, "UTF-8");
mail.setHeader("X-Mailer", "Apache OFBiz, The Open For Business 
Project");
mail.setSentDate(new Date());
mail.addRecipients(Message.RecipientType.TO, sendTo);

trans = session.getTransport("smtp")
authUser = UtilProperties.getPropertyValue('general.properties',
'mail.smtp.auth.user')
authPass = UtilProperties.getPropertyValue('general.properties',
'mail.smtp.auth.password')

trans.connect(sendVia, authUser, authPass);
trans.sendMessage(mail, mail.getAllRecipients())
trans.close()

logWarning("successful run of testMail ")
logWarning(" user = " + userLogin.partyId);

return success("this test is done successful")  
}   


Re: [Proposal] Make accounting entry configurable

2018-05-08 Thread Sharan Foga
Now that is a very very interesting idea! 

Thanks
Sharan

On 2018/05/07 18:24:49, Scott Gray  wrote: 
> Another additional option we could consider at some point is to extract the
> GL out to it's own component. It would simplify evaluation for people who
> do want to use it, and removal for that don't or replacement for anyone who
> wants to use something else.
> 
> Regards
> Scott
> 
> On Thu, 3 May 2018, 18:12 Aman Agrawal, 
> wrote:
> 
> > Hello,
> >
> > In current flow, if we want to disable the accounting then we need to
> > disable the set of seca's. We don't have any configurable setting to
> > disable accounting.
> > So, I have a proposal to make accounting transaction entries configurable.
> > We can manage this by adding a new field 'enableAccounting' in the
> > 'PartyAcctgPreference' entity. Accounting transaction entries will be
> > entertained accordingly.
> >
> > Thanks and regards,
> > *Aman Agrawal*
> > Sr. Enterprise Software Engineer
> > www.hotwaxsystems.com
> > www.hotwax.co
> >
> 


Re: svn commit: r1828857 - in /ofbiz/ofbiz-framework/trunk/docs/asciidoc: documentation_guidelines.adoc resource/ resource/article.adoc resource/source.java

2018-05-08 Thread Jacques Le Roux

Hi Michael,

source.java needs either a ASL2 header (I guess not) or to be in 
https://svn.apache.org/repos/asf/ofbiz/tools/rat-excludes.txt

Thanks

Jacques


Le 10/04/2018 à 23:24, mbr...@apache.org a écrit :

Author: mbrohl
Date: Tue Apr 10 21:24:31 2018
New Revision: 1828857

URL: http://svn.apache.org/viewvc?rev=1828857=rev
Log:
Improved: added the first draft of the documentation guidelines.

Added:
 ofbiz/ofbiz-framework/trunk/docs/asciidoc/documentation_guidelines.adoc
 ofbiz/ofbiz-framework/trunk/docs/asciidoc/resource/
 ofbiz/ofbiz-framework/trunk/docs/asciidoc/resource/article.adoc
 ofbiz/ofbiz-framework/trunk/docs/asciidoc/resource/source.java   (with 
props)

Added: ofbiz/ofbiz-framework/trunk/docs/asciidoc/documentation_guidelines.adoc
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/docs/asciidoc/documentation_guidelines.adoc?rev=1828857=auto
==
--- ofbiz/ofbiz-framework/trunk/docs/asciidoc/documentation_guidelines.adoc 
(added)
+++ ofbiz/ofbiz-framework/trunk/docs/asciidoc/documentation_guidelines.adoc Tue 
Apr 10 21:24:31 2018
@@ -0,0 +1,627 @@
+
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+= Apache OFBiz Documentation Guidelines
+The Apache OFBiz Project
+Release 17.12
+:imagesdir: ./images
+ifdef::backend-pdf[]
+:title-logo-image: image::OFBiz-Logo.svg[Apache OFBiz Logo, pdfwidth=4.25in, 
align=center]
+:source-highlighter: rouge
+endif::[]
+
+== Intro
+
+This guideline serves as a general styleguide and collection of examples of 
how we are documenting the project.
+This intentionally is not a complete user manual but lists the subset of 
functionality and formatting options we
+want to use.
+
+For further reference and more examples see
+
+* Official Asciidoc User Guide
+footnote:[http://asciidoc.org/userguide.html]
+* Asciidoc Writers Guide
+footnote:[https://asciidoctor.org/docs/asciidoc-writers-guide/].
+* Asciidoc Quick Reference
+footnote:[https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/]
+* Asciidoc Recommended Practices
+footnote:[https://asciidoctor.org/docs/asciidoc-recommended-practices/]
+
+If you want to help with the documentation of the project, see wiki page
+footnote:[https://cwiki.apache.org/confluence/display/OFBIZ/OFBiz+Documentation+Team]
 for further information and
+how we are organised.
+
+== General rules
+
+=== Document configuration
+
+Documents who will be published standalone (e.g. developer manual, user 
manual) should contain a common configuration
+so that the output ist generated in the same way for all documents.
+
+[NOTE]
+This is not necessary for documents which will only be included in parent 
documents. These documents will inherit the
+configuration from the parent.
+
+This ist the proposed configuration:
+
+
+The Apache OFBiz Project // <1>
+Release 17.12 // <2>
+:imagesdir: ./images // <3>
+ifdef::backend-pdf[] // <4>
+:title-logo-image: image::OFBiz-Logo.svg[Apache OFBiz Logo, pdfwidth=4.25in, 
align=center] // <5>
+:source-highlighter: rouge // <6>
+endif::[] // <7>
+
+<1> author
+<2> target release, indicates for which release this documentation is valid
+<3> global definition of the image directory
+<4> begin block of configurations only for pdf rendering
+<5> define the title logo image
+<6> use the Rouge source code highlighter
+<7> end block of configurations only for PDF rendering
+
+The following configuration options are set globally in the Gradle build file.
+They are not configured in the document itself and are listed for reference 
only:
+
+.build.gradle
+
+'doctype': 'book', // <1>
+'experimental': '', // <2>
+'icons': 'font', // <3>
+'sectnums': '', // <4>
+'chapter-label': '', // <5>
+'toc': '', // <6>
+'toclevels': '5' // <7>
+
+<1> doctype book
+<2> allow experimental features like keyboard shortcuts
+<3> make font awesome icons available
+<4> number chapters and sections automatically
+<5> do not prefix the chapters
+<6> insert a table of contents
+<7> max levels to show in the table of contents
+
+=== Apache License Header
+
+Each .adoc file must contain the Apache license header (put between " 
license... "). You can just copy the
+following block:
+
+

[NEW THREAD] email in viewprofile

2018-05-08 Thread Jacques Le Roux

Oops, I guess it should be better simple quotes inside the double quotes:

    href="javascript:document.createEmail${contactMech.infoString?replace('','')?replace('','')?replace('.','')}.submit()">${uiLabelMap.CommonSendEmail} 



right? Please check, I did it locally but w/o email setting, so I could miss 
something

We will then need to amend trunk and back to R16

Thanks for report!

Jacques


Le 08/05/2018 à 14:04, Jacques Le Roux a écrit :

Ralf,

This was fixed w/ https://issues.apache.org/jira/browse/OFBIZ-7075 which was 
done before the R16 branch was released

Please double check,

I guess you are now subscribed to the dev ML? Please send only to the dev ML, 
no need to put me in copy

Thanks

Jacques


Le 07/05/2018 à 23:11, i...@agentur-m3.de a écrit :

The current version: Apache OFBiz 16.11.04.

Ralf




Am 03.05.2018 um 08:48 schrieb Jacques Le Roux:

Which version are you referring to?

BTW your email has been moderated, please subscribe to the MLs:
http://ofbiz.apache.org/mailing-lists.html

Jacques

1
Le 02/05/2018 à 15:08, r...@agentur-m3.de a écrit :

Trying to configure E-Mail in OFBiz

I had a look at this:

    partymgr/control/viewprofile

there is a button "send email", which does not seem to work.

In Contact.ftl (Line 96) there is a JavaScript  call
which seems to have missing quotes and maybe a problem
with formatting the E-Mail-address.




Best regards,

Ralf












Re: [NEW THREAD] email in viewprofile

2018-05-08 Thread Jacques Le Roux

Ralf,

This was fixed w/ https://issues.apache.org/jira/browse/OFBIZ-7075 which was 
done before the R16 branch was released

Please double check,

I guess you are now subscribed to the dev ML? Please send only to the dev ML, 
no need to put me in copy ;)

Thanks

Jacques


Le 07/05/2018 à 23:11, i...@agentur-m3.de a écrit :

The current version: Apache OFBiz 16.11.04.

Ralf




Am 03.05.2018 um 08:48 schrieb Jacques Le Roux:

Which version are you referring to?

BTW your email has been moderated, please subscribe to the MLs:
http://ofbiz.apache.org/mailing-lists.html

Jacques

1
Le 02/05/2018 à 15:08, r...@agentur-m3.de a écrit :

Trying to configure E-Mail in OFBiz

I had a look at this:

    partymgr/control/viewprofile

there is a button "send email", which does not seem to work.

In Contact.ftl (Line 96) there is a JavaScript  call
which seems to have missing quotes and maybe a problem
with formatting the E-Mail-address.




Best regards,

Ralf









Re: [Proposal] Make accounting entry configurable

2018-05-08 Thread Aman Agrawal
Hello,

In this, I have added one field 'enableAccounting' in the
PartyAcctgPreference entity. By this field added check whether accounting
is enable or not in the services used to create accounting transaction
entries.
I have uploaded patch for the same on OFBIZ-10391
.

Thanks and regards,

*Aman Agrawal*
Sr. Enterprise Software Engineer
www.hotwaxsystems.com
www.hotwax.co

On Tue, May 8, 2018 at 2:31 PM, Rishi Solanki 
wrote:

> Interesting!!
> Scott you are suggesting plugin or base component?
>
> Thanks!
>
>
> Rishi Solanki
> Sr Manager, Enterprise Software Development
> HotWax Systems Pvt. Ltd.
> Direct: +91-9893287847
> http://www.hotwaxsystems.com
> www.hotwax.co
>
> On Mon, May 7, 2018 at 11:54 PM, Scott Gray 
> wrote:
>
> > Another additional option we could consider at some point is to extract
> the
> > GL out to it's own component. It would simplify evaluation for people who
> > do want to use it, and removal for that don't or replacement for anyone
> who
> > wants to use something else.
> >
> > Regards
> > Scott
> >
> > On Thu, 3 May 2018, 18:12 Aman Agrawal, 
> > wrote:
> >
> > > Hello,
> > >
> > > In current flow, if we want to disable the accounting then we need to
> > > disable the set of seca's. We don't have any configurable setting to
> > > disable accounting.
> > > So, I have a proposal to make accounting transaction entries
> > configurable.
> > > We can manage this by adding a new field 'enableAccounting' in the
> > > 'PartyAcctgPreference' entity. Accounting transaction entries will be
> > > entertained accordingly.
> > >
> > > Thanks and regards,
> > > *Aman Agrawal*
> > > Sr. Enterprise Software Engineer
> > > www.hotwaxsystems.com
> > > www.hotwax.co
> > >
> >
>


Re: [Proposal] Make accounting entry configurable

2018-05-08 Thread Rishi Solanki
Interesting!!
Scott you are suggesting plugin or base component?

Thanks!


Rishi Solanki
Sr Manager, Enterprise Software Development
HotWax Systems Pvt. Ltd.
Direct: +91-9893287847
http://www.hotwaxsystems.com
www.hotwax.co

On Mon, May 7, 2018 at 11:54 PM, Scott Gray 
wrote:

> Another additional option we could consider at some point is to extract the
> GL out to it's own component. It would simplify evaluation for people who
> do want to use it, and removal for that don't or replacement for anyone who
> wants to use something else.
>
> Regards
> Scott
>
> On Thu, 3 May 2018, 18:12 Aman Agrawal, 
> wrote:
>
> > Hello,
> >
> > In current flow, if we want to disable the accounting then we need to
> > disable the set of seca's. We don't have any configurable setting to
> > disable accounting.
> > So, I have a proposal to make accounting transaction entries
> configurable.
> > We can manage this by adding a new field 'enableAccounting' in the
> > 'PartyAcctgPreference' entity. Accounting transaction entries will be
> > entertained accordingly.
> >
> > Thanks and regards,
> > *Aman Agrawal*
> > Sr. Enterprise Software Engineer
> > www.hotwaxsystems.com
> > www.hotwax.co
> >
>