Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.classpath
.project
*.vlt
.settings/
target/
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
CQ Commerce implementation sample
=======================
=================================

A simple example that shows how to implement the CQ Commerce API.

This content package provides a bundle with a new custom implementation of the CQ Commerce API.
The bundle doesn't provide any particular extension; it just help understanding how to set it up and define it as the commerce provider.

Prerequisites
=============

A clean installation of Adobe Experience Manager 5.6.1 with the Geometrixx Outdoors demo site.

Installation
===========

mvn clean install -P installPackage
mvn clean install -P installPackage

change /content/geometrixx-outdoors/en/jcr:content/cq:commerceProvider value to 'training'
Change `/content/geometrixx-outdoors/en/jcr:content/cq:commerceProvider` value from `geometrixx` to `training` and then view a commerce page such as [http://localhost:4502/cf#/content/geometrixx-outdoors/en/equipment/skiing/banff-snow.html](http://localhost:4502/cf#/content/geometrixx-outdoors/en/equipment/skiing/banff-snow.html)
5 changes: 4 additions & 1 deletion bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<configuration>
<specVersion>1.2</specVersion>
</configuration>
<executions>
<execution>
<id>generate-scr-descriptor</id>
Expand Down Expand Up @@ -144,7 +147,7 @@
<dependency>
<groupId>com.adobe.cq.commerce</groupId>
<artifactId>cq-commerce-core</artifactId>
<version>5.6.8</version>
<version>5.6.18</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class TrainingCommerceServiceFactory extends AbstractJcrCommerceServiceFa
* Create a new <code>TrainingCommerceServiceImpl</code>.
*/
public CommerceService getCommerceService(Resource res) {
return new TrainingCommerceServiceImpl(getServices(), res);
return new TrainingCommerceServiceImpl(getServiceContext(), res);
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.adobe.training;

import java.util.List;

import com.adobe.cq.commerce.common.ServiceContext;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.resource.Resource;
Expand All @@ -22,8 +24,8 @@ public class TrainingCommerceServiceImpl extends AbstractJcrCommerceService impl
private Resource resource;
private ResourceResolver resolver;

public TrainingCommerceServiceImpl(AbstractJcrCommerceServiceFactory.Services services, Resource res) {
super(services);
public TrainingCommerceServiceImpl(ServiceContext serviceContext, Resource res) {
super(serviceContext);
this.resource = res;
this.resolver = res.getResourceResolver();
}
Expand Down Expand Up @@ -60,5 +62,8 @@ public CommerceResult search(CommerceQuery arg0) throws CommerceException {
// TODO Auto-generated method stub
return null;
}


public boolean isAvailable(String s) {
return true;
}
}
30 changes: 0 additions & 30 deletions bundle/target/classes/META-INF/MANIFEST.MF

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
13 changes: 0 additions & 13 deletions bundle/target/scr-plugin-generated/OSGI-INF/metatype/metatype.xml

This file was deleted.

24 changes: 0 additions & 24 deletions bundle/target/scr-plugin-generated/OSGI-INF/scr-plugin/scrinfo.xml

This file was deleted.

24 changes: 0 additions & 24 deletions bundle/target/scr-plugin-generated/OSGI-INF/serviceComponents.xml

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
5 changes: 0 additions & 5 deletions content/target/maven-archiver/pom.properties

This file was deleted.

92 changes: 0 additions & 92 deletions content/target/vault-work/META-INF/vault/config.xml

This file was deleted.

Loading