Code Monkey home page Code Monkey logo

aimeos-flow's Introduction

Aimeos logo

Aimeos Flow/Neos package

Build Status Scrutinizer Code Quality

โญ Star us on GitHub โ€” it helps!

Aimeos is THE professional, full-featured and high performance e-commerce package for Flow/NeosCMS! You can install it in your existing Flow application within 5 minutes and can adapt, extend, overwrite and customize anything to your needs.

Aimeos Flow demo

Table of content

Installation

This document is for the latest Aimeos Flow 2019.10 release and later.

  • LTS release: 2019.10

The Aimeos Flow/Neos web shop package is a composer based library that can be installed easiest by using Composer:

composer create-project neos/flow-base-distribution myshop

Make sure that the database is set up and it is configured. If you want to use a database server other than MySQL, please have a look into the article about supported database servers and their specific configuration.

Neos has a nice setup page for this when opening the /setup URL of your installation. For Flow, this is done in your Configuration/Settings.yaml file and must at least include these settings:

Neos:
  Flow:
    persistence:
      backendOptions:
        host: '<host name or IP address>'
        dbname: '<database name>'
        user: '<database user name>'
        password: '<secret password>'

Important: The configuration file format requires each additional indention to be two spaces. Not more, not less and no tabs at all! Otherwise, you will get an error about an invalid configuration file format.

Then add these lines to your composer.json of your Flow/Neos project:

    "extra": {
        "installer-paths": {
            "Packages/Extensions/{$name}/": ["type:aimeos-extension"]
        }
    },
    "prefer-stable": true,
    "minimum-stability": "dev",
    "require": {
        "aimeos/aimeos-flow": "~2019.10",
        ...
    },

Afterwards, install the Aimeos shop package using

composer update

Setup

To create all required tables and to add the demo data, you need to execute a Flow console command in the base directory of your Flow application:

./flow aimeos:setup --option=setup/default/demo:1

In a production environment or if you don't want that the demo data gets installed, leave out the --option=setup/default/demo:1 option.

For Flow only you need to import the routes from the Aimeos web shop package into your Configuration/Routes.yaml nice looking URLs. Insert the lines below to the beginning of the Routes.yaml file:

-
  name: 'Aimeos'
  uriPattern: 'shop/<AimeosShopRoutes>'
  subRoutes:
    AimeosShopRoutes:
      package: 'Aimeos.Shop'

It's important to import the routes from the Aimeos web shop package before the FlowSubroutes lines. If you add it afterwards, the default Flow routes will match first and you will get an error that the requested package/action wasn't found.

Now Flow would basically know which controller/action it shall execute. But with Neos, one additional step is needed:

Add the following PrivilegeTarget to Configuration/Policy.yaml

privilegeTargets:
  Neos\Flow\Security\Authorization\Privilege\Method\MethodPrivilege:
    'MyShop:AllActions':
      matcher: 'method(Aimeos\Shop\Controller\(.*)Controller->(.*)Action())'

roles:
  'Neos.Flow:Everybody':
    privileges:
      -
        privilegeTarget: 'MyShop:AllActions'
        permission: GRANT

The above will grant access to all Aimeos Controller/Actions pairs, for everyone - probably not what you want. Please refine to your needs!

Then, you should be able to call the catalog list page in your browser using

http://<your web root>/shop/list

For the administration interface you have to setup authenticaton first and log in before you will be able to get into the shop management interface:

http://<your web root>/shop/admin

Hints

To simplify development, you should configure to use no content cache. You can do this in the Configuration/Settings.yaml file of your Flow/Neos application by adding these lines at the bottom:

Aimeos:
  Shop:
    flow:
      cache:
        name: None

License

The Aimeos Flow/Neos package is licensed under the terms of the LGPLv3 license and is available for free.

Links

aimeos-flow's People

Contributors

aimeos avatar htuscher avatar mrimann avatar scrutinizer-auto-fixer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

aimeos-flow's Issues

Fatal Error when doing ./flow aimeos:setup

Hi,

just installed aimeos with composer and when getting the part with ./flow aimeos:setup --option=setup/default/demo:1 i got a fatal error:

PHP Fatal error: Class 'Imagine\Image\ImageInterface' not found in /Users/kim/Sites/Neos-2.0/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Reflection/ReflectionService.php on line 1700
Execution of subprocess failed with exit code 255 without any further output.
(Please check your PHP error log for possible Fatal errors)

Type: TYPO3\Flow\Core\Booting\Exception\SubProcessException
Code: 1355480641
File: Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Core/Booting/Scripts.php
Line: 528

Running Neos 2.0 on local machine (Mac) and installation went smooth with all dependencies done via composer.

Any idea or have you had this error before.

Kind regards,

Kim Holberg

not compatible with Flow 4

I tried to install Aimeos for the first time, and it seems it is not compatible with Flow 4 (or Neos 3.0 in that matter)

Is it planned to update aimeos-flow for it?
i tried it with
"aimeos/aimeos-flow": "~2017.02"

but i got the error

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: remove neos/flow 4.0.1
    - Conclusion: don't install neos/flow 4.0.1
    - Conclusion: remove neos/neos 3.0.1
    - Installation request for aimeos/aimeos-flow ~2017.02 -> satisfiable by aimeos/aimeos-flow[2017.02.x-dev].
    - Conclusion: don't install neos/flow 4.0.0
    - neos/neos 3.0.0 requires neos/flow ~4.0.0 -> satisfiable by neos/flow[4.0.1, 4.0.0, 4.0.x-dev].
    - neos/neos 3.0.1 requires neos/flow ~4.0.0 -> satisfiable by neos/flow[4.0.1, 4.0.0, 4.0.x-dev].
    - neos/neos 3.0.x-dev requires neos/flow ~4.0.0 -> satisfiable by neos/flow[4.0.1, 4.0.0, 4.0.x-dev].
    - Conclusion: don't install neos/flow 4.0.x-dev
    - Installation request for neos/neos ~3.0.0 -> satisfiable by neos/neos[3.0.0, 3.0.1, 3.0.x-dev].

Error during setup

Hi,

I am using Neos 3.0.6 version of Neos. While running this command ./flow aimeos:setup i get the following error
Required class "Aimeos\Flow\AimeosTypeConverter" could not be loaded properly for reflection.
Am i missing something ?

Secured Shop Admin Backend in Neos Documentation?

Hello, first thank you for making it compatible with Neos 3.0 so quickly. :)

One thing however i noticed is that the Admin Backend is not secured by default, so we have to use the Framework way to do this.

I got that working too now, Only one small thing i noticed is that the Simple Mode does not send the csrf_token for the graphs. so i think thats the reason i only see the spinners in the Dashboard and the XHR Request shows You are not allowed to perform this action. in the browser debugger though i allowed the Jsonadm Controller.

So far everything i tried from the Expert Mode works, and i saw the csrf_token send there. So the Expert Mode works.

Also Unfortunately its nowhere really documented how to configure how to secure the Shop Admin Backend for Neos. Maybe that could be documented?

My Configuration for it is the following
(not sure if thats the correct NamePattern of the controllers. Will have to check if the Controller accessible to everybody has any action that users should not be able to execute):

Settings.yaml

Neos:
  Flow:
    security:
      authentication:
        providers:
          'Neos.Neos:Backend':
            requestPatterns:
              'MyShop:AdminControllers':
                pattern: 'ControllerObjectName'
                patternOptions:
                  controllerObjectNamePattern: 'Aimeos\Shop\Controller\(Admin|Extadm|Jsonadm|Jqadm).*'

Policy.yaml

privilegeTargets:
  Neos\Flow\Security\Authorization\Privilege\Method\MethodPrivilege:
    'MyShop:AllActions':
      matcher: 'method(Aimeos\Shop\Controller\(Catalog|Locale|Account|Basket|Checkout|Page|Jsonapi)Controller->(.*)Action())'

    'MyShop:AdminActions':
      matcher: 'method(Aimeos\Shop\Controller\(Admin|Extadm|Jsonadm|Jqadm)Controller->(.*)Action())'

roles:
  'Aimeos.Shop:ShopAdmin':
    privileges:
      -
        privilegeTarget: 'MyShop:AllActions'
        permission: GRANT
      -
        privilegeTarget: 'MyShop:AdminActions'
        permission: GRANT

  'Neos.Flow:Everybody':
    privileges:
      -
        privilegeTarget: 'MyShop:AllActions'
        permission: GRANT

Sorry for the long text, and thanks for that nice shop system. ;)

Missing step in the documentation?

Hi

I've started a fresh Neos 2.0 installation and followed your steps to get Aimeos added. But I can't reach the store frontend (/shop/list) and the admin area (/shop/admin).

What I see is the following error:
NOTICE Flow No authentication entry point found for active tokens, therefore cannot authenticate or redirect to authentication automatically.

And if I leave out adding the Subroutes to the global route definition, then it just ends up in a "page not found" error.

Is there something missing in the documentation that needs to be done, to get Aimeos up and running?

401 Unauthorized

I follow the install document,
I already added PrivilegeTarget to /neos-2.0/Configuration/Policy.yml
And then view http:///shop/list,
:

Uncaught Exception in Flow
#1222204027: Could not authenticate any token.

Might be missing or wrong credentials or no authentication provider matched.
Evaluated following 1 privilege target(s):
"TYPO3.Neos:AllControllerActions": ABSTAIN
(0 granted, 0 denied, 1 abstained)

More information
TYPO3\Flow\Security\Exception\NoTokensAuthenticatedException thrown in file
/neos-2.0/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/TYPO3_Flow_Security_Authorization_Interceptor_PolicyEnforcement.php in line 100.
Reference code: 20151113055828d4f24b

18 TYPO3\Flow\Security\Authorization\Interceptor\PolicyEnforcement_Original::invoke()


/neos-2.0/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/TYPO3_Flow_Security_Aspect_PolicyEnforcementAspect.php:

00059:   if ($this->securityContext->areAuthorizationChecksDisabled() !== TRUE) {
00060:    $this->policyEnforcementInterceptor->setJoinPoint($joinPoint);

00061:    $this->policyEnforcementInterceptor->invoke();

00062:   }
00063: 


17 TYPO3\Flow\Security\Aspect\PolicyEnforcementAspect_Original::enforcePolicy(TYPO3\Flow\Aop\JoinPoint)


Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Aop/Advice/AroundAdvice.php:

00032:   $adviceObject = $this->objectManager->get($this->aspectObjectName);
00033:   $methodName = $this->adviceMethodName;

00034:   return $adviceObject->$methodName($joinPoint);

00035:  }
00036: }


16 TYPO3\Flow\Aop\Advice\AroundAdvice::invoke(TYPO3\Flow\Aop\JoinPoint)


Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Aop/Advice/AdviceChain.php:

00053:   $this->adviceIndex++;
00054:   if ($this->adviceIndex < count($this->advices)) {

00055:    $result = $this->advices[$this->adviceIndex]->invoke($joinPoint);

00056:   } else {
00057:    $result = $joinPoint->getProxy()->Flow_Aop_Proxy_invokeJoinpoint($joinPoint);


15 TYPO3\Flow\Aop\Advice\AdviceChain::proceed(TYPO3\Flow\Aop\JoinPoint)


/neos-2.0/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Aimeos_Shop_Controller_CatalogController.php:

00709:     $adviceChain->rewind();
00710:     $joinPoint = new \TYPO3\Flow\Aop\JoinPoint($this, 'Aimeos\Shop\Controller\CatalogController', 'listAction', $methodArguments, $adviceChain);

00711:     $result = $adviceChain->proceed($joinPoint);

00712:     $methodArguments = $joinPoint->getMethodArguments();
00713: 


14 Aimeos\Shop\Controller\CatalogController::listAction()


13 call_user_func_array(array|2|, array|0|)


/neos-2.0/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/TYPO3_Flow_Mvc_Controller_ActionController.php:

00406: 
00407:   if (!$validationResult->hasErrors()) {

00408:    $actionResult = call_user_func_array(array($this, $this->actionMethodName), $preparedArguments);

00409:   } else {
00410:    $actionIgnoredArguments = static::getActionIgnoredValidationArguments($this->objectManager);


12 TYPO3\Flow\Mvc\Controller\ActionController_Original::callActionMethod()


/neos-2.0/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/TYPO3_Flow_Mvc_Controller_ActionController.php:

00173:   }
00174: 

00175:   $this->callActionMethod();

00176:  }
00177: 


11 TYPO3\Flow\Mvc\Controller\ActionController_Original::processRequest(TYPO3\Flow\Mvc\ActionRequest, TYPO3\Flow\Http\Response)


/neos-2.0/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/TYPO3_Flow_Mvc_Dispatcher.php:

00148:    try {
00149:     $this->emitBeforeControllerInvocation($request, $response, $controller);

00150:     $controller->processRequest($request, $response);

00151:     $this->emitAfterControllerInvocation($request, $response, $controller);
00152:    } catch (StopActionException $exception) {


10 TYPO3\Flow\Mvc\Dispatcher_Original::initiateDispatchLoop(TYPO3\Flow\Mvc\ActionRequest, TYPO3\Flow\Http\Response)


/neos-2.0/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/TYPO3_Flow_Mvc_Dispatcher.php:

00102:    /** @var ActionRequest $request */
00103:    $firewall->blockIllegalRequests($request);

00104:    $this->initiateDispatchLoop($request, $response);

00105:   } catch (AuthenticationRequiredException $exception) {
00106:    $entryPointFound = FALSE;


9 TYPO3\Flow\Mvc\Dispatcher_Original::dispatch(TYPO3\Flow\Mvc\ActionRequest, TYPO3\Flow\Http\Response)


8 call_user_func_array(array|2|, array|2|)


Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Object/DependencyInjection/DependencyProxy.php:

00092:   */
00093:  public function __call($methodName, array $arguments) {

00094:   return call_user_func_array(array($this->_activateDependency(), $methodName), $arguments);

00095:  }
00096: 


7 TYPO3\Flow\Object\DependencyInjection\DependencyProxy::__call("dispatch", array|2|)


/neos-2.0/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/TYPO3_Flow_Mvc_DispatchComponent.php:

00100: 
00101:   $componentContext->setParameter('TYPO3\Flow\Mvc\DispatchComponent', 'actionRequest' ,$actionRequest);

00102:   $this->dispatcher->dispatch($actionRequest, $componentContext->getHttpResponse());

00103:  }
00104: 


6 TYPO3\Flow\Object\DependencyInjection\DependencyProxy::dispatch(TYPO3\Flow\Mvc\ActionRequest, TYPO3\Flow\Http\Response)


/neos-2.0/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/TYPO3_Flow_Mvc_DispatchComponent.php:

00100: 
00101:   $componentContext->setParameter('TYPO3\Flow\Mvc\DispatchComponent', 'actionRequest' ,$actionRequest);

00102:   $this->dispatcher->dispatch($actionRequest, $componentContext->getHttpResponse());

00103:  }
00104: 


5 TYPO3\Flow\Mvc\DispatchComponent_Original::handle(TYPO3\Flow\Http\Component\ComponentContext)

/neos-2.0/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/TYPO3_Flow_Http_Component_ComponentChain.php:

00051:     continue;
00052:    }

00053:    $component->handle($componentContext);

00054:    if ($componentContext->getParameter('TYPO3\Flow\Http\Component\ComponentChain', 'cancel') === TRUE) {
00055:     $componentContext->setParameter('TYPO3\Flow\Http\Component\ComponentChain', 'cancel', NULL);


4 TYPO3\Flow\Http\Component\ComponentChain_Original::handle(TYPO3\Flow\Http\Component\ComponentContext)

/neos-2.0/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/TYPO3_Flow_Http_Component_ComponentChain.php:

00051:     continue;
00052:    }

00053:    $component->handle($componentContext);

00054:    if ($componentContext->getParameter('TYPO3\Flow\Http\Component\ComponentChain', 'cancel') === TRUE) {
00055:     $componentContext->setParameter('TYPO3\Flow\Http\Component\ComponentChain', 'cancel', NULL);


3 TYPO3\Flow\Http\Component\ComponentChain_Original::handle(TYPO3\Flow\Http\Component\ComponentContext)


Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Http/RequestHandler.php:

00105: 
00106:   $componentContext = new ComponentContext($this->request, $this->response);

00107:   $this->baseComponentChain->handle($componentContext);

00108: 
00109:   $this->response->send();


2 TYPO3\Flow\Http\RequestHandler::handleRequest()


Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Core/Bootstrap.php:

00110: 
00111:   $this->activeRequestHandler = $this->resolveRequestHandler();

00112:   $this->activeRequestHandler->handleRequest();

00113:  }
00114: 


1 TYPO3\Flow\Core\Bootstrap::run()


/neos-2.0/Web/index.php:

00025: $context = \TYPO3\Flow\Core\Bootstrap::getEnvironmentConfigurationSetting('FLOW_CONTEXT') ?: 'Development';
00026: $bootstrap = new \TYPO3\Flow\Core\Bootstrap($context);

00027: $bootstrap->run();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.