forked from Aspen-Discovery/aspen-discovery
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update handling of Palace Project collections
- Automatically load Palace Project Collections into Aspen and allow the name of the collection to be changed for display within Aspen. - Allow Palace Project Collections to be omitted from Aspen. - Reduce the update interval for Palace Project Collections that do not have circulation. - rebuild jars
- Loading branch information
Showing
28 changed files
with
322 additions
and
40 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions
10
.../palace_project_export/src/org/aspendiscovery/palace_project/PalaceProjectCollection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.aspendiscovery.palace_project; | ||
|
||
public class PalaceProjectCollection { | ||
public long id; | ||
public String palaceProjectName; | ||
public String displayName; | ||
public boolean hasCirculation; | ||
public boolean includeInAspen; | ||
public long lastIndexed; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?php | ||
|
||
require_once ROOT_DIR . '/Action.php'; | ||
require_once ROOT_DIR . '/sys/PalaceProject/PalaceProjectSetting.php'; | ||
require_once ROOT_DIR . '/sys/PalaceProject/PalaceProjectCollection.php'; | ||
require_once ROOT_DIR . '/services/Admin/ObjectEditor.php'; | ||
|
||
class PalaceProject_Collections extends ObjectEditor { | ||
function getObjectType(): string { | ||
return 'PalaceProjectCollections'; | ||
} | ||
|
||
function getToolName(): string { | ||
return 'Collections'; | ||
} | ||
|
||
function getModule(): string { | ||
return 'PalaceProject'; | ||
} | ||
|
||
function getPageTitle(): string { | ||
return 'Palace Project Collections'; | ||
} | ||
|
||
function getAllObjects($page, $recordsPerPage): array { | ||
$object = new PalaceProjectCollection(); | ||
if (isset($_REQUEST['settingId'])) { | ||
$settingId = $_REQUEST['settingId']; | ||
$object->settingId = $settingId; | ||
} | ||
$object->limit(($page - 1) * $recordsPerPage, $recordsPerPage); | ||
$this->applyFilters($object); | ||
$object->orderBy($this->getSort()); | ||
$object->find(); | ||
$objectList = []; | ||
while ($object->fetch()) { | ||
$objectList[$object->id] = clone $object; | ||
} | ||
return $objectList; | ||
} | ||
|
||
function getDefaultSort(): string { | ||
return 'palaceProjectName asc'; | ||
} | ||
|
||
function getObjectStructure($context = ''): array { | ||
return PalaceProjectCollection::getObjectStructure($context); | ||
} | ||
|
||
function getPrimaryKeyColumn(): string { | ||
return 'id'; | ||
} | ||
|
||
function getIdKeyColumn(): string { | ||
return 'id'; | ||
} | ||
|
||
function canAddNew() { | ||
return true; | ||
} | ||
|
||
function canDelete() { | ||
return true; | ||
} | ||
|
||
function getAdditionalObjectActions($existingObject): array { | ||
return []; | ||
} | ||
|
||
function getInstructions(): string { | ||
return 'https://help.aspendiscovery.org/help/integration/econtent'; | ||
} | ||
|
||
function getBreadcrumbs(): array { | ||
$breadcrumbs = []; | ||
$breadcrumbs[] = new Breadcrumb('/Admin/Home', 'Administration Home'); | ||
$breadcrumbs[] = new Breadcrumb('/Admin/Home#palace_project', 'Palace Project'); | ||
if (isset($_REQUEST['settingId'])) { | ||
$breadcrumbs[] = new Breadcrumb('/PalaceProject/Settings?objectAction=edit&id=' . $this->activeObject->settingId, 'Settings'); | ||
$breadcrumbs[] = new Breadcrumb('/PalaceProject/Collections?settingId=' . $this->activeObject->settingId, 'All Collections'); | ||
}else{ | ||
$breadcrumbs[] = new Breadcrumb('/PalaceProject/Settings', 'All Settings'); | ||
} | ||
return $breadcrumbs; | ||
} | ||
|
||
function getActiveAdminSection(): string { | ||
return 'palace_project'; | ||
} | ||
|
||
function canView(): bool { | ||
return UserAccount::userHasPermission('Administer Palace Project'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
require_once ROOT_DIR . '/sys/PalaceProject/PalaceProjectSetting.php'; | ||
|
||
class PalaceProjectCollection extends DataObject { | ||
public $__table = 'palace_project_collections'; // table name | ||
public $id; | ||
public $settingId; | ||
public $palaceProjectName; | ||
public $displayName; | ||
public $hasCirculation; | ||
public $lastIndexed; | ||
|
||
public function getUniquenessFields(): array { | ||
return [ | ||
'id', | ||
]; | ||
} | ||
|
||
public static function getObjectStructure($context = ''): array { | ||
$palaceProjectSettings = []; | ||
$palaceProjectSetting = new PalaceProjectSetting(); | ||
$palaceProjectSetting->find(); | ||
while ($palaceProjectSetting->fetch()) { | ||
$palaceProjectSettings[$palaceProjectSetting->id] = (string)$palaceProjectSetting; | ||
} | ||
|
||
$structure = [ | ||
'id' => [ | ||
'property' => 'id', | ||
'type' => 'label', | ||
'label' => 'Id', | ||
'description' => 'The unique id within the database', | ||
], | ||
'settingId' => [ | ||
'property' => 'settingId', | ||
'type' => 'enum', | ||
'values' => $palaceProjectSettings, | ||
'label' => 'Setting Id', | ||
'readOnly' => true, | ||
], | ||
'palaceProjectName' => [ | ||
'property' => 'palaceProjectName', | ||
'type' => 'text', | ||
'label' => 'Palace Project Name', | ||
'description' => 'The name of the collection within Palace Project', | ||
'readOnly' => true, | ||
], | ||
'displayName' => [ | ||
'property' => 'displayName', | ||
'type' => 'text', | ||
'label' => 'Aspen Display Name', | ||
'description' => 'The name of the collection for display within Asepn', | ||
], | ||
'hasCirculation' => [ | ||
'property' => 'hasCirculation', | ||
'type' => 'checkbox', | ||
'label' => 'Has Circulation', | ||
'description' => 'If the collection has circulation. Collections with circulation will be indexed continuously.', | ||
], | ||
'includeInAspen' => [ | ||
'property' => 'includeInAspen', | ||
'type' => 'checkbox', | ||
'label' => 'Include In Aspen', | ||
'description' => 'Whether the collection is included within Aspen.', | ||
], | ||
'lastIndexed' => [ | ||
'property' => 'lastIndexed', | ||
'type' => 'timestamp', | ||
'label' => 'Last Indexed', | ||
'description' => 'When the collection was indexed last. Collections without circulation will index every 24 hours', | ||
], | ||
]; | ||
return $structure; | ||
} | ||
|
||
public function getEditLink($context): string { | ||
return '/PalaceProject/Collections?objectAction=edit&id=' . $this->id; | ||
} | ||
} |
Oops, something went wrong.