Skip to content
Snippets Groups Projects
Commit 34016a0b authored by ribeaudc's avatar ribeaudc
Browse files

[LMS-493,LMS-474] change: - Sample and Experiment hibernated and moved to...

[LMS-493,LMS-474] change: - Sample and Experiment hibernated and moved to 'lims_base' project. Unit and System Tests broken.

SVN: 8216
parent ca3b2c5c
No related merge requests found
......@@ -20,7 +20,7 @@ import ch.systemsx.cisd.common.exceptions.UserFailureException;
import ch.systemsx.cisd.lims.base.IDataSetService;
import ch.systemsx.cisd.lims.base.ILIMSServiceFactory;
import ch.systemsx.cisd.lims.base.ServiceRegistry;
import ch.systemsx.cisd.lims.base.dto.ExternalData;
import ch.systemsx.cisd.lims.base.dto.ExternalDataPE;
/**
* A <code>IDataSetService</code> implementation.
......@@ -41,7 +41,7 @@ final class DataSetService implements IDataSetService
// IDataSetService
//
public final ExternalData tryGetDataSet(final String sessionToken, final String dataSetCode)
public final ExternalDataPE tryGetDataSet(final String sessionToken, final String dataSetCode)
throws UserFailureException
{
return service.tryGetDataSet(sessionToken, dataSetCode);
......
......@@ -49,8 +49,9 @@ import ch.systemsx.cisd.common.filesystem.FileUtilities;
import ch.systemsx.cisd.common.logging.LogCategory;
import ch.systemsx.cisd.common.logging.LogFactory;
import ch.systemsx.cisd.lims.base.IDataSetService;
import ch.systemsx.cisd.lims.base.dto.ExternalData;
import ch.systemsx.cisd.lims.base.dto.ExternalDataPE;
import ch.systemsx.cisd.lims.base.dto.LocatorType;
import ch.systemsx.cisd.lims.base.dto.LocatorTypePE;
/**
* @author Franz-Josef Elmer
......@@ -203,7 +204,7 @@ public class DatasetDownloadServlet extends HttpServlet
throws UnsupportedEncodingException, IOException
{
String dataSetCode = requestParams.getDataSetCode();
ExternalData dataSet = tryToGetDataSet(session, dataSetCode);
ExternalDataPE dataSet = tryToGetDataSet(session, dataSetCode);
if (dataSet == null)
{
throw new UserFailureException("Unknown data set '" + dataSetCode + "'.");
......@@ -288,7 +289,7 @@ public class DatasetDownloadServlet extends HttpServlet
}
private void renderPage(IRendererFactory rendererFactory, HttpServletResponse response,
ExternalData dataSet, RenderingContext renderingContext) throws IOException
ExternalDataPE dataSet, RenderingContext renderingContext) throws IOException
{
File file = renderingContext.getFile();
if (file.exists() == false)
......@@ -305,7 +306,8 @@ public class DatasetDownloadServlet extends HttpServlet
}
private void createPage(IRendererFactory rendererFactory, HttpServletResponse response,
ExternalData dataSet, RenderingContext renderingContext, File file) throws IOException
ExternalDataPE dataSet, RenderingContext renderingContext, File file)
throws IOException
{
if (operationLog.isInfoEnabled())
{
......@@ -351,7 +353,7 @@ public class DatasetDownloadServlet extends HttpServlet
}
}
private void deliverFile(final HttpServletResponse response, ExternalData dataSet, File file)
private void deliverFile(final HttpServletResponse response, ExternalDataPE dataSet, File file)
throws IOException, FileNotFoundException
{
long size = file.length();
......@@ -391,7 +393,7 @@ public class DatasetDownloadServlet extends HttpServlet
if (sessionIdOrNull != null)
{
IDataSetService dataSetService = applicationContext.getDataSetService();
ExternalData dataSet = dataSetService.tryGetDataSet(sessionIdOrNull, dataSetCode);
ExternalDataPE dataSet = dataSetService.tryGetDataSet(sessionIdOrNull, dataSetCode);
if (operationLog.isInfoEnabled())
{
String actionDesc = (dataSet != null) ? "obtained from" : "not found in";
......@@ -408,10 +410,10 @@ public class DatasetDownloadServlet extends HttpServlet
}
}
private File createDataSetRootDirectory(ExternalData dataSet)
private File createDataSetRootDirectory(ExternalDataPE dataSet)
{
String path = dataSet.getLocation();
LocatorType locatorType = dataSet.getLocatorType();
LocatorTypePE locatorType = dataSet.getLocatorType();
if (locatorType.getCode().equals(LocatorType.DEFAULT_LOCATOR_TYPE_CODE))
{
path = applicationContext.getConfigParameters().getStorePath() + "/" + path;
......@@ -425,24 +427,24 @@ public class DatasetDownloadServlet extends HttpServlet
return dataSetRootDirectory;
}
private void putDataSetToMap(HttpSession session, String dataSetCode, ExternalData dataSet)
private void putDataSetToMap(HttpSession session, String dataSetCode, ExternalDataPE dataSet)
{
getDataSets(session).put(dataSetCode, dataSet);
}
private ExternalData tryToGetDataSet(HttpSession session, String dataSetCode)
private ExternalDataPE tryToGetDataSet(HttpSession session, String dataSetCode)
{
return getDataSets(session).get(dataSetCode);
}
@SuppressWarnings("unchecked")
private Map<String, ExternalData> getDataSets(HttpSession session)
private Map<String, ExternalDataPE> getDataSets(HttpSession session)
{
Map<String, ExternalData> map =
(Map<String, ExternalData>) session.getAttribute(DATA_SET_KEY);
Map<String, ExternalDataPE> map =
(Map<String, ExternalDataPE>) session.getAttribute(DATA_SET_KEY);
if (map == null)
{
map = new HashMap<String, ExternalData>();
map = new HashMap<String, ExternalDataPE>();
session.setAttribute(DATA_SET_KEY, map);
}
return map;
......
......@@ -25,10 +25,10 @@ import org.apache.commons.lang.StringUtils;
import ch.systemsx.cisd.common.exceptions.CheckedExceptionTunnel;
import ch.systemsx.cisd.common.utilities.Template;
import ch.systemsx.cisd.lims.base.dto.Experiment;
import ch.systemsx.cisd.lims.base.dto.ExternalData;
import ch.systemsx.cisd.lims.base.dto.ExperimentPE;
import ch.systemsx.cisd.lims.base.dto.ExternalDataPE;
import ch.systemsx.cisd.lims.base.dto.GroupPE;
import ch.systemsx.cisd.lims.base.dto.Procedure;
import ch.systemsx.cisd.lims.base.dto.ProcedurePE;
import ch.systemsx.cisd.lims.base.dto.ProjectPE;
/**
......@@ -96,12 +96,12 @@ final class HTMLDirectoryRenderer implements IDirectoryRenderer
this.writer = writer;
}
public void printHeader(final ExternalData dataSet)
public void printHeader(final ExternalDataPE dataSet)
{
final String datasetCode = dataSet.getCode();
final String sampleCode = dataSet.getAssociatedSampleCode();
final Procedure procedure = dataSet.getProcedure();
final Experiment experiment = procedure.getExperiment();
final ProcedurePE procedure = dataSet.getProcedure();
final ExperimentPE experiment = procedure.getExperiment();
final String experimentCode = experiment.getCode();
final ProjectPE project = experiment.getProject();
final String projectCode = project.getCode();
......
......@@ -17,7 +17,7 @@
package ch.systemsx.cisd.openbis.datasetdownload;
import ch.systemsx.cisd.lims.base.dto.ExternalData;
import ch.systemsx.cisd.lims.base.dto.ExternalDataPE;
/**
* Interface of a renderer of a directory.
......@@ -26,7 +26,7 @@ import ch.systemsx.cisd.lims.base.dto.ExternalData;
*/
public interface IDirectoryRenderer extends IWriterInjector
{
public void printHeader(ExternalData dataSet);
public void printHeader(ExternalDataPE dataSet);
public void printLinkToParentDirectory(String relativePath);
......
......@@ -20,7 +20,7 @@ import java.io.PrintWriter;
import org.apache.commons.io.FileUtils;
import ch.systemsx.cisd.lims.base.dto.ExternalData;
import ch.systemsx.cisd.lims.base.dto.ExternalDataPE;
/**
* Factory for rendering file system view in plain text.
......@@ -82,7 +82,7 @@ public class PlainTextRendererFactory implements IRendererFactory
{
}
public void printHeader(ExternalData dataSet)
public void printHeader(ExternalDataPE dataSet)
{
writer.println("Directory content:");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment