Skip to content

Commit

Permalink
CQ-10370 - Write code samples showing how to extend the Hybris connector
Browse files Browse the repository at this point in the history
re-structuring the modules
  • Loading branch information
jckautzmann committed Dec 11, 2013
1 parent 5f9b121 commit b452097
Show file tree
Hide file tree
Showing 19 changed files with 81 additions and 32 deletions.
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,30 @@
cq-hybris-extensions
====================
My Project
========

This a content package project generated using the multimodule-content-package-archetype.

Building
--------

This project uses Maven for building. Common commands:

From the root directory, run ``mvn -PautoInstallPackage clean install`` to build the bundle and content package and install to a CQ instance.

From the bundle directory, run ``mvn -PautoInstallBundle clean install`` to build *just* the bundle and install to a CQ instance.

Using with VLT
--------------

To use vlt with this project, first build and install the package to your local CQ instance as described above. Then cd to `content/src/main/content/jcr_root` and run

vlt --credentials admin:admin checkout -f ../META-INF/vault/filter.xml --force http://localhost:4502/crx

Once the working copy is created, you can use the normal ``vlt up`` and ``vlt ci`` commands.

Specifying CRX Host/Port
------------------------

The CRX host and port can be specified on the command line with:
mvn -Dcrx.host=otherhost -Dcrx.port=5502 <goals>


5 changes: 5 additions & 0 deletions myproject/bundle/pom.xml → bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.jcr.api</artifactId>
</dependency>
<dependency>
<groupId>com.adobe.cq.commerce</groupId>
<artifactId>cq-commerce-hybris-impl</artifactId>
</dependency>

</dependencies>

<!-- ====================================================================== -->
Expand Down
40 changes: 40 additions & 0 deletions bundle/src/main/java/com/mycompany/myproject/MyImportHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*************************************************************************
*
* ADOBE CONFIDENTIAL
* __________________
*
* Copyright 2013 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/
package com.mycompany.myproject;

import javax.jcr.Node;

import com.adobe.cq.commerce.hybris.importer.DefaultImportHandler;
import com.adobe.cq.commerce.hybris.importer.ImportHandler;
import com.adobe.cq.commerce.hybris.importer.ImporterContext;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.api.resource.ValueMap;

/**
* Customized import handler for Hybris product catalogs.
*/
@Component(metatype = true, label = "Customized Commerce Hybris Import Handler")
@Service
public class MyImportHandler extends DefaultImportHandler implements ImportHandler {

public void updateAsset(Node imageNode, ImporterContext ctx, ValueMap values) throws Exception {
// put your code here
}

}
File renamed without changes.
30 changes: 0 additions & 30 deletions myproject/README.md

This file was deleted.

6 changes: 6 additions & 0 deletions myproject/pom.xml → pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@
<version>2.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.adobe.cq.commerce</groupId>
<artifactId>cq-commerce-hybris-impl</artifactId>
<version>5.6.200</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down

0 comments on commit b452097

Please sign in to comment.