Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Uploader
Commits
2fd3cd82
Commit
2fd3cd82
authored
Sep 08, 2019
by
Matija Obreza
Browse files
Merge branch '29-add-aegis-flag' into 'master'
Resolve "Add AEGIS flag" Closes
#29
See merge request
!23
parents
cd1273af
7654c623
Changes
5
Hide whitespace changes
Inline
Side-by-side
anno-gui/src/main/java/org/genesys2/anno/gui/PushDialog.java
View file @
2fd3cd82
...
@@ -87,6 +87,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
...
@@ -87,6 +87,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
swing2swt.layout.BorderLayout
;
import
swing2swt.layout.BorderLayout
;
import
org.eclipse.swt.events.KeyAdapter
;
import
org.eclipse.swt.events.KeyEvent
;
public
class
PushDialog
extends
Dialog
{
public
class
PushDialog
extends
Dialog
{
private
static
final
Logger
_log
=
Logger
.
getLogger
(
PushDialog
.
class
);
private
static
final
Logger
_log
=
Logger
.
getLogger
(
PushDialog
.
class
);
...
@@ -212,6 +214,14 @@ public class PushDialog extends Dialog {
...
@@ -212,6 +214,14 @@ public class PushDialog extends Dialog {
createContents
();
createContents
();
logAppender
=
new
SwtLogAppender
(
this
.
txtJson
);
logAppender
=
new
SwtLogAppender
(
this
.
txtJson
);
txtJson
.
addKeyListener
(
new
KeyAdapter
()
{
@Override
public
void
keyPressed
(
KeyEvent
e
)
{
if
(
e
.
character
==
'k'
&&
(
e
.
stateMask
==
SWT
.
COMMAND
||
e
.
stateMask
==
SWT
.
CTRL
))
{
logAppender
.
clearBuffer
();
}
}
});
Composite
composite
=
new
Composite
(
shell
,
SWT
.
NO_FOCUS
);
Composite
composite
=
new
Composite
(
shell
,
SWT
.
NO_FOCUS
);
composite
.
setLayoutData
(
BorderLayout
.
SOUTH
);
composite
.
setLayoutData
(
BorderLayout
.
SOUTH
);
...
@@ -297,6 +307,9 @@ public class PushDialog extends Dialog {
...
@@ -297,6 +307,9 @@ public class PushDialog extends Dialog {
for
(
int
i
=
futures
.
size
()
-
1
;
i
>=
0
;
i
--)
{
for
(
int
i
=
futures
.
size
()
-
1
;
i
>=
0
;
i
--)
{
Future
<?>
future
=
futures
.
get
(
i
);
Future
<?>
future
=
futures
.
get
(
i
);
if
(
future
==
null
)
{
continue
;
}
if
(
future
.
isDone
()
||
future
.
isCancelled
())
{
if
(
future
.
isDone
()
||
future
.
isCancelled
())
{
futures
.
remove
(
future
);
futures
.
remove
(
future
);
}
else
{
}
else
{
...
@@ -512,9 +525,12 @@ public class PushDialog extends Dialog {
...
@@ -512,9 +525,12 @@ public class PushDialog extends Dialog {
long
lastTime
=
0
;
long
lastTime
=
0
;
do
{
do
{
for
(
int
i
=
futures
.
size
()
-
1
;
i
>=
0
;
i
--)
{
for
(
int
i
=
futures
.
size
()
-
1
;
i
>=
0
;
i
--)
{
Future
<?>
f
=
futures
.
get
(
i
);
Future
<?>
future
=
futures
.
get
(
i
);
if
(
f
.
isDone
())
{
if
(
future
==
null
)
{
futures
.
remove
(
f
);
continue
;
}
if
(
future
.
isDone
())
{
futures
.
remove
(
future
);
}
}
}
}
...
@@ -676,7 +692,7 @@ public class PushDialog extends Dialog {
...
@@ -676,7 +692,7 @@ public class PushDialog extends Dialog {
// If filtering, check INSTCODE is listed
// If filtering, check INSTCODE is listed
if
(
instCodesFilter
.
size
()
>
0
&&
!(
isBlackList
^
instCodesFilter
.
contains
(
accessionInstCode
)))
{
if
(
instCodesFilter
.
size
()
>
0
&&
!(
isBlackList
^
instCodesFilter
.
contains
(
accessionInstCode
)))
{
_log
.
info
(
"Ignoring accessions with inst code : "
+
accessionInstCode
);
_log
.
debug
(
"Ignoring accessions with inst code : "
+
accessionInstCode
);
continue
;
continue
;
}
}
...
...
anno-gui/src/main/java/org/genesys2/anno/gui/SwtLogAppender.java
View file @
2fd3cd82
...
@@ -47,6 +47,17 @@ public class SwtLogAppender extends WriterAppender {
...
@@ -47,6 +47,17 @@ public class SwtLogAppender extends WriterAppender {
patternLayout
.
setConversionPattern
(
DEFAULT_LAYOUT_PATTERN
);
patternLayout
.
setConversionPattern
(
DEFAULT_LAYOUT_PATTERN
);
setLayout
(
patternLayout
);
setLayout
(
patternLayout
);
}
}
public
void
clearBuffer
()
{
synchronized
(
logBuffer
)
{
display
.
asyncExec
(()
->
{
if
(
text
!=
null
)
{
text
.
setText
(
""
);
}
});
logBuffer
.
delete
(
0
,
logBuffer
.
length
());
}
}
public
void
setConversionPattern
(
String
conversionPattern
)
{
public
void
setConversionPattern
(
String
conversionPattern
)
{
PatternLayout
patternLayout
=
(
PatternLayout
)
getLayout
();
PatternLayout
patternLayout
=
(
PatternLayout
)
getLayout
();
...
@@ -75,14 +86,16 @@ public class SwtLogAppender extends WriterAppender {
...
@@ -75,14 +86,16 @@ public class SwtLogAppender extends WriterAppender {
}
}
}
}
final
String
mes
=
layout
.
format
(
loggingEvent
)
+
(
throwableStr
==
null
?
""
:
sb
.
toString
());
final
String
mes
=
layout
.
format
(
loggingEvent
)
+
(
throwableStr
==
null
?
""
:
sb
.
toString
());
logBuffer
.
append
(
mes
);
synchronized
(
logBuffer
)
{
if
(
logBuffer
.
length
()
>
maxBufferSize
&&
text
.
getSelectionCount
()
==
0
)
{
logBuffer
.
append
(
mes
);
// System.err.println("CLEARING POOL len=" + logBuffer.length() +
if
(
logBuffer
.
length
()
>
maxBufferSize
)
{
// " removing=" + (logBuffer.length() - maxBufferSize));
// System.err.println("CLEARING POOL len=" + logBuffer.length() +
logBuffer
.
replace
(
0
,
logBuffer
.
length
()
-
maxBufferSize
,
""
);
// " removing=" + (logBuffer.length() - maxBufferSize));
int
pos
=
logBuffer
.
indexOf
(
"\n"
);
logBuffer
.
replace
(
0
,
logBuffer
.
length
()
-
maxBufferSize
,
""
);
if
(
pos
>=
0
)
{
int
pos
=
logBuffer
.
indexOf
(
"\n"
);
logBuffer
.
replace
(
0
,
pos
+
1
,
""
);
if
(
pos
>=
0
)
{
logBuffer
.
replace
(
0
,
pos
+
1
,
""
);
}
}
}
}
}
...
...
anno-gui/src/main/java/org/genesys2/anno/predefined/GenesysJSON.java
View file @
2fd3cd82
...
@@ -225,6 +225,9 @@ public class GenesysJSON {
...
@@ -225,6 +225,9 @@ public class GenesysJSON {
columnDef
=
new
JsonField
(
Api1Constants
.
Accession
.
MLSSTAT
,
RdfMCPD
.
MLSSTAT
).
setType
(
boolean
.
class
);
columnDef
=
new
JsonField
(
Api1Constants
.
Accession
.
MLSSTAT
,
RdfMCPD
.
MLSSTAT
).
setType
(
boolean
.
class
);
columns
.
add
(
columnDef
);
columns
.
add
(
columnDef
);
columnDef
=
new
JsonField
(
Api1Constants
.
Accession
.
AEGIS
,
RdfMCPD
.
AEGIS
).
setType
(
boolean
.
class
);
columns
.
add
(
columnDef
);
columnDef
=
new
JsonField
(
Api1Constants
.
Accession
.
INTRUST
,
RdfMCPD
.
FAOINTRUST
).
setType
(
boolean
.
class
);
columnDef
=
new
JsonField
(
Api1Constants
.
Accession
.
INTRUST
,
RdfMCPD
.
FAOINTRUST
).
setType
(
boolean
.
class
);
columns
.
add
(
columnDef
);
columns
.
add
(
columnDef
);
...
...
anno-gui/src/main/java/org/genesys2/anno/predefined/MCPD.java
View file @
2fd3cd82
...
@@ -164,6 +164,9 @@ public class MCPD {
...
@@ -164,6 +164,9 @@ public class MCPD {
columnDef
=
new
ColumnDef
(
"MLSSTAT"
,
"MLS status of the accession"
,
ColumnDataType
.
BOOLEAN
,
false
,
RdfMCPD
.
MLSSTAT
).
setIncludeNull
(
false
);
columnDef
=
new
ColumnDef
(
"MLSSTAT"
,
"MLS status of the accession"
,
ColumnDataType
.
BOOLEAN
,
false
,
RdfMCPD
.
MLSSTAT
).
setIncludeNull
(
false
);
columns
.
add
(
columnDef
);
columns
.
add
(
columnDef
);
columnDef
=
new
ColumnDef
(
"AEGIS"
,
"Aegis status of the accession"
,
ColumnDataType
.
BOOLEAN
,
false
,
RdfMCPD
.
AEGIS
).
setIncludeNull
(
false
);
columns
.
add
(
columnDef
);
columnDef
=
new
ColumnDef
(
"REMARKS"
,
"Remarks"
,
ColumnDataType
.
TEXT
,
false
,
RdfMCPD
.
REMARKS
).
setAllowMultiple
(
true
);
columnDef
=
new
ColumnDef
(
"REMARKS"
,
"Remarks"
,
ColumnDataType
.
TEXT
,
false
,
RdfMCPD
.
REMARKS
).
setAllowMultiple
(
true
);
columns
.
add
(
columnDef
);
columns
.
add
(
columnDef
);
...
...
anno-gui/src/main/java/org/genesys2/anno/predefined/RdfMCPD.java
View file @
2fd3cd82
...
@@ -23,6 +23,7 @@ public class RdfMCPD {
...
@@ -23,6 +23,7 @@ public class RdfMCPD {
public
static
final
String
ACCENUMB
=
"http://purl.org/germplasm/germplasmTerm#germplasmID"
;
public
static
final
String
ACCENUMB
=
"http://purl.org/germplasm/germplasmTerm#germplasmID"
;
public
static
final
String
ACCENUMB_NEW
=
"https://www.genesys-pgr.org/rdf/mcpd#newAcceNumb"
;
public
static
final
String
ACCENUMB_NEW
=
"https://www.genesys-pgr.org/rdf/mcpd#newAcceNumb"
;
public
static
final
String
AEGIS
=
"https://www.genesys-pgr.org/rdf/mcpd#aegis"
;
public
static
final
String
GENUS
=
"http://rs.tdwg.org/dwc/terms/genus"
;
public
static
final
String
GENUS
=
"http://rs.tdwg.org/dwc/terms/genus"
;
public
static
final
String
GENUS_NEW
=
"https://www.genesys-pgr.org/rdf/mcpd#newGenus"
;
public
static
final
String
GENUS_NEW
=
"https://www.genesys-pgr.org/rdf/mcpd#newGenus"
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment