Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

OFBiz Beginner's Development Guide Using Practice Application
Hello All,

Here is the link for the document which will be helpful for the beginners to
get ready for working in Ofbiz.
http://docs.ofbiz.org/display/OFBIZ...ice+Application

Thanks to everybody involved directly or indirectly in the creation of this
document.
We will try to improve this document as soon as time permits.
Improvement suggestions are more then welcome and looking for the positive
contribution from community members to make it much better document.

--
Thanks & Regards
--
Pranay Pandey
Indore, India


Report this thread to moderator Post Follow-up to this message
Old Post
Pranay Pandey
06-06-08 12:38 AM


Re: OFBiz Beginner's Development Guide Using Practice Application
Hello Pranay,

great work :)
Perfect for beginners like myself.

As I'm trying to write my first service, implemented with java, maybe
you could add a few words about that in your tutorial.

Maybe someone could answer a question about that:
how do I call services which need authentication (e.g.
createPartyEmailAddress from framework/party/services)?
What I'm doing:
my service requires already authentication, which works, creating
persons is no problem at all (createPerson has auth="false", which i
don't get why today, but i'm sure that's because of my limited knowledge
of ofbiz)
calling createPartyEmailAddress throws:
[  ServiceDispatcher.java:522:ERROR] Error in Service
[partyContactMechPermissionCheck]: You must be logged in to complete the
[Party contact mech permission logic] process.
a snipped of my code is below.

Thanks again for this tutorial and thanks for any answers,

Roland

--- code ---
[...]
Map createPartyEmailAddressMap = UtilMisc.toMap(
"emailAddress", context.get("emailAddress"),
"contactMechPurposeTypeId", "PRIMARY_EMAIL",
"login.username", context.get("login.username"),
"login.password", context.get("login.password"));
[...]

// create Person
Map createPersonResult = dispatcher.runSync("createPerson",
createPersonMap);
if (ServiceUtil.isError(createPersonResult)) {
return createPersonResult;
}

// create EmailAddress
createPartyEmailAddressMap.put("partyId",
createPersonResult.get("partyId"));
Map createPartyEmailAddressResult =
dispatcher.runSync("createPartyEmailAddress", createPartyEmailAddressMap);
if (ServiceUtil.isError(createPartyEmailAddressResult)) {
return createPartyEmailAddressResult;
}



Report this thread to moderator Post Follow-up to this message
Old Post
RolandH
06-06-08 12:38 AM


Re: OFBiz Beginner's Development Guide Using Practice Application
createPerson has auth set to false so that new users can create
themselves. It's an exception to the standard practice.

-Adrian


RolandH wrote:
> Hello Pranay,
>
> great work :)
> Perfect for beginners like myself.
>
> As I'm trying to write my first service, implemented with java, maybe
> you could add a few words about that in your tutorial.
>
> Maybe someone could answer a question about that:
> how do I call services which need authentication (e.g.
> createPartyEmailAddress from framework/party/services)?
> What I'm doing:
> my service requires already authentication, which works, creating
> persons is no problem at all (createPerson has auth="false", which i
> don't get why today, but i'm sure that's because of my limited knowledge
> of ofbiz)
> calling createPartyEmailAddress throws:
> [  ServiceDispatcher.java:522:ERROR] Error in Service
> [partyContactMechPermissionCheck]: You must be logged in to complete the
> [Party contact mech permission logic] process.
> a snipped of my code is below.
>
> Thanks again for this tutorial and thanks for any answers,
>
> Roland
>
> --- code ---
> [...]
> Map createPartyEmailAddressMap = UtilMisc.toMap(
>    "emailAddress", context.get("emailAddress"),
>    "contactMechPurposeTypeId", "PRIMARY_EMAIL",
>    "login.username", context.get("login.username"),
>    "login.password", context.get("login.password"));
> [...]
>
> // create Person
> Map createPersonResult = dispatcher.runSync("createPerson",
> createPersonMap);
> if (ServiceUtil.isError(createPersonResult)) {
> return createPersonResult;
> }
>
> // create EmailAddress
> createPartyEmailAddressMap.put("partyId",
> createPersonResult.get("partyId"));
> Map createPartyEmailAddressResult =
> dispatcher.runSync("createPartyEmailAddress", createPartyEmailAddressMap);
> if (ServiceUtil.isError(createPartyEmailAddressResult)) {
> return createPartyEmailAddressResult;
> }
>
>


Report this thread to moderator Post Follow-up to this message
Old Post
Adrian Crum
06-06-08 12:38 AM


Re: OFBiz Beginner's Development Guide Using Practice Application
thanks for the effort

Pranay Pandey sent the following on 6/5/2008 8:22 AM:
> Hello All,
>
> Here is the link for the document which will be helpful for the beginners 
to
> get ready for working in Ofbiz.
> http://docs.ofbiz.org/display/OFBIZ...ice+Application
>
> Thanks to everybody involved directly or indirectly in the creation of thi
s
> document.
> We will try to improve this document as soon as time permits.
> Improvement suggestions are more then welcome and looking for the positive
> contribution from community members to make it much better document.
>



Report this thread to moderator Post Follow-up to this message
Old Post
BJ Freeman
06-06-08 12:38 AM


Re: OFBiz Beginner's Development Guide Using Practice Application
Pranay ,

Thanks for putting this document on the Ofbiz Confluence .

--
Ashish

On Thu, Jun 5, 2008 at 2:41 PM, BJ Freeman <bjfree@free-man.net> wrote:

> thanks for the effort
>
> Pranay Pandey sent the following on 6/5/2008 8:22 AM: 
> to 
> http://docs.ofbiz.org/display/OFBIZ...ice+Application 
> this 
> positive 
>
>


Report this thread to moderator Post Follow-up to this message
Old Post
Ashish Vijaywargiya
06-06-08 10:07 AM


Re: OFBiz Beginner's Development Guide Using Practice Application
Hello Ronald,

I hope this will be of help.
The service you are calling is createPartyEmailAddress requires
authentication so you need to send the userLogin value to it.
Something like this:

// perform actions as the system user
GenericValue userLogin =
delegator.findByPrimaryKeyCache("UserLogin", UtilMisc.toMap("userLoginId",
"system"));

input = UtilMisc.toMap("userLogin", userLogin, "emailAddress",
email, "partyId", "_NA_", "fromDate", fromDate, "contactMechPurposeTypeId",
"OTHER_EMAIL");
Map serviceResults =
dispatcher.runSync("createPartyEmailAddress", input);
if (ServiceUtil.isError(serviceResults)) {
throw new
GenericServiceException(ServiceUtil.getErrorMessage(serviceResults));
}

Thanks & Regrads
--
Pranay Pandey


On Thu, Jun 5, 2008 at 9:38 PM, RolandH <roland-ml@redvision.de> wrote:

> Hello Pranay,
>
> great work :)
> Perfect for beginners like myself.
>
> As I'm trying to write my first service, implemented with java, maybe you
> could add a few words about that in your tutorial.
>
> Maybe someone could answer a question about that:
> how do I call services which need authentication (e.g.
> createPartyEmailAddress from framework/party/services)?
> What I'm doing:
> my service requires already authentication, which works, creating persons
> is no problem at all (createPerson has auth="false", which i don't get why
> today, but i'm sure that's because of my limited knowledge of ofbiz)
> calling createPartyEmailAddress throws:
> [  ServiceDispatcher.java:522:ERROR] Error in Service
> [partyContactMechPermissionCheck]: You must be logged in to complete the
> [Party contact mech permission logic] process.
> a snipped of my code is below.
>
> Thanks again for this tutorial and thanks for any answers,
>
> Roland
>
> --- code ---
> [...]
> Map createPartyEmailAddressMap = UtilMisc.toMap(
>   "emailAddress", context.get("emailAddress"),
>   "contactMechPurposeTypeId", "PRIMARY_EMAIL",
>   "login.username", context.get("login.username"),
>   "login.password", context.get("login.password"));
> [...]
>
> // create Person
> Map createPersonResult = dispatcher.runSync("createPerson",
> createPersonMap);
> if (ServiceUtil.isError(createPersonResult)) {
> return createPersonResult;
> }
>
> // create EmailAddress
> createPartyEmailAddressMap.put("partyId",
> createPersonResult.get("partyId"));
> Map createPartyEmailAddressResult =
> dispatcher.runSync("createPartyEmailAddress", createPartyEmailAddressMap);
> if (ServiceUtil.isError(createPartyEmailAddressResult)) {
> return createPartyEmailAddressResult;
> }
>
>


Report this thread to moderator Post Follow-up to this message
Old Post
Pranay Pandey
06-06-08 10:07 AM


Re: OFBiz Beginner's Development Guide Using Practice Application
Thanks for this clarification, Adrian

--Roland

Adrian Crum wrote:
> createPerson has auth set to false so that new users can create
> themselves. It's an exception to the standard practice.
>
> -Adrian



Report this thread to moderator Post Follow-up to this message
Old Post
RolandH
06-06-08 01:36 PM


Re: OFBiz Beginner's Development Guide Using Practice Application
Hi Pranay,

thanks for your answer, after this mail i found my real solution:

Map createPartyEmailAddressMap =
UtilMisc.toMap(
"emailAddress", context.get("emailAddress"),
"contactMechPurposeTypeId", "PRIMARY_EMAIL",
"userLogin", context.get("userLogin")
);
userLogin holds the actual user, if I read existing code correctly.

Thanks for your help,
Roland

Pranay Pandey wrote:
> I hope this will be of help.
> The service you are calling is createPartyEmailAddress requires
> authentication so you need to send the userLogin value to it.
> Something like this:
>
> // perform actions as the system user
>             GenericValue userLogin =
> delegator.findByPrimaryKeyCache("UserLogin", UtilMisc.toMap("userLoginId",
> "system"));
>
>             input = UtilMisc.toMap("userLogin", userLogin, "emailAddress",
> email, "partyId", "_NA_", "fromDate", fromDate, "contactMechPurposeTypeId"
,
> "OTHER_EMAIL");
>             Map serviceResults =
> dispatcher.runSync("createPartyEmailAddress", input);
>             if (ServiceUtil.isError(serviceResults)) {
>                 throw new
> GenericServiceException(ServiceUtil.getErrorMessage(serviceResults));
>             }
>


Report this thread to moderator Post Follow-up to this message
Old Post
RolandH
06-06-08 01:36 PM


Re: OFBiz Beginner's Development Guide Using Practice Application
thnx by effort but i have a problem i follow the steps in

"Creating the web app on the back end" but when i try charge aplication i
cant see nothing only especial characters : 

somebody have same result?

regards

Edson

2008/6/6 RolandH <roland-ml@redvision.de>:

> Hi Pranay,
>
> thanks for your answer, after this mail i found my real solution:
>
>   Map createPartyEmailAddressMap =
>       UtilMisc.toMap(
>              "emailAddress", context.get("emailAddress"),
>              "contactMechPurposeTypeId", "PRIMARY_EMAIL",
>              "userLogin", context.get("userLogin")
>              );
> userLogin holds the actual user, if I read existing code correctly.
>
> Thanks for your help,
> Roland
>
>
> Pranay Pandey wrote:
> 
>


Report this thread to moderator Post Follow-up to this message
Old Post
Edson Chavez
06-11-08 12:39 AM


Re: OFBiz Beginner's Development Guide Using Practice Application
Hi Edson,
Your question is not clear. Please be verbose when you are asking questions.
BTW there is one zip file of source is also attached with this you can take
a reference from that.

Thanks & Regards
--
Pranay Pandey


On Wed, Jun 11, 2008 at 3:38 AM, Edson Chavez <edsonchavez@gmail.com> wrote:

> thnx by effort but i have a problem i follow the steps in
>
> "Creating the web app on the back end" but when i try charge aplication i
> cant see nothing only especial characters :
>
> somebody have same result?
>
> regards
>
> Edson
>
> 2008/6/6 RolandH <roland-ml@redvision.de>:
> 
> UtilMisc.toMap("userLoginId", 
> "emailAddress", 
>


Report this thread to moderator Post Follow-up to this message
Old Post
Pranay Pandey
06-11-08 10:00 AM


Sponsored Links




Last Thread Next Thread Next
Pages (2): [1] 2 »
Search this forum -> 
Post New Thread

OFBiz archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 02:56 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.