Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anatomy of XML import descriptor 
Label
Body3.6.0+

Info
TODO


XML import and export build on the same concepts as any other import and export. Descriptor definition specifies the import descriptor resolver that will parse the configurations. Import director service will invoke the XML import or export service to perform the action.

Code Block
languagexml
titlecustomers.xml XML import
<import-descriptor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:noNamespaceSchemaLocation="file:../../../../../../../domain-api/src/main/resources/META-INF/schema/import-descriptor-xml.xsd">

    <entity-type>org.yes.cart.domain.entity.Customer</entity-type>

    <import-file-descriptor>
        <file-encoding>UTF-8</file-encoding>
        <file-name-mask>customers-data.xml</file-name-mask>
    </import-file-descriptor>

    <xml-handler>CUSTOMER</xml-handler>

</import-descriptor>

 

Because XML import and export have a well defined schema the only option available is specifying appropriate handler to use. For exports all handler have "pretty" format by suffixing the name of the handler with "_PRETTY".

Code Block
languagexml
titlecustomers.xml XML export
<export-descriptor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:noNamespaceSchemaLocation="file:../../../../../../../domain-api/src/main/resources/META-INF/schema/export-descriptor-xml.xsd">

    <context>
        <shop-code>SHOIP1</shop-code>
    </context>

    <entity-type>org.yes.cart.domain.entity.Customer</entity-type>

    <export-file-descriptor>
        <file-encoding>UTF-8</file-encoding>
        <file-name>target/customers_export-{timestamp}.xml</file-name>
    </export-file-descriptor>

    <select-cmd>select t from CustomerEntity t</select-cmd>

    <xml-handler>CUSTOMER_PRETTY</xml-handler>

</export-descriptor>

 

Here is the full list of XML descriptor available out of the box:

The following handlers are supported OOTB:

Entity
Import
Export
Notes
AddressADDRESS,CUSTOMERADDRESS,CUSTOMER 
AssociationPRODUCTPRODUCTCreated automatically during product import
AttributeATTRIBUTEATTRIBUTE 
AttributeGroupATTRIBUTEGROUPATTRIBUTEGROUP 
AttrValueBrandBRANDBRAND 
AttrValueCategoryCATEGORYCATEGORY 
AttrValueCustomerCUSTOMERCUSTOMER 
AttrValueProductPRODUCTPRODUCT 
AttrValueProductSkuPRODUCT,SKUPRODUCT,SKU 
AttrValueShopSHOPSHOP 
AttrValueSystemSYSTEMSYSTEM 
BrandPRODUCT,BRANDBRANDCreated automatically during product import
CarrierSHIPPINGPROVIDERSHIPPINGPROVIDER 
CarrierShopSHOP,SHOP_CARRIERSSHOP
CarrierSlaSHIPPINGMETHOD,SHIPPINGPROVIDERSHIPPINGMETHOD,SHIPPINGPROVIDER 
CategoryCATEGORY,PRODUCT,PRODUCT_CATEGORIESCATEGORYCreated automatically during product import
CountryCOUNTRYCOUNTRY 
CustomerCUSTOMERCUSTOMER 
CustomerOrderCUSTOMERORDERCUSTOMERORDERCreate ONLY for now
CustomerOrderDeliveryCUSTOMERORDERCUSTOMERORDERCreate ONLY for now
CustomerOrderDeliveryDetCUSTOMERORDERCUSTOMERORDERCreate ONLY for now
CustomerOrderDetCUSTOMERORDERCUSTOMERORDERCreate ONLY for now
CustomerShopCUSTOMERCUSTOMER 
CustomerWishListCUSTOMERCUSTOMER 
DataDescriptorDATADESCRIPTORDATADESCRIPTOR 
DataGroupDATAGROUPDATAGROUP 
EtypeETYPEETYPE 
ManagerORGANISATIONUSERORGANISATIONUSER 
ManagerRoleORGANISATIONUSERORGANISATIONUSER 
ManagerShopORGANISATIONUSERORGANISATIONUSER 
ProdTypeAttributeViewGroupPRODUCTTYPEPRODUCTTYPE 
ProductPRODUCTPRODUCT 
ProductAssociationPRODUCT,PRODUCT_LINKSPRODUCT 
ProductCategoryPRODUCT,PRODUCT_CATEGORIESPRODUCT 
ProductEnsembleOption(error)  (error) 
ProductSkuPRODUCT,SKUPRODUCT,SKUIncluded in product but can run standalone as SKU
ProductTypePRODUCTTYPEPRODUCTTYPE 
ProductTypeAttrPRODUCTTYPEPRODUCTTYPE 
PromotionPROMOTIONPROMOTION 
PromotionCouponPROMOTION,PROMOTIONCOUPONPROMOTION,PROMOTIONCOUPON 
PromotionCouponUsageCUSTOMERORDERCUSTOMERORDERCreate ONLY for now
Role (error)(error) 
SeoImage (error)(error)  
ShopSHOPSHOP 
ShopAliasSHOP,SHOP_ALIASESSHOP 
ShopCategorySHOP,SHOP_CATEGORIESSHOP 
ShoppingCartState (error)(error)  
ShopUrlSHOP,SHOP_URLSSHOP 
ShopWarehouseSHOP,SHOP_CENTRESSHOP 
SkuPricePRICEPRICE 
SkuPriceRulePRICERULEPRICERULE 
SkuWarehouseINVENTORYINVENTORY 
StateCOUNTRYSTATECOUNTRYSTATE 
System (error)(error)  
TaxTAXTAX 
TaxConfigTAXCONFIGTAXCONFIG 
WarehouseFULFILMENTCENTREFULFILMENTCENTRE