├── .circleci ├── ci │ ├── build.js │ ├── ci.js │ └── it-tests.js ├── codecov.yml ├── config.yml └── settings.xml ├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── BUG_REPORT.md │ └── FEATURE_REQUEST.md ├── PULL_REQUEST_TEMPLATE.md └── release-drafter.yml ├── .gitignore ├── LICENSE ├── README.md ├── VERSIONS.md ├── all └── pom.xml ├── bundles ├── cif-connector-graphql │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── adobe │ │ │ └── cq │ │ │ └── commerce │ │ │ ├── graphql │ │ │ ├── core │ │ │ │ ├── GraphqlProductViewHandler.java │ │ │ │ └── MagentoProduct.java │ │ │ ├── magento │ │ │ │ ├── GraphqlDataService.java │ │ │ │ ├── GraphqlDataServiceConfiguration.java │ │ │ │ ├── GraphqlDataServiceImpl.java │ │ │ │ └── GraphqlQueries.java │ │ │ ├── resource │ │ │ │ ├── CategoryProductsIterator.java │ │ │ │ ├── CategoryResource.java │ │ │ │ ├── Constants.java │ │ │ │ ├── ErrorResource.java │ │ │ │ ├── GraphqlQueryLanguageProvider.java │ │ │ │ ├── GraphqlResourceProvider.java │ │ │ │ ├── GraphqlResourceProviderFactory.java │ │ │ │ ├── ProductResource.java │ │ │ │ ├── ResourceMapper.java │ │ │ │ ├── RootCategoryResource.java │ │ │ │ └── SyntheticImageResource.java │ │ │ └── search │ │ │ │ └── CatalogSearchSupport.java │ │ │ ├── gui │ │ │ └── components │ │ │ │ ├── common │ │ │ │ ├── cifcategoryfield │ │ │ │ │ └── Initializer.java │ │ │ │ └── cifproductfield │ │ │ │ │ ├── Initializer.java │ │ │ │ │ └── impl │ │ │ │ │ ├── ChildrenDataSourceServlet.java │ │ │ │ │ └── SearchDataSourceServlet.java │ │ │ │ └── configuration │ │ │ │ ├── ConfigurationColumnPreview.java │ │ │ │ ├── ConfigurationColumnViewItem.java │ │ │ │ ├── package-info.java │ │ │ │ └── servlets │ │ │ │ └── ConfigurationInheritanceServlet.java │ │ │ ├── omnisearch │ │ │ └── ProductsSuggestionOmniSearchHandler.java │ │ │ ├── postprocessor │ │ │ └── MultiFieldDropTargetPostProcessor.java │ │ │ ├── renderconditions │ │ │ ├── IsProductDetailPageServlet.java │ │ │ └── IsProductListPageServlet.java │ │ │ └── utils │ │ │ └── ConfigInheritance.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── adobe │ │ │ └── cq │ │ │ └── commerce │ │ │ ├── graphql │ │ │ ├── core │ │ │ │ ├── GraphqlProductViewHandlerTest.java │ │ │ │ └── SyntheticResourceWithProperties.java │ │ │ ├── magento │ │ │ │ ├── GraphqlAemContext.java │ │ │ │ ├── GraphqlDataServiceImplTest.java │ │ │ │ └── MockGraphqlDataServiceConfiguration.java │ │ │ ├── resource │ │ │ │ ├── CategoryProductsIteratorTest.java │ │ │ │ ├── GraphqlQueryLanguageProviderTest.java │ │ │ │ ├── GraphqlResourceProviderFactoryTest.java │ │ │ │ └── GraphqlResourceProviderTest.java │ │ │ └── testing │ │ │ │ └── Utils.java │ │ │ ├── gui │ │ │ └── components │ │ │ │ ├── common │ │ │ │ ├── FieldInitializerTest.java │ │ │ │ ├── cifcategoryfield │ │ │ │ │ └── InitializerTest.java │ │ │ │ └── cifproductfield │ │ │ │ │ ├── InitializerTest.java │ │ │ │ │ └── impl │ │ │ │ │ ├── ChildrenDataSourceServletTest.java │ │ │ │ │ └── SearchDataSourceServletTest.java │ │ │ │ └── configuration │ │ │ │ ├── ConfigurationColumnPreviewTest.java │ │ │ │ ├── ConfigurationColumnViewItemTest.java │ │ │ │ └── servlets │ │ │ │ └── ConfigurationInheritanceServletTest.java │ │ │ ├── omnisearch │ │ │ └── ProductsSuggestionOmniSearchHandlerTest.java │ │ │ ├── postprocessor │ │ │ └── MultiFieldDropTargetPostProcessorTest.java │ │ │ └── renderconditions │ │ │ ├── IsProductDetailPageServletTest.java │ │ │ └── IsProductListPageServletTest.java │ │ └── resources │ │ ├── commerce-categories-omnisearch-request.json │ │ ├── commerce-products-omni-search-request.json │ │ ├── commerce-products-omni-search-request2.json │ │ ├── commerce-products-omni-search-request3.json │ │ ├── context │ │ ├── drop-target-post-processor.json │ │ ├── graphql-client-adapter-factory-context.json │ │ ├── graphql-resource-provider-context.json │ │ ├── is-product-detail-page-servlet-test-context.json │ │ ├── is-product-list-page-servlet-test-context.json │ │ ├── jcr-conf-console.json │ │ ├── jcr-conf-inheritance.json │ │ └── jcr-conf.json │ │ ├── graphql-queries │ │ ├── category-products.txt │ │ ├── category-search.txt │ │ ├── categorylist-by-urlkey.txt │ │ ├── product-by-sku.txt │ │ ├── products-empty-search-for-category.txt │ │ ├── products-empty-search.txt │ │ ├── products-search-for-category.txt │ │ └── products-search.txt │ │ ├── logback-test.xml │ │ ├── magento-graphql-category-products-page1.json │ │ ├── magento-graphql-category-products-page2.json │ │ ├── magento-graphql-category-products-page3.json │ │ ├── magento-graphql-category-products.json │ │ ├── magento-graphql-category-search.json │ │ ├── magento-graphql-categorylist-coats.json │ │ ├── magento-graphql-categorylist-dresses.json │ │ ├── magento-graphql-categorylist-empty.json │ │ ├── magento-graphql-categorylist-root.json │ │ ├── magento-graphql-error.json │ │ ├── magento-graphql-no-product.json │ │ ├── magento-graphql-other-product.json │ │ ├── magento-graphql-product.json │ │ ├── magento-graphql-products-search.json │ │ ├── magento-graphql-simple-product.json │ │ ├── magento-graphql-simple-products.json │ │ ├── sample-graphql-generic-response.json │ │ └── test-queries │ │ ├── README.md │ │ └── graphql-requests.log └── cif-virtual-catalog │ ├── pom.xml │ └── src │ ├── main │ └── java │ │ └── com │ │ └── adobe │ │ └── cq │ │ └── commerce │ │ └── virtual │ │ └── catalog │ │ ├── admin │ │ └── impl │ │ │ └── CatalogIdentifierDatasource.java │ │ ├── data │ │ ├── CatalogDataResourceProviderFactory.java │ │ ├── CatalogDataResourceProviderManager.java │ │ ├── CatalogIdentifier.java │ │ ├── CatalogIdentifierService.java │ │ ├── Constants.java │ │ └── impl │ │ │ ├── CatalogDataResourceProviderManagerImpl.java │ │ │ ├── CatalogIdentifierServiceImpl.java │ │ │ └── ProductBindingCreator.java │ │ └── models │ │ ├── ConfigurationReference.java │ │ └── impl │ │ └── ConfigurationReferenceImpl.java │ └── test │ ├── java │ └── com │ │ └── adobe │ │ └── cq │ │ └── commerce │ │ └── virtual │ │ └── catalog │ │ ├── admin │ │ └── impl │ │ │ └── CatalogIdentifierDatasourceTest.java │ │ ├── data │ │ └── impl │ │ │ ├── CatalogDataProviderManagerConfTest.java │ │ │ ├── CatalogDataResourceProviderManagerImplTest.java │ │ │ └── ProductBindingCreatorTest.java │ │ └── models │ │ └── impl │ │ └── ConfigurationReferenceTest.java │ └── resources │ ├── context │ ├── jcr-catalog-bindings.json │ ├── jcr-cifrootfolder-references.json │ ├── jcr-conf-page.json │ ├── jcr-conf.json │ ├── jcr-dataroots.json │ └── jcr-wrong-conf.json │ ├── nodetypes │ └── cq-page.cnd │ └── simplelogger.properties ├── content ├── cif-connector │ ├── pom.xml │ ├── src │ │ └── main │ │ │ └── content │ │ │ ├── META-INF │ │ │ └── vault │ │ │ │ └── filter.xml │ │ │ └── jcr_root │ │ │ ├── apps │ │ │ └── commerce │ │ │ │ └── scaffolding │ │ │ │ └── product │ │ │ │ └── .content.xml │ │ │ └── libs │ │ │ ├── cif │ │ │ └── .content.xml │ │ │ ├── commerce │ │ │ ├── config │ │ │ │ └── org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-cif-omnisearch.xml │ │ │ └── gui │ │ │ │ ├── clientlibs │ │ │ │ └── configbrowser │ │ │ │ │ ├── .content.xml │ │ │ │ │ ├── js.txt │ │ │ │ │ └── js │ │ │ │ │ ├── actions │ │ │ │ │ └── delete.js │ │ │ │ │ └── renderconditions │ │ │ │ │ └── renderconditions.js │ │ │ │ ├── components │ │ │ │ ├── authoring │ │ │ │ │ └── editor │ │ │ │ │ │ └── pagepreview │ │ │ │ │ │ └── clientlibs │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ ├── js.txt │ │ │ │ │ │ └── pagepreview.js │ │ │ │ ├── common │ │ │ │ │ ├── cifcategoryfield │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ ├── CIFCategoryFieldHelper.java │ │ │ │ │ │ ├── carditem │ │ │ │ │ │ │ └── carditem.html │ │ │ │ │ │ ├── cifcategoryfield.html │ │ │ │ │ │ ├── clientlibs │ │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ │ ├── cifcategorypicker.js │ │ │ │ │ │ │ └── js.txt │ │ │ │ │ │ ├── columnitem │ │ │ │ │ │ │ └── columnitem.html │ │ │ │ │ │ ├── columnitempreview │ │ │ │ │ │ │ ├── ColumnItemPreviewHelper.java │ │ │ │ │ │ │ └── columnitempreview.html │ │ │ │ │ │ ├── datasources │ │ │ │ │ │ │ └── children │ │ │ │ │ │ │ │ └── children.java │ │ │ │ │ │ └── listitem │ │ │ │ │ │ │ └── listitem.html │ │ │ │ │ ├── cifpicker │ │ │ │ │ │ └── clientlibs │ │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ │ ├── cifpicker.js │ │ │ │ │ │ │ └── js.txt │ │ │ │ │ └── cifproductfield │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ ├── CIFProductFieldHelper.java │ │ │ │ │ │ ├── ViewHelper.java │ │ │ │ │ │ ├── carditem │ │ │ │ │ │ └── carditem.html │ │ │ │ │ │ ├── cifproductfield.html │ │ │ │ │ │ ├── clientlibs │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ ├── cifproductpicker.js │ │ │ │ │ │ └── js.txt │ │ │ │ │ │ ├── columnitem │ │ │ │ │ │ └── columnitem.html │ │ │ │ │ │ ├── columnitempreview │ │ │ │ │ │ ├── ColumnItemPreviewHelper.java │ │ │ │ │ │ └── columnitempreview.html │ │ │ │ │ │ ├── listitem │ │ │ │ │ │ └── listitem.html │ │ │ │ │ │ └── suggestion │ │ │ │ │ │ └── suggestion.jsp │ │ │ │ └── configuration │ │ │ │ │ ├── columnpreview │ │ │ │ │ └── columnpreview.html │ │ │ │ │ ├── columnviewitem │ │ │ │ │ └── columnviewitem.html │ │ │ │ │ └── page │ │ │ │ │ ├── .content.xml │ │ │ │ │ ├── _cq_dialog │ │ │ │ │ └── .content.xml │ │ │ │ │ ├── clientlibs │ │ │ │ │ ├── .content.xml │ │ │ │ │ ├── css.txt │ │ │ │ │ ├── css │ │ │ │ │ │ └── configurationpage.css │ │ │ │ │ ├── js.txt │ │ │ │ │ └── js │ │ │ │ │ │ └── configurationpage.js │ │ │ │ │ └── template │ │ │ │ │ └── .content.xml │ │ │ │ └── content │ │ │ │ ├── common │ │ │ │ ├── cifcategoryfield │ │ │ │ │ ├── .content.xml │ │ │ │ │ ├── columnpreview │ │ │ │ │ │ └── .content.xml │ │ │ │ │ └── picker │ │ │ │ │ │ └── .content.xml │ │ │ │ └── cifproductfield │ │ │ │ │ ├── .content.xml │ │ │ │ │ ├── columnpreview │ │ │ │ │ └── .content.xml │ │ │ │ │ ├── picker │ │ │ │ │ └── .content.xml │ │ │ │ │ ├── pickerpage │ │ │ │ │ └── .content.xml │ │ │ │ │ └── suggestion │ │ │ │ │ └── .content.xml │ │ │ │ ├── configuration │ │ │ │ ├── .content.xml │ │ │ │ └── createconfiguration │ │ │ │ │ └── .content.xml │ │ │ │ └── products │ │ │ │ └── _jcr_content │ │ │ │ └── views │ │ │ │ └── column │ │ │ │ └── .content.xml │ │ │ ├── cq │ │ │ └── core │ │ │ │ └── content │ │ │ │ └── nav │ │ │ │ └── tools │ │ │ │ └── cloudservices │ │ │ │ └── cifconfig │ │ │ │ └── .content.xml │ │ │ ├── dam │ │ │ └── content │ │ │ │ └── schemaeditors │ │ │ │ └── forms │ │ │ │ └── default │ │ │ │ └── items │ │ │ │ └── tabs │ │ │ │ └── items │ │ │ │ └── tab6 │ │ │ │ └── .content.xml │ │ │ └── wcm │ │ │ └── core │ │ │ └── content │ │ │ └── editor │ │ │ └── _jcr_content │ │ │ └── content │ │ │ └── items │ │ │ └── content.xml │ └── tests │ │ ├── .prettierignore │ │ ├── .prettierrc │ │ ├── karma.conf.js │ │ ├── package-lock.json │ │ ├── package.json │ │ └── src │ │ ├── CIF.js │ │ └── libs │ │ └── commerce │ │ └── gui │ │ └── components │ │ ├── authoring │ │ └── editor │ │ │ └── pagepreview │ │ │ └── PagePreviewTest.js │ │ └── common │ │ ├── cifcategoryfield │ │ └── CifCategoryPickerTest.js │ │ ├── cifpicker │ │ └── CifPickerTest.js │ │ └── cifproductfield │ │ └── CifProductPickerTest.js └── cif-virtual-catalog │ ├── pom.xml │ └── src │ └── main │ └── content │ ├── META-INF │ └── vault │ │ └── filter.xml │ └── jcr_root │ ├── _oak_index │ └── .content.xml │ ├── apps │ └── commerce │ │ └── gui │ │ └── content │ │ └── products │ │ └── folderproperties │ │ └── .content.xml │ └── libs │ └── commerce │ ├── components │ ├── ciffolder │ │ ├── .content.xml │ │ ├── _cq_dialog │ │ │ └── .content.xml │ │ └── dialog.xml │ ├── cifimage │ │ └── cifimage.html │ ├── cifrendercondition │ │ └── cifrendercondition.jsp │ └── cifrootfolder │ │ ├── .content.xml │ │ ├── _cq_dialog │ │ └── .content.xml │ │ ├── dialog.xml │ │ ├── include │ │ └── include.jsp │ │ └── reference │ │ └── reference.html │ ├── config │ ├── org.apache.sling.jcr.repoinit.RepositoryInitializer-default.config │ └── org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-virtual-commerce.xml │ └── gui │ ├── components │ ├── admin │ │ ├── folder │ │ │ └── include │ │ │ │ └── include.jsp │ │ └── products │ │ │ ├── bindproducttreewizard │ │ │ ├── clientlibs │ │ │ │ ├── .content.xml │ │ │ │ ├── bindproducttreewizard.css │ │ │ │ ├── bindproducttreewizard.js │ │ │ │ ├── css.txt │ │ │ │ └── js.txt │ │ │ └── commerceproviderdatasource │ │ │ │ └── commerceproviderdatasource.jsp │ │ │ ├── childcard │ │ │ └── childcard.jsp │ │ │ ├── childcolumnitem │ │ │ └── childcolumnitem.jsp │ │ │ ├── childrow │ │ │ └── childrow.jsp │ │ │ └── products.jsp │ ├── authoring │ │ └── assetfinder │ │ │ └── product │ │ │ └── clientlibs │ │ │ └── ProductAssetPanel.js │ └── common │ │ └── productsearchdatasource │ │ └── productsearchdatasource.jsp │ └── content │ ├── common │ └── productfield │ │ └── picker │ │ └── search │ │ ├── .content.xml │ │ └── views │ │ └── card │ │ └── datasource │ │ └── .content.xml │ └── products │ ├── .content.xml │ ├── bindproducttreewizard │ └── .content.xml │ ├── folderproperties │ └── _jcr_content │ │ ├── content │ │ └── items │ │ │ └── ref │ │ │ └── .content.xml │ │ └── editcondition.xml │ └── properties │ └── _jcr_content │ └── editcondition │ └── .content.xml ├── it ├── content │ ├── pom.xml │ └── src │ │ └── main │ │ └── content │ │ ├── META-INF │ │ └── vault │ │ │ └── filter.xml │ │ └── jcr_root │ │ ├── apps │ │ └── cloudcommerce │ │ │ └── config │ │ │ ├── com.adobe.cq.commerce.graphql.client.impl.GraphqlClientImpl-default.config │ │ │ ├── com.adobe.cq.commerce.graphql.magento.GraphqlDataServiceImpl-default.config │ │ │ └── org.apache.sling.commons.log.LogManager.factory.config-commerce.xml │ │ ├── conf │ │ └── testproject │ │ │ └── settings │ │ │ └── wcm │ │ │ └── templates │ │ │ ├── category-page │ │ │ ├── .content.xml │ │ │ └── structure │ │ │ │ └── .content.xml │ │ │ └── product-page │ │ │ ├── .content.xml │ │ │ └── structure │ │ │ └── .content.xml │ │ └── content │ │ ├── dam │ │ └── ciftest │ │ │ ├── .content.xml │ │ │ ├── _jcr_content │ │ │ ├── folderThumbnail │ │ │ └── folderThumbnail.dir │ │ │ │ └── .content.xml │ │ │ └── ciftest.jpg │ │ │ ├── .content.xml │ │ │ └── _jcr_content │ │ │ └── renditions │ │ │ ├── cq5dam.thumbnail.140.100.png │ │ │ ├── cq5dam.thumbnail.140.100.png.dir │ │ │ └── .content.xml │ │ │ ├── cq5dam.thumbnail.319.319.png │ │ │ ├── cq5dam.thumbnail.319.319.png.dir │ │ │ └── .content.xml │ │ │ ├── cq5dam.thumbnail.48.48.png │ │ │ ├── cq5dam.thumbnail.48.48.png.dir │ │ │ └── .content.xml │ │ │ ├── cq5dam.web.1280.1280.jpeg │ │ │ ├── cq5dam.web.1280.1280.jpeg.dir │ │ │ └── .content.xml │ │ │ ├── original │ │ │ └── original.dir │ │ │ └── .content.xml │ │ └── testproject │ │ ├── testpdp │ │ └── .content.xml │ │ └── testplp │ │ └── .content.xml ├── http │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── adobe │ │ │ └── cq │ │ │ └── commerce │ │ │ └── it │ │ │ └── http │ │ │ ├── AssetMetadataEditorExtensionIT.java │ │ │ ├── CommerceTestBase.java │ │ │ ├── GraphqlOSGiConfig.java │ │ │ ├── GraphqlProductConsoleIT.java │ │ │ └── PageEditorExtensionIT.java │ │ └── resources │ │ └── com │ │ └── adobe │ │ └── cq │ │ └── commerce │ │ └── it │ │ └── http │ │ ├── identity.jks │ │ ├── magento-graphql-category-products.json │ │ ├── magento-graphql-categorylist-coats.json │ │ ├── magento-graphql-categorylist-empty.json │ │ ├── magento-graphql-categorylist-men.json │ │ ├── magento-graphql-categorylist-root.json │ │ └── magento-graphql-product.json └── mock-server │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── adobe │ │ │ └── cq │ │ │ └── testing │ │ │ └── mockserver │ │ │ ├── MockRequest.java │ │ │ ├── MockResponse.java │ │ │ ├── Request.java │ │ │ ├── RequestResponseRule.java │ │ │ ├── RequestWrapper.java │ │ │ ├── Response.java │ │ │ ├── Rule.java │ │ │ ├── Server.java │ │ │ ├── Servlet.java │ │ │ └── StringComparator.java │ └── resources │ │ └── com │ │ └── adobe │ │ └── cq │ │ └── testing │ │ └── mockserver │ │ ├── identity.jks │ │ └── identity.p12 │ └── test │ └── java │ └── com │ └── adobe │ └── cq │ └── testing │ └── mockserver │ └── junit │ └── ServerRule.java ├── parent ├── eclipse-formatter.xml └── pom.xml └── pom.xml /.circleci/ci/build.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | 'use strict'; 16 | 17 | const ci = new (require('./ci.js'))(); 18 | const path = require('path'); 19 | 20 | ci.context(); 21 | 22 | ci.stage('Project Configuration'); 23 | const configuration = ci.collectConfiguration(); 24 | console.log(configuration); 25 | 26 | ci.stage('Build Project'); 27 | ci.sh('mvn -B clean install -s .circleci/settings.xml'); 28 | 29 | ci.stage('Collect test results'); 30 | const testFolder = path.resolve(process.cwd(), 'test-results/junit'); 31 | ci.sh(`mkdir -p ${testFolder}`); 32 | ci.sh(`find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ${testFolder}/ \\;`); -------------------------------------------------------------------------------- /.circleci/codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: 4 | default: off 5 | unittests: 6 | enabled: true 7 | target: 80% 8 | threshold: 10% 9 | base: auto 10 | flags: unittests 11 | karma: 12 | enabled: true 13 | target: 80% 14 | threshold: 10% 15 | base: auto 16 | flags: karma 17 | patch: 18 | default: off 19 | unittests: 20 | enabled: true 21 | target: 80% 22 | threshold: 10% 23 | base: auto 24 | flags: unittests 25 | karma: 26 | enabled: true 27 | target: 80% 28 | threshold: 10% 29 | base: auto 30 | flags: karma 31 | flags: 32 | unittests: 33 | paths: 34 | - bundles/cif-connector-graphql/ 35 | - bundles/cif-virtual-catalog/ 36 | karma: 37 | paths: 38 | - content/cif-connector/ -------------------------------------------------------------------------------- /.circleci/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | 19 | ossrh 20 | 21 | true 22 | 23 | 24 | gpg 25 | ${env.GPG_PASSPHRASE} 26 | 27 | 28 | 29 | 30 | 31 | 32 | ossrh 33 | ${env.SONATYPE_USER} 34 | ${env.SONATYPE_PASS} 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Adobe Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at Grp-opensourceoffice@adobe.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at [http://contributor-covenant.org/version/1/4][version] 72 | 73 | [homepage]: http://contributor-covenant.org 74 | [version]: http://contributor-covenant.org/version/1/4/ -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thanks for choosing to contribute! 4 | 5 | The following are a set of guidelines to follow when contributing to this project. 6 | 7 | ## Code Of Conduct 8 | 9 | This project adheres to the Adobe [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to the team. 10 | 11 | ## Contributor License Agreement 12 | 13 | All third-party contributions to this project must be accompanied by a signed contributor license agreement. This gives Adobe permission to redistribute your contributions as part of the project. [Sign our CLA](http://opensource.adobe.com/cla.html). You only need to submit an Adobe CLA one time, so if you have submitted one previously, you are good to go! 14 | 15 | ## How to contribute 16 | 17 | New code contributions should be made primarily using GitHub pull requests. This involves creating a fork of the project in your personal space, adding your new code in a branch and triggering a pull request. 18 | 19 | See how to perform pull requests at https://help.github.com/articles/using-pull-requests. 20 | 21 | Please follow the [pull request template](PULL_REQUEST_TEMPLATE.md) when submitting a pull request! 22 | 23 | ## New Feature request 24 | Please follow the [feature template](ISSUE_TEMPLATE/FEATURE_REQUEST.md) to open new feature requests. 25 | 26 | 27 | ## Issues 28 | 29 | Please follow the [issue template](ISSUE_TEMPLATE/BUG_REPORT.md) to open new [issues](https://github.com/adobe/commerce-cif-connector/issues) and join the conversations to provide feedback. 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/BUG_REPORT.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Issue report 3 | about: Having an issue? Please create a report to explain what it is about. 4 | 5 | --- 6 | 7 | ### Expected Behaviour 8 | 9 | ### Actual Behaviour 10 | 11 | ### Reproduce Scenario (including but not limited to) 12 | 13 | #### Steps to Reproduce 14 | 15 | #### Platform and Version 16 | 17 | #### Sample Code that illustrates the problem 18 | 19 | #### Logs taken while reproducing problem -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Do you have new ideas for this project? Please fill in a request. 4 | 5 | --- 6 | 7 | ### User Story 8 | 9 | 10 | 11 | ### Description & Motivation 12 | 13 | 14 | ### Deliverables 15 | 16 | 17 | 18 | 19 | 20 | ### Acceptance Criteria 21 | 22 | 23 | 24 | 25 | 26 | ### Verification Steps 27 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Description 4 | 5 | 6 | 7 | ## Related Issue 8 | 9 | 10 | 11 | 12 | 13 | 14 | ## Motivation and Context 15 | 16 | 17 | 18 | ## How Has This Been Tested? 19 | 20 | 21 | 22 | 23 | 24 | ## Screenshots (if appropriate): 25 | 26 | ## Types of changes 27 | 28 | 29 | 30 | - [ ] Bug fix (non-breaking change which fixes an issue) 31 | - [ ] New feature (non-breaking change which adds functionality) 32 | - [ ] Breaking change (fix or feature that would cause existing functionality to change) 33 | 34 | ## Checklist: 35 | 36 | 37 | 38 | 39 | - [ ] I have signed the [Adobe Open Source CLA](http://opensource.adobe.com/cla.html). 40 | - [ ] My change requires a change to the documentation. 41 | - [ ] I have updated the documentation accordingly. 42 | - [ ] I have read the **CONTRIBUTING** document. 43 | - [ ] I have added tests to cover my changes and the overall coverage did not decrease. 44 | - [ ] All unit tests pass on CircleCi. 45 | - [ ] I ran all tests locally and they pass. 46 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name-template: "CIF Connector $NEXT_MINOR_VERSION" 2 | categories: 3 | - title: "Features & Enhancements" 4 | labels: 5 | - "feature" 6 | - "enhancement" 7 | - title: "Bug Fixes" 8 | labels: 9 | - "fix" 10 | - "bugfix" 11 | - "bug" 12 | exclude-labels: 13 | - "releng" 14 | template: | 15 | ## Changes 16 | This release introduces the following new features and bug fixes: 17 | 18 | $CHANGES 19 | 20 | For a list containing all the fixed issues see [all the change details](https://github.com/adobe/commerce-cif-connector/compare/$PREVIOUS_TAG...cif-connector-reactor-$NEXT_MINOR_VERSION). 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .classpath 3 | .metadata 4 | .project 5 | .settings 6 | .vscode 7 | **/target/**/* 8 | *.iml 9 | pom.xml.releaseBackup 10 | release.properties 11 | .DS_Store 12 | **/node_modules/ 13 | **/coverage/ 14 | **/karma-junit/ -------------------------------------------------------------------------------- /VERSIONS.md: -------------------------------------------------------------------------------- 1 | # CIF Connector Historical System Requirements 2 | 3 | See below for a full list of minimum system requirements for historical versions of the CIF Connector: 4 | 5 | | CIF Connector | AEM 6.4 | AEM 6.5 | Magento | Java | 6 | | ------------- | ------- | ------- | ------------- | ---- | 7 | | 1.8.1 | 6.4.4.0 | 6.5.0 | 2.4.0 | 1.8 | 8 | | 1.8.0 | 6.4.4.0 | 6.5.0 | 2.4.0 | 1.8 | 9 | | 1.7.0 | 6.4.4.0 | 6.5.0 | 2.4.0 | 1.8 | 10 | | 1.6.0 | 6.4.4.0 | 6.5.0 | 2.4.0 | 1.8 | 11 | | 1.5.0 | 6.4.4.0 | 6.5.0 | 2.4.0 | 1.8 | 12 | | 1.4.0 | 6.4.4.0 | 6.5.0 | 2.4.0 | 1.8 | 13 | | 1.3.0 | 6.4.4.0 | 6.5.0 | 2.3.4 & 2.3.5 | 1.8 | 14 | | 1.2.0 | 6.4.4.0 | 6.5.0 | 2.3.4 & 2.3.5 | 1.8 | 15 | | 1.1.0 | 6.4.4.0 | 6.5.0 | 2.3.4 & 2.3.5 | 1.8 | 16 | | 1.0.0 | 6.4.4.0 | 6.5.0 | 2.3.4 & 2.3.5 | 1.8 | 17 | | 0.10.0 | 6.4.4.0 | 6.5.0 | 2.3.4 | 1.8 | 18 | | 0.9.0 | 6.4.4.0 | 6.5.0 | 2.3.4 | 1.8 | 19 | | 0.8.1 | 6.4.4.0 | 6.5.0 | 2.3.2 & 2.3.3 | 1.8 | 20 | | 0.8.0 | 6.4.4.0 | 6.5.0 | 2.3.2 & 2.3.3 | 1.8 | 21 | | 0.7.0 | 6.4.4.0 | 6.5.0 | 2.3.2 & 2.3.3 | 1.8 | 22 | | 0.6.0 | 6.4.4.0 | 6.5.0 | 2.3.2 & 2.3.3 | 1.8 | 23 | | 0.5.0 (all) | 6.4.4.0 | 6.5.0 | 2.3.1 & 2.3.2 | 1.8 | 24 | | 0.4.0 (all) | 6.4.4.0 | 6.5.0 | 2.3.1 & 2.3.2 | 1.8 | 25 | | 0.3.0 (all) | 6.4.4.0 | 6.5.0 | 2.3.1 & 2.3.2 | 1.8 | 26 | | 0.2.0 (all) | 6.4.4.0 | 6.5.0 | 2.3.1 | 1.8 | 27 | | 0.1.0 (all) | 6.4.4.0 | 6.5.0 | 2.3.1 | 1.8 | 28 | -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/main/java/com/adobe/cq/commerce/graphql/resource/Constants.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.commerce.graphql.resource; 16 | 17 | import static com.adobe.cq.commerce.virtual.catalog.data.Constants.PN_MAGENTO_STORE; 18 | 19 | public class Constants { 20 | 21 | public static final String MAGENTO_GRAPHQL_PROVIDER = "magento-graphql"; 22 | public static final String PRODUCT = "product"; 23 | public static final String VARIANT = "variant"; 24 | public static final String CATEGORY = "category"; 25 | public static final String LEAF_CATEGORY = "isLeaf"; 26 | public static final String HAS_CHILDREN = "hasChildren"; 27 | public static final String IS_ERROR = "isError"; 28 | public static final String SKU = "sku"; 29 | public static final String SLUG = "slug"; 30 | public static final String CIF_ID = "cifId"; 31 | public static final String URL_PATH = "urlPath"; 32 | public static final String PRODUCT_FORMATTED_PRICE = "formattedPrice"; 33 | public static final String STORE_HEADER = "Store"; 34 | public static final String MAGENTO_STORE_PROPERTY = PN_MAGENTO_STORE; 35 | public static final String MAGENTO_ROOT_CATEGORY_ID_PROPERTY = "magentoRootCategoryId"; 36 | } 37 | -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/main/java/com/adobe/cq/commerce/graphql/resource/SyntheticImageResource.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.commerce.graphql.resource; 16 | 17 | import java.util.HashMap; 18 | import java.util.Map; 19 | 20 | import org.apache.sling.api.resource.ResourceResolver; 21 | import org.apache.sling.api.resource.SyntheticResource; 22 | import org.apache.sling.api.resource.ValueMap; 23 | import org.apache.sling.api.wrappers.DeepReadValueMapDecorator; 24 | 25 | import com.adobe.cq.commerce.common.ValueMapDecorator; 26 | import com.day.cq.commons.DownloadResource; 27 | import com.day.cq.commons.ImageResource; 28 | 29 | public class SyntheticImageResource extends ImageResource { 30 | 31 | public static final String IMAGE_RESOURCE_TYPE = "commerce/components/product/image"; 32 | 33 | /** 34 | * Creates an ImageResource based on a SyntheticResource. 35 | * This class returns the path of the SyntheticResource when {@link ImageResource#getFileReference()} is called. 36 | * 37 | * @param resolver The resource resolver. 38 | * @param path The resource path. 39 | * @param slingResourceType The sling resource type. 40 | * @param url The URL of the image. 41 | */ 42 | public SyntheticImageResource(ResourceResolver resolver, String path, String slingResourceType, String url) { 43 | super(new SyntheticResource(resolver, path, slingResourceType) { 44 | private ValueMap valueMap; 45 | { 46 | Map values = new HashMap<>(); 47 | values.put(DownloadResource.PN_REFERENCE, url); 48 | valueMap = new DeepReadValueMapDecorator(this, new ValueMapDecorator(values)); 49 | } 50 | 51 | @Override 52 | public AdapterType adaptTo(Class type) { 53 | if (ValueMap.class.equals(type)) { 54 | return type.cast(valueMap); 55 | } else { 56 | return super.adaptTo(type); 57 | } 58 | } 59 | }); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/main/java/com/adobe/cq/commerce/gui/components/configuration/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2020 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | @Version("1.6.0") 16 | package com.adobe.cq.commerce.gui.components.configuration; 17 | 18 | import org.osgi.annotation.versioning.Version; -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/java/com/adobe/cq/commerce/graphql/core/SyntheticResourceWithProperties.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.commerce.graphql.core; 16 | 17 | import java.util.Map; 18 | 19 | import org.apache.sling.api.resource.ResourceResolver; 20 | import org.apache.sling.api.resource.SyntheticResource; 21 | import org.apache.sling.api.resource.ValueMap; 22 | 23 | import com.adobe.cq.commerce.common.ValueMapDecorator; 24 | 25 | public class SyntheticResourceWithProperties extends SyntheticResource { 26 | 27 | private Map properties; 28 | 29 | public SyntheticResourceWithProperties(ResourceResolver resourceResolver, String path, String resourceType, 30 | Map properties) { 31 | super(resourceResolver, path, resourceType); 32 | this.properties = properties; 33 | } 34 | 35 | @SuppressWarnings("unchecked") 36 | public AdapterType adaptTo(Class type) { 37 | if (type == ValueMap.class) { 38 | return (AdapterType) new ValueMapDecorator(this.properties); 39 | } 40 | return super.adaptTo(type); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/java/com/adobe/cq/commerce/graphql/magento/GraphqlAemContext.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.commerce.graphql.magento; 16 | 17 | import java.util.Dictionary; 18 | import java.util.Hashtable; 19 | import java.util.Map; 20 | 21 | import org.apache.sling.testing.mock.sling.ResourceResolverType; 22 | import org.osgi.service.cm.Configuration; 23 | import org.osgi.service.cm.ConfigurationAdmin; 24 | 25 | import io.wcm.testing.mock.aem.junit.AemContext; 26 | import io.wcm.testing.mock.aem.junit.AemContextBuilder; 27 | 28 | import static org.apache.sling.testing.mock.caconfig.ContextPlugins.CACONFIG; 29 | 30 | public final class GraphqlAemContext { 31 | 32 | public final static String CATALOG_IDENTIFIER = "my-catalog"; 33 | 34 | private GraphqlAemContext() {} 35 | 36 | public static AemContext createContext(Map contentPaths) { 37 | 38 | AemContext context = new AemContextBuilder(ResourceResolverType.JCR_MOCK).plugin(CACONFIG) 39 | .beforeSetUp(ctx -> { 40 | ConfigurationAdmin configurationAdmin = ctx.getService(ConfigurationAdmin.class); 41 | Configuration serviceConfiguration = configurationAdmin.getConfiguration( 42 | "org.apache.sling.caconfig.resource.impl.def.DefaultContextPathStrategy"); 43 | 44 | Dictionary props = new Hashtable<>(); 45 | props.put("configRefResourceNames", new String[] { ".", "jcr:content" }); 46 | props.put("configRefPropertyNames", "cq:conf"); 47 | serviceConfiguration.update(props); 48 | 49 | serviceConfiguration = configurationAdmin.getConfiguration( 50 | "org.apache.sling.caconfig.resource.impl.def.DefaultConfigurationResourceResolvingStrategy"); 51 | props = new Hashtable<>(); 52 | props.put("configPath", "/conf"); 53 | serviceConfiguration.update(props); 54 | 55 | serviceConfiguration = configurationAdmin.getConfiguration( 56 | "org.apache.sling.caconfig.impl.ConfigurationResolverImpl"); 57 | props = new Hashtable<>(); 58 | props.put("configBucketNames", new String[] { "settings" }); 59 | serviceConfiguration.update(props); 60 | }) 61 | .build(); 62 | // Load page structure 63 | contentPaths.entrySet().iterator().forEachRemaining(entry -> { 64 | context.load().json(entry.getValue(), entry.getKey()); 65 | }); 66 | return context; 67 | 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/java/com/adobe/cq/commerce/graphql/magento/MockGraphqlDataServiceConfiguration.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.commerce.graphql.magento; 16 | 17 | import java.lang.annotation.Annotation; 18 | 19 | public class MockGraphqlDataServiceConfiguration implements Annotation, GraphqlDataServiceConfiguration { 20 | 21 | public static final int ROOT_CATEGORY_ID = 4; 22 | 23 | private Boolean productCachingEnabled; 24 | 25 | @Override 26 | public String identifier() { 27 | return GraphqlDataServiceConfiguration.CONNECTOR_ID_DEFAULT; 28 | } 29 | 30 | @Override 31 | public boolean productCachingEnabled() { 32 | return productCachingEnabled != null ? productCachingEnabled : GraphqlDataServiceConfiguration.PRODUCT_CACHING_ENABLED_DEFAULT; 33 | } 34 | 35 | @Override 36 | public int productCachingTimeMinutes() { 37 | return GraphqlDataServiceConfiguration.PRODUCT_CACHING_TIME_DEFAULT; 38 | } 39 | 40 | @Override 41 | public boolean categoryCachingEnabled() { 42 | return GraphqlDataServiceConfiguration.CATEGORY_CACHING_ENABLED_DEFAULT; 43 | } 44 | 45 | @Override 46 | public int productCachingSize() { 47 | return GraphqlDataServiceConfiguration.PRODUCT_CACHE_SIZE; 48 | } 49 | 50 | @Override 51 | public int categoryCachingSize() { 52 | return GraphqlDataServiceConfiguration.CATEGORY_CACHE_SIZE; 53 | } 54 | 55 | @Override 56 | public int categoryCachingTimeMinutes() { 57 | return GraphqlDataServiceConfiguration.CATEGORY_CACHING_TIME_DEFAULT; 58 | } 59 | 60 | @Override 61 | public Class annotationType() { 62 | return GraphqlDataServiceConfiguration.class; 63 | } 64 | 65 | public void setProductCachingEnabled(boolean productCachingEnabled) { 66 | this.productCachingEnabled = productCachingEnabled; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/commerce-categories-omnisearch-request.json: -------------------------------------------------------------------------------- 1 | { 2 | "selectionId": [ 3 | "id" 4 | ], 5 | "root": [ 6 | "/var/commerce/products" 7 | ], 8 | "_commerce_limit": "20", 9 | "fulltext": [ 10 | "5.5.5" 11 | ], 12 | ":cq_csrf_token": [ 13 | "eyJleHAiOjE1ODI2MTk2NTMsImlhdCI6MTU4MjYxOTA1M30.HILDt1QJBV20ieEPGEIc1xP8yg2_BM9P9MfCntdVUzw" 14 | ], 15 | "_commerce_commerce_type": "category", 16 | "_commerce_offset": "0" 17 | } -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/commerce-products-omni-search-request.json: -------------------------------------------------------------------------------- 1 | { 2 | "path": "/var/commerce/products", 3 | "p.guessTotal": [ 4 | "true" 5 | ], 6 | "property.value": "product", 7 | "_commerce_limit": "20", 8 | "fulltext": [ 9 | "gloves" 10 | ], 11 | "property": "cq:commerceType", 12 | "type": "nt:unstructured", 13 | "_commerce_offset": "20", 14 | "_": [ 15 | "1511171777780" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/commerce-products-omni-search-request2.json: -------------------------------------------------------------------------------- 1 | { 2 | "path": "/var/commerce/products", 3 | "p.guessTotal": [ 4 | "true" 5 | ], 6 | "property.value": "product", 7 | "_commerce_limit": "2", 8 | "fulltext": [ 9 | "gloves" 10 | ], 11 | "property": "cq:commerceType", 12 | "type": "nt:unstructured", 13 | "_commerce_offset": "4", 14 | "_": [ 15 | "1511171777780" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/commerce-products-omni-search-request3.json: -------------------------------------------------------------------------------- 1 | { 2 | "path": "/var/commerce/products", 3 | "p.guessTotal": [ 4 | "true" 5 | ], 6 | "property.value": "product", 7 | "fulltext": [ 8 | "gloves" 9 | ], 10 | "property": "cq:commerceType", 11 | "type": "nt:unstructured", 12 | "_": [ 13 | "1511171777780" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/context/drop-target-post-processor.json: -------------------------------------------------------------------------------- 1 | { 2 | "postprocessor": { 3 | "jcr:primaryType": "cq:Page", 4 | "jcr:content": { 5 | "jcr:primaryType": "cq:PageContent", 6 | "existingMultiValue": { 7 | "items": [ 8 | "a" 9 | ] 10 | }, 11 | "noExistingMultiValue": { 12 | 13 | }, 14 | "existingSingleValue": { 15 | "items": "a" 16 | }, 17 | "noExistingComposite": { 18 | 19 | }, 20 | "existingComposite": { 21 | "subNode": { 22 | "item0": { 23 | "jcr:primaryType": "nt:unstructured", 24 | "link": "a" 25 | }, 26 | "item1": { 27 | "jcr:primaryType": "nt:unstructured", 28 | "link": "c" 29 | } 30 | } 31 | } 32 | } 33 | }, 34 | "mockproduct": { 35 | "slug": "mockslug" 36 | }, 37 | "missingslug": {} 38 | } -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/context/graphql-client-adapter-factory-context.json: -------------------------------------------------------------------------------- 1 | { 2 | "pageA": { 3 | "jcr:primaryType": "cq:Page", 4 | "jcr:content": { 5 | "jcr:primaryType":"cq:PageContent", 6 | "cq:catalogIdentifier": "my-catalog", 7 | "cq:magentoStore": "default", 8 | "magentoRootCategoryId": "4" 9 | } 10 | }, 11 | "pageB": { 12 | "jcr:primaryType": "cq:Page", 13 | "jcr:content": { 14 | "jcr:primaryType":"cq:PageContent", 15 | "cq:catalogIdentifier": "my-catalog", 16 | "cq:magentoStore": "default", 17 | "magentoRootCategoryId": "4" 18 | }, 19 | "pageC": { 20 | "jcr:primaryType": "cq:Page", 21 | "jcr:content": { 22 | "jcr:primaryType":"cq:PageContent" 23 | } 24 | } 25 | }, 26 | "pageD": { 27 | "jcr:primaryType": "cq:Page", 28 | "jcr:content": { 29 | "jcr:primaryType":"cq:PageContent" 30 | } 31 | }, 32 | "pageE": { 33 | "jcr:primaryType": "cq:Page", 34 | "jcr:content": { 35 | "jcr:primaryType":"cq:PageContent", 36 | "cq:catalogIdentifier": "my-catalog", 37 | "cq:magentoStore": "default", 38 | "magentoRootCategoryId": "a" 39 | } 40 | }, 41 | "pageF": { 42 | "jcr:primaryType": "cq:Page", 43 | "jcr:content": { 44 | "jcr:primaryType": "cq:PageContent", 45 | "cq:conf": "/conf/test-config" 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/context/graphql-resource-provider-context.json: -------------------------------------------------------------------------------- 1 | { 2 | "commerce": { 3 | "jcr:primaryType": "sling:Folder", 4 | "products": { 5 | "jcr:primaryType": "sling:Folder", 6 | "magento-graphql": { 7 | "jcr:primaryType": "sling:Folder", 8 | "cq:catalogDataResourceProviderFactory": "magento-graphql", 9 | "cq:catalogIdentifier": "default", 10 | "cq:magentoStore": "default", 11 | "magentoRootCategoryId": "4" 12 | } 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/context/is-product-detail-page-servlet-test-context.json: -------------------------------------------------------------------------------- 1 | { 2 | "nopage": { 3 | }, 4 | 5 | "nocontentpage": { 6 | "jcr:primaryType": "cq:Page" 7 | }, 8 | 9 | "noproductpage": { 10 | "jcr:primaryType": "cq:Page", 11 | "jcr:content": { 12 | "jcr:primaryType": "cq:PageContent" 13 | } 14 | }, 15 | 16 | "validpage": { 17 | "jcr:primaryType": "cq:Page", 18 | "jcr:content": { 19 | "jcr:primaryType": "cq:PageContent", 20 | "product": { 21 | "sling:resourceType": "core/cif/components/commerce/product/v1/product" 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/context/is-product-list-page-servlet-test-context.json: -------------------------------------------------------------------------------- 1 | { 2 | "nopage": { 3 | }, 4 | 5 | "nocontentpage": { 6 | "jcr:primaryType": "cq:Page" 7 | }, 8 | 9 | "noproductlistpage": { 10 | "jcr:primaryType": "cq:Page", 11 | "jcr:content": { 12 | "jcr:primaryType": "cq:PageContent" 13 | } 14 | }, 15 | 16 | "validpage": { 17 | "jcr:primaryType": "cq:Page", 18 | "jcr:content": { 19 | "jcr:primaryType": "cq:PageContent", 20 | "product": { 21 | "sling:resourceType": "core/cif/components/commerce/productlist/v1/productlist" 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/context/jcr-conf-console.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType": "nt:folder", 3 | "testing": { 4 | "jcr:primaryType": "sling:Folder", 5 | "settings": { 6 | "jcr:primaryType": "sling:Folder", 7 | "cloudconfigs": { 8 | "jcr:primaryType": "sling:Folder", 9 | "commerce": { 10 | "jcr:primaryType": "cq:Page", 11 | "jcr:content": { 12 | "jcr:title": "Mock configuration", 13 | "magentoRootCategoryId": "4", 14 | "cq:graphqlClient": "default", 15 | "cq:catalogIdentifier": "my-catalog", 16 | "magentoStore": "4", 17 | "jcr:created": "Thu Feb 06 2020 14:21:13 GMT+0200", 18 | "cq:lastModified": "Thu Feb 06 2020 14:21:13 GMT+0200", 19 | "cq:catalogDataResourceProviderFactory": "magento-graphql" 20 | } 21 | } 22 | } 23 | } 24 | }, 25 | "settings": { 26 | "jcr:primaryType": "sling:Folder", 27 | "cloudconfigs": { 28 | "jcr:primaryType": "sling:Folder" 29 | } 30 | }, 31 | "folder1": { 32 | "jcr:primaryType": "sling:Folder" 33 | }, 34 | "folder2": { 35 | "jcr:primaryType": "sling:OrderedFolder", 36 | "settings": { 37 | "jcr:primaryType": "sling:Folder", 38 | "cloudconfigs": { 39 | "jcr:primaryType": "sling:Folder" 40 | } 41 | } 42 | }, 43 | "folder3": { 44 | "jcr:primaryType": "sling:OrderedFolder", 45 | "folder1": { 46 | "jcr:primaryType": "sling:OrderedFolder" 47 | }, 48 | "folder2": { 49 | "jcr:primaryType": "sling:OrderedFolder", 50 | "settings": { 51 | "jcr:primaryType": "sling:Folder" 52 | } 53 | } 54 | }, 55 | "folder4": { 56 | "jcr:primaryType": "sling:OrderedFolder", 57 | "settings": { 58 | "jcr:primaryType": "sling:Folder", 59 | "cloudconfigs": { 60 | "jcr:primaryType": "sling:Folder" 61 | } 62 | }, 63 | "folder1": { 64 | "jcr:primaryType": "sling:Folder" 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/context/jcr-conf-inheritance.json: -------------------------------------------------------------------------------- 1 | { 2 | "jcr:primaryType": "nt:folder", 3 | "level1": { 4 | "jcr:primaryType": "sling:Folder", 5 | "level2": { 6 | "jcr:primaryType": "sling:Folder", 7 | "settings": { 8 | "jcr:primaryType": "sling:Folder", 9 | "cloudconfigs": { 10 | "jcr:primaryType": "sling:Folder", 11 | "commerce": { 12 | "jcr:primaryType": "cq:Page", 13 | "jcr:content": { 14 | "jcr:title": "Mock configuration", 15 | "magentoGraphqlEndpoint": "/magento/graphql-modified", 16 | "jcr:created": "Thu Feb 06 2020 14:21:13 GMT+0200" 17 | } 18 | } 19 | } 20 | } 21 | }, 22 | "settings": { 23 | "jcr:primaryType": "sling:Folder", 24 | "cloudconfigs": { 25 | "jcr:primaryType": "sling:Folder", 26 | "commerce": { 27 | "jcr:primaryType": "cq:Page", 28 | "jcr:content": { 29 | "jcr:title": "Mock configuration", 30 | "cq:graphqlClient": "not-default", 31 | "magentoStore": "2", 32 | "jcr:created": "Thu Feb 06 2020 14:21:13 GMT+0200" 33 | } 34 | } 35 | } 36 | } 37 | }, 38 | "settings": { 39 | "jcr:primaryType": "sling:Folder", 40 | "cloudconfigs": { 41 | "jcr:primaryType": "sling:Folder", 42 | "commerce": { 43 | "jcr:primaryType": "cq:Page", 44 | "jcr:content": { 45 | "jcr:title": "Mock configuration", 46 | "jcr:language": "en_us", 47 | "magentoGraphqlEndpoint": "/magento/graphql", 48 | "magentoRootCategoryId": "4", 49 | "cq:graphqlClient": "default", 50 | "cq:catalogIdentifier": "my-catalog", 51 | "magentoStore": "4", 52 | "jcr:created": "Thu Feb 06 2020 14:21:13 GMT+0200", 53 | "cq:catalogDataResourceProviderFactory": "magento-graphql" 54 | } 55 | } 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/context/jcr-conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "cloudconfigs": { 3 | "jcr:primaryType": "sling:Folder", 4 | "commerce": { 5 | "jcr:primaryType": "cq:Page", 6 | "magentoRootCategoryId": "4", 7 | "cq:graphqlClient": "default", 8 | "cq:catalogIdentifier": "my-catalog", 9 | "magentoStore": "default", 10 | "jcr:created": "Thu Feb 06 2020 14:21:13 GMT+0200", 11 | "cq:catalogDataResourceProviderFactory": "magento-graphql" 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/graphql-queries/category-products.txt: -------------------------------------------------------------------------------- 1 | {category(id:19){products(sort:{name:ASC},currentPage:1,pageSize:10){total_count,items{__typename,id,sku,name,url_key,updated_at,thumbnail{url}}}}} -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/graphql-queries/category-search.txt: -------------------------------------------------------------------------------- 1 | {categoryList(filters:{name:{match:"1.2.3.4.5"}}){id,name,url_path,url_key}} -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/graphql-queries/categorylist-by-urlkey.txt: -------------------------------------------------------------------------------- 1 | {categoryList(filters:{url_key:{eq:"venia-dresses"}}){id,name,url_path,url_key,product_count,children_count,children{id,name,url_path,url_key,product_count,children_count}}} -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/graphql-queries/product-by-sku.txt: -------------------------------------------------------------------------------- 1 | {products(filter:{sku:{eq:"meskwielt"}}){items{__typename,id,sku,name,description{html},image{url},thumbnail{url},url_key,updated_at,created_at,price{regularPrice{amount{currency,value}}},categories{__typename,url_path},... on ConfigurableProduct{variants{product{id,sku,name,description{html},image{url},thumbnail{url},url_key,updated_at,created_at,price{regularPrice{amount{currency,value}}}}}}}}} -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/graphql-queries/products-empty-search-for-category.txt: -------------------------------------------------------------------------------- 1 | {products(filter:{category_id:{eq:"11"},price:{from:""}},sort:{relevance:DESC},currentPage:0,pageSize:3){items{__typename,id,sku,name,url_key,updated_at,thumbnail{url}}}} -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/graphql-queries/products-empty-search.txt: -------------------------------------------------------------------------------- 1 | {products(filter:{price:{from:""}},sort:{relevance:DESC},currentPage:0,pageSize:3){items{__typename,id,sku,name,url_key,updated_at,thumbnail{url}}}} -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/graphql-queries/products-search-for-category.txt: -------------------------------------------------------------------------------- 1 | {products(search:"coats",filter:{category_id:{eq:"11"}},sort:{relevance:DESC},currentPage:0,pageSize:3){items{__typename,id,sku,name,url_key,updated_at,thumbnail{url}}}} -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/graphql-queries/products-search.txt: -------------------------------------------------------------------------------- 1 | {products(search:"coats",sort:{relevance:DESC},currentPage:0,pageSize:3){items{__typename,id,sku,name,url_key,updated_at,thumbnail{url}}}} -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0 6 | 7 | 8 | 9 | 10 | 11 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 12 | 13 | 14 | 15 | 16 | 17 | 18 | src/test/resources/test-queries/graphql-requests.log 19 | false 20 | 21 | 22 | 23 | DEBUG 24 | NEUTRAL 25 | DENY 26 | 27 | 28 | 29 | 30 | 31 | return message.contains("{dummy}"); 32 | 33 | NEUTRAL 34 | DENY 35 | 36 | 37 | 38 | 39 | %replace(%msg){'Executing GraphQL query: ', ''}%n%n 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/magento-graphql-category-products-page1.json: -------------------------------------------------------------------------------- 1 | { 2 | "category": { 3 | "products": { 4 | "total_count": 8, 5 | "items": [ 6 | { 7 | "__typename": "SimpleProduct", 8 | "id": 1, 9 | "sku": "product-1" 10 | }, 11 | { 12 | "__typename": "SimpleProduct", 13 | "id": 2, 14 | "sku": "product-2" 15 | }, 16 | { 17 | "__typename": "SimpleProduct", 18 | "id": 3, 19 | "sku": "product-3" 20 | } 21 | ] 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/magento-graphql-category-products-page2.json: -------------------------------------------------------------------------------- 1 | { 2 | "category": { 3 | "products": { 4 | "total_count": 8, 5 | "items": [ 6 | { 7 | "__typename": "SimpleProduct", 8 | "id": 4, 9 | "sku": "product-4" 10 | }, 11 | { 12 | "__typename": "SimpleProduct", 13 | "id": 5, 14 | "sku": "product-5" 15 | }, 16 | { 17 | "__typename": "SimpleProduct", 18 | "id": 6, 19 | "sku": "product-6" 20 | } 21 | ] 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/magento-graphql-category-products-page3.json: -------------------------------------------------------------------------------- 1 | { 2 | "category": { 3 | "products": { 4 | "total_count": 8, 5 | "items": [ 6 | { 7 | "__typename": "SimpleProduct", 8 | "id": 7, 9 | "sku": "product-7" 10 | }, 11 | { 12 | "__typename": "SimpleProduct", 13 | "id": 8, 14 | "sku": "product-8" 15 | } 16 | ] 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/magento-graphql-category-search.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "categoryList": [ 4 | { 5 | "id": 1729, 6 | "name": "Category 41.2.3.4.5", 7 | "url_path": "category-41/category-41-2/category-41-2-3/category-41-2-3-4/category-41-2-3-4-5", 8 | "url_key": "category-41-2-3-4-5" 9 | }, 10 | { 11 | "id": 48379, 12 | "name": "Category 51.2.3.4.5", 13 | "url_path": "category-51/category-51-2/category-51-2-3/category-51-2-3-4/category-51-2-3-4-5", 14 | "url_key": "category-51-2-3-4-5" 15 | } 16 | ] 17 | } 18 | } -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/magento-graphql-categorylist-coats.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "categoryList": [ 4 | { 5 | "id": 19, 6 | "name": "Coats", 7 | "url_path": "men/coats", 8 | "url_key": "coats", 9 | "product_count": 0, 10 | "children_count": "0", 11 | "children": [] 12 | }, 13 | { 14 | "id": 25, 15 | "name": "Coats", 16 | "url_path": "women/coats", 17 | "url_key": "coats", 18 | "product_count": 0, 19 | "children_count": "0", 20 | "children": [] 21 | } 22 | ] 23 | } 24 | } -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/magento-graphql-categorylist-dresses.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "categoryList": [ 4 | { 5 | "id": 37, 6 | "name": "Dresses", 7 | "url_path": "venia-dresses", 8 | "url_key": "venia-dresses", 9 | "product_count": 12, 10 | "children_count": "0", 11 | "children": [] 12 | } 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/magento-graphql-categorylist-empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "categoryList": [] 4 | } 5 | } -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/magento-graphql-categorylist-root.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "categoryList": [ 4 | { 5 | "id": 4, 6 | "name": "Default Category", 7 | "url_path": null, 8 | "url_key": "default-category", 9 | "product_count": 1, 10 | "children_count": "20", 11 | "children": [ 12 | { 13 | "id": 37, 14 | "name": "Dresses", 15 | "url_path": "venia-dresses", 16 | "url_key": "venia-dresses", 17 | "product_count": 12, 18 | "children_count": "0" 19 | }, 20 | { 21 | "id": 34, 22 | "name": "Bottoms", 23 | "url_path": "venia-bottoms", 24 | "url_key": "venia-bottoms", 25 | "product_count": 0, 26 | "children_count": "2" 27 | }, 28 | { 29 | "id": 31, 30 | "name": "Tops", 31 | "url_path": "venia-tops", 32 | "url_key": "venia-tops", 33 | "product_count": 0, 34 | "children_count": "2" 35 | }, 36 | { 37 | "id": 27, 38 | "name": "Accessories", 39 | "url_path": "venia-accessories", 40 | "url_key": "venia-accessories", 41 | "product_count": 14, 42 | "children_count": "3" 43 | }, 44 | { 45 | "id": 38, 46 | "name": "Shop The Look", 47 | "url_path": "shop-the-look", 48 | "url_key": "shop-the-look", 49 | "product_count": 0, 50 | "children_count": "6" 51 | }, 52 | { 53 | "id": 46, 54 | "name": "Software", 55 | "url_path": "software", 56 | "url_key": "software", 57 | "product_count": 3, 58 | "children_count": "0" 59 | }, 60 | { 61 | "id": 47, 62 | "name": "New Products", 63 | "url_path": "new-products3", 64 | "url_key": "new-products3", 65 | "product_count": 2, 66 | "children_count": "0" 67 | } 68 | ] 69 | } 70 | ] 71 | } 72 | } -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/magento-graphql-error.json: -------------------------------------------------------------------------------- 1 | { 2 | "errors": [ 3 | { 4 | "message": "Cannot query field \"categoriess\" on type \"ProductInterface\".", 5 | "category": "graphql", 6 | "locations": [ 7 | { 8 | "line": 23, 9 | "column": 9 10 | } 11 | ] 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/magento-graphql-no-product.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "products": { 4 | "total_count": 0, 5 | "items": [] 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/magento-graphql-other-product.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "products": { 4 | "total_count": 1, 5 | "items": [ 6 | { 7 | "__typename": "DownloadableProduct", 8 | "id": 1, 9 | "sku": "24-MB01", 10 | "name": "Joust Duffle Bag", 11 | "description": { 12 | "html": "The sporty Joust Duffle Bag can't be beat" 13 | }, 14 | "image": { 15 | "url": "http://hostname/pub/media/catalog/product/mb01-blue-0.jpg" 16 | }, 17 | "thumbnail": { 18 | "url": "http://hostname/pub/media/catalog/product/mb01-blue-0.jpg" 19 | }, 20 | "url_key": "joust-duffle-bag", 21 | "updated_at": "2019-05-21 11:54:47", 22 | "created_at": "2019-05-21 11:54:47", 23 | "price": { 24 | "regularPrice": { 25 | "amount": { 26 | "currency": "USD", 27 | "value": 34 28 | } 29 | } 30 | }, 31 | "categories": [ 32 | { 33 | "__typename": "CategoryTree", 34 | "url_path": "coats" 35 | }, 36 | { 37 | "__typename": "CategoryTree", 38 | "url_path": "coats/men" 39 | } 40 | ] 41 | } 42 | ] 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/magento-graphql-simple-product.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "products": { 4 | "total_count": 1, 5 | "items": [ 6 | { 7 | "__typename": "SimpleProduct", 8 | "id": 1, 9 | "sku": "24-MB01", 10 | "name": "Joust Duffle Bag", 11 | "description": { 12 | "html": "The sporty Joust Duffle Bag can't be beat" 13 | }, 14 | "image": { 15 | "url": "http://hostname/pub/media/catalog/product/mb01-blue-0.jpg" 16 | }, 17 | "thumbnail": { 18 | "url": "http://hostname/pub/media/catalog/product/mb01-blue-0.jpg" 19 | }, 20 | "url_key": "joust-duffle-bag", 21 | "updated_at": "2019-05-21 11:54:47", 22 | "created_at": "2019-05-21 11:54:47", 23 | "price": { 24 | "regularPrice": { 25 | "amount": { 26 | "currency": "USD", 27 | "value": 34 28 | } 29 | } 30 | }, 31 | "categories": [ 32 | { 33 | "__typename": "CategoryTree", 34 | "url_path": "coats" 35 | }, 36 | { 37 | "__typename": "CategoryTree", 38 | "url_path": "coats/men" 39 | } 40 | ] 41 | } 42 | ] 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/sample-graphql-generic-response.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "list": ["test", "test2"] 4 | } 5 | } -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/test-queries/README.md: -------------------------------------------------------------------------------- 1 | # GraphQL queries 2 | 3 | This folder contains the list of GraphQL queries "generated" by the connector during unit testing. This can help developers understand the types of queries executed by the connector, especially when implementing a 3rd-party integration for another commerce platform. 4 | 5 | Due to the limitations of unit testing, we do not guarantee that this list covers all the queries generated by the connector in a real production setup. 6 | 7 | The file `graphql-requests.log` is generated automatically by the logger configured in [../logback-test.xml](../logback-test.xml), do NOT edit it manually. -------------------------------------------------------------------------------- /bundles/cif-connector-graphql/src/test/resources/test-queries/graphql-requests.log: -------------------------------------------------------------------------------- 1 | {products(filter:{sku:{eq:"meskwielt"}}){items{__typename,id,sku,name,description{html},image{url},thumbnail{url},url_key,updated_at,created_at,price{regularPrice{amount{currency,value}}},categories{__typename,url_path},... on ConfigurableProduct{variants{product{id,sku,name,description{html},image{url},thumbnail{url},url_key,updated_at,created_at,price{regularPrice{amount{currency,value}}}}}}}}} 2 | 3 | {categoryList(filters:{name:{match:"1.2.3.4.5"}}){id,name,url_path,url_key}} 4 | 5 | {categoryList(filters:{ids:{eq:"1"}}){id,name,url_path,url_key,product_count,children_count,children{id,name,url_path,url_key,product_count,children_count}}} 6 | 7 | {category(id:19){products(sort:{name:ASC},currentPage:1,pageSize:10){total_count,items{__typename,id,sku,name,url_key,updated_at,thumbnail{url}}}}} 8 | 9 | {categoryList(filters:{url_key:{eq:"venia-dresses"}}){id,name,url_path,url_key,product_count,children_count,children{id,name,url_path,url_key,product_count,children_count}}} 10 | 11 | {products(filter:{category_id:{eq:"11"},price:{from:""}},sort:{relevance:DESC},currentPage:0,pageSize:3){items{__typename,id,sku,name,url_key,updated_at,thumbnail{url}}}} 12 | 13 | {products(search:"coats",sort:{relevance:DESC},currentPage:0,pageSize:3){items{__typename,id,sku,name,url_key,updated_at,thumbnail{url}}}} 14 | 15 | {categoryList(filters:{url_key:{eq:"meskwielt"}}){id,name,url_path,url_key,product_count,children_count,children{id,name,url_path,url_key,product_count,children_count}}} 16 | 17 | {products(search:"coats",filter:{category_id:{eq:"11"}},sort:{relevance:DESC},currentPage:0,pageSize:3){items{__typename,id,sku,name,url_key,updated_at,thumbnail{url}}}} 18 | 19 | {products(filter:{price:{from:""}},sort:{relevance:DESC},currentPage:0,pageSize:3){items{__typename,id,sku,name,url_key,updated_at,thumbnail{url}}}} 20 | 21 | {categoryList(filters:{url_key:{eq:"meskwielt-Purple-XS"}}){id,name,url_path,url_key,product_count,children_count,children{id,name,url_path,url_key,product_count,children_count}}} 22 | 23 | {categoryList(filters:{url_key:{eq:"coats"}}){id,name,url_path,url_key,product_count,children_count,children{id,name,url_path,url_key,product_count,children_count}}} 24 | 25 | {categoryList(filters:{url_key:{eq:"image"}}){id,name,url_path,url_key,product_count,children_count,children{id,name,url_path,url_key,product_count,children_count}}} 26 | 27 | {products(search:"gloves",sort:{relevance:DESC},currentPage:2,pageSize:20){items{__typename,id,sku,name,url_key,updated_at,thumbnail{url}}}} 28 | 29 | {categoryList(filters:{url_key:{eq:"24-MB01"}}){id,name,url_path,url_key,product_count,children_count,children{id,name,url_path,url_key,product_count,children_count}}} 30 | 31 | {products(filter:{sku:{eq:"24-MB01"}}){items{__typename,id,sku,name,description{html},image{url},thumbnail{url},url_key,updated_at,created_at,price{regularPrice{amount{currency,value}}},categories{__typename,url_path},... on ConfigurableProduct{variants{product{id,sku,name,description{html},image{url},thumbnail{url},url_key,updated_at,created_at,price{regularPrice{amount{currency,value}}}}}}}}} 32 | 33 | {categoryList(filters:{ids:{eq:"4"}}){id,name,url_path,url_key,product_count,children_count,children{id,name,url_path,url_key,product_count,children_count}}} 34 | 35 | {category(id:19){products(sort:{name:ASC},currentPage:1,pageSize:20){total_count,items{__typename,id,sku,name,url_key,updated_at,thumbnail{url}}}}} 36 | 37 | -------------------------------------------------------------------------------- /bundles/cif-virtual-catalog/src/main/java/com/adobe/cq/commerce/virtual/catalog/data/CatalogDataResourceProviderFactory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.commerce.virtual.catalog.data; 16 | 17 | import org.apache.sling.api.resource.Resource; 18 | import org.apache.sling.spi.resource.provider.ResourceProvider; 19 | 20 | /** 21 | * Factory for creating catalog data resource providers. 22 | */ 23 | public interface CatalogDataResourceProviderFactory { 24 | /** 25 | * Property name for factory service identifier for OSGi. 26 | */ 27 | String PROPERTY_FACTORY_SERVICE_ID = "catalogDataResourceProviderFactory"; 28 | 29 | /** 30 | * Property name for factory service identifier in root folder. 31 | */ 32 | String PROPERTY_FACTORY_ID = "cq:" + PROPERTY_FACTORY_SERVICE_ID; 33 | 34 | /** 35 | * Creates a new resource provider instance on each call. 36 | * 37 | * @param root the Resource for the root folder of the resource provider 38 | * @return a new ResourceProvider instance 39 | */ 40 | ResourceProvider createResourceProvider(Resource root); 41 | } 42 | -------------------------------------------------------------------------------- /bundles/cif-virtual-catalog/src/main/java/com/adobe/cq/commerce/virtual/catalog/data/CatalogDataResourceProviderManager.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.commerce.virtual.catalog.data; 16 | 17 | import java.util.List; 18 | import java.util.Map; 19 | 20 | import org.apache.sling.api.resource.Resource; 21 | import org.apache.sling.spi.resource.provider.ResourceProvider; 22 | 23 | /** 24 | * Manages the resource registrations for the {@link ResourceProvider}. 25 | */ 26 | public interface CatalogDataResourceProviderManager { 27 | 28 | /** 29 | * Returns the registered resource provider factories. 30 | * 31 | * @return a {@link Map} where a keys are factory identifiers and values are the corresponding resource providers 32 | */ 33 | Map> getProviderFactories(); 34 | 35 | /** 36 | * Returns all the products data roots found in the JCR. 37 | * 38 | * @return The list of data roots. 39 | */ 40 | List getDataRoots(); 41 | } 42 | -------------------------------------------------------------------------------- /bundles/cif-virtual-catalog/src/main/java/com/adobe/cq/commerce/virtual/catalog/data/CatalogIdentifier.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.commerce.virtual.catalog.data; 16 | 17 | import java.util.Collection; 18 | 19 | /** 20 | * Provides details about catalog identifiers (projects in UI) configured for a cloud commerce provider. 21 | */ 22 | public interface CatalogIdentifier { 23 | 24 | /** 25 | * Get a collection of all configured catalog identifiers (project in UI). 26 | * 27 | * @return A collection containing all configured catalog identifiers (project in UI). 28 | */ 29 | Collection getAllCatalogIdentifiers(); 30 | 31 | /** 32 | * Gets the commerce provider name for the current implementation. 33 | * 34 | * @return The name of the commerce provider. 35 | */ 36 | String getCommerceProviderName(); 37 | } 38 | -------------------------------------------------------------------------------- /bundles/cif-virtual-catalog/src/main/java/com/adobe/cq/commerce/virtual/catalog/data/CatalogIdentifierService.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.commerce.virtual.catalog.data; 16 | 17 | import java.util.Collection; 18 | import java.util.Map; 19 | 20 | /** 21 | * Service for getting all catalog identifiers (projects in UI) for all cloud commerce provider implementations. 22 | */ 23 | public interface CatalogIdentifierService { 24 | 25 | /** 26 | * Get all catalog identifiers for all cloud commerce provider implementations. 27 | * 28 | * @return A map where the keys are the names of the commerce providers and the values are a collection of all 29 | * catalog identifiers for that specific commerce provider. 30 | */ 31 | Map> getCatalogIdentifiersForAllCommerceProviders(); 32 | } 33 | -------------------------------------------------------------------------------- /bundles/cif-virtual-catalog/src/main/java/com/adobe/cq/commerce/virtual/catalog/data/Constants.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * 4 | * Copyright 2020 Adobe. All rights reserved. 5 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. You may obtain a copy 7 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under 10 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 11 | * OF ANY KIND, either express or implied. See the License for the specific language 12 | * governing permissions and limitations under the License. 13 | * 14 | ******************************************************************************/ 15 | 16 | package com.adobe.cq.commerce.virtual.catalog.data; 17 | 18 | import org.apache.commons.lang3.StringUtils; 19 | 20 | /** 21 | * Constants related to the CIF Connector 22 | */ 23 | public abstract class Constants { 24 | 25 | public static final String CONF_ROOT = "/conf"; 26 | 27 | public static final String CONF_CONTAINER_BUCKET_NAME = "settings"; 28 | 29 | public static final String CLOUDCONFIGS_BUCKET_NAME = "cloudconfigs"; 30 | 31 | public static final String COMMERCE_CONFIG_NAME = "commerce"; 32 | 33 | public static final String COMMERCE_BUCKET_PATH = StringUtils.join(new String[] { CONF_CONTAINER_BUCKET_NAME, CLOUDCONFIGS_BUCKET_NAME, 34 | COMMERCE_CONFIG_NAME }, "/"); 35 | 36 | public static final String CONFIGURATION_NAME = StringUtils.join(new String[] { CLOUDCONFIGS_BUCKET_NAME, COMMERCE_CONFIG_NAME }, "/"); 37 | 38 | public static final String PN_CONF = "cq:conf"; 39 | public static final String PN_MAGENTO_ROOT_CATEGORY_ID = "magentoRootCategoryId"; 40 | public static final String PN_CATALOG_PROVIDER_FACTORY = "cq:catalogDataResourceProviderFactory"; 41 | public static final String PN_CATALOG_IDENTIFIER = "cq:catalogIdentifier"; 42 | public static final String PN_GRAPHQL_CLIENT = "cq:graphqlClient"; 43 | public static final String PN_MAGENTO_STORE = "magentoStore"; 44 | public static final String PN_CATALOG_PATH = "cq:catalogPath"; 45 | 46 | private Constants() { 47 | 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /bundles/cif-virtual-catalog/src/main/java/com/adobe/cq/commerce/virtual/catalog/data/impl/CatalogIdentifierServiceImpl.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.commerce.virtual.catalog.data.impl; 16 | 17 | import java.util.Collection; 18 | import java.util.Map; 19 | import java.util.concurrent.ConcurrentHashMap; 20 | 21 | import org.osgi.service.component.annotations.Component; 22 | import org.osgi.service.component.annotations.Reference; 23 | import org.osgi.service.component.annotations.ReferenceCardinality; 24 | import org.osgi.service.component.annotations.ReferencePolicy; 25 | 26 | import com.adobe.cq.commerce.virtual.catalog.data.CatalogIdentifier; 27 | import com.adobe.cq.commerce.virtual.catalog.data.CatalogIdentifierService; 28 | 29 | /** 30 | * Collects all cloud commerce providers and builds the list of available catalog identifiers (project in UI) for each 31 | * of them. 32 | */ 33 | @Component(service = CatalogIdentifierService.class) 34 | public class CatalogIdentifierServiceImpl implements CatalogIdentifierService { 35 | 36 | private Map> map = new ConcurrentHashMap<>(); 37 | 38 | @Reference( 39 | service = CatalogIdentifier.class, 40 | bind = "bindCatalogIdentifier", 41 | unbind = "unbindCatalogIdentifier", 42 | cardinality = ReferenceCardinality.AT_LEAST_ONE, 43 | policy = ReferencePolicy.DYNAMIC) 44 | protected void bindCatalogIdentifier(CatalogIdentifier identifier, Map properties) { 45 | map.put(identifier.getCommerceProviderName(), identifier.getAllCatalogIdentifiers()); 46 | } 47 | 48 | protected void unbindCatalogIdentifier(CatalogIdentifier identifier, Map properties) { 49 | map.remove(identifier.getCommerceProviderName()); 50 | } 51 | 52 | @Override 53 | public Map> getCatalogIdentifiersForAllCommerceProviders() { 54 | return map; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /bundles/cif-virtual-catalog/src/main/java/com/adobe/cq/commerce/virtual/catalog/models/ConfigurationReference.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2020 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | package com.adobe.cq.commerce.virtual.catalog.models; 15 | 16 | public interface ConfigurationReference { 17 | String getText(); 18 | 19 | String getConfigURL(); 20 | } 21 | -------------------------------------------------------------------------------- /bundles/cif-virtual-catalog/src/main/java/com/adobe/cq/commerce/virtual/catalog/models/impl/ConfigurationReferenceImpl.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2020 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | package com.adobe.cq.commerce.virtual.catalog.models.impl; 15 | 16 | import java.net.URLEncoder; 17 | 18 | import javax.annotation.PostConstruct; 19 | import javax.inject.Inject; 20 | 21 | import org.apache.sling.api.SlingHttpServletRequest; 22 | import org.apache.sling.api.resource.Resource; 23 | import org.apache.sling.api.resource.ValueMap; 24 | import org.apache.sling.models.annotations.Model; 25 | import org.apache.sling.models.annotations.injectorspecific.Self; 26 | 27 | import com.adobe.cq.commerce.virtual.catalog.models.ConfigurationReference; 28 | 29 | @Model( 30 | adaptables = SlingHttpServletRequest.class, 31 | adapters = { ConfigurationReference.class }, 32 | resourceType = ConfigurationReferenceImpl.RESOURCE_TYPE) 33 | public class ConfigurationReferenceImpl implements ConfigurationReference { 34 | protected static final String RESOURCE_TYPE = "commerce/components/cifrootfolder/reference"; 35 | 36 | @Self 37 | private SlingHttpServletRequest request; 38 | 39 | @Inject 40 | private Resource resource; 41 | 42 | private String text; 43 | private String configUrl; 44 | 45 | @PostConstruct 46 | private void initModel() { 47 | ValueMap vm = resource.getValueMap(); 48 | 49 | if (vm.containsKey("text")) { 50 | text = vm.get("text", String.class); 51 | } else { 52 | text = "Reference"; 53 | } 54 | 55 | String path = request.getParameter("item") != null ? request.getParameter("item") : request.getRequestPathInfo().getSuffix(); 56 | 57 | if (path != null) { 58 | Resource targetResource = request.getResourceResolver().getResource(path); 59 | if (targetResource != null) { 60 | ValueMap targetVm = targetResource.getValueMap(); 61 | if (targetVm.containsKey("cq:conf")) { 62 | String configPath = targetVm.get("cq:conf", String.class); 63 | 64 | Resource configResource = request.getResourceResolver().getResource(configPath + "/settings/cloudconfigs/commerce"); 65 | 66 | if (configResource != null) { 67 | configUrl = "/mnt/overlay/wcm/core/content/sites/properties.html?item=" + 68 | URLEncoder.encode(configResource.getPath()); 69 | } 70 | } 71 | } 72 | } 73 | } 74 | 75 | @Override 76 | public String getText() { 77 | return text; 78 | } 79 | 80 | @Override 81 | public String getConfigURL() { 82 | return configUrl; 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /bundles/cif-virtual-catalog/src/test/resources/context/jcr-catalog-bindings.json: -------------------------------------------------------------------------------- 1 | { 2 | "products": { 3 | "jcr:primaryType": "sling:Folder", 4 | "testing-1": { 5 | "jcr:primaryType": "sling:Folder", 6 | "cq:conf": "/non/existing" 7 | }, 8 | "testing-2": { 9 | "jcr:primaryType": "sling:Folder", 10 | "cq:conf": "/non/existing/too" 11 | }, 12 | "testing-to-be-deleted": { 13 | "jcr:primaryType": "sling:Folder", 14 | "cq:conf": "/conf/testing-to-be-deleted" 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /bundles/cif-virtual-catalog/src/test/resources/context/jcr-cifrootfolder-references.json: -------------------------------------------------------------------------------- 1 | { 2 | "full-reference" : { 3 | "jcr:primaryType": "nt:unstructured", 4 | "sling:resourceType": "commerce/components/cifrootfolder/reference", 5 | "text": "Configuration reference" 6 | }, 7 | "no-text-reference" : { 8 | "jcr:primaryType": "nt:unstructured", 9 | "sling:resourceType": "commerce/components/cifrootfolder/reference" 10 | } 11 | } -------------------------------------------------------------------------------- /bundles/cif-virtual-catalog/src/test/resources/context/jcr-conf-page.json: -------------------------------------------------------------------------------- 1 | { 2 | "cloudconfigs": { 3 | "jcr:primaryType": "sling:Folder", 4 | "commerce": { 5 | "jcr:primaryType": "cq:Page", 6 | "jcr:content": { 7 | "jcr:primaryType": "cq:PageContent", 8 | "magentoStore": "english" 9 | } 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /bundles/cif-virtual-catalog/src/test/resources/context/jcr-conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "cloudconfigs": { 3 | "jcr:primaryType": "sling:Folder", 4 | "commerce": { 5 | "jcr:primaryType": "nt:unstructured", 6 | "cq:catalogDataResourceProviderFactory": "TestProviderFactory" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /bundles/cif-virtual-catalog/src/test/resources/context/jcr-dataroots.json: -------------------------------------------------------------------------------- 1 | { 2 | "products": { 3 | "jcr:primaryType": "sling:Folder", 4 | "testing": { 5 | "jcr:primaryType": "sling:Folder", 6 | "jcr:title": "Test products", 7 | "cq:conf": "/conf/testing" 8 | }, 9 | "testingNoConfig": { 10 | "jcr:primaryType": "sling:Folder", 11 | "jcr:title": "Test products no configuration", 12 | "cq:catalogDataResourceProviderFactory": "non-existent" 13 | }, 14 | "testingWrongConfig": { 15 | "jcr:primaryType": "sling:Folder", 16 | "jcr:title": "Test products no configuration", 17 | "cq:conf": "/conf/wrong-configuration" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /bundles/cif-virtual-catalog/src/test/resources/context/jcr-wrong-conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "cloudconfigs": { 3 | "jcr:primaryType": "sling:Folder", 4 | "commerce": { 5 | "jcr:primaryType": "nt:unstructured" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /bundles/cif-virtual-catalog/src/test/resources/nodetypes/cq-page.cnd: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | 16 | 17 | /* Define just the cq: types that we need for testing */ 18 | [cq:Page] > nt:hierarchyNode 19 | orderable 20 | + jcr:content (nt:base) = nt:base copy primary 21 | + * (nt:base) = nt:base version 22 | 23 | [cq:PageContent] > nt:unstructured, mix:title, mix:created 24 | orderable 25 | - cq:template (string) 26 | - cq:allowedTemplates (string) multiple 27 | - pageTitle (string) 28 | - navTitle (string) 29 | - hideInNav (boolean) 30 | - onTime (date) 31 | - offTime (date) 32 | - cq:lastModified (date) 33 | - cq:lastModifiedBy (string) 34 | - cq:designPath (string) 35 | - jcr:language (string) -------------------------------------------------------------------------------- /bundles/cif-virtual-catalog/src/test/resources/simplelogger.properties: -------------------------------------------------------------------------------- 1 | # See https://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html for the syntax of this file 2 | 3 | # Disable logger during tests 4 | org.slf4j.simpleLogger.log.com.adobe.cq.commerce.virtual.catalog.content.impl.provider.DefaultPageBuilder=off 5 | org.slf4j.simpleLogger.log.com.adobe.cq.commerce.virtual.catalog.data.impl.CatalogDataResourceProviderManagerImpl=off 6 | org.slf4j.simpleLogger.log.com.adobe.cq.commerce.virtual.catalog.content.impl.CatalogContentResourceProviderManagerImpl=off 7 | org.slf4j.simpleLogger.log.org.apache.jackrabbit.oak.query.QueryImpl=off 8 | org.slf4j.simpleLogger.log.org.apache.jackrabbit.oak.plugins.index.IndexUpdate=off 9 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/META-INF/vault/filter.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/cif/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/config/org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-cif-omnisearch.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/clientlibs/configbrowser/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/clientlibs/configbrowser/js.txt: -------------------------------------------------------------------------------- 1 | #base=js 2 | actions/delete.js 3 | renderconditions/renderconditions.js -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/clientlibs/configbrowser/js/actions/delete.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | 12 | */ 13 | 14 | (function($) { 15 | const COMMAND_URL = Granite.HTTP.externalize('/bin/wcmcommand'); 16 | 17 | const deleteConfig = path => { 18 | $.ajax({ 19 | url: COMMAND_URL, 20 | type: 'POST', 21 | data: { 22 | _charset: 'UTF-8', 23 | cmd: 'deletePage', 24 | path, 25 | force: false, 26 | checkChildren: true 27 | }, 28 | success: () => { 29 | location.reload(); 30 | } 31 | }); 32 | }; 33 | 34 | const deleteHandler = (name, el, config, collectionm, selections) => { 35 | const itemPath = selections[0].dataset['foundationCollectionItemId']; 36 | 37 | if (!itemPath) { 38 | console.error('Cannot determine the item path, not doing anything'); 39 | return; 40 | } 41 | 42 | const ui = $(window).adaptTo('foundation-ui'); 43 | 44 | const messageEl = document.createElement('div'); 45 | messageEl.innerHTML = `${Granite.I18n.get( 46 | 'Are you sure you want to delete this configuration: ' 47 | )}
${itemPath}`; 48 | ui.prompt(Granite.I18n.get('Delete'), messageEl.innerHTML, 'notice', [ 49 | { 50 | text: Granite.I18n.get('OK'), 51 | handler: () => { 52 | deleteConfig(itemPath); 53 | }, 54 | warning: 'true' 55 | }, 56 | { 57 | text: Granite.I18n.get('Cancel') 58 | } 59 | ]); 60 | }; 61 | 62 | $(window) 63 | .adaptTo('foundation-registry') 64 | .register('foundation.collection.action.action', { 65 | name: 'cq.wcm.commerce.configuration.delete', 66 | handler: deleteHandler 67 | }); 68 | })(Granite.$); 69 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/authoring/editor/pagepreview/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/authoring/editor/pagepreview/clientlibs/js.txt: -------------------------------------------------------------------------------- 1 | pagepreview.js -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifcategoryfield/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifcategoryfield/carditem/carditem.html: -------------------------------------------------------------------------------- 1 | 14 | 15 | 19 | 22 | 23 | ${"Category" @ i18n} 24 | ${resource["jcr:title"]} 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifcategoryfield/cifcategoryfield.html: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifcategoryfield/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifcategoryfield/clientlibs/js.txt: -------------------------------------------------------------------------------- 1 | cifcategorypicker.js -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifcategoryfield/columnitem/columnitem.html: -------------------------------------------------------------------------------- 1 | 14 | 15 | 20 | 21 | 22 | 23 | 24 | 25 | ${helper.title} 26 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifcategoryfield/columnitempreview/ColumnItemPreviewHelper.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package libs.commerce.gui.components.common.cifcategoryfield.columnitempreview; 16 | 17 | import org.apache.sling.api.resource.Resource; 18 | 19 | import com.adobe.cq.sightly.WCMUsePojo; 20 | import com.adobe.granite.ui.components.ExpressionHelper; 21 | import com.adobe.granite.ui.components.ExpressionResolver; 22 | 23 | 24 | public class ColumnItemPreviewHelper extends WCMUsePojo { 25 | private Resource itemResource; 26 | 27 | @Override 28 | public void activate() { 29 | final ExpressionHelper ex = new ExpressionHelper(getSlingScriptHelper().getService(ExpressionResolver.class), getRequest()); 30 | String path = ex.getString(getProperties().get("path", String.class)); 31 | itemResource = getResourceResolver().getResource(path); 32 | } 33 | 34 | public Resource getItemResource() { 35 | return itemResource; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifcategoryfield/columnitempreview/columnitempreview.html: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 17 | 18 | ${'Title' @ i18n} 19 | ${helper.title} 20 | 21 | 22 | ${'Id' @ i18n} 23 | ${cifId} 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifcategoryfield/listitem/listitem.html: -------------------------------------------------------------------------------- 1 | 14 | 15 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | ${helper.title} 26 |
${helper.properties.cifId}
27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifpicker/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifpicker/clientlibs/js.txt: -------------------------------------------------------------------------------- 1 | cifpicker.js -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifproductfield/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifproductfield/cifproductfield.html: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifproductfield/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifproductfield/clientlibs/js.txt: -------------------------------------------------------------------------------- 1 | cifproductpicker.js -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifproductfield/columnitem/columnitem.html: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 21 | 22 | 23 | 24 | 25 | 26 | ${helper.title} 27 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifproductfield/columnitempreview/ColumnItemPreviewHelper.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package libs.commerce.gui.components.common.cifproductfield.columnitempreview; 16 | 17 | import com.adobe.cq.sightly.WCMUsePojo; 18 | 19 | import org.apache.sling.api.resource.Resource; 20 | import com.adobe.granite.ui.components.ExpressionHelper; 21 | import com.adobe.granite.ui.components.ExpressionResolver; 22 | 23 | 24 | public class ColumnItemPreviewHelper extends WCMUsePojo { 25 | private Resource itemResource; 26 | 27 | @Override 28 | public void activate() { 29 | final ExpressionHelper ex = new ExpressionHelper(getSlingScriptHelper().getService(ExpressionResolver.class), getRequest()); 30 | String path = ex.getString(getProperties().get("path", String.class)); 31 | itemResource = getResourceResolver().getResource(path); 32 | } 33 | 34 | public Resource getItemResource() { 35 | return itemResource; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifproductfield/columnitempreview/columnitempreview.html: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | ${'Title' @ i18n} 24 | ${helper.title} 25 | 26 | ${'SKU' @ i18n} 27 | ${helper.sku} 28 | 29 | ${'Modified' @ i18n} 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifproductfield/listitem/listitem.html: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | ${helper.title} 27 |
${helper.sku}
28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/common/cifproductfield/suggestion/suggestion.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | 3 | Copyright 2019 Adobe. All rights reserved. 4 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. You may obtain a copy 6 | of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software distributed under 9 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | OF ANY KIND, either express or implied. See the License for the specific language 11 | governing permissions and limitations under the License. 12 | 13 | --%><% 14 | %><%@include file="/libs/granite/ui/global.jsp"%><% 15 | %><%@page session="false" 16 | import="java.util.Collections, 17 | java.util.Comparator, 18 | java.util.Iterator, 19 | java.util.List, 20 | java.util.regex.Matcher, 21 | java.util.regex.Pattern, 22 | org.apache.jackrabbit.util.Text, 23 | com.adobe.granite.ui.components.AttrBuilder, 24 | com.adobe.granite.ui.components.Config, 25 | com.adobe.granite.ui.components.ExpressionHelper, 26 | com.adobe.granite.ui.components.PagingIterator"%><% 27 | 28 | final ExpressionHelper ex = cmp.getExpressionHelper(); 29 | final Config cfg = cmp.getConfig(); 30 | 31 | final String query = ex.getString(cfg.get("query", String.class)); 32 | 33 | final String searchName = Text.getName(query); 34 | 35 | final Pattern searchNamePattern = Pattern.compile(Pattern.quote(searchName), Pattern.CASE_INSENSITIVE); 36 | 37 | %><% 38 | for (Iterator it = cmp.getItemDataSource().iterator(); it.hasNext();) { 39 | Resource r = it.next(); 40 | String path = r.getValueMap().get("identifier", String.class); 41 | String title = r.getValueMap().get("jcr:title", String.class); 42 | 43 | AttrBuilder attrs = new AttrBuilder(request, xssAPI); 44 | attrs.add("type", "button"); 45 | attrs.add("is", "coral-buttonlist-item"); 46 | attrs.add("value", path); 47 | 48 | 49 | %><% 50 | } 51 | %><%! 52 | 53 | private String mark(String path, Pattern regex, XSSAPI xssAPI) { 54 | StringBuilder sb = new StringBuilder(); 55 | 56 | int parentIndex = path.lastIndexOf('/'); 57 | 58 | sb.append(xssAPI.encodeForHTML(path.substring(0, parentIndex + 1))); 59 | 60 | String name = path.substring(parentIndex + 1); 61 | 62 | Matcher m = regex.matcher(name); 63 | 64 | if (m.lookingAt()) { 65 | sb.append(xssAPI.encodeForHTML(name.substring(0, m.start()))); 66 | 67 | if (m.group().length() > 0) { 68 | sb.append("" + xssAPI.encodeForHTML(m.group()) + ""); 69 | } 70 | 71 | sb.append(xssAPI.encodeForHTML(name.substring(m.end()))); 72 | } else { 73 | sb.append(xssAPI.encodeForHTML(name)); 74 | } 75 | 76 | return sb.toString(); 77 | } 78 | %> -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/configuration/columnpreview/columnpreview.html: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | ${'Title' @ i18n} 23 | ${configPreview.title} 24 | 25 | 26 | 27 | ${'Modified' @ i18n} 28 | 29 | 30 | 31 | 32 | ${'Published' @ i18n} 33 | 34 | 35 | ${'Not published' @ i18n} 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/configuration/columnviewitem/columnviewitem.html: -------------------------------------------------------------------------------- 1 | 14 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | ${configuration.title} 24 |
25 |
26 | 27 |
-------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/configuration/page/.content.xml: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/configuration/page/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/configuration/page/clientlibs/css.txt: -------------------------------------------------------------------------------- 1 | #base=css 2 | configurationpage.css -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/configuration/page/clientlibs/css/configurationpage.css: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * 4 | * Copyright 2020 Adobe. All rights reserved. 5 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. You may obtain a copy 7 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under 10 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 11 | * OF ANY KIND, either express or implied. See the License for the specific language 12 | * governing permissions and limitations under the License. 13 | * 14 | ******************************************************************************/ 15 | 16 | #cq-commerce-products-bindproducttree-catalog-select-data { 17 | display: none; 18 | } 19 | 20 | .bindproducttreewizard-customfields.hide { 21 | display: none; 22 | } 23 | 24 | .cif-toggle-inheritance coral-icon { 25 | color: #4b4b4b; 26 | } 27 | .cif-toggle-inheritance coral-icon { 28 | margin-top: 0.5rem; 29 | margin-left: 0.4rem; 30 | float: right; 31 | } 32 | 33 | .foundation-form input.cif-lockable-field, 34 | .foundation-form coral-select.cif-lockable-field { 35 | display: inline-block !important; 36 | width: 94% !important; 37 | } 38 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/configuration/page/clientlibs/js.txt: -------------------------------------------------------------------------------- 1 | #base=js 2 | configurationpage.js -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/components/configuration/page/template/.content.xml: -------------------------------------------------------------------------------- 1 | 6 | 8 | 9 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/content/common/cifcategoryfield/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/content/common/cifcategoryfield/columnpreview/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/content/common/cifproductfield/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/content/common/cifproductfield/columnpreview/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/content/common/cifproductfield/pickerpage/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 15 | 16 | 19 | 24 | 27 | 31 | 32 | 36 | <body 37 | jcr:primaryType="nt:unstructured" 38 | sling:resourceType="commerce/gui/components/common/basepathswrapper" 39 | wrappedResourceType="granite/ui/components/coral/foundation/collection/action" 40 | granite:class="cq-commerce-productpickerframe-activator" 41 | granite:hidden="false"> 42 | <data 43 | jcr:primaryType="nt:unstructured" 44 | filter="${param.filter}" 45 | href.uritemplate="#" 46 | root="${commerceProductsBasePath}" 47 | selectionCount="${param.selectionCount}"/> 48 | </body> 49 | </jcr:content> 50 | <rep:policy/> 51 | </jcr:root> -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/content/common/cifproductfield/suggestion/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured" 4 | sling:resourceType="commerce/gui/components/common/cifproductfield/suggestion" 5 | query="${param.query}"> 6 | <datasource 7 | jcr:primaryType="nt:unstructured" 8 | sling:resourceType="commerce/gui/components/common/cifproductfield/datasources/children" 9 | filter="${param.filter}" 10 | limit="${empty requestPathInfo.selectors[1] ? "10" : requestPathInfo.selectors[1]}" 11 | offset="${requestPathInfo.selectors[0]}" 12 | query="${param.query}" 13 | rootPath="${empty param.root ? "/" : param.root}"/> 14 | </jcr:root> 15 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/commerce/gui/content/products/_jcr_content/views/column/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0" 3 | granite:rel="cq-commerce-products-admin-childpages" 4 | jcr:primaryType="nt:unstructured" 5 | jcr:title="Column View" 6 | sling:resourceType="commerce/gui/components/common/basepathswrapper" 7 | wrappedResourceType="granite/ui/components/coral/foundation/columnview" 8 | icon="viewColumn" 9 | layoutId="column" 10 | limit="{Long}19" 11 | loadAncestors="{Boolean}true" 12 | metaResourceType="commerce/gui/components/admin/products/meta" 13 | modeGroup="cq-commerce-products-admin-childpages" 14 | path="${requestPathInfo.suffix}" 15 | previewSrc="/mnt/overlay/commerce/gui/content/products/previewcolumn.html{+id}" 16 | rootPath="${commerceProductsBasePath}" 17 | size="${empty requestPathInfo.selectors[1] ? "19" : requestPathInfo.selectors[1]}" 18 | src="/mnt/overlay/commerce/gui/content/products/jcr:content/views/column{.offset,limit}.html{+id}" 19 | stateId="products.shell.collectionpage"> 20 | <datasource 21 | jcr:primaryType="nt:unstructured" 22 | sling:resourceType="commerce/gui/components/admin/products/childdatasource" 23 | itemResourceType="commerce/gui/components/admin/products/childcolumnitem" 24 | limit="${empty requestPathInfo.selectors[1] ? "20" : requestPathInfo.selectors[1] + 1}" 25 | offset="${requestPathInfo.selectors[0]}" 26 | path="${requestPathInfo.suffix}"/> 27 | </jcr:root> 28 | -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/cq/core/content/nav/tools/cloudservices/cifconfig/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" 3 | xmlns:cq="http://www.day.com/jcr/cq/1.0" 4 | xmlns:jcr="http://www.jcp.org/jcr/1.0" 5 | xmlns:granite="http://www.adobe.com/jcr/granite/1.0" 6 | jcr:primaryType="nt:unstructured" 7 | icon="cloud" 8 | jcr:title="CIF Configuration" 9 | jcr:description="Configuration settings for the Commerce Integration Framework" 10 | href="/libs/commerce/gui/content/configuration.html/conf"> 11 | </jcr:root> -------------------------------------------------------------------------------- /content/cif-connector/src/main/content/jcr_root/libs/dam/content/schemaeditors/forms/default/items/tabs/items/tab6/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured" 4 | jcr:title="Commerce" 5 | sling:resourceType="granite/ui/components/coral/foundation/container" 6 | granite:rel="aem-assets-metadata-form-tab" 7 | granite:class="cq-dam-asset-metadata-commerce" 8 | listOrder="3"> 9 | <items jcr:primaryType="nt:unstructured"> 10 | <col1 11 | jcr:primaryType="nt:unstructured" 12 | sling:resourceType="granite/ui/components/coral/foundation/container" 13 | granite:rel="aem-assets-metadata-form-column" 14 | listOrder="0"/> 15 | <col2 16 | jcr:primaryType="nt:unstructured" 17 | sling:resourceType="granite/ui/components/coral/foundation/container" 18 | granite:rel="aem-assets-metadata-form-column" 19 | listOrder="1"> 20 | <items jcr:primaryType="nt:unstructured"> 21 | <productSku 22 | jcr:primaryType="nt:unstructured" 23 | sling:resourceType="commerce/gui/components/common/cifproductfield" 24 | fieldDescription="SKU of the related products." 25 | fieldLabel="Product SKUs" 26 | multiple="true" 27 | filter="folderOrProduct" 28 | name="./jcr:content/metadata/cq:relatedProducts" 29 | selectionId="sku"/> 30 | </items> 31 | </col2> 32 | <col3 33 | jcr:primaryType="nt:unstructured" 34 | sling:resourceType="granite/ui/components/coral/foundation/container" 35 | granite:rel="aem-assets-metadata-form-column" 36 | listOrder="2"/> 37 | </items> 38 | </jcr:root> 39 | -------------------------------------------------------------------------------- /content/cif-connector/tests/.prettierignore: -------------------------------------------------------------------------------- 1 | *.min.js 2 | *.min-latest.js 3 | **/dist/*.js 4 | **/node/* 5 | **/coverage/* 6 | -------------------------------------------------------------------------------- /content/cif-connector/tests/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "tabWidth": 4, 4 | "useTabs": false, 5 | "semi": true, 6 | "singleQuote": true, 7 | "trailingComma": "none", 8 | "bracketSpacing": true, 9 | "jsxBracketSameLine": true, 10 | "arrowParens": "avoid", 11 | "requirePragma": false, 12 | "insertPragma": false, 13 | "proseWrap": "preserve" 14 | } -------------------------------------------------------------------------------- /content/cif-connector/tests/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cif-connector", 3 | "private": true, 4 | "version": "0.0.1", 5 | "description": "CIF Connector - Content Package", 6 | "main": "index.js", 7 | "scripts": { 8 | "test": "npm run prettier:check && npm run karma:run", 9 | "karma:run": "karma start --single-run --browsers ChromeHeadless,FirefoxHeadless karma.conf.js", 10 | "karma:debug": "karma start --single-run=false --browsers Chrome --debug karma.conf.js", 11 | "prettier:check": "prettier --check '{../src,src}/**/*.{js,css}' --config ./.prettierrc", 12 | "prettier:fix": "prettier --write '{../src,src}/**/*.{js,css}' --config ./.prettierrc" 13 | }, 14 | "author": "Adobe", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/adobe/aem-core-cif-components.git" 18 | }, 19 | "license": "Apache-2.0", 20 | "devDependencies": { 21 | "chai": "^4.2.0", 22 | "karma": "^4.3.0", 23 | "karma-chai": "^0.1.0", 24 | "karma-chrome-launcher": "^2.2.0", 25 | "karma-coverage": "^1.1.2", 26 | "karma-firefox-launcher": "^1.1.0", 27 | "karma-junit-reporter": "^1.2.0", 28 | "karma-mocha": "^1.3.0", 29 | "karma-sinon": "^1.0.5", 30 | "karma-spec-reporter": "0.0.32", 31 | "mocha": "^6.1.4", 32 | "prettier": "^1.18.1", 33 | "sinon": "^7.3.2" 34 | }, 35 | "dependencies": { 36 | "@babel/polyfill": "^7.4.4" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /content/cif-connector/tests/src/CIF.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | window.CIF = window.CIF || {}; 16 | 17 | Granite = { 18 | author: { ContentFrame: { location: '' } }, 19 | $: function(obj) { 20 | return { 21 | on: function() {}, 22 | find: function(selector) { 23 | let el = document.querySelector(selector); 24 | let edata = { 25 | data: function(key, value) { 26 | if (!key && !value) { 27 | var data = {}; 28 | for (var i = 0, atts = el.attributes, n = atts.length; i < n; i++) { 29 | let name = atts[i].nodeName; 30 | if (name.startsWith('data-')) { 31 | data[name.substring('data-'.length)] = atts[i].value; 32 | } 33 | } 34 | 35 | return data; 36 | } else if (key && !value) { 37 | return edata[key]; 38 | } else if (key && value) { 39 | return (edata[key] = value); 40 | } 41 | } 42 | }; 43 | return edata; 44 | }, 45 | adaptTo: function(api) { 46 | if (api == 'foundation-util-htmlparser') { 47 | return { 48 | parse: function() { 49 | return Promise.resolve({}); 50 | } 51 | }; 52 | } else if (api == 'foundation-picker') { 53 | return { 54 | attach: function() {}, 55 | pick: function() { 56 | return { then: function() {} }; 57 | }, 58 | focus: function() {} 59 | }; 60 | } 61 | }, 62 | 63 | children: function() { 64 | return [Promise.resolve(obj)]; 65 | } 66 | }; 67 | } 68 | }; 69 | -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/META-INF/vault/filter.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | ~ Copyright 2016 Adobe Systems Incorporated 4 | ~ 5 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 6 | ~ you may not use this file except in compliance with the License. 7 | ~ You may obtain a copy of the License at 8 | ~ 9 | ~ http://www.apache.org/licenses/LICENSE-2.0 10 | ~ 11 | ~ Unless required by applicable law or agreed to in writing, software 12 | ~ distributed under the License is distributed on an "AS IS" BASIS, 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ~ See the License for the specific language governing permissions and 15 | ~ limitations under the License. 16 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> 17 | <workspaceFilter version="1.0"> 18 | <filter root="/libs/commerce/config"> 19 | <include pattern="/libs/commerce/config/org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-virtual-commerce"/> 20 | <include pattern="/libs/commerce/config/org.apache.sling.jcr.repoinit.RepositoryInitializer-default.config"/> 21 | </filter> 22 | <filter root="/libs/commerce/install"> 23 | <include pattern="/libs/commerce/install/cq-commerce-virtual-catalog-(.*).jar"/> 24 | </filter> 25 | <filter root="/libs/commerce/components/" mode="update"/> 26 | <filter root="/libs/commerce/gui" mode="update"/> 27 | <filter root="/libs/commerce/gui/content/products" mode="update"/> 28 | <filter root="/libs/commerce/gui/content/products/bindproducttreewizard"/> 29 | <filter root="/libs/commerce/gui/components/admin/products/products.jsp"/> 30 | <filter root="/libs/commerce/gui/components/admin/products/childcard/childcard.jsp"/> 31 | <filter root="/libs/commerce/gui/components/admin/products/childrow/childrow.jsp"/> 32 | <filter root="/libs/commerce/gui/components/admin/products/childcolumnitem/childcolumnitem.jsp"/> 33 | <filter root="/libs/commerce/gui/components/admin/products/bindproducttreewizard"/> 34 | <filter root="/apps/commerce/gui/content/products/folderproperties"/> 35 | 36 | <!-- We delete the cq:tags search field in the product picker --> 37 | <filter root="/libs/commerce/gui/content/common/productfield/picker/search/form/tagid"/> 38 | <filter root="/libs/commerce/gui/content/common/productfield/picker/search/form/tagid-property"/> 39 | 40 | <filter root="/oak:index/commerceCqVirtualCatalog" /> 41 | 42 | </workspaceFilter> 43 | -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/_oak_index/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:rep="internal" 3 | jcr:mixinTypes="[rep:AccessControllable]" 4 | jcr:primaryType="nt:unstructured"> 5 | <commerceCqVirtualCatalog 6 | includedPaths="{String}[/content]" 7 | jcr:primaryType="oak:QueryIndexDefinition" 8 | propertyNames="{Name}[cq:virtualCatalog]" 9 | reindex="{Boolean}false" 10 | type="property"/> 11 | </jcr:root> -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/apps/commerce/gui/content/products/folderproperties/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="cq:Page"> 4 | <jcr:content 5 | jcr:primaryType="nt:unstructured" 6 | backHref="${granite:concat("/aem/products.html", granite:encodeURIPath(granite:relativeParent(empty param.item ? requestPathInfo.suffix : param.item, 1)))}"> 7 | </jcr:content> 8 | </jcr:root> 9 | -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/components/ciffolder/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:Component"> 4 | <cq:dialog/> 5 | <dialog/> 6 | </jcr:root> 7 | -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/components/ciffolder/dialog.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:Dialog" 4 | height="400" 5 | stateful="false" 6 | xtype="dialog"> 7 | <items jcr:primaryType="cq:WidgetCollection"> 8 | <tabs jcr:primaryType="cq:TabPanel"> 9 | <items jcr:primaryType="cq:WidgetCollection"> 10 | <basic 11 | jcr:primaryType="cq:Widget" 12 | path="/libs/sling/OrderedFolder/tab_basic.overlay.infinity.json" 13 | xtype="cqinclude"/> 14 | <cug 15 | jcr:primaryType="cq:Widget" 16 | path="/libs/sling/OrderedFolder/tab_cug.overlay.infinity.json" 17 | xtype="cqinclude"/> 18 | </items> 19 | </tabs> 20 | </items> 21 | </jcr:root> 22 | -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/components/cifimage/cifimage.html: -------------------------------------------------------------------------------- 1 | <!--/* 2 | 3 | Copyright 2019 Adobe. All rights reserved. 4 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. You may obtain a copy 6 | of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software distributed under 9 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | OF ANY KIND, either express or implied. See the License for the specific language 11 | governing permissions and limitations under the License. 12 | 13 | */--><!--/* 14 | 15 | Simple image component for rendering CIF external images. 16 | 17 | */--> 18 | <div id="cif-image-${resource.path}"><img src="${resource.fileReference}"></div> -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/components/cifrendercondition/cifrendercondition.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | 3 | Copyright 2019 Adobe. All rights reserved. 4 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. You may obtain a copy 6 | of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software distributed under 9 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | OF ANY KIND, either express or implied. See the License for the specific language 11 | governing permissions and limitations under the License. 12 | 13 | --%> 14 | <%@include file="/libs/granite/ui/global.jsp" %> 15 | <%@page session="false" 16 | import="com.adobe.granite.ui.components.rendercondition.RenderCondition, 17 | com.adobe.granite.ui.components.rendercondition.SimpleRenderCondition, 18 | org.apache.commons.lang.StringUtils, 19 | com.adobe.granite.ui.components.Config, 20 | javax.jcr.Node" %> 21 | <% 22 | 23 | final Config cfg = cmp.getConfig(); 24 | final String path = StringUtils.trimToNull(cmp.getExpressionHelper().getString(cfg.get("path", String.class))); 25 | 26 | if(path == null) { 27 | return; 28 | } 29 | 30 | Resource content = resourceResolver.getResource(path); 31 | boolean decision = true; 32 | if ( content == null || content.adaptTo(Node.class) == null) { 33 | decision = false; 34 | } 35 | request.setAttribute(RenderCondition.class.getName(), new SimpleRenderCondition(decision)); 36 | %> -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/components/cifrootfolder/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:Component"> 4 | <cq:dialog/> 5 | <dialog/> 6 | </jcr:root> 7 | -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/components/cifrootfolder/dialog.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:Dialog" 4 | height="400" 5 | stateful="false" 6 | xtype="dialog"> 7 | <items jcr:primaryType="cq:WidgetCollection"> 8 | <tabs jcr:primaryType="cq:TabPanel"> 9 | <items jcr:primaryType="cq:WidgetCollection"> 10 | <basic 11 | jcr:primaryType="cq:Widget" 12 | path="/libs/sling/OrderedFolder/tab_basic.overlay.infinity.json" 13 | xtype="cqinclude"/> 14 | <cug 15 | jcr:primaryType="cq:Widget" 16 | path="/libs/sling/OrderedFolder/tab_cug.overlay.infinity.json" 17 | xtype="cqinclude"/> 18 | </items> 19 | </tabs> 20 | </items> 21 | </jcr:root> 22 | -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/components/cifrootfolder/include/include.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | 3 | Copyright 2019 Adobe. All rights reserved. 4 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. You may obtain a copy 6 | of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software distributed under 9 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | OF ANY KIND, either express or implied. See the License for the specific language 11 | governing permissions and limitations under the License. 12 | 13 | --%><% 14 | %><%@include file="/libs/granite/ui/global.jsp"%><% 15 | %><%@page session="false" 16 | import="org.apache.commons.lang.StringUtils, 17 | com.adobe.granite.ui.components.AttrBuilder, 18 | com.adobe.granite.ui.components.Tag"%><% 19 | 20 | String path = cmp.getExpressionHelper().getString(cmp.getConfig().get("path", String.class)); 21 | if (path == null) { 22 | return; 23 | } 24 | 25 | Resource target = resourceResolver.getResource(path); 26 | if (target == null) { 27 | return; 28 | } 29 | 30 | String provider = target.getValueMap().get("cq:catalogDataResourceProviderFactory", String.class); 31 | if (StringUtils.isBlank(provider)) { 32 | return; 33 | } 34 | 35 | Resource customFieldsParent = resourceResolver.getResource("commerce/gui/content/products/bindproducttreewizard/customfields"); 36 | if (customFieldsParent == null) { 37 | return; 38 | } 39 | 40 | Resource customFields = customFieldsParent.getChild(provider); 41 | if (customFields == null) { 42 | return; 43 | } 44 | 45 | AttrBuilder attrs = new AttrBuilder(request, xssAPI); 46 | Tag tag = new Tag("div", attrs); 47 | cmp.include(customFields, customFields.getResourceType(), tag); 48 | %> -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/components/cifrootfolder/reference/reference.html: -------------------------------------------------------------------------------- 1 | <!--/* 2 | 3 | Copyright 2020 Adobe. All rights reserved. 4 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. You may obtain a copy 6 | of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software distributed under 9 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | OF ANY KIND, either express or implied. See the License for the specific language 11 | governing permissions and limitations under the License. 12 | 13 | */--><!--/* 14 | 15 | Simple component rendering configuration link for a product binding. 16 | 17 | */--> 18 | <sly data-sly-use.configRef="com.adobe.cq.commerce.virtual.catalog.models.ConfigurationReference"></sly> 19 | <a class="coral-Link" href="${configRef.configURL}" >${configRef.text}</a> -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/config/org.apache.sling.jcr.repoinit.RepositoryInitializer-default.config: -------------------------------------------------------------------------------- 1 | scripts=[" 2 | create service user product-binding-service 3 | set ACL on /var/commerce/products 4 | allow rep:write for product-binding-service 5 | end 6 | set ACL on /conf 7 | allow jcr:read for product-binding-service 8 | allow jcr:modifyProperties for product-binding-service 9 | end 10 | "] -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/config/org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-virtual-commerce.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="sling:OsgiConfig" 4 | user.default="" 5 | user.mapping="[com.adobe.commerce.cif.virtual-catalog:virtual-products-service=configuration-reader-service,com.adobe.commerce.cif.virtual-catalog:frontend=content-reader-service,com.adobe.commerce.cif.virtual-catalog:product-binding-service=product-binding-service]"/> 6 | -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/gui/components/admin/products/bindproducttreewizard/clientlibs/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0" 3 | xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 4 | xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 5 | jcr:primaryType="cq:ClientLibraryFolder" 6 | dependecies="[granite.ui.coral.foundation]" 7 | categories="[commerce.gui.products.bindproducttreewizard]"> 8 | </jcr:root> 9 | -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/gui/components/admin/products/bindproducttreewizard/clientlibs/bindproducttreewizard.css: -------------------------------------------------------------------------------- 1 | #cq-commerce-products-bindproducttree-catalog-select-data { 2 | display: none; 3 | } 4 | 5 | .bindproducttreewizard-customfields.hide { 6 | display: none; 7 | } -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/gui/components/admin/products/bindproducttreewizard/clientlibs/css.txt: -------------------------------------------------------------------------------- 1 | bindproducttreewizard.css -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/gui/components/admin/products/bindproducttreewizard/clientlibs/js.txt: -------------------------------------------------------------------------------- 1 | bindproducttreewizard.js -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/gui/components/admin/products/bindproducttreewizard/commerceproviderdatasource/commerceproviderdatasource.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | 3 | Copyright 2019 Adobe. All rights reserved. 4 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. You may obtain a copy 6 | of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software distributed under 9 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | OF ANY KIND, either express or implied. See the License for the specific language 11 | governing permissions and limitations under the License. 12 | 13 | --%> 14 | <%@page session="false" 15 | import="java.util.ArrayList, 16 | java.util.HashMap, 17 | java.util.Map, 18 | org.apache.sling.api.wrappers.ValueMapDecorator, 19 | com.adobe.granite.ui.components.ds.DataSource, 20 | com.adobe.granite.ui.components.ds.EmptyDataSource, 21 | com.adobe.granite.ui.components.ds.SimpleDataSource, 22 | com.adobe.granite.ui.components.ds.ValueMapResource, 23 | org.apache.sling.api.resource.ResourceMetadata, 24 | com.adobe.cq.commerce.virtual.catalog.data.CatalogDataResourceProviderFactory, 25 | com.adobe.cq.commerce.virtual.catalog.data.CatalogDataResourceProviderManager" %> 26 | <%@include file="/libs/foundation/global.jsp" %> 27 | <% 28 | DataSource ds; 29 | // Get data for datasource 30 | CatalogDataResourceProviderManager resourceProviderManager = sling.getService(CatalogDataResourceProviderManager.class); 31 | if (resourceProviderManager == null) { 32 | log.warn("CatalogDataResourceProviderManager not found"); 33 | ds = EmptyDataSource.instance(); 34 | } else { 35 | Map<String, CatalogDataResourceProviderFactory<?>> dataResourceProviderFactories = resourceProviderManager.getProviderFactories(); 36 | 37 | // Build datasource 38 | ArrayList<Resource> resourceList = new ArrayList<Resource>(); 39 | for (String factoryName : dataResourceProviderFactories.keySet()) { 40 | Map<String, Object> map = new HashMap<>(); 41 | map.put("text", factoryName); 42 | map.put("value", factoryName); 43 | ValueMapResource syntheticResource = new ValueMapResource(resourceResolver, new ResourceMetadata(), "", 44 | new ValueMapDecorator(map)); 45 | resourceList.add(syntheticResource); 46 | } 47 | ds = resourceList.isEmpty() ? EmptyDataSource.instance() : new SimpleDataSource(resourceList.iterator()); 48 | } 49 | // Put datasource in request for consumption 50 | request.setAttribute(DataSource.class.getName(), ds); 51 | %> -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/gui/components/authoring/assetfinder/product/clientlibs/ProductAssetPanel.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | (function ($, ns, channel, window, undefined) { 16 | 17 | var self = {}, 18 | name = 'Products', 19 | insertAfter = 'Documents'; 20 | 21 | // make the loadAssets function more flexible 22 | self.searchRoot = '/var/commerce/products'; 23 | 24 | var searchPath = self.searchRoot, 25 | productServlet = '/bin/wcm/contentfinder/cifproduct/view.html', 26 | itemResourceType = 'commerce/gui/components/authoring/assetfinder/product'; 27 | 28 | /** 29 | * 30 | * @param query {String} search query 31 | * @param lowerLimit {Number} lower bound for paging 32 | * @param upperLimit {Number} upper bound for paging 33 | * @returns {jQuery.Promise} 34 | */ 35 | self.loadAssets = function (query, lowerLimit, upperLimit) { 36 | var param = { 37 | '_dc': new Date().getTime(), // cache killer 38 | 'query': query, 39 | 'itemResourceType': itemResourceType, // single item rendering (cards) 40 | 'limit': lowerLimit + ".." + upperLimit, 41 | '_charset_': 'utf-8' 42 | }; 43 | 44 | return $.ajax({ 45 | type: 'GET', 46 | dataType: 'html', 47 | url: Granite.HTTP.externalize(productServlet) + searchPath, 48 | data: param 49 | }); 50 | }; 51 | 52 | /** 53 | * Set URL to servlet 54 | * @param servlet {String} URL to product servlet 55 | */ 56 | self.setServlet = function (servlet) { 57 | productServlet = servlet; 58 | }; 59 | 60 | self.setSearchPath = function (path) { 61 | searchPath = path.replace(/\/$/, ""); // Strip trailing slash 62 | }; 63 | 64 | self.setItemResourceType = function (resourceType) { 65 | itemResourceType = resourceType; 66 | }; 67 | 68 | self.resetSearchPath = function () { 69 | searchPath = self.searchRoot; 70 | }; 71 | 72 | // register as a asset tab 73 | ns.ui.assetFinder.register(name, self, insertAfter); 74 | 75 | }(jQuery, Granite.author, jQuery(document), this)); 76 | -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/gui/components/common/productsearchdatasource/productsearchdatasource.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | 3 | Copyright 2019 Adobe. All rights reserved. 4 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. You may obtain a copy 6 | of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software distributed under 9 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | OF ANY KIND, either express or implied. See the License for the specific language 11 | governing permissions and limitations under the License. 12 | 13 | --%><% 14 | %><%@include file="/libs/granite/ui/global.jsp" %><% 15 | %><%@page session="false" 16 | import="javax.jcr.Session, 17 | java.util.Map, 18 | java.util.HashMap, 19 | org.apache.commons.collections4.Transformer, 20 | org.apache.commons.collections4.iterators.TransformIterator, 21 | org.apache.sling.api.resource.ResourceWrapper, 22 | com.adobe.granite.omnisearch.spi.core.OmniSearchHandler, 23 | com.adobe.granite.ui.components.Config, 24 | com.adobe.granite.ui.components.ExpressionHelper, 25 | com.adobe.granite.ui.components.ds.DataSource, 26 | com.adobe.granite.ui.components.ds.SimpleDataSource, 27 | com.day.cq.search.result.SearchResult" %><% 28 | 29 | final Config cfg = new Config(resource.getChild(Config.DATASOURCE)); 30 | final ExpressionHelper ex = cmp.getExpressionHelper(); 31 | 32 | final String itemRT = cfg.get("itemResourceType", String.class); 33 | final long offset = ex.get(cfg.get("offset", "0"), long.class); 34 | final long limit = ex.get(cfg.get("limit", "20"), long.class); 35 | 36 | Map<String, Object> params = new HashMap<>(); 37 | for (Map.Entry<String, String[]> entry : request.getParameterMap().entrySet()) { 38 | params.put(entry.getKey(), entry.getValue()); 39 | } 40 | 41 | String filter = "(component.name=com.adobe.cq.commerce.impl.omnisearch.ProductsOmniSearchHandler)"; 42 | OmniSearchHandler[] handlers = sling.getServices(OmniSearchHandler.class, filter); 43 | final SearchResult result = handlers[0].getResults(resourceResolver, params, limit, offset); 44 | 45 | final DataSource ds = new SimpleDataSource(new TransformIterator<>(result.getResources(), new Transformer<Resource, Resource>() { 46 | public Resource transform(Resource r) { 47 | return new ResourceWrapper(r) { 48 | public String getResourceType() { 49 | return itemRT; 50 | } 51 | }; 52 | } 53 | })); 54 | 55 | request.setAttribute(DataSource.class.getName(), ds); 56 | %> -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/gui/content/common/productfield/picker/search/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"/> 3 | -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/gui/content/common/productfield/picker/search/views/card/datasource/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:unstructured" 4 | sling:resourceType="commerce/gui/components/common/productsearchdatasource" 5 | itemResourceType="commerce/gui/components/common/productfield/carditem" 6 | limit="${empty requestPathInfo.selectors[3] ? "21" : requestPathInfo.selectors[3] + 1}" 7 | offset="${requestPathInfo.selectors[2]}"/> 8 | -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/gui/content/products/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="cq:Page"> 4 | <jcr:content 5 | jcr:mixinTypes="[sling:VanityPath]" 6 | jcr:primaryType="nt:unstructured" 7 | jcr:title="AEM Products" 8 | sling:resourceType="granite/ui/components/shell/collectionpage" 9 | sling:vanityOrder="{Long}100" 10 | sling:vanityPath="/aem/products" 11 | contentPath="${requestPathInfo.suffix}" 12 | currentView="${state["products.shell.collectionpage.layoutId"].string}" 13 | modeGroup="cq-commerce-products-admin-childpages" 14 | pageURITemplate="/libs/commerce/gui/content/products.html{+id}" 15 | targetCollection=".cq-commerce-products-admin-childpages" 16 | omnisearchLocationPath="/libs/granite/omnisearch/content/metadata/product" 17 | consoleId="cq-commerce-products"> 18 | <actions jcr:primaryType="nt:unstructured"> 19 | <secondary jcr:primaryType="nt:unstructured"> 20 | <create 21 | jcr:primaryType="nt:unstructured" 22 | sling:resourceType="granite/ui/components/coral/foundation/pulldown" 23 | text="Create" 24 | variant="primary"> 25 | <items jcr:primaryType="nt:unstructured"> 26 | <bindproducttree 27 | granite:rel="cq-commerce-products-bindproducttree-activator" 28 | jcr:primaryType="nt:unstructured" 29 | sling:resourceType="granite/ui/components/coral/foundation/collection/actionlink" 30 | action="foundation.link" 31 | relScope="collection" 32 | target=".cq-commerce-products-admin-childpages" 33 | text="Bind Products"> 34 | <data 35 | jcr:primaryType="nt:unstructured" 36 | href.uritemplate="/mnt/overlay/commerce/gui/content/products/bindproducttreewizard.html{+id}/"/> 37 | </bindproducttree> 38 | </items> 39 | </create> 40 | </secondary> 41 | </actions> 42 | </jcr:content> 43 | </jcr:root> 44 | -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/gui/content/products/folderproperties/_jcr_content/content/items/ref/.content.xml: -------------------------------------------------------------------------------- 1 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" 2 | xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="nt:unstructured" 4 | sling:resourceType="commerce/gui/components/admin/folder/include" 5 | folderResourceTypes="[sling:Folder,sling:OrderedFolder]" 6 | path="${empty param.item ? requestPathInfo.suffix : param.item}"/> -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/gui/content/products/folderproperties/_jcr_content/editcondition.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0" 3 | xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 4 | xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 5 | jcr:primaryType="nt:unstructured" 6 | sling:resourceType="commerce/components/cifrendercondition" 7 | path="${empty param.item ? requestPathInfo.suffix : param.item}"/> 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /content/cif-virtual-catalog/src/main/content/jcr_root/libs/commerce/gui/content/products/properties/_jcr_content/editcondition/.content.xml: -------------------------------------------------------------------------------- 1 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" 2 | xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="nt:unstructured" 4 | sling:resourceType="commerce/components/cifrendercondition" 5 | path="${empty param.item ? requestPathInfo.suffix : param.item}"/> -------------------------------------------------------------------------------- /it/content/src/main/content/META-INF/vault/filter.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <!-- 3 | 4 | Copyright 2019 Adobe. All rights reserved. 5 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. You may obtain a copy 7 | of the License at http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed under 10 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 11 | OF ANY KIND, either express or implied. See the License for the specific language 12 | governing permissions and limitations under the License. 13 | 14 | --> 15 | <workspaceFilter version="1.0"> 16 | <filter root="/apps/cloudcommerce/config"/> 17 | <filter root="/content/dam/ciftest"/> 18 | <filter root="/conf/testproject"/> 19 | <filter root="/content/testproject"/> 20 | </workspaceFilter> -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/apps/cloudcommerce/config/com.adobe.cq.commerce.graphql.client.impl.GraphqlClientImpl-default.config: -------------------------------------------------------------------------------- 1 | identifier="default" 2 | url="https://localhost/graphql" 3 | httpMethod="POST" 4 | acceptSelfSignedCertificates="true" 5 | maxHttpConnections="20" -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/apps/cloudcommerce/config/com.adobe.cq.commerce.graphql.magento.GraphqlDataServiceImpl-default.config: -------------------------------------------------------------------------------- 1 | identifier="default" 2 | productCachingEnabled="true" 3 | productCachingTimeMinutes="5" 4 | productCachingSize="1000" 5 | categoryCachingSize="100" 6 | catalogCachingEnabled="true" 7 | catalogCachingTimeMinutes="60" 8 | catalogPagingLimit="50" 9 | catalogCachingSchedulerEnabled="false" -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/apps/cloudcommerce/config/org.apache.sling.commons.log.LogManager.factory.config-commerce.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="sling:OsgiConfig" 4 | org.apache.sling.commons.log.file="logs/commerce.log" 5 | org.apache.sling.commons.log.level="debug" 6 | org.apache.sling.commons.log.names="[com.adobe.cq.commerce]" 7 | org.apache.sling.commons.log.pattern="\{0,date,yyyy-MM-dd HH:mm:ss.SSS} {4} [{3}] {5}"/> -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/conf/testproject/settings/wcm/templates/category-page/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:Template"> 4 | <jcr:content 5 | cq:lastModified="{Date}2019-03-26T14:36:02.480+02:00" 6 | cq:lastModifiedBy="admin" 7 | jcr:primaryType="cq:PageContent" 8 | jcr:title="Category page" 9 | status="enabled"/> 10 | </jcr:root> 11 | -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/conf/testproject/settings/wcm/templates/category-page/structure/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="cq:Page"> 4 | <jcr:content 5 | cq:deviceGroups="[mobile/groups/responsive]" 6 | cq:lastModified="{Date}2019-03-26T14:33:35.241+02:00" 7 | cq:lastModifiedBy="admin" 8 | cq:template="/conf/testproject/settings/wcm/templates/category-page" 9 | jcr:primaryType="cq:PageContent" 10 | sling:resourceType="core/cif/components/structure/page/v1/page"> 11 | <root 12 | jcr:primaryType="nt:unstructured" 13 | sling:resourceType="wcm/foundation/components/responsivegrid"> 14 | <responsivegrid 15 | jcr:created="{Date}2018-10-17T10:18:24.968+02:00" 16 | jcr:createdBy="admin" 17 | jcr:lastModified="{Date}2018-10-17T10:18:24.968+02:00" 18 | jcr:lastModifiedBy="admin" 19 | jcr:primaryType="nt:unstructured" 20 | sling:resourceType="wcm/foundation/components/responsivegrid" 21 | editable="{Boolean}true"> 22 | <cq:responsive jcr:primaryType="nt:unstructured"/> 23 | </responsivegrid> 24 | </root> 25 | </jcr:content> 26 | </jcr:root> 27 | -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/conf/testproject/settings/wcm/templates/product-page/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 3 | jcr:primaryType="cq:Template"> 4 | <jcr:content 5 | cq:lastModified="{Date}2019-03-26T14:36:02.480+02:00" 6 | cq:lastModifiedBy="admin" 7 | jcr:primaryType="cq:PageContent" 8 | jcr:title="Product page" 9 | status="enabled"/> 10 | </jcr:root> 11 | -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/conf/testproject/settings/wcm/templates/product-page/structure/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="cq:Page"> 4 | <jcr:content 5 | cq:deviceGroups="[mobile/groups/responsive]" 6 | cq:lastModified="{Date}2019-03-26T14:33:35.241+02:00" 7 | cq:lastModifiedBy="admin" 8 | cq:template="/conf/testproject/settings/wcm/templates/product-page" 9 | jcr:primaryType="cq:PageContent" 10 | sling:resourceType="core/cif/components/structure/page/v1/page"> 11 | <root 12 | jcr:primaryType="nt:unstructured" 13 | sling:resourceType="wcm/foundation/components/responsivegrid"> 14 | <responsivegrid 15 | jcr:created="{Date}2018-10-17T10:18:24.968+02:00" 16 | jcr:createdBy="admin" 17 | jcr:lastModified="{Date}2018-10-17T10:18:24.968+02:00" 18 | jcr:lastModifiedBy="admin" 19 | jcr:primaryType="nt:unstructured" 20 | sling:resourceType="wcm/foundation/components/responsivegrid" 21 | editable="{Boolean}true"> 22 | <cq:responsive jcr:primaryType="nt:unstructured"/> 23 | </responsivegrid> 24 | </root> 25 | </jcr:content> 26 | </jcr:root> 27 | -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/content/dam/ciftest/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="sling:Folder"> 4 | <jcr:content 5 | jcr:primaryType="nt:unstructured" 6 | jcr:title="ciftest" 7 | sourcing="false"> 8 | <folderThumbnail/> 9 | </jcr:content> 10 | </jcr:root> 11 | -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/content/dam/ciftest/_jcr_content/folderThumbnail: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/commerce-cif-connector/0f5bb01d63ef4b1c006bd29074dec39bc6585738/it/content/src/main/content/jcr_root/content/dam/ciftest/_jcr_content/folderThumbnail -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/content/dam/ciftest/_jcr_content/folderThumbnail.dir/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:dam="http://www.day.com/dam/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:file"> 4 | <jcr:content 5 | dam:folderThumbnailPaths="[/content/dam/ciftest/ciftest.jpg]" 6 | jcr:primaryType="nt:unstructured" 7 | bgcolor="{Long}-1" 8 | height="{Long}140" 9 | width="{Long}240"/> 10 | </jcr:root> 11 | -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/content/dam/ciftest/ciftest.jpg/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dam="http://www.day.com/dam/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:mixinTypes="[mix:referenceable]" 4 | jcr:primaryType="dam:Asset" 5 | jcr:uuid="7b032a31-f297-4b30-bfef-a481fed9cee4"> 6 | <jcr:content 7 | dam:assetState="processed" 8 | jcr:lastModified="{Date}2019-11-01T10:59:40.795+02:00" 9 | jcr:lastModifiedBy="admin" 10 | jcr:primaryType="dam:AssetContent"> 11 | <metadata 12 | dam:Bitsperpixel="{Long}24" 13 | dam:Comments="Created with GIMP " 14 | dam:extracted="{Date}2019-11-01T10:59:40.623+02:00" 15 | dam:Fileformat="JPEG" 16 | dam:MIMEtype="image/jpeg" 17 | dam:Numberofimages="{Long}1" 18 | dam:Numberoftextualcomments="{Long}1" 19 | dam:Physicalheightindpi="{Long}300" 20 | dam:Physicalheightininches="{Decimal}1.3333333730697632" 21 | dam:Physicalwidthindpi="{Long}300" 22 | dam:Physicalwidthininches="{Decimal}2.0" 23 | dam:Progressive="yes" 24 | dam:sha1="4a7b5c76855dced517c6b18d9a56fb994a158689" 25 | dam:size="{Long}8685" 26 | dc:format="image/jpeg" 27 | jcr:mixinTypes="[cq:Taggable]" 28 | jcr:primaryType="nt:unstructured" 29 | tiff:ImageLength="{Long}400" 30 | tiff:ImageWidth="{Long}600"/> 31 | <related jcr:primaryType="nt:unstructured"/> 32 | </jcr:content> 33 | </jcr:root> 34 | -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/content/dam/ciftest/ciftest.jpg/_jcr_content/renditions/cq5dam.thumbnail.140.100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/commerce-cif-connector/0f5bb01d63ef4b1c006bd29074dec39bc6585738/it/content/src/main/content/jcr_root/content/dam/ciftest/ciftest.jpg/_jcr_content/renditions/cq5dam.thumbnail.140.100.png -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/content/dam/ciftest/ciftest.jpg/_jcr_content/renditions/cq5dam.thumbnail.140.100.png.dir/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:file"> 4 | <jcr:content 5 | jcr:lastModifiedBy="workflow-process-service" 6 | jcr:primaryType="oak:Resource"/> 7 | </jcr:root> 8 | -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/content/dam/ciftest/ciftest.jpg/_jcr_content/renditions/cq5dam.thumbnail.319.319.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/commerce-cif-connector/0f5bb01d63ef4b1c006bd29074dec39bc6585738/it/content/src/main/content/jcr_root/content/dam/ciftest/ciftest.jpg/_jcr_content/renditions/cq5dam.thumbnail.319.319.png -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/content/dam/ciftest/ciftest.jpg/_jcr_content/renditions/cq5dam.thumbnail.319.319.png.dir/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:file"> 4 | <jcr:content 5 | jcr:lastModifiedBy="workflow-process-service" 6 | jcr:primaryType="oak:Resource"/> 7 | </jcr:root> 8 | -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/content/dam/ciftest/ciftest.jpg/_jcr_content/renditions/cq5dam.thumbnail.48.48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/commerce-cif-connector/0f5bb01d63ef4b1c006bd29074dec39bc6585738/it/content/src/main/content/jcr_root/content/dam/ciftest/ciftest.jpg/_jcr_content/renditions/cq5dam.thumbnail.48.48.png -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/content/dam/ciftest/ciftest.jpg/_jcr_content/renditions/cq5dam.thumbnail.48.48.png.dir/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:file"> 4 | <jcr:content 5 | jcr:lastModifiedBy="workflow-process-service" 6 | jcr:primaryType="oak:Resource"/> 7 | </jcr:root> 8 | -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/content/dam/ciftest/ciftest.jpg/_jcr_content/renditions/cq5dam.web.1280.1280.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/commerce-cif-connector/0f5bb01d63ef4b1c006bd29074dec39bc6585738/it/content/src/main/content/jcr_root/content/dam/ciftest/ciftest.jpg/_jcr_content/renditions/cq5dam.web.1280.1280.jpeg -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/content/dam/ciftest/ciftest.jpg/_jcr_content/renditions/cq5dam.web.1280.1280.jpeg.dir/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:file"> 4 | <jcr:content 5 | jcr:lastModifiedBy="workflow-process-service" 6 | jcr:primaryType="oak:Resource"/> 7 | </jcr:root> 8 | -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/content/dam/ciftest/ciftest.jpg/_jcr_content/renditions/original: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/commerce-cif-connector/0f5bb01d63ef4b1c006bd29074dec39bc6585738/it/content/src/main/content/jcr_root/content/dam/ciftest/ciftest.jpg/_jcr_content/renditions/original -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/content/dam/ciftest/ciftest.jpg/_jcr_content/renditions/original.dir/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="nt:file"> 4 | <jcr:content 5 | jcr:lastModifiedBy="admin" 6 | jcr:mimeType="image/jpeg" 7 | jcr:primaryType="oak:Resource"/> 8 | </jcr:root> 9 | -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/content/testproject/testpdp/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="cq:Page"> 4 | <jcr:content 5 | cq:lastModified="{Date}2019-11-06T17:43:01.352+02:00" 6 | cq:lastModifiedBy="admin" 7 | cq:lastRolledout="{Date}2019-04-17T13:22:08.543+02:00" 8 | cq:lastRolledoutBy="admin" 9 | cq:template="/conf/testproject/settings/wcm/templates/product-page" 10 | jcr:mixinTypes="[cq:LiveRelationship]" 11 | jcr:primaryType="cq:PageContent" 12 | jcr:title="Product page" 13 | sling:resourceType="core/cif/components/structure/page/v1/page"> 14 | <root 15 | cq:lastRolledout="{Date}2019-04-17T13:22:08.534+02:00" 16 | cq:lastRolledoutBy="admin" 17 | jcr:mixinTypes="[cq:LiveRelationship]" 18 | jcr:primaryType="nt:unstructured"> 19 | <responsivegrid 20 | cq:lastRolledout="{Date}2019-04-17T13:22:08.536+02:00" 21 | cq:lastRolledoutBy="admin" 22 | jcr:mixinTypes="[cq:LiveRelationship]" 23 | jcr:primaryType="nt:unstructured" 24 | sling:resourceType="wcm/foundation/components/responsivegrid"> 25 | <product 26 | cq:lastRolledout="{Date}2019-04-17T13:22:08.542+02:00" 27 | cq:lastRolledoutBy="admin" 28 | jcr:created="{Date}2019-03-29T17:03:07.030+02:00" 29 | jcr:createdBy="admin" 30 | jcr:lastModified="{Date}2019-04-17T13:22:08.541+02:00" 31 | jcr:lastModifiedBy="admin" 32 | jcr:mixinTypes="[cq:LiveRelationship]" 33 | jcr:primaryType="nt:unstructured" 34 | sling:resourceType="core/cif/components/commerce/product/v1/product"/> 35 | </responsivegrid> 36 | </root> 37 | </jcr:content> 38 | </jcr:root> 39 | -------------------------------------------------------------------------------- /it/content/src/main/content/jcr_root/content/testproject/testplp/.content.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 3 | jcr:primaryType="cq:Page"> 4 | <jcr:content 5 | cq:lastModified="{Date}2019-11-06T17:43:01.352+02:00" 6 | cq:lastModifiedBy="admin" 7 | cq:lastRolledout="{Date}2019-04-17T13:22:08.543+02:00" 8 | cq:lastRolledoutBy="admin" 9 | cq:template="/conf/testproject/settings/wcm/templates/category-page" 10 | jcr:mixinTypes="[cq:LiveRelationship]" 11 | jcr:primaryType="cq:PageContent" 12 | jcr:title="Category page" 13 | sling:resourceType="core/cif/components/structure/page/v1/page"> 14 | <root 15 | cq:lastRolledout="{Date}2019-04-17T13:22:08.534+02:00" 16 | cq:lastRolledoutBy="admin" 17 | jcr:mixinTypes="[cq:LiveRelationship]" 18 | jcr:primaryType="nt:unstructured"> 19 | <responsivegrid 20 | cq:lastRolledout="{Date}2019-04-17T13:22:08.536+02:00" 21 | cq:lastRolledoutBy="admin" 22 | jcr:mixinTypes="[cq:LiveRelationship]" 23 | jcr:primaryType="nt:unstructured" 24 | sling:resourceType="wcm/foundation/components/responsivegrid"> 25 | <productlist 26 | cq:lastRolledout="{Date}2019-04-17T13:22:08.542+02:00" 27 | cq:lastRolledoutBy="admin" 28 | jcr:created="{Date}2019-03-29T17:03:07.030+02:00" 29 | jcr:createdBy="admin" 30 | jcr:lastModified="{Date}2019-04-17T13:22:08.541+02:00" 31 | jcr:lastModifiedBy="admin" 32 | jcr:mixinTypes="[cq:LiveRelationship]" 33 | jcr:primaryType="nt:unstructured" 34 | sling:resourceType="core/cif/components/commerce/productlist/v1/productlist"/> 35 | </responsivegrid> 36 | </root> 37 | </jcr:content> 38 | </jcr:root> 39 | -------------------------------------------------------------------------------- /it/http/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /it/http/src/test/java/com/adobe/cq/commerce/it/http/GraphqlOSGiConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.commerce.it.http; 16 | 17 | import java.util.HashMap; 18 | import java.util.Map; 19 | 20 | /** 21 | * Builds the OSGI config to be updated from the ITs. 22 | */ 23 | public class GraphqlOSGiConfig { 24 | 25 | Map<String, Object> config; 26 | 27 | public GraphqlOSGiConfig() { 28 | config = new HashMap<>(); 29 | } 30 | 31 | public Map<String, Object> build() { 32 | return this.config; 33 | } 34 | 35 | public GraphqlOSGiConfig withIdentifier(String identifier) { 36 | config.put("identifier", identifier); 37 | return this; 38 | } 39 | 40 | public GraphqlOSGiConfig withUrl(String url) { 41 | config.put("url", url); 42 | return this; 43 | } 44 | 45 | public GraphqlOSGiConfig withHttpMethod(String httpMethod) { 46 | config.put("httpMethod", httpMethod); 47 | return this; 48 | } 49 | 50 | public GraphqlOSGiConfig withAcceptSelfSignedCertificates(boolean acceptSelfSignedCertificates) { 51 | config.put("acceptSelfSignedCertificates", Boolean.valueOf(acceptSelfSignedCertificates).toString()); 52 | return this; 53 | } 54 | 55 | public GraphqlOSGiConfig withCatalogCachingSchedulerEnabled(boolean enableScheduler) { 56 | config.put("catalogCachingSchedulerEnabled", Boolean.valueOf(enableScheduler).toString()); 57 | return this; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /it/http/src/test/resources/com/adobe/cq/commerce/it/http/identity.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/commerce-cif-connector/0f5bb01d63ef4b1c006bd29074dec39bc6585738/it/http/src/test/resources/com/adobe/cq/commerce/it/http/identity.jks -------------------------------------------------------------------------------- /it/http/src/test/resources/com/adobe/cq/commerce/it/http/magento-graphql-categorylist-coats.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "categoryList": [ 4 | { 5 | "id": 19, 6 | "name": "Coats", 7 | "url_path": "men/coats", 8 | "url_key": "coats", 9 | "product_count": 0, 10 | "children_count": "0", 11 | "children": [] 12 | }, 13 | { 14 | "id": 25, 15 | "name": "Coats", 16 | "url_path": "women/coats", 17 | "url_key": "coats", 18 | "product_count": 0, 19 | "children_count": "0", 20 | "children": [] 21 | } 22 | ] 23 | } 24 | } -------------------------------------------------------------------------------- /it/http/src/test/resources/com/adobe/cq/commerce/it/http/magento-graphql-categorylist-empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "categoryList": [] 4 | } 5 | } -------------------------------------------------------------------------------- /it/http/src/test/resources/com/adobe/cq/commerce/it/http/magento-graphql-categorylist-men.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "categoryList": [ 4 | { 5 | "id": 15, 6 | "name": "Men", 7 | "url_path": "men", 8 | "url_key": "men", 9 | "product_count": 0, 10 | "children_count": "7", 11 | "children": [ 12 | { 13 | "id": 16, 14 | "name": "Shorts", 15 | "url_path": "men/shorts", 16 | "url_key": "shorts", 17 | "product_count": 0, 18 | "children_count": "0" 19 | }, 20 | { 21 | "id": 17, 22 | "name": "Shirts", 23 | "url_path": "men/shirts", 24 | "url_key": "shirts", 25 | "product_count": 0, 26 | "children_count": "0" 27 | }, 28 | { 29 | "id": 18, 30 | "name": "Pants", 31 | "url_path": "men/pants", 32 | "url_key": "pants", 33 | "product_count": 0, 34 | "children_count": "0" 35 | }, 36 | { 37 | "id": 19, 38 | "name": "Coats", 39 | "url_path": "men/coats", 40 | "url_key": "coats", 41 | "product_count": 0, 42 | "children_count": "0" 43 | }, 44 | { 45 | "id": 20, 46 | "name": "Gloves", 47 | "url_path": "men/gloves", 48 | "url_key": "gloves", 49 | "product_count": 0, 50 | "children_count": "0" 51 | }, 52 | { 53 | "id": 21, 54 | "name": "Footwear", 55 | "url_path": "men/footwear", 56 | "url_key": "footwear", 57 | "product_count": 0, 58 | "children_count": "0" 59 | }, 60 | { 61 | "id": 22, 62 | "name": "Scarfs", 63 | "url_path": "men/scarfs", 64 | "url_key": "scarfs", 65 | "product_count": 0, 66 | "children_count": "0" 67 | } 68 | ] 69 | } 70 | ] 71 | } 72 | } -------------------------------------------------------------------------------- /it/http/src/test/resources/com/adobe/cq/commerce/it/http/magento-graphql-categorylist-root.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "categoryList": [ 4 | { 5 | "id": 4, 6 | "name": "We.Retail Root Category", 7 | "url_path": null, 8 | "position": 3, 9 | "product_count": 0, 10 | "children_count": "3", 11 | "children": [ 12 | { 13 | "id": 5, 14 | "name": "Equipment", 15 | "url_path": "equipment", 16 | "position": 1 17 | }, 18 | { 19 | "id": 15, 20 | "name": "Men", 21 | "url_path": "men", 22 | "position": 2 23 | }, 24 | { 25 | "id": 7, 26 | "name": "Women", 27 | "url_path": "women", 28 | "position": 3 29 | } 30 | ] 31 | } 32 | ] 33 | } 34 | } -------------------------------------------------------------------------------- /it/mock-server/src/main/java/com/adobe/cq/testing/mockserver/Request.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.testing.mockserver; 16 | 17 | import javax.servlet.http.HttpServletRequest; 18 | 19 | /** 20 | * Generic interface that extends {@link RequestResponseRule} to include additional methods for mocking. 21 | */ 22 | public interface Request extends HttpServletRequest { 23 | 24 | /** 25 | * Match the request against another received request. 26 | * 27 | * @param r Request to compare 28 | * @return Returns true if the received request contains at least all properties of the request object. 29 | */ 30 | boolean match(RequestWrapper r); 31 | 32 | /** 33 | * Generic interface for a Request builder. 34 | */ 35 | interface Builder { 36 | 37 | /** 38 | * Validate and build Request object. 39 | * 40 | * @return Request object 41 | */ 42 | Request build(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /it/mock-server/src/main/java/com/adobe/cq/testing/mockserver/RequestWrapper.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.testing.mockserver; 16 | 17 | import java.io.IOException; 18 | 19 | import javax.servlet.http.HttpServletRequest; 20 | 21 | import org.apache.commons.io.IOUtils; 22 | 23 | /** 24 | * RequestWrapper wraps a HttpServletRequest to enable multiple caching of the request body. 25 | */ 26 | public class RequestWrapper { 27 | 28 | /** Request reference. */ 29 | private HttpServletRequest request; 30 | 31 | /** Request body cache. */ 32 | private String body = null; 33 | 34 | /** 35 | * Constructor. 36 | * 37 | * @param request Request reference. 38 | */ 39 | public RequestWrapper(HttpServletRequest request) { 40 | this.request = request; 41 | } 42 | 43 | /** 44 | * Returns the body of the request. 45 | * 46 | * @return Request body as string. 47 | * @throws IOException if body cannot be read 48 | */ 49 | public String getBody() throws IOException { 50 | if (this.body == null) { 51 | this.body = IOUtils.toString(this.request.getReader()); 52 | } 53 | return this.body; 54 | } 55 | 56 | /** 57 | * Returns request reference. 58 | * 59 | * @return Request reference. 60 | */ 61 | public HttpServletRequest getRequest() { 62 | return request; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /it/mock-server/src/main/java/com/adobe/cq/testing/mockserver/Response.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.testing.mockserver; 16 | 17 | import javax.servlet.http.HttpServletResponse; 18 | 19 | /** 20 | * Generic interface that extends {@link RequestResponseRule} to include additional methods for mocking. 21 | */ 22 | public interface Response extends HttpServletResponse { 23 | 24 | /** 25 | * Apply any property set on the response object to a given response. 26 | * 27 | * @param r Response object. 28 | */ 29 | void applyTo(HttpServletResponse r); 30 | 31 | /** 32 | * Generic interface for a Response builder. 33 | */ 34 | interface Builder { 35 | 36 | /** 37 | * Validate and build Response object. 38 | * 39 | * @return Response object 40 | */ 41 | Response build(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /it/mock-server/src/main/java/com/adobe/cq/testing/mockserver/Rule.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.testing.mockserver; 16 | 17 | import javax.servlet.http.HttpServletResponse; 18 | 19 | /** 20 | * Defines behavior of the mock server via the generic servlet. 21 | */ 22 | public interface Rule { 23 | 24 | /** 25 | * Checks if the Rule matches a given HTTP request. 26 | * 27 | * @param request HTTP request object 28 | * @return true if the rule matches the given HTTP request. 29 | */ 30 | boolean match(RequestWrapper request); 31 | 32 | /** 33 | * Execute the rule for given request and response object. 34 | * 35 | * @param request HTTP request object 36 | * @param response HTTP response object 37 | * @return true if the rule was applied 38 | */ 39 | boolean execute(RequestWrapper request, HttpServletResponse response); 40 | 41 | /** 42 | * Verify that the rule was applied correctly. 43 | * 44 | * @throws Exception if rule is not met 45 | */ 46 | void verify() throws Exception; 47 | 48 | /** 49 | * Reset the rule to be reused. 50 | */ 51 | void reset(); 52 | 53 | /** 54 | * Generic interface for a Rule builder. 55 | */ 56 | interface Builder { 57 | 58 | /** 59 | * Validate and build Rule object. 60 | * 61 | * @return Rule object 62 | */ 63 | Rule build(); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /it/mock-server/src/main/java/com/adobe/cq/testing/mockserver/Servlet.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.testing.mockserver; 16 | 17 | import java.io.IOException; 18 | import java.util.ArrayList; 19 | import java.util.List; 20 | 21 | import javax.servlet.ServletException; 22 | import javax.servlet.http.HttpServlet; 23 | import javax.servlet.http.HttpServletRequest; 24 | import javax.servlet.http.HttpServletResponse; 25 | 26 | import org.slf4j.Logger; 27 | import org.slf4j.LoggerFactory; 28 | 29 | /** 30 | * Generic servlet for the mock server. 31 | * The behavior of the servlet is defined by a set of rules that have to be added. 32 | */ 33 | public class Servlet extends HttpServlet { 34 | 35 | private static final Logger log = LoggerFactory.getLogger(Servlet.class); 36 | 37 | /** List of rules. */ 38 | private List<Rule> rules = new ArrayList<>(); 39 | 40 | /** 41 | * Reset and remove all the rules of the servlet. 42 | */ 43 | public void reset() { 44 | for (Rule rule : this.rules) { 45 | rule.reset(); 46 | } 47 | this.rules.clear(); 48 | } 49 | 50 | /** 51 | * Add a rule to the servlet. 52 | * 53 | * @param rule Rule to be added. 54 | */ 55 | public void add(Rule rule) { 56 | this.rules.add(rule); 57 | } 58 | 59 | /** 60 | * Verify all rules. 61 | * 62 | * @throws Exception if not all rules are met 63 | */ 64 | public void verify() throws Exception { 65 | for (Rule rule : this.rules) { 66 | rule.verify(); 67 | } 68 | } 69 | 70 | @Override 71 | protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 72 | 73 | log.info("Incoming request {}.", req.getRequestURI()); 74 | 75 | // Go through rules and execute the first that matches 76 | RequestWrapper wrapper = new RequestWrapper(req); 77 | for (Rule rule : rules) { 78 | if (rule.execute(wrapper, resp)) 79 | return; 80 | } 81 | 82 | // Return 404 if no rule is applicable 83 | resp.sendError(HttpServletResponse.SC_NOT_FOUND); 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /it/mock-server/src/main/java/com/adobe/cq/testing/mockserver/StringComparator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.testing.mockserver; 16 | 17 | /** 18 | * Generic interface for string comparison functions. 19 | */ 20 | @FunctionalInterface 21 | public interface StringComparator { 22 | boolean compare(String given); 23 | } 24 | -------------------------------------------------------------------------------- /it/mock-server/src/main/resources/com/adobe/cq/testing/mockserver/identity.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/commerce-cif-connector/0f5bb01d63ef4b1c006bd29074dec39bc6585738/it/mock-server/src/main/resources/com/adobe/cq/testing/mockserver/identity.jks -------------------------------------------------------------------------------- /it/mock-server/src/main/resources/com/adobe/cq/testing/mockserver/identity.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/commerce-cif-connector/0f5bb01d63ef4b1c006bd29074dec39bc6585738/it/mock-server/src/main/resources/com/adobe/cq/testing/mockserver/identity.p12 -------------------------------------------------------------------------------- /it/mock-server/src/test/java/com/adobe/cq/testing/mockserver/junit/ServerRule.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 3 | * Copyright 2019 Adobe. All rights reserved. 4 | * This file is licensed to you under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. You may obtain a copy 6 | * of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software distributed under 9 | * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 10 | * OF ANY KIND, either express or implied. See the License for the specific language 11 | * governing permissions and limitations under the License. 12 | * 13 | ******************************************************************************/ 14 | 15 | package com.adobe.cq.testing.mockserver.junit; 16 | 17 | import org.junit.rules.ExternalResource; 18 | 19 | import com.adobe.cq.testing.mockserver.Rule; 20 | import com.adobe.cq.testing.mockserver.Server; 21 | 22 | /** 23 | * Rule wrapper for the mock server to be used in JUnit. 24 | */ 25 | public class ServerRule extends ExternalResource { 26 | 27 | /** Server instance. */ 28 | private Server server; 29 | 30 | /** 31 | * Private constructor. 32 | */ 33 | private ServerRule() {} 34 | 35 | /** 36 | * Instantiate a ServerRule that automatically starts and stops a server as defined in the given Builder. 37 | * 38 | * @param builder Server.Builder object 39 | */ 40 | public ServerRule(Server.Builder builder) { 41 | super(); 42 | this.server = builder.build(); 43 | } 44 | 45 | @Override 46 | protected void before() throws Exception { 47 | this.server.start(); 48 | } 49 | 50 | @Override 51 | protected void after() { 52 | try { 53 | this.server.stop(); 54 | } catch (Exception e) { 55 | e.printStackTrace(); 56 | } 57 | } 58 | 59 | /** 60 | * Remove all rules from the server. 61 | */ 62 | public void reset() { 63 | this.server.reset(); 64 | } 65 | 66 | /** 67 | * Add a rule builder to the server. 68 | * 69 | * @param builder Rule.Builder object 70 | */ 71 | public void add(Rule.Builder builder) { 72 | this.server.add(builder); 73 | } 74 | 75 | /** 76 | * Add a rule to the server. 77 | * 78 | * @param rule Rule object 79 | */ 80 | public void add(Rule rule) { 81 | this.server.add(rule); 82 | } 83 | 84 | /** 85 | * Verify all the rules of the server. 86 | */ 87 | public void verify() throws Exception { 88 | this.server.verify(); 89 | } 90 | 91 | /** 92 | * HTTP port, the server is listening to. 93 | * 94 | * @return HTTP port 95 | */ 96 | public int getHttpPort() { 97 | return this.server.getHttpPort(); 98 | } 99 | 100 | /** 101 | * HTTPS port, the server is listening to. 102 | * 103 | * @return HTTPS port 104 | */ 105 | public int getHttpsPort() { 106 | return this.server.getHttpsPort(); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <!-- 3 | 4 | Copyright 2018 Adobe. All rights reserved. 5 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. You may obtain a copy 7 | of the License at http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed under 10 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 11 | OF ANY KIND, either express or implied. See the License for the specific language 12 | governing permissions and limitations under the License. 13 | 14 | --> 15 | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 16 | 17 | <parent> 18 | <groupId>com.adobe.commerce.cif</groupId> 19 | <artifactId>cif-connector-parent</artifactId> 20 | <version>1.8.2-SNAPSHOT</version> 21 | <relativePath>parent/pom.xml</relativePath> 22 | </parent> 23 | 24 | <modelVersion>4.0.0</modelVersion> 25 | <artifactId>cif-connector-reactor</artifactId> 26 | <packaging>pom</packaging> 27 | 28 | <name>CIF Connector Reactor</name> 29 | <description>Maven Multi-module project for the CIF connector project</description> 30 | 31 | <modules> 32 | <module>parent</module> 33 | <module>bundles/cif-virtual-catalog</module> 34 | <module>content/cif-virtual-catalog</module> 35 | <module>content/cif-connector</module> 36 | <module>bundles/cif-connector-graphql</module> 37 | <module>all</module> 38 | </modules> 39 | 40 | <!-- We have a dedicated profile for integration tests --> 41 | <!-- They are included by default unless we perform a release --> 42 | <profiles> 43 | <profile> 44 | <id>integration-tests</id> 45 | <activation> 46 | <property> 47 | <name>!skip-it</name> 48 | </property> 49 | </activation> 50 | <modules> 51 | <module>it/content</module> 52 | <module>it/http</module> 53 | <module>it/mock-server</module> 54 | </modules> 55 | </profile> 56 | </profiles> 57 | 58 | <scm> 59 | <connection>scm:git:https://github.com/adobe/commerce-cif-connector.git</connection> 60 | <developerConnection>scm:git:git@github.com:adobe/commerce-cif-connector.git</developerConnection> 61 | <url>https://github.com/adobe/commerce-cif-connector</url> 62 | <tag>HEAD</tag> 63 | </scm> 64 | <organization> 65 | <name>Adobe</name> 66 | <url>https://www.adobe.com</url> 67 | </organization> 68 | <licenses> 69 | <license> 70 | <name>The Apache License, Version 2.0</name> 71 | <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> 72 | </license> 73 | </licenses> 74 | 75 | </project> --------------------------------------------------------------------------------