From: <rv...@us...> - 2009-06-25 02:26:46
|
Revision: 98 http://treebase.svn.sourceforge.net/treebase/?rev=98&view=rev Author: rvos Date: 2009-06-25 02:26:45 +0000 (Thu, 25 Jun 2009) Log Message: ----------- Added NeXML->RDF serialization Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/AbstractDownloadController.java Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/AbstractDownloadController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/AbstractDownloadController.java 2009-06-24 04:50:43 UTC (rev 97) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/AbstractDownloadController.java 2009-06-25 02:26:45 UTC (rev 98) @@ -15,8 +15,11 @@ protected String mFormatParameter = "format"; protected static final int FORMAT_NEXUS = 1; protected static final int FORMAT_NEXML = 2; + protected static final int FORMAT_RDF = 3; private NexusService mNexmlService; + private NexusService mRdfaService; private static String mNexmlContentType = "application/xml"; + private static String mRdfContentType = "application/rdf+xml"; /** * @@ -29,6 +32,9 @@ if ( requestedFormat.equalsIgnoreCase("nexml") ) { return FORMAT_NEXML; } + else if ( requestedFormat.equalsIgnoreCase("rdf") ) { + return FORMAT_RDF; + } else { return FORMAT_NEXUS; // default } @@ -92,6 +98,9 @@ if ( getFormat(request) == FORMAT_NEXML ) { WebUtil.downloadFile(response, downloadDirName, fileName, mNexmlContentType); } + else if ( getFormat(request) == FORMAT_RDF ) { + WebUtil.downloadFile(response, downloadDirName, fileName, mRdfContentType); + } else { WebUtil.downloadFile(response, downloadDirName, fileName); } @@ -116,4 +125,12 @@ mNexmlService = nexmlService; } + public NexusService getRdfaService() { + return mRdfaService; + } + + public void setRdfaService(NexusService rdfaService) { + mRdfaService = rdfaService; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |