You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Ramkrishna Swamy <ra...@gmail.com> on 2010/06/02 16:48:20 UTC

Error in service getPartyTelephone

Hello list,

When i call service getPartyTelephone from groovy then it shows error "you
must be logged in to complete the process", i saw the service definition, it
requires only partyId not userlogin and also auth is false. so what could be
problem.
Thanks in advance.

-- 
Thanks
Ramkrishna

Re: Error in service getPartyTelephone

Posted by BJ Freeman <bj...@free-man.net>.
https://cwiki.apache.org/confluence/display/OFBTECH/OFBiz+security
look At service program level.


=========================
BJ Freeman
http://bjfreeman.elance.com
Strategic Power Office with Supplier Automation <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com <http://www.specialtymarket.com/>

Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man
Linkedin
<http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro>


Ramkrishna Swamy sent the following on 6/2/2010 7:48 AM:
> Hello list,
> 
> When i call service getPartyTelephone from groovy then it shows error "you
> must be logged in to complete the process", i saw the service definition, it
> requires only partyId not userlogin and also auth is false. so what could be
> problem.
> Thanks in advance.
> 


Re: Error in service getPartyTelephone

Posted by Ramkrishna Swamy <ra...@gmail.com>.
Thanks Deepak for sharing the link, I have already solved the problem.

-- 
Thanks
Ramkrishna

On Fri, Jun 4, 2010 at 11:25 AM, Deepak Dixit
<de...@hotwaxmedia.com>wrote:

> Hello Ramkrishna,
>
> You don't need get userLogin from parameters its availble in screen
> context.
> https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=6553757
> So you can directly use userLogin.
>
> You are trying to get userLogin from parameters there for you face the type
> conversion error.All parameters are in string formate.
>
> Regards
> --
> Deepak Dixit
>
>
>
>
> Ramkrishna Swamy wrote:
>
>> Hello Patrick,
>>
>> I did the same by putting value of userLogin into map and then passed map
>> to
>> service but it trows error saying "Groovy Event Error (Service
>> [getPartyTelephone] Failed (java.lang.String cannot be cast to
>> org.ofbiz.entity.GenericValue))".
>>
>> Following is my code for service: -
>> telecomNumberMap = dispatcher.runSync("getPartyTelephone", [partyId :
>> partyId, userLogin : userLogin]);
>>
>>
>>
>>
>> On Thu, Jun 3, 2010 at 8:56 PM, Patrick <patrickinminneapolis@gmail.com
>> >wrote:
>>
>>
>>
>>> Hi Rama
>>> Look at the example create invoice
>>>
>>> InvoiceServices.java
>>> createInvoiceContext.put("userLogin", userLogin);
>>> Map createInvoiceResult = dispatcher.runSync("createInvoice",
>>> createInvoiceContext);
>>>
>>> Notice the service def doesn't explicitly mention userLogin
>>>   <service name="createInvoice" engine="simple"
>>> default-entity-name="Invoice"
>>>
>>>
>>>  location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml"
>>> invoke="createInvoice">
>>>       <description>Create Invoice Record</description>
>>>       <permission-service service-name="acctgInvoicePermissionCheck"
>>> main-action="CREATE"/>
>>>       <auto-attributes mode="INOUT" include="pk" optional="true"/>
>>>       <auto-attributes mode="IN" include="nonpk" optional="true"/>
>>>       <override name="invoiceTypeId" mode="IN" optional="false"/>
>>>       <override name="statusId" mode = "IN" optional="false"/>
>>>       <override name="partyIdFrom" mode = "IN" optional="false"/>
>>>       <override name="partyId" mode = "IN" optional="false"/>
>>>   </service>
>>>
>>>
>>> On Thu, Jun 3, 2010 at 6:50 AM, Ramkrishna Swamy
>>> <ra...@gmail.com> wrote:
>>>
>>>
>>>> Hi Patrick,
>>>>
>>>>  I put the userLogin into the map but it says "java.lang.String cannot
>>>> be
>>>> cast to org.ofbiz.entity.GenericValue", then i tried with putting
>>>> userLoginId but it says "No such property userLoginId"
>>>> Following is my code: -
>>>> Groovy Event Error (Service [getPartyTelephone] Failed (java.lang.String
>>>>
>>>>
>>> cannot be cast to org.ofbiz.entity.GenericValue))
>>>
>>>
>>>> userLogin = parameters.userLogin;
>>>> partyId = parameters.partyId;
>>>> telecomNumberMap = dispatcher.runSync("getPartyTelephone",
>>>> UtilMisc.toMap("partyId", partyId, "userLoginId",
>>>>
>>>>
>>> userLogin.userLoginId));
>>>
>>>
>>>> Although the service getPartyTelephone does not require any userLogin
>>>> parameter as input.
>>>>
>>>> Please help.
>>>>
>>>> On Wed, Jun 2, 2010 at 10:02 PM, Patrick <
>>>> patrickinminneapolis@gmail.com
>>>> wrote:
>>>>
>>>>
>>>>
>>>>> Just put userLogin into the context map.
>>>>>
>>>>> On Wed, Jun 2, 2010 at 9:48 AM, Ramkrishna Swamy
>>>>> <ra...@gmail.com> wrote:
>>>>>
>>>>>
>>>>>> Hello list,
>>>>>>
>>>>>> When i call service getPartyTelephone from groovy then it shows error
>>>>>>
>>>>>>
>>>>> "you
>>>>>
>>>>>
>>>>>> must be logged in to complete the process", i saw the service
>>>>>>
>>>>>>
>>>>> definition,
>>>
>>>
>>>> it
>>>>>
>>>>>
>>>>>> requires only partyId not userlogin and also auth is false. so what
>>>>>>
>>>>>>
>>>>> could
>>>
>>>
>>>> be
>>>>>
>>>>>
>>>>>> problem.
>>>>>> Thanks in advance.
>>>>>>
>>>>>> --
>>>>>> Thanks
>>>>>> Ramkrishna
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>> --
>>>> Thanks
>>>> Ramkrishna
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>>
>
>
>

Re: Error in service getPartyTelephone

Posted by Deepak Dixit <de...@hotwaxmedia.com>.
Hello Ramkrishna,

You don't need get userLogin from parameters its availble in screen 
context. 
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=6553757
So you can directly use userLogin.

You are trying to get userLogin from parameters there for you face the 
type conversion error.All parameters are in string formate.

Regards
-- 
Deepak Dixit



Ramkrishna Swamy wrote:
> Hello Patrick,
>
> I did the same by putting value of userLogin into map and then passed map to
> service but it trows error saying "Groovy Event Error (Service
> [getPartyTelephone] Failed (java.lang.String cannot be cast to
> org.ofbiz.entity.GenericValue))".
>
> Following is my code for service: -
> telecomNumberMap = dispatcher.runSync("getPartyTelephone", [partyId :
> partyId, userLogin : userLogin]);
>
>
>
>
> On Thu, Jun 3, 2010 at 8:56 PM, Patrick <pa...@gmail.com>wrote:
>
>   
>> Hi Rama
>> Look at the example create invoice
>>
>> InvoiceServices.java
>> createInvoiceContext.put("userLogin", userLogin);
>> Map createInvoiceResult = dispatcher.runSync("createInvoice",
>> createInvoiceContext);
>>
>> Notice the service def doesn't explicitly mention userLogin
>>    <service name="createInvoice" engine="simple"
>> default-entity-name="Invoice"
>>
>>  location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml"
>> invoke="createInvoice">
>>        <description>Create Invoice Record</description>
>>        <permission-service service-name="acctgInvoicePermissionCheck"
>> main-action="CREATE"/>
>>        <auto-attributes mode="INOUT" include="pk" optional="true"/>
>>        <auto-attributes mode="IN" include="nonpk" optional="true"/>
>>        <override name="invoiceTypeId" mode="IN" optional="false"/>
>>        <override name="statusId" mode = "IN" optional="false"/>
>>        <override name="partyIdFrom" mode = "IN" optional="false"/>
>>        <override name="partyId" mode = "IN" optional="false"/>
>>    </service>
>>
>>
>> On Thu, Jun 3, 2010 at 6:50 AM, Ramkrishna Swamy
>> <ra...@gmail.com> wrote:
>>     
>>> Hi Patrick,
>>>
>>>  I put the userLogin into the map but it says "java.lang.String cannot be
>>> cast to org.ofbiz.entity.GenericValue", then i tried with putting
>>> userLoginId but it says "No such property userLoginId"
>>> Following is my code: -
>>> Groovy Event Error (Service [getPartyTelephone] Failed (java.lang.String
>>>       
>> cannot be cast to org.ofbiz.entity.GenericValue))
>>     
>>> userLogin = parameters.userLogin;
>>> partyId = parameters.partyId;
>>> telecomNumberMap = dispatcher.runSync("getPartyTelephone",
>>> UtilMisc.toMap("partyId", partyId, "userLoginId",
>>>       
>> userLogin.userLoginId));
>>     
>>> Although the service getPartyTelephone does not require any userLogin
>>> parameter as input.
>>>
>>> Please help.
>>>
>>> On Wed, Jun 2, 2010 at 10:02 PM, Patrick <patrickinminneapolis@gmail.com
>>> wrote:
>>>
>>>       
>>>> Just put userLogin into the context map.
>>>>
>>>> On Wed, Jun 2, 2010 at 9:48 AM, Ramkrishna Swamy
>>>> <ra...@gmail.com> wrote:
>>>>         
>>>>> Hello list,
>>>>>
>>>>> When i call service getPartyTelephone from groovy then it shows error
>>>>>           
>>>> "you
>>>>         
>>>>> must be logged in to complete the process", i saw the service
>>>>>           
>> definition,
>>     
>>>> it
>>>>         
>>>>> requires only partyId not userlogin and also auth is false. so what
>>>>>           
>> could
>>     
>>>> be
>>>>         
>>>>> problem.
>>>>> Thanks in advance.
>>>>>
>>>>> --
>>>>> Thanks
>>>>> Ramkrishna
>>>>>
>>>>>           
>>>
>>> --
>>> Thanks
>>> Ramkrishna
>>>
>>>       
>
>
>
>   



Re: Error in service getPartyTelephone

Posted by Ramkrishna Swamy <ra...@gmail.com>.
Hello Patrick,

I did the same by putting value of userLogin into map and then passed map to
service but it trows error saying "Groovy Event Error (Service
[getPartyTelephone] Failed (java.lang.String cannot be cast to
org.ofbiz.entity.GenericValue))".

Following is my code for service: -
telecomNumberMap = dispatcher.runSync("getPartyTelephone", [partyId :
partyId, userLogin : userLogin]);




On Thu, Jun 3, 2010 at 8:56 PM, Patrick <pa...@gmail.com>wrote:

> Hi Rama
> Look at the example create invoice
>
> InvoiceServices.java
> createInvoiceContext.put("userLogin", userLogin);
> Map createInvoiceResult = dispatcher.runSync("createInvoice",
> createInvoiceContext);
>
> Notice the service def doesn't explicitly mention userLogin
>    <service name="createInvoice" engine="simple"
> default-entity-name="Invoice"
>
>  location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml"
> invoke="createInvoice">
>        <description>Create Invoice Record</description>
>        <permission-service service-name="acctgInvoicePermissionCheck"
> main-action="CREATE"/>
>        <auto-attributes mode="INOUT" include="pk" optional="true"/>
>        <auto-attributes mode="IN" include="nonpk" optional="true"/>
>        <override name="invoiceTypeId" mode="IN" optional="false"/>
>        <override name="statusId" mode = "IN" optional="false"/>
>        <override name="partyIdFrom" mode = "IN" optional="false"/>
>        <override name="partyId" mode = "IN" optional="false"/>
>    </service>
>
>
> On Thu, Jun 3, 2010 at 6:50 AM, Ramkrishna Swamy
> <ra...@gmail.com> wrote:
> > Hi Patrick,
> >
> >  I put the userLogin into the map but it says "java.lang.String cannot be
> > cast to org.ofbiz.entity.GenericValue", then i tried with putting
> > userLoginId but it says "No such property userLoginId"
> > Following is my code: -
> >Groovy Event Error (Service [getPartyTelephone] Failed (java.lang.String
> cannot be cast to org.ofbiz.entity.GenericValue))
> > userLogin = parameters.userLogin;
> > partyId = parameters.partyId;
> > telecomNumberMap = dispatcher.runSync("getPartyTelephone",
> > UtilMisc.toMap("partyId", partyId, "userLoginId",
> userLogin.userLoginId));
> >
> > Although the service getPartyTelephone does not require any userLogin
> > parameter as input.
> >
> > Please help.
> >
> > On Wed, Jun 2, 2010 at 10:02 PM, Patrick <patrickinminneapolis@gmail.com
> >wrote:
> >
> >> Just put userLogin into the context map.
> >>
> >> On Wed, Jun 2, 2010 at 9:48 AM, Ramkrishna Swamy
> >> <ra...@gmail.com> wrote:
> >> > Hello list,
> >> >
> >> > When i call service getPartyTelephone from groovy then it shows error
> >> "you
> >> > must be logged in to complete the process", i saw the service
> definition,
> >> it
> >> > requires only partyId not userlogin and also auth is false. so what
> could
> >> be
> >> > problem.
> >> > Thanks in advance.
> >> >
> >> > --
> >> > Thanks
> >> > Ramkrishna
> >> >
> >>
> >
> >
> >
> > --
> > Thanks
> > Ramkrishna
> >
>



-- 
Thanks
Ramkrishna

Re: Error in service getPartyTelephone

Posted by Patrick <pa...@gmail.com>.
Hi Rama
Look at the example create invoice

InvoiceServices.java
createInvoiceContext.put("userLogin", userLogin);
Map createInvoiceResult = dispatcher.runSync("createInvoice",
createInvoiceContext);

Notice the service def doesn't explicitly mention userLogin
    <service name="createInvoice" engine="simple" default-entity-name="Invoice"
        location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml"
invoke="createInvoice">
        <description>Create Invoice Record</description>
        <permission-service service-name="acctgInvoicePermissionCheck"
main-action="CREATE"/>
        <auto-attributes mode="INOUT" include="pk" optional="true"/>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
        <override name="invoiceTypeId" mode="IN" optional="false"/>
        <override name="statusId" mode = "IN" optional="false"/>
        <override name="partyIdFrom" mode = "IN" optional="false"/>
        <override name="partyId" mode = "IN" optional="false"/>
    </service>


On Thu, Jun 3, 2010 at 6:50 AM, Ramkrishna Swamy
<ra...@gmail.com> wrote:
> Hi Patrick,
>
>  I put the userLogin into the map but it says "java.lang.String cannot be
> cast to org.ofbiz.entity.GenericValue", then i tried with putting
> userLoginId but it says "No such property userLoginId"
> Following is my code: -
>
> userLogin = parameters.userLogin;
> partyId = parameters.partyId;
> telecomNumberMap = dispatcher.runSync("getPartyTelephone",
> UtilMisc.toMap("partyId", partyId, "userLoginId", userLogin.userLoginId));
>
> Although the service getPartyTelephone does not require any userLogin
> parameter as input.
>
> Please help.
>
> On Wed, Jun 2, 2010 at 10:02 PM, Patrick <pa...@gmail.com>wrote:
>
>> Just put userLogin into the context map.
>>
>> On Wed, Jun 2, 2010 at 9:48 AM, Ramkrishna Swamy
>> <ra...@gmail.com> wrote:
>> > Hello list,
>> >
>> > When i call service getPartyTelephone from groovy then it shows error
>> "you
>> > must be logged in to complete the process", i saw the service definition,
>> it
>> > requires only partyId not userlogin and also auth is false. so what could
>> be
>> > problem.
>> > Thanks in advance.
>> >
>> > --
>> > Thanks
>> > Ramkrishna
>> >
>>
>
>
>
> --
> Thanks
> Ramkrishna
>

Re: Error in service getPartyTelephone

Posted by Ramkrishna Swamy <ra...@gmail.com>.
Hi Patrick,

 I put the userLogin into the map but it says "java.lang.String cannot be
cast to org.ofbiz.entity.GenericValue", then i tried with putting
userLoginId but it says "No such property userLoginId"
Following is my code: -

userLogin = parameters.userLogin;
partyId = parameters.partyId;
telecomNumberMap = dispatcher.runSync("getPartyTelephone",
UtilMisc.toMap("partyId", partyId, "userLoginId", userLogin.userLoginId));

Although the service getPartyTelephone does not require any userLogin
parameter as input.

Please help.

On Wed, Jun 2, 2010 at 10:02 PM, Patrick <pa...@gmail.com>wrote:

> Just put userLogin into the context map.
>
> On Wed, Jun 2, 2010 at 9:48 AM, Ramkrishna Swamy
> <ra...@gmail.com> wrote:
> > Hello list,
> >
> > When i call service getPartyTelephone from groovy then it shows error
> "you
> > must be logged in to complete the process", i saw the service definition,
> it
> > requires only partyId not userlogin and also auth is false. so what could
> be
> > problem.
> > Thanks in advance.
> >
> > --
> > Thanks
> > Ramkrishna
> >
>



-- 
Thanks
Ramkrishna

Re: Error in service getPartyTelephone

Posted by Patrick <pa...@gmail.com>.
Just put userLogin into the context map.

On Wed, Jun 2, 2010 at 9:48 AM, Ramkrishna Swamy
<ra...@gmail.com> wrote:
> Hello list,
>
> When i call service getPartyTelephone from groovy then it shows error "you
> must be logged in to complete the process", i saw the service definition, it
> requires only partyId not userlogin and also auth is false. so what could be
> problem.
> Thanks in advance.
>
> --
> Thanks
> Ramkrishna
>