C. How to customize a Job ?
2. Date format
According to the IVOA Recommendation, all Job dates must have a format compatible with the standard ISO-8601.
By default AbstractJob follows this standard by using the format yyyy-MM-dd'T'HH:mm:ss.SSSZ. It is stored in the attribute DEFAULT_DATE_FORMAT, and is used to parse it when the user sets/updates an attribute of type Date, and to format it when a date has to be displayed (particularly during the serialization of a Job).
This date format can be changed thanks to the method setDateFormat(DateFormat). Here is an example of how to use it:
public class JobChvatal extends AbstractJob { ... public JobChvatal(Map<String, String> lstParam) throws UWSException { super(lstParam); setDateFormat(new SimpleDateFormat("dd/MM/yyyy HH:mm:ss.SSS")); } ... }
Thus any date of Chvatal jobs must follow the format: dd/MM/yyyy HH:mm:ss.SSS (ex: instead of "2011-01-18T16:50:12.163+0100" , we must have "18/01/2011 16:50:12.163").
Warning !
All job attributes given in a HTTP request must have the same format than the one defined in the implied type of Job !