Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #490 from mwoodiupui/dspace-4_x

[DS-1795] When run command dspace "dspace stat-initial"
  • Loading branch information...
commit 004a8d8ffcc558296b2b1e1adfab439c62b327fc 2 parents be9af85 + bb6f4fc
@mwoodiupui mwoodiupui authored
View
21 dspace-api/src/main/java/org/dspace/app/statistics/LogAnalyser.java
@@ -7,6 +7,7 @@
*/
package org.dspace.app.statistics;
+import org.dspace.content.MetadataSchema;
import org.dspace.core.ConfigurationManager;
import org.dspace.core.Context;
import org.dspace.core.LogManager;
@@ -153,10 +154,10 @@
private static Pattern logRegex = null;
/** pattern to match commented out lines from the config file */
- private static Pattern comment = Pattern.compile("^#");
+ private static final Pattern comment = Pattern.compile("^#");
/** pattern to match genuine lines from the config file */
- private static Pattern real = Pattern.compile("^(.+)=(.+)");
+ private static final Pattern real = Pattern.compile("^(.+)=(.+)");
/** pattern to match all search types */
private static Pattern typeRX = null;
@@ -1165,8 +1166,12 @@ public static Integer getNumItems(Context context, String type)
"AND metadata_field_id = (" +
" SELECT metadata_field_id " +
" FROM metadatafieldregistry " +
- " WHERE element = 'type' " +
- " AND qualifier IS NULL) ";
+ " WHERE metadata_schema_id = (" +
+ " SELECT metadata_schema_id" +
+ " FROM MetadataSchemaRegistry" +
+ " WHERE short_id = '" + MetadataSchema.DC_SCHEMA + "')" +
+ " AND element = 'type' " +
+ " AND qualifier IS NULL) ";
}
// start the date constraint query buffer
@@ -1184,8 +1189,12 @@ public static Integer getNumItems(Context context, String type)
"WHERE metadata_field_id = (" +
" SELECT metadata_field_id " +
" FROM metadatafieldregistry " +
- " WHERE element = 'date' " +
- " AND qualifier = 'accessioned') ");
+ " WHERE metadata_schema_id = (" +
+ " SELECT metadata_schema_id" +
+ " FROM MetadataSchemaRegistry" +
+ " WHERE short_id = '" + MetadataSchema.DC_SCHEMA + "')" +
+ " AND element = 'date' " +
+ " AND qualifier = 'accessioned') ");
// Verifies that the metadata contains a valid date, otherwise the
// postgres queries blow up when doing the ::timestamp cast.
Please sign in to comment.
Something went wrong with that request. Please try again.