Talk:API:EPrints

From EPrints Documentation
Revision as of 18:25, 2 September 2009 by Cjg (Talk | contribs)

Jump to: navigation, search

I'm going to use this page to get my thoughts in order. Cjg 16:58, 2 September 2009 (BST)

Current 3.1 System

Session, Repository, DataSet, MetaField

API

Plan:

  • RepositoryHandle (was Session)
  • MetaFieldHandle
  • DataSetHandle
  • Repository, MetaField and DataSet still exist but are not part of the API.
$handle = EPrint->get_repository_handle()
$dataset = $handle->get_dataset_handle()
$field = $dataset->get_field( "foo" )
$search = $dataset->get_search()

OK. The problems:

  • what to name the new modules
  • if we should rename the old modules? s/DataSet/DataSetConfig/
  • What methods to use
  • What $foo variable name to conventially use to refer to this item.
$repo = EPrints->repository_by_id( "devel" );
$dataset = $repo->dataset( "user" );
$user = $repo->user( 23 );
$user = $repo->user_by_username( "cjg" );
$user = $dataset->dataobj( 23 );
$search = $dataset->search();
$list = $search->execute();