public List<IServiceInfo> getAvailableActions(FormatInfo sourceFormat) throws PlatoException {
List<PreservationActionService> services = registry.findServices(sourceFormat, null);
ArrayList<IServiceInfo> result = new ArrayList<IServiceInfo>();
for (PreservationActionService service : services) {
ActionInfo def = new ActionInfo();
def.setShortname(service.getName());
if (service.getTargetFormat() != null) {
def.setTargetFormat(service.getTargetFormat().getDefaultExtension());
def.setTargetFormatInfo(service.getTargetFormat());
}
def.setInfo(service.getDescription());
def.setUrl(service.getUrl());
def.setDescriptor(service.getDescriptor());
if (service.isMigration())
def.setServiceIdentifier("MiniMEE-migration");
else {
def.setEmulated(true);
def.setServiceIdentifier("MiniMEE-emulation");
// TODO: refine setting type according to sourceFormat
if ("avi".equals(sourceFormat.getDefaultExtension())
|| "mpg".equals(sourceFormat.getDefaultExtension())
|| "mpeg".equals(sourceFormat.getDefaultExtension())) {
def.setParamByName("filetype", "1");
} else if ("jpg".equals(sourceFormat.getDefaultExtension())
|| "gif".equals(sourceFormat.getDefaultExtension())
|| "tif".equals(sourceFormat.getDefaultExtension())) {
def.setParamByName("filetype", "2");
} else if ("pdf".equals(sourceFormat.getDefaultExtension())
|| "sam".equals(sourceFormat.getDefaultExtension())) {
def.setParamByName("filetype", "3");
}
}
result.add(def);
}