[GitHub] jena pull request #433: JENA-1561: Enable TDB2 in Fuseki UI and on the comma...

2018-06-12 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/jena/pull/433


---


[GitHub] jena pull request #433: JENA-1561: Enable TDB2 in Fuseki UI and on the comma...

2018-06-11 Thread afs
Github user afs commented on a diff in the pull request:

https://github.com/apache/jena/pull/433#discussion_r194399246
  
--- Diff: 
jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/mgt/ActionDatasets.java
 ---
@@ -351,15 +356,13 @@ private static void assemblerFromForm(HttpAction 
action, StreamRDF dest) {
 FusekiSystem.addGlobals(params); 
 
 //action.log.info(format("[%d] Create database : name = %s, type = 
%s", action.id, dbName, dbType )) ;
-if ( ! dbType.equals(tDatabasetTDB) && ! 
dbType.equals(tDatabasetMem) )
-ServletOps.errorBadRequest(format("dbType can be only '%s' or 
'%s'", tDatabasetTDB, tDatabasetMem)) ;
 
-String template = null ;
-if ( dbType.equalsIgnoreCase(tDatabasetTDB))
-template = 
TemplateFunctions.templateFile(Template.templateTDBFN, params, Lang.TTL) ;
-if ( dbType.equalsIgnoreCase(tDatabasetMem))
-template = 
TemplateFunctions.templateFile(Template.templateMemFN, params, Lang.TTL) ;
-RDFParser.create().source(new 
StringReader(template)).base("http://base/;).lang(Lang.TTL).parse(dest);
+String template = 
dbTypeToTemplate.get(dbType.toLowerCase(Locale.ROOT));
+if ( template == null )
+ServletOps.errorBadRequest(format("dbType can be only '%s' 
or '%s'", tDatabaseTDB, tDatabaseMem)) ;
--- End diff --

Good point! Done.


---


[GitHub] jena pull request #433: JENA-1561: Enable TDB2 in Fuseki UI and on the comma...

2018-06-11 Thread rvesse
Github user rvesse commented on a diff in the pull request:

https://github.com/apache/jena/pull/433#discussion_r194342614
  
--- Diff: 
jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/mgt/ActionDatasets.java
 ---
@@ -351,15 +356,13 @@ private static void assemblerFromForm(HttpAction 
action, StreamRDF dest) {
 FusekiSystem.addGlobals(params); 
 
 //action.log.info(format("[%d] Create database : name = %s, type = 
%s", action.id, dbName, dbType )) ;
-if ( ! dbType.equals(tDatabasetTDB) && ! 
dbType.equals(tDatabasetMem) )
-ServletOps.errorBadRequest(format("dbType can be only '%s' or 
'%s'", tDatabasetTDB, tDatabasetMem)) ;
 
-String template = null ;
-if ( dbType.equalsIgnoreCase(tDatabasetTDB))
-template = 
TemplateFunctions.templateFile(Template.templateTDBFN, params, Lang.TTL) ;
-if ( dbType.equalsIgnoreCase(tDatabasetMem))
-template = 
TemplateFunctions.templateFile(Template.templateMemFN, params, Lang.TTL) ;
-RDFParser.create().source(new 
StringReader(template)).base("http://base/;).lang(Lang.TTL).parse(dest);
+String template = 
dbTypeToTemplate.get(dbType.toLowerCase(Locale.ROOT));
+if ( template == null )
+ServletOps.errorBadRequest(format("dbType can be only '%s' 
or '%s'", tDatabaseTDB, tDatabaseMem)) ;
--- End diff --

This PR now allows three possibilities so the error message is now 
inaccurate


---


[GitHub] jena pull request #433: JENA-1561: Enable TDB2 in Fuseki UI and on the comma...

2018-06-09 Thread afs
GitHub user afs opened a pull request:

https://github.com/apache/jena/pull/433

JENA-1561: Enable TDB2 in Fuseki UI and on the command line.

Both full and basic server command line code.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/afs/jena fuseki-tdb2

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/jena/pull/433.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #433


commit df2e9838f513de6a515c2d3b9c9985466ccc26f8
Author: Andy Seaborne 
Date:   2018-06-09T18:07:10Z

JENA-1561: Enable TDB2 in UI and command line.




---