-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extracted environmente setup out of the examples
Now there is a third example that setups env for both image upload and product update examples.
- Loading branch information
1 parent
cb77260
commit 89b02e3
Showing
10 changed files
with
379 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Magento Search and Upload Demo | ||
============================== | ||
|
||
INTRODUCTION | ||
This example setups environment in order to be able to run media upload and price update examples. | ||
|
||
HOW TO DEMO: | ||
1. Set the following environment variables: | ||
a. magentoUsername This is the username of your Magento Account | ||
b. magentoPassword This is the password of your Magento account | ||
c. magentoAddress This is the url of your Magento server | ||
d. s3AccessKey This is the access key of your Amazon Account | ||
e. s3SecetKey. This is the secret key of your Amazon Account | ||
f. s3BucketName. This is a test bucket from where images where being uploaded to Magento | ||
2. Run the different setup flows from the MagentoFunctionalTestDriver, or deploy it an a Mule Container: | ||
a. CreatePriceUpdatesFlow: Creates some price update document in the mongodb. Alternatively, hit | ||
http://localhost:9090/magento-demo-setup-create-price-updates | ||
b. CreateProductsFlow: creates some products in Magento. Alternatively, you can hit | ||
http://localhost:9090/magento-demo-setup-create-products in order to run it. | ||
c. CreateS3BucketFlow and UploadS3ImageFlow: Creates a bucket and uploads an image to it. Alternatively, | ||
hit http://localhost:9090/magento-demo-setup-create-bucket and http://magento-demo-setup-upload-s3-image, respectively | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.mule.demos</groupId> | ||
<artifactId>mule-magento-demo-setup</artifactId> | ||
<packaging>mule</packaging> | ||
<name>Mule Magento Demo Setup</name> | ||
<version>1.0</version> | ||
|
||
<properties> | ||
<muleVersion>3.1.0</muleVersion> | ||
<ibeansVersion>1.1</ibeansVersion> | ||
<mule.magento.version>1.1-SNAPSHOT</mule.magento.version> | ||
<mule.s3.version>1.0</mule.s3.version> | ||
</properties> | ||
|
||
<description>Example that setups magento, s3 and mongo environment for the rest of magento examples</description> | ||
|
||
<build> | ||
<defaultGoal>install</defaultGoal> | ||
<finalName>${artifactId}</finalName> | ||
|
||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-enforcer-plugin</artifactId> | ||
<version>1.0-beta-1</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>enforce</goal> | ||
</goals> | ||
<configuration> | ||
<rules> | ||
<requireProperty> | ||
<property>env.MULE_HOME</property> | ||
<message>You must set MULE_HOME before building the demo.</message> | ||
</requireProperty> | ||
</rules> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>2.3.1</version> | ||
<configuration> | ||
<source>1.5</source> | ||
<target>1.5</target> | ||
<encoding>ISO-8859-1</encoding> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.mule.tools</groupId> | ||
<artifactId>maven-mule-plugin</artifactId> | ||
<version>1.5</version> | ||
<extensions>true</extensions> | ||
<configuration> | ||
<inclusions> | ||
<inclusion> | ||
<groupId>org.mule.modules</groupId> | ||
<artifactId>mule-module-magento</artifactId> | ||
</inclusion> | ||
<inclusion> | ||
<groupId>org.mule.modules</groupId> | ||
<artifactId>mule-module-s3</artifactId> | ||
</inclusion> | ||
<inclusion> | ||
<groupId>org.mule.transports</groupId> | ||
<artifactId>mule-transport-mongodb</artifactId> | ||
</inclusion> | ||
</inclusions> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-antrun-plugin</artifactId> | ||
<version>1.4</version> | ||
<executions> | ||
<execution> | ||
<id>package-example</id> | ||
<phase>install</phase> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
<configuration> | ||
<tasks> | ||
<copy file="${project.build.directory}/${artifactId}.zip" | ||
todir="${env.MULE_HOME}/apps" overwrite="true" /> | ||
</tasks> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.mule.modules</groupId> | ||
<artifactId>mule-module-magento</artifactId> | ||
<version>${mule.magento.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mule.modules</groupId> | ||
<artifactId>mule-module-s3</artifactId> | ||
<version>${mule.s3.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mule.transports</groupId> | ||
<artifactId>mule-transport-mongodb</artifactId> | ||
<version>3.1.0.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mule.tests</groupId> | ||
<artifactId>mule-tests-functional</artifactId> | ||
<version>${muleVersion}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.ibeans</groupId> | ||
<artifactId>ibeans-support</artifactId> | ||
<version>${ibeansVersion}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mule.modules</groupId> | ||
<artifactId>mule-module-ognl</artifactId> | ||
<version>${muleVersion}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mule.modules</groupId> | ||
<artifactId>mule-module-ibeans</artifactId> | ||
<version>${muleVersion}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mule.modules</groupId> | ||
<artifactId>mule-module-scripting</artifactId> | ||
<version>${muleVersion}</version> | ||
</dependency> | ||
</dependencies> | ||
<repositories> | ||
<repository> | ||
<id>muleforge-repo</id> | ||
<name>MuleForge Repository</name> | ||
<url>http://repository.muleforge.org</url> | ||
<layout>default</layout> | ||
</repository> | ||
<repository> | ||
<id>codehaus-repo</id> | ||
<name>Codehaus Repository</name> | ||
<url>http://dist.codehaus.org/mule/dependencies/maven2</url> | ||
<layout>default</layout> | ||
</repository> | ||
<repository> | ||
<id>ibeans-repo</id> | ||
<name>iBeans Repository</name> | ||
<url>http://repository.ibeans.muleforge.org</url> | ||
<layout>default</layout> | ||
</repository> | ||
</repositories> | ||
</project> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Mule Magento Cloud Connector | ||
Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com | ||
The software in this package is published under the terms of the CPAL v1.0 | ||
license, a copy of which has been included with this distribution in the | ||
LICENSE.txt file. | ||
--> | ||
|
||
<mule xmlns="http://www.mulesoft.org/schema/mule/core" | ||
xmlns:magento="http://www.mulesoft.org/schema/mule/magento" | ||
xmlns:s3="http://www.mulesoft.org/schema/mule/s3" | ||
xmlns:json="http://www.mulesoft.org/schema/mule/json" | ||
xmlns:mongodb="http://www.mulesoft.org/schema/mule/mongodb" | ||
xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" | ||
xmlns:spring="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:http="http://www.mulesoft.org/schema/mule/http" | ||
xsi:schemaLocation=" | ||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd | ||
http://www.mulesoft.org/schema/mule/magento http://www.mulesoft.org/schema/mule/magento/1.1-SNAPSHOT/mule-magento.xsd | ||
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd | ||
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/3.1/mule-json.xsd | ||
http://www.mulesoft.org/schema/mule/s3 http://www.mulesoft.org/schema/mule/s3/1.0/mule-s3.xsd | ||
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/3.1/mule-scripting.xsd | ||
http://www.mulesoft.org/schema/mule/mongodb http://www.mulesoft.org/schema/mule/mongodb/3.1/mule-mongodb.xsd | ||
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.0/mule-http.xsd"> | ||
|
||
<magento:config name="MagentoTest" username="${magentoUsername}" password="${magentoPassword}" address="${magentoAddress}" /> | ||
<s3:config accessKey="${s3AccessKey}" secretKey="${s3SecretKey}" /> | ||
<mongodb:connector name="mongodb" database="${mongoDatabase}" hostname="${mongoHostname}" /> | ||
|
||
<flow name="CreatePriceUpdatesFlow"> | ||
<description>Creates some price update document in the mongodb</description> | ||
<http:inbound-endpoint host="localhost" port="9090" | ||
path="magento-demo-setup-create-price-updates" /> | ||
<scripting:component> | ||
<scripting:script engine="groovy"> | ||
return [ "{ \"sku\": \"A04569\", \"price\": 8963}", "{ \"sku\": \"FF0AS489\", \"price\": 150 }", "{ \"sku\": \"1029H\", \"price \": 9863 }" ] | ||
</scripting:script> | ||
</scripting:component> | ||
<collection-splitter/> | ||
<mongodb:outbound-endpoint collection="priceUpdates"/> | ||
</flow> | ||
|
||
<flow name="CreateProductsFlow"> | ||
<description>Creates some products in Magento for testing. | ||
</description> | ||
<http:inbound-endpoint host="localhost" port="9090" | ||
path="magento-demo-setup-create-products" /> | ||
<magento:create-product set="4" sku="A04569" | ||
type="simple"> | ||
<magento:attributes> | ||
<magento:attribute key="name" value="Blue Oak Chair" /> | ||
<magento:attribute key="status" value="1" /> | ||
</magento:attributes> | ||
</magento:create-product> | ||
<magento:create-product set="4" sku="FF0AS489" | ||
type="simple"> | ||
<magento:attributes> | ||
<magento:attribute key="name" value="Levis Jeans" /> | ||
<magento:attribute key="status" value="1" /> | ||
</magento:attributes> | ||
</magento:create-product> | ||
<magento:create-product set="4" sku="1029H" | ||
type="simple"> | ||
<magento:attributes> | ||
<magento:attribute key="name" value="Generic USB Mouse" /> | ||
<magento:attribute key="status" value="1" /> | ||
<magento:attribute key="meta_keyword" value="technology" /> | ||
</magento:attributes> | ||
</magento:create-product> | ||
</flow> | ||
|
||
<flow name="CreateS3BucketFlow"> | ||
<description>Creates a bucket in S3 for testing</description> | ||
<http:inbound-endpoint host="localhost" port="9090" | ||
path="magento-demo-setup-create-bucket" /> | ||
<s3:create-bucket bucketName="${s3.bucketName}" /> | ||
</flow> | ||
|
||
<flow name="UploadS3ImageFlow"> | ||
<description>Uploads an USB mouse image to s3</description> | ||
<http:inbound-endpoint host="localhost" port="9090" | ||
path="magento-demo-setup-upload-s3-image" /> | ||
<outbound-endpoint | ||
address="http://www.zumbrovalley.net/ArcadeOptics/trackball/ms009s_top.jpg" /> | ||
<s3:create-object content="#[payload]" bucketName="${s3.bucketName}" | ||
key="1029H.jpg" acl="PUBLIC_READ" /> | ||
</flow> | ||
|
||
</mule> |
Oops, something went wrong.