Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Adam Kučera
semanticBMS
Commits
419a955c
Commit
419a955c
authored
Jun 29, 2016
by
akucera
Browse files
solved cleanup after batch update
parent
323bcc6d
Changes
11
Hide whitespace changes
Inline
Side-by-side
SemanticBMSClient/edit.html
View file @
419a955c
...
...
@@ -128,6 +128,13 @@
$
(
"
#sendRemove
"
).
click
(
function
()
{
if
(
$
(
"
#user
"
).
val
().
trim
()
==
""
||
$
(
"
#pass
"
).
val
().
trim
()
==
""
)
{
$
(
"
#status
"
).
html
(
$
.
t
(
"
Enter valid credentials.
"
));
p
.
toggleButtonError
(
"
removeOverallStatus
"
,
"
Forbidden
"
);
return
;
}
var
glyphDP
=
"
minus
"
;
var
glyphRels
=
"
minus
"
;
var
glyphTrends
=
"
minus
"
;
...
...
@@ -161,8 +168,10 @@
if
(
assertions
.
length
>
0
&&
ids
.
length
>
0
)
p
.
removeAssertions
(
assertions
,
0
,
ids
,
0
);
if
(
assertions
.
length
>
0
&&
ids
.
length
>
0
)
{
p
.
removeAssertions
(
assertions
,
0
,
ids
,
0
);
p
.
toggleButtonSending
(
"
removeOverallStatus
"
);
}
}
...
...
@@ -204,7 +213,14 @@
}
else
if
(
iA
<
assertions
.
length
)
{
p
.
removeAssertions
(
assertions
,
++
iA
,
ids
,
0
);
}
}
else
{
$
(
"
#removeOverallStatus
"
).
html
(
$
.
t
(
"
Finishing...
"
));
// query to reopen the model
$
.
ajax
({
type
:
"
get
"
,
url
:
SBMSPage
.
prototype
.
sbmsURL
+
"
datapoints/
"
+
ids
[
0
]
}).
done
(
function
()
{
p
.
toggleButtonSuccess
(
"
removeOverallStatus
"
);
p
.
toggleButtonComplete
(
"
removeOverallStatus
"
,
"
success
"
);
});
}
},
parseRawInput
:
function
(
input
,
headersPresent
,
delimiter
)
{
...
...
@@ -275,28 +291,28 @@
},
sendInsertBatch
:
function
()
{
p
.
toggleButtonSending
();
p
.
toggleButtonSending
(
"
batchOverallStatus
"
);
if
(
datapoints
.
length
>
0
)
{
index
=
0
;
p
.
proceedSend
(
datapoints
,
index
,
function
()
{
p
.
toggleButtonSuccess
();
p
.
toggleButtonComplete
(
"
Completed
"
);
p
.
toggleButtonSuccess
(
"
batchOverallStatus
"
);
p
.
toggleButtonComplete
(
"
batchOverallStatus
"
,
"
success
"
);
});
}
},
proceedSend
:
function
(
data
,
index
,
completeAction
)
{
if
(
index
<
data
.
length
)
{
p
.
insertDP
(
data
[
index
],
function
()
{
},
function
()
{
},
function
(
error
)
{
},
function
(
status
)
{
if
(
S
tatus
==
"
success
"
)
{
p
.
insertDP
(
data
[
index
],
function
(
id
)
{
},
function
(
id
)
{
},
function
(
id
,
error
)
{
},
function
(
id
,
status
)
{
if
(
s
tatus
==
"
success
"
)
{
p
.
proceedSend
(
data
,
index
+
1
,
completeAction
);
}
else
{
completeAction
();
}
},
"
logBatch
"
);
},
"
logBatch
"
,
"
batchOverallStatus
"
);
}
else
{
completeAction
();
}
...
...
@@ -313,11 +329,11 @@
if
(
dp
!=
null
)
{
p
.
insertDP
(
dp
,
p
.
toggleButtonSending
,
p
.
toggleButtonSuccess
,
p
.
toggleButtonError
,
p
.
toggleButtonComplete
,
"
logSingle
"
);
"
logSingle
"
,
"
status
"
);
}
},
insertDP
:
function
(
dp
,
ba
,
sa
,
ea
,
ca
,
logId
)
{
insertDP
:
function
(
dp
,
ba
,
sa
,
ea
,
ca
,
logId
,
overallStatusId
)
{
var
query
=
p
.
sbmsURL
+
"
datapoints/
"
;
$
.
ajax
({
type
:
'
POST
'
,
...
...
@@ -330,21 +346,21 @@
contentType
:
'
application/json
'
,
beforeSend
:
function
(
xhr
)
{
p
.
setAuth
(
xhr
);
ba
();
ba
(
overallStatusId
);
$
(
"
#
"
+
logId
).
append
(
"
\n
Sending dp:
"
+
JSON
.
stringify
(
dp
,
null
,
2
));
},
success
:
function
(
result
)
{
sa
();
sa
(
overallStatusId
);
$
(
"
#
"
+
logId
).
append
(
"
\n
Success
"
);
},
error
:
function
(
xhr
,
status
,
error
)
{
ea
(
error
);
ea
(
overallStatusId
,
error
);
$
(
"
#
"
+
logId
)
.
append
(
"
\n
Error -
"
+
status
+
"
-
"
+
error
);
},
complete
:
function
(
xhr
,
status
)
{
ca
(
status
);
ca
(
overallStatusId
,
status
);
$
(
"
#
"
+
logId
).
append
(
"
\n
Complete -
"
+
status
+
"
\n
-----------
"
);
}
...
...
@@ -427,7 +443,6 @@
</nav>
<form
id=
"queryForm"
>
<div
class=
"container-fluid"
>
<ul
class=
"nav nav-tabs"
>
<li
role=
"presentation"
class=
"active opNav"
data-show-div=
"tabInsertSingle"
id=
"navInsertSingle"
><a
...
...
@@ -453,18 +468,18 @@
data-incl-file=
"inclInsertBatch.html"
></div>
<div
id=
"tabInsertTrends"
class=
"opDiv"
data-incl-file=
"inclInsertTrend
s
.html"
>
<p>
TODO Trends insert
</p>
data-incl-file=
"inclInsertTrend.html"
>
</div>
<div
id=
"tabInsertPrograms"
class=
"opDiv"
data-incl-file=
"inclInsertProgram
s
.html"
>
<p>
TODO Programs insert
</p>
data-incl-file=
"inclInsertProgram.html"
>
</div>
<div
id=
"tabInsertInfluence"
class=
"opDiv"
data-incl-file=
"inclInsertInfluence.html"
>
<p>
TODO Influence insert
</p>
</div>
<div
id=
"tabRemoveBatch"
class=
"opDiv"
...
...
SemanticBMSClient/inclInsertBatch.html
View file @
419a955c
...
...
@@ -19,7 +19,7 @@
</div>
<div
class=
"form-group"
>
<button
type=
"button"
id=
"parseBatch"
class=
"btn btn-info"
>
Parse data
</button>
<button
type=
"button"
id=
"sendBatch"
class=
"btn btn-primary"
>
Save data
</button>
<button
type=
"button"
id=
"sendBatch"
class=
"
sendButton
btn btn-primary"
>
Save data
</button>
</div>
<h4>
Console
</h4>
...
...
SemanticBMSClient/inclInsertInfluence.html
0 → 100644
View file @
419a955c
<p>
TODO Influence insert
</p>
\ No newline at end of file
SemanticBMSClient/inclInsertProgram.html
0 → 100644
View file @
419a955c
<p>
TODO Programs insert
</p>
\ No newline at end of file
SemanticBMSClient/inclInsertSingle.html
View file @
419a955c
...
...
@@ -13,7 +13,7 @@
<div
class=
"panel-body"
>
<div
class=
"form-group form-horizontal text-center"
>
<h3><span
id=
"status"
class=
"label label-lg label-success"
>
Ready
</span>
<button
type=
"button"
id=
"sendSingle"
class=
"btn btn-primary"
>
Send query
</button></h3>
<button
type=
"button"
id=
"sendSingle"
class=
"
sendButton
btn btn-primary"
>
Send query
</button></h3>
</div>
<div
class=
"panel-body"
>
<pre
id=
"console"
class=
"bg-info"
><small
id=
"logSingle"
>
Ready
</small></pre>
...
...
SemanticBMSClient/inclInsertTrend.html
0 → 100644
View file @
419a955c
<p>
TODO Trends insert
</p>
\ No newline at end of file
SemanticBMSClient/inclRemoveBatch.html
View file @
419a955c
...
...
@@ -8,7 +8,10 @@
<div
class=
"checkbox"
><label><input
type=
"checkbox"
name=
"relsToRemove"
id=
"removeRels"
value=
"relations"
>
Relation (influences, uses) assertions
</label></div>
<div
class=
"checkbox"
><label><input
type=
"checkbox"
name=
"relsToRemove"
id=
"removeTrends"
value=
"trends"
>
Trend assertions
</label></div>
</div>
<button
type=
"button"
id=
"sendRemove"
class=
"btn btn-primary"
>
Remove data
</button>
<h3><button
type=
"button"
id=
"sendRemove"
class=
"sendButton btn btn-primary"
>
Remove data
</button>
<span
id=
"removeOverallStatus"
class=
"label label-success"
data-i18n=
"Ready"
>
Ready
</span>
</h3>
</div>
<div
class=
"col-lg-4 col-md-4"
>
...
...
SemanticBMSClient/js/scripts.js
View file @
419a955c
...
...
@@ -17,7 +17,7 @@ function SBMSPage(initFunc, vars, customFunc) {
$
(
document
).
ready
([
this
.
i18nInit
,
this
.
savePassInit
,
initFunc
]);
$
(
document
).
ready
([
this
.
showLoading
,
this
.
i18nInit
,
this
.
savePassInit
,
initFunc
]);
}
SBMSPage
.
prototype
.
trees
=
{};
SBMSPage
.
prototype
.
mapURL
=
"
https://kompas.muni.cz/auth/
"
;
...
...
@@ -27,30 +27,30 @@ function SBMSPage(initFunc, vars, customFunc) {
xhr
.
setRequestHeader
(
'
authorization
'
,
"
Basic
"
+
Base64
.
encode
(
$
(
"
#user
"
).
val
()
+
"
:
"
+
$
(
"
#pass
"
).
val
()));
};
SBMSPage
.
prototype
.
toggleButtonSending
=
function
()
{
$
(
"
#
status
"
).
html
(
$
.
t
(
"
Sending...
"
));
$
(
"
#
status
"
).
removeClass
(
"
label-success
"
);
$
(
"
#
status
"
).
removeClass
(
"
label-danger
"
);
$
(
"
#
status
"
).
addClass
(
"
label-info
"
);
$
(
"
#
send
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
SBMSPage
.
prototype
.
toggleButtonSending
=
function
(
id
)
{
$
(
"
#
"
+
id
).
html
(
$
.
t
(
"
Sending...
"
));
$
(
"
#
"
+
id
).
removeClass
(
"
label-success
"
);
$
(
"
#
"
+
id
).
removeClass
(
"
label-danger
"
);
$
(
"
#
"
+
id
).
addClass
(
"
label-info
"
);
$
(
"
.
send
Button
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
};
SBMSPage
.
prototype
.
toggleButtonSuccess
=
function
()
{
$
(
"
#
status
"
).
html
(
$
.
t
(
"
Completed
"
));
$
(
"
#
status
"
).
removeClass
(
"
label-info
"
);
$
(
"
#
status
"
).
addClass
(
"
label-success
"
);
SBMSPage
.
prototype
.
toggleButtonSuccess
=
function
(
id
)
{
$
(
"
#
"
+
id
).
html
(
$
.
t
(
"
Completed
"
));
$
(
"
#
"
+
id
).
removeClass
(
"
label-info
"
);
$
(
"
#
"
+
id
).
addClass
(
"
label-success
"
);
};
SBMSPage
.
prototype
.
toggleButtonError
=
function
(
error
)
{
SBMSPage
.
prototype
.
toggleButtonError
=
function
(
id
,
error
)
{
//$(resultsDivId).html(status + ":" + error);
$
(
"
#
status
"
).
html
(
$
.
t
(
"
Error:
"
)
+
$
.
t
(
error
));
$
(
"
#
status
"
).
removeClass
(
"
label-info
"
);
$
(
"
#
status
"
).
addClass
(
"
label-danger
"
);
$
(
"
#
"
+
id
).
html
(
$
.
t
(
"
Error:
"
)
+
$
.
t
(
error
));
$
(
"
#
"
+
id
).
removeClass
(
"
label-info
"
);
$
(
"
#
"
+
id
).
addClass
(
"
label-danger
"
);
};
SBMSPage
.
prototype
.
toggleButtonComplete
=
function
(
status
)
{
SBMSPage
.
prototype
.
toggleButtonComplete
=
function
(
id
,
status
)
{
//$("#status").html("Completed with " + status);
$
(
"
#
send
"
).
removeAttr
(
"
disabled
"
);
$
(
"
.
send
Button
"
).
removeAttr
(
"
disabled
"
);
};
SBMSPage
.
prototype
.
loadList
=
function
(
type
,
func
,
params
)
{
...
...
@@ -121,6 +121,7 @@ function SBMSPage(initFunc, vars, customFunc) {
cache
:
true
,
url
:
SBMSPage
.
prototype
.
sbmsURL
+
"
types/field.source
"
}).
done
(
function
(
fieldsList
)
{
// saving to cache
SBMSPage
.
prototype
.
fieldCategories
=
fieldsList
;
for
(
i
=
0
;
i
<
data
.
length
;
i
++
)
{
var
parent
=
params
[
0
];
//(columns) ? params[0] + "Col" + Math.floor((i / (Math.floor(data.length / 2) + 1))) : params[0];
...
...
@@ -402,6 +403,16 @@ i18next.init({
});
};
SBMSPage
.
prototype
.
showLoading
=
function
()
{
$
(
"
body
"
).
append
(
'
<div id="loading" class="text-center"><h3><span class="glyphicon glyphicon-hourglass" aria-hidden="true"></span></h3></div>
'
);
$
(
"
#loading
"
).
dialog
({
dialogClass
:
"
no-close
"
,
modal
:
true
,
title
:
"
Loading...
"
});
$
(
document
).
ajaxStop
(
function
()
{
$
(
"
#loading
"
).
dialog
(
"
close
"
);})
}
SBMSPage
.
prototype
.
savePassInit
=
function
()
{
$
(
"
#login
"
).
submit
(
function
()
{
this
.
reset
();
...
...
SemanticBMSClient/query.html
View file @
419a955c
...
...
@@ -51,14 +51,6 @@
var
p
=
new
SBMSPage
(
function
()
{
$
(
"
#loading
"
).
dialog
({
dialogClass
:
"
no-close
"
,
modal
:
true
,
title
:
"
Loading...
"
});
$
(
document
).
ajaxStop
(
function
()
{
$
(
"
#loading
"
).
dialog
(
"
close
"
);})
$
(
"
#results
"
).
hide
();
$
(
"
#resultsJSON
"
).
hide
();
...
...
@@ -197,19 +189,19 @@ var p = new SBMSPage (function() {
data
:
data
,
beforeSend
:
function
(
xhr
)
{
p
.
setAuth
(
xhr
);
p
.
toggleButtonSending
();
p
.
toggleButtonSending
(
"
status
"
);
},
success
:
function
(
result
)
{
$
(
"
#results
"
).
show
();
$
(
"
#resultsJSON
"
).
html
(
"
<code id='json'><pre>
"
+
JSON
.
stringify
(
result
,
null
,
2
)
+
"
</pre></code>
"
);
p
.
makeTableFromJSON
(
result
,
'
input[name=fieldsC]:checked
'
,
"
#resultsTable
"
);
p
.
toggleButtonSuccess
();
p
.
toggleButtonSuccess
(
"
status
"
);
},
error
:
function
(
xhr
,
status
,
error
)
{
p
.
toggleButtonError
(
error
);
p
.
toggleButtonError
(
"
status
"
,
error
);
},
complete
:
function
(
xhr
,
status
)
{
p
.
toggleButtonComplete
(
status
);
p
.
toggleButtonComplete
(
"
status
"
,
status
);
}
});
...
...
@@ -372,7 +364,7 @@ var p = new SBMSPage (function() {
<div
class=
"panel-body"
>
<div
class=
"form-inline"
>
<h3><button
type=
"button"
id=
"send"
class=
"btn btn-primary"
data-i18n=
"Send query"
>
Send query
</button>
<h3><button
type=
"button"
id=
"send"
class=
"
sendButton
btn btn-primary"
data-i18n=
"Send query"
>
Send query
</button>
<span
id=
"status"
class=
"label label-success"
data-i18n=
"Ready"
>
Ready
</span></h3>
</div>
...
...
@@ -400,6 +392,5 @@ var p = new SBMSPage (function() {
<div
id=
"treeSelect"
title=
"Select value"
>
<div
id=
"tree"
></div>
</div>
<div
id=
"loading"
class=
"text-center"
><h3><span
class=
"glyphicon glyphicon-hourglass"
aria-hidden=
"true"
></span></h3></div>
</body>
</html>
\ No newline at end of file
SemanticBMSClient/sparql.html
View file @
419a955c
...
...
@@ -42,7 +42,7 @@ sendSPARQL: function () {
url
:
query
,
beforeSend
:
function
(
xhr
)
{
p
.
setAuth
(
xhr
);
p
.
toggleButtonSending
();
p
.
toggleButtonSending
(
"
status
"
);
},
success
:
function
(
result
)
{
if
(
format
==
"
json
"
)
{
...
...
@@ -51,14 +51,14 @@ sendSPARQL: function () {
}
else
{
p
.
makeTableFromCSV
(
result
,
"
#results
"
);
}
p
.
toggleButtonSuccess
();
p
.
toggleButtonSuccess
(
"
status
"
);
$
(
"
#sparql
"
).
attr
(
"
rows
"
,
"
3
"
);
},
error
:
function
(
xhr
,
status
,
error
)
{
p
.
toggleButtonError
(
error
);
p
.
toggleButtonError
(
"
status
"
,
error
);
},
complete
:
function
(
xhr
,
status
)
{
p
.
toggleButtonComplete
(
status
);
p
.
toggleButtonComplete
(
"
status
"
,
status
);
}
});
},
...
...
@@ -166,7 +166,7 @@ WHERE {
<label
class=
"radio-inline"
><input
type=
"radio"
name=
"format"
value=
"json"
>
JSON
</label>
</div>
<div
class=
"form-group form-inline"
>
<button
type=
"button"
id=
"send"
class=
"btn btn-primary"
>
Send query
</button>
<button
type=
"button"
id=
"send"
class=
"
sendButton
btn btn-primary"
>
Send query
</button>
<span
id=
"status"
class=
"label label-success"
>
Ready
</span>
</div>
<div
class=
"form-group"
>
...
...
SemanticBMSServer/src/main/java/cz/muni/fi/lasaris/sbms/model/TdbConnector.java
View file @
419a955c
...
...
@@ -104,8 +104,9 @@ public class TdbConnector {
throw
new
IllegalStateException
(
"Tdb not opened"
);
}
if
(
dirty
.
compareAndSet
(
true
,
false
))
{
if
(
checkDirty
&&
dirty
.
compareAndSet
(
true
,
false
))
{
logger
.
debug
(
"cached model is dirty - reopening"
);
open
();
ModelUpdater
.
cleanup
();
open
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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