Writing a recipe

Marco Steinhaeuser edited this page Jun 13, 2017 · 6 revisions

Introduction

It´s quite easy to write your own recipe for the OXID module connector.

  1. fork OMC recipes branch
  2. create a vendor directory (if it doesn't exist yet)
  3. create a recipe file
  4. send a pull request

Example

  {
      "name": "PayPal",
      "vendor": "oxid",
      "id": "oepaypapl",
      "type": "oxid",
      "picture": "",
      "license": "GNU",
      "desc": {
        "en": "PayPal payment method for checkout.",
        "de": "PayPal als Zahlart."
     },
      "tags": [
          "frontend",
          "paypal",
          "payment",
          "checkout"
      ],
      "versions": {
          "3.2.1": {
              "project": "https://github.com/OXID-eSales/paypal/tree/v3.2.1",
              "url": "https://github.com/OXID-eSales/paypal/archive/v3.2.1.zip",
              "supported": [
                  	"4.9",
                  	"4.8",
                  	"4.7"
              ],
              "mapping": [
              	{
                  	"src": "source/modules/oe/",
                  	"dest": "modules/oe/"
              	}
              ]
          }
      }
  }

Documentation

Key Value Type Description
name PayPal string Module name
vendor oxid string Vendor name (= vendor directory name, lowercase, one word)
id oepaypal string License type
type oxid string OXID module id (metadata.php)
license GNU string License type
picture http://my.shop/logo.jpg string Module icon [optional]
desc "en": "modul description" array Module description
tags frontend, paypal, payment, checkout array Module tags
versions 3.2.1 arrray Module versions (see table below)

Module versions

Key Value Type Description
project https://github.com/OXID-eSales/paypal/tree/v3.2.1 string Project / module url
url https://github.com/OXID-eSales/paypal/archive/v3.2.1.zip string Source file url (if url is not set, module will be displayed, but installation is not possible)
supported 4.9, 4.8, 4.7 array Support application versions
mapping array Firectory / file mappgins (see table below)

Directory / file mappings

Key Value Type Description
src source/modules/oe/ string Source directory / file (recursive)
dest modules/oe/ string Destination directory / file

Hooks (optional)

Key Value Type Description
preinstall array before / during module download
type str alert OR overlay
message str your notification message
link str information url
postinstall array after module download
type str alert OR overlay
message str your notification message
link str information url

##More examples Using single mapping file ...

  {
      "name": "XML-Sitemap for OXID",
      "vendor": "proudcommerce",
      "type": "oxid",
      "license": "GNU",
      "desc": {
        "en": "Generated an XML sitemap for OXID eshop.",
        "de": "Erzeugt eine XML-Sitemap für den Shop."
      },
      "tags": [
          "frontend",
          "seo",
          "sitemap"
      ],
      "versions": {
          "1.0.0": {
              "project": "https://github.com/proudcommerce/google_sitemap",
              "url": "https://github.com/proudcommerce/google_sitemap/archive/master.zip",
              "supported": [
                  	"4.9",
                  	"4.8",
                  	"4.7",
                  	"4.6"
              ],
              "mapping": [
              	{
                  	"src": "google_sitemap_xml.php",
                  	"dest": "google_sitemap_xml.php"
              	}
              ]
          }
      }
  }

Using more module versions ...

  {
      "name": "Mobile Theme",
      "vendor": "oxid",
      "type": "oxid",
      "license": "GNU",
      "desc": {
        "en": "Mobile theme for OXID eshop.",
        "de": "Mobile Theme für den OXID eShop."
      },
      "tags": [
          "frontend",
          "mobile",
          "theme"
      ],
      "versions": {
          "1.3.0": {
              "project": "https://github.com/OXID-eSales/mobile_theme/tree/b-1.3",
              "url": "https://github.com/OXID-eSales/mobile_theme/archive/v1.3.0.zip",
              "supported": [
                  	"4.9",
                  	"4.8"
              ],
              "mapping": [
              	{
                  	"src": "source/modules/oe/",
                  	"dest": "modules/oe/"
                }
              ]
          },
          "1.1.0": {
              "project": "https://github.com/OXID-eSales/mobile_theme/tree/b-1.1",
              "url": "https://github.com/OXID-eSales/mobile_theme/archive/v1.1.0.zip",
              "supported": [
                  	"4.7"
              ],
              "mapping": [
              	{
                  	"src": "source/modules/oe/",
                  	"dest": "modules/oe/"
              	}
              ]
          }
      }
  }

Using more module directory / file mappings ...

  {
      "name": "TOXID cURL",
      "vendor": "marmalade",
      "type": "oxid",
      "license": "unknown",
      "desc": {
        "en": "TOXID cURL enables you to load dynamic CMS content into your OXID eShop.",
        "de": "TOXID cURL bietet die Möglichkeit dynamischen CMS Content in den OXID eShop einzubinden"
      },
      "tags": [
      	"frontend",
          "content",
          "wordpress",
          "typo3",
          "redaxo"
      ],
      "versions": {
          "2.0.0": {
              "project": "https://github.com/jkrug/TOXID-cURL",
              "url": "https://github.com/jkrug/TOXID-cURL/archive/master.zip",
              "supported": [
              		"4.9",
                  	"4.8",
                  	"4.7"
              ],
              "mapping": [
              	{
                  	"src": "",
                  	"dest": "modules/toxid_curl/"
              	},
              	{
                  	"src": "smarty/plugins/",
                  	"dest": "smarty/plugins/"
              	}
              ]
          }
      }
  }

Using hooks ...

{
    "name": "oxid|JSON",
    "vendor": "shoptimax",
    "type": "oxid",
    "license": "GNU",
    "desc": {
      "en": "REST interface for the OXID eShop using the Tonic PHP framework with AngularJS backend.",
      "de": "REST Interface für den OXID eShop."
    },
    "tags": [
        "backend",
        "REST",
        "Tonic",
        "angularjs"
    ],
    "versions": {
        "1.0.0": {
            "project": "https://github.com/shoptimax/oxidjson",
            "url": "https://github.com/shoptimax/oxidjson/archive/master.zip",
            "supported": [
                "4.8",
                "4.7"
            ],
            "mapping": [
                {
                    "src": "app/",
                    "dest": "app/"
                },
                {
                    "src": "modules/",
                    "dest": "modules/"
                },
                {
                    "src": "oxrest/",
                    "dest": "oxrest/"
                }
            ]
        }
    },
    "hooks": {
        "preinstall": {
            "type" : "alert",
            "message": "Thank you for using oxid|json! Have fun with this module :)"
        },
        "postinstall": {
            "type" : "overlay",
            "message": "Please adjust your .htaccess file and make sure that the required libs are installed!",
            "link": "https://github.com/shoptimax/oxidjson"
        }
    }
}
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.