Revision 4123
Added by daigle over 16 years ago
src/edu/ucsb/nceas/metacat/MetacatReplication.java | ||
---|---|---|
1489 | 1489 |
// system id may not have server url on front. Add it if not. |
1490 | 1490 |
String systemID = rs.getString(5); |
1491 | 1491 |
if (!systemID.startsWith("http://")) { |
1492 |
systemID = SystemUtil.getServerURL() + systemID;
|
|
1492 |
systemID = SystemUtil.getContextURL() + systemID;
|
|
1493 | 1493 |
} |
1494 | 1494 |
sb.append("</public_id><system_id>").append(systemID); |
1495 | 1495 |
sb.append("</system_id></row>"); |
src/edu/ucsb/nceas/metacat/DocumentIdQuery.java | ||
---|---|---|
24 | 24 |
package edu.ucsb.nceas.metacat; |
25 | 25 |
|
26 | 26 |
import java.io.File; |
27 |
import java.io.IOException; |
|
28 | 27 |
import java.util.Hashtable; |
29 | 28 |
|
30 |
import edu.ucsb.nceas.utilities.Options; |
|
29 |
import edu.ucsb.nceas.metacat.service.PropertyService; |
|
30 |
import edu.ucsb.nceas.metacat.service.ServiceException; |
|
31 | 31 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
32 | 32 |
|
33 | 33 |
/** |
... | ... | |
119 | 119 |
public static void main(String[] args) |
120 | 120 |
{ |
121 | 121 |
String CONFIG_DIR = "lib"; |
122 |
String CONFIG_NAME = "metacat.properties"; |
|
123 | 122 |
File dirPath = new File(CONFIG_DIR); |
124 |
File propertyFile = new File(dirPath, CONFIG_NAME); |
|
125 |
Options options = null; |
|
126 | 123 |
try { |
127 |
options = Options.initialize(propertyFile);
|
|
128 |
} catch (IOException ioe) {
|
|
129 |
System.err.println("Error in loading options: "
|
|
124 |
PropertyService.getInstance(dirPath.getPath());
|
|
125 |
} catch (ServiceException ioe) {
|
|
126 |
System.err.println("Error in loading properties: "
|
|
130 | 127 |
+ ioe.getMessage()); |
131 | 128 |
} |
132 | 129 |
|
src/edu/ucsb/nceas/metacat/DocumentImpl.java | ||
---|---|---|
1811 | 1811 |
this.system_id = rs.getString(1); |
1812 | 1812 |
// system id may not have server url on front. Add it if not. |
1813 | 1813 |
if (!system_id.startsWith("http://")) { |
1814 |
system_id = SystemUtil.getServerURL() + system_id;
|
|
1814 |
system_id = SystemUtil.getContextURL() + system_id;
|
|
1815 | 1815 |
} |
1816 | 1816 |
this.validateType = rs.getString(2); |
1817 | 1817 |
|
src/edu/ucsb/nceas/metacat/DBUtil.java | ||
---|---|---|
195 | 195 |
systemID = rs.getString(1); |
196 | 196 |
// system id may not have server url on front. Add it if not. |
197 | 197 |
if (!systemID.startsWith("http://")) { |
198 |
systemID = SystemUtil.getServerURL() + systemID;
|
|
198 |
systemID = SystemUtil.getContextURL() + systemID;
|
|
199 | 199 |
} |
200 | 200 |
} else { |
201 | 201 |
throw new SQLException("Non-registered doctype: " + doctype); |
src/edu/ucsb/nceas/metacat/DBEntityResolver.java | ||
---|---|---|
213 | 213 |
systemid = rs.getString(1); |
214 | 214 |
// system id may not have server url on front. Add it if not. |
215 | 215 |
if (!systemid.startsWith("http://")) { |
216 |
systemid = SystemUtil.getServerURL() + systemid;
|
|
216 |
systemid = SystemUtil.getContextURL() + systemid;
|
|
217 | 217 |
} |
218 | 218 |
} |
219 | 219 |
stmt.close(); |
src/edu/ucsb/nceas/metacat/SchemaLocationResolver.java | ||
---|---|---|
160 | 160 |
// system id may not have server url on front. Add it if not. |
161 | 161 |
if (!location.startsWith("http://")) { |
162 | 162 |
try { |
163 |
location = SystemUtil.getServerURL() + location;
|
|
163 |
location = SystemUtil.getContextURL() + location;
|
|
164 | 164 |
} catch (PropertyNotFoundException pnfe) { |
165 | 165 |
throw new SQLException("Could not find property: " |
166 | 166 |
+ pnfe.getMessage()); |
src/edu/ucsb/nceas/metacat/AccessControlList.java | ||
---|---|---|
948 | 948 |
systemID = rs.getString(1); |
949 | 949 |
// system id may not have server url on front. Add it if not. |
950 | 950 |
if (!systemID.startsWith("http://")) { |
951 |
systemID = SystemUtil.getServerURL() + systemID;
|
|
951 |
systemID = SystemUtil.getContextURL() + systemID;
|
|
952 | 952 |
} |
953 | 953 |
} |
954 | 954 |
|
Also available in: Unified diff
Append context url onto system id instead of server url.