...
Anatomy of XML import descriptor LabelBody 3.6.0+
Body | 3.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 | ||||
---|---|---|---|---|
| ||||
<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 | ||||
---|---|---|---|---|
| ||||
<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 |
---|---|---|---|
Address | ADDRESS,CUSTOMER | ADDRESS,CUSTOMER | |
Association | PRODUCT | PRODUCT | Created automatically during product import |
Attribute | ATTRIBUTE | ATTRIBUTE | |
AttributeGroup | ATTRIBUTEGROUP | ATTRIBUTEGROUP | |
AttrValueBrand | BRAND | BRAND | |
AttrValueCategory | CATEGORY | CATEGORY | |
AttrValueCustomer | CUSTOMER | CUSTOMER | |
AttrValueProduct | PRODUCT | PRODUCT | |
AttrValueProductSku | PRODUCT,SKU | PRODUCT,SKU | |
AttrValueShop | SHOP | SHOP | |
AttrValueSystem | SYSTEM | SYSTEM | |
Brand | PRODUCT,BRAND | BRAND | Created automatically during product import |
Carrier | SHIPPINGPROVIDER | SHIPPINGPROVIDER | |
CarrierShop | SHOP,SHOP_CARRIERS | SHOP | |
CarrierSla | SHIPPINGMETHOD,SHIPPINGPROVIDER | SHIPPINGMETHOD,SHIPPINGPROVIDER | |
Category | CATEGORY,PRODUCT,PRODUCT_CATEGORIES | CATEGORY | Created automatically during product import |
Country | COUNTRY | COUNTRY | |
Customer | CUSTOMER | CUSTOMER | |
CustomerOrder | CUSTOMERORDER | CUSTOMERORDER | Create ONLY for now |
CustomerOrderDelivery | CUSTOMERORDER | CUSTOMERORDER | Create ONLY for now |
CustomerOrderDeliveryDet | CUSTOMERORDER | CUSTOMERORDER | Create ONLY for now |
CustomerOrderDet | CUSTOMERORDER | CUSTOMERORDER | Create ONLY for now |
CustomerShop | CUSTOMER | CUSTOMER | |
CustomerWishList | CUSTOMER | CUSTOMER | |
DataDescriptor | DATADESCRIPTOR | DATADESCRIPTOR | |
DataGroup | DATAGROUP | DATAGROUP | |
Etype | ETYPE | ETYPE | |
Manager | ORGANISATIONUSER | ORGANISATIONUSER | |
ManagerRole | ORGANISATIONUSER | ORGANISATIONUSER | |
ManagerShop | ORGANISATIONUSER | ORGANISATIONUSER | |
ProdTypeAttributeViewGroup | PRODUCTTYPE | PRODUCTTYPE | |
Product | PRODUCT | PRODUCT | |
ProductAssociation | PRODUCT,PRODUCT_LINKS | PRODUCT | |
ProductCategory | PRODUCT,PRODUCT_CATEGORIES | PRODUCT | |
ProductEnsembleOption | |||
ProductSku | PRODUCT,SKU | PRODUCT,SKU | Included in product but can run standalone as SKU |
ProductType | PRODUCTTYPE | PRODUCTTYPE | |
ProductTypeAttr | PRODUCTTYPE | PRODUCTTYPE | |
Promotion | PROMOTION | PROMOTION | |
PromotionCoupon | PROMOTION,PROMOTIONCOUPON | PROMOTION,PROMOTIONCOUPON | |
PromotionCouponUsage | CUSTOMERORDER | CUSTOMERORDER | Create ONLY for now |
Role | |||
SeoImage | |||
Shop | SHOP | SHOP | |
ShopAlias | SHOP,SHOP_ALIASES | SHOP | |
ShopCategory | SHOP,SHOP_CATEGORIES | SHOP | |
ShoppingCartState | |||
ShopUrl | SHOP,SHOP_URLS | SHOP | |
ShopWarehouse | SHOP,SHOP_CENTRES | SHOP | |
SkuPrice | PRICE | PRICE | |
SkuPriceRule | PRICERULE | PRICERULE | |
SkuWarehouse | INVENTORY | INVENTORY | |
State | COUNTRYSTATE | COUNTRYSTATE | |
System | |||
Tax | TAX | TAX | |
TaxConfig | TAXCONFIG | TAXCONFIG | |
Warehouse | FULFILMENTCENTRE | FULFILMENTCENTRE |