Skip to content
Snippets Groups Projects
Commit af1b419a authored by buczekp's avatar buczekp
Browse files

[SE-255] cifex data set info extractor extension

SVN: 16274
parent 4ec9f10f
No related merge requests found
......@@ -46,10 +46,10 @@ notify-successful-registration = false
server-url = https://localhost:8443/
# The username to use when contacting the openBIS server
username = etlserver
username = etlserver_csb
# The password to use when contacting the openBIS server
password = etlserver
password = etlserver_csb
# The base URL for Web client access.
download-url = https://localhost:8444
......@@ -93,7 +93,7 @@ main-thread.incoming-dir = data/incoming
main-thread.incoming-data-completeness-condition = auto-detection
# ---------------- Plugin properties
# The extractor class to use for code extraction
main-thread.data-set-info-extractor = ch.ethz.bsse.cisd.plasmid.dss.PlasmidDataSetInfoExtractor
main-thread.data-set-info-extractor = ch.ethz.bsse.cisd.plasmid.dss.PlasmidDefaultDataSetInfoExtractor
main-thread.data-set-info-extractor.space-code = YEAST_LAB
# The extractor class to use for type extraction
......@@ -111,7 +111,7 @@ main-thread.dataset-handler = ch.ethz.bsse.cisd.plasmid.dss.PlasmidDataSetHandle
cifex.incoming-dir = data/incoming-cifex
cifex.incoming-data-completeness-condition = auto-detection
cifex.delete-unidentified = true
cifex.data-set-info-extractor = ch.systemsx.cisd.etlserver.cifex.CifexDataSetInfoExtractor
cifex.data-set-info-extractor = ch.ethz.bsse.cisd.plasmid.dss.PlasmidCifexDataSetInfoExtractor
cifex.type-extractor = ch.systemsx.cisd.etlserver.cifex.CifexTypeExtractor
cifex.storage-processor = ch.systemsx.cisd.etlserver.CifexStorageProcessor
cifex.storage-processor.processor = ch.systemsx.cisd.etlserver.DefaultStorageProcessor
......
......@@ -53,10 +53,10 @@ notify-successful-registration = false
server-url = http://localhost:8888
# The username to use when contacting the openBIS server
username = etlserver
username = etlserver_csb
# The password to use when contacting the openBIS server
password = etlserver
password = etlserver_csb
# The base URL for Web client access.
download-url = http://localhost:${port}
......@@ -99,7 +99,7 @@ main-thread.incoming-dir = ${data-folder}/incoming
main-thread.incoming-data-completeness-condition = auto-detection
# ---------------- Plugin properties
# The extractor class to use for code extraction
main-thread.data-set-info-extractor = ch.ethz.bsse.cisd.plasmid.dss.PlasmidDataSetInfoExtractor
main-thread.data-set-info-extractor = ch.ethz.bsse.cisd.plasmid.dss.PlasmidDefaultDataSetInfoExtractor
main-thread.data-set-info-extractor.space-code = YEAST_LAB
# The extractor class to use for type extraction
......@@ -117,7 +117,7 @@ main-thread.dataset-handler = ch.ethz.bsse.cisd.plasmid.dss.PlasmidDataSetHandle
cifex.incoming-dir = ${data-folder}/incoming-cifex
cifex.incoming-data-completeness-condition = auto-detection
cifex.delete-unidentified = true
cifex.data-set-info-extractor = ch.systemsx.cisd.etlserver.cifex.CifexDataSetInfoExtractor
cifex.data-set-info-extractor = ch.ethz.bsse.cisd.plasmid.dss.PlasmidCifexDataSetInfoExtractor
cifex.type-extractor = ch.systemsx.cisd.etlserver.cifex.CifexTypeExtractor
cifex.storage-processor = ch.systemsx.cisd.etlserver.CifexStorageProcessor
cifex.storage-processor.processor = ch.systemsx.cisd.etlserver.DefaultStorageProcessor
......
/*
* Copyright 2010 ETH Zuerich, CISD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ch.ethz.bsse.cisd.plasmid.dss;
import java.io.File;
import org.apache.commons.io.FilenameUtils;
import ch.systemsx.cisd.openbis.generic.shared.dto.NewProperty;
/**
* Helper class for creation of data set property of type {@code FILE_NAME} holding name of the file
* stored for the data set.
*
* @author Piotr Buczek
*/
class DataSetFileNamePropertyHelper
{
private final static String FILE_NAME_PROPERTY = "FILE_NAME";
static NewProperty createProperty(File incomingDataSetFile, boolean stripExtension)
{
String fileName = incomingDataSetFile.getName();
if (stripExtension)
{
fileName = FilenameUtils.removeExtension(fileName);
}
return new NewProperty(FILE_NAME_PROPERTY, fileName);
}
}
/*
* Copyright 2010 ETH Zuerich, CISD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ch.ethz.bsse.cisd.plasmid.dss;
import java.io.File;
import java.util.Properties;
import ch.systemsx.cisd.common.exceptions.EnvironmentFailureException;
import ch.systemsx.cisd.common.exceptions.UserFailureException;
import ch.systemsx.cisd.etlserver.IDataSetInfoExtractor;
import ch.systemsx.cisd.etlserver.cifex.CifexDataSetInfoExtractor;
import ch.systemsx.cisd.openbis.dss.generic.shared.IEncapsulatedOpenBISService;
import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetInformation;
import ch.systemsx.cisd.openbis.generic.shared.dto.NewProperty;
/**
* {@link IDataSetInfoExtractor} implementation that delegates extraction of data to
* {@link CifexDataSetInfoExtractor} and adds one property of type {@code FILE_NAME} holding name of
* the file stored for the data set. Registration will fail if this property type doesn't exist in
* openBIS DB or is not attached to the data set type extracted by type extractor.
*
* @author Piotr Buczek
*/
public class PlasmidCifexDataSetInfoExtractor implements IDataSetInfoExtractor
{
private final IDataSetInfoExtractor delegator;
public PlasmidCifexDataSetInfoExtractor(final Properties globalProperties)
{
this.delegator = new CifexDataSetInfoExtractor(globalProperties);
}
public DataSetInformation getDataSetInformation(File incomingDataSetFile,
IEncapsulatedOpenBISService openbisService) throws UserFailureException,
EnvironmentFailureException
{
final DataSetInformation result =
delegator.getDataSetInformation(incomingDataSetFile, openbisService);
final NewProperty fileNameProperty =
DataSetFileNamePropertyHelper.createProperty(incomingDataSetFile, true);
result.getDataSetProperties().add(fileNameProperty);
return result;
}
}
......@@ -35,17 +35,15 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.NewProperty;
* <p>
* Registered data sets will have one property of type {@code FILE_NAME} holding name of the file
* stored for the data set. Registration will fail if this property type doesn't exist in openBIS DB
* or is not attached to the data set type extracted by {@link PlasmidTypeExtractor}.
* or is not attached to the data set type extracted by type extractor.
*
* @author Piotr Buczek
*/
public class PlasmidDataSetInfoExtractor implements IDataSetInfoExtractor
public class PlasmidDefaultDataSetInfoExtractor implements IDataSetInfoExtractor
{
private final static String FILE_NAME_PROPERTY = "FILE_NAME";
private final IDataSetInfoExtractor delegator;
public PlasmidDataSetInfoExtractor(final Properties globalProperties)
public PlasmidDefaultDataSetInfoExtractor(final Properties globalProperties)
{
this.delegator = new DefaultDataSetInfoExtractor(globalProperties);
}
......@@ -57,8 +55,9 @@ public class PlasmidDataSetInfoExtractor implements IDataSetInfoExtractor
final DataSetInformation result =
delegator
.getDataSetInformation(incomingDataSetFile.getParentFile(), openbisService);
result.getDataSetProperties().add(
new NewProperty(FILE_NAME_PROPERTY, incomingDataSetFile.getName()));
final NewProperty fileNameProperty =
DataSetFileNamePropertyHelper.createProperty(incomingDataSetFile, false);
result.getDataSetProperties().add(fileNameProperty);
return result;
}
}
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