Yes that was what I meant.
System.out.println("In Update method====") dint get printed. Ok Thankyou
Summit.
Sumit Pandit-3 wrote:
>
> Do you mean -
> System.err.println("======= In update person service !!! ====== "); is
> not working ?
> Service will call on submit.
>
>
> On Nov 9, 2009, at 2:41 PM, swathi wrote:
>
>>
>> Sorry Summit.. But it doesnt look like its getting executed. I wrote
>> a sop in
>> updatePerson() method, and tried to create a person,The record got
>> created
>> but the print stmt did not get printed on console. So I was
>> assuming that
>> the service call at <auto-field-service> tag just displays the flds
>> as they
>> are in service (as input and output params) and the java method
>> doesnt get
>> executed. Am I in the wrong assumption..
>>
>> Sumit Pandit-3 wrote:
>>>
>>> Hi Swathi,
>>>
>>> On Nov 9, 2009, at 8:33 AM, swathi wrote:
>>>
>>>>
>>>> Hi Sumit. Thankyou for your guidence. I was looking at createPerson
>>>> flow in
>>>> Party application.
>>>> Iam a little confused here..In EditPerson form in PartyForms.xml,
>>>> At the line, <auto-fields-service service-name="updatePerson"/>
>>>> does it goto 'updatePerson' in services.xml and from there does it
>>>> goto
>>>> 'updatePerson' method in PartyServices.java and execute the method
>>>> updatePerson() ??
>>>
>>> It is correct.
>>>
>>>
>>>
>>>
>>>> (I know that when save button is clicked, it goes to either
>>>> createPerson or
>>>> updatePerson service and from there it goes to partyServices.java
>>>> and
>>>> executes createPerson() or UpdatePerson() method accordingly. But
>>>> not sure
>>>> if java method is called when service is called at auto-fields-
>>>> service tag)
>>>>
>>>> Can someone pleaase clear this..
>>>>
>>>> Thankyou.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Sumit Pandit-3 wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> partyId = delegator.getNextSeqId("Party");
>>>>>
>>>>> And for more information and to handle other scenario refer -
>>>>> createPerson service in PartyServices.java
>>>>>
>>>>> --
>>>>> Thanks And Regards
>>>>> Sumit Pandit
>>>>>
>>>>> On Nov 6, 2009, at 1:46 PM, swathi wrote:
>>>>>
>>>>>>
>>>>>> Thankyou Sumit.
>>>>>>
>>>>>> But I also need partyId which is primarykey. If I want to auto
>>>>>> generate the
>>>>>> partyID, How do I do it in this code.
>>>>>>
>>>>>> Sumit Pandit-3 wrote:
>>>>>>>
>>>>>>> I think following might help you.
>>>>>>>
>>>>>>> PS - Please go through Delegator API for being more comfortable.
>>>>>>>
>>>>>>>
>>>>>>> On Nov 6, 2009, at 11:31 AM, swathi wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> Here is my code:
>>>>>>>> public static String savePerson(HttpServletRequest request,
>>>>>>>> HttpServletResponse response) {
>>>>>>>>
>>>>>>>
>>>>>>> Delegator delegator = (Delegator) request.getAttribute
>>>>>>> ("delegator");
>>>>>>>
>>>>>>>> String salutation=request.getParameter("salutation");
>>>>>>>> String firstName= request.getParameter("firstName");
>>>>>>>> String lastName = request.getParameter("lastName");
>>>>>>>> String personalTitle=request.getParameter("personalTitle");
>>>>>>>>
>>>>>>>
>>>>>>> GenericValue person = delegator.makeValue("Person",
>>>>>>> UtilMisc.toMap
>>>>>>> ("salutation", salutation, "firstName", firstName, "lastName",
>>>>>>> lastName, "personalTitle", personalTitle));
>>>>>>>
>>>>>>> try {
>>>>>>> person.create();
>>>>>>> } catch (GenericEntityException e) {}
>>>>>>>
>>>>>>> return "success";
>>>>>>>
>>>>>>>>
>>>>>>>> }
>>>>>>>> Actually Iam kind of stuck here,not sure how do I save it to db.
>>>>>>>> Iam
>>>>>>>> trying
>>>>>>>> to create a new record into Person table in webtools.
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>>
>>>>>>>> Sumit Pandit-3 wrote:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Can you please paste your code of java event which is saving
>>>>>>>>> your
>>>>>>>>> data
>>>>>>>>> in database. That would help me to understand where you are
>>>>>>>>> going
>>>>>>>>> wrong.
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Thanks And Regards
>>>>>>>>> Sumit Pandit
>>>>>>>>>
>>>>>>>>> On Nov 6, 2009, at 9:24 AM, swathi wrote:
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Thankyou.
>>>>>>>>>>
>>>>>>>>>> Can I not save data in database using Java Program. Do I
>>>>>>>>>> have to
>>>>>>>>>> goto
>>>>>>>>>> service anyhow.
>>>>>>>>>> This is my flow..
>>>>>>>>>> my request goes from controller.xml -> screen-> On click of a
>>>>>>>>>> button, Create
>>>>>>>>>> Person-> request goes to controller again ->Screen -> ftl->On
>>>>>>>>>> click
>>>>>>>>>> of save
>>>>>>>>>> button on ftl , the action is 'savePerson' ie goes to
>>>>>>>>>> controller.xml. Here I
>>>>>>>>>> have a java event, where I want to save this data entered on
>>>>>>>>>> ftl. I
>>>>>>>>>> got data
>>>>>>>>>> entered, using request,getParameter(). I created a map,
>>>>>>>>>> inpMap=FastMap.newInstance();
>>>>>>>>>> I put the data into the map.
>>>>>>>>>> inpMap.put("firstName",firstName);
>>>>>>>>>> Not sure how to save this data to database in this program
>>>>>>>>>> itself..
>>>>>>>>>> I looked
>>>>>>>>>> at some examples where I found,after they got values from
>>>>>>>>>> parameters, they
>>>>>>>>>> put it in tha map and y called
>>>>>>>>>> dispatcher.runSync("..servicename..","..mapName..") ie they
>>>>>>>>>> are
>>>>>>>>>> calling a
>>>>>>>>>> service and in service a simple-method is called again.. Do we
>>>>>>>>>> have
>>>>>>>>>> to go
>>>>>>>>>> thru this long step... Sorry if I created a confusion..
>>>>>>>>>> Can someone please guide me..
>>>>>>>>>>
>>>>>>>>>> Thanks
>>>>>>>>>>
>>>>>>>>>> S.Hage wrote:
>>>>>>>>>>>
>>>>>>>>>>> look in the file runtime\logs\error.log.
>>>>>>>>>>>
>>>>>>>>>>> You can also add System.out.println("") in your java code 'to
>>>>>>>>>>> trace
>>>>>>>>>>> it'
>>>>>>>>>>> and look in runtime\logs\ofbiz.log.
>>>>>>>>>>>
>>>>>>>>>>> S.H.
>>>>>>>>>>>
>>>>>>>>>>> ______________________
>>>>>>>>>>> Saad Hage
>>>>>>>>>>> [email protected]
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> From: swathi [via OFBiz]
>>>>>>>>>>> Sent: Thursday, November 05, 2009 4:49 PM
>>>>>>>>>>> To: S.Hage
>>>>>>>>>>> Subject: Re: compile java event.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Yes I had to change the properties in build.xml according
>>>>>>>>>>> to my
>>>>>>>>>>> application and In eclipse I added my src folder to
>>>>>>>>>>> JavaBuildPath.
>>>>>>>>>>> I got
>>>>>>>>>>> the build dir created with classes folder and lib folder
>>>>>>>>>>> with .class
>>>>>>>>>>> files and.jar file respectively. But my event doesnt work
>>>>>>>>>>> as I
>>>>>>>>>>> want
>>>>>>>>>>> it to.
>>>>>>>>>>> where do I see if I have any errors.
>>>>>>>>>>>
>>>>>>>>>>> Thankyou
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> S.Hage wrote:
>>>>>>>>>>> I thing you should change thoses in build.xml:
>>>>>>>>>>>
>>>>>>>>>>> <property name="desc" value="your component
>>>>>>>>>>> decription"/>
>>>>>>>>>>> <property name="name" value="your component name in
>>>>>>>>>>> hot-deploy"/>
>>>>>>>>>>> <property name="ofbiz.home.dir" value="../.."/>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> swathi wrote:
>>>>>>>>>>> Iam working on my own application in hot-deploy
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> James McGill-5 wrote:
>>>>>>>>>>> On Wed, Nov 4, 2009 at 2:38 PM, swathi
>>>>>>>>>>> <[email protected]>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Hi
>>>>>>>>>>>> Can someone please tell me How do I compile a java event. I
>>>>>>>>>>>> copied
>>>>>>>>>>>> build.xml
>>>>>>>>>>>> from example application. Just by doing ant at cmd prmt
>>>>>>>>>>>> doesnt
>>>>>>>>>>> create a
>>>>>>>>>>>> build dir with jars in my component.
>>>>>>>>>>>> In which dir does it create the build dir?
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Make sure your component is loaddd in component-load.xml,
>>>>>>>>>>> and
>>>>>>>>>>> your
>>>>>>>>>>> component's build.xml is included in the filelist in the
>>>>>>>>>>> parent
>>>>>>>>>>> build.xml.
>>>>>>>>>>> Are you working in specialpurpose/yourapp?
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> James McGill
>>>>>>>>>>> Phoenix AZ
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>>>>
>>>>>>>>>>> View message @
>>>>>>>>>>> http://n4.nabble.com/compile-java-event-tp439486p532067.html
>>>>>>>>>>> To unsubscribe from Re: compile java event., click here.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> View this message in context:
>>>>>>>>>> http://n4.nabble.com/compile-java-event-tp439486p547822.html
>>>>>>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> View this message in context:
>>>>>>>> http://n4.nabble.com/compile-java-event-tp439486p548231.html
>>>>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://n4.nabble.com/compile-java-event-tp439486p558547.html
>>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://n4.nabble.com/compile-java-event-tp439486p584972.html
>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://n4.nabble.com/compile-java-event-tp439486p585127.html
>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>
>
--
View this message in context:
http://n4.nabble.com/compile-java-event-tp439486p585415.html
Sent from the OFBiz - User mailing list archive at Nabble.com.