public QName getStoredQueryReturnType(String storedQueryId) throws IOException { ListStoredQueriesResponseType list = getStoredQueryListResponse(); for (StoredQueryListItemType query : list.getStoredQuery()) { if (query.getId().equals(storedQueryId)) { return query.getReturnFeatureType().get(0); } } throw new IOException("Unknown stored query " + storedQueryId); }
protected List<StoredQueryListItemType> listStoredQueries() { try { WFSDataStore contentStore = getContentDataStore(); return contentStore.getStoredQueryListResponse().getStoredQuery(); } catch (IOException ie) { throw new RuntimeException("Uanble to list stored queries", ie); } }
public QName getStoredQueryReturnType(String storedQueryId) throws IOException { ListStoredQueriesResponseType list = getStoredQueryListResponse(); for (StoredQueryListItemType query : list.getStoredQuery()) { if (query.getId().equals(storedQueryId)) { return query.getReturnFeatureType().get(0); } } throw new IOException("Unknown stored query " + storedQueryId); }
@Override protected void encode(Encoder encoder, Object value, OutputStream output, Operation op) throws IOException, ServiceException { // check the returned types, they are qnames and we need to declare their prefixes ListStoredQueriesResponseType response = (ListStoredQueriesResponseType) value; for (StoredQueryListItemType sq : response.getStoredQuery()) { if (sq.getReturnFeatureType() != null) { for (QName qName : sq.getReturnFeatureType()) { if (qName.getNamespaceURI() != null && qName.getPrefix() != null) { encoder.getNamespaces() .declarePrefix(qName.getPrefix(), qName.getNamespaceURI()); } } } } encoder.encode(value, WFS.ListStoredQueriesResponse, output); } }
response.getStoredQuery().add(item);