Author: jaz
Date: Tue May 15 13:05:57 2007 New Revision: 538299 URL: http://svn.apache.org/viewvc?view=rev&rev=538299 Log: added find by owner of inventory item Modified: ofbiz/trunk/applications/party/servicedef/services_view.xml ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java Modified: ofbiz/trunk/applications/party/servicedef/services_view.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services_view.xml?view=diff&rev=538299&r1=538298&r2=538299 ============================================================================== --- ofbiz/trunk/applications/party/servicedef/services_view.xml (original) +++ ofbiz/trunk/applications/party/servicedef/services_view.xml Tue May 15 13:05:57 2007 @@ -48,6 +48,9 @@ <attribute name="countryCode" type="String" mode="IN" optional="true"/> <attribute name="areaCode" type="String" mode="IN" optional="true"/> <attribute name="contactNumber" type="String" mode="IN" optional="true"/> + <attribute name="inventoryItemId" type="String" mode="IN" optional="true"/> <!-- does a LIKE compare on this --> + <attribute name="serialNumber" type="String" mode="IN" optional="true"/> <!-- does a LIKE compare on this --> + <attribute name="softIdentifier" type="String" mode="IN" optional="true"/> <!-- does a LIKE compare on this --> <attribute name="roleTypes" type="List" mode="OUT" optional="false"/> <attribute name="currentRole" type="org.ofbiz.entity.GenericValue" mode="OUT" optional="true"/> Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java?view=diff&rev=538299&r1=538298&r2=538299 ============================================================================== --- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java (original) +++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java Tue May 15 13:05:57 2007 @@ -1158,6 +1158,45 @@ } // ---- + // InventoryItem Fields + // ---- + + // filter on inventory item's fields + String inventoryItemId = (String) context.get("inventoryItemId"); + String serialNumber = (String) context.get("serialNumber"); + String softIdentifier = (String) context.get("softIdentifier"); + if (UtilValidate.isNotEmpty(inventoryItemId) || + UtilValidate.isNotEmpty(serialNumber) || + UtilValidate.isNotEmpty(softIdentifier)) { + + // add role to view + dynamicView.addMemberEntity("II", "InventoryItem"); + dynamicView.addAlias("II", "ownerPartyId"); + dynamicView.addViewLink("PT", "II", Boolean.FALSE, ModelKeyMap.makeKeyMapList("partyId", "ownerPartyId")); + } + if (UtilValidate.isNotEmpty(inventoryItemId)) { + paramList = paramList + "&inventoryItemId=" + inventoryItemId; + dynamicView.addAlias("II", "inventoryItemId"); + // add the expr + andExprs.add(new EntityExpr("inventoryItemId", true, EntityOperator.LIKE, "%" + inventoryItemId + "%", true)); + fieldsToSelect.add("inventoryItemId"); + } + if (UtilValidate.isNotEmpty(serialNumber)) { + paramList = paramList + "&serialNumber=" + serialNumber; + dynamicView.addAlias("II", "serialNumber"); + // add the expr + andExprs.add(new EntityExpr("serialNumber", true, EntityOperator.LIKE, "%" + serialNumber + "%", true)); + fieldsToSelect.add("serialNumber"); + } + if (UtilValidate.isNotEmpty(softIdentifier)) { + paramList = paramList + "&softIdentifier=" + softIdentifier; + dynamicView.addAlias("II", "softIdentifier"); + // add the expr + andExprs.add(new EntityExpr("softIdentifier", true, EntityOperator.LIKE, "%" + softIdentifier + "%", true)); + fieldsToSelect.add("softIdentifier"); + } + + // ---- // PostalAddress fields // ---- if ("P".equals(extInfo)) { |
Free forum by Nabble | Edit this page |