/** * Delivers all ProcessDescriptions from a WPS * * @param wpsUrl the URL of the WPS * @return An Array of ProcessDescriptions * @throws IOException */ public ProcessDescriptionType[] getAllProcessDescriptions(String wpsUrl) throws IOException{ return getProcessDescriptionsFromCache(wpsUrl).getProcessDescriptions().getProcessDescriptionArray(); }
private ProcessDescriptionType loadProcessDescription(File describeProcessFile){ try { InputStream xmlDesc = new FileInputStream(describeProcessFile); XmlOptions option = new XmlOptions(); option.setLoadTrimTextBuffer(); ProcessDescriptionsDocument doc = ProcessDescriptionsDocument.Factory.parse(xmlDesc, option); if(doc.getProcessDescriptions().getProcessDescriptionArray().length == 0) { LOGGER.warn("ProcessDescription is empty! " + describeProcessFile.getName()); return null; } return doc.getProcessDescriptions().getProcessDescriptionArray(0); } catch(IOException e) { LOGGER.warn("Could not initialize algorithm, parsing error! " + describeProcessFile.getName(), e); } catch(XmlException e) { LOGGER.warn("Could not initialize algorithm, parsing error! " + describeProcessFile.getName(), e); } return null; }
private static ProcessDescriptionType createProcessDescription (File describeProcessFile){ try { InputStream xmlDesc = new FileInputStream(describeProcessFile); XmlOptions option = new XmlOptions(); option.setLoadTrimTextBuffer(); ProcessDescriptionsDocument doc = ProcessDescriptionsDocument.Factory.parse(xmlDesc, option); if(doc.getProcessDescriptions().getProcessDescriptionArray().length == 0) { LOGGER.warn("ProcessDescription is empty!"); return null; } return doc.getProcessDescriptions().getProcessDescriptionArray(0); } catch(IOException e) { LOGGER.warn("Could not initialize algorithm, parsing error! ", e); } catch(XmlException e) { LOGGER.warn("Could not initialize algorithm, parsing error! ", e); } return null; }
/** * return the processDescription for a specific process from Cache. * @param serverID * @param processID * @return a ProcessDescription for a specific process from Cache. * @throws IOException */ public ProcessDescriptionType getProcessDescription(String serverID, String processID) throws IOException { ProcessDescriptionType[] processes = getProcessDescriptionsFromCache(serverID).getProcessDescriptions().getProcessDescriptionArray(); for(ProcessDescriptionType process : processes) { if(process.getIdentifier().getStringValue().equals(processID)) { return process; } } return null; }
public String[] getProcessNames(String url) throws IOException { ProcessDescriptionType[] processes = getProcessDescriptionsFromCache(url).getProcessDescriptions().getProcessDescriptionArray(); String[] processNames = new String[processes.length]; for(int i = 0; i<processNames.length; i++){ processNames[i] = processes[i].getIdentifier().getStringValue(); } return processNames; }
if (processDescriptionDocument.getProcessDescriptions().getProcessDescriptionArray().length == 0) ProcessDescriptionType processDescription = processDescriptionDocument.getProcessDescriptions().getProcessDescriptionArray(0);
document.getProcessDescriptions().setLang(WebProcessingService.DEFAULT_LANGUAGE); document.getProcessDescriptions().setService("WPS"); document.getProcessDescriptions().setVersion(Request.SUPPORTED_VERSION); document.getProcessDescriptions().addNewProcessDescription().set(description);