You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Christopher Snow <sn...@snowconsulting.co.uk> on 2010/03/24 12:23:58 UTC

Party Main Role

In the party find screen, there is a column to show the Party's Main Role.

Where is the party main role stored?

Many thanks in advance,

Chris

Re: Party Main Role

Posted by Ashish Vijaywargiya <vi...@gmail.com>.
AFAIK we don't have any GUI support for it.
You may need to play with Webtools to add supporting data.
Please refer commit done at r814287 for more details.

--
Ashish

On Wed, Mar 24, 2010 at 8:34 PM, Christopher Snow
<sn...@snowconsulting.co.uk> wrote:
> Hi Ashish,
>
> That makes it easy to "get" the main party role.  How does one "set" the
> main party role?
>
> Many thanks,
>
> Chris
>
>
> Ashish Vijaywargiya wrote:
>>
>> Here is the code from ftl file:
>>
>>            <td>
>>              <#assign mainRole =
>> dispatcher.runSync("getPartyMainRole",
>> Static["org.ofbiz.base.util.UtilMisc"].toMap("partyId",
>> partyRow.partyId, "userLogin", userLogin))/>
>>              ${mainRole.description?if_exists}
>>            </td>
>>
>> Here is the code from service definition:
>>    <service name="getPartyMainRole" engine="simple"
>>
>>  location="component://party/script/org/ofbiz/party/party/PartyServices.xml"
>> invoke="getPartyMainRole">
>>        <description>Get the main role of this party which is a child
>> of the MAIN_ROLE roletypeId</description>
>>        <attribute name="partyId" type="String" mode="IN"
>> optional="false"/>
>>        <attribute name="roleTypeId" type="String" mode="OUT"
>> optional="true"/>
>>        <attribute name="description" type="String" mode="OUT"
>> optional="true"/>
>>    </service>
>>
>> Here is the code from Mini Lang:
>>    <simple-method method-name="getPartyMainRole"
>>        short-description="Get the main role of this party which is a
>> child of the MAIN_ROLE roletypeId">
>>        <entity-and entity-name="PartyRole" list="partyRoles">
>>            <field-map field-name="partyId" from-field="parameters.partyId"
>> />
>>        </entity-and>
>>        <!-- find the role in the list -->
>>        <clear-field field="mainRoleTypeId"/>
>>        <iterate entry="partyRole" list="partyRoles">
>>            <if-empty field="mainRoleTypeId">
>>                <entity-and entity-name="RoleTypeIn3Levels"
>> list="roleTypeIn3Levels">
>>                    <field-map field-name="topRoleTypeId" value="MAIN_ROLE"
>> />
>>                    <field-map field-name="lowRoleTypeId"
>> from-field="partyRole.roleTypeId" />
>>                </entity-and>
>>                <if-not-empty field="roleTypeIn3Levels">
>>                    <set field="mainRoleTypeId"
>> from-field="partyRole.roleTypeId" />
>>                </if-not-empty>
>>            </if-empty>
>>        </iterate>
>>        <if-not-empty field="mainRoleTypeId">
>>            <field-to-result field="mainRoleTypeId"
>> result-name="roleTypeId" />
>>            <entity-one entity-name="RoleType" value-field="roleType">
>>                <field-map field-name="roleTypeId"
>> from-field="mainRoleTypeId" />
>>            </entity-one>
>>            <field-to-result result-name="description"
>> field="roleType.description" />
>>        </if-not-empty>
>>    </simple-method>
>>
>> Please let me me know if you need any help to understand the code.
>> In short refer RoleTypeIn3Levels entity. :-)
>>
>> Thanks!
>>
>> --
>> Ashish
>>
>>
>> On Wed, Mar 24, 2010 at 7:15 PM, chris snow <ch...@googlemail.com>
>> wrote:
>>
>>>
>>> Hi Rishi,  how is the main role differentiated from the other roles?
>>>
>>> Many thanks,
>>>
>>> Chris
>>>
>>> On Wed, Mar 24, 2010 at 1:41 PM, Rishi Solanki
>>> <ri...@gmail.com>wrote:
>>>
>>>
>>>>
>>>> Hi,
>>>> It is coming from RoleType entity in the dropdown.
>>>> The Party main role as well as any other role is stored in PartyRole
>>>> like ;
>>>> BUYER, SALES_REP, CUSTOMER etc.
>>>>
>>>> Rishi Solanki
>>>> Enterprise Software Developer
>>>> HotWax Media Pvt. Ltd.
>>>>
>>>>
>>>> On Wed, Mar 24, 2010 at 4:53 PM, Christopher Snow <
>>>> snowch@snowconsulting.co.uk> wrote:
>>>>
>>>>
>>>>>
>>>>> In the party find screen, there is a column to show the Party's Main
>>>>>
>>>>
>>>> Role.
>>>>
>>>>>
>>>>> Where is the party main role stored?
>>>>>
>>>>> Many thanks in advance,
>>>>>
>>>>> Chris
>>>>>
>>>>>
>
>

Re: Party Main Role

Posted by Christopher Snow <sn...@snowconsulting.co.uk>.
Hi Ashish,

That makes it easy to "get" the main party role.  How does one "set" the 
main party role?

Many thanks,

Chris


Ashish Vijaywargiya wrote:
> Here is the code from ftl file:
>
>             <td>
>               <#assign mainRole =
> dispatcher.runSync("getPartyMainRole",
> Static["org.ofbiz.base.util.UtilMisc"].toMap("partyId",
> partyRow.partyId, "userLogin", userLogin))/>
>               ${mainRole.description?if_exists}
>             </td>
>
> Here is the code from service definition:
>     <service name="getPartyMainRole" engine="simple"
>             location="component://party/script/org/ofbiz/party/party/PartyServices.xml"
> invoke="getPartyMainRole">
>         <description>Get the main role of this party which is a child
> of the MAIN_ROLE roletypeId</description>
>         <attribute name="partyId" type="String" mode="IN" optional="false"/>
>         <attribute name="roleTypeId" type="String" mode="OUT" optional="true"/>
>         <attribute name="description" type="String" mode="OUT" optional="true"/>
>     </service>
>
> Here is the code from Mini Lang:
>     <simple-method method-name="getPartyMainRole"
>         short-description="Get the main role of this party which is a
> child of the MAIN_ROLE roletypeId">
>         <entity-and entity-name="PartyRole" list="partyRoles">
>             <field-map field-name="partyId" from-field="parameters.partyId" />
>         </entity-and>
>         <!-- find the role in the list -->
>         <clear-field field="mainRoleTypeId"/>
>         <iterate entry="partyRole" list="partyRoles">
>             <if-empty field="mainRoleTypeId">
>                 <entity-and entity-name="RoleTypeIn3Levels"
> list="roleTypeIn3Levels">
>                     <field-map field-name="topRoleTypeId" value="MAIN_ROLE" />
>                     <field-map field-name="lowRoleTypeId"
> from-field="partyRole.roleTypeId" />
>                 </entity-and>
>                 <if-not-empty field="roleTypeIn3Levels">
>                     <set field="mainRoleTypeId"
> from-field="partyRole.roleTypeId" />
>                 </if-not-empty>
>             </if-empty>
>         </iterate>
>         <if-not-empty field="mainRoleTypeId">
>             <field-to-result field="mainRoleTypeId" result-name="roleTypeId" />
>             <entity-one entity-name="RoleType" value-field="roleType">
>                 <field-map field-name="roleTypeId"
> from-field="mainRoleTypeId" />
>             </entity-one>
>             <field-to-result result-name="description"
> field="roleType.description" />
>         </if-not-empty>
>     </simple-method>
>
> Please let me me know if you need any help to understand the code.
> In short refer RoleTypeIn3Levels entity. :-)
>
> Thanks!
>
> --
> Ashish
>
>
> On Wed, Mar 24, 2010 at 7:15 PM, chris snow <ch...@googlemail.com> wrote:
>   
>> Hi Rishi,  how is the main role differentiated from the other roles?
>>
>> Many thanks,
>>
>> Chris
>>
>> On Wed, Mar 24, 2010 at 1:41 PM, Rishi Solanki <ri...@gmail.com>wrote:
>>
>>     
>>> Hi,
>>> It is coming from RoleType entity in the dropdown.
>>> The Party main role as well as any other role is stored in PartyRole like ;
>>> BUYER, SALES_REP, CUSTOMER etc.
>>>
>>> Rishi Solanki
>>> Enterprise Software Developer
>>> HotWax Media Pvt. Ltd.
>>>
>>>
>>> On Wed, Mar 24, 2010 at 4:53 PM, Christopher Snow <
>>> snowch@snowconsulting.co.uk> wrote:
>>>
>>>       
>>>> In the party find screen, there is a column to show the Party's Main
>>>>         
>>> Role.
>>>       
>>>> Where is the party main role stored?
>>>>
>>>> Many thanks in advance,
>>>>
>>>> Chris
>>>>
>>>>         


Re: Party Main Role

Posted by Ashish Vijaywargiya <vi...@gmail.com>.
Here is the code from ftl file:

            <td>
              <#assign mainRole =
dispatcher.runSync("getPartyMainRole",
Static["org.ofbiz.base.util.UtilMisc"].toMap("partyId",
partyRow.partyId, "userLogin", userLogin))/>
              ${mainRole.description?if_exists}
            </td>

Here is the code from service definition:
    <service name="getPartyMainRole" engine="simple"
            location="component://party/script/org/ofbiz/party/party/PartyServices.xml"
invoke="getPartyMainRole">
        <description>Get the main role of this party which is a child
of the MAIN_ROLE roletypeId</description>
        <attribute name="partyId" type="String" mode="IN" optional="false"/>
        <attribute name="roleTypeId" type="String" mode="OUT" optional="true"/>
        <attribute name="description" type="String" mode="OUT" optional="true"/>
    </service>

Here is the code from Mini Lang:
    <simple-method method-name="getPartyMainRole"
        short-description="Get the main role of this party which is a
child of the MAIN_ROLE roletypeId">
        <entity-and entity-name="PartyRole" list="partyRoles">
            <field-map field-name="partyId" from-field="parameters.partyId" />
        </entity-and>
        <!-- find the role in the list -->
        <clear-field field="mainRoleTypeId"/>
        <iterate entry="partyRole" list="partyRoles">
            <if-empty field="mainRoleTypeId">
                <entity-and entity-name="RoleTypeIn3Levels"
list="roleTypeIn3Levels">
                    <field-map field-name="topRoleTypeId" value="MAIN_ROLE" />
                    <field-map field-name="lowRoleTypeId"
from-field="partyRole.roleTypeId" />
                </entity-and>
                <if-not-empty field="roleTypeIn3Levels">
                    <set field="mainRoleTypeId"
from-field="partyRole.roleTypeId" />
                </if-not-empty>
            </if-empty>
        </iterate>
        <if-not-empty field="mainRoleTypeId">
            <field-to-result field="mainRoleTypeId" result-name="roleTypeId" />
            <entity-one entity-name="RoleType" value-field="roleType">
                <field-map field-name="roleTypeId"
from-field="mainRoleTypeId" />
            </entity-one>
            <field-to-result result-name="description"
field="roleType.description" />
        </if-not-empty>
    </simple-method>

Please let me me know if you need any help to understand the code.
In short refer RoleTypeIn3Levels entity. :-)

Thanks!

--
Ashish


On Wed, Mar 24, 2010 at 7:15 PM, chris snow <ch...@googlemail.com> wrote:
> Hi Rishi,  how is the main role differentiated from the other roles?
>
> Many thanks,
>
> Chris
>
> On Wed, Mar 24, 2010 at 1:41 PM, Rishi Solanki <ri...@gmail.com>wrote:
>
>> Hi,
>> It is coming from RoleType entity in the dropdown.
>> The Party main role as well as any other role is stored in PartyRole like ;
>> BUYER, SALES_REP, CUSTOMER etc.
>>
>> Rishi Solanki
>> Enterprise Software Developer
>> HotWax Media Pvt. Ltd.
>>
>>
>> On Wed, Mar 24, 2010 at 4:53 PM, Christopher Snow <
>> snowch@snowconsulting.co.uk> wrote:
>>
>> > In the party find screen, there is a column to show the Party's Main
>> Role.
>> >
>> > Where is the party main role stored?
>> >
>> > Many thanks in advance,
>> >
>> > Chris
>> >
>>
>

Re: Party Main Role

Posted by chris snow <ch...@googlemail.com>.
Hi Rishi,  how is the main role differentiated from the other roles?

Many thanks,

Chris

On Wed, Mar 24, 2010 at 1:41 PM, Rishi Solanki <ri...@gmail.com>wrote:

> Hi,
> It is coming from RoleType entity in the dropdown.
> The Party main role as well as any other role is stored in PartyRole like ;
> BUYER, SALES_REP, CUSTOMER etc.
>
> Rishi Solanki
> Enterprise Software Developer
> HotWax Media Pvt. Ltd.
>
>
> On Wed, Mar 24, 2010 at 4:53 PM, Christopher Snow <
> snowch@snowconsulting.co.uk> wrote:
>
> > In the party find screen, there is a column to show the Party's Main
> Role.
> >
> > Where is the party main role stored?
> >
> > Many thanks in advance,
> >
> > Chris
> >
>

Re: Party Main Role

Posted by BJ Freeman <bj...@free-man.net>.
look at
    <simple-method method-name="getPartyMainRole"
under
party/scrips/org/ofbiz/party/party/partyservices.xml

=========================
BJ Freeman
http://bjfreeman.elance.com
Strategic Power Office with Supplier Automation <http://www.businessesnetwork.com/automation/viewforum.php?f=93>
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>


chris snow sent the following on 3/24/2010 6:45 AM:
> Hi Rishi,  how is the main role differentiated from the other roles?
> 
> Many thanks,
> 
> Chris
> 
> On Wed, Mar 24, 2010 at 1:41 PM, Rishi Solanki <ri...@gmail.com>wrote:
> 
>> Hi,
>> It is coming from RoleType entity in the dropdown.
>> The Party main role as well as any other role is stored in PartyRole like ;
>> BUYER, SALES_REP, CUSTOMER etc.
>>
>> Rishi Solanki
>> Enterprise Software Developer
>> HotWax Media Pvt. Ltd.
>>
>>
>> On Wed, Mar 24, 2010 at 4:53 PM, Christopher Snow <
>> snowch@snowconsulting.co.uk> wrote:
>>
>>> In the party find screen, there is a column to show the Party's Main
>> Role.
>>> Where is the party main role stored?
>>>
>>> Many thanks in advance,
>>>
>>> Chris
>>>
> 



Re: Party Main Role

Posted by Rishi Solanki <ri...@gmail.com>.
Hi,
It is coming from RoleType entity in the dropdown.
The Party main role as well as any other role is stored in PartyRole like ;
BUYER, SALES_REP, CUSTOMER etc.

Rishi Solanki
Enterprise Software Developer
HotWax Media Pvt. Ltd.


On Wed, Mar 24, 2010 at 4:53 PM, Christopher Snow <
snowch@snowconsulting.co.uk> wrote:

> In the party find screen, there is a column to show the Party's Main Role.
>
> Where is the party main role stored?
>
> Many thanks in advance,
>
> Chris
>