Skip to content
GitLab
Explore
Sign in
Commits on Source (3)
Added possibility to load XML models also from config folder
· 72577a25
Sonia Zorba
authored
Nov 18, 2021
72577a25
CI: added configuration for tagged installer
· f94c6237
Sonia Zorba
authored
Nov 18, 2021
f94c6237
Set version to 1.3.5
· b8b9eac9
Sonia Zorba
authored
Nov 18, 2021
b8b9eac9
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
b8b9eac9
...
@@ -51,8 +51,6 @@ test_backend:
...
@@ -51,8 +51,6 @@ test_backend:
upload_installer
:
upload_installer
:
stage
:
deploy
stage
:
deploy
tags
:
-
shell
tags
:
tags
:
-
shell
-
shell
only
:
only
:
...
@@ -60,3 +58,13 @@ upload_installer:
...
@@ -60,3 +58,13 @@ upload_installer:
script
:
script
:
-
'
curl
--header
"JOB-TOKEN:
$CI_JOB_TOKEN"
--upload-file
install.sh
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/TASMAN/latest/install.sh"'
-
'
curl
--header
"JOB-TOKEN:
$CI_JOB_TOKEN"
--upload-file
install.sh
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/TASMAN/latest/install.sh"'
-
'
curl
--header
"JOB-TOKEN:
$CI_JOB_TOKEN"
--upload-file
install-jdk8.sh
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/TASMAN/latest/install-jdk8.sh"'
-
'
curl
--header
"JOB-TOKEN:
$CI_JOB_TOKEN"
--upload-file
install-jdk8.sh
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/TASMAN/latest/install-jdk8.sh"'
upload_tagged_installer
:
stage
:
deploy
tags
:
-
shell
rules
:
-
if
:
'
$CI_COMMIT_TAG
!=
null'
script
:
-
'
curl
--header
"JOB-TOKEN:
$CI_JOB_TOKEN"
--upload-file
install.sh
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/TASMAN/${CI_COMMIT_TAG}/install-${CI_COMMIT_TAG}.sh"'
-
'
curl
--header
"JOB-TOKEN:
$CI_JOB_TOKEN"
--upload-file
install-jdk8.sh
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/TASMAN/${CI_COMMIT_TAG}/install-${CI_COMMIT_TAG}-jdk8.sh"'
CHANGELOG.md
View file @
b8b9eac9
# CHANGELOG
# CHANGELOG
## Version 1.3.5
*
Added possibility to load custom TAP_SCHEMA XML models also from configuration folder (inside a folder named
`schema_definition`
).
## Version 1.3.4
## Version 1.3.4
*
Bugfix: loaded also Postgres views metadata
*
Bugfix: loaded also Postgres views metadata
...
...
TASMAN-bom/pom.xml
View file @
b8b9eac9
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<groupId>
it.inaf.ia2.tsm
</groupId>
<groupId>
it.inaf.ia2.tsm
</groupId>
<artifactId>
tasman-bom
</artifactId>
<artifactId>
tasman-bom
</artifactId>
<version>
1.3.
4
</version>
<version>
1.3.
5
</version>
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
...
@@ -54,4 +54,4 @@
...
@@ -54,4 +54,4 @@
</plugin>
</plugin>
</plugins>
</plugins>
</build>
</build>
</project>
</project>
\ No newline at end of file
TASMAN-core/pom.xml
View file @
b8b9eac9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<groupId>
it.inaf.ia2.tsm
</groupId>
<groupId>
it.inaf.ia2.tsm
</groupId>
<artifactId>
tasman-bom
</artifactId>
<artifactId>
tasman-bom
</artifactId>
<version>
1.3.
4
</version>
<version>
1.3.
5
</version>
</parent>
</parent>
<artifactId>
tasman-core
</artifactId>
<artifactId>
tasman-core
</artifactId>
...
@@ -134,4 +134,4 @@
...
@@ -134,4 +134,4 @@
</plugin>
</plugin>
</plugins>
</plugins>
</build>
</build>
</project>
</project>
\ No newline at end of file
TASMAN-core/src/main/java/it/inaf/ia2/tsm/model/SchemaModels.java
View file @
b8b9eac9
...
@@ -53,12 +53,26 @@ public class SchemaModels {
...
@@ -53,12 +53,26 @@ public class SchemaModels {
String
[]
tapSchemaModelFiles
=
getXMLModelFileNames
(
properties
,
"tap_schema_models"
);
String
[]
tapSchemaModelFiles
=
getXMLModelFileNames
(
properties
,
"tap_schema_models"
);
String
[]
ivoaModelFiles
=
getXMLModelFileNames
(
properties
,
"ivoa_schema_models"
);
String
[]
ivoaModelFiles
=
getXMLModelFileNames
(
properties
,
"ivoa_schema_models"
);
TAP_SCHEMA_MODELS
=
new
XMLModelsLoader
(
tapSchemaModelFiles
).
load
();
TAP_SCHEMA_MODELS
=
new
XMLModelsLoader
(
tapSchemaModelFiles
,
getTapSchemaModelsFromExternalFolder
()
).
load
();
IVOA_SCHEMA_MODELS
=
new
XMLModelsLoader
(
ivoaModelFiles
).
load
();
IVOA_SCHEMA_MODELS
=
new
XMLModelsLoader
(
ivoaModelFiles
).
load
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
ExceptionInInitializerError
(
e
);
throw
new
ExceptionInInitializerError
(
e
);
}
}
}
}
private
static
File
[]
getTapSchemaModelsFromExternalFolder
()
{
String
tasmanConfigFolder
=
System
.
getenv
(
"TASMAN_CONFIG_FOLDER"
);
if
(
tasmanConfigFolder
!=
null
)
{
File
tapSchemaModelsExternalFolder
=
new
File
(
tasmanConfigFolder
).
toPath
().
resolve
(
"schema_definition"
).
toFile
();
if
(
tapSchemaModelsExternalFolder
.
exists
())
{
return
tapSchemaModelsExternalFolder
.
listFiles
();
}
}
return
new
File
[]{};
}
private
static
Properties
getCoreProperties
()
throws
IOException
{
private
static
Properties
getCoreProperties
()
throws
IOException
{
Properties
props
=
new
Properties
();
Properties
props
=
new
Properties
();
...
...
TASMAN-core/src/main/java/it/inaf/ia2/tsm/model/XMLModelsLoader.java
View file @
b8b9eac9
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,8 @@
*/
*/
package
it.inaf.ia2.tsm.model
;
package
it.inaf.ia2.tsm.model
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -52,13 +54,19 @@ public class XMLModelsLoader {
...
@@ -52,13 +54,19 @@ public class XMLModelsLoader {
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
XMLModelsLoader
.
class
);
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
XMLModelsLoader
.
class
);
private
final
String
[]
xmlModelFileNames
;
private
final
String
[]
xmlModelFileNames
;
private
final
File
[]
xmlModelExternalFiles
;
// key: doc version
// key: doc version
private
final
Map
<
String
,
Document
>
documents
;
private
final
Map
<
String
,
Document
>
documents
;
private
final
Map
<
String
,
String
>
inheritanceGraph
;
private
final
Map
<
String
,
String
>
inheritanceGraph
;
private
final
Map
<
Integer
,
List
<
Document
>>
inheritanceLevels
;
private
final
Map
<
Integer
,
List
<
Document
>>
inheritanceLevels
;
public
XMLModelsLoader
(
String
[]
xmlModelFileNames
)
{
public
XMLModelsLoader
(
String
[]
xmlModelFileNames
)
{
this
(
xmlModelFileNames
,
new
File
[]{});
}
public
XMLModelsLoader
(
String
[]
xmlModelFileNames
,
File
[]
xmlModelExternalFiles
)
{
this
.
xmlModelFileNames
=
xmlModelFileNames
;
this
.
xmlModelFileNames
=
xmlModelFileNames
;
this
.
xmlModelExternalFiles
=
xmlModelExternalFiles
;
this
.
documents
=
new
HashMap
<>();
this
.
documents
=
new
HashMap
<>();
inheritanceGraph
=
new
HashMap
<>();
inheritanceGraph
=
new
HashMap
<>();
inheritanceLevels
=
new
HashMap
<>();
inheritanceLevels
=
new
HashMap
<>();
...
@@ -110,19 +118,29 @@ public class XMLModelsLoader {
...
@@ -110,19 +118,29 @@ public class XMLModelsLoader {
for
(
String
xmlModelFileName
:
xmlModelFileNames
)
{
for
(
String
xmlModelFileName
:
xmlModelFileNames
)
{
try
(
InputStream
in
=
classLoader
.
getResourceAsStream
(
xmlModelFileName
))
{
try
(
InputStream
in
=
classLoader
.
getResourceAsStream
(
xmlModelFileName
))
{
Document
doc
=
builder
.
parse
(
in
);
loadFile
(
builder
,
in
);
Element
root
=
doc
.
getDocumentElement
();
}
String
version
=
root
.
getAttribute
(
"version"
);
}
// TODO: XML Model validation
for
(
File
xmlModelExternalFile
:
xmlModelExternalFiles
)
{
// Documents loaded in a single XMLModelsLoader instance must
try
(
FileInputStream
fis
=
new
FileInputStream
(
xmlModelExternalFile
))
{
// have different versions.
loadFile
(
builder
,
fis
);
assert
documents
.
get
(
version
)
==
null
;
documents
.
put
(
version
,
doc
);
}
}
}
}
}
}
private
void
loadFile
(
DocumentBuilder
builder
,
InputStream
in
)
throws
IOException
,
SAXException
{
Document
doc
=
builder
.
parse
(
in
);
Element
root
=
doc
.
getDocumentElement
();
String
version
=
root
.
getAttribute
(
"version"
);
// TODO: XML Model validation
// Documents loaded in a single XMLModelsLoader instance must
// have different versions.
assert
documents
.
get
(
version
)
==
null
;
documents
.
put
(
version
,
doc
);
}
private
void
buildInheritanceGraph
()
{
private
void
buildInheritanceGraph
()
{
for
(
Document
document
:
documents
.
values
())
{
for
(
Document
document
:
documents
.
values
())
{
Element
root
=
document
.
getDocumentElement
();
Element
root
=
document
.
getDocumentElement
();
...
...
TASMAN-embedded/pom.xml
View file @
b8b9eac9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<groupId>
it.inaf.ia2.tsm
</groupId>
<groupId>
it.inaf.ia2.tsm
</groupId>
<artifactId>
tasman-bom
</artifactId>
<artifactId>
tasman-bom
</artifactId>
<version>
1.3.
4
</version>
<version>
1.3.
5
</version>
</parent>
</parent>
<artifactId>
tasman-embedded
</artifactId>
<artifactId>
tasman-embedded
</artifactId>
...
@@ -86,4 +86,4 @@
...
@@ -86,4 +86,4 @@
</plugin>
</plugin>
</plugins>
</plugins>
</build>
</build>
</project>
</project>
\ No newline at end of file
TASMAN-webapp/pom.xml
View file @
b8b9eac9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<groupId>
it.inaf.ia2.tsm
</groupId>
<groupId>
it.inaf.ia2.tsm
</groupId>
<artifactId>
tasman-bom
</artifactId>
<artifactId>
tasman-bom
</artifactId>
<version>
1.3.
4
</version>
<version>
1.3.
5
</version>
</parent>
</parent>
<artifactId>
tasman-webapp
</artifactId>
<artifactId>
tasman-webapp
</artifactId>
...
...
config.properties.example
View file @
b8b9eac9
ucd_service_url=http://ia2-vo.oats.inaf.it/ucd/
ucd_service_url=http://ia2-vo.oats.inaf.it/ucd/
config_directory=/home/user/.tasman
config_directory=/etc/tasman
\ No newline at end of file
install_template.sh
View file @
b8b9eac9
...
@@ -110,8 +110,8 @@ cd - 1> /dev/null
...
@@ -110,8 +110,8 @@ cd - 1> /dev/null
# Creating executable
# Creating executable
tasman_bin
=
"
$install_dir
""tasman"
tasman_bin
=
"
$install_dir
""tasman"
echo
"#!/bin/
ba
sh"
>
$tasman_bin
echo
"#!/bin/sh"
>
$tasman_bin
echo
"java -jar
$install_dir
""tasman-embedded.jar
\$
1"
>>
$tasman_bin
echo
"
TASMAN_CONFIG_FOLDER=
$tasman_config_dir
java -jar
$install_dir
""tasman-embedded.jar
\$
1"
>>
$tasman_bin
chmod
+x
$tasman_bin
chmod
+x
$tasman_bin
# Creating executable symbolic link
# Creating executable symbolic link
...
...