Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
ENH: Refs #0963. Moved all the remaining apis (in api module) to core.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhengZ committed Apr 5, 2013
1 parent e7aa956 commit cccee69
Show file tree
Hide file tree
Showing 9 changed files with 505 additions and 449 deletions.
12 changes: 9 additions & 3 deletions core/controllers/api/BitstreamController.php
Expand Up @@ -29,8 +29,11 @@ class Rest_BitstreamController extends ApiController
*/
public function indexAction()
{
$apiFunctions['default'] = 'bitstreamCount';
$apiFunctions['count'] = 'bitstreamCount';
$apiFunctions = array(
'default' => 'bitstreamCount',
'exists' => 'bitstreamCount',
'download' => 'bitstreamDownloadByChecksum'
);
$this->_genericAction($this->_request->getParams(), 'index', $apiFunctions);
}

Expand Down Expand Up @@ -60,7 +63,10 @@ public function headAction()
*/
public function getAction()
{
$apiFunctions['default'] = 'bitstreamGet';
$apiFunctions = array(
'default' => 'bitstreamGet',
'download' => 'bitstreamDownloadById'
);
$this->_genericAction($this->_request->getParams(), 'get', $apiFunctions);
}

Expand Down
3 changes: 2 additions & 1 deletion core/controllers/api/FolderController.php
Expand Up @@ -53,7 +53,8 @@ public function getAction()
$apiFunctions = array(
'default' => 'folderGet',
'children' => 'folderChildren',
'permission' => 'folderListPermissions'
'permission' => 'folderListPermissions',
'download' => 'folderDownload'
);
$this->_genericAction($this->_request->getParams(), 'get', $apiFunctions);
}
Expand Down
3 changes: 2 additions & 1 deletion core/controllers/api/ItemController.php
Expand Up @@ -57,7 +57,8 @@ public function getAction()
$apiFunctions = array(
'default' => 'itemGet',
'metadata'=> 'itemGetmetadata',
'permission' => 'itemListPermissions'
'permission' => 'itemListPermissions',
'download' => 'itemDownload'
);
$this->_genericAction($this->_request->getParams(), 'get', $apiFunctions);
}
Expand Down
5 changes: 4 additions & 1 deletion core/controllers/api/SystemController.php
Expand Up @@ -39,7 +39,8 @@ public function indexAction()
'metadataqualifiers' => 'metadataQualifiersList',
'uploadeoffset' => 'uploadGetoffset',
'metadatatypes' => 'metadataTypesList',
'metadaelements' => 'metadataElementsList'
'metadaelements' => 'metadataElementsList',
'uploadtoken' => 'uploadGeneratetoken'
);
$this->_genericAction($this->_request->getParams(), 'index', $apiFunctions);
}
Expand Down Expand Up @@ -73,6 +74,8 @@ public function postAction()
$apiFunctions = array(
'default' => 'adminDatabaseCleanup',
'databasecleanup' => 'adminDatabaseCleanup',
'defaultapikey' => 'userApikeyDefault',
'upload' => 'uploadPerform'
);
$this->_genericAction($this->_request->getParams(), 'post', $apiFunctions);
}
Expand Down

0 comments on commit cccee69

Please sign in to comment.