211 |
211 |
private static final String FUNCTION_NAME_UPDATE = "update";
|
212 |
212 |
private static final String FUNCTION_NAME_GENERATE_MISSING_SYSTEM_METADATA = "generatemissingsystemmetadata";
|
213 |
213 |
|
|
214 |
private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss'Z'");
|
|
215 |
|
214 |
216 |
private ServletContext servletContext;
|
215 |
217 |
private Logger logMetacat;
|
216 |
218 |
private MetacatHandler handler;
|
... | ... | |
402 |
404 |
SimpleDateFormat sdf = new SimpleDateFormat();
|
403 |
405 |
if(fromDateS != null)
|
404 |
406 |
{
|
405 |
|
fromDate = new Date(new Long(fromDateS).longValue());//sdf.parse(fromDateS, new ParsePosition(0));
|
|
407 |
//fromDate = new Date(new Long(fromDateS).longValue());//sdf.parse(fromDateS, new ParsePosition(0));
|
|
408 |
fromDate = dateFormat.parse(fromDateS);
|
406 |
409 |
}
|
407 |
410 |
if(toDateS != null)
|
408 |
411 |
{
|
409 |
|
toDate = new Date(new Long(toDateS).longValue());//sdf.parse(toDateS, new ParsePosition(0));
|
|
412 |
//toDate = new Date(new Long(toDateS).longValue());//sdf.parse(toDateS, new ParsePosition(0));
|
|
413 |
toDate = dateFormat.parse(toDateS);
|
410 |
414 |
}
|
411 |
415 |
if(eventS != null)
|
412 |
416 |
{
|
... | ... | |
633 |
637 |
{ //parse the params and make the crud call
|
634 |
638 |
String name = (String) paramlist.nextElement();
|
635 |
639 |
String[] value = (String[])request.getParameterValues(name);
|
636 |
|
for(int i=0; i<value.length; i++)
|
|
640 |
/*for(int i=0; i<value.length; i++)
|
637 |
641 |
{
|
638 |
642 |
System.out.println("name: " + name + " value: " + value[i]);
|
639 |
|
}
|
|
643 |
}*/
|
640 |
644 |
if(name.equals("startTime") && value != null)
|
641 |
645 |
{
|
642 |
646 |
try
|
643 |
647 |
{
|
644 |
|
startTime = DateFormat.getDateTimeInstance().parse(value[0]);
|
|
648 |
startTime = dateFormat.parse(value[0]);
|
645 |
649 |
}
|
646 |
650 |
catch(Exception e)
|
647 |
651 |
{ //if we can't parse it, just don't use the startTime param
|
... | ... | |
653 |
657 |
{
|
654 |
658 |
try
|
655 |
659 |
{
|
656 |
|
endTime = DateFormat.getDateTimeInstance().parse(value[0]);
|
|
660 |
endTime = dateFormat.parse(value[0]);
|
657 |
661 |
}
|
658 |
662 |
catch(Exception e)
|
659 |
663 |
{ //if we can't parse it, just don't use the endTime param
|
... | ... | |
696 |
700 |
StringReader sr = new StringReader(ol.toString());
|
697 |
701 |
out = response.getOutputStream();
|
698 |
702 |
// Serialize and write it to the output stream
|
|
703 |
System.out.println("list size: " + ol.sizeObjectInfoList());
|
|
704 |
|
699 |
705 |
try {
|
700 |
706 |
serializeServiceType(ObjectList.class, ol, out);
|
701 |
707 |
} catch (JiBXException e) {
|
... | ... | |
705 |
711 |
} catch (BaseException e) {
|
706 |
712 |
serializeException(e, out);
|
707 |
713 |
} catch (IOException e) {
|
708 |
|
ServiceFailure sf = new ServiceFailure("1030", e.getMessage());
|
|
714 |
e.printStackTrace();
|
|
715 |
ServiceFailure sf = new ServiceFailure("1030",
|
|
716 |
"Error in ResourceHandler.getObject: " + e.getMessage());
|
709 |
717 |
serializeException(sf, out);
|
710 |
718 |
}
|
711 |
719 |
}
|
... | ... | |
734 |
742 |
} catch (BaseException e) {
|
735 |
743 |
serializeException(e, out);
|
736 |
744 |
} catch (IOException e) {
|
737 |
|
ServiceFailure sf = new ServiceFailure("1030", e.getMessage());
|
|
745 |
ServiceFailure sf = new ServiceFailure("1030",
|
|
746 |
"Error in ResourceHandler.getSystemMetadataObject: " + e.getMessage());
|
738 |
747 |
serializeException(sf, out);
|
739 |
748 |
} finally {
|
740 |
749 |
IOUtils.closeQuietly(out);
|
fixed listObject bugs, added params to the listObjects rest interface, consolidated the date format passed in params