You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by zhiyongcui <zh...@gmail.com> on 2011/05/24 11:53:38 UTC
about view-entity
How to implement sql as below with view-entity definition.
select PRODUCT_ID,FACILITY_ID,LOCATION_SEQ_ID, SUM(case when
LOCATION_SEQ_ID='A' then QUANTITY_OH_HAND_TOTAL else 0 end) AS QTY1,
SUM(case when LOCATION_SEQ_ID='b' then QUANTITY_OH_HAND_TOTAL else 0 end) AS
QTY2 from inventory_item where PRODUCT_ID in (select PRODUCT_ID from Product
where PRODUCT_TYPE_ID='FINISHED_GOOD') GROUP BY PRODUCT_ID,LOCATION_SEQ_ID
--
View this message in context: http://ofbiz.135035.n4.nabble.com/about-view-entity-tp3546616p3546616.html
Sent from the OFBiz - User mailing list archive at Nabble.com.
Re: about view-entity
Posted by Brajesh Patel <br...@hotwaxmedia.com>.
hi,
Following view-entity will help you because there some aggregate function is used in side of this entity also there is the use of group by clause.
<view-entity entity-name="
OrderHeaderAndRoleSummary"
package-name="org.ofbiz.order.order"
never-cache="true"
title="Order Header And Roles View Entity">
<member-entity entity-alias="ORLE" entity-name="OrderRole"/>
<member-entity entity-alias="OH" entity-name="OrderHeader"/>
<alias entity-alias="ORLE" name="partyId" group-by="true"/>
<alias entity-alias="ORLE" name="roleTypeId" group-by="true"/>
<alias entity-alias="OH" name="orderId"/>
<alias entity-alias="OH" name="orderTypeId"/>
<alias entity-alias="OH" name="orderDate"/>
<alias entity-alias="OH" name="statusId"/>
<alias entity-alias="OH" name="totalGrandAmount" field="grandTotal" function="sum"/>
<alias entity-alias="OH" name="totalSubRemainingAmount" field="remainingSubTotal" function="sum"/>
<alias entity-alias="OH" name="totalOrders" field="orderId" function="count"/>
<view-link entity-alias="ORLE" rel-entity-alias="OH">
<key-map field-name="orderId"/>
</view-link>
</view-entity>
--
Brajesh
On 24-May-2011, at 3:23 PM, zhiyongcui wrote:
> How to implement sql as below with view-entity definition.
>
> select PRODUCT_ID,FACILITY_ID,LOCATION_SEQ_ID, SUM(case when
> LOCATION_SEQ_ID='A' then QUANTITY_OH_HAND_TOTAL else 0 end) AS QTY1,
> SUM(case when LOCATION_SEQ_ID='b' then QUANTITY_OH_HAND_TOTAL else 0 end) AS
> QTY2 from inventory_item where PRODUCT_ID in (select PRODUCT_ID from Product
> where PRODUCT_TYPE_ID='FINISHED_GOOD') GROUP BY PRODUCT_ID,LOCATION_SEQ_ID
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/about-view-entity-tp3546616p3546616.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
My Portal - Menus
Posted by Paul Ray <sa...@gmail.com>.
Hi Community,
I have a strange situation and at this time out of my wits to figure
this out.
Essentially wanted a MYPORTAL_CONSULTANT profile similar to
MYPORTAL_EMPLOYEE . Instead of editing the MYPORTAL_EMPLOYEE or any of
the default Portal Pages, decided to create a new set with Portal Page
data and linking to PortalPagePortlet. Also created a new security group
to link up and everything else required and I am able to see the
consultant portal pages with the defined menu items.
The problem is intermittent in some cases where the menu items don't
show up except for the default main and preferences. On a few setups
the menu items just don't show up.
Digging through the code figured that the method renderMenuItemString of
ModelMenuItem.java is not getting called in all cases where the menu
does not show up. Working backwards from there, thought would be able to
trap what is going wrong but no luck so far. Hence this note to see if
anyone as any suggestions. Note that the default MYPORTAL_EMPLOYEE
though works fine.
Thanks in advance
Ray