{"action":"created","comment":{"url":"https://api.github.com/repos/geotools/geotools/pulls/comments/23129583","id":23129583,"diff_hunk":"@@ -588,55 +512,230 @@ protected String getOperationURI(WFSOperationType operation, HttpMethod method)\n \n     @Override\n     public Set<String> getServerSupportedOutputFormats(WFSOperationType operation) {\n-        OperationsMetadataType omt = this.capabilities.getOperationsMetadata();\n-        omt.getOperation();\n-\n-        trace(\"Looking suppoerted output formats for \", operation);\n+         String parameterName;\n \n-        List<OperationType> operations = capabilities.getOperationsMetadata().getOperation();\n-        for (OperationType op : operations) {\n-            if (!operation.getName().equals(op.getName())) {\n-                continue;\n-            }\n-\n-            for (Object o : op.getParameter()) {\n-                System.out.println(o);\n+        final Version serviceVersion = getServiceVersion();\n+        final boolean wfs1_0 = Versions.v1_0_0.equals(serviceVersion);\n+        switch (operation) {\n+        case GET_FEATURE:\n+            parameterName = wfs1_0 ? \"ResultFormat\" : \"outputFormat\";\n+            break;\n+        case DESCRIBE_FEATURETYPE:\n+            parameterName = wfs1_0 ? \"SchemaDescriptionLanguage\" : \"outputFormat\";\n+            break;\n+        case GET_FEATURE_WITH_LOCK:\n+            parameterName = wfs1_0 ? \"ResultFormat\" : \"outputFormat\";\n+            break;\n+        case TRANSACTION:\n+            if (wfs1_0) {\n+                //TODO: not sure what to do here.\n+                //this is a hack, there appears to be no format info in the 1.0 capabilities for transaction\n+                operation = GET_FEATURE;\n+                parameterName = \"ResultFormat\";\n+            } else {\n+                parameterName = \"inputFormat\";\n             }\n-\n+            break;\n+        default:\n+            throw new UnsupportedOperationException(\"not yet implemented for \" + operation);\n         }\n-        // TODO Auto-generated method stub\n-        return null;\n+        \n+        final OperationType operationMetadata = getOperationMetadata(operation);\n+\n+        Set<String> serverSupportedFormats;\n+        serverSupportedFormats = findParameters(operationMetadata, parameterName);\n+        return serverSupportedFormats;\n     }\n \n     @Override\n     public Set<String> getServerSupportedOutputFormats(QName typeName, WFSOperationType operation) {\n-        // TODO Auto-generated method stub\n-        return null;\n+        Set<String> ftypeFormats = new HashSet<String>();\n+\n+        final Set<String> serviceOutputFormats = getServerSupportedOutputFormats(operation);\n+        ftypeFormats.addAll(serviceOutputFormats);\n+\n+        if (GET_FEATURE.equals(operation)) {\n+            final FeatureTypeInfo typeInfo = getFeatureTypeInfo(typeName);\n+\n+            final Set<String> typeAdvertisedFormats = typeInfo.getOutputFormats();\n+\n+            ftypeFormats.addAll(typeAdvertisedFormats);\n+        }\n+        return ftypeFormats;\n     }\n \n     @Override\n     public List<String> getClientSupportedOutputFormats(WFSOperationType operation) {\n-        // TODO Auto-generated method stub\n-        return null;\n+        List<WFSResponseFactory> operationResponseFactories;\n+        operationResponseFactories = WFSExtensions.findResponseFactories(operation);\n+\n+        List<String> outputFormats = new LinkedList<String>();\n+        for (WFSResponseFactory factory : operationResponseFactories) {\n+            List<String> factoryFormats = factory.getSupportedOutputFormats();\n+            outputFormats.addAll(factoryFormats);\n+        }\n+\n+        if (GET_FEATURE.equals(operation)) {\n+            for (String preferred : PREFERRED_FORMATS) {\n+                boolean hasFormat = outputFormats.remove(preferred);\n+                if (hasFormat) {\n+                    outputFormats.add(0, preferred);\n+                    break;\n+                }\n+            }\n+        }\n+\n+        return outputFormats;\n     }\n \n     @Override\n     public boolean supportsTransaction(QName typeName) {\n-        // TODO Auto-generated method stub\n-        return false;\n+        try {\n+            getFeatureTypeInfo(typeName);\n+        } catch (IllegalArgumentException e) {\n+            throw e;\n+        }\n+        if (!supportsOperation(TRANSACTION, POST)) {\n+            return false;\n+        }\n+\n+        /*OperationsType operations = this.capabilities.getFeatureTypeList().getOperations();\n+        @SuppressWarnings(\"unchecked\")\n+        List<net.opengis.wfs.OperationType> operation = operations.getOperation();\n+        for (net.opengis.wfs.OperationType required : Arrays.asList(\n+                net.opengis.wfs.OperationType.INSERT_LITERAL,\n+                net.opengis.wfs.OperationType.UPDATE_LITERAL,\n+                net.opengis.wfs.OperationType.DELETE_LITERAL)) {\n+\n+            if (!operation.contains(required)) {\n+                info(\"Transactions not supported since WFS didn't declare support for \"\n+                        + required.getName());\n+                return false;\n+            }\n+        }*/","path":"modules/unsupported/wfs-ng/src/main/java/org/geotools/data/wfs/internal/v2_0/StrictWFS_2_0_Strategy.java","position":416,"original_position":416,"commit_id":"37b5ac0c49185afe9064d23c42ae45be382a0ee9","original_commit_id":"37b5ac0c49185afe9064d23c42ae45be382a0ee9","user":{"login":"jodygarnett","id":629681,"avatar_url":"https://avatars.githubusercontent.com/u/629681?v=3","gravatar_id":"","url":"https://api.github.com/users/jodygarnett","html_url":"https://github.com/jodygarnett","followers_url":"https://api.github.com/users/jodygarnett/followers","following_url":"https://api.github.com/users/jodygarnett/following{/other_user}","gists_url":"https://api.github.com/users/jodygarnett/gists{/gist_id}","starred_url":"https://api.github.com/users/jodygarnett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodygarnett/subscriptions","organizations_url":"https://api.github.com/users/jodygarnett/orgs","repos_url":"https://api.github.com/users/jodygarnett/repos","events_url":"https://api.github.com/users/jodygarnett/events{/privacy}","received_events_url":"https://api.github.com/users/jodygarnett/received_events","type":"User","site_admin":false},"body":"The commented out code here makes a bit more sense to me, expect I am missing the point.","created_at":"2015-01-17T23:57:25Z","updated_at":"2015-01-17T23:57:25Z","html_url":"https://github.com/geotools/geotools/pull/681#discussion_r23129583","pull_request_url":"https://api.github.com/repos/geotools/geotools/pulls/681","_links":{"self":{"href":"https://api.github.com/repos/geotools/geotools/pulls/comments/23129583"},"html":{"href":"https://github.com/geotools/geotools/pull/681#discussion_r23129583"},"pull_request":{"href":"https://api.github.com/repos/geotools/geotools/pulls/681"}}},"pull_request":{"url":"https://api.github.com/repos/geotools/geotools/pulls/681","id":27167285,"html_url":"https://github.com/geotools/geotools/pull/681","diff_url":"https://github.com/geotools/geotools/pull/681.diff","patch_url":"https://github.com/geotools/geotools/pull/681.patch","issue_url":"https://api.github.com/repos/geotools/geotools/issues/681","number":681,"state":"open","locked":false,"title":"Wfs-ng improvements: support getfeature requests to WFS 2.0 server","user":{"login":"NielsCharlier","id":1906115,"avatar_url":"https://avatars.githubusercontent.com/u/1906115?v=3","gravatar_id":"","url":"https://api.github.com/users/NielsCharlier","html_url":"https://github.com/NielsCharlier","followers_url":"https://api.github.com/users/NielsCharlier/followers","following_url":"https://api.github.com/users/NielsCharlier/following{/other_user}","gists_url":"https://api.github.com/users/NielsCharlier/gists{/gist_id}","starred_url":"https://api.github.com/users/NielsCharlier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NielsCharlier/subscriptions","organizations_url":"https://api.github.com/users/NielsCharlier/orgs","repos_url":"https://api.github.com/users/NielsCharlier/repos","events_url":"https://api.github.com/users/NielsCharlier/events{/privacy}","received_events_url":"https://api.github.com/users/NielsCharlier/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-11T19:58:16Z","updated_at":"2015-01-17T23:57:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"01400a545d35f3326eb181a4d3f6d3258d439f9c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/geotools/geotools/pulls/681/commits","review_comments_url":"https://api.github.com/repos/geotools/geotools/pulls/681/comments","review_comment_url":"https://api.github.com/repos/geotools/geotools/pulls/comments/{number}","comments_url":"https://api.github.com/repos/geotools/geotools/issues/681/comments","statuses_url":"https://api.github.com/repos/geotools/geotools/statuses/37b5ac0c49185afe9064d23c42ae45be382a0ee9","head":{"label":"geotools:wfs-ng-improvements-2.0","ref":"wfs-ng-improvements-2.0","sha":"37b5ac0c49185afe9064d23c42ae45be382a0ee9","user":{"login":"geotools","id":1187031,"avatar_url":"https://avatars.githubusercontent.com/u/1187031?v=3","gravatar_id":"","url":"https://api.github.com/users/geotools","html_url":"https://github.com/geotools","followers_url":"https://api.github.com/users/geotools/followers","following_url":"https://api.github.com/users/geotools/following{/other_user}","gists_url":"https://api.github.com/users/geotools/gists{/gist_id}","starred_url":"https://api.github.com/users/geotools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geotools/subscriptions","organizations_url":"https://api.github.com/users/geotools/orgs","repos_url":"https://api.github.com/users/geotools/repos","events_url":"https://api.github.com/users/geotools/events{/privacy}","received_events_url":"https://api.github.com/users/geotools/received_events","type":"Organization","site_admin":false},"repo":{"id":2752522,"name":"geotools","full_name":"geotools/geotools","owner":{"login":"geotools","id":1187031,"avatar_url":"https://avatars.githubusercontent.com/u/1187031?v=3","gravatar_id":"","url":"https://api.github.com/users/geotools","html_url":"https://github.com/geotools","followers_url":"https://api.github.com/users/geotools/followers","following_url":"https://api.github.com/users/geotools/following{/other_user}","gists_url":"https://api.github.com/users/geotools/gists{/gist_id}","starred_url":"https://api.github.com/users/geotools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geotools/subscriptions","organizations_url":"https://api.github.com/users/geotools/orgs","repos_url":"https://api.github.com/users/geotools/repos","events_url":"https://api.github.com/users/geotools/events{/privacy}","received_events_url":"https://api.github.com/users/geotools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geotools/geotools","description":"Official GeoTools repository","fork":false,"url":"https://api.github.com/repos/geotools/geotools","forks_url":"https://api.github.com/repos/geotools/geotools/forks","keys_url":"https://api.github.com/repos/geotools/geotools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geotools/geotools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geotools/geotools/teams","hooks_url":"https://api.github.com/repos/geotools/geotools/hooks","issue_events_url":"https://api.github.com/repos/geotools/geotools/issues/events{/number}","events_url":"https://api.github.com/repos/geotools/geotools/events","assignees_url":"https://api.github.com/repos/geotools/geotools/assignees{/user}","branches_url":"https://api.github.com/repos/geotools/geotools/branches{/branch}","tags_url":"https://api.github.com/repos/geotools/geotools/tags","blobs_url":"https://api.github.com/repos/geotools/geotools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geotools/geotools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geotools/geotools/git/refs{/sha}","trees_url":"https://api.github.com/repos/geotools/geotools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geotools/geotools/statuses/{sha}","languages_url":"https://api.github.com/repos/geotools/geotools/languages","stargazers_url":"https://api.github.com/repos/geotools/geotools/stargazers","contributors_url":"https://api.github.com/repos/geotools/geotools/contributors","subscribers_url":"https://api.github.com/repos/geotools/geotools/subscribers","subscription_url":"https://api.github.com/repos/geotools/geotools/subscription","commits_url":"https://api.github.com/repos/geotools/geotools/commits{/sha}","git_commits_url":"https://api.github.com/repos/geotools/geotools/git/commits{/sha}","comments_url":"https://api.github.com/repos/geotools/geotools/comments{/number}","issue_comment_url":"https://api.github.com/repos/geotools/geotools/issues/comments/{number}","contents_url":"https://api.github.com/repos/geotools/geotools/contents/{+path}","compare_url":"https://api.github.com/repos/geotools/geotools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geotools/geotools/merges","archive_url":"https://api.github.com/repos/geotools/geotools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geotools/geotools/downloads","issues_url":"https://api.github.com/repos/geotools/geotools/issues{/number}","pulls_url":"https://api.github.com/repos/geotools/geotools/pulls{/number}","milestones_url":"https://api.github.com/repos/geotools/geotools/milestones{/number}","notifications_url":"https://api.github.com/repos/geotools/geotools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geotools/geotools/labels{/name}","releases_url":"https://api.github.com/repos/geotools/geotools/releases{/id}","created_at":"2011-11-10T23:22:12Z","updated_at":"2015-01-17T09:58:22Z","pushed_at":"2015-01-17T09:58:22Z","git_url":"git://github.com/geotools/geotools.git","ssh_url":"git@github.com:geotools/geotools.git","clone_url":"https://github.com/geotools/geotools.git","svn_url":"https://github.com/geotools/geotools","homepage":"http://geotools.org","size":211144,"stargazers_count":170,"watchers_count":170,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":252,"mirror_url":null,"open_issues_count":12,"forks":252,"open_issues":12,"watchers":170,"default_branch":"master"}},"base":{"label":"geotools:master","ref":"master","sha":"aec2ba81f7727c1a73f6fc10c92e68b8124a7704","user":{"login":"geotools","id":1187031,"avatar_url":"https://avatars.githubusercontent.com/u/1187031?v=3","gravatar_id":"","url":"https://api.github.com/users/geotools","html_url":"https://github.com/geotools","followers_url":"https://api.github.com/users/geotools/followers","following_url":"https://api.github.com/users/geotools/following{/other_user}","gists_url":"https://api.github.com/users/geotools/gists{/gist_id}","starred_url":"https://api.github.com/users/geotools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geotools/subscriptions","organizations_url":"https://api.github.com/users/geotools/orgs","repos_url":"https://api.github.com/users/geotools/repos","events_url":"https://api.github.com/users/geotools/events{/privacy}","received_events_url":"https://api.github.com/users/geotools/received_events","type":"Organization","site_admin":false},"repo":{"id":2752522,"name":"geotools","full_name":"geotools/geotools","owner":{"login":"geotools","id":1187031,"avatar_url":"https://avatars.githubusercontent.com/u/1187031?v=3","gravatar_id":"","url":"https://api.github.com/users/geotools","html_url":"https://github.com/geotools","followers_url":"https://api.github.com/users/geotools/followers","following_url":"https://api.github.com/users/geotools/following{/other_user}","gists_url":"https://api.github.com/users/geotools/gists{/gist_id}","starred_url":"https://api.github.com/users/geotools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geotools/subscriptions","organizations_url":"https://api.github.com/users/geotools/orgs","repos_url":"https://api.github.com/users/geotools/repos","events_url":"https://api.github.com/users/geotools/events{/privacy}","received_events_url":"https://api.github.com/users/geotools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geotools/geotools","description":"Official GeoTools repository","fork":false,"url":"https://api.github.com/repos/geotools/geotools","forks_url":"https://api.github.com/repos/geotools/geotools/forks","keys_url":"https://api.github.com/repos/geotools/geotools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geotools/geotools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geotools/geotools/teams","hooks_url":"https://api.github.com/repos/geotools/geotools/hooks","issue_events_url":"https://api.github.com/repos/geotools/geotools/issues/events{/number}","events_url":"https://api.github.com/repos/geotools/geotools/events","assignees_url":"https://api.github.com/repos/geotools/geotools/assignees{/user}","branches_url":"https://api.github.com/repos/geotools/geotools/branches{/branch}","tags_url":"https://api.github.com/repos/geotools/geotools/tags","blobs_url":"https://api.github.com/repos/geotools/geotools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geotools/geotools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geotools/geotools/git/refs{/sha}","trees_url":"https://api.github.com/repos/geotools/geotools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geotools/geotools/statuses/{sha}","languages_url":"https://api.github.com/repos/geotools/geotools/languages","stargazers_url":"https://api.github.com/repos/geotools/geotools/stargazers","contributors_url":"https://api.github.com/repos/geotools/geotools/contributors","subscribers_url":"https://api.github.com/repos/geotools/geotools/subscribers","subscription_url":"https://api.github.com/repos/geotools/geotools/subscription","commits_url":"https://api.github.com/repos/geotools/geotools/commits{/sha}","git_commits_url":"https://api.github.com/repos/geotools/geotools/git/commits{/sha}","comments_url":"https://api.github.com/repos/geotools/geotools/comments{/number}","issue_comment_url":"https://api.github.com/repos/geotools/geotools/issues/comments/{number}","contents_url":"https://api.github.com/repos/geotools/geotools/contents/{+path}","compare_url":"https://api.github.com/repos/geotools/geotools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geotools/geotools/merges","archive_url":"https://api.github.com/repos/geotools/geotools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geotools/geotools/downloads","issues_url":"https://api.github.com/repos/geotools/geotools/issues{/number}","pulls_url":"https://api.github.com/repos/geotools/geotools/pulls{/number}","milestones_url":"https://api.github.com/repos/geotools/geotools/milestones{/number}","notifications_url":"https://api.github.com/repos/geotools/geotools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geotools/geotools/labels{/name}","releases_url":"https://api.github.com/repos/geotools/geotools/releases{/id}","created_at":"2011-11-10T23:22:12Z","updated_at":"2015-01-17T09:58:22Z","pushed_at":"2015-01-17T09:58:22Z","git_url":"git://github.com/geotools/geotools.git","ssh_url":"git@github.com:geotools/geotools.git","clone_url":"https://github.com/geotools/geotools.git","svn_url":"https://github.com/geotools/geotools","homepage":"http://geotools.org","size":211144,"stargazers_count":170,"watchers_count":170,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":252,"mirror_url":null,"open_issues_count":12,"forks":252,"open_issues":12,"watchers":170,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/geotools/geotools/pulls/681"},"html":{"href":"https://github.com/geotools/geotools/pull/681"},"issue":{"href":"https://api.github.com/repos/geotools/geotools/issues/681"},"comments":{"href":"https://api.github.com/repos/geotools/geotools/issues/681/comments"},"review_comments":{"href":"https://api.github.com/repos/geotools/geotools/pulls/681/comments"},"review_comment":{"href":"https://api.github.com/repos/geotools/geotools/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/geotools/geotools/pulls/681/commits"},"statuses":{"href":"https://api.github.com/repos/geotools/geotools/statuses/37b5ac0c49185afe9064d23c42ae45be382a0ee9"}}}}