Skip to content

Commit

Permalink
Merge pull request #460 from Adyen/feature/AD-319
Browse files Browse the repository at this point in the history
AD-319 Create CMS Components for Express Payment Methods Placeholder …
  • Loading branch information
pjaneta authored Oct 31, 2024
2 parents 2a1b393 + 4848863 commit f408346
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.adyen.v6.controllers.cms;

import com.adyen.v6.model.contents.components.AdyenAccExpressCheckoutCartPageComponentModel;
import de.hybris.platform.addonsupport.controllers.cms.AbstractCMSAddOnComponentController;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller(AdyenAccExpressCheckoutCartPageComponentModel._TYPECODE + "Controller")
@RequestMapping(value = "/view/" + AdyenAccExpressCheckoutCartPageComponentModel._TYPECODE + "Controller")
public class AdyenAccCartExpressCheckoutComponentController extends AbstractCMSAddOnComponentController<AdyenAccExpressCheckoutCartPageComponentModel> {

@Override
protected void fillModel(final HttpServletRequest request, final Model model, final AdyenAccExpressCheckoutCartPageComponentModel component) {
model.addAttribute("test", "testValue");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.adyen.v6.controllers.cms;

import com.adyen.v6.model.contents.components.AdyenAccExpressCheckoutProductPageComponentModel;
import de.hybris.platform.addonsupport.controllers.cms.AbstractCMSAddOnComponentController;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller(AdyenAccExpressCheckoutProductPageComponentModel._TYPECODE + "Controller")
@RequestMapping(value = "/view/" + AdyenAccExpressCheckoutProductPageComponentModel._TYPECODE + "Controller")
public class AdyenAccProductExpressCheckoutComponentController extends AbstractCMSAddOnComponentController<AdyenAccExpressCheckoutProductPageComponentModel> {

@Override
protected void fillModel(final HttpServletRequest request, final Model model, final AdyenAccExpressCheckoutProductPageComponentModel component) {
model.addAttribute("test", "testValue");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<%@ page trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<div class="row">
<div class="col-sm-8 col-md-6 pull-right">
Cart Page Express Checkout component
<br>
${test}
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<%@ page trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<div>
Product Page Express Checkout component
<br>
${test}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,13 @@
xsi:noNamespaceSchemaLocation="items.xsd">

<itemtypes>
<itemtype code="AdyenAccExpressCheckoutProductPageComponent" autocreate="true"
generate="true" extends="SimpleCMSComponent" jaloclass="com.adyen.v6.jalo.contents.components.AdyenAccExpressCheckoutProductPageComponent">
<description>Represents express checkout options for product page.</description>
</itemtype>
<itemtype code="AdyenAccExpressCheckoutCartPageComponent" autocreate="true"
generate="true" extends="SimpleCMSComponent" jaloclass="com.adyen.v6.jalo.contents.components.AdyenAccExpressCheckoutCartPageComponent">
<description>Represents express checkout options for product page.</description>
</itemtype>
</itemtypes>
</items>
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
$contentCatalog=electronicsContentCatalog
$contentCVS=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVersion.version[default=Staged])[default=$contentCatalog:Staged]
$contentCVO=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVersion.version[default=Online])[default=$contentCatalog:Online]
$contentCatalog = electronicsContentCatalog
$contentCVS = catalogVersion(CatalogVersion.catalog(Catalog.id[default = $contentCatalog]), CatalogVersion.version[default = Staged])[default = $contentCatalog:Staged]
$contentCVO = catalogVersion(CatalogVersion.catalog(Catalog.id[default = $contentCatalog]), CatalogVersion.version[default = Online])[default = $contentCatalog:Online]

INSERT_UPDATE JspIncludeComponent;uid[unique=true];page;$contentCVS[unique=true]
;CartComponent;/WEB-INF/views/responsive/pages/cart/cartDisplay.jsp
INSERT_UPDATE JspIncludeComponent; uid[unique = true]; page; $contentCVS[unique = true]
; CartComponent ; /WEB-INF/views/responsive/pages/cart/cartDisplay.jsp


INSERT_UPDATE JspIncludeComponent;uid[unique=true];page;$contentCVO[unique=true]
;CartComponent;/WEB-INF/views/responsive/pages/cart/cartDisplay.jsp
INSERT_UPDATE JspIncludeComponent; uid[unique = true]; page; $contentCVO[unique = true]
; CartComponent ; /WEB-INF/views/responsive/pages/cart/cartDisplay.jsp

INSERT_UPDATE ContentSlot; $contentCVS[unique = true]; uid[unique = true]; cmsComponents(&componentRef)[mode = merge]
; ; AddToCartSlot ; AccAdyenProductExpressCheckout

INSERT_UPDATE AdyenAccExpressCheckoutProductPageComponent; $contentCVS[unique = true]; uid[unique = true] ; name ; &componentRef
; ; AccAdyenProductExpressCheckout ; Adyen Accelerator Product Page Express Checkout ; AccAdyenProductExpressCheckout

INSERT_UPDATE ContentSlot; $contentCVS[unique = true]; uid[unique = true] ; cmsComponents($contentCVS, uid)
; ; TopContent-cartPage ; AccAdyenCartExpressCheckout,CartComponent
; ; BottomContentSlot-cartPage ; CheckoutComponent,AccAdyenCartExpressCheckout,CartSuggestions

INSERT_UPDATE AdyenAccExpressCheckoutCartPageComponent; $contentCVS[unique = true]; uid[unique = true] ; name ; &componentRef
; ; AccAdyenCartExpressCheckout ; Adyen Accelerator Cart Page Express Checkout ; AccAdyenCartExpressCheckout

0 comments on commit f408346

Please sign in to comment.