Product/Inventory Import


#1

I have tried a few things but I am a compete novice at xml.

How can I import my product listing? I created 2 items and exported 'Product" and added an additional incremented the ID # and them imported back in to test but I get errors and the item is not added.

Ideally I would like to import the 2000+ items with cost, retail pricing, and promotional pricing all at once.

Errors depending on options selected on import screen:
image

The Following Errors Occurred:

1. ERROR: parsing file: ERROR parsing Entity Xml file: org.xml.sax.SAXException: A transaction error occurred reading data
org.ofbiz.entity.GenericEntityException: org.ofbiz.entity.GenericEntityException: org.ofbiz.entity.GenericEntityException: Error while inserting: [GenericEntity:Product][productId,OEMQT-CA(java.lang.String)][productTypeId,FINISHED_GOOD(java.lang.String)][primaryProductCategoryId,10002(java.lang.String)][manufacturerPartyId,null()][facilityId,null()][introductionDate,2018-11-14 15:50:37.0(java.sql.Timestamp)][releaseDate,2018-11-14 15:50:43.0(java.sql.Timestamp)][supportDiscontinuationDate,null()][salesDiscontinuationDate,null()][salesDiscWhenNotAvail,N(java.lang.String)][internalName,OEMQT-CA(java.lang.String)][brandName,AMSOIL(java.lang.String)][comments,OE 5W-20 Synthetic Motor Oil Case(java.lang.String)][productName,OEMQT-CA(java.lang.String)][description,null()][longDescription,null()][priceDetailText,null()][smallImageUrl,null()][mediumImageUrl,null()][largeImageUrl,null()][detailImageUrl,null()][originalImageUrl,null()][detailScreen,null()][inventoryMessage,null()][inventoryItemTypeId,NON_SERIAL_INV_ITEM(java.lang.String)][requireInventory,Y(java.lang.String)][quantityUomId,OTH_ea(java.lang.String)][quantityIncluded,1.000000(java.math.BigDecimal)][piecesIncluded,1(java.lang.Long)][requireAmount,N(java.lang.String)][fixedAmount,null()][amountUomTypeId,null()][weightUomId,WT_lb(java.lang.String)][weight,null()][productWeight,24.00000(java.math.BigDecimal)][heightUomId,null()][productHeight,null()][shippingHeight,null()][widthUomId,null()][productWidth,null()][shippingWidth,null()][depthUomId,null()][productDepth,null()][shippingDepth,null()][diameterUomId,null()][productDiameter,null()][productRating,null()][ratingTypeEnum,null()][returnable,Y(java.lang.String)][taxable,Y(java.lang.String)][chargeShipping,N(java.lang.String)][autoCreateKeywords,null()][includeInPromotions,N(java.lang.String)][isVirtual,N(java.lang.String)][isVariant,N(java.lang.String)][virtualVariantMethodEnum,null()][originGeoId,null()][requirementMethodEnumId,null()][billOfMaterialLevel,0(java.lang.Long)][reservMaxPersons,null()][reserv2ndPPPerc,null()][reservNthPPPerc,null()][configId,null()][createdDate,2018-11-14 21:51:52.357(java.sql.Timestamp)][createdByUserLogin,admin(java.lang.String)][lastModifiedDate,2018-11-14 21:51:52.357(java.sql.Timestamp)][lastModifiedByUserLogin,admin(java.lang.String)][inShippingBox,N(java.lang.String)][defaultShipmentBoxTypeId,null()][lotIdFilledIn,Forbidden(java.lang.String)][orderDecimalQuantity,N(java.lang.String)][lastUpdatedStamp,2018-11-15 02:59:04.01(java.sql.Timestamp)][lastUpdatedTxStamp,2018-11-15 02:59:04.008(java.sql.Timestamp)][createdStamp,2018-11-15 02:59:04.01(java.sql.Timestamp)][createdTxStamp,2018-11-15 02:59:04.008(java.sql.Timestamp)] (SQL Exception while executing the following:INSERT INTO OFBIZ.PRODUCT (PRODUCT_ID, PRODUCT_TYPE_ID, PRIMARY_PRODUCT_CATEGORY_ID, MANUFACTURER_PARTY_ID, FACILITY_ID, INTRODUCTION_DATE, RELEASE_DATE, SUPPORT_DISCONTINUATION_DATE, SALES_DISCONTINUATION_DATE, SALES_DISC_WHEN_NOT_AVAIL, INTERNAL_NAME, BRAND_NAME, COMMENTS, PRODUCT_NAME, DESCRIPTION, LONG_DESCRIPTION, PRICE_DETAIL_TEXT, SMALL_IMAGE_URL, MEDIUM_IMAGE_URL, LARGE_IMAGE_URL, DETAIL_IMAGE_URL, ORIGINAL_IMAGE_URL, DETAIL_SCREEN, INVENTORY_MESSAGE, INVENTORY_ITEM_TYPE_ID, REQUIRE_INVENTORY, QUANTITY_UOM_ID, QUANTITY_INCLUDED, PIECES_INCLUDED, REQUIRE_AMOUNT, FIXED_AMOUNT, AMOUNT_UOM_TYPE_ID, WEIGHT_UOM_ID, WEIGHT, PRODUCT_WEIGHT, HEIGHT_UOM_ID, PRODUCT_HEIGHT, SHIPPING_HEIGHT, WIDTH_UOM_ID, PRODUCT_WIDTH, SHIPPING_WIDTH, DEPTH_UOM_ID, PRODUCT_DEPTH, SHIPPING_DEPTH, DIAMETER_UOM_ID, PRODUCT_DIAMETER, PRODUCT_RATING, RATING_TYPE_ENUM, RETURNABLE, TAXABLE, CHARGE_SHIPPING, AUTO_CREATE_KEYWORDS, INCLUDE_IN_PROMOTIONS, IS_VIRTUAL, IS_VARIANT, VIRTUAL_VARIANT_METHOD_ENUM, ORIGIN_GEO_ID, REQUIREMENT_METHOD_ENUM_ID, BILL_OF_MATERIAL_LEVEL, RESERV_MAX_PERSONS, RESERV2ND_P_P_PERC, RESERV_NTH_P_P_PERC, CONFIG_ID, CREATED_DATE, CREATED_BY_USER_LOGIN, LAST_MODIFIED_DATE, LAST_MODIFIED_BY_USER_LOGIN, IN_SHIPPING_BOX, DEFAULT_SHIPMENT_BOX_TYPE_ID, LOT_ID_FILLED_IN, ORDER_DECIMAL_QUANTITY, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (INSERT on table 'PRODUCT' caused a violation of foreign key constraint 'PROD_PRIMARY_CAT' for key (10002). The statement has been rolled back.)) (Error while inserting: [GenericEntity:Product][productId,OEMQT-CA(java.lang.String)][productTypeId,FINISHED_GOOD(java.lang.String)][primaryProductCategoryId,10002(java.lang.String)][manufacturerPartyId,null()][facilityId,null()][introductionDate,2018-11-14 15:50:37.0(java.sql.Timestamp)][releaseDate,2018-11-14 15:50:43.0(java.sql.Timestamp)][supportDiscontinuationDate,null()][salesDiscontinuationDate,null()][salesDiscWhenNotAvail,N(java.lang.String)][internalName,OEMQT-CA(java.lang.String)][brandName,AMSOIL(java.lang.String)][comments,OE 5W-20 Synthetic Motor Oil Case(java.lang.String)][productName,OEMQT-CA(java.lang.String)][description,null()][longDescription,null()][priceDetailText,null()][smallImageUrl,null()][mediumImageUrl,null()][largeImageUrl,null()][detailImageUrl,null()][originalImageUrl,null()][detailScreen,null()][inventoryMessage,null()][inventoryItemTypeId,NON_SERIAL_INV_ITEM(java.lang.String)][requireInventory,Y(java.lang.String)][quantityUomId,OTH_ea(java.lang.String)][quantityIncluded,1.000000(java.math.BigDecimal)][piecesIncluded,1(java.lang.Long)][requireAmount,N(java.lang.String)][fixedAmount,null()][amountUomTypeId,null()][weightUomId,WT_lb(java.lang.String)][weight,null()][productWeight,24.00000(java.math.BigDecimal)][heightUomId,null()][productHeight,null()][shippingHeight,null()][widthUomId,null()][productWidth,null()][shippingWidth,null()][depthUomId,null()][productDepth,null()][shippingDepth,null()][diameterUomId,null()][productDiameter,null()][productRating,null()][ratingTypeEnum,null()][returnable,Y(java.lang.String)][taxable,Y(java.lang.String)][chargeShipping,N(java.lang.String)][autoCreateKeywords,null()][includeInPromotions,N(java.lang.String)][isVirtual,N(java.lang.String)][isVariant,N(java.lang.String)][virtualVariantMethodEnum,null()][originGeoId,null()][requirementMethodEnumId,null()][billOfMaterialLevel,0(java.lang.Long)][reservMaxPersons,null()][reserv2ndPPPerc,null()][reservNthPPPerc,null()][configId,null()][createdDate,2018-11-14 21:51:52.357(java.sql.Timestamp)][createdByUserLogin,admin(java.lang.String)][lastModifiedDate,2018-11-14 21:51:52.357(java.sql.Timestamp)][lastModifiedByUserLogin,admin(java.lang.String)][inShippingBox,N(java.lang.String)][defaultShipmentBoxTypeId,null()][lotIdFilledIn,Forbidden(java.lang.String)][orderDecimalQuantity,N(java.lang.String)][lastUpdatedStamp,2018-11-15 02:59:04.01(java.sql.Timestamp)][lastUpdatedTxStamp,2018-11-15 02:59:04.008(java.sql.Timestamp)][createdStamp,2018-11-15 02:59:04.01(java.sql.Timestamp)][createdTxStamp,2018-11-15 02:59:04.008(java.sql.Timestamp)] (SQL Exception while executing the following:INSERT INTO OFBIZ.PRODUCT (PRODUCT_ID, PRODUCT_TYPE_ID, PRIMARY_PRODUCT_CATEGORY_ID, MANUFACTURER_PARTY_ID, FACILITY_ID, INTRODUCTION_DATE, RELEASE_DATE, SUPPORT_DISCONTINUATION_DATE, SALES_DISCONTINUATION_DATE, SALES_DISC_WHEN_NOT_AVAIL, INTERNAL_NAME, BRAND_NAME, COMMENTS, PRODUCT_NAME, DESCRIPTION, LONG_DESCRIPTION, PRICE_DETAIL_TEXT, SMALL_IMAGE_URL, MEDIUM_IMAGE_URL, LARGE_IMAGE_URL, DETAIL_IMAGE_URL, ORIGINAL_IMAGE_URL, DETAIL_SCREEN, INVENTORY_MESSAGE, INVENTORY_ITEM_TYPE_ID, REQUIRE_INVENTORY, QUANTITY_UOM_ID, QUANTITY_INCLUDED, PIECES_INCLUDED, REQUIRE_AMOUNT, FIXED_AMOUNT, AMOUNT_UOM_TYPE_ID, WEIGHT_UOM_ID, WEIGHT, PRODUCT_WEIGHT, HEIGHT_UOM_ID, PRODUCT_HEIGHT, SHIPPING_HEIGHT, WIDTH_UOM_ID, PRODUCT_WIDTH, SHIPPING_WIDTH, DEPTH_UOM_ID, PRODUCT_DEPTH, SHIPPING_DEPTH, DIAMETER_UOM_ID, PRODUCT_DIAMETER, PRODUCT_RATING, RATING_TYPE_ENUM, RETURNABLE, TAXABLE, CHARGE_SHIPPING, AUTO_CREATE_KEYWORDS, INCLUDE_IN_PROMOTIONS, IS_VIRTUAL, IS_VARIANT, VIRTUAL_VARIANT_METHOD_ENUM, ORIGIN_GEO_ID, REQUIREMENT_METHOD_ENUM_ID, BILL_OF_MATERIAL_LEVEL, RESERV_MAX_PERSONS, RESERV2ND_P_P_PERC, RESERV_NTH_P_P_PERC, CONFIG_ID, CREATED_DATE, CREATED_BY_USER_LOGIN, LAST_MODIFIED_DATE, LAST_MODIFIED_BY_USER_LOGIN, IN_SHIPPING_BOX, DEFAULT_SHIPMENT_BOX_TYPE_ID, LOT_ID_FILLED_IN, ORDER_DECIMAL_QUANTITY, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (INSERT on table 'PRODUCT' caused a violation of foreign key constraint 'PROD_PRIMARY_CAT' for key (10002). The statement has been rolled back.))) (org.ofbiz.entity.GenericEntityException: Error while inserting: [GenericEntity:Product][productId,OEMQT-CA(java.lang.String)][productTypeId,FINISHED_GOOD(java.lang.String)][primaryProductCategoryId,10002(java.lang.String)][manufacturerPartyId,null()][facilityId,null()][introductionDate,2018-11-14 15:50:37.0(java.sql.Timestamp)][releaseDate,2018-11-14 15:50:43.0(java.sql.Timestamp)][supportDiscontinuationDate,null()][salesDiscontinuationDate,null()][salesDiscWhenNotAvail,N(java.lang.String)][internalName,OEMQT-CA(java.lang.String)][brandName,AMSOIL(java.lang.String)][comments,OE 5W-20 Synthetic Motor Oil Case(java.lang.String)][productName,OEMQT-CA(java.lang.String)][description,null()][longDescription,null()][priceDetailText,null()][smallImageUrl,null()][mediumImageUrl,null()][largeImageUrl,null()][detailImageUrl,null()][originalImageUrl,null()][detailScreen,null()][inventoryMessage,null()][inventoryItemTypeId,NON_SERIAL_INV_ITEM(java.lang.String)][requireInventory,Y(java.lang.String)][quantityUomId,OTH_ea(java.lang.String)][quantityIncluded,1.000000(java.math.BigDecimal)][piecesIncluded,1(java.lang.Long)][requireAmount,N(java.lang.String)][fixedAmount,null()][amountUomTypeId,null()][weightUomId,WT_lb(java.lang.String)][weight,null()][productWeight,24.00000(java.math.BigDecimal)][heightUomId,null()][productHeight,null()][shippingHeight,null()][widthUomId,null()][productWidth,null()][shippingWidth,null()][depthUomId,null()][productDepth,null()][shippingDepth,null()][diameterUomId,null()][productDiameter,null()][productRating,null()][ratingTypeEnum,null()][returnable,Y(java.lang.String)][taxable,Y(java.lang.String)][chargeShipping,N(java.lang.String)][autoCreateKeywords,null()][includeInPromotions,N(java.lang.String)][isVirtual,N(java.lang.String)][isVariant,N(java.lang.String)][virtualVariantMethodEnum,null()][originGeoId,null()][requirementMethodEnumId,null()][billOfMaterialLevel,0(java.lang.Long)][reservMaxPersons,null()][reserv2ndPPPerc,null()][reservNthPPPerc,null()][configId,null()][createdDate,2018-11-14 21:51:52.357(java.sql.Timestamp)][createdByUserLogin,admin(java.lang.String)][lastModifiedDate,2018-11-14 21:51:52.357(java.sql.Timestamp)][lastModifiedByUserLogin,admin(java.lang.String)][inShippingBox,N(java.lang.String)][defaultShipmentBoxTypeId,null()][lotIdFilledIn,Forbidden(java.lang.String)][orderDecimalQuantity,N(java.lang.String)][lastUpdatedStamp,2018-11-15 02:59:04.01(java.sql.Timestamp)][lastUpdatedTxStamp,2018-11-15 02:59:04.008(java.sql.Timestamp)][createdStamp,2018-11-15 02:59:04.01(java.sql.Timestamp)][createdTxStamp,2018-11-15 02:59:04.008(java.sql.Timestamp)] (SQL Exception while executing the following:INSERT INTO OFBIZ.PRODUCT (PRODUCT_ID, PRODUCT_TYPE_ID, PRIMARY_PRODUCT_CATEGORY_ID, MANUFACTURER_PARTY_ID, FACILITY_ID, INTRODUCTION_DATE, RELEASE_DATE, SUPPORT_DISCONTINUATION_DATE, SALES_DISCONTINUATION_DATE, SALES_DISC_WHEN_NOT_AVAIL, INTERNAL_NAME, BRAND_NAME, COMMENTS, PRODUCT_NAME, DESCRIPTION, LONG_DESCRIPTION, PRICE_DETAIL_TEXT, SMALL_IMAGE_URL, MEDIUM_IMAGE_URL, LARGE_IMAGE_URL, DETAIL_IMAGE_URL, ORIGINAL_IMAGE_URL, DETAIL_SCREEN, INVENTORY_MESSAGE, INVENTORY_ITEM_TYPE_ID, REQUIRE_INVENTORY, QUANTITY_UOM_ID, QUANTITY_INCLUDED, PIECES_INCLUDED, REQUIRE_AMOUNT, FIXED_AMOUNT, AMOUNT_UOM_TYPE_ID, WEIGHT_UOM_ID, WEIGHT, PRODUCT_WEIGHT, HEIGHT_UOM_ID, PRODUCT_HEIGHT, SHIPPING_HEIGHT, WIDTH_UOM_ID, PRODUCT_WIDTH, SHIPPING_WIDTH, DEPTH_UOM_ID, PRODUCT_DEPTH, SHIPPING_DEPTH, DIAMETER_UOM_ID, PRODUCT_DIAMETER, PRODUCT_RATING, RATING_TYPE_ENUM, RETURNABLE, TAXABLE, CHARGE_SHIPPING, AUTO_CREATE_KEYWORDS, INCLUDE_IN_PROMOTIONS, IS_VIRTUAL, IS_VARIANT, VIRTUAL_VARIANT_METHOD_ENUM, ORIGIN_GEO_ID, REQUIREMENT_METHOD_ENUM_ID, BILL_OF_MATERIAL_LEVEL, RESERV_MAX_PERSONS, RESERV2ND_P_P_PERC, RESERV_NTH_P_P_PERC, CONFIG_ID, CREATED_DATE, CREATED_BY_USER_LOGIN, LAST_MODIFIED_DATE, LAST_MODIFIED_BY_USER_LOGIN, IN_SHIPPING_BOX, DEFAULT_SHIPMENT_BOX_TYPE_ID, LOT_ID_FILLED_IN, ORDER_DECIMAL_QUANTITY, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (INSERT on table 'PRODUCT' caused a violation of foreign key constraint 'PROD_PRIMARY_CAT' for key (10002). The statement has been rolled back.)) (Error while inserting: [GenericEntity:Product][productId,OEMQT-CA(java.lang.String)][productTypeId,FINISHED_GOOD(java.lang.String)][primaryProductCategoryId,10002(java.lang.String)][manufacturerPartyId,null()][facilityId,null()][introductionDate,2018-11-14 15:50:37.0(java.sql.Timestamp)][releaseDate,2018-11-14 15:50:43.0(java.sql.Timestamp)][supportDiscontinuationDate,null()][salesDiscontinuationDate,null()][salesDiscWhenNotAvail,N(java.lang.String)][internalName,OEMQT-CA(java.lang.String)][brandName,AMSOIL(java.lang.String)][comments,OE 5W-20 Synthetic Motor Oil Case(java.lang.String)][productName,OEMQT-CA(java.lang.String)][description,null()][longDescription,null()][priceDetailText,null()][smallImageUrl,null()][mediumImageUrl,null()][largeImageUrl,null()][detailImageUrl,null()][originalImageUrl,null()][detailScreen,null()][inventoryMessage,null()][inventoryItemTypeId,NON_SERIAL_INV_ITEM(java.lang.String)][requireInventory,Y(java.lang.String)][quantityUomId,OTH_ea(java.lang.String)][quantityIncluded,1.000000(java.math.BigDecimal)][piecesIncluded,1(java.lang.Long)][requireAmount,N(java.lang.String)][fixedAmount,null()][amountUomTypeId,null()][weightUomId,WT_lb(java.lang.String)][weight,null()][productWeight,24.00000(java.math.BigDecimal)][heightUomId,null()][productHeight,null()][shippingHeight,null()][widthUomId,null()][productWidth,null()][shippingWidth,null()][depthUomId,null()][productDepth,null()][shippingDepth,null()][diameterUomId,null()][productDiameter,null()][productRating,null()][ratingTypeEnum,null()][returnable,Y(java.lang.String)][taxable,Y(java.lang.String)][chargeShipping,N(java.lang.String)][autoCreateKeywords,null()][includeInPromotions,N(java.lang.String)][isVirtual,N(java.lang.String)][isVariant,N(java.lang.String)][virtualVariantMethodEnum,null()][originGeoId,null()][requirementMethodEnumId,null()][billOfMaterialLevel,0(java.lang.Long)][reservMaxPersons,null()][reserv2ndPPPerc,null()][reservNthPPPerc,null()][configId,null()][createdDate,2018-11-14 21:51:52.357(java.sql.Timestamp)][createdByUserLogin,admin(java.lang.String)][lastModifiedDate,2018-11-14 21:51:52.357(java.sql.Timestamp)][lastModifiedByUserLogin,admin(java.lang.String)][inShippingBox,N(java.lang.String)][defaultShipmentBoxTypeId,null()][lotIdFilledIn,Forbidden(java.lang.String)][orderDecimalQuantity,N(java.lang.String)][lastUpdatedStamp,2018-11-15 02:59:04.01(java.sql.Timestamp)][lastUpdatedTxStamp,2018-11-15 02:59:04.008(java.sql.Timestamp)][createdStamp,2018-11-15 02:59:04.01(java.sql.Timestamp)][createdTxStamp,2018-11-15 02:59:04.008(java.sql.Timestamp)] (SQL Exception while executing the following:INSERT INTO OFBIZ.PRODUCT (PRODUCT_ID, PRODUCT_TYPE_ID, PRIMARY_PRODUCT_CATEGORY_ID, MANUFACTURER_PARTY_ID, FACILITY_ID, INTRODUCTION_DATE, RELEASE_DATE, SUPPORT_DISCONTINUATION_DATE, SALES_DISCONTINUATION_DATE, SALES_DISC_WHEN_NOT_AVAIL, INTERNAL_NAME, BRAND_NAME, COMMENTS, PRODUCT_NAME, DESCRIPTION, LONG_DESCRIPTION, PRICE_DETAIL_TEXT, SMALL_IMAGE_URL, MEDIUM_IMAGE_URL, LARGE_IMAGE_URL, DETAIL_IMAGE_URL, ORIGINAL_IMAGE_URL, DETAIL_SCREEN, INVENTORY_MESSAGE, INVENTORY_ITEM_TYPE_ID, REQUIRE_INVENTORY, QUANTITY_UOM_ID, QUANTITY_INCLUDED, PIECES_INCLUDED, REQUIRE_AMOUNT, FIXED_AMOUNT, AMOUNT_UOM_TYPE_ID, WEIGHT_UOM_ID, WEIGHT, PRODUCT_WEIGHT, HEIGHT_UOM_ID, PRODUCT_HEIGHT, SHIPPING_HEIGHT, WIDTH_UOM_ID, PRODUCT_WIDTH, SHIPPING_WIDTH, DEPTH_UOM_ID, PRODUCT_DEPTH, SHIPPING_DEPTH, DIAMETER_UOM_ID, PRODUCT_DIAMETER, PRODUCT_RATING, RATING_TYPE_ENUM, RETURNABLE, TAXABLE, CHARGE_SHIPPING, AUTO_CREATE_KEYWORDS, INCLUDE_IN_PROMOTIONS, IS_VIRTUAL, IS_VARIANT, VIRTUAL_VARIANT_METHOD_ENUM, ORIGIN_GEO_ID, REQUIREMENT_METHOD_ENUM_ID, BILL_OF_MATERIAL_LEVEL, RESERV_MAX_PERSONS, RESERV2ND_P_P_PERC, RESERV_NTH_P_P_PERC, CONFIG_ID, CREATED_DATE, CREATED_BY_USER_LOGIN, LAST_MODIFIED_DATE, LAST_MODIFIED_BY_USER_LOGIN, IN_SHIPPING_BOX, DEFAULT_SHIPMENT_BOX_TYPE_ID, LOT_ID_FILLED_IN, ORDER_DECIMAL_QUANTITY, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (INSERT on table 'PRODUCT' caused a violation of foreign key constraint 'PROD_PRIMARY_CAT' for key (10002). The statement has been rolled back.))))

#2

Can you post the xml you’ve used?

You can follow demo data in order to see how product data must be created in xml format. Check ./applications/product/data/ProductDemoData.xml


#3

Hey Corey and welcome to the community.

We are aware that importing product data in batches is a pain atm, which is why we have two things in development that tackle the problem:

  1. An Excel Plugin
    https://www.scipioerp.com/2018/08/14/excel-add-in-beta-testers-wanted/

  2. An advanced template that creates the entity entries for you

The latter has been added a year ago and there have been additions last week, which will probably find its way to the public repo probably today or tomorrow. The approach simplifies the data as such:

<entity-engine-transform-xml template="component://shop/data/templates/commonproduct.ftl">
<products>
    <product productId="ML_1" productCategoryId="ML-CL-WMN-101" productName="Sports Bra Butterfly" isVirtual="Y" virtualVariantMethodEnum="VV_FEATURETREE" description="Medium-impact sports done right." longDescription="For medium-impact sports like cycling, dance and cardio classes, the Butterfly Women's Sports Bra features sweat-wicking fabric and a racerback design to help keep you dry, comfortable and moving freely." defaultPrice="19.99" quantityIncluded="1.0" weight="0.3">
        <image productId="ML_1" imageUrl="/images/majorleague/general/alora-griffiths-770611-unsplash.jpg" copyOrig="true" imageNr="0"/>
        <productFeatureAppl productId="ML_1" productFeatureId="7100" productFeatureApplTypeId="SELECTABLE_FEATURE" sequenceNum="1"/>
        <productFeatureAppl productId="ML_1" productFeatureId="7101" productFeatureApplTypeId="SELECTABLE_FEATURE" sequenceNum="2"/>
    </product>
    <product productId="ML_2" productCategoryId="ML-CL-WMN-101" productName="Epic Win" isVirtual="Y" virtualVariantMethodEnum="VV_FEATURETREE" description="High performance running shoe." longDescription="The Epic Win provides crazy comfort that lasts as long as you can run. Its foam cushioning is responsive yet lightweight, durable yet soft. This attraction of opposites creates a sensation that not only enhances the feeling of moving forward, but makes running feel fun, too." defaultPrice="69.99" quantityIncluded="1.0" weight="0.5">
        <image productId="ML_2" imageUrl="/images/majorleague/general/tj-dragotta-578717-unsplash.jpg" copyOrig="true" imageNr="0"/>
        <image productId="ML_2" imageUrl="/images/majorleague/general/clem-onojeghuo-120372-unsplash.jpg" copyOrig="true" imageNr="1"/>
        <productFeatureAppl productId="ML_2" productFeatureId="7103" productFeatureApplTypeId="SELECTABLE_FEATURE" sequenceNum="1"/>
        <productFeatureAppl productId="ML_2" productFeatureId="7104" productFeatureApplTypeId="SELECTABLE_FEATURE" sequenceNum="2"/>
    </product>
</products>

The above outlines a more advanced example, that will be possible after today or tomorrows merge (@pplx: perhaps we can do that later?).

But even without todays merges you should be able to use the template. There is a good example available under /applications/shop/data/DemoCatalogGenericProductData.xml. It allows you to create a default price and list price, add descriptions, assign to default categories and such. The changes we are adding allow you to add multiple images and also assign product features (if available), such as a selectable color or size info.

I use them a lot myself, simply because it makes it so much easier to define products with only a few lines. You will still have to add the categories, productstore & catalog info, but otherwise this should work fine.


#4

I think I figured out what I did wrong. I mistakenly incremented the primaryProductCategoryId thinking it was the ID of the product… completely missed it. There was not an primaryProductCategoryId with that ID to update.


#5

Oh, alright. So everything works now?


#6

I was able to import 1 line. Now I am trying to update & convert my csv so that I can import it… would like to figure out the pricing too. I have default/wholesale cost, retail pricing, and then a special price for each item.


#7

Use this as a reference:

You can even extend the /applications/shop/data/templates/commonproduct.ftl in order to allow more type of prices and such. Be aware that the price types you want already exist, check https://localhost:8443/admin/control/FindGeneric?entityName=ProductPriceType&find=true&VIEW_SIZE=50&VIEW_INDEX=0


#8

And this for prices in general:

https://www.scipioerp.com/community/end-user/applications/catalog-management-pim/prices-promotions/

A few of the more common price types:

  • default price: base price that applies if no other is set
  • list price: your standard price (basically what you usually charge)
  • promotional price: special price you only use in combination with a promotion

The others are less often used, but will either be displayed on top of the current price (like a competitive price) or used for some of the underlying processes…


#9

I got pretty excited when I was able to import all my products but then came across the catalog screen which does not show them… Only 1 category has items which are ones I manually configured.

image

Here is a snippet of the import which has categories in it:

<?xml version="1.0" encoding="UTF-8" standalone="true"?>

-<entity-engine-xml>

<Product createdTxStamp="43418.9104166667" createdStamp="43418.9104166667" lastUpdatedTxStamp="43418.9104166667" lastUpdatedStamp="43418.9104166667" orderDecimalQuantity="N" lotIdFilledIn="Forbidden" inShippingBox="N" lastModifiedByUserLogin="admin" lastModifiedDate="43419.5708333333" createdByUserLogin="admin" createdDate="43418.9104166667" billOfMaterialLevel="0" isVariant="N" isVirtual="N" includeInPromotions="Y" chargeShipping="N" taxable="Y" returnable="Y" productWeight="3.2" weightUomId="WT_lb" requireAmount="N" piecesIncluded="1" quantityIncluded="1" quantityUomId="OTH_ea" requireInventory="Y" inventoryItemTypeId="NON_SERIAL_INV_ITEM" description="WIX 24050 Fuel Filter" productName="24050-EA" comments="WIX 24050 Fuel Filter" brandName="WIX" internalName="24050-EA" salesDiscWhenNotAvail="N" releaseDate="43418.6597222222" introductionDate="43418.6597222222" primaryProductCategoryId="10004" productTypeId="FINISHED_GOOD" productId="24050-EA"/>

<Product createdTxStamp="43418.9104166667" createdStamp="43418.9104166667" lastUpdatedTxStamp="43418.9104166667" lastUpdatedStamp="43418.9104166667" orderDecimalQuantity="N" lotIdFilledIn="Forbidden" inShippingBox="N" lastModifiedByUserLogin="admin" lastModifiedDate="43419.5708333333" createdByUserLogin="admin" createdDate="43418.9104166667" billOfMaterialLevel="0" isVariant="N" isVirtual="N" includeInPromotions="Y" chargeShipping="N" taxable="Y" returnable="Y" productWeight="0.9" weightUomId="WT_lb" requireAmount="N" piecesIncluded="1" quantityIncluded="1" quantityUomId="OTH_ea" requireInventory="Y" inventoryItemTypeId="NON_SERIAL_INV_ITEM" description="WIX 24161 Cabin Air Filter (0)" productName="24161-EA" comments="WIX 24161 Cabin Air Filter (0)" brandName="WIX" internalName="24161-EA" salesDiscWhenNotAvail="N" releaseDate="43418.6597222222" introductionDate="43418.6597222222" primaryProductCategoryId="10002" productTypeId="FINISHED_GOOD" productId="24161-EA"/>

#10

Unfortunately it is not enough to define the products, but you’d also have to assign them to a ProductCategory like so:

<ProductCategoryMember productCategoryId="10000" productId="24050-EA" fromDate="2001-05-13 12:00:00.0"/>
<ProductCategoryMember productCategoryId="10000" productId="24161-EA" fromDate="2001-05-13 12:00:00.0"/>

The primaryProductCategoryId unfortunately does not assign to a productcategory, it only tells the system what the primary category is so that URLs can be properly generated.

The template i posted earlier takes care of all of these additional database entries, so I think it may be easier for you if you rely on that for now, instead of doing the entries yourself (you can always check out the other example files if you want to understand the database in its full extend).


#11

The changes have been pushed, so you should be able to use the dynamic entity template to its full extend after you pull from upstream.


#12

Guess I’m not understanding… I tried but got an error… still can’t get dates to work right coming out of excel. Is there better piece of software for handling large amounts of data with xml?

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<entity-engine-transform-xml>
	<products>
		<ProductCategoryMember productCategoryId="10004" productId="24050-EA" fromDate="43418.9104166667"/>
		<ProductCategoryMember productCategoryId="10002" productId="24161-EA" fromDate="43418.9104166667"/>
		<ProductCategoryMember productCategoryId="10002" productId="24479-EA" fromDate="43418.9104166667"/>

ERROR rendering error page [/control/error], but here is the error text: org.ofbiz.widget.renderer.ScreenRenderException: Error rendering screen [component://webtools/widget/EntityScreens.xml#EntityImport]: org.ofbiz.entity.transaction.GenericTransactionException: The current transaction is marked for rollback, not beginning a new transaction and aborting current operation; the rollbackOnly was caused by: Error in Service [parseEntityXmlFile]: ERROR parsing Entity Xml file: java.lang.NullPointerException (The current transaction is marked for rollback, not beginning a new transaction and aborting current operation; the rollbackOnly was caused by: Error in Service [parseEntityXmlFile]: ERROR parsing Entity Xml file: java.lang.NullPointerException)


#13

You are mixing information now. The ProductCategoryMember is required (like many other things) if you import each entity entry in an xml seed file. I do not recommend that, precisely because it is a bad user experience for you.

Just use the following and adopt:

    <entity-engine-transform-xml template="component://shop/data/templates/commonproduct.ftl">
<products>
    <product productId="ML_1" productCategoryId="ML-CL-WMN-101" productName="Sports Bra Butterfly" description="Medium-impact sports done right." longDescription="For medium-impact sports like cycling, dance and cardio classes, the Butterfly Women's Sports Bra features sweat-wicking fabric and a racerback design to help keep you dry, comfortable and moving freely." defaultPrice="19.99" quantityIncluded="1.0" weight="0.3">
        <image productId="ML_1" imageUrl="/images/majorleague/general/alora-griffiths-770611-unsplash.jpg" copyOrig="true" imageNr="0"/>
    </product>
    <product productId="ML_2" productCategoryId="ML-CL-WMN-101" productName="Epic Win"  description="High performance running shoe." longDescription="The Epic Win provides crazy comfort that lasts as long as you can run. Its foam cushioning is responsive yet lightweight, durable yet soft. This attraction of opposites creates a sensation that not only enhances the feeling of moving forward, but makes running feel fun, too." defaultPrice="69.99" quantityIncluded="1.0" weight="0.5">
        <image productId="ML_2" imageUrl="/images/majorleague/general/tj-dragotta-578717-unsplash.jpg" copyOrig="true" imageNr="0"/>
        <image productId="ML_2" imageUrl="/images/majorleague/general/clem-onojeghuo-120372-unsplash.jpg" copyOrig="true" imageNr="1"/>
    </product>
</products></entity-engine-transform-xml>

the snippet above includes images, which have to be copied into the framework/images/webapp/images directory (which maps to /images), in case you want to set those.

Let me know if you need help modifying the above snippet, but it really is easier than having to go through the larger entity seed files and importing those one by one…


#14

There are more options to this, you can also set listPrice and also add features and such, but for the sake of simplicity let’s just start with the basic products now…

If you don’t have any imaes, feel free to remove the lines starting with <image too.


#15

If you are interested in how this template works, check component://shop/data/templates/commonproduct.ftl - that may also be helpful to understand the underlying data entries being created (you will find the ones you posted in there, too)


#16

I looked at earlier but honestly this (scipio) is my first time working hands-on with xml formatting, not that I am very experienced with anything else. I am sure it is noticeable…

Thank you. I will be reworking this shortly.


#17

Hey, that is completely understandable. We just worry that your experience may be a lot worse simply because we are mixing topics here.

Let me also post you another sample here, so you get a better understanding of how you can work with these “templates”, rather than the entity info directly:

<entity-engine-transform-xml template="component://shop/data/templates/commonproduct.ftl">
<products>
    <product productId="FD-1000" productCategoryId="FOOD-100" productName="Bananas" longDescription="Delicious bananas." defaultPrice="0.89" listPrice="0.99" minimumOrderPrice="10.0"/>
    <product productId="FD-1001" productCategoryId="FOOD-100" productName="Oranges" longDescription="Delicious oranges." defaultPrice="0.85" listPrice="0.85" minimumOrderPrice="12.0"/>
    <product productId="FD-1002" productCategoryId="FOOD-100" productName="Assorted Vegetables" longDescription="Delicious assorted vegetables, picked at random." defaultPrice="4.99" listPrice="4.89" piecesIncluded="12" />
    <product productId="FD-1003" productCategoryId="FOOD-100" productName="Green Peppers" longDescription="Delicious green peppers." defaultPrice="0.85" listPrice="0.95" minimumOrderPrice="10.0" />
    <product productId="FD-1004" productCategoryId="FOOD-100" productName="Red Peppers" longDescription="Delicious red peppers." defaultPrice="0.85" listPrice="0.95" minimumOrderPrice="10.0" />
    <product productId="FD-1005" productCategoryId="FOOD-100" productName="Yellow Peppers" longDescription="Delicious yellow peppers." defaultPrice="0.85" listPrice="0.95" minimumOrderPrice="10.0" />
    <product productId="FD-1006" productCategoryId="FOOD-100" productName="Cucumbers" longDescription="Delicious cucumbers." defaultPrice="0.85" listPrice="0.95" minimumOrderPrice="10.0" />
    <product productId="FD-1007" productCategoryId="FOOD-100" productName="Carrots" longDescription="Delicious carrots." defaultPrice="0.85" listPrice="0.95" minimumOrderPrice="10.0" />
    <product productId="FD-1008" productCategoryId="FOOD-100" productName="Onions" longDescription="Delicious onions." defaultPrice="0.85" listPrice="0.95" minimumOrderPrice="10.0" />
    <product productId="FD-1009" productCategoryId="FOOD-100" productName="Parsnips" longDescription="Delicious parsnips." defaultPrice="0.85" listPrice="0.95" minimumOrderPrice="10.0" />
    <product productId="FD-1010" productCategoryId="FOOD-100" productName="Celery" longDescription="Delicious celery." defaultPrice="0.85" listPrice="0.95" minimumOrderPrice="10.0" />
    <product productId="FD-1011" productCategoryId="FOOD-100" productName="Pickles" longDescription="Delicious pickles." defaultPrice="0.85" listPrice="0.95" minimumOrderPrice="10.0" />
    <product productId="FD-1012" productCategoryId="FOOD-100" productName="Tomatoes" longDescription="Delicious tomatoes." defaultPrice="0.85" listPrice="0.95" minimumOrderPrice="10.0" />
    <product productId="FD-1013" productCategoryId="FOOD-100" productName="Eggplant" longDescription="Delicious eggplant." defaultPrice="0.85" listPrice="0.95" minimumOrderPrice="10.0" />
    <product productId="FD-1014" productCategoryId="FOOD-100" productName="Arugula" longDescription="Delicious arugula." defaultPrice="0.85" listPrice="0.95" minimumOrderPrice="10.0" />
    <product productId="FD-1015" productCategoryId="FOOD-100" productName="Romaine Lettuce" longDescription="Delicious romaine lettuce." defaultPrice="0.85" listPrice="0.95" minimumOrderPrice="10.0" />
    <product productId="FD-1016" productCategoryId="FOOD-100" productName="Spinach" longDescription="Delicious spinach." defaultPrice="0.85" listPrice="0.95" minimumOrderPrice="10.0" />
    <product productId="FD-1017" productCategoryId="FOOD-100" productName="Green Apples" longDescription="Delicious green apples." defaultPrice="0.85" listPrice="0.95" minimumOrderPrice="10.0" />
    <product productId="FD-1050" productCategoryId="FOOD-100" productName="Strawberry Cream Cake" longDescription="Delicious strawberry cream cake." defaultPrice="19.99" listPrice="22.99"/>
    <product productId="FD-1060" productCategoryId="FOOD-100" productName="Pink Shrimp" longDescription="Delicious pink shrimp." defaultPrice="12.99" quantityIncluded="0.454" quantityUomId="WT_kg"/>
    <product productId="FD-1061" productCategoryId="FOOD-100" productName="Sea Bass" longDescription="Delicious sea bass." defaultPrice="12.99" quantityIncluded="0.454" quantityUomId="WT_kg"/>
    <product productId="FD-1062" productCategoryId="FOOD-100" productName="Salmon" longDescription="Delicious salmon." defaultPrice="12.99" quantityIncluded="0.454" quantityUomId="WT_kg"/>
    <product productId="FD-1063" productCategoryId="FOOD-100" productName="Wild-Caught Tuna" longDescription="Delicious wild-caught tuna." defaultPrice="12.99" quantityIncluded="0.454" quantityUomId="WT_kg"/>
    <product productId="FD-1064" productCategoryId="FOOD-100" productName="Atlantic Cod" longDescription="Delicious atlantic cod." defaultPrice="12.99" quantityIncluded="0.454" quantityUomId="WT_kg"/>
    <product productId="FD-1065" productCategoryId="FOOD-100" productName="Catfish" longDescription="Delicious catfish." defaultPrice="12.99" quantityIncluded="0.454" quantityUomId="WT_kg"/>
    <product productId="FD-1066" productCategoryId="FOOD-100" productName="Raw Shrimp (with shell)" longDescription="Delicious shrimp, with shell, zipperback." defaultPrice="11.99" quantityIncluded="0.454" quantityUomId="WT_kg"/>
    <product productId="PR-1000" productCategoryId="PC-PR-101" extraCategoryId1="ELTRN-100" productName="USB Optical Mouse" longDescription="Simple, durable, USB optical mouse." defaultPrice="19.99" />
    <product productId="CAM-7000" productCategoryId="ELTRN-100" productName="Nikon FM2 film" description="FM2 film for Nikon Analog Cameras." longDescription="High-quality FM2 film for Nikon Analog Cameras." defaultPrice="19.99" quantityIncluded="100.0" weight="0.1"/>
</products></entity-engine-transform-xml>

When you use the templates (not the change of the first line changing to entity-engine-transform-xml template) then the data you need to enter is alot less. The productcategories are set with productCategoryId and there is no need for additional lines of xml


#18

I should also mention again: we hope to complete the excel import soon. I agree that working with data files is not ideal and generally an excel import/export is more desirable. Our problem so far has been that we support an enormous amount of different product configurations and it is a bit tricky to simplify all the information so that it fits in data-table (Products like the Pizza or PC example on our demo are particularly tough, as they feature not only multiple user input options but also wire into the manufacturing component…)


#19

Well, I thought I understood but getting errors each time. I trimmed the listing down a lot just to see (below) but still get an error on import. I did the git pull earlier as well. Now says “Already up to date”

<entity-engine-transform-xml template="component://shop/data/templates/commonproduct.ftl">
    	<products>
    		<product productId="24882-EA" productCategoryId="10002"/>
    		<product productId="XLZQT-EA" productCategoryId="10001"/>
    		<product productId="XLZQTC-CA" productCategoryId="10001"/>
    		<product productId="XLZQTC-EA" productCategoryId="10001"/>
    		<product productId="ZRFQT-CA" productCategoryId="10001"/>
    		<product productId="ZRFQT-EA" productCategoryId="10001"/>
    		<product productId="ZRTQT-CA" productCategoryId="10001"/>
    		<product productId="ZRTQT-EA" productCategoryId="10001"/>
    	</products>
    </entity-engine-transform-xml>

image


#20

You are on the right track. The error states that you have to specify a productName and some other info for this to properly work. Let’s try the following for a start (you can modify the values later:

<entity-engine-transform-xml template="component://shop/data/templates/commonproduct.ftl">
	<products>
		<product productId="24882-EA" productCategoryId="10002" defaultPrice="99.99" productName="Placeholder for 24882-EA" description="Description for 24882-EA"/>
		<product productId="XLZQT-EA" productCategoryId="10001" defaultPrice="99.99" productName="Placeholder for XLZQT-EA" description="Description for XLZQT-EA"/>
		<product productId="XLZQTC-CA" productCategoryId="10001" defaultPrice="99.99" productName="Placeholder for XLZQTC-EA" description="Description for XLZQTC-EA"/>
		<product productId="XLZQTC-EA" productCategoryId="10001" defaultPrice="99.99" productName="Placeholder for XLZQTC-EA" description="Description for XLZQTC-EA"/>
		<product productId="ZRFQT-CA" productCategoryId="10001" defaultPrice="99.99" productName="Placeholder for ZRFQT-EA" description="Description for ZRFQT-EA"/>
		<product productId="ZRFQT-EA" productCategoryId="10001" defaultPrice="99.99" productName="Placeholder for ZRFQT-EA" description="Description for ZRFQT-EA"/>
		<product productId="ZRTQT-CA" productCategoryId="10001" defaultPrice="99.99" productName="Placeholder for ZRTQT-EA" description="Description for ZRTQT-EA"/>
		<product productId="ZRTQT-EA" productCategoryId="10001" defaultPrice="99.99" productName="Placeholder for ZRTQT-EA" description="Description for ZRTQT-EA"/>
	</products>
</entity-engine-transform-xml>

Give it a try, if it doesn’t work, I’ll try to recreate your data in full