Create the dummy search record for this page

@return CwpSearchPage
518885
protected function generateSearchRecord()
    {
        $searchPage = CwpSearchPage::create();
        $searchPage->URLSegment = 'search';
        $searchPage->Title = _t('SilverStripe\\CMS\\Search\\SearchForm.SearchResults', 'Search Results');
        $searchPage->ID = -1;
        return $searchPage;
    }
408402
public function search()
    {
        $params = $this->getRequestParameter('params');
        $query = $params['query'];
        $class = $this->getClass($params['rootNode']);

        $rows = $this->hasRequestParameter('rows') ? (int)$this->getRequestParameter('rows') : null;
        $page = $this->hasRequestParameter('page') ? (int)$this->getRequestParameter('page') : 1;
        $startRow = is_null($rows) ? 0 : $rows * ($page - 1);

        try {
            $results = [];

            // if it is an URI
            if (strpos($query, LOCAL_NAMESPACE) === 0) {
                $resource = $this->getResource($query);
                if ($resource->exists() && $resource->isInstanceOf($class)) {
                    $results = new ResultSet([$resource->getUri()], 1);
                }
            }

            //  if there is no results based on considering the query as URI
            if (empty($results)) {
                $results = $this->getServiceLocator()->get(Search::SERVICE_ID)->query($query, $class->getUri(), $startRow, $rows);
            }

            $totalPages = is_null($rows) ? 1 : ceil( $results->getTotalCount() / $rows );

            $response = new StdClass();
            if(count($results) > 0 ){

                foreach($results as $uri) {
                    $instance = $this->getResource($uri);
                    $instanceProperties = array(
                        'id' => $instance->getUri(),
                        OntologyRdfs::RDFS_LABEL => $instance->getLabel()
                    );

                    $response->data[] = $instanceProperties;
                }
            }
    		$response->success = true;
            $response->page = empty($response->data) ? 0 : $page;
    		$response->total = $totalPages;
    		$response->records = count($results);

    		$this->returnJson($response, 200);
        } catch (SyntaxException $e) {
            $this->returnJson(array(
                'success' => false,
                'msg' => $e->getUserMessage()
            ));
        }
    }
429469
public function search()
	{
		$view = $this->getView();
		$context = $this->getContext();

		try
		{
			$view->orderpaymenttypeBody = '';

			foreach( $this->getSubClients() as $client ) {
				$view->orderpaymenttypeBody .= $client->search();
			}
		}
		catch( \Aimeos\MShop\Exception $e )
		{
			$error = array( 'order-counthour' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
			$view->errors = $view->get( 'errors', [] ) + $error;
			$this->logException( $e );
		}
		catch( \Exception $e )
		{
			$error = array( 'order-counthour' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
			$view->errors = $view->get( 'errors', [] ) + $error;
			$this->logException( $e );
		}

		/** admin/jqadm/dashboard/order/counthour/template-item
		 * Relative path to the HTML body template of the order per counthour subpart for the dashboard.
		 *
		 * The template file contains the HTML code and processing instructions
		 * to generate the result shown in the body of the frontend. The
		 * configuration string is the path to the template file relative
		 * to the templates directory (usually in admin/jqadm/templates).
		 *
		 * You can overwrite the template file configuration in extensions and
		 * provide alternative templates. These alternative templates should be
		 * named like the default one but with the string "default" replaced by
		 * an unique name. You may use the name of your project for this. If
		 * you've implemented an alternative client class as well, "default"
		 * should be replaced by the name of the new class.
		 *
		 * @param string Relative path to the template creating the HTML code
		 * @since 2016.04
		 * @category Developer
		 */
		$tplconf = 'admin/jqadm/dashboard/order/counthour/template-item';
		$default = 'dashboard/item-order-counthour-standard';

		return $view->render( $view->config( $tplconf, $default ) );
	}
336681
public function actionGet() 
	{
		if(Yii::app()->request->isAjaxRequest) {
			$criteria=new CDbCriteria; 
			$criteria->condition = 'publish = :publish'; 
			$criteria->params = array(':publish'=>1); 
			$criteria->order = 'creation_date DESC'; 

			$dataProvider = new CActiveDataProvider('OmmuWalls', array( 
				'criteria'=>$criteria, 
				'pagination'=>array( 
					'pageSize'=>5, 
				), 
			));
			
			$data = '';
			$wall = $dataProvider->getData();
			if(!empty($wall)) {
				foreach($wall as $key => $item) {
					$data .= Utility::otherDecode($this->renderPartial('_view', array('data'=>$item), true, false));
				}
			}
			$pager = OFunction::getDataProviderPager($dataProvider);
			if($pager[nextPage] != '0') {
				$summaryPager = 'Displaying 1-'.($pager[currentPage]*$pager[pageSize]).' of '.$pager[itemCount].' results.';
			} else {
				$summaryPager = 'Displaying 1-'.$pager[itemCount].' of '.$pager[itemCount].' results.';
			}
			$nextPager = $pager['nextPage'] != 0 ? Yii::app()->controller->createUrl('get', array($pager['pageVar']=>$pager['nextPage'])) : 0;
			
			$return = array(
				'type'=>0,
				'data'=>$data,
				'pager'=>$pager,
				'summarypager'=>$summaryPager,
				'nextpage'=>$nextPager,
			);
			echo CJSON::encode($return);
			
		} else
			throw new CHttpException(404, Yii::t('phrase', 'The requested page does not exist.'));
	}
676392
public function CreatePage()
	{
		$this->_myWords = $this->WordCollection();

		$this->_document = new XmlnukeDocument($this->_myWords->Value("TITLE"), $this->_myWords->Value("ABSTRACT"));

		$this->_url = "module:Xmlnuke.Sample";

		$this->_document->setMenuTitle($this->_myWords->Value("OPTIONMODULE"));

		$this->_document->addMenuItem($this->_url."?op=1", $this->_myWords->Value("OBJECT"), $this->_myWords->Value("DESCOBJECT"));
		$this->_document->addMenuItem($this->_url."?op=2", $this->_myWords->Value("FORM"), $this->_myWords->Value("DESCFORM"));
		$this->_document->addMenuItem($this->_url."?op=3", $this->_myWords->Value("EDITLIST"), $this->_myWords->Value("DESCEDITLIST"));
		$this->_document->addMenuItem($this->_url."?op=4", $this->_myWords->Value("ANYDATASET"), $this->_myWords->Value("DESCANYDATASET"));
		$this->_document->addMenuItem($this->_url."?op=5", $this->_myWords->Value("DATABASE"), $this->_myWords->Value("DESCDATABASE"));
		$this->_document->addMenuItem($this->_url."?op=6", $this->_myWords->Value("UPLOAD"), $this->_myWords->Value("DESCUPLOAD"));
		$this->_document->addMenuItem($this->_url."?op=7", $this->_myWords->Value("XMLDATASET"), $this->_myWords->Value("DESCXMLDATASET"));
		$this->_document->addMenuItem($this->_url."?op=8", $this->_myWords->Value("TEXTFILEDATASET"), $this->_myWords->Value("DESTEXTFILEDATASET"));
		$this->_document->addMenuItem($this->_url."?op=9", $this->_myWords->Value("XMLCHART"), $this->_myWords->Value("DESCXMLCHART"));
		$this->_document->addMenuItem($this->_url."?op=10",$this->_myWords->Value("TABVIEW"), $this->_myWords->Value("DESCTABVIEW"));
		$this->_document->addMenuItem($this->_url."?op=11",$this->_myWords->Value("DUALLIST"), $this->_myWords->Value("DESCDUALLIST"));
		$this->_document->addMenuItem($this->_url."?op=12",$this->_myWords->Value("FAQ"), $this->_myWords->Value("DESCFAQ"));
		$this->_document->addMenuItem($this->_url."?op=13",$this->_myWords->Value("AJAXPOST"), $this->_myWords->Value("DESCAJAXPOST"));
		$this->_document->addMenuItem($this->_url."?op=14",$this->_myWords->Value("AUTOSUGGEST"), $this->_myWords->Value("DESCAUTOSUGGEST"));
		$this->_document->addMenuItem($this->_url."?op=15",$this->_myWords->Value("TREEVIEW"), $this->_myWords->Value("DESCTREEVIEW"));
		$this->_document->addMenuItem($this->_url."?op=16",$this->_myWords->Value("SORTABLE"), $this->_myWords->Value("DESCSORTABLE"));
		$this->_document->addMenuItem($this->_url."?op=20",$this->_myWords->Value("PORTLET"), $this->_myWords->Value("PORTLET"));
		$this->_document->addMenuItem($this->_url."?op=17",$this->_myWords->Value("CALENDAR"), $this->_myWords->Value("DESCCALENDAR"));
		$this->_document->addMenuItem($this->_url."?op=18",$this->_myWords->Value("UIALERT"), $this->_myWords->Value("DESCUIALERT"));
		$this->_document->addMenuItem($this->_url."?op=19",$this->_myWords->Value("MEDIAGALLERY"), $this->_myWords->Value("DESCMEDIAGALLERY"));

		$block = new XmlBlockCollection($this->_myWords->Value("MODULE"), BlockPosition::Center);

		$paragraph = new XmlParagraphCollection();

		$paragraph->addXmlnukeObject(new XmlnukeText($this->_myWords->Value("DESCMODULE")));
		$paragraph->addXmlnukeObject(new XmlnukeBreakLine());
		$paragraph->addXmlnukeObject(new XmlnukeText($this->_myWords->Value("SELECTOPTION")));
		$block->addXmlnukeObject($paragraph);
		$this->_document->addXmlnukeObject($block);

		$option = $this->_context->get("op");

		switch ($option)
		{
			case 1:
				{
					$this->actionCreateObject();
					break;
				}
			case 2:
				{
					$this->actionForm();
					break;
				}
			case 3:
				{
					$this->actionEditList();
					break;
				}
			case 4:
				{
					$this->actionEditAnydataSet();
					break;
				}
			case 5:
				{
					$this->actionEditDB();
					break;
				}
			case 6:
				{
					$this->actionUpload();
					break;
				}
			case 7:
				{
					$this->Opcao7();
					break;
				}
			case 8:
				{
					$this->Opcao8();
					break;
				}
			case 9:
				{
					$this->Opcao9();
					break;
				}
			case 10:
				{
					$this->Opcao10();
					break;
				}
			case 11:
				{
					$this->Opcao11();
					break;
				}
			case 12:
				{
					$this->Opcao12();
					break;
				}
			case 13:
				{
					$this->Opcao13();
					break;
				}
			case 14:
				{
					$this->Opcao14();
					break;
				}
			case 15:
				{
					$this->Opcao15();
					break;
				}
			case 16:
				{
					$this->Opcao16();
					break;
				}
			case 17:
				{
					$this->Opcao17();
					break;
				}
			case 18:
				{
					$this->Opcao18();
					break;
				}
			case 19:
				{
					$this->Opcao19();
					break;
				}
			case 20:
				{
					$this->Opcao20();
					break;
				}
		}
		return $this->_document->generatePage();
	}
105036
protected function makeFinder()
    {
        $directories = RootDirectories::getEnforceable();
        $found = [];

        $filesystem = new Filesystem();

        foreach ($directories as $directory) {
            if ($filesystem->exists($directory) && is_dir($directory)) {
                $found[] = $directory;
            }
        }

        return DefaultFinder::create()->in($found);
    }
138011
public function create()
    {
        $now = $this->now();

        /**
         * @var Page $page
         */
        $classNamespace = $this->getEntityNamespace();
        $page = new $classNamespace();
        $page
            ->setEnabled(true)
            ->setPersistent(false)
            ->setPublicationDate($now)
            ->setCreatedAt($now)
            ->setUpdatedAt($now);

        return $page;
    }
752937
protected function createPager(): Pagerfanta
    {
        if ($this->dataLoader instanceof ContextualizedDataLoaderInterface && null !== $this->getResultContext()) {
            $this->dataLoader->setCurrentContext($this->getResultContext());
        }

        return new Pagerfanta(
            EAVAdapter::create(
                $this->dataLoader,
                $this->getQueryBuilder(),
                $this->configuration->getOption('loader_depth', 2)
            )
        );
    }
116065
public function indexAction()
    {
        $searchService = $this->get( "ezpublish.api.repository" )->getSearchService();
        $query         = $this->getQuery();
        $query->limit  = 0;
        $resultCount   = $searchService->findLocations( $query )->totalCount;

        // Dom Doc
        $sitemap               = new DOMDocument( "1.0", "UTF-8" );
        $sitemap->formatOutput = true;

        // create an index if we are greater than th PACKET_MAX
        if ( $resultCount > static::PACKET_MAX )
        {
            $root = $sitemap->createElement( "sitemapindex" );
            $root->setAttribute( "xmlns", "http://www.sitemaps.org/schemas/sitemap/0.9" );
            $sitemap->appendChild( $root );

            $this->fillSitemapIndex( $sitemap, $resultCount, $root );

            return new Response( $sitemap->saveXML(), 200, [ "Content-type" => "text/xml" ] );
        }

        // if we are less or equal than the PACKET_SIZE, redo the search with no limit and list directly the urlmap
        $query->limit = $resultCount;
        $results      = $searchService->findLocations( $query );
        $root         = $sitemap->createElement( "urlset" );
        $root->setAttribute( "xmlns", "http://www.sitemaps.org/schemas/sitemap/0.9" );
        $this->fillSitemap( $sitemap, $root, $results );
        $sitemap->appendChild( $root );

        $response = new Response( $sitemap->saveXML(), 200, [ "Content-type" => "text/xml" ] );
        $response->setSharedMaxAge( 24 * 3600 );

        return $response;
    }
113762
public function search()
    {
        $query = Rubric::find()
            ->where('id>1')
            ->orderBy('lft ASC, position DESC');

        return new ActiveDataProvider([
            'query' => $query,
            'pagination' => [
                'pageSize' => Yii::$app->params['itemsPerPage'],
            ],
        ]);
    }
47577
public function CreatePageForm() {
		$createOptions = array(
			'child' => 'As a child of the selected page',
			'sibling' => 'As a sibling of the selected page',
		);

		$pageTree = new TreeDropdownField('CreateContext', _t('WikiPage.CREATE_CONTEXT', 'Select an existing page'), 'WikiPage');
		$pageTree->setValue($this->ID);
		$pageTree->setTreeBaseID($this->data()->getWikiRoot()->ID);
		$fields = FieldList::create(
						new TextField('NewPageName', _t('WikiPage.NEW_PAGE_NAME', 'New Page Name')),
						$pageTree,
						new OptionsetField('CreateType', _t('WikiPage.CREATE_OPTIONS', 'and create the new page '), $createOptions, 'child')
		);

		$actions = FieldList::create(new FormAction('addpage', _t('WikiPage.ADD_PAGE', 'Create')));

		return new Form($this, 'CreatePageForm', $fields, $actions);
	}
884619
public function searchAction()
    {
        $optionsProvider = $this->getOptionsProvider();
        $pane = $this->params()->fromRoute('pane');
        if (! $pane || ! $optionsProvider->hasIdentifier($pane)) {
            $pane = 'first';
        }

        $options = $optionsProvider->getOptions($pane, 'search');

        $search = $optionsProvider->getSearchProxy($pane);
        $form = $this->getSearchForm();
        $form->setAttribute(
            'action',
            $this->url()->fromRoute(
                'sc-admin/content-search',
                ['pane' => $pane]
            )
        );
        $form->bind($search);
        if ($this->getRequest()->isPost()) {
            $post = $this->params()->fromPost();
            if (array_key_exists('clean', $post)) {
                $search->clean();
            } else {
                $form->setData($post);
            }
            if ($form->isValid()) {
                $options->setSearchOptions(
                    $form->getData(ContentSearchForm::VALUES_AS_ARRAY)
                );
                $optionsProvider->save($options->getName());
            }
        }
        $list = $this->getContentListProvider()->getList($pane);

        return new ViewModel([
            'options' => $options,
            'list' => $list,
            'pane' => $pane,
            'form' => $form,
        ]);
    }
1232333
public function CreatePage() 
	{
		parent::CreatePage(); 
	
		$this->_myWords = $this->WordCollection();
		
		$this->defaultXmlnukeDocument->addMenuItem("module:Xmlnuke.Admin.FileManagement",$this->_myWords->Value("FILEMANAGEMENT"),"");
		
		$this->_block = new XmlBlockCollection($this->_myWords->Value("FILEMANAGEMENT"), BlockPosition::Center);
		$this->setTitlePage($this->_myWords->Value("TITLE"));
		$this->setHelp($this->_myWords->Value("DESCRIPTION"));
		$this->defaultXmlnukeDocument->addXmlnukeObject($this->_block);
		
		
		//get the current folder
		$root = $this->_context->get("folder");
		
		$browser = new XmlFileBrowser($root, $this->_action, $this->_context);
		
		//SET FILEBROWSER ACESS LEVEL
		$processor = new AnydatasetFilenameProcessor("filemanagement");
		$processor->setFilenameLocation(ForceFilenameLocation::UseWhereExists );
		$anyDataSet = new AnyDataset($processor->FullQualifiedNameAndPath());

		$ignoreAdmin = false;

		$it = $anyDataSet->getIterator();
		while($it->hasNext())
		{
			$row = $it->moveNext();
			switch ($row->getField("type"))
			{
				case "INITIAL_DIR":
					$initial_dir = $row->getFieldArray("value");
					$browser->setSubFoldersPermitted($initial_dir);
					break;
				case "VALID_FILE_NEW":
					$file_new_list = $row->getFieldArray("value");
					$browser->setFileNewList($file_new_list);
					break;
				case "VALID_FILE_VIEW":
					$file_view_list = $row->getFieldArray("value");
					$browser->setFileViewList($file_view_list);
					break;
				case "VALID_FILE_EDIT":
					$file_edit_list = $row->getFieldArray("value");
					$browser->setFileEditList($file_edit_list);
					break;
				case "VALID_FILE_DELETE":
					$file_delete_list = $row->getFieldArray("value");
					$browser->setFileDeleteList($file_delete_list);
					break;
				case "VALID_FILE_UPLOAD":
					$file_upload_list = $row->getFieldArray("value");
					$browser->setFileUploadList($file_upload_list);
					break;
				case "VALID_FILE_MAX_UPLOAD":
					$file_max_upload = $row->getField("value");
					$browser->setFileMaxUpload($file_max_upload);
					break;
				case "PERMISSION":
					$browser->setFileNew($row->getField("file_new"));
					$browser->setFileView($row->getField("file_view"));
					$browser->setFileEdit($row->getField("file_edit"));
					$browser->setFileDelete($row->getField("file_delete"));
					$browser->setFileUpload($row->getField("file_upload"));
					$browser->setFolderNew($row->getField("folder_new"));
					$browser->setFolderView($row->getField("folder_view"));
					$browser->setFolderEdit($row->getField("folder_edit"));
					$browser->setFolderDelete($row->getField("folder_delete"));
					$ignoreAdmin = ($row->getField("ignore_admin")=="true");
					break;
			}
		}		
		
		if ($this->isUserAdmin() && !$ignoreAdmin)
			$browser->setUserType(FileBrownserUserType::ADMIN );
		
		$this->_block->addXmlnukeObject($browser);                                                                             
		
		return $this->defaultXmlnukeDocument->generatePage();
	}
406395
public function createDecorator(ISearchContext $search_context)
	{
		$locator_factory = new DefaultElementLocatorFactory($search_context, $this->annotationManager);

		return new TypifiedPropertyDecorator($locator_factory, $this);
	}
586300
protected function createComponentPagePublish() : object
    {
        $control = $this->IPage_Publish->create();

        $control->onSave[] = function () use ($control)
        {
            $this->getComponent('pageSummaryModal')->redrawControl('pageSummary');

            $control->redrawControl('publish');

            $this->redrawPrinters(); // TODO: Remove dependency on Structure Module
        };

        return $control;
    }
971996
private String createSearchResults() {

        String query = m_searchParams.getQuery();
        StringBuffer result = new StringBuffer();
        if (!CmsStringUtil.isEmptyOrWhitespaceOnly(query) && (query.length() > 3)) {
            CmsSearchResultView resultView = new CmsSearchResultView(getJsp());
            // proprietary workplace admin link for pagelinks of search:
            resultView.setSearchRessourceUrl(
                getJsp().link(
                    "/system/workplace/views/admin/admin-main.jsp?path=/searchindex/singleindex/search&indexname="
                        + getSearchIndexIndex().getName()));
            m_search.init(getCms());

            // custom parameters (non-widget controlled)
            // these are from generated search page links
            String page = getJsp().getRequest().getParameter("searchPage");
            if (!CmsStringUtil.isEmptyOrWhitespaceOnly(page)) {
                m_searchParams.setSearchPage(Integer.parseInt(page));
            }
            String categories = getJsp().getRequest().getParameter("searchCategories");
            if (!CmsStringUtil.isEmptyOrWhitespaceOnly(categories)) {
                m_searchParams.setCategories(CmsStringUtil.splitAsList(categories, ','));
            }

            String searchRoots = getJsp().getRequest().getParameter("searchRoots");
            if (!CmsStringUtil.isEmptyOrWhitespaceOnly(searchRoots)) {
                m_searchParams.setSearchRoots(searchRoots);
            }
            m_search.setParameters(m_searchParams);
            result.append("<div style=\"padding:12px;\">\n").append(resultView.displaySearchResult(m_search)).append(
                "\n</div>\n");
        } else {
            // Just don't perform search
        }
        return result.toString();
    }
1063981
public function search()
    {
        $criteria = new CDbCriteria;

        $criteria->compare('id', $this->id);
        $criteria->compare('name', $this->name, true);
        $criteria->compare('path', $this->path, true);
        $criteria->compare('extension', $this->extension, true);
        $criteria->compare('filename', $this->filename, true);
        $criteria->compare('mimeType', $this->mimeType, true);
        $criteria->compare('byteSize', $this->byteSize, true);
        $criteria->compare('hash', $this->hash, true);
        $criteria->compare('createdAt', $this->createdAt, true);

        return new CActiveDataProvider($this, array(
            'criteria' => $criteria,
        ));
    }