Skip to content
Snippets Groups Projects
Commit 7a4399b3 authored by Adam Laskowski's avatar Adam Laskowski
Browse files

BIS-713: removed old code

parent 0d56bcd2
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
Showing
with 0 additions and 1885 deletions
#
# Copyright 2014 ETH Zuerich, Scientific IT Services
#
# 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.
#
# MasterDataRegistrationTransaction Class
from ch.ethz.sis.openbis.generic.server.asapi.v3 import ApplicationServerApi
from ch.systemsx.cisd.openbis.generic.server import CommonServiceProvider
from ch.ethz.sis.openbis.generic.asapi.v3.dto.service.id import CustomASServiceCode
from ch.ethz.sis.openbis.generic.asapi.v3.dto.service import CustomASServiceExecutionOptions
from ch.systemsx.cisd.openbis.generic.server.jython.api.v1.impl import MasterDataRegistrationHelper
import sys
helper = MasterDataRegistrationHelper(sys.path)
api = CommonServiceProvider.getApplicationContext().getBean(ApplicationServerApi.INTERNAL_SERVICE_NAME)
sessionToken = api.loginAsSystem()
props = CustomASServiceExecutionOptions().withParameter('xls', helper.listXlsByteArrays()) \
.withParameter('method', 'import').withParameter('zip', False).withParameter('xls_name', 'IMAGING').withParameter('update_mode', 'UPDATE_IF_EXISTS') \
.withParameter('scripts', helper.getAllScripts())
result = api.executeCustomASService(sessionToken, CustomASServiceCode("xls-import"), props)
api.logout(sessionToken)
print("======================== imaging-master-data xls ingestion result ========================")
print(result)
print("======================== imaging-data xls ingestion result ========================")
# from ch.ethz.sis.openbis.generic.server.asapi.v3 import ApplicationServerApi
# from ch.systemsx.cisd.openbis.generic.server import CommonServiceProvider
# from ch.ethz.sis.openbis.generic.asapi.v3.dto.service.id import CustomASServiceCode
# from ch.ethz.sis.openbis.generic.asapi.v3.dto.service import CustomASServiceExecutionOptions
# from ch.systemsx.cisd.openbis.generic.server.jython.api.v1.impl import MasterDataRegistrationHelper
# import sys
#
# from ch.systemsx.cisd.openbis.generic.server.hotfix import ELNFixes
# from ch.systemsx.cisd.openbis.generic.server.hotfix import ELNAnnotationsMigration
# from ch.systemsx.cisd.openbis.generic.server.hotfix import ELNCollectionTypeMigration
#
# api = CommonServiceProvider.getApplicationContext().getBean(ApplicationServerApi.INTERNAL_SERVICE_NAME)
# sessionToken = api.loginAsSystem()
#
# if ELNFixes.isELNInstalled():
# ELNFixes.beforeUpgrade(sessionToken)
# ELNAnnotationsMigration.beforeUpgrade(sessionToken)
# ELNCollectionTypeMigration.beforeUpgrade(sessionToken)
#
# helper = MasterDataRegistrationHelper(sys.path)
# props = CustomASServiceExecutionOptions().withParameter('xls', helper.getByteArray("common-data-model.xls"))\
# .withParameter('method', 'import').withParameter('zip', False).withParameter('xls_name', 'ELN-LIMS').withParameter('update_mode', 'UPDATE_IF_EXISTS')\
# .withParameter('scripts', helper.getAllScripts())
# result = api.executeCustomASService(sessionToken, CustomASServiceCode("xls-import"), props)
#
# if not ELNFixes.isMultiGroup():
# props = CustomASServiceExecutionOptions().withParameter('xls', helper.getByteArray("single-group-data-model.xls"))\
# .withParameter('method', 'import').withParameter('zip', False).withParameter('xls_name', 'ELN-LIMS').withParameter('update_mode', 'UPDATE_IF_EXISTS')\
# .withParameter('scripts', helper.getAllScripts())
# result = api.executeCustomASService(sessionToken, CustomASServiceCode("xls-import"), props)
#
# ELNCollectionTypeMigration.afterUpgrade()
# api.logout(sessionToken)
# print("======================== master-data xls ingestion result ========================")
# print(result)
# print("======================== master-data xls ingestion result ========================")
File deleted
# Copyright ETH 2023 Zürich, Scientific IT Services
#
# 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.
#
import json
def assert_control(control_config):
if not control_config:
return True, ''
obligatory_tags = ['@type', 'label', 'type']
for tag in obligatory_tags:
if tag not in control_config:
return False, tag+': is missing!'
if control_config[tag] is None:
return False, tag+': can not be empty!'
list_tags = ['values', 'range', 'speeds', 'visibility']
for list_tag in list_tags:
if list_tag in control_config and control_config[list_tag] is not None and not isinstance(control_config[list_tag], list):
return False, list_tag+': must be a list or null!'
boolean_tags = ['playable', 'multiselect']
for boolean_tag in boolean_tags:
if boolean_tag in control_config and control_config[boolean_tag] is not None and not isinstance(control_config[boolean_tag], bool):
return False, boolean_tag+': must be a boolean or empty!'
if 'visibility' in control_config and control_config['visibility'] is not None:
visibility = control_config['visibility']
for vis in visibility:
tags = ['label', 'values']
all_tags = tags + ['range', 'unit']
for tag in ['label', 'values']:
if tag not in vis:
return False, 'visibility->'+tag+': is missing!'
if vis[tag] is None:
return False, 'visibility->'+tag+': can not be empty!'
for tag in ['values', 'range']:
if tag in vis and vis[tag] is not None and not isinstance(vis[tag], list):
return False, 'visibility->'+tag+': must be a list!'
if 'metadata' in control_config and control_config['metadata'] is not None and not isinstance(control_config['metadata'], dict):
return False, '->metadata: must be a dictionary or null!'
return True, ''
def assert_config(json_config):
if 'config' in json_config:
config = json_config['config']
obligatory_tags = ['@type', 'adaptor', 'version', 'playable', 'exports', 'inputs']
for tag in obligatory_tags:
if tag not in config:
return False, 'config->' + tag + ': is missing!'
if config[tag] is None:
return False, 'config->' + tag + ': can not be empty!'
if config['adaptor'].strip() == '':
return False, 'config->adaptor: can not be blank!'
list_tags = ['speeds', 'resolutions', 'exports', 'inputs']
for list_tag in list_tags:
if list_tag in config and config[list_tag] is not None and not isinstance(config[list_tag], list):
return False, '\''+list_tag+'\' must be a list or null!'
if not isinstance(config['playable'], bool):
return False, 'config->playable: must be a boolean!'
for control in config['exports']:
result, err = assert_control(control)
if not result:
return result, 'config->exports->' + err
for control in config['inputs']:
result, err = assert_control(control)
if not result:
return result, 'config->inputs->' + err
if 'metadata' in config and config['metadata'] is not None and not isinstance(config['metadata'], dict):
return False, 'config->metadata: must be a dictionary or null!'
else:
return False, 'Missing \'config\' tag in configuration!'
return True, ''
def assert_preview(preview_config):
obligatory_tags = ['@type', 'format', 'show']
for tag in obligatory_tags:
if tag not in config:
return False, tag + ': is missing!'
if config[tag] is None:
return False, tag + ': can not be empty!'
if not isinstance(preview_config['show'], bool):
return False, 'show: must be boolean!'
if not isinstance(preview_config['format'], str):
return False, 'format: must be string!'
if 'bytes' in preview_config and preview_config['bytes'] is not None and not isinstance(preview_config['bytes'], str):
return False, 'bytes: must be a base64 encoded string or null!'
if 'metadata' in preview_config and preview_config['metadata'] is not None and not isinstance(preview_config['metadata'], dict):
return False, 'metadata: must be a dictionary or null!'
if 'config' in preview_config and preview_config['config'] is not None and not isinstance(preview_config['config'], dict):
return False, 'config: must be a dictionary or null!'
return True, ''
def assert_images(json_config):
if 'images' in json_config:
images = json_config['images']
if images is None:
return False, '\'images\' tag can not be null!'
if not isinstance(images, list):
return False, '\'images\' tag must be a list!'
for image in images:
obligatory_tags = ['@type']
for tag in obligatory_tags:
if tag not in image:
return False, 'images->' + tag + ': missing tag!'
if image[tag] is None:
return False, 'images->' + tag + ': can not be empty!'
if 'metadata' in image and image['metadata'] is not None and not isinstance(image['metadata'], dict):
return False, 'images->metadata: must be a dictionary or null!'
if 'previews' in image and image['previews'] is not None and not isinstance(image['previews'], list):
return False, 'images->previews: must be a list or null!'
for preview in image['previews']:
res, err = assert_preview(preview)
if not res:
return result, 'images->previews->' + err
else:
return False, 'Missing \'images\' tag in configuration!'
return True, ''
def get_rendered_property(entity, property):
properties = entity.externalDataPE().getProperties()
for prop in properties:
etpt = prop.getEntityTypePropertyType()
pt = etpt.getPropertyType()
code = pt.getCode()
if code == property:
return prop.tryGetUntypedValue()
return None
def validate(entity, is_new):
imaging_dataset_config = get_rendered_property(entity, "$IMAGING_DATA_CONFIG")
if imaging_dataset_config is None or imaging_dataset_config == "":
return "Imaging dataset config can not be empty!"
elif "test_validation_failure" in imaging_dataset_config:
return "Imaging dataset config validation failure!"
else:
try:
config = json.loads(imaging_dataset_config)
except Exception as e:
return "Could not parse JSON: " + e
result, err = assert_config(config)
if not result:
return err
apply from: 'javaproject.gradle'
apply from: 'repository.gradle'
//evaluationDependsOn(':api-openbis-java')
dependencies {
api project(':api-openbis-java'),
project(':server-original-data-store')
implementation 'fasterxml:jackson-annotations:2.9.10',
'fasterxml:jackson-core:2.9.10',
'fasterxml:jackson-databind:2.9.10.8',
'fasterxml:jackson-datatype-jsr310:2.9.10'
// testImplementation 'testng:testng:6.8-CISD'
// project(':server-original-data-store')
testImplementation 'junit:junit:4.10',
'testng:testng:6.8-CISD'
testRuntimeOnly 'hamcrest:hamcrest-core:1.3',
project(':server-original-data-store')
}
sourceSets {
main {
resources {
srcDirs = ['source/java/*']
}
}
test {
resources {
srcDirs = ['sourceTest/java']
}
}
}
//test {
// workingDir = '.'
//}
def premiseArchiveName = 'openBIS-premise-imaging.jar'
jar {
dependsOn compileJava
archiveName premiseArchiveName
includeEmptyDirs false
}
task premiseImagingJar(type: Copy) {
dependsOn jar
from("${project.buildDir}/libs/${premiseArchiveName}")
into ".."
doLast {
// delete "${project.buildDir}/${premiseArchiveName}"
// delete "${project.buildDir}"
// delete
}
}
\ No newline at end of file
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://sissource.ethz.ch/openbis/openbis-public/openbis-ivy/-/raw/main/gradle/distribution/7.4/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# 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
#
# https://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.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
apply plugin: 'java-library'
apply plugin: 'project-report'
evaluationDependsOnChildren()
configurations {
implementation {
canBeResolved = true
}
testImplementation {
canBeResolved = true
}
runtimeOnly {
canBeResolved = true
}
tests.extendsFrom testRuntimeOnly
}
configurations {
ecj
}
configurations.all {
resolutionStrategy.cacheDynamicVersionsFor 0, 'hours'
resolutionStrategy.cacheChangingModulesFor 0, 'hours'
}
//task wrapper(type: Wrapper) {
// gradleVersion = '4.10.3'
// distributionUrl = "https://services.gradle.org/distributions/gradle-4.10.3-bin.zip"
//}
sourceCompatibility='11'
targetCompatibility='11'
sourceSets {
main {
java {
srcDirs = ['source/java']
}
}
test {
java {
srcDirs = ['sourceTest/java']
}
resources {
srcDirs = ['sourceTest/java']
}
}
examples {
java {
srcDirs = ['sourceExamples/java']
}
}
}
buildDir = 'targets/gradle'
buildscript {
apply from: './repository.gradle'
repositories repositoryConfig
dependencies {
classpath 'cisd:cisd-ant-tasks:r29834'
}
}
repositories repositoryConfig
def execute(command, arguments) {
new ByteArrayOutputStream().withStream { os ->
print "execute: ${command}"
arguments.collect({print " ${it}"})
println ''
def result = exec {
executable = command
args = arguments
standardOutput = os
}
return os.toString().split('\n')
}
}
ext.executeFunction = {
command, arguments -> execute(command, arguments)
}
def execute_working_dir(command, arguments, working_dir) {
new ByteArrayOutputStream().withStream { os ->
print "execute: ${command}"
arguments.collect({print " ${it}"})
println ''
def result = exec {
executable = command
args = arguments
standardOutput = os
}
return os.toString().split('\n')
}
}
ext.svnCommand = 'svn'
def isSvnProject() {
return new java.io.File(projectDir, ".svn").isDirectory() || new java.io.File(projectDir, "../.svn").isDirectory()
}
def isGitProject() {
return new java.io.File(projectDir, ".git").isDirectory() || new java.io.File(projectDir, "../.git").isDirectory()
}
def executeSVN(arguments) {
arguments.add(0, '--non-interactive')
return execute(svnCommand, arguments)
}
def calculateCleanFlag() {
return 'clean'
for (childProject in project.childProjects.values()) {
if (childProject.cleanFlag == 'dirty') {
return 'dirty'
}
}
def isSvn = isSvnProject()
if (isSvn) {
def output = executeSVN(['status', '../' + project.name])
def lines = output.findAll({ (it.startsWith('?') || it.trim().isEmpty()) == false})
return lines.isEmpty() ? 'clean' : 'dirty'
} else if (isGitProject()) {
def output = execute_working_dir('git', ['status', '--porcelain'], '../' + project.name)
return output.length == 0 ? 'clean' : 'dirty'
} else {
return 'dirty'
}
}
def findMaximum(lines, key) {
return lines.findAll({ it.startsWith(key)}).collect({element -> element.split(':')[1].toInteger()}).max()
}
def calculateBuildInfo() {
if (isSvnProject()) {
def output = executeSVN(['info', '-R', '../' + project.name])
def maxRevisionNumber = findMaximum(output, 'Revision:')
project.ext.revisionNumber = findMaximum(output, 'Last Changed Rev:')
if (maxRevisionNumber < project.ext.revisionNumber) {
throw new GradleException("Maximum revision ($maxRevisionNumber) is less than the maximum "
+ "last changed revision ($project.ext.revisionNumber).")
}
project.ext.versionNumber = 'SNAPSHOT'
def url = output.findAll({ it.startsWith('URL:')})[0].split('URL:')[1].trim()
if (url.contains('/trunk') == false) {
def pathElements = url.split('/')
project.ext.versionNumber = 'libraries' == pathElements[-2] ? pathElements[-3] : pathElements[-2]
}
} else if (isGitProject()) {
def gitlogoutput = execute_working_dir('git', ['log', '-1', '--format=%at'], '../' + project.name)
project.ext.revisionNumber = Integer.parseInt(gitlogoutput[0])
def tag = 'git tag -l --points-at HEAD'.execute().text.trim()
if (tag == null || tag.isEmpty() || tag.contains('pybis')) {
project.ext.versionNumber = 'SNAPSHOT'
} else {
project.ext.versionNumber = tag
}
} else {
project.ext.revisionNumber = 1
project.ext.versionNumber = 'SNAPSHOT'
}
for (childProject in project.childProjects.values()) {
project.ext.revisionNumber = Math.max(project.ext.revisionNumber, childProject.revisionNumber)
if (project.ext.versionNumber != childProject.versionNumber) {
throw new GradleException("Inconsistent version numbers: "
+ "${project.name} at version ${project.ext.versionNumber} but "
+ "${childProject.name} at version ${childProject.versionNumber}.")
}
}
version = "${project.ext.versionNumber}-r${project.ext.revisionNumber}"
project.ext.revisionForPublication = project.ext.versionNumber.startsWith('SNAPSHOT') ? "r${project.ext.revisionNumber}" : project.ext.versionNumber
project.ext.cleanFlag = calculateCleanFlag()
def buildInfo = "${project.ext.versionNumber}:${project.ext.revisionNumber}:${project.ext.cleanFlag}"
def buildInfoDev = "${project.ext.versionNumber}-dev:${project.ext.revisionNumber}:${project.ext.cleanFlag}"
println "BUILD INFO for $project: $buildInfo"
def targetsDistFolder = new File("${project.projectDir}/targets/dist")
targetsDistFolder.deleteDir()
targetsDistFolder.mkdirs()
def targetDistBuildInfo = new File(targetsDistFolder, "BUILD-${project.name}.INFO")
targetDistBuildInfo << buildInfo
def mainClassesFolder = new File("${project.projectDir}/targets/gradle/classes/java/main")
mainClassesFolder.mkdirs()
def mainClassesBuildInfo = new File(mainClassesFolder, "BUILD-${project.name}.INFO")
mainClassesBuildInfo.delete()
mainClassesBuildInfo << buildInfoDev
}
calculateBuildInfo()
group='cisd'
task checkRestrictions(type: Exec, dependsOn: [classes, testClasses]) {
doFirst {
/*
def cp = configurations.testImplementation.filter({ f -> f.name.startsWith('restrictionchecker') || f.name.startsWith('bcel')}).asPath
def cmd = ['java', '-cp', cp, 'ch.rinn.restrictions.RestrictionChecker', '-r', sourceSets.main.output.classesDirs.first()]
if (sourceSets.test.output.classesDirs.first().exists()) {
cmd.add(sourceSets.test.output.classesDirs.first())
}
cmd.add('-cp')
cmd.add(sourceSets.main.output.classesDirs.first())
if (sourceSets.test.output.classesDirs.first().exists()) {
cmd.add(sourceSets.test.output.classesDirs.first())
}
cmd.add(configurations.testImplementation.asPath)
commandLine cmd
*/
commandLine = ['pwd']
}
}
def deleteSymbolicLinksRecursively(file) {
def absolutePath = file.getAbsolutePath()
def canonicalPath = file.getCanonicalPath()
if (absolutePath.equals(canonicalPath) == false) {
file.delete();
} else if (file.isDirectory()) {
File[] files = file.listFiles()
for (File child : files) {
deleteSymbolicLinksRecursively(child)
}
}
}
task deleteSymLinks {
doFirst {
println "DELETE SYM LINKS in $buildDir"
deleteSymbolicLinksRecursively buildDir
}
}
clean.dependsOn deleteSymLinks
test {
useTestNG()
options.suites('sourceTest/java/tests.xml')
systemProperty "ant.project.name", project.name
maxHeapSize = "8192m"
jvmArgs '-Duser.timezone=Europe/Zurich', '-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StrErrLog'
testLogging.showStandardStreams = true
ignoreFailures = true
}
test.dependsOn checkRestrictions
// Legacy Java 8 compiler from eclipse
dependencies {
ecj "eclipse:ecj:4.6.1"
}
if(System.getProperty("java.version").startsWith("1.8.")) {
tasks.withType(JavaCompile) {
options.headerOutputDirectory.convention(null)
}
}
compileJava {
options.encoding = 'utf-8'
options.fork = true
doFirst {
// Use the legacy Java 8 compiler from eclipse for Java 8
if(System.getProperty("java.version").startsWith("1.8.")) {
options.forkOptions.with {
executable = 'java'
jvmArgs = createEclipseJDK8Args()
}
} else if(System.getProperty("java.version").startsWith("11.") || System.getProperty("java.version").startsWith("17.")) {
// Use modern openJDK 11 or 17 Compiler
} else {
throw new Exception("Unsupported Java version found: '" + System.getProperty("java.version") + "', please use JDK8, JDK11 or JDK17");
}
}
}
compileTestJava {
options.encoding = 'utf-8'
options.fork = true
doFirst {
// Use the legacy Java 8 compiler from eclipse for Java 8
if(System.getProperty("java.version").startsWith("1.8.")) {
options.forkOptions.with {
executable = 'java'
jvmArgs = createEclipseJDK8Args()
}
} else if(System.getProperty("java.version").startsWith("11.") || System.getProperty("java.version").startsWith("17.")) {
// Use modern openJDK 11 or 17 Compiler
} else {
throw new Exception("Unsupported Java version found: '" + System.getProperty("java.version") + "', please use JDK8, JDK11 or JDK17");
}
}
}
def createEclipseJDK8Args() {
def args = ['-cp', configurations.ecj.asPath, 'org.eclipse.jdt.internal.compiler.batch.Main', '-nowarn']
return args
}
processTestResources {
fileMode=0666
}
apply plugin: 'eclipse'
eclipse {
classpath {
downloadSources=true
defaultOutputDir = file('targets/classes')
}
}
eclipse.classpath.file {
whenMerged{ classpath ->
def projectRefs = classpath.entries.findAll{entry -> entry.kind =='src' && entry.path.startsWith('/')}
classpath.entries.removeAll(projectRefs)
classpath.entries.addAll(projectRefs)
}
}
task testJar(type: Jar, dependsOn: testClasses) {
baseName = "test-${project.archivesBaseName}"
from sourceSets.test.output
}
task sourcesJar(type: Jar) {
duplicatesStrategy 'include'
classifier = 'sources'
from sourceSets.main.allSource
}
compileJava.dependsOn sourcesJar
artifacts {
tests testJar
}
artifacts {
archives sourcesJar
}
task compileDependencies(type: Copy) {
into "$buildDir/output/compile-dependencies"
from configurations.implementation
}
task runtimeDependencies(type: Copy) {
into "$buildDir/output/runtime-dependencies"
from configurations.runtimeOnly
}
task testCompileDependencies(type: Copy) {
into "$buildDir/output/testCompile-dependencies"
from configurations.testImplementation
}
task testRuntimeDependencies(type: Copy) {
into "$buildDir/output/testRuntime-dependencies"
from configurations.testRuntimeOnly
}
task checkDependencies(dependsOn: classes) {
doLast {
ant.taskdef(name: 'dependencychecker', classname: 'classycle.ant.DependencyCheckingTask', classpath: configurations.testRuntime.asPath)
ant.dependencychecker(
definitionFile: 'resource/dependency-structure.ddf',
failOnUnwantedDependencies: 'true',
mergeInnerClasses: 'true') {
fileset(dir: "${buildDir}", includes: "**/*.class")
}
}
}
apply plugin: 'ivy-publish'
if (hasProperty('ivyRepository') == false || ''.equals(project.ivyRepository))
{
project.ext.ivyRepository = "${project.projectDir}/../ivy-repository"
}
publishing {
repositories {
ivy {
ivyPattern "file://${project.ivyRepository}/[organisation]/[module]/[revision]/ivy.xml"
artifactPattern "file://${project.ivyRepository}/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"
}
}
}
publish {
dependsOn build
}
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'utf-8')
}
}
ext.repositoryConfig = {
ivy {
ivyPattern "https://sissource.ethz.ch/openbis/openbis-public/openbis-ivy/-/raw/main/[organisation]/[module]/[revision]/ivy.xml"
artifactPattern "https://sissource.ethz.ch/openbis/openbis-public/openbis-ivy/-/raw/main/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"
}
}
//includeFlat 'lib-commonbase', 'lib-common', 'api-openbis-java', 'lib-openbis-common', 'lib-authentication', 'lib-dbmigration', 'server-application-server',
// 'server-original-data-store', 'server-screening', 'server-external-data-store',
// 'ui-admin', 'lib-microservice-server', 'ui-eln-lims', 'api-openbis-javascript'
//
//def includes = ['lib-commonbase', 'lib-common', 'api-openbis-java', 'lib-openbis-common', 'api-openbis-javascript',
// 'lib-authentication', 'lib-dbmigration', 'server-application-server', 'server-original-data-store']
//
//includes.forEach { name ->
// includeFlat(name)
// project(":${name}").projectDir = new File("../openbis/${name}")
//}
def includes = ['lib-common', 'lib-commonbase', 'api-openbis-java',
'api-openbis-javascript', 'lib-openbis-common', 'lib-dbmigration', 'lib-authentication',
'server-original-data-store', 'server-application-server'
]
includes.forEach { name ->
includeFlat(name)
project(":${name}").projectDir = new File("../../../../../../../../../../${name}")
}
\ No newline at end of file
/*
* Copyright ETH 2023 Zürich, Scientific IT Services
*
* 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.sis.openbis.generic.server.dss.plugins;
import ch.ethz.sis.openbis.generic.dssapi.v3.dto.service.CustomDSSServiceExecutionOptions;
import ch.ethz.sis.openbis.generic.dssapi.v3.dto.service.id.ICustomDSSServiceId;
import ch.ethz.sis.openbis.generic.dssapi.v3.plugin.service.ICustomDSSServiceExecutor;
import java.io.Serializable;
import java.util.Map;
import java.util.Properties;
public class PingPongService implements ICustomDSSServiceExecutor
{
public PingPongService(Properties properties)
{
System.out.println("||> INIT PING PONG SERVICE");
}
@Override
public Serializable executeService(String sessionToken, ICustomDSSServiceId serviceId,
CustomDSSServiceExecutionOptions options)
{
Map<String, Object> params = options.getParameters();
if(params.containsKey("key") && params.get("key").toString().equalsIgnoreCase("PING"))
{
return "PONG";
}
throw new IllegalArgumentException("Missing Ping parameter");
}
}
/*
* Copyright ETH 2023 Zürich, Scientific IT Services
*
* 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.sis.openbis.generic.dssapi.v3.dto.imaging;
import ch.systemsx.cisd.base.annotation.JsonObject;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
@JsonObject("dss.dto.imaging.ImagingDataSetConfig")
public class ImagingDataSetConfig implements Serializable
{
private static final long serialVersionUID = 1L;
@JsonProperty
private String adaptor;
@JsonProperty
private Double version;
@JsonProperty
private List<Integer> speeds;
@JsonProperty
private List<String> resolutions;
@JsonProperty
private boolean playable;
@JsonProperty
private List<ImagingDataSetControl> exports;
@JsonProperty
private List<ImagingDataSetControl> inputs;
@JsonProperty
private Map<String, String> metaData;
@JsonIgnore
public String getAdaptor()
{
return adaptor;
}
public void setAdaptor(String adaptor)
{
this.adaptor = adaptor;
}
@JsonIgnore
public Double getVersion()
{
return version;
}
public void setVersion(Double version)
{
this.version = version;
}
@JsonIgnore
public List<Integer> getSpeeds()
{
return speeds;
}
public void setSpeeds(List<Integer> speeds)
{
this.speeds = speeds;
}
@JsonIgnore
public List<String> getResolutions()
{
return resolutions;
}
public void setResolutions(List<String> resolutions)
{
this.resolutions = resolutions;
}
@JsonIgnore
public boolean isPlayable()
{
return playable;
}
public void setPlayable(boolean playable)
{
this.playable = playable;
}
@JsonIgnore
public List<ImagingDataSetControl> getExports()
{
return exports;
}
public void setExports(
List<ImagingDataSetControl> exports)
{
this.exports = exports;
}
@JsonIgnore
public List<ImagingDataSetControl> getInputs()
{
return inputs;
}
public void setInputs(
List<ImagingDataSetControl> inputs)
{
this.inputs = inputs;
}
@JsonIgnore
public Map<String, String> getMetaData()
{
return metaData;
}
public void setMetaData(Map<String, String> metaData)
{
this.metaData = metaData;
}
@Override
public String toString()
{
return "ImagingDataSetConfig: " + adaptor;
}
}
/*
* Copyright ETH 2023 Zürich, Scientific IT Services
*
* 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.sis.openbis.generic.dssapi.v3.dto.imaging;
import ch.systemsx.cisd.base.annotation.JsonObject;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
@JsonObject("dss.dto.imaging.ImagingDataSetControl")
public class ImagingDataSetControl implements Serializable
{
private static final long serialVersionUID = 1L;
@JsonProperty
private String label;
@JsonProperty
private String section;
@JsonProperty
private String type;
@JsonProperty
private List<String> values;
@JsonProperty
private String unit;
@JsonProperty
private List<String> range;
@JsonProperty
private boolean multiselect;
@JsonProperty
private Boolean playable;
@JsonProperty
private List<Integer> speeds;
@JsonProperty
private List<ImagingDataSetControlVisibility> visibility;
@JsonProperty
private Map<String, String> metaData;
@JsonIgnore
public String getLabel()
{
return label;
}
public void setLabel(String label)
{
this.label = label;
}
@JsonIgnore
public String getSection()
{
return section;
}
public void setSection(String section)
{
this.section = section;
}
@JsonIgnore
public String getUnit()
{
return unit;
}
public void setUnit(String unit)
{
this.unit = unit;
}
@JsonIgnore
public String getType()
{
return type;
}
public void setType(String type)
{
this.type = type;
}
@JsonIgnore
public List<String> getValues()
{
return values;
}
public void setValues(List<String> values)
{
this.values = values;
}
@JsonIgnore
public boolean isMultiselect()
{
return multiselect;
}
public void setMultiselect(boolean multiselect)
{
this.multiselect = multiselect;
}
@JsonIgnore
public Boolean getPlayable()
{
return playable;
}
public void setPlayable(Boolean playable)
{
this.playable = playable;
}
@JsonIgnore
public List<Integer> getSpeeds()
{
return speeds;
}
public void setSpeeds(List<Integer> speeds)
{
this.speeds = speeds;
}
@JsonIgnore
public List<String> getRange()
{
return range;
}
public void setRange(List<String> range)
{
this.range = range;
}
@JsonIgnore
public List<ImagingDataSetControlVisibility> getVisibility()
{
return visibility;
}
public void setVisibility(
List<ImagingDataSetControlVisibility> visibility)
{
this.visibility = visibility;
}
@JsonIgnore
public Map<String, String> getMetaData()
{
return metaData;
}
public void setMetaData(Map<String, String> metaData)
{
this.metaData = metaData;
}
@Override
public String toString()
{
return "ImagingDataSetControl: " + label;
}
}
/*
* Copyright ETH 2023 Zürich, Scientific IT Services
*
* 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.sis.openbis.generic.dssapi.v3.dto.imaging;
import ch.systemsx.cisd.base.annotation.JsonObject;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
@JsonObject("dss.dto.imaging.ImagingDataSetControlVisibility")
public class ImagingDataSetControlVisibility implements Serializable
{
private static final long serialVersionUID = 1L;
@JsonProperty
private String label;
@JsonProperty
private List<String> values;
@JsonProperty
private List<String> range;
@JsonProperty
private String unit;
@JsonIgnore
public String getLabel()
{
return label;
}
public void setLabel(String label)
{
this.label = label;
}
@JsonIgnore
public List<String> getValues()
{
return values;
}
public void setValues(List<String> values)
{
this.values = values;
}
@JsonIgnore
public List<String> getRange()
{
return range;
}
public void setRange(List<String> range)
{
this.range = range;
}
@JsonIgnore
public String getUnit()
{
return unit;
}
public void setUnit(String unit)
{
this.unit = unit;
}
@Override
public String toString()
{
return "ImagingDataSetControlVisibility: " + label;
}
}
/*
* Copyright ETH 2023 Zürich, Scientific IT Services
*
* 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.sis.openbis.generic.dssapi.v3.dto.imaging;
import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.property.PropertiesDeserializer;
import ch.systemsx.cisd.base.annotation.JsonObject;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.io.Serializable;
import java.util.Map;
@JsonObject("dss.dto.imaging.ImagingDataSetExport")
public class ImagingDataSetExport implements Serializable
{
private static final long serialVersionUID = 1L;
@JsonProperty
@JsonDeserialize(contentUsing = PropertiesDeserializer.class)
private Map<String, Serializable> config;
@JsonProperty
@JsonDeserialize(contentUsing = PropertiesDeserializer.class)
private Map<String, String> metaData;
@JsonIgnore
public Map<String, Serializable> getConfig()
{
return config;
}
public void setConfig(Map<String, Serializable> config)
{
this.config = config;
}
@JsonIgnore
public Map<String, String> getMetaData()
{
return metaData;
}
public void setMetaData(Map<String, String> metaData)
{
this.metaData = metaData;
}
@Override
public String toString()
{
return "ImagingDataSetExport";
}
}
/*
* Copyright ETH 2023 Zürich, Scientific IT Services
*
* 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.sis.openbis.generic.dssapi.v3.dto.imaging;
import ch.systemsx.cisd.base.annotation.JsonObject;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
@JsonObject("dss.dto.imaging.ImagingDataSetImage")
public class ImagingDataSetImage implements Serializable
{
private static final long serialVersionUID = 1L;
@JsonProperty
private List<ImagingDataSetPreview> previews;
@JsonProperty
private Map<String, Serializable> config;
@JsonProperty
private Map<String, String> metaData;
@JsonIgnore
public List<ImagingDataSetPreview> getPreviews()
{
return previews;
}
public void setPreviews(
List<ImagingDataSetPreview> previews)
{
this.previews = previews;
}
public Map<String, Serializable> getConfig()
{
return config;
}
public void setConfig(Map<String, Serializable> config)
{
this.config = config;
}
@JsonIgnore
public Map<String, String> getMetaData()
{
return metaData;
}
public void setMetaData(Map<String, String> metaData)
{
this.metaData = metaData;
}
@Override
public String toString()
{
return "ImagingDataSetImage:";
}
}
/*
* Copyright ETH 2023 Zürich, Scientific IT Services
*
* 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.sis.openbis.generic.dssapi.v3.dto.imaging;
import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.property.PropertiesDeserializer;
import ch.systemsx.cisd.base.annotation.JsonObject;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
@JsonObject("dss.dto.imaging.ImagingDataSetMultiExport")
public class ImagingDataSetMultiExport implements Serializable
{
private static final long serialVersionUID = 1L;
@JsonProperty
private String permId;
@JsonProperty
private int index;
@JsonProperty
@JsonDeserialize(contentUsing = PropertiesDeserializer.class)
private Map<String, Serializable> config;
@JsonProperty
@JsonDeserialize(contentUsing = PropertiesDeserializer.class)
private Map<String, String> metaData;
@JsonIgnore
public String getPermId()
{
return permId;
}
public void setPermId(String permId) {
this.permId = permId;
}
@JsonIgnore
public int getIndex()
{
return index;
}
public void setIndex(int index) {
this.index = index;
}
@JsonIgnore
public Map<String, Serializable> getConfig()
{
return config;
}
public void setConfig(Map<String, Serializable> config)
{
this.config = config;
}
@JsonIgnore
public Map<String, String> getMetaData()
{
return metaData;
}
public void setMetaData(Map<String, String> metaData)
{
this.metaData = metaData;
}
@Override
public String toString()
{
return "ImagingDataSetMultiExport:" + permId;
}
}
/*
* Copyright ETH 2023 Zürich, Scientific IT Services
*
* 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.sis.openbis.generic.dssapi.v3.dto.imaging;
import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.property.PropertiesDeserializer;
import ch.systemsx.cisd.base.annotation.JsonObject;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
@JsonObject("dss.dto.imaging.ImagingDataSetPreview")
public class ImagingDataSetPreview implements Serializable
{
private static final long serialVersionUID = 1L;
@JsonProperty
@JsonDeserialize(contentUsing = PropertiesDeserializer.class)
private Map<String, Serializable> config;
@JsonProperty
private String format;
@JsonProperty
private String bytes;
@JsonProperty
private boolean show;
@JsonProperty
private Map<String, String> metaData;
@JsonIgnore
public Map<String, Serializable> getConfig()
{
return config;
}
public void setConfig(Map<String, Serializable> config)
{
this.config = config;
}
@JsonIgnore
public String getFormat()
{
return format;
}
public void setFormat(String format)
{
this.format = format;
}
@JsonIgnore
public String getBytes()
{
return bytes;
}
public void setBytes(String bytes)
{
this.bytes = bytes;
}
@JsonIgnore
public boolean isShow()
{
return show;
}
public void setShow(boolean show)
{
this.show = show;
}
@JsonIgnore
public Map<String, String> getMetaData()
{
return metaData;
}
public void setMetaData(Map<String, String> metaData)
{
this.metaData = metaData;
}
@Override
public String toString()
{
return "ImagingDataSetPreview";
}
}
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