r4511 - trunk/src/edu/ucsb/nceas/metacat
daigle at ecoinformatics.org
daigle at ecoinformatics.org
Tue Nov 4 16:04:54 PST 2008
Author: daigle
Date: 2008-11-04 16:04:54 -0800 (Tue, 04 Nov 2008)
New Revision: 4511
Modified:
trunk/src/edu/ucsb/nceas/metacat/Sitemap.java
Log:
Change the db query to only pull public allowed documents when creating the sitemap file.
Modified: trunk/src/edu/ucsb/nceas/metacat/Sitemap.java
===================================================================
--- trunk/src/edu/ucsb/nceas/metacat/Sitemap.java 2008-11-05 00:03:44 UTC (rev 4510)
+++ trunk/src/edu/ucsb/nceas/metacat/Sitemap.java 2008-11-05 00:04:54 UTC (rev 4511)
@@ -100,8 +100,15 @@
// Query xml_documents to get list of documents
StringBuffer query = new StringBuffer();
// TODO: make the doctype configurable in the query
- query.append("select docid, rev from xml_documents "
- + "where doctype LIKE 'eml:%' " + "order by docid, rev");
+ String sql =
+ "SELECT xml_documents.docid, xml_documents.rev " +
+ "FROM xml_documents, xml_access " +
+ "WHERE xml_documents.doctype LIKE 'eml:%' " +
+ "AND xml_documents.docid = xml_access.docid " +
+ "AND xml_access.principal_name = 'public' " +
+ "AND xml_access.perm_type = 'allow' " +
+ "order by docid, rev";
+ query.append(sql);
DBConnection dbConn = null;
int serialNumber = -1;
More information about the Metacat-cvs
mailing list