Skip to content

Commit c9c047b

Browse files
committed
Merge branch 'release/1.5'
2 parents 4aea0cb + b518186 commit c9c047b

File tree

72 files changed

+1250
-454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1250
-454
lines changed

analyse/src/main/java/org/csuc/analyse/factory/ParserFILE.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void execute(String fileOrPath) throws Exception {
3838
if (Objects.nonNull(path) && Files.exists(path, LinkOption.NOFOLLOW_LINKS)) {
3939
Files.walk(path)
4040
.filter(Files::isRegularFile)
41-
.filter(f -> f.toString().endsWith(".xml"))
41+
// .filter(f -> f.toString().endsWith(".xml"))
4242
.forEach(f -> {
4343
logger.info(String.format("%s file: %s", iter.incrementAndGet(), f.getFileName()));
4444
try {

analyse/src/main/resources/log4j2.xml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,15 @@
33
<Appenders>
44
<!-- All -->
55
<RollingFile name="RollingFile"
6-
fileName="${echoes.path}/logs/${project.name}-${date:yyyy-MM-dd}.log"
7-
filePattern="${echoes.path}/logs/rotate/${project.name}-%d{yyyy-MM-dd}-%i.log.gz"
8-
ignoreExceptions="false">
6+
fileName="${echoes.path}/logs/${artifactId}.log"
7+
filePattern="${echoes.path}/logs/rotate/${artifactId}-%d{yyyy-MM-dd}-%i.log.gz">
98
<PatternLayout>
109
<Pattern>%d{HH:mm:ss.SSS} [%t] %highlight{%level}{FATAL=bg_red, ERROR=red, WARN=yellow, INFO=green,
1110
DEBUG=blue} - %msg%n
1211
</Pattern>
1312
</PatternLayout>
1413
<Policies>
15-
<OnStartupTriggeringPolicy/>
16-
<SizeBasedTriggeringPolicy size="10 MB"/>
17-
<TimeBasedTriggeringPolicy/>
14+
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
1815
</Policies>
1916
</RollingFile>
2017
<!-- Console -->

echoes-gui/echoes-gui-client/app/analyse/analyse.controller.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@
119119
width: '60%',
120120
data: vm,
121121
controller: ['$scope', '$state', '$log', function ($scope, $state, $log) {
122-
$log.info(vm.profile.sub)
123-
124122
$scope.options = {
125123
methods: ["sax", "dom4j", "dom", "xslt"],
126124
formats: ["xml", "json"],
@@ -136,7 +134,8 @@
136134
'type': $scope.model.type,
137135
'format': $scope.model.format,
138136
'user': vm.profile.sub,
139-
'value': $scope.model.text
137+
'filename': ( typeof $scope.model.file === 'undefined' ) ? null : $scope.model.file.name,
138+
'value': ( typeof $scope.model.text === 'undefined' ) ? $scope.model.file.tempFilePath : $scope.model.text
140139
};
141140
$log.info(data);
142141

@@ -145,7 +144,8 @@
145144
method: $scope.model.method,
146145
type: $scope.model.type,
147146
format: $scope.model.format,
148-
value: $scope.model.text
147+
filename: ( typeof $scope.model.file === 'undefined' ) ? null : $scope.model.file.name,
148+
value: ( typeof $scope.model.text === 'undefined' ) ? $scope.model.file.tempFilePath : $scope.model.text
149149
}).then(function (_data) {
150150
$log.info(_data);
151151

@@ -158,8 +158,24 @@
158158
});
159159
}
160160
};
161+
162+
$scope.dzCallbacks = {
163+
'addedfile' : function(file){
164+
$log.log('dzCallbacks file added', file);
165+
},
166+
'success': function (file, response) {
167+
$log.log('dzCallbacks success', file, response);
168+
$scope.model.file = response
169+
}
170+
};
171+
172+
173+
//Apply methods for dropzone
174+
//Visit http://www.dropzonejs.com/#dropzone-methods for more methods
175+
$scope.dzMethods = {};
161176
}]
162177
});
163178
};
179+
164180
}
165181
})();

echoes-gui/echoes-gui-client/app/analyse/analyse.html

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,22 @@ <h3>{{vm.title}} <span class="badge badge-light">{{vm.data._size}}</span>
3636
class="glyphicon glyphicon-play-circle text-info"></span>
3737
<span ng-if="data.status == 'QUEUE'" class="glyphicon glyphicon-hourglass"></span>
3838
</td>
39-
<td title="'status'">
40-
<i class="fas fa-circle text-muted"></i><i class="fas fa-circle text-muted"></i><i class="fas fa-circle text-muted"></i>
41-
</td>
39+
<!--<td title="'status'">-->
40+
<!--<i class="fas fa-circle text-muted"></i><i class="fas fa-circle text-muted"></i><i class="fas fa-circle text-muted"></i>-->
41+
<!--</td>-->
4242
<td title="'id'">
4343
<a ng-if="data.status != 'ERROR'"
4444
ng-class="{'btn disabled' : data.status != 'END' && data.status != 'ERROR' }"
4545
target="_self"
4646
href="/rest/api/analyse/user/{{vm.profile.sub}}/id/{{data._id}}/download">{{data._id}}</a>
4747
<a ui-sref="analyse-detail({_id: '{{data._id}}'})" ng-if="data.status == 'ERROR'">{{data._id}}</a>
4848
</td>
49-
<td title="'input'">
49+
<td title="'input'" ng-if="data.type != 'FILE'">
5050
{{data.value | limitTo: 50}}<span ng-if="data.value.length > 50">...</span>
5151
</td>
52+
<td title="'filename'" ng-if="data.type == 'FILE'">
53+
{{data.filename}}
54+
</td>
5255
<td title="'timestamp'">
5356
{{data.timestamp.year}}-{{data.timestamp.monthValue}}-{{data.timestamp.dayOfMonth}}
5457
</td>
@@ -90,6 +93,15 @@ <h3 class="modal-title text-center">{{ngDialogData.title}}</h3>
9093
required.</p>
9194
</div>
9295

96+
<!-- FILE -->
97+
<div ng-if="model.type == 'file'" class="form-group" ng-class="{ 'has-error' : userForm.file.$invalid && userForm.file.$pristine}">
98+
<label>File*</label>
99+
<div id="dropzone1" class="dropzone" options="dzOptions" callbacks="dzCallbacks" ng-dropzone></div>
100+
<input type="hidden" name="file" class="form-control" ng-model="model.file" required>
101+
<p ng-show="userForm.file.$invalid && userForm.file.$error.required" class="help-block">File is
102+
required.</p>
103+
</div>
104+
93105
<!-- Format -->
94106
<div class="form-group" ng-class="{ 'has-error' : userForm.format.$invalid && userForm.format.$pristine }">
95107
<label>Format*</label>
@@ -100,7 +112,7 @@ <h3 class="modal-title text-center">{{ngDialogData.title}}</h3>
100112
</div>
101113

102114
<!-- VALUE -->
103-
<div class="form-group" ng-class="{ 'has-error' : userForm.text.$pristine
115+
<div ng-if="model.type == 'oai' || model.type == 'url'" class="form-group" ng-class="{ 'has-error' : userForm.text.$pristine
104116
|| userForm.text.$invalid && userForm.text.$error.pattern || userForm.text.$invalid && userForm.text.$dirty}">
105117
<label>Input*</label>
106118
<input type="text" name="text" class="form-control" ng-model="model.text" required
@@ -110,9 +122,7 @@ <h3 class="modal-title text-center">{{ngDialogData.title}}</h3>
110122
<p ng-show="userForm.text.$invalid && userForm.text.$error.pattern" class="help-block">Input not valid
111123
url.</p>
112124
</div>
113-
114125
<button type="submit" class="btn btn-primary">Submit</button>
115-
116126
</form>
117127
</div>
118128
</script>

echoes-gui/echoes-gui-client/app/app.js

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
'use strict';
44

55
angular
6-
.module('app', ['auth0.auth0', 'ui.bootstrap', 'angular-jwt', 'ui.router', 'angular-uuid', 'ngTable', 'ngDialog', 'ngMessages','chart.js'])
6+
.module('app', ['auth0.auth0', 'ui.bootstrap', 'angular-jwt', 'ui.router', 'angular-uuid', 'ngTable', 'ngDialog', 'ngMessages','chart.js',
7+
'thatisuday.dropzone'])
78
.config(config);
89

910
config.$inject = [
@@ -14,7 +15,8 @@
1415
'angularAuth0Provider',
1516
'jwtOptionsProvider',
1617
'ChartJsProvider',
17-
'ngDialogProvider'
18+
'ngDialogProvider',
19+
'dropzoneOpsProvider'
1820
];
1921

2022
function config($stateProvider,
@@ -24,7 +26,8 @@
2426
angularAuth0Provider,
2527
jwtOptionsProvider,
2628
ChartJsProvider,
27-
ngDialogProvider
29+
ngDialogProvider,
30+
dropzoneOpsProvider
2831
) {
2932

3033
$stateProvider
@@ -150,6 +153,13 @@
150153
},
151154
onEnter: checkAuthentication
152155
})
156+
.state('loader-error', {
157+
url: '/loader/:_id/error/:page?pagesize',
158+
controller: 'LoaderControllerError',
159+
templateUrl: 'app/loader/loader.detail.error.html',
160+
controllerAs: 'vm',
161+
onEnter: checkAuthentication
162+
})
153163
.state('404', {
154164
url: "/404",
155165
templateUrl: "404.html",
@@ -160,6 +170,20 @@
160170
}
161171
});
162172

173+
dropzoneOpsProvider.setOptions({
174+
url: '/upload',
175+
maxFiles: '1',
176+
maxFilesize: 1024,
177+
acceptedFiles: '.xml',
178+
addRemoveLinks: true,
179+
dictDefaultMessage: 'Click to add or drop XML',
180+
dictRemoveFile: 'Remove XML',
181+
dictResponseError: 'Could not upload this XML',
182+
autoDiscover: false,
183+
createImageThumbnails: false,
184+
previewTemplate: '<div class="uploaded-image"><span data-dz-name></span> <strong class="dz-size" data-dz-size></strong><div class="dz-error-message" data-dz-errormessage></div><div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div></div>'
185+
});
186+
163187
// Initialization for the angular-auth0 library
164188
angularAuth0Provider.init({
165189
clientID: AUTH0_CLIENT_ID,

echoes-gui/echoes-gui-client/app/factories/rest.factory.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,18 @@
384384
});
385385
};
386386

387+
data.loaderErrors = function (_params) {
388+
var searchData = restApiService.getNew("loaderErrors", _params);
389+
390+
$log.info('loaderErrors: ', searchData);
391+
392+
return $http({
393+
method: 'GET',
394+
url: searchData.url,
395+
params: searchData.object
396+
});
397+
};
398+
387399
//
388400

389401
return data;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
(function () {
2+
'use strict';
3+
angular
4+
.module('app')
5+
.filter('na', na);
6+
7+
function na() {
8+
return function (input) {
9+
return (angular.equals(input, 0)) ? 'N/A' : input;
10+
};
11+
}
12+
})();
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
(function () {
2+
3+
'use strict';
4+
5+
angular
6+
.module('app')
7+
.controller('LoaderControllerError', loaderControllerError);
8+
9+
loaderControllerError.$inject = ['$scope', 'authService', 'uuid', 'NgTableParams', '$http', '$log', '$stateParams', '$interval',
10+
'echoesChart', 'restApi', 'ngDialog', '$state', '$timeout'];
11+
12+
function loaderControllerError($scope, authService, uuid, NgTableParams, $http, $log, $stateParams, $interval,
13+
echoesChart, restApi, ngDialog, $state) {
14+
var vm = this;
15+
16+
vm.title = 'Publish-detail-error';
17+
vm.auth = authService;
18+
19+
vm.data;
20+
vm.tableParams;
21+
22+
vm._id = $stateParams._id;
23+
vm.page = $stateParams.page;
24+
vm.count = $stateParams.pagesize;
25+
26+
$log.info("count: ", $state.params)
27+
28+
if (authService.getCachedProfile()) {
29+
vm.profile = authService.getCachedProfile();
30+
31+
run()
32+
} else {
33+
authService.getProfile(function (err, profile) {
34+
vm.profile = profile;
35+
$scope.$apply();
36+
37+
run()
38+
});
39+
}
40+
41+
function run() {
42+
restApi.loaderErrors({
43+
user: vm.profile.sub,
44+
id: vm._id,
45+
page: vm.page,
46+
pagesize: vm.count
47+
})
48+
.then(function (_data) {
49+
$log.info(_data.data);
50+
51+
vm.data = _data.data;
52+
if(_data.data._size > 0)
53+
vm.tableParams = ngTableParams(vm.data, vm.count)
54+
55+
})
56+
.catch(function (reason) {
57+
console.log(reason)
58+
}).finally(function() {
59+
console.log("finally finished gists");
60+
});
61+
}
62+
63+
64+
function ngTableParams(data, count) {
65+
return new NgTableParams({
66+
page: vm.page,
67+
count: count
68+
}, {
69+
total: data._size,
70+
getData: function (params) {
71+
vm.page = params.page();
72+
vm.count = params.count();
73+
74+
return restApi.loaderErrors({
75+
id: vm._id,
76+
user: vm.profile.sub,
77+
pagesize: vm.count,
78+
page: vm.page
79+
}).then(function (d) {
80+
return d.data._embedded;
81+
}).catch(function (_data) {
82+
$log.info(_data);
83+
})
84+
.finally(function () { $state.go("loader-error", {_id: vm._id, page: vm.page, pagesize: vm.count}); });
85+
}
86+
});
87+
}
88+
}
89+
})();

echoes-gui/echoes-gui-client/app/loader/loader.controller.detail.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
function loaderDetail($scope, authService, $stateParams, echoesChart, restApi, $log) {
1212
var vm = this;
13-
vm.title = 'Loader-detail';
13+
vm.title = 'Publish-detail';
1414
vm.auth = authService;
1515
vm.profile;
1616
vm._id = $stateParams._id;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<div class="container">
2+
<a ui-sref="loader-detail({_id:'{{vm._id}}'})"><span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span> Back </a>
3+
<h2>{{vm.title}} <span class="badge badge-light">{{vm.data._size}}</span></h2>
4+
5+
6+
<div class="table-responsive col-xs-12 col-sm-12 col-lg-12">
7+
<table ng-table="vm.tableParams" class="table" show-filter="false">
8+
<tr ng-repeat="data in $data">
9+
<td title="'name'">
10+
{{data.value}}
11+
</td>
12+
<td title="'status-code'">
13+
{{data.status}}
14+
</td>
15+
<td title="'message'">
16+
{{data.message}}
17+
</td>
18+
</tr>
19+
</table>
20+
</div>
21+
</div>

0 commit comments

Comments
 (0)