mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-23 18:03:11 +00:00
formatidentifier table renamed to fileextension.
git-svn-id: http://scm.dspace.org/svn/repo/trunk@274 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -65,11 +65,11 @@ CREATE TABLE BitstreamFormatRegistry
|
|||||||
);
|
);
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
-- FormatIdentifier table
|
-- FileExtension table
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
DROP TABLE FormatIdentifier;
|
DROP TABLE FileExtension;
|
||||||
|
|
||||||
CREATE TABLE FormatIdentifier
|
CREATE TABLE FileExtension
|
||||||
(
|
(
|
||||||
id INTEGER PRIMARY KEY,
|
id INTEGER PRIMARY KEY,
|
||||||
bitstream_format_id INTEGER REFERENCES BitstreamFormatRegistry(bitstream_format_id),
|
bitstream_format_id INTEGER REFERENCES BitstreamFormatRegistry(bitstream_format_id),
|
||||||
|
@@ -113,7 +113,7 @@ public class BitstreamFormat
|
|||||||
extensions = new ArrayList();
|
extensions = new ArrayList();
|
||||||
|
|
||||||
TableRowIterator tri = DatabaseManager.query(context,
|
TableRowIterator tri = DatabaseManager.query(context,
|
||||||
"SELECT * FROM formatidentifier WHERE bitstream_format_id=" +
|
"SELECT * FROM fileextension WHERE bitstream_format_id=" +
|
||||||
getID());
|
getID());
|
||||||
|
|
||||||
while (tri.hasNext())
|
while (tri.hasNext())
|
||||||
@@ -496,14 +496,14 @@ public class BitstreamFormat
|
|||||||
|
|
||||||
// Delete extensions
|
// Delete extensions
|
||||||
DatabaseManager.updateQuery(bfContext,
|
DatabaseManager.updateQuery(bfContext,
|
||||||
"DELETE FROM formatidentifier WHERE bitstream_format_id=" +
|
"DELETE FROM fileextension WHERE bitstream_format_id=" +
|
||||||
getID());
|
getID());
|
||||||
|
|
||||||
// Rewrite extensions
|
// Rewrite extensions
|
||||||
for (int i = 0; i < extensions.size(); i++)
|
for (int i = 0; i < extensions.size(); i++)
|
||||||
{
|
{
|
||||||
String s = (String) extensions.get(i);
|
String s = (String) extensions.get(i);
|
||||||
TableRow r = DatabaseManager.create(bfContext, "formatidentifier");
|
TableRow r = DatabaseManager.create(bfContext, "fileextension");
|
||||||
r.setColumn("bitstream_format_id", getID());
|
r.setColumn("bitstream_format_id", getID());
|
||||||
r.setColumn("extension", s);
|
r.setColumn("extension", s);
|
||||||
DatabaseManager.update(bfContext, r);
|
DatabaseManager.update(bfContext, r);
|
||||||
@@ -540,7 +540,7 @@ public class BitstreamFormat
|
|||||||
|
|
||||||
// Delete extensions
|
// Delete extensions
|
||||||
DatabaseManager.updateQuery(bfContext,
|
DatabaseManager.updateQuery(bfContext,
|
||||||
"DELETE FROM formatidentifier WHERE bitstream_format_id=" +
|
"DELETE FROM fileextension WHERE bitstream_format_id=" +
|
||||||
getID());
|
getID());
|
||||||
|
|
||||||
// Delete this format from database
|
// Delete this format from database
|
||||||
|
@@ -103,12 +103,12 @@ public class FormatIdentifier
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// See if the extension is in the FormatIdentifier table
|
// See if the extension is in the fileextension table
|
||||||
TableRowIterator tri = DatabaseManager.query(context,
|
TableRowIterator tri = DatabaseManager.query(context,
|
||||||
"SELECT bitstreamformatregistry.* FROM bitstreamformatregistry, " +
|
"SELECT bitstreamformatregistry.* FROM bitstreamformatregistry, " +
|
||||||
"formatidentifier WHERE formatidentifier.extension LIKE '" +
|
"fileextension WHERE fileextension.extension LIKE '" +
|
||||||
extension +"' AND bitstreamformatregistry.bitstream_format_id=" +
|
extension +"' AND bitstreamformatregistry.bitstream_format_id=" +
|
||||||
"formatidentifier.bitstream_format_id");
|
"fileextension.bitstream_format_id");
|
||||||
|
|
||||||
if (tri.hasNext())
|
if (tri.hasNext())
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user