Steps regenerate error: 1) Hit url: https://localhost:8443/ordermgr/control/orderentry 2) Select purchase order with supplier 3) Add product for order 4) Click on the productId from showcart page it will generate error as following org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen component://order/widget/ordermgr/OrderEntryCatalogScreens.xml#productdetail: java.lang.NullPointerException: Cannot get property 'productStoreId' on null object (Cannot get property 'productStoreId' on null object) Notes from Mridul: As Joe has already stated that we need to do few adjustments in the code based on presence of productStoreId. I would vote for: 1. Showing all reviews. 2. Skipping surveys. The third section, which is the most important one and needs productStoreId is getProductVariantTree service invoked in ProductDetail.groovy (line 232). getProductVariantTree service needs productStoreId to get available inventory. In case of PO's we don't need to check for available inventory at all. Now for being able to use the same code to display product detail page in case of a PO, we will need to make modifications to getProductVariantTree service too, which can be done in two ways: 1. Add a boolean IN attribute checkInventory to service definition, if its true check the available inventory and if false do not. 2. A check on productStoreId in the implementation can serve our purpose too. I like #1 more as it won't eliminate importance of productStoreId in case of a sales order. Looking forward to suggestions from community to handle this situation. Thanks Amit for the contribution. Mridul Thanks a lot for providing useful notes for the implementation. Guys, I appreciate your coordination on this! git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@882618 13f79535-47bb-0310-9956-ffa450edef68
151 lines
10 KiB
XML
151 lines
10 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<!--
|
|
Licensed to the Apache Software Foundation (ASF) under one
|
|
or more contributor license agreements. See the NOTICE file
|
|
distributed with this work for additional information
|
|
regarding copyright ownership. The ASF licenses this file
|
|
to you under the Apache License, Version 2.0 (the
|
|
"License"); you may not use this file except in compliance
|
|
with the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing,
|
|
software distributed under the License is distributed on an
|
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, either express or implied. See the License for the
|
|
specific language governing permissions and limitations
|
|
under the License.
|
|
-->
|
|
|
|
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
|
|
<description>Product Component Maintenance Services</description>
|
|
<vendor>OFBiz</vendor>
|
|
<version>1.0</version>
|
|
|
|
<!-- Product View Services -->
|
|
<service name="getProduct" engine="java"
|
|
location="org.ofbiz.product.product.ProductServices" invoke="prodFindProduct">
|
|
<description>Gets a product value object.</description>
|
|
<attribute name="productId" type="String" mode="IN"/>
|
|
<attribute name="product" type="org.ofbiz.entity.GenericValue" mode="OUT"/>
|
|
</service>
|
|
<service name="getProductVariant" engine="java"
|
|
location="org.ofbiz.product.product.ProductServices" invoke="prodFindSelectedVariant">
|
|
<description>Gets a list of variant product value objects.</description>
|
|
<attribute name="productId" type="String" mode="IN"/>
|
|
<attribute name="selectedFeatures" type="java.util.Map" mode="IN"/>
|
|
<attribute name="products" type="java.util.List" mode="OUT"/>
|
|
</service>
|
|
<service name="getProductFeatureSet" engine="java"
|
|
location="org.ofbiz.product.product.ProductServices" invoke="prodFindFeatureTypes">
|
|
<description>Gets a Set of product features (distinct)</description>
|
|
<attribute name="productId" type="String" mode="IN"/>
|
|
<attribute name="productFeatureApplTypeId" type="String" mode="IN" optional="true"/>
|
|
<attribute name="featureSet" type="java.util.Set" mode="OUT"/>
|
|
</service>
|
|
<service name="getProductVariantTree" engine="java"
|
|
location="org.ofbiz.product.product.ProductServices" invoke="prodMakeFeatureTree">
|
|
<description>Gets a tree of product variants based on a virtual product and a list of features.</description>
|
|
<attribute name="productId" type="String" mode="IN"/>
|
|
<attribute name="featureOrder" type="java.util.Collection" mode="IN"/>
|
|
<attribute name="productStoreId" type="String" mode="IN" optional="true"/>
|
|
<attribute name="checkInventory" type="Boolean" mode="IN" default-value="true" optional="true"/>
|
|
<attribute name="variantTree" type="java.util.Map" mode="OUT" optional="true"/>
|
|
<attribute name="variantSample" type="java.util.Map" mode="OUT" optional="true"/>
|
|
<attribute name="virtualVariant" type="java.util.List" mode="OUT" optional="true"/>
|
|
</service>
|
|
<service name="getAllProductVariants" engine="java"
|
|
location="org.ofbiz.product.product.ProductServices" invoke="prodFindAllVariants">
|
|
<description>Gets a Collection of products from a 'virtual' parent product.</description>
|
|
<attribute name="productId" type="String" mode="IN"/>
|
|
<attribute name="assocProducts" type="java.util.Collection" mode="OUT"/>
|
|
</service>
|
|
<service name="getAssociatedProducts" engine="java"
|
|
location="org.ofbiz.product.product.ProductServices" invoke="prodFindAssociatedByType">
|
|
<description>
|
|
Finds associated products by the defined type. Only one of either productId or productIdTo can be supplied,
|
|
not both. If bidirectional is set to true then the passed in productId will be treated as both a productId
|
|
and a productIdTo (defaults to false). If sortDescending is true then assocProducts will be returned sorted
|
|
by sequenceNum descending (defaults to false).
|
|
</description>
|
|
<attribute name="productId" type="String" mode="IN" optional="true"/>
|
|
<attribute name="productIdTo" type="String" mode="IN" optional="true"/>
|
|
<attribute name="checkViewAllow" type="Boolean" mode="IN" optional="true"/>
|
|
<attribute name="prodCatalogId" type="String" mode="IN" optional="true"/>
|
|
<attribute name="type" type="String" mode="IN"/>
|
|
<attribute name="bidirectional" type="Boolean" mode="IN" optional="true"/>
|
|
<attribute name="sortDescending" type="Boolean" mode="IN" optional="true"/>
|
|
<attribute name="assocProducts" type="java.util.Collection" mode="OUT" optional="true"/>
|
|
</service>
|
|
<service name="getProductFeatures" engine="java"
|
|
location="org.ofbiz.product.product.ProductServices" invoke="prodGetFeatures">
|
|
<description>Gets a Collection of product features (ProductFeatureAndAppl) for a product.</description>
|
|
<attribute name="productId" type="String" mode="IN"/>
|
|
<attribute name="type" type="String" mode="IN" optional="true"/>
|
|
<attribute name="distinct" type="String" mode="IN" optional="true"/>
|
|
<attribute name="productFeatures" type="java.util.Collection" mode="OUT"/>
|
|
</service>
|
|
<service name="getSuppliersForProduct" engine="java"
|
|
location="org.ofbiz.product.supplier.SupplierProductServices" invoke="getSuppliersForProduct">
|
|
<description>Finds a list of SupplierProduct entities based on either a product or, if not provided, at least a productId.
|
|
If partyId and currencyUomId are given, they are used to filter the list down. Note that productId is REQUIRED, even if you are passing in a product entity.</description>
|
|
<attribute name="productId" type="String" mode="IN" optional="false"/>
|
|
<attribute name="partyId" type="String" mode="IN" optional="true"/>
|
|
<attribute name="currencyUomId" type="String" mode="IN" optional="true"/>
|
|
<attribute name="quantity" type="BigDecimal" mode="IN" optional="true"/>
|
|
<attribute name="canDropShip" type="String" mode="IN" optional="true"/>
|
|
<attribute name="supplierProducts" type="java.util.List" mode="OUT" optional="false"/>
|
|
</service>
|
|
<service name="convertFeaturesForSupplier" engine="java"
|
|
location = "org.ofbiz.product.supplier.SupplierProductServices" invoke="convertFeaturesForSupplier">
|
|
<description>Takes a list of product feature (either ProductFeature or ProductFeatureAndAppl) and converts
|
|
each one for the supplier specified by partyId, changing the description and idCode</description>
|
|
<attribute type="java.util.Collection" mode="IN" name="productFeatures" optional="false"/>
|
|
<attribute type="String" mode="IN" name="partyId" optional="false"/>
|
|
<attribute type="java.util.Collection" mode="OUT" name="convertedProductFeatures"/>
|
|
</service>
|
|
|
|
<!-- Category View Services -->
|
|
<service name="getProductCategoryMembers" engine="java"
|
|
location="org.ofbiz.product.category.CategoryServices" invoke="getCategoryMembers">
|
|
<description>Gets ProductCategoryMembers for the category_id</description>
|
|
<attribute name="categoryId" type="String" mode="IN"/>
|
|
<attribute name="category" type="org.ofbiz.entity.GenericValue" mode="OUT"/>
|
|
<attribute name="categoryMembers" type="java.util.Collection" mode="OUT"/>
|
|
</service>
|
|
<service name="getPreviousNextProducts" engine="java"
|
|
location="org.ofbiz.product.category.CategoryServices" invoke="getPreviousNextProducts">
|
|
<description>Gets the previous and next product Ids.</description>
|
|
<attribute name="categoryId" type="String" mode="IN"/>
|
|
<attribute name="productId" type="String" mode="IN"/>
|
|
<attribute name="activeOnly" type="Boolean" mode="IN" optional="true"/>
|
|
<attribute name="orderByFields" type="List" mode="IN" optional="true"/>
|
|
<attribute name="category" type="org.ofbiz.entity.GenericValue" mode="OUT" optional="true"/>
|
|
<attribute name="previousProductId" type="String" mode="OUT" optional="true"/>
|
|
<attribute name="nextProductId" type="String" mode="OUT" optional="true"/>
|
|
</service>
|
|
<service name="getProductCategoryAndLimitedMembers" engine="java"
|
|
location="org.ofbiz.product.category.CategoryServices" invoke="getProductCategoryAndLimitedMembers">
|
|
<description>Gets a productCategory and a Collection of associated productCategoryMembers and calculates limiting parameters</description>
|
|
<attribute name="productCategoryId" type="String" mode="IN" optional="false"/>
|
|
<attribute name="prodCatalogId" type="String" mode="IN" optional="true"/>
|
|
<attribute name="defaultViewSize" type="Integer" mode="IN" optional="false"/>
|
|
<attribute name="limitView" type="Boolean" mode="IN" optional="false"/>
|
|
<attribute name="checkViewAllow" type="Boolean" mode="IN" optional="true"/>
|
|
<attribute name="viewIndexString" type="String" mode="IN" optional="true"/>
|
|
<attribute name="viewSizeString" type="String" mode="IN" optional="true"/>
|
|
<attribute name="useCacheForMembers" type="Boolean" mode="IN" optional="true"/>
|
|
<attribute name="activeOnly" type="Boolean" mode="IN" optional="true"/>
|
|
<attribute name="orderByFields" type="List" mode="IN" optional="true"/>
|
|
<attribute name="productCategory" type="org.ofbiz.entity.GenericValue" mode="OUT" optional="true"/>
|
|
<attribute name="productCategoryMembers" type="java.util.Collection" mode="OUT" optional="true"/> <!-- this list will only contain the limited members if limitView=true -->
|
|
<attribute name="viewIndex" type="Integer" mode="OUT" optional="false"/> <!-- this is a 1 based index, ie the first results are in index 1 -->
|
|
<attribute name="viewSize" type="Integer" mode="OUT" optional="false"/>
|
|
<attribute name="lowIndex" type="Integer" mode="OUT" optional="false"/>
|
|
<attribute name="highIndex" type="Integer" mode="OUT" optional="false"/>
|
|
<attribute name="listSize" type="Integer" mode="OUT" optional="false"/>
|
|
</service>
|
|
</services>
|