Looking for example of how to grab a parent entity and it's children

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Looking for example of how to grab a parent entity and it's children

Jim Barrows
IE I want the Income type, and it's children, and it's children, etc.
I'm hoping we've done this before, and I don't have to pioneer anything :)

--
James A Barrows
Reply | Threaded
Open this post in threaded view
|

Re: Looking for example of how to grab a parent entity and it's children

hans_bakker
It depends what you want to do with the result...
If on screen in an ftl look at the 'cms' option of a website or the
navigate option under dataresource in the content component.

If you want it in Java or Bsh create a recursive function to get the
childs or parents of a record. Look at the WorkEffortChild and
WorkEffortParent relationships for an example.

Regards, Hans

On Sun, 2007-12-09 at 20:16 -0700, Jim Barrows wrote:
> IE I want the Income type, and it's children, and it's children, etc.
> I'm hoping we've done this before, and I don't have to pioneer anything :)
>
--
http://Antwebsystems.com : OFBiz Quality support for competitive rates.



Reply | Threaded
Open this post in threaded view
|

Re: Looking for example of how to grab a parent entity and it's children

Jim Barrows
Oh, I just need to create an income statement, so I need all the
accounts that have an account class that inherits from Income, and the
same thing for Expense, Assets, and Liabilities :)
I was hoping for something less code intensive :)  Ah well... :)

On Dec 9, 2007 9:30 PM, Hans Bakker <[hidden email]> wrote:

> It depends what you want to do with the result...
> If on screen in an ftl look at the 'cms' option of a website or the
> navigate option under dataresource in the content component.
>
> If you want it in Java or Bsh create a recursive function to get the
> childs or parents of a record. Look at the WorkEffortChild and
> WorkEffortParent relationships for an example.
>
> Regards, Hans
>
> On Sun, 2007-12-09 at 20:16 -0700, Jim Barrows wrote:
> > IE I want the Income type, and it's children, and it's children, etc.
> > I'm hoping we've done this before, and I don't have to pioneer anything :)
> >
> --
> http://Antwebsystems.com : OFBiz Quality support for competitive rates.
>
>
>
>



--
James A Barrows
Reply | Threaded
Open this post in threaded view
|

Re: Looking for example of how to grab a parent entity and it's children

Jacopo Cappellato
We will probably need a recursive method/service to do this. The method
can simply return a List of glAccountId strings. Its input will be the
Account Class and organizationPartyId.
The method can be implemented in the
org.ofbiz.accounting.util.UtilAccounting class

Then the returned List object can then easily be used to compose an
entity condition object for queries.

Jacopo


Jim Barrows wrote:

> Oh, I just need to create an income statement, so I need all the
> accounts that have an account class that inherits from Income, and the
> same thing for Expense, Assets, and Liabilities :)
> I was hoping for something less code intensive :)  Ah well... :)
>
> On Dec 9, 2007 9:30 PM, Hans Bakker <[hidden email]> wrote:
>> It depends what you want to do with the result...
>> If on screen in an ftl look at the 'cms' option of a website or the
>> navigate option under dataresource in the content component.
>>
>> If you want it in Java or Bsh create a recursive function to get the
>> childs or parents of a record. Look at the WorkEffortChild and
>> WorkEffortParent relationships for an example.
>>
>> Regards, Hans
>>
>> On Sun, 2007-12-09 at 20:16 -0700, Jim Barrows wrote:
>>> IE I want the Income type, and it's children, and it's children, etc.
>>> I'm hoping we've done this before, and I don't have to pioneer anything :)
>>>
>> --
>> http://Antwebsystems.com : OFBiz Quality support for competitive rates.
>>
>>
>>
>>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Looking for example of how to grab a parent entity and it's children

Jacopo Cappellato
In reply to this post by Jim Barrows
Jim,

if you are starting the implementation of the incoming statement and
balance sheet reports (that would be great), I'd strongly recommend that
the first version of them would be in html (screen widget + form widget
or ftl and bsh). We can then add to it other variants implemented with
other tools (e.g. JasperReports).
If you need help to play with ftl or form/screen widget code we can
help... you may start with the implementation of the bsh script to
gather the data for the report, then we can think about the best way to
represent them (ftl or form widget).

What do you think?

Jacopo


Jim Barrows wrote:

> Oh, I just need to create an income statement, so I need all the
> accounts that have an account class that inherits from Income, and the
> same thing for Expense, Assets, and Liabilities :)
> I was hoping for something less code intensive :)  Ah well... :)
>
> On Dec 9, 2007 9:30 PM, Hans Bakker <[hidden email]> wrote:
>> It depends what you want to do with the result...
>> If on screen in an ftl look at the 'cms' option of a website or the
>> navigate option under dataresource in the content component.
>>
>> If you want it in Java or Bsh create a recursive function to get the
>> childs or parents of a record. Look at the WorkEffortChild and
>> WorkEffortParent relationships for an example.
>>
>> Regards, Hans
>>
>> On Sun, 2007-12-09 at 20:16 -0700, Jim Barrows wrote:
>>> IE I want the Income type, and it's children, and it's children, etc.
>>> I'm hoping we've done this before, and I don't have to pioneer anything :)
>>>
>> --
>> http://Antwebsystems.com : OFBiz Quality support for competitive rates.
>>
>>
>>
>>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Looking for example of how to grab a parent entity and it's children

Jacopo Cappellato
In reply to this post by Jacopo Cappellato
Jim,

you can use the following recirsive method as an example:

org.ofbiz.accounting.util.UtilAccounting.isAccountClassClass(...)

Feel free to submit a patch (for review) when you need it.

Jacopo


Jacopo Cappellato wrote:

> We will probably need a recursive method/service to do this. The method
> can simply return a List of glAccountId strings. Its input will be the
> Account Class and organizationPartyId.
> The method can be implemented in the
> org.ofbiz.accounting.util.UtilAccounting class
>
> Then the returned List object can then easily be used to compose an
> entity condition object for queries.
>
> Jacopo
>
>
> Jim Barrows wrote:
>> Oh, I just need to create an income statement, so I need all the
>> accounts that have an account class that inherits from Income, and the
>> same thing for Expense, Assets, and Liabilities :)
>> I was hoping for something less code intensive :)  Ah well... :)
>>
>> On Dec 9, 2007 9:30 PM, Hans Bakker <[hidden email]>
>> wrote:
>>> It depends what you want to do with the result...
>>> If on screen in an ftl look at the 'cms' option of a website or the
>>> navigate option under dataresource in the content component.
>>>
>>> If you want it in Java or Bsh create a recursive function to get the
>>> childs or parents of a record. Look at the WorkEffortChild and
>>> WorkEffortParent relationships for an example.
>>>
>>> Regards, Hans
>>>
>>> On Sun, 2007-12-09 at 20:16 -0700, Jim Barrows wrote:
>>>> IE I want the Income type, and it's children, and it's children, etc.
>>>> I'm hoping we've done this before, and I don't have to pioneer
>>>> anything :)
>>>>
>>> --
>>> http://Antwebsystems.com : OFBiz Quality support for competitive rates.
>>>
>>>
>>>
>>>
>>
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: Looking for example of how to grab a parent entity and it's children

Jacopo Cappellato
I've created two tasks to keep track of this effort:

https://issues.apache.org/jira/browse/OFBIZ-1501

https://issues.apache.org/jira/browse/OFBIZ-1502

Jacopo


Jacopo Cappellato wrote:

> Jim,
>
> you can use the following recirsive method as an example:
>
> org.ofbiz.accounting.util.UtilAccounting.isAccountClassClass(...)
>
> Feel free to submit a patch (for review) when you need it.
>
> Jacopo
>
>
> Jacopo Cappellato wrote:
>> We will probably need a recursive method/service to do this. The
>> method can simply return a List of glAccountId strings. Its input will
>> be the Account Class and organizationPartyId.
>> The method can be implemented in the
>> org.ofbiz.accounting.util.UtilAccounting class
>>
>> Then the returned List object can then easily be used to compose an
>> entity condition object for queries.
>>
>> Jacopo
>>
>>
>> Jim Barrows wrote:
>>> Oh, I just need to create an income statement, so I need all the
>>> accounts that have an account class that inherits from Income, and the
>>> same thing for Expense, Assets, and Liabilities :)
>>> I was hoping for something less code intensive :)  Ah well... :)
>>>
>>> On Dec 9, 2007 9:30 PM, Hans Bakker <[hidden email]>
>>> wrote:
>>>> It depends what you want to do with the result...
>>>> If on screen in an ftl look at the 'cms' option of a website or the
>>>> navigate option under dataresource in the content component.
>>>>
>>>> If you want it in Java or Bsh create a recursive function to get the
>>>> childs or parents of a record. Look at the WorkEffortChild and
>>>> WorkEffortParent relationships for an example.
>>>>
>>>> Regards, Hans
>>>>
>>>> On Sun, 2007-12-09 at 20:16 -0700, Jim Barrows wrote:
>>>>> IE I want the Income type, and it's children, and it's children, etc.
>>>>> I'm hoping we've done this before, and I don't have to pioneer
>>>>> anything :)
>>>>>
>>>> --
>>>> http://Antwebsystems.com : OFBiz Quality support for competitive rates.
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: Looking for example of how to grab a parent entity and it's children

Jim Barrows
In reply to this post by Jacopo Cappellato
That's pretty much my plan.   Start with the basics, and then pretty
it up later.

On Dec 9, 2007 10:59 PM, Jacopo Cappellato <[hidden email]> wrote:

> Jim,
>
> if you are starting the implementation of the incoming statement and
> balance sheet reports (that would be great), I'd strongly recommend that
> the first version of them would be in html (screen widget + form widget
> or ftl and bsh). We can then add to it other variants implemented with
> other tools (e.g. JasperReports).
> If you need help to play with ftl or form/screen widget code we can
> help... you may start with the implementation of the bsh script to
> gather the data for the report, then we can think about the best way to
> represent them (ftl or form widget).
>
> What do you think?
>
> Jacopo
>
>
>
> Jim Barrows wrote:
> > Oh, I just need to create an income statement, so I need all the
> > accounts that have an account class that inherits from Income, and the
> > same thing for Expense, Assets, and Liabilities :)
> > I was hoping for something less code intensive :)  Ah well... :)
> >
> > On Dec 9, 2007 9:30 PM, Hans Bakker <[hidden email]> wrote:
> >> It depends what you want to do with the result...
> >> If on screen in an ftl look at the 'cms' option of a website or the
> >> navigate option under dataresource in the content component.
> >>
> >> If you want it in Java or Bsh create a recursive function to get the
> >> childs or parents of a record. Look at the WorkEffortChild and
> >> WorkEffortParent relationships for an example.
> >>
> >> Regards, Hans
> >>
> >> On Sun, 2007-12-09 at 20:16 -0700, Jim Barrows wrote:
> >>> IE I want the Income type, and it's children, and it's children, etc.
> >>> I'm hoping we've done this before, and I don't have to pioneer anything :)
> >>>
> >> --
> >> http://Antwebsystems.com : OFBiz Quality support for competitive rates.
> >>
> >>
> >>
> >>
> >
> >
> >
>
>
>



--
James A Barrows