mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-23 09:53:09 +00:00
Top-level browse views (ItemsByTitle, ItemsByDate, ItemsByAuthor, ItemsByDateAccessioned) converted to tables
Community and Collection browse views remain views, but are no longer dynamically ordered. git-svn-id: http://scm.dspace.org/svn/repo/trunk@54 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -191,6 +191,7 @@ CREATE TABLE DCValue
|
|||||||
);
|
);
|
||||||
|
|
||||||
-- An index for dctypes
|
-- An index for dctypes
|
||||||
|
DROP INDEX dcvalue_dc_type_id_idx;
|
||||||
CREATE INDEX dcvalue_dc_type_id_idx on DCValue(dc_type_id);
|
CREATE INDEX dcvalue_dc_type_id_idx on DCValue(dc_type_id);
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
@@ -477,17 +478,14 @@ WHERE Item.item_id = DCValue.item_id
|
|||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
-- ItemsByAuthor view
|
-- ItemsByAuthor view
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
DROP VIEW ItemsByAuthor;
|
DROP TABLE ItemsByAuthor;
|
||||||
|
|
||||||
CREATE VIEW ItemsByAuthor as
|
CREATE TABLE ItemsByAuthor
|
||||||
SELECT DCResult.item_id, DCResult.text_value as Author
|
(
|
||||||
FROM DCResult, DCTypeRegistry
|
items_by_author_id INTEGER PRIMARY KEY,
|
||||||
WHERE DCTypeRegistry.element = 'contributor'
|
item_id INTEGER REFERENCES Item(item_id),
|
||||||
AND DCTypeRegistry.qualifier = 'author'
|
author TEXT
|
||||||
AND DCTypeRegistry.dc_type_id = DCResult.dc_type_id
|
);
|
||||||
AND DCResult.in_archive = 't'
|
|
||||||
ORDER BY Author, DCResult.item_id
|
|
||||||
;
|
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
-- CollectionItemsByAuthor view
|
-- CollectionItemsByAuthor view
|
||||||
@@ -498,7 +496,6 @@ CREATE VIEW CollectionItemsByAuthor as
|
|||||||
SELECT Collection2Item.collection_id, ItemsByAuthor.*
|
SELECT Collection2Item.collection_id, ItemsByAuthor.*
|
||||||
FROM ItemsByAuthor, Collection2Item
|
FROM ItemsByAuthor, Collection2Item
|
||||||
WHERE ItemsByAuthor.item_id = Collection2Item.item_id
|
WHERE ItemsByAuthor.item_id = Collection2Item.item_id
|
||||||
ORDER BY Author, ItemsByAuthor.item_id
|
|
||||||
;
|
;
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
@@ -510,7 +507,6 @@ CREATE VIEW CommunityItemsByAuthor as
|
|||||||
SELECT Community2Item.community_id, ItemsByAuthor.*
|
SELECT Community2Item.community_id, ItemsByAuthor.*
|
||||||
FROM ItemsByAuthor, Community2Item
|
FROM ItemsByAuthor, Community2Item
|
||||||
WHERE ItemsByAuthor.item_id = Community2Item.item_id
|
WHERE ItemsByAuthor.item_id = Community2Item.item_id
|
||||||
ORDER BY Author, ItemsByAuthor.item_id
|
|
||||||
;
|
;
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
@@ -557,19 +553,15 @@ end;
|
|||||||
-- ItemsByTitle view
|
-- ItemsByTitle view
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
DROP VIEW ItemsByTitle;
|
DROP TABLE ItemsByTitle;
|
||||||
|
|
||||||
CREATE VIEW ItemsByTitle as
|
CREATE TABLE ItemsByTitle
|
||||||
SELECT DCResult.item_id,
|
(
|
||||||
DCResult.text_value as Title,
|
items_by_title_id INTEGER PRIMARY KEY,
|
||||||
sorttitle(DCResult.text_value) as SortTitle
|
item_id INTEGER REFERENCES Item(item_id),
|
||||||
FROM DCResult, DCTypeRegistry
|
title TEXT,
|
||||||
WHERE DCTypeRegistry.element = 'title'
|
sort_title TEXT
|
||||||
AND DCTypeRegistry.qualifier is null
|
);
|
||||||
AND DCTypeRegistry.dc_type_id = DCResult.dc_type_id
|
|
||||||
AND DCResult.in_archive = 't'
|
|
||||||
ORDER BY SortTitle, DCResult.item_id
|
|
||||||
;
|
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
-- CollectionItemsByTitle view
|
-- CollectionItemsByTitle view
|
||||||
@@ -580,7 +572,6 @@ CREATE VIEW CollectionItemsByTitle as
|
|||||||
SELECT Collection2Item.collection_id, ItemsByTitle.*
|
SELECT Collection2Item.collection_id, ItemsByTitle.*
|
||||||
FROM ItemsByTitle, Collection2Item
|
FROM ItemsByTitle, Collection2Item
|
||||||
WHERE ItemsByTitle.item_id = Collection2Item.item_id
|
WHERE ItemsByTitle.item_id = Collection2Item.item_id
|
||||||
ORDER BY Title, ItemsByTitle.item_id
|
|
||||||
;
|
;
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
@@ -592,23 +583,19 @@ CREATE VIEW CommunityItemsByTitle as
|
|||||||
SELECT Community2Item.community_id, ItemsByTitle.*
|
SELECT Community2Item.community_id, ItemsByTitle.*
|
||||||
FROM ItemsByTitle, Community2Item
|
FROM ItemsByTitle, Community2Item
|
||||||
WHERE ItemsByTitle.item_id = Community2Item.item_id
|
WHERE ItemsByTitle.item_id = Community2Item.item_id
|
||||||
ORDER BY Title, ItemsByTitle.item_id
|
|
||||||
;
|
;
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
-- ItemsByDate view
|
-- ItemsByDate table
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
DROP VIEW ItemsByDate;
|
DROP TABLE ItemsByDate;
|
||||||
|
|
||||||
CREATE VIEW ItemsByDate as
|
CREATE TABLE ItemsByDate
|
||||||
SELECT DCResult.item_id, DCResult.text_value as DateIssued
|
(
|
||||||
FROM DCResult, DCTypeRegistry
|
items_by_date_id INTEGER PRIMARY KEY,
|
||||||
WHERE DCTypeRegistry.element = 'date'
|
item_id INTEGER REFERENCES Item(item_id),
|
||||||
AND DCTypeRegistry.qualifier = 'issued'
|
date_issued TEXT
|
||||||
AND DCTypeRegistry.dc_type_id = DCResult.dc_type_id
|
);
|
||||||
AND DCResult.in_archive = 't'
|
|
||||||
ORDER BY DateIssued desc, DCResult.item_id
|
|
||||||
;
|
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
-- CollectionItemsByDate view
|
-- CollectionItemsByDate view
|
||||||
@@ -619,7 +606,6 @@ CREATE VIEW CollectionItemsByDate as
|
|||||||
SELECT Collection2Item.collection_id, ItemsByDate.*
|
SELECT Collection2Item.collection_id, ItemsByDate.*
|
||||||
FROM ItemsByDate, Collection2Item
|
FROM ItemsByDate, Collection2Item
|
||||||
WHERE ItemsByDate.item_id = Collection2Item.item_id
|
WHERE ItemsByDate.item_id = Collection2Item.item_id
|
||||||
ORDER BY DateIssued desc, ItemsByDate.item_id
|
|
||||||
;
|
;
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
@@ -631,23 +617,19 @@ CREATE VIEW CommunityItemsByDate as
|
|||||||
SELECT Community2Item.community_id, ItemsByDate.*
|
SELECT Community2Item.community_id, ItemsByDate.*
|
||||||
FROM ItemsByDate, Community2Item
|
FROM ItemsByDate, Community2Item
|
||||||
WHERE ItemsByDate.item_id = Community2Item.item_id
|
WHERE ItemsByDate.item_id = Community2Item.item_id
|
||||||
ORDER BY DateIssued desc, ItemsByDate.item_id
|
|
||||||
;
|
;
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
-- ItemsByDateAccessioned view
|
-- ItemsByDateAccessioned table
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
DROP VIEW ItemsByDateAccessioned;
|
DROP TABLE ItemsByDateAccessioned;
|
||||||
|
|
||||||
CREATE VIEW ItemsByDateAccessioned as
|
CREATE TABLE ItemsByDateAccessioned
|
||||||
SELECT DCResult.item_id, DCResult.text_value as DateAccessioned
|
(
|
||||||
FROM DCResult, DCTypeRegistry
|
items_by_date_accessioned_id INTEGER PRIMARY KEY,
|
||||||
WHERE DCTypeRegistry.element = 'date'
|
item_id INTEGER REFERENCES Item(item_id),
|
||||||
AND DCTypeRegistry.qualifier = 'accessioned'
|
date_accessioned TEXT
|
||||||
AND DCTypeRegistry.dc_type_id = DCResult.dc_type_id
|
);
|
||||||
AND DCResult.in_archive = 't'
|
|
||||||
ORDER BY DateAccessioned, DCResult.item_id
|
|
||||||
;
|
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
-- CollectionItemsByDateAccessioned view
|
-- CollectionItemsByDateAccessioned view
|
||||||
@@ -658,7 +640,6 @@ CREATE VIEW CollectionItemsByDateAccessioned as
|
|||||||
SELECT Collection2Item.collection_id, ItemsByDateAccessioned.*
|
SELECT Collection2Item.collection_id, ItemsByDateAccessioned.*
|
||||||
FROM ItemsByDateAccessioned, Collection2Item
|
FROM ItemsByDateAccessioned, Collection2Item
|
||||||
WHERE ItemsByDateAccessioned.item_id = Collection2Item.item_id
|
WHERE ItemsByDateAccessioned.item_id = Collection2Item.item_id
|
||||||
ORDER BY DateAccessioned desc, ItemsByDateAccessioned.item_id
|
|
||||||
;
|
;
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
@@ -670,6 +651,5 @@ CREATE VIEW CommunityItemsByDateAccessioned as
|
|||||||
SELECT Community2Item.community_id, ItemsByDateAccessioned.*
|
SELECT Community2Item.community_id, ItemsByDateAccessioned.*
|
||||||
FROM ItemsByDateAccessioned, Community2Item
|
FROM ItemsByDateAccessioned, Community2Item
|
||||||
WHERE ItemsByDateAccessioned.item_id = Community2Item.item_id
|
WHERE ItemsByDateAccessioned.item_id = Community2Item.item_id
|
||||||
ORDER BY DateAccessioned desc, ItemsByDateAccessioned.item_id
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user