From: <rv...@us...> - 2009-06-25 02:41:35
|
Revision: 107 http://treebase.svn.sourceforge.net/treebase/?rev=107&view=rev Author: rvos Date: 2009-06-25 02:41:29 +0000 (Thu, 25 Jun 2009) Log Message: ----------- Added NeXML->RDF serialization, removed old, commented out code. Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadANexusRCTFileController.java Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadANexusRCTFileController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadANexusRCTFileController.java 2009-06-25 02:40:49 UTC (rev 106) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadANexusRCTFileController.java 2009-06-25 02:41:29 UTC (rev 107) @@ -21,9 +21,6 @@ */ package org.cipres.treebase.web.controllers; -//import java.io.File; -//import java.io.FileWriter; - import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -36,7 +33,6 @@ import org.cipres.treebase.domain.study.StudyService; import org.cipres.treebase.domain.study.Submission; import org.cipres.treebase.web.util.ControllerUtil; -//import org.cipres.treebase.web.util.WebUtil; /** * @author madhu @@ -80,53 +76,6 @@ Submission submission = study.getSubmission(); generateAFileDynamically(pRequest, pResponse, submission.getId()); return null; - -// String fileName = pRequest.getParameter("nexusfile"); -// if (fileName == null) { -// return null; -// } -// -// String nexFileName = (fileName + "rct").replaceAll(TreebaseUtil.ANEMPTYSPACE, "_"); -// -// if (LOGGER.isInfoEnabled()) { -// LOGGER.info("Submission id: " + submission.getId() + ", FileName: " + nexFileName); -// } - -// String downloadDir = pRequest.getSession().getServletContext().getRealPath( -// TreebaseUtil.FILESEP + "NexusFileDownload") -// + TreebaseUtil.FILESEP + pRequest.getRemoteUser(); -// String downloadDir = getDownloadDir(pRequest); -// -// long start = System.currentTimeMillis(); -// -// File dirPath = new File(downloadDir); -// if (!dirPath.exists()) { -// dirPath.mkdirs(); -// } -// -// String pathName = downloadDir + TreebaseUtil.FILESEP + nexFileName; -// File file = new File(pathName); -// -// if (LOGGER.isDebugEnabled()) { -// LOGGER.debug("path=" + pathName); -// } -// -// FileWriter fwriter = new FileWriter(file); -// StringBuilder bldr = new StringBuilder("#NEXUS"); -// bldr.append(TreebaseUtil.getLineSeparators(2)); -// bldr -// .append(getStudyService().generateReconstructedNexusFile(submission.getId(), fileName)); -// -// fwriter.write(bldr.toString()); -// fwriter.close(); -// WebUtil.downloadFile(pResponse, downloadDir, nexFileName); -// -// if (LOGGER.isDebugEnabled()) { -// long end = System.currentTimeMillis(); -// LOGGER.debug(" file download time=" + (end-start)); -// } -// -// return null; } @Override @@ -151,6 +100,11 @@ Study study = mStudyService.findByID(study_id); return getNexmlService().serialize(study); } + else if ( getFormat(request) == FORMAT_RDF ) { + Long study_id = ControllerUtil.getStudyId(request); + Study study = mStudyService.findByID(study_id); + return getRdfaService().serialize(study); + } else { String fileName = request.getParameter("nexusfile"); if (fileName == null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |