Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Issue Hybris Importer - "Sling:resourceType" prop not getting generated

KishCq5
Level 3
Level 3

Hi All,

While importing the product content from Hybris(http://localhost:4502/etc/importers/hybris.html) all the properties are generating properly except property “sling:resourceType” . It is happening for Product node and Variant Node. The image node is able to add “sling:resourceType” property. Is there any know issue on this? if so, what would be the solution. This is the custom Hybris Importer implementation we are developing for our project.

For the Code below I am able to generate properties cq:commerceType, myvariant as well jcr:lastModified but not sling:resourceType property. I tried pointing to OOTB importer code as well. But not able to generate sling:resourceType property.

 

protected Node createVariant(Node parentProduct, String name) throws RepositoryException {

              Node variant = JcrUtil.createUniqueNode(parentProduct, name, "nt:unstructured", parentProduct.getSession());

              variant.setProperty("cq:commerceType", "variant");

              variant.setProperty("myvariant", "myvariantmyvariantmyvariantmyvariantmyvariant");

              variant.setProperty("sling:resourceType", "commerce/components/product1");

              variant.setProperty("jcr:lastModified", Calendar.getInstance());

 

protected Node createProduct(String path, Session session) throws RepositoryException {

 

Node product = JcrUtil.createUniqueNode(parent, Text.getName(path), "nt:unstructured", session);

              product.setProperty("cq:commerceType", "product");

              product.setProperty("myproduct", "myproductmyproductmyproductmyproductmyproductmyproductmyproduct");

              product.setProperty("sling:resourceType", "commerce/components/product2");

              product.setProperty("jcr:lastModified", Calendar.getInstance());

2 Replies
Tim_Donovanuk
Level 2
Level 2

Could you try (as a test) to set sling:resourceSuperType instead?