Revision 5481
Added by berkley almost 14 years ago
src/edu/ucsb/nceas/metacat/restservice/ResourceHandler.java | ||
---|---|---|
281 | 281 |
//a) not system metadata itself |
282 | 282 |
//b) does not already have a system metadata id in the systemmetadata table |
283 | 283 |
//c) not a BIN object (data) |
284 |
//TODO: check if we need this anymore. Might be superceded |
|
285 |
//by MetacatPopulator |
|
284 | 286 |
generateMissingSystemMetadata(); |
285 | 287 |
status = true; |
286 | 288 |
} |
... | ... | |
365 | 367 |
} |
366 | 368 |
else |
367 | 369 |
{ |
370 |
//change to D1 spec for specifying which http methods are allowed for a resource |
|
368 | 371 |
printError("POST, PUT, DELETE is not supported for logs.", response); |
369 | 372 |
status = true; |
370 | 373 |
} |
... | ... | |
687 | 690 |
ObjectFormat objectFormat = null; |
688 | 691 |
boolean replicaStatus = false; |
689 | 692 |
int start = 0; |
693 |
//TODO: make the max count into a const |
|
690 | 694 |
int count = 1000; |
691 | 695 |
Enumeration paramlist = request.getParameterNames(); |
692 | 696 |
while (paramlist.hasMoreElements()) |
... | ... | |
753 | 757 |
*/ |
754 | 758 |
ObjectList ol = cs.listObjects(token, startTime, endTime, |
755 | 759 |
objectFormat, replicaStatus, start, count); |
756 |
ol = cs.listObjects(token, startTime, endTime, objectFormat, replicaStatus, start, count); |
|
760 |
//TODO: why is this calling this twice? |
|
761 |
//ol = cs.listObjects(token, startTime, endTime, objectFormat, replicaStatus, start, count); |
|
757 | 762 |
|
758 | 763 |
StringReader sr = new StringReader(ol.toString()); |
759 | 764 |
out = response.getOutputStream(); |
... | ... | |
845 | 850 |
|
846 | 851 |
// Serialize and write it to the output stream |
847 | 852 |
try { |
853 |
//TODO: look at the efficiency of this method. The system metadata |
|
854 |
//is read from metacat (in CrudService) as xml, then serialized |
|
855 |
//to a SystemMetadat object, then returned here, then serizlized |
|
856 |
//back to XML to be sent to the response. |
|
848 | 857 |
serializeServiceType(SystemMetadata.class, sysmeta, out); |
849 | 858 |
} catch (JiBXException e) { |
850 | 859 |
throw new ServiceFailure("1190", "Failed to serialize SystemMetadata: " + e.getMessage()); |
... | ... | |
986 | 995 |
private Hashtable processMMP(InputStream is) |
987 | 996 |
throws IOException |
988 | 997 |
{ |
989 |
//SORTAHACK: Since mmp seems to have a bug where large object parts get truncated, |
|
998 |
//TODO: verify that this is how the RFC for MMP should work |
|
999 |
//SORTAHACK: Since mmp seems to have a bug where large object parts get truncated, |
|
990 | 1000 |
//parse the stream here. This has the disavantage of putting the |
991 | 1001 |
//stream into memory. |
992 | 1002 |
InputStream object = null; |
src/edu/ucsb/nceas/metacat/dataone/CrudService.java | ||
---|---|---|
610 | 610 |
MetacatResultSet rs = handler.query(metacatUrl, params, username, |
611 | 611 |
groups, sessionid); |
612 | 612 |
List docs = rs.getDocuments(); |
613 |
//TODO: make the max count into a const. See ResourceHandler |
|
614 |
//TODO: does the spec use 1000 as a "return all" flag? |
|
613 | 615 |
if(count == 1000) |
614 | 616 |
{ |
615 | 617 |
count = docs.size(); |
... | ... | |
650 | 652 |
if(dateSMM.indexOf(".") != -1) |
651 | 653 |
{ //strip the milliseconds |
652 | 654 |
//TODO: don't do this. we need milliseconds now. |
655 |
//TODO: explore ISO 8601 to figure out milliseconds |
|
653 | 656 |
dateSMM = dateSMM.substring(0, dateSMM.indexOf(".")) + 'Z'; |
654 | 657 |
} |
655 | 658 |
//System.out.println("dateSMM: " + dateSMM); |
... | ... | |
1110 | 1113 |
/** |
1111 | 1114 |
* get the system metadata for a document with a specified guid. |
1112 | 1115 |
*/ |
1113 |
public SystemMetadata getSystemMetadata(AuthToken token, Identifier guid)
|
|
1116 |
public SystemMetadata getSystemMetadata(AuthToken token, Identifier guid) |
|
1114 | 1117 |
throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, |
1115 | 1118 |
InvalidRequest, NotImplemented { |
1116 | 1119 |
|
... | ... | |
1130 | 1133 |
|
1131 | 1134 |
@Override |
1132 | 1135 |
public String produce(final OutputStream dataSink) throws Exception { |
1136 |
//TODO: change to memory mapped IO so that exceptions get |
|
1137 |
//passed to the response correctly. |
|
1133 | 1138 |
try { |
1134 | 1139 |
String username = "public"; |
1135 | 1140 |
String[] groupnames = null; |
Also available in: Unified diff
new todos from code review with roger