Use only when create a new resource

@EXT\Route(
"/perms/open/{node}",
name="claro_resource_open_perms",
options={"expose"=true}
)
420743
public function openPermsAction(ResourceNode $node)
    {
        $collection = new ResourceCollection(array($node));
        $this->checkAccess('ADMINISTRATE', $collection);
        $this->rightsManager->editPerms(1, $this->roleManager->getRoleByName('ROLE_USER'), $node, false);
        $this->rightsManager->editPerms(1, $this->roleManager->getRoleByName('ROLE_ANONYMOUS'), $node, false);

        return new Response('', 204, array('Content-Type' => 'application/json'));
    }
537285
protected function findOrCreateRoute($path, $locale, CustomUrlBehavior $document, $route)
    {
        try {
            /** @var RouteDocument $routeDocument */
            $routeDocument = $this->documentManager->find($path, $locale);
        } catch (DocumentNotFoundException $ex) {
            return $this->documentManager->create('custom_url_route');
        }

        if (!$routeDocument instanceof RouteDocument
            || $routeDocument->getTargetDocument()->getUuid() !== $document->getUuid()
        ) {
            throw new ResourceLocatorAlreadyExistsException($route, $document->getTitle());
        }

        return $routeDocument;
    }
789434
public function create()
	{
		try
		{
			$this->client->send(new Request($this->uri->withPath($this->uri->getPath().'resources')
				->withQuery(http_build_query([
					'path' => $this->getPath()
				], null, '&')), 'PUT'));
			$this->setContents([]);
		}
		catch (\Exception $exc)
		{
			throw $exc;
		}

		return $this;
	}
1139900
public function onCreate(CreateResourceEvent $event)
    {
        $request = $this->container->get('request');
        $form = $this->container->get('form.factory')->create(new FileType(true), new File());
        $form->handleRequest($request);

        if ($form->isValid()) {
            $this->handleFileCreation($form, $event);
        }

        $content = $this->container->get('templating')->render(
            'ClarolineCoreBundle:Resource:createForm.html.twig',
            array(
                'form' => $form->createView(),
                'resourceType' => $event->getResourceType()
            )
        );
        $event->setErrorFormContent($content);
        $event->stopPropagation();
    }
665062
private function addRoute(RouteCollection $routeCollection, string $resourceClass, string $operationName, array $operation, ResourceMetadata $resourceMetadata, string $operationType): void
    {
        $resourceShortName = $resourceMetadata->getShortName();

        if (isset($operation['route_name'])) {
            return;
        }

        if (!isset($operation['method'])) {
            throw new RuntimeException(sprintf('Either a "route_name" or a "method" operation attribute must exist for the operation "%s" of the resource "%s".', $operationName, $resourceClass));
        }

        if (null === $controller = $operation['controller'] ?? null) {
            $controller = sprintf('%s%s_%s', self::DEFAULT_ACTION_PATTERN, strtolower($operation['method']), $operationType);

            if (!$this->container->has($controller)) {
                throw new RuntimeException(sprintf('There is no builtin action for the %s %s operation. You need to define the controller yourself.', $operationType, $operation['method']));
            }
        }

        $path = trim(trim($resourceMetadata->getAttribute('route_prefix', '')), '/');
        $path .= $this->operationPathResolver->resolveOperationPath($resourceShortName, $operation, $operationType, $operationName);

        $route = new Route(
            $path,
            [
                '_controller' => $controller,
                '_format' => null,
                '_api_resource_class' => $resourceClass,
                sprintf('_api_%s_operation_name', $operationType) => $operationName,
            ] + ($operation['defaults'] ?? []),
            $operation['requirements'] ?? [],
            $operation['options'] ?? [],
            $operation['host'] ?? '',
            $operation['schemes'] ?? [],
            [$operation['method']],
            $operation['condition'] ?? ''
        );

        $routeCollection->add(RouteNameGenerator::generate($operationName, $resourceShortName, $operationType), $route);
    }
606708
public function openFinderExplorerPath($path, $node)
    {
        $path = explode('/', $path);
        foreach ($path as $nodeName) {
            $this->openFinderExplorerNode($nodeName, $node);
        }
    }
987265
public function onOpen(OpenResourceEvent $event)
    {
        $params = [];
        $params['_controller'] = 'IcapWebsiteBundle:Website:view';
        $params['websiteId'] = $event->getResource()->getId();
        $params['view'] = false;
        $subRequest = $this->request->duplicate([], null, $params);
        $response = $this->httpKernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
        $event->setResponse($response);
        $event->stopPropagation();
    }
1251895
public function init() {

        parent::init();

		// Permission
        $this->crudPermission = CmsGlobal::PERM_BLOG_ADMIN;

		// Config
		$this->parentType	= CmsGlobal::TYPE_POST;
		$this->commentType	= ModelComment::TYPE_COMMENT;
		$this->apixBase		= 'cms/page/comment';
		$this->parentUrl	= '/cms/post/update?id=';
		$this->urlKey		= 'post-comments';

		// Services
		$this->parentService = Yii::$app->factory->get( 'postService' );

		// Sidebar
		$this->sidebar = [ 'parent' => 'sidebar-cms', 'child' => 'post-comments' ];

		// Return Url
		$this->returnUrl = Url::previous( $this->urlKey );
		$this->returnUrl = isset( $this->returnUrl ) ? $this->returnUrl : Url::toRoute( [ '/cms/post/comment/all' ], true );

		// All Url
		$allUrl = Url::previous( 'posts' );
		$allUrl = isset( $allUrl ) ? $allUrl : Url::toRoute( [ '/cms/post/all' ], true );

		// Breadcrumbs
		$this->breadcrumbs	= [
			'base' => [
				[ 'label' => 'Home', 'url' => Url::toRoute( '/dashboard' ) ],
				[ 'label' => 'Posts', 'url' =>  $allUrl ]
			],
			'all' => [ [ 'label' => 'Post Comments' ] ],
			'create' => [ [ 'label' => 'Post Comments', 'url' => $this->returnUrl ], [ 'label' => 'Add' ] ],
			'update' => [ [ 'label' => 'Post Comments', 'url' => $this->returnUrl ], [ 'label' => 'Update' ] ],
			'delete' => [ [ 'label' => 'Post Comments', 'url' => $this->returnUrl ], [ 'label' => 'Delete' ] ]
		];
	}
677061
function createResource(url, params, methods) {
      var resource;

      params = _.defaults({}, params, defaultParams);
      methods = _.defaults({}, methods, defaultMethods);
      resource = $resource(url, params, methods);

      // overwrite $save to automatically call $create or $update
      resource.prototype.$save = function save() {
        if (!this._id) {
          return this.$create();
        }

        return this.$update();
      };

      return resource;
    }
400133
private function createRoutes()
    {
        $this->routeCollection->add('_content', new Route('/{slug}', [
            '_controller' => 'OpiferContentBundle:Frontend/Content:view',
            'slug'        => '',
        ], [
            'slug'        => "[a-zA-Z0-9\-_\/]*",
        ], [
            'expose'      => true,
        ]));
        $this->routeCollection->add('home', new Route('/', [
            '_controller' => 'OpiferContentBundle:Frontend/Content:view',
            'slug'        => '',
        ], [
            'slug'        => "[a-zA-Z0-9\-_\/]*",
        ], [
            'expose'      => true,
        ]));
    }
707986
public function onOpen(OpenResourceEvent $event)
    {
        $directory = $event->getResource();

        $content = $this->templating->render(
            'ClarolineCoreBundle:directory:index.html.twig', [
                'directory' => $directory,
                '_resource' => $directory,
            ]
        );

        $response = new Response($content);
        $event->setResponse($response);

        $event->stopPropagation();
    }
1116981
public function resource($rule, $route = '', array $option = [], array $pattern = [])
    {
        return (new Resource($this, $this->group, $rule, $route, $option, $pattern, $this->rest))
            ->lazy($this->lazy);
    }
109180
private function _createRoute( $options )
    {
        $url = $this->_di->getService( "url" );

        /**
         * All route uris should have the uri prefix
         */
        $options["uri"] = $url->getUriPrefix() . $options["uri"];

        if (isset($options["controller_action"]))
        {
            $controller_action_exploded = explode( "#", $options["controller_action"] );

            $options["controllerName"] = $controller_action_exploded[0];
            $options["actionName"]     = $controller_action_exploded[1];
        }

        // $uri            = $settings["uri"];
        //
        // $controllerName = $settings["controllerName"];
        //
        // $actionName     = $settings["actionName"];
        //
        // $params         = $settigns["params"];

        return new Route($options);
    }
1166545
private function init($uri, $callback)
    {

        try {
            /**
             * check if there is a general type validation
             * can throw an exception
             */
            $this->validate($uri);

            switch (true) {
                /**
                 * check if the routing maps to an object via array or class
                 */
                case (is_array($callback) || (is_object($callback) && !is_callable($callback))) :
                    $this->setType(self::TYPE_O);
                    $this->strategy = StrategyFactory::make(self::TYPE_O, $callback, new RouteMethodAnnotaionParser());
                    break;

                /**
                 * maps a simple function
                 */
                case (is_string($callback)) :
                    $this->setType(self::TYPE_F);
                    $this->strategy = StrategyFactory::make(self::TYPE_F, $callback);

                    if (!function_exists($callback)) {
                        throw new RouteException(sprintf(_('There is no such Function like %s'), $callback));
                    }
                    break;

                /**
                 * Closure callback
                 */
                case (is_callable($callback)) :
                    $this->setType(self::TYPE_LF);
                    $this->strategy = StrategyFactory::make(self::TYPE_LF, $callback);
                    break;
            }
        } catch (RouteException $e) {
            throw $e;
        }

        return true;
    }
514958
static function create( $name, $parameters = array(), $repositoryPath = false, $repositoryID = false )
    {
        $parameters['name'] = $name;
        $handler = new eZPackage( $parameters, $repositoryPath );

        // New packages always use local repository
        if ( $repositoryID === false )
            $repositoryID = 'local';
        $repositoryInformation = $handler->repositoryInformation( $repositoryID );
        if ( $repositoryPath !== false )
            $repositoryInformation['path'] = $repositoryPath;
        $handler->setCurrentRepositoryInformation( $repositoryInformation );
        return $handler;
    }
1069636
public function call()
    {
        if (empty($this->options)) {
            $this->options = $this->app->config('bono.controllers');
        }

        if (empty($this->options['mapping'])) {
            return $this->next->call();
        }

        $mapping = $this->options['mapping'];

        $resourceUri = $this->app->request->getResourceUri();
        if ($mapping) {
            foreach ($mapping as $uri => $Map) {
                if (is_int($uri)) {
                    $uri = $Map;
                    $Map = null;
                }

                $matcher = preg_replace('/:\w+/', '(\w+)', '/^'.addcslashes($uri, '\/').'(?:\/.*)*$/');
                $matches = '';
                $isMatch = preg_match($matcher, $resourceUri, $matches);

                if ($isMatch)  {
                    if (is_null($Map)) {
                        if (isset($this->options['default'])) {
                            $Map = $this->options['default'];
                        } else {
                            throw new \Exception('URI "'.$uri.'" does not have suitable controller class "'.$Map.'"');
                        }
                    }
                    $this->app->controller = $controller = new $Map($this->app, $uri);
                    if (!($controller instanceof \Bono\Controller\Controller)) {
                        throw new \Exception(
                            'Controller "'.$Map.'" should be instance of Bono\Controller\Controller.'
                        );
                    }
                    break;
                }
            }
        }

        $this->next->call();
    }
1012765
private function open() {
         if (!is_resource($this->handler)) {
             $this->handler = fsockopen($this->options['host'], $this->options['port'], $_, $_, $this->options['timeout']);
         }
     }