Data Provider ------
772356
public function getPage( $config = [] ) {

		$modelClass	= static::$modelClass;
		$modelTable	= $this->getModelTable();

		$contentTable	= Yii::$app->factory->get( 'modelContentService' )->getModelTable();
		$templateTable	= Yii::$app->factory->get( 'templateService' )->getModelTable();

	    $sort = new Sort([
	        'attributes' => [
				'id' => [
					'asc' => [ "$modelTable.id" => SORT_ASC ],
					'desc' => [ "$modelTable.id" => SORT_DESC ],
					'default' => SORT_DESC,
					'label' => 'Id'
				],
				'template' => [
					'asc' => [ "$templateTable.name" => SORT_ASC ],
					'desc' => [ "$templateTable.name" => SORT_DESC ],
					'default' => SORT_DESC,
					'label' => 'Template',
				],
				'name' => [
					'asc' => [ "$modelTable.name" => SORT_ASC ],
					'desc' => [ "$modelTable.name" => SORT_DESC ],
					'default' => SORT_DESC,
					'label' => 'Name'
				],
				'slug' => [
					'asc' => [ "$modelTable.slug" => SORT_ASC ],
					'desc' => [ "$modelTable.slug" => SORT_DESC ],
					'default' => SORT_DESC,
					'label' => 'Slug'
				],
	            'type' => [
	                'asc' => [ "$modelTable.type" => SORT_ASC ],
	                'desc' => [ "$modelTable.type" => SORT_DESC ],
	                'default' => SORT_DESC,
	                'label' => 'Type'
	            ],
	            'icon' => [
	                'asc' => [ "$modelTable.icon" => SORT_ASC ],
	                'desc' => [ "$modelTable.icon" => SORT_DESC ],
	                'default' => SORT_DESC,
	                'label' => 'Icon'
	            ],
				'title' => [
					'asc' => [ "$modelTable.title" => SORT_ASC ],
					'desc' => [ "$modelTable.title" => SORT_DESC ],
					'default' => SORT_DESC,
					'label' => 'Title'
				],
				'status' => [
					'asc' => [ "$modelTable.status" => SORT_ASC ],
					'desc' => [ "$modelTable.status" => SORT_DESC ],
					'default' => SORT_DESC,
					'label' => 'Status'
				],
				'visibility' => [
					'asc' => [ "$modelTable.visibility" => SORT_ASC ],
					'desc' => [ "$modelTable.visibility" => SORT_DESC ],
					'default' => SORT_DESC,
					'label' => 'Visibility'
				],
				'order' => [
					'asc' => [ "$modelTable.order" => SORT_ASC ],
					'desc' => [ "$modelTable.order" => SORT_DESC ],
					'default' => SORT_DESC,
					'label' => 'Order'
				],
				'pinned' => [
					'asc' => [ "$modelTable.pinned" => SORT_ASC ],
					'desc' => [ "$modelTable.pinned" => SORT_DESC ],
					'default' => SORT_DESC,
					'label' => 'Pinned'
				],
				'featured' => [
					'asc' => [ "$modelTable.featured" => SORT_ASC ],
					'desc' => [ "$modelTable.featured" => SORT_DESC ],
					'default' => SORT_DESC,
					'label' => 'Featured'
				],
				'cdate' => [
					'asc' => [ "$modelTable.createdAt" => SORT_ASC ],
					'desc' => [ "$modelTable.createdAt" => SORT_DESC ],
					'default' => SORT_DESC,
					'label' => 'Created At'
				],
				'udate' => [
					'asc' => [ "$modelTable.modifiedAt" => SORT_ASC ],
					'desc' => [ "$modelTable.modifiedAt" => SORT_DESC ],
					'default' => SORT_DESC,
					'label' => 'Updated At'
				]
	        ],
	        'defaultOrder' => [
	        	'cdate' => SORT_DESC
	        ]
	    ]);

		if( !isset( $config[ 'sort' ] ) ) {

			$config[ 'sort' ] = $sort;
		}

		// Query ------------

		// Filters ----------

		// Searching --------

		// Reporting --------

		// Result -----------

		return parent::findPage( $config );
	}
509299
def get_datasource(self, source_id, datasource_id):
        
        target_url = self.client.get_url('DATASOURCE', 'GET', 'single', {'source_id': source_id, 'datasource_id': datasource_id})
        return self.client.get_manager(Datasource)._get(target_url)
908081
@Bean
  public DataSource dataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource(dbUrl, userName, password);
    dataSource.setDriverClassName(Driver.class.getName());

    // no need shutdown, EmbeddedDatabaseFactoryBean will take care of this
    // EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
    // EmbeddedDatabase dataSource = builder.setType(EmbeddedDatabaseType.H2).setName("h2_example").build();
    return dataSource;
  }
1171727
public function getData()
    {
        if (!$this->data && $this->dataProvider) {
            return call_user_func($this->dataProvider, $this);
        }
        return $this->data;
    }
147698
protected DataSource getDataSource() throws RepositoryException
   {
      try
      {
         return containerConfig.dsProvider.getDataSource(containerConfig.dbSourceName);
      }
      catch (NamingException e)
      {
         throw new RepositoryException("Datasource '" + containerConfig.dbSourceName
            + "' is not bound in this context.", e);
      }
   }
1250845
private void loadDataIntoSourceDB() {
    String[] customers = { "{ \"name\" : \"Alice\", \"id\": 1, \"phone\" : 8793993333, \"state\":\"CA\"}",
        "{ \"name\" : \"Bob\", \"id\": 2, \"phone\" : 8793993334, \"state\":\"WA\"}",
        "{ \"name\" : \"Carl\", \"id\": 3, \"phone\" : 8793993335, \"state\":\"CA\"}",
        "{ \"name\" : \"Dennis\", \"id\": 4, \"phone\" : 8793993336, \"state\":\"OR\"}",
        "{ \"name\" : \"Evelyn\", \"id\": 5, \"phone\" : 8793993337, \"state\":\"CA\"}",
        "{ \"name\" : \"Falcon\", \"id\": 6, \"phone\" : 8793993338, \"state\":\"AZ\"}",
        "{ \"name\" : \"Gerald\", \"id\": 7, \"phone\" : 8793993339, \"state\":\"CA\"}",
        "{ \"name\" : \"Howard\", \"id\": 8, \"phone\" : 8793993340, \"state\":\"PA\"}",
        "{ \"name\" : \"Irwin\", \"id\": 9, \"phone\" : 8793993341, \"state\":\"CA\"}",
        "{ \"name\" : \"Jack\", \"id\": 10, \"phone\" : 8793993342, \"state\":\"OR\"}" };
    DocumentManager docMgr = sourceClient.newDocumentManager();
    DocumentMetadataHandle customerMetadataHandle = new DocumentMetadataHandle();
    customerMetadataHandle.getCollections().add("customers");
    docMgr.write(
        docMgr.newWriteSet().add("/moveData/customer1.json", customerMetadataHandle, new StringHandle(customers[0]).withFormat(Format.JSON))
            .add("/moveData/customer2.json", customerMetadataHandle, new StringHandle(customers[1]).withFormat(Format.JSON))
            .add("/moveData/customer3.json", customerMetadataHandle, new StringHandle(customers[2]).withFormat(Format.JSON))
            .add("/moveData/customer4.json", customerMetadataHandle, new StringHandle(customers[3]).withFormat(Format.JSON))
            .add("/moveData/customer5.json", customerMetadataHandle, new StringHandle(customers[4]).withFormat(Format.JSON))
            .add("/moveData/customer6.json", customerMetadataHandle, new StringHandle(customers[5]).withFormat(Format.JSON))
            .add("/moveData/customer7.json", customerMetadataHandle, new StringHandle(customers[6]).withFormat(Format.JSON))
            .add("/moveData/customer8.json", customerMetadataHandle, new StringHandle(customers[7]).withFormat(Format.JSON))
            .add("/moveData/customer9.json", customerMetadataHandle, new StringHandle(customers[8]).withFormat(Format.JSON))
            .add("/moveData/customer10.json", customerMetadataHandle, new StringHandle(customers[9]).withFormat(Format.JSON)));
    Random customerRandom = new Random();
    DocumentMetadataHandle orderMetadataHandle = new DocumentMetadataHandle();
    orderMetadataHandle.getCollections().add("orders");
    DocumentWriteSet orderWriteSet = docMgr.newWriteSet();
    long diff = (long) 30 * 24 * 60 * 60 * 1000;
    long endTime = new Date().getTime();
    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
    for (int i = 0; i < 50; i++) {
      String orderDate = "\"orderdate\" : \"" + dateFormat.format(endTime - (long) (diff * Math.random())) + "\"";
      String orderDocument = "{ \"id\" : " + (i + 1) + ", \"customerid\" : " + (customerRandom.nextInt(10) + 1) + ", "
          + orderDate + "}";
      orderWriteSet.add("/moveData/order" + (i + 1) + ".json", orderMetadataHandle,
          new StringHandle(orderDocument).withFormat(Format.JSON));
    }
    docMgr.write(orderWriteSet);
    installTransform(sourceClient);
  }
641213
public function handle_get_data() {
        $url = new UrlHelper ();
        $pageNumber = $url->get('pageNumber', 1);
        $perPage = $url->get('perPage', 10);
        $filters = $url->get("filters_json", "[]");

        $params = array(
            'skip' => ($pageNumber - 1) * $perPage,
            'take' => $perPage,
            'filters_json' => $filters
        );
        return array(
            'type' => 'json',
            'data' => array (
                'rows' => $this->dataProvider->getData($params)
            )
        );
    }
565448
public function dataTabs() {
        $wt_tree = Globals::getTree();
        $controller = new JsonController();
        
        $ga_id = Filter::getInteger('ga_id');
        $ga = $this->provider->getGeoAnalysis($ga_id);
        $sosa_provider = new SosaProvider($wt_tree, Auth::user());
        
        $controller
            ->restrictAccess($ga && $sosa_provider->isSetup())
            ->pageHeader();
        
        $jsonArray = array();
        
        list($placesDispGeneral, $placesDispGenerations) = $ga->getAnalysisResults($sosa_provider->getAllSosaWithGenerations());
        
        $flags = array();
        if($placesDispGeneral && $ga->getOptions() && $ga->getOptions()->isUsingFlags()) {
            $mapProvider = new GoogleMapsProvider();            
            foreach($placesDispGeneral['places'] as $place => $count) {
                $flags[$place] = $mapProvider->getPlaceIcon(new Place($place, $wt_tree));
            }
        }
        
        $jsonArray['generaltab'] = $this->htmlPlacesAnalysisGeneralTab($ga, $placesDispGeneral, $flags);
        $jsonArray['generationstab'] = $this->htmlPlacesAnalysisGenerationsTab($ga, $placesDispGenerations, $flags);

        $controller->encode($jsonArray);
    }
1265765
public function getDataProvider()
    {
        if ($this->dataProvider === null) {
            $this->_id = $this->_id
                ?: Yii::$app->request->post('selection')
                ?: Yii::$app->request->get('selection')
                ?: Yii::$app->request->get('id');

            $this->dataProvider = $this->getSearchModel()->search([], ['pagination' => false]);
            $this->dataProvider->query->andFilterWhere(
                is_array($this->_id) ? ['in', 'id', $this->_id] : ['eq', 'id', $this->_id]
            );

            if (empty($this->dataProvider->query->where)) {
                throw new BadRequestHttpException('Where condition is empty!');
            }

            $this->dataProvider->query->andFilterWhere($this->findOptions);
        }
        $limit = $this->dataProvider->query->limit;
        $this->dataProvider->query->andFilterWhere($this->findOptions)->limit($limit ?? -1);

        return $this->dataProvider;
    }
1265080
@DataProvider(name = "generateData")
    Object[][] generateData() {
        final Random ran = new Random();
        final Object[][] intData = new Object[Config.RUNS][];
        for (int i = 0; i < intData.length; i++) {
            final List<Integer> data = new ArrayList<Integer>();
            int counter = 0;
            while (counter < ARRAYSIZE) {
                data.add(ran.nextInt());
                counter++;
            }
            intData[i] = new Object[]{data};
        }
        return intData;
    }
468580
public function getDataMapper()
    {
        $dataMapper = Ioc::make(DataMapper::class);
        $dataMapper->setSchema($this->getSchema());

        return $dataMapper;
    }
366693
public com.google.api.ads.admanager.axis.v201811.AudienceSegmentDataProvider getDataProvider() {
        return dataProvider;
    }
1120012
public function addDataProviderInput()
    {
        $input = (new Select(self::DATA_PARAM))
                ->setOptions(array(null => '---'));
        $dataProviderClasses = array();
        foreach ($this->di->get('config')->formFactory->dataProviders as $classname) {
            $provider = new $classname;
            if ($provider instanceof DataProviderInterface) {
                $dataProviderClasses[$classname] = $provider->getName();
            }
        }
        $input
                ->addOptions($dataProviderClasses)
                ->setLabel('Data provider');
        $this->add($input);
    }
1314101
public DataProvider getDataProvider(){
        if(this.dataProvider == null){
//            EventLogger.logEvent("org.wwarn.surveyor.client.mvp.SimpleClientFactory", "getDataProvider", "begin");

//            EventLogger.logEvent("org.wwarn.surveyor.client.mvp.SimpleClientFactory", "getSchema", "begin");
            DataSchema schema = getSchema();
//            EventLogger.logEvent("org.wwarn.surveyor.client.mvp.SimpleClientFactory", "getSchema", "end");
//            EventLogger.logEvent("org.wwarn.surveyor.client.mvp.SimpleClientFactory", "getFacetFieldList", "begin");
            String[] facetFieldList = getFacetFieldList();
//            EventLogger.logEvent("org.wwarn.surveyor.client.mvp.SimpleClientFactory", "getFacetFieldList", "end");
//            EventLogger.logEvent("org.wwarn.surveyor.client.mvp.SimpleClientFactory", "DefaultLocalJSONDataProvider", "begin");
            final ApplicationContext applicationContext1 = getApplicationContext();
            final DatasourceConfig config = applicationContext1.getConfig(DatasourceConfig.class);
            GenericDataSource dataSource = new GenericDataSource(config.getFilename(), null, GenericDataSource.DataSourceType.ServletRelativeDataSource);

            switch (config.getDataSourceProvider()){
                case ClientSideSearchDataProvider:
                    dataSource.setDataSourceProvider(DataSourceProvider.ClientSideSearchDataProvider);
                    this.dataProvider = new ClientSideSearchDataProvider(dataSource, schema, facetFieldList);
                break;
                case ServerSideLuceneDataProvider:
                    dataSource.setDataSourceProvider(DataSourceProvider.ServerSideLuceneDataProvider);
                    this.dataProvider = new ServerSideSearchDataProvider(dataSource, schema, facetFieldList);
                    break;
                case GoogleAppEngineLuceneDataSource:
                    dataSource.setDataSourceProvider(DataSourceProvider.GoogleAppEngineLuceneDataSource);
                    this.dataProvider = new ServerSideSearchDataProvider(dataSource, schema, facetFieldList);
                    break;
                case LocalClientSideDataProvider:
                default:
                    dataSource.setDataSourceProvider(DataSourceProvider.LocalClientSideDataProvider);
                    this.dataProvider =  new DefaultLocalJSONDataProvider(dataSource, schema, facetFieldList);
                    break;
            }
//            EventLogger.logEvent("org.wwarn.surveyor.client.mvp.SimpleClientFactory", "DefaultLocalJSONDataProvider", "end");
//            EventLogger.logEvent("org.wwarn.surveyor.client.mvp.SimpleClientFactory", "getDataProvider", "end");

        }
        return this.dataProvider;

    }
867829
def provider_list(self, lookup='all'):
        '''
        
        '''
        data = {}
        lookups = self.lookup_providers(lookup)
        if not lookups:
            return data

        for alias, driver in lookups:
            if alias not in data:
                data[alias] = {}
            if driver not in data[alias]:
                data[alias][driver] = {}
        return data
756529
function findDataSource(connections, dataSource, cb) {
  var query = {

  };

  //Searching By ID.
  query[CONSTANTS.DATA_SOURCE_ID] = dataSource[CONSTANTS.DATA_SOURCE_ID];

  //Looking up a full data source document as we are updating
  lookUpDataSources(connections, {
    query: query,
    lean: false
  }, function(err, dataSources) {
    if (err) {
      return cb(buildErrorResponse({
        error: err,
        userDetail: "Unexpected Error When Searching For A Data Source",
        code: ERROR_CODES.FH_FORMS_UNEXPECTED_ERROR
      }));
    }

    //Should only be one data source
    if (dataSources.length !== 1) {
      return cb(buildErrorResponse({
        error: new Error("Data Source Not Found"),
        systemDetail: "Requested ID: "  + dataSource[CONSTANTS.DATA_SOURCE_ID],
        code: ERROR_CODES.FH_FORMS_NOT_FOUND
      }));
    }

    return cb(undefined, dataSource, dataSources[0]);
  });
}
510799
private function getDataMapper()
    {
        if($this->dataMapper == null) {
            $this->dataMapper = new \Friday\Model\DataMapper(self::$app->config);
        }
        return $this->dataMapper;
    }