File tree Expand file tree Collapse file tree 7 files changed +33
-5
lines changed
test/java/chatbot/lib/api/dbpedia Expand file tree Collapse file tree 7 files changed +33
-5
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ master_build:
39
39
<< : *build_template
40
40
only :
41
41
- master
42
- - tags
43
42
artifacts :
44
43
expire_in : 1 month
45
44
paths :
Original file line number Diff line number Diff line change 1
1
# DBpedia Chatbot
2
2
3
- ## [ GSoC Wiki] ( https://github.com/dbpedia/chatbot/wiki/GSoC-2017:-Chatbot-for-DBpedia )
3
+ [ ![ BCH compliance] ( https://bettercodehub.com/edge/badge/dbpedia/chatbot?branch=master )] ( https://bettercodehub.com/ )
4
+
5
+ For more information about this project and ** GSoC Progress** please refer to [ GSoC Wiki] ( https://github.com/dbpedia/chatbot/wiki/GSoC-2017:-Chatbot-for-DBpedia )
4
6
5
7
## Environment Configurations
6
8
admin.username = <admin-username>
35
37
## Development
36
38
mvn spring-boot:run
37
39
node/node node_modules/.bin/webpack --watch
40
+
41
+ ## Embed Code
42
+ Add the following snippet to the ` <head> ` section of the webpage where you want to embed the ChatBot.
43
+ ``` javascript
44
+ < script type= " text/javascript" >
45
+ window .onload = function () {
46
+ var iframe = document .createElement (" iframe" );
47
+ iframe .setAttribute (" src" , " http://chat.dbpedia.org/embed" );
48
+ iframe .setAttribute (" frameBorder" , 0 );
49
+ iframe .style .zIndex = 10000000 ;
50
+ iframe .style .height = " 100%" ;
51
+ iframe .style .width = " 40%" ;
52
+ iframe .style .position = " fixed" ;
53
+ iframe .style .bottom = " 20px" ;
54
+ iframe .style .right = " 20px" ;
55
+ document .body .appendChild (iframe);
56
+ }
57
+ < / script>
58
+ ```
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ class Embed extends React.Component {
26
26
</ div >
27
27
</ div >
28
28
< div className = "embed-chat-button-container" >
29
- < a className = "embed-chat-button btn btn-raised btn-fab btn-primary " onClick = { this . toggleChat } >
29
+ < a className = "embed-chat-button btn btn-raised btn-fab" onClick = { this . toggleChat } >
30
30
< i className = "material-icons" >
31
31
{ this . state . isChatOpen ? "clear" : "chat" }
32
32
</ i >
Original file line number Diff line number Diff line change @@ -26,4 +26,5 @@ html, body {
26
26
.embed-chat-button {
27
27
left : 100% !important ;
28
28
margin-left : -56px !important ;
29
+ background : @brand-secondary !important ;
29
30
}
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ protected void configure(HttpSecurity http) throws Exception {
79
79
.and ()
80
80
.logout ()
81
81
.permitAll ();
82
+ http .headers ().frameOptions ().disable ();
82
83
}
83
84
84
85
@ Autowired
Original file line number Diff line number Diff line change @@ -33,6 +33,12 @@ public GenesisService() {
33
33
client = HttpClientBuilder .create ().setDefaultRequestConfig (requestConfig ).build ();
34
34
}
35
35
36
+ // Created for tests since they fail because Genesis cannot produce results before timeout occurs
37
+ public GenesisService (int timeout ) {
38
+ RequestConfig requestConfig = RequestConfig .custom ().setSocketTimeout (timeout ).build ();
39
+ client = HttpClientBuilder .create ().setDefaultRequestConfig (requestConfig ).build ();
40
+ }
41
+
36
42
private String makeRequest (String endpoint , String uri , String requestType ) {
37
43
try {
38
44
HttpPost httpPost = new HttpPost (endpoint );
Original file line number Diff line number Diff line change 15
15
public class TestGenesisService {
16
16
@ Test
17
17
public void checkSimilar () throws Exception {
18
- String uris = new GenesisService ().getSimilarEntities ("http://dbpedia.org/resource/Barack_Obama" );
18
+ String uris = new GenesisService (0 ).getSimilarEntities ("http://dbpedia.org/resource/Barack_Obama" );
19
19
assertNotNull (uris );
20
20
assertNotEquals (uris .trim (), "" );
21
21
}
22
22
23
23
@ Test
24
24
public void checkRelated () throws Exception {
25
- String uris = new GenesisService ().getRelatedEntities ("http://dbpedia.org/resource/Barack_Obama" );
25
+ String uris = new GenesisService (0 ).getRelatedEntities ("http://dbpedia.org/resource/Barack_Obama" );
26
26
assertNotNull (uris );
27
27
assertNotEquals (uris .trim (), "" );
28
28
}
You can’t perform that action at this time.
0 commit comments