Initialize page resource controller.

@param type PageRepositoryInterface $page

@return null
338299
public function setRepository()
    {
        $this->repository = app()->make(PageRepositoryInterface::class);
        $this->repository
            ->pushCriteria(\Litepie\Repository\Criteria\RequestCriteria::class)
            ->pushCriteria(\Litecms\Page\Repositories\Criteria\PageResourceCriteria::class);
    }
1238799
public function initialise_js(moodle_page $page) {
        foreach ($this->jsyuimodules as $js) {
            $page->requires->yui_module($js->modules, $js->function, $js->arguments, null, $js->ondomready);
        }
        foreach ($this->jsinitcalls as $js) {
            $page->requires->js_init_call($js->function, $js->extraarguments, $js->ondomready, $js->module);
        }
        foreach ($this->jsstrings as $string) {
            $page->requires->strings_for_js($string->identifiers, $string->component, $string->a);
        }
    }
676424
public function setPage(\Fulgurio\LightCMSBundle\Entity\Page $page = null)
    {
        $this->page = $page;

        return $this;
    }
1171107
public function initializeLayout($page, \LayoutModel $layout)
	{
		static::$pageLayout = $layout;

		if(!static::isEnabled())
		{
			return;
		}

		// reset default framework
		static::$pageLayout->framework = null;

		$templates = $GLOBALS['BOOTSTRAP']['templates']['dynamicLoad'];

		// only load these templates if layout uses it because default templates are changed
		foreach ($templates as $path => $templates)
		{
			foreach ($templates as $template)
			{
				\TemplateLoader::addFile($template, $path);
			}
		}
	}
428054
public function resolve(Page $page = null)
    {
        if (null === $page || (null === $metadataBag = $page->getMetaData())) {
            $metadataBag = new MetaDataBag();
        }

        if (!is_array($this->definitions)) {
            return $metadataBag;
        }

        foreach ($this->definitions as $name => $definition) {
            if (!is_array($definition)) {
                continue;
            }

            if (null === $metadata = $metadataBag->get($name)) {
                $metadata = new MetaData($name);
                $metadataBag->add($metadata);
            }

            $this->parseDefinition($definition, $metadata, $page);
        }

        return clone $metadataBag;
    }
211596
public void initPage() throws CmsException {

        if ((m_page == null) && (m_cms != null)) {
            String requestUri = m_cms.getRequestContext().getUri();
            // get the container page itself, checking the history first
            CmsResource pageResource = (CmsResource)CmsHistoryResourceHandler.getHistoryResource(m_request);
            if (pageResource == null) {
                pageResource = m_cms.readResource(requestUri);
            }
            m_page = getPage(pageResource);
            m_page = CmsTemplateMapper.get(m_request).transformContainerpageBean(
                m_cms,
                m_page,
                pageResource.getRootPath());

        }
    }
649385
private function setPage($page)
    {
        if (! is_int($page)) {
            throw new Exceptions\InvalidIntegerType(gettype($page));
        }

        // There is at least one page
        if ($page <= 0) {
            throw new Exceptions\PositiveIntegerRequired($page);
        }

        $this->page = $page;

        $this->changedPage();
    }
634050
private function discardPageRedirections(PageInterface $page)
    {
        if ($page->isEnabled()) {
            /** @var \Ekyna\Bundle\CmsBundle\Model\PageTranslationInterface $translation */
            foreach ($page->getTranslations() as $locale => $translation) {
                // TODO use url generator or i18n routing prefix strategy
                $localePrefix = $locale != 'fr' ? '/' . $locale : '';
                $event = new DiscardRedirectionEvent($localePrefix . $translation->getPath());
                $this->dispatcher->dispatch(RedirectionEvents::DISCARD, $event);
            }
        }
    }
526961
private function loadBlocks(PageInterface $page)
    {
        $blocks = $this->blockInteractor->loadPageBlocks($page);

        // save a local cache
        foreach ($blocks as $block) {
            $this->blocks[$block->getId()] = $block;
        }
    }
1144053
public function setPage(\Amulen\PageBundle\Entity\Page $page = null) {
        $this->page = $page;

        return $this;
    }
1133915
protected function loadPage($page)
    {
        $this->pageStart = $page * $this->pageSize;
        $this->pageData = $this->query->setFirstResult($this->pageStart)->setMaxResults($this->pageSize)->getResult();
    }
216204
public function setPage($page)
    {
        $this->page = min($page > 0 ? $page : $this->getFirstPage(), $this->getLastPage());
    }
1245904
public function init(Page $page = null)
    {
        if (!$page) {
            return $this;
        }

        $this->page = $page;
        $this->online = $page->isOnline();
        $this->name = $page->getName();
        $this->meta = $page->getMeta();
        $this->openGraph = $page->getOpenGraph();
        $this->title = $page->getTitle();

        return $this;
    }
684599
public function makePageSnapshot(PageInterface $page)
    {
        foreach ($page->getLayoutBlock() as $layoutBlock) {
            $layoutBlockContent = $this->registry->getManagerForClass($layoutBlock->getClassType())->getRepository($layoutBlock->getClassType())->find(
                $layoutBlock->getObjectId()
            );
            $layoutBlock->takeSnapshot($this->serializer->serialize($layoutBlockContent, 'json'));
        }

        $pageSnapshotClass = $this->pageSnapshotManager->getClassName();

        /** @var \Networking\InitCmsBundle\Model\PageSnapshotInterface $pageSnapshot */
        $pageSnapshot = new $pageSnapshotClass($page);
        $pageSnapshot->setVersionedData($this->serializer->serialize($page, 'json'))
            ->setPage($page);

        if ($oldPageSnapshot = $page->getSnapshot()) {
            $snapshotContentRoute = $oldPageSnapshot->getContentRoute();
        } else {
            $contentRouteClass = $this->contentRouteManager->getClassName();
            /** @var \Networking\InitCmsBundle\Model\ContentRouteInterface $snapshotContentRoute */
            $snapshotContentRoute = new $contentRouteClass();
        }

        $pageSnapshot->setContentRoute($snapshotContentRoute);
        $pageSnapshot->setPath(self::getPageRoutePath($page->getPath()));

        $om = $this->registry->getManagerForClass($pageSnapshotClass);
        $om->persist($pageSnapshot);
        $om->flush();

        $snapshotContentRoute->setPath(self::getPageRoutePath($page->getPath()));
        $snapshotContentRoute->setObjectId($pageSnapshot->getId());

        if ($oldPageSnapshot && ($oldPageSnapshot->getPath() != self::getPageRoutePath($page->getPath()))) {
            $this->phpCache->clean();
        }

        $om = $this->registry->getManagerForClass(get_class($snapshotContentRoute));
        $om->persist($snapshotContentRoute);
        $om->flush();
    }
50708
public void init(PageContext pageContext, ComponentPageImpl componentPage, boolean executeConstr) throws PageException {
	this.pageSource = componentPage.getPageSource();

	// extends
	if (!StringUtil.isEmpty(properties.extend)) {
	    base = ComponentLoader.searchComponent(pageContext, componentPage.getPageSource(), properties.extend, Boolean.TRUE, null, true, executeConstr);
	}
	else {
	    CIPage p = ((ConfigWebImpl) pageContext.getConfig()).getBaseComponentPage(pageSource.getDialect(), pageContext);
	    if (!componentPage.getPageSource().equals(p.getPageSource())) {
		base = ComponentLoader.loadComponent(pageContext, p, "Component", false, false, true, executeConstr);
	    }
	}

	if (base != null) {
	    this.dataMemberDefaultAccess = base.dataMemberDefaultAccess;
	    this._static = new StaticScope(base._static, this, componentPage, dataMemberDefaultAccess);
	    // this._triggerDataMember=base._triggerDataMember;
	    this.absFin = base.absFin;
	    _data = base._data;
	    _udfs = new HashMapPro<Key, UDF>(base._udfs);
	    setTop(this, base);
	}
	else {
	    this.dataMemberDefaultAccess = pageContext.getCurrentTemplateDialect() == CFMLEngine.DIALECT_CFML ? pageContext.getConfig().getComponentDataMemberDefaultAccess()
		    : Component.ACCESS_PRIVATE;
	    this._static = new StaticScope(null, this, componentPage, dataMemberDefaultAccess);
	    // TODO get per CFC setting
	    // this._triggerDataMember=pageContext.getConfig().getTriggerComponentDataMember();
	    _udfs = new HashMapPro<Key, UDF>();
	    _data = MapFactory.getConcurrentMap();
	}
	// implements
	if (!StringUtil.isEmpty(properties.implement)) {
	    if (absFin == null) absFin = new AbstractFinal();
	    absFin.add(InterfaceImpl.loadInterfaces(pageContext, getPageSource(), properties.implement));
	    // abstrCollection.implement(pageContext,getPageSource(),properties.implement);
	}

	/*
	 * print.e("--------------------------------------"); print.e(_getPageSource().getDisplayPath());
	 * print.e(abstrCollection.getUdfs());
	 */

	// scope
	useShadow = base == null ? (pageSource.getDialect() == CFMLEngine.DIALECT_CFML ? pageContext.getConfig().useComponentShadow() : false) : base.useShadow;
	if (useShadow) {
	    if (base == null) scope = new ComponentScopeShadow(this, MapFactory.getConcurrentMap());
	    else scope = new ComponentScopeShadow(this, (ComponentScopeShadow) base.scope, false);
	}
	else {
	    scope = new ComponentScopeThis(this);
	}
	initProperties();

	// invoke static constructor
	if (!componentPage._static.isInit()) {
	    componentPage._static.setInit(true);// this needs to happen before the call
	    try {
		componentPage.staticConstructor(pageContext, this);
	    }
	    catch (Throwable t) {
		ExceptionUtil.rethrowIfNecessary(t);
		componentPage._static.setInit(false);
		throw Caster.toPageException(t);
	    }
	}
    }
1126735
protected function initializeView(ViewInterface $view)
    {
        parent::initializeView($view);

        /* @var ModuleTemplate $module */ // holds the state of chosen tab
        $module = GeneralUtility::makeInstance(ModuleTemplate::class);
        $coreOptimizationTabs = $module->getDynamicTabMenu([], 'coreOptimization');
        $this->view->assign('tabs', $coreOptimizationTabs);
    }
556596
public function page($page = null)
    {
        if (isset($page)) {
            $this->setPage($page);

            return $this;
        }

        return $this->getPage();
    }