Difference between revisions of "Talk:API:EPrints"

From EPrints Documentation
Jump to: navigation, search
(API)
(API)
Line 21: Line 21:
 
* What methods to use
 
* What methods to use
 
* What $foo variable name to conventially use to refer to this item.
 
* What $foo variable name to conventially use to refer to this item.
 +
 +
==== revision 2 ====
  
 
  $repo = EPrints->repository_by_id( "devel" );
 
  $repo = EPrints->repository_by_id( "devel" );
Line 29: Line 31:
 
  $search = $dataset->search();
 
  $search = $dataset->search();
 
  $list = $search->execute();
 
  $list = $search->execute();
 +
 +
==== rev. 3. ====
 +
 +
$repo = EPrints->repository( "devel", noise=>1 );
 +
$repo = EPrints->repository_from_request( noise=>3 );
 +
$xml = $repo->xml();
 +
$dataset = $repo->dataset( "user" );
 +
$user = $repo->user( 23 );
 +
$user = $repo->user_by_username( "cjg" );
 +
$user = $dataset->dataobj( 23 );
 +
$search = $dataset->prepare_search();
 +
$list = $search->execute();
 +
 +
Still needing API working out: dataobj,eprint,user,subject,file,document,search,list,xml,page

Revision as of 12:50, 8 September 2009

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.

revision 2

$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();

rev. 3.

$repo = EPrints->repository( "devel", noise=>1 );
$repo = EPrints->repository_from_request( noise=>3 );
$xml = $repo->xml();
$dataset = $repo->dataset( "user" );
$user = $repo->user( 23 );
$user = $repo->user_by_username( "cjg" );
$user = $dataset->dataobj( 23 );
$search = $dataset->prepare_search();
$list = $search->execute();

Still needing API working out: dataobj,eprint,user,subject,file,document,search,list,xml,page