diff --git a/apps/dnet-is-application/src/main/resources/old_bootstrap_ui.tgz b/apps/dnet-is-application/src/main/resources/old_bootstrap_ui.tgz new file mode 100644 index 00000000..19ffd72d Binary files /dev/null and b/apps/dnet-is-application/src/main/resources/old_bootstrap_ui.tgz differ diff --git a/apps/dnet-is-application/src/main/resources/static/html/context_viewer.html b/apps/dnet-is-application/src/main/resources/static/html/context_viewer.html deleted file mode 100644 index 6ff22bfe..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/context_viewer.html +++ /dev/null @@ -1,56 +0,0 @@ - - -
-
-
-

- Context ID: {{ctxId}}
Label: {{ctxInfo.label}}
Type: {{ctxInfo.type}}
Parameters: [show] -

-

- Return to contexts list Download -

- - - -
-
-
- - - - \ No newline at end of file diff --git a/apps/dnet-is-application/src/main/resources/static/html/contexts.html b/apps/dnet-is-application/src/main/resources/static/html/contexts.html deleted file mode 100644 index f8ed091d..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/contexts.html +++ /dev/null @@ -1,102 +0,0 @@ - - -
-
-
- -

- -

- - - - - - - - - - - - - - - - - - - - - - - -
IDLabelType
no contexts
{{ctx.id}}{{ctx.label}}{{ctx.type}} - - -
-
-
-
- - - - diff --git a/apps/dnet-is-application/src/main/resources/static/html/dsm_add_api.html b/apps/dnet-is-application/src/main/resources/static/html/dsm_add_api.html deleted file mode 100644 index 5539d1fa..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/dsm_add_api.html +++ /dev/null @@ -1,29 +0,0 @@ - - -
-
-
- -
- - - - - - - - -
- -
- - {{api}}
- - - -
- - -
-
-
diff --git a/apps/dnet-is-application/src/main/resources/static/html/dsm_api.html b/apps/dnet-is-application/src/main/resources/static/html/dsm_api.html deleted file mode 100644 index 35a1e8ee..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/dsm_api.html +++ /dev/null @@ -1,9 +0,0 @@ - - -
-
-
- {{api}} -
-
-
diff --git a/apps/dnet-is-application/src/main/resources/static/html/dsm_results.html b/apps/dnet-is-application/src/main/resources/static/html/dsm_results.html deleted file mode 100644 index 5754a8ed..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/dsm_results.html +++ /dev/null @@ -1,83 +0,0 @@ - - -
-
-
- - -

- Number of results: {{nResults}}
- Page: {{currPage + 1}} / {{nPages}}- / - -

- - - -
-
-
{{r.name}} -
{{r.otherName}}
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Id{{r.id}}
Type{{r.type}}
Collected From{{r.collectedFrom}}
URL{{r.websiteUrl}}
Namespace Prefix{{r.nsprefix}}
Organization(s) - - {{o.name}} - -
-
-
APIs -
- - {{a.id}} - - {{a.protocol}} - {{a.compliance}} - activenot active -
Last aggregation: {{a.aggrDate}} (total: {{a.aggrTotal}})
-
- - add api -
Consent Terms of UseYES
Fulltext DownloadYES
-
-
-
-
-
diff --git a/apps/dnet-is-application/src/main/resources/static/html/dsm_search.html b/apps/dnet-is-application/src/main/resources/static/html/dsm_search.html deleted file mode 100644 index b49c75a0..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/dsm_search.html +++ /dev/null @@ -1,74 +0,0 @@ - - -
-
-
-
-
- - - - -
-
-
-
-
-
-

- Or browse using: -

-

-
-
-
- - diff --git a/apps/dnet-is-application/src/main/resources/static/html/info.html b/apps/dnet-is-application/src/main/resources/static/html/info.html deleted file mode 100644 index 80b08390..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/info.html +++ /dev/null @@ -1,41 +0,0 @@ - - -
-
-
-

- -

- -
- -
-
{{section.name}}
- - - - - - - - - - - - - - - - - - - - - - -
Group IDArtifact IDVersionPOM
{{r.k}}
{{r.v}}
{{r.group}}{{r.name}}{{v}}
{{f}}
-
-
-
-
-
diff --git a/apps/dnet-is-application/src/main/resources/static/html/parts/form_select.html b/apps/dnet-is-application/src/main/resources/static/html/parts/form_select.html deleted file mode 100644 index 29208c41..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/parts/form_select.html +++ /dev/null @@ -1,12 +0,0 @@ -
- -
- - (Optional) -
-
diff --git a/apps/dnet-is-application/src/main/resources/static/html/parts/form_textarea.html b/apps/dnet-is-application/src/main/resources/static/html/parts/form_textarea.html deleted file mode 100644 index 496ddef2..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/parts/form_textarea.html +++ /dev/null @@ -1,10 +0,0 @@ -
- -
- - (Optional) -
-
diff --git a/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield.html b/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield.html deleted file mode 100644 index 57e72078..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield.html +++ /dev/null @@ -1,11 +0,0 @@ -
- -
- - (Optional) -
-
diff --git a/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield_static.html b/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield_static.html deleted file mode 100644 index f35e93d0..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield_static.html +++ /dev/null @@ -1,8 +0,0 @@ -
- -
- -
-
diff --git a/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield_with_prefix.html b/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield_with_prefix.html deleted file mode 100644 index a2ed1d5d..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield_with_prefix.html +++ /dev/null @@ -1,15 +0,0 @@ -
- -
-
-
- {{prefix}} -
- - (Optional) -
-
-
diff --git a/apps/dnet-is-application/src/main/resources/static/html/parts/page_filter.html b/apps/dnet-is-application/src/main/resources/static/html/parts/page_filter.html deleted file mode 100644 index 0f8af4bd..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/parts/page_filter.html +++ /dev/null @@ -1,4 +0,0 @@ -

- - {{totalLabel}}: {{(list | filter:filter).length}} -

diff --git a/apps/dnet-is-application/src/main/resources/static/html/parts/page_title.html b/apps/dnet-is-application/src/main/resources/static/html/parts/page_title.html deleted file mode 100644 index 09f70183..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/parts/page_title.html +++ /dev/null @@ -1 +0,0 @@ -

{{title}}

diff --git a/apps/dnet-is-application/src/main/resources/static/html/protocols.html b/apps/dnet-is-application/src/main/resources/static/html/protocols.html deleted file mode 100644 index fc8820b9..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/protocols.html +++ /dev/null @@ -1,34 +0,0 @@ - - -
- -

NOTE: Use the api to register new protocols

- -
-
-
-
-
{{prot.id}}
-

No parameters

- - - - - - - - - - - - - - - - - -
ParameterDescriptionTypeRequiredHas Sel Function
{{p.name}}{{p.label}}{{p.type}}
-
-
-
-
diff --git a/apps/dnet-is-application/src/main/resources/static/html/resources.html b/apps/dnet-is-application/src/main/resources/static/html/resources.html deleted file mode 100644 index d273d8a6..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/resources.html +++ /dev/null @@ -1,120 +0,0 @@ - - -
-
-
-

- -

- - - -
-
- {{typeDesc.contentType}} -
{{r.name}}
-

{{r.description}}

-

- Id: {{r.id}}
Creation date: {{r.creationDate}}
Modification date: {{r.modificationDate}} -

- - - raw content - -
-
- -
-
-
- - - - - - - - - - - - diff --git a/apps/dnet-is-application/src/main/resources/static/html/voc_editor.html b/apps/dnet-is-application/src/main/resources/static/html/voc_editor.html deleted file mode 100644 index acb943f2..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/voc_editor.html +++ /dev/null @@ -1,108 +0,0 @@ - - -
-
-
-

- Vocabulary ID: {{vocId}}
- Vocabulary Name: {{vocInfo.name}}
- Description: {{vocInfo.description}} -

-

- Return to vocabulary list - - Download -

- - - - - - - - - - - - - - - - - - - - - - - - - -
CodeNameEncodingSynonyms
no terms
{{t.code}}{{t.name}}{{t.encoding}}0 synonym(s) {{s.term}} - - -
-
-
-
- - - - diff --git a/apps/dnet-is-application/src/main/resources/static/html/vocs.html b/apps/dnet-is-application/src/main/resources/static/html/vocs.html deleted file mode 100644 index aa6a341a..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/vocs.html +++ /dev/null @@ -1,64 +0,0 @@ - - -
-
-
-

- -

- - - - - - - - - - - - - - - - - - - - - - - -
IDNameDescription
no vocabularies
{{v.id}}{{v.name}}{{v.description}} - - -
-
-
-
- - - - \ No newline at end of file diff --git a/apps/dnet-is-application/src/main/resources/static/html/wf_history.html b/apps/dnet-is-application/src/main/resources/static/html/wf_history.html deleted file mode 100644 index ff362589..00000000 --- a/apps/dnet-is-application/src/main/resources/static/html/wf_history.html +++ /dev/null @@ -1,131 +0,0 @@ - - -
-
-
- - - -

- Recent workflows (max {{maxNumberOfRecentWfs}}) - Workflows from {{fromDate | date:"yyyy-MM-dd HH:mm:ss"}} to {{toDate | date:"yyyy-MM-dd HH:mm:ss"}} - Workflows from {{fromDate | date:"yyyy-MM-dd HH:mm:ss"}} to undefined - Workflows from undefined to {{toDate | date:"yyyy-MM-dd HH:mm:ss"}} -
- Count : {{(workflows | filter:wfFilter).length}} -

- - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Process Id - - - - - - Workflow Name - - - - - - Workflow Family - - - - - - Datasource - - - - - - Status - - - - - - Start Date - - - - - - End Date - - - -
no workflows
{{wf.processId}}{{wf.name}}{{wf.family}}{{wf.dsName}}{{wf.status}}{{wf.startDate}}{{wf.endDate}}
-
-
-
- - - - - - \ No newline at end of file diff --git a/apps/dnet-is-application/src/main/resources/static/index.html b/apps/dnet-is-application/src/main/resources/static/index.html deleted file mode 100644 index 052e4089..00000000 --- a/apps/dnet-is-application/src/main/resources/static/index.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - OpenAIRE Tools - - - - - - - -
- -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/apps/dnet-is-application/src/main/resources/static/js/ctx_ctrls.js b/apps/dnet-is-application/src/main/resources/static/js/ctx_ctrls.js deleted file mode 100644 index d9312c1f..00000000 --- a/apps/dnet-is-application/src/main/resources/static/js/ctx_ctrls.js +++ /dev/null @@ -1,99 +0,0 @@ -app.controller('ctxListController', function($scope, $http) { - $scope.contexts = []; - $scope.tmpCtx = {}; - $scope.mode = ''; - - call_http_get($http, './ajax/contexts/?' + $.now(), function(res) { - $scope.contexts = res.data; - }); - - $scope.prepareNewCtx = function() { - $scope.mode = 'new'; - $scope.tmpCtx = { - 'id' : '', - 'label' : '', - 'type' : '', - 'parameters' : [] - }; - } - - $scope.prepareEditCtx = function(ctx) { - $scope.mode = 'edit'; - $scope.tmpCtx = angular.copy(ctx); - } - - $scope.saveContext = function(ctx) { - if ($scope.mode == 'new') { - var found = false; - - angular.forEach($scope.contexts, function(v) { - if (ctx.id == ctx.id) { found = true; }; - }); - - if (found) { - alert("Insertion failed: context already exists !"); - return; - } - } - - json_http_post($http,'./ajax/contexts/?' + $.now(), ctx, function(res) { - $scope.contexts = res.data; - alert("Context saved"); - }); - }; - - $scope.deleteContext = function(id) { - if (confirm("Are you sure ?")) { - call_http_delete($http, './ajax/contexts/' + encodeURIComponent(id) + '?' + $.now(), function(res) { - $scope.contexts = res.data; - alert("Context deleted"); - }); - } - }; - -}); - -// ---------------------------------------------------- - -app.controller('ctxViewerController', function($scope, $http, $routeParams) { - $scope.ctxId = $routeParams.id; - $scope.ctxInfo = {}; - $scope.categories = []; - $scope.parameters = []; - - var url = './ajax/contexts/' + encodeURIComponent($scope.ctxId); - - call_http_get($http, url + '?' + $.now(), function(res) { - $scope.ctxInfo = res.data; - - call_http_get($http, url + '/categories?' + $.now(), function(res) { - $scope.categories = res.data; - }); - }); - - $scope.loadContextParameters = function() { - $scope.parameters = []; - call_http_get($http, './ajax/contexts/' + encodeURIComponent($scope.ctxId) + '?' + $.now(), function(res) { - $scope.parameters = res.data.parameters; - }); - } - - $scope.populateNode = function(level, node) { - $scope.url = './ajax/contexts/' - + encodeURIComponent(level) - + '/' - + encodeURIComponent(node.id) - + '/concepts'; - - node.populated = true; - - call_http_get($http, $scope.url + '?' + $.now(), function(res) { - node.concepts = res.data; - }); - } - - $scope.initShowParameters = function(params) { - $scope.parameters = params; - } - -}); diff --git a/apps/dnet-is-application/src/main/resources/static/js/dsm_ctrls.js b/apps/dnet-is-application/src/main/resources/static/js/dsm_ctrls.js deleted file mode 100644 index d4cd90b3..00000000 --- a/apps/dnet-is-application/src/main/resources/static/js/dsm_ctrls.js +++ /dev/null @@ -1,123 +0,0 @@ -app.controller('dsmSearchController', function($scope, $http, $location, $timeout) { - $scope.browseFieldId = ""; - $scope.browseFieldName = ""; - $scope.browseData = []; - - $scope.browsableFields = []; - - call_http_get($http, './ajax/dsm/browsableFields' , function(res) { - $scope.browsableFields = res.data; - }); - - $scope.browseField = function(id, label) { - $scope.browseFieldId = id; - $scope.browseFieldName = name; - $scope.browseData = []; - - call_http_get($http, './ajax/dsm/browse/' + encodeURIComponent(id) + '?' + $.now(), function(res) { - $scope.browseData = res.data; - }); - } - - $scope.search = function(field, value) { - var path = "/dsm/results"; - if (field) { path += '/' + encodeURIComponent(field); } - path += '/0/100'; - - $timeout(function() { - $location.path(path).search('value', value); - }, 1000); - } -}); - -// ---------------------------------------------------- - -app.controller('dsmResultsController', function($scope, $http, $location, $routeParams) { - $scope.field = $routeParams.field; - $scope.value = $routeParams.value; - $scope.pageSize = $routeParams.size; - $scope.currPage = $routeParams.page; - - $scope.nResults = 0; - $scope.results = []; - $scope.nPages = 0; - - var url = './ajax/dsm/'; - if ($scope.field) { url += 'searchByField/' + encodeURIComponent($scope.field); } - else { url += 'search' } - url += '/' + $scope.currPage + '/' + $scope.pageSize; - url += '?value=' + encodeURIComponent($scope.value) + '&' + $.now(); - - call_http_get($http, url, function(res) { - $scope.results = res.data.content; - $scope.nResults = res.data.totalElements; - $scope.currPage = res.data.number; - $scope.nPages = res.data.totalPages; - }); - - $scope.gotoPage = function(page) { - $scope.results = []; - var path = "/dsm/results"; - if ($scope.field) { path += '/' + encodeURIComponent($scope.field); } - path += '/' + page + '/' + $scope.pageSize; - $location.path(path).search('value', $scope.value); - } - -}); - -// ---------------------------------------------------- - -app.controller('dsmApiController', function($scope, $http, $routeParams) { - $scope.apiId = $routeParams.id; - $scope.api = {}; - - call_http_get($http, './ajax/dsm/api?id=' + encodeURIComponent($scope.apiId) , function(res) { - $scope.api = res.data; - }); - -}); - -// ---------------------------------------------------- - -app.controller('dsmAddApiController', function($scope, $http, $routeParams) { - $scope.dsName = $routeParams.dsName; - $scope.prefix = 'api_________::' + $routeParams.dsId + '::'; - $scope.api = {} - - $scope.protocols = []; - $scope.protocolsMap = {}; - $scope.compatibilityLevels = []; - $scope.contentDescTypes = []; - - $scope.selProtParams = []; - - $scope.$watch('api.protocol', function() { - if ($scope.api.protocol) { - $scope.selProtParams = $scope.protocolsMap[$scope.api.protocol]; - } - }); - - - call_http_get($http, './ajax/dsm/conf' , function(res) { - $scope.protocols = []; - $scope.protocolsMap = {}; - angular.forEach(res.data.protocols, function(prot) { - $scope.protocols.push(prot.id); - $scope.protocolsMap[prot.id] = prot.params; - }); - - $scope.compatibilityLevels = res.data.compatibilityLevels; - $scope.contentDescTypes = res.data.contentDescTypes; - }); - - $scope.save = function() { - var record = angular.copy($scope.api); - record.id = $scope.prefix + record.id; - record.datasource = $routeParams.dsId; - - json_http_post($http, './ajax/dsm/api', record, function(res) { - $scope.api = res.data; - }); - } - -}); diff --git a/apps/dnet-is-application/src/main/resources/static/js/is_main.js b/apps/dnet-is-application/src/main/resources/static/js/is_main.js deleted file mode 100644 index 6f05e43f..00000000 --- a/apps/dnet-is-application/src/main/resources/static/js/is_main.js +++ /dev/null @@ -1,147 +0,0 @@ -var app = angular.module('isApp', ['ngRoute']); - -app.config(['$routeProvider', function($routeProvider) { - $routeProvider - .when('/info', { templateUrl: './html/info.html', controller: 'infoController' }) - .when('/wf_history/:total', { templateUrl: './html/wf_history.html', controller: 'wfHistoryController' }) - .when('/protocols', { templateUrl: './html/protocols.html', controller: 'protocolsController' }) - .when('/resources/:type', { templateUrl: './html/resources.html', controller: 'resourcesController' }) - .when('/contexts', { templateUrl: './html/contexts.html', controller: 'ctxListController' }) - .when('/context/:id', { templateUrl: './html/context_viewer.html', controller: 'ctxViewerController' }) - .when('/vocs', { templateUrl: './html/vocs.html', controller: 'vocListController' }) - .when('/vocabularyEditor', { templateUrl: './html/voc_editor.html', controller: 'vocEditorController' }) - .when('/dsm/search', { templateUrl: './html/dsm_search.html', controller: 'dsmSearchController' }) - .when('/dsm/results/:page/:size', { templateUrl: './html/dsm_results.html', controller: 'dsmResultsController' }) - .when('/dsm/results/:field/:page/:size', { templateUrl: './html/dsm_results.html', controller: 'dsmResultsController' }) - .when('/dsm/addApi', { templateUrl: './html/dsm_add_api.html', controller: 'dsmAddApiController' }) - .when('/dsm/api', { templateUrl: './html/dsm_api.html', controller: 'dsmApiController' }) - .otherwise({ redirectTo: '/info' }); - } -]); - -app.directive('pageTitle', function() { - return { - restrict: 'E', - scope: { 'title': '@' }, - templateUrl: './html/parts/page_title.html', - link: function(scope, element, attrs) {} - }; -}); - - -app.directive('pageFilter', function() { - return { - restrict: 'E', - scope: { - 'filter' : '=', - 'list' : '=', - 'description' : '@', - 'totalLabel' : '@' - }, - templateUrl: './html/parts/page_filter.html', - link: function(scope, element, attrs) { - if (!scope.description) { - scope.description = 'Filter...'; - } - if (!scope.totalLabel) { - scope.totalLabel = 'Total'; - } - } - }; -}); - -app.directive('formTextfield', function() { - return { - restrict: 'E', - scope: { - 'label' : '@', - 'regex' : '@', - 'optional' : '@', - 'type' : '@', - 'value' : '=', - }, - templateUrl: './html/parts/form_textfield.html', - link: function(scope, element, attrs) { - scope.required = (scope.optional != 'true'); - if (scope.regex) { scope.mypattern = new RegExp(scope.regex); } - else if (scope.type == 'NUMBER') { scope.mypattern = new RegExp("^[-+]?[0-9]+(\.[0-9]+)?$"); } - else if (scope.type == 'BOOLEAN') { scope.mypattern = new RegExp("^(true|false)$"); } - else { scope.mypattern = new RegExp(".+"); } - } - }; -}); - -app.directive('formTextfieldStatic', function() { - return { - restrict: 'E', - scope: { - 'label' : '@', - 'value' : '=', - }, - templateUrl: './html/parts/form_textfield_static.html', - link: function(scope, element, attrs) {} - }; -}); - -app.directive('formTextfieldWithPrefix', function() { - return { - restrict: 'E', - scope: { - 'label' : '@', - 'prefix' : '@', - 'optional' : '@', - 'value' : '=' - }, - templateUrl: './html/parts/form_textfield_with_prefix.html', - link: function(scope, element, attrs) { - scope.suffix = ''; - scope.required = (scope.optional != 'true'); - - scope.$watch('suffix', function() { - var tmpId = scope.prefix + scope.suffix; - - if (scope.suffix && scope.suffix.trim() != '') { - scope.value = tmpId; - } else { - scope.value = null; - } - }); - } - } -}); - -app.directive('formSelect', function() { - return { - restrict: 'E', - scope: { - 'label' : '@', - 'optional' : '@', - 'terms' : '=', - 'value' : '=', - - }, - templateUrl: './html/parts/form_select.html', - link: function(scope, element, attrs) { - scope.required = (scope.optional != 'true'); - } - }; -}); - -app.directive('formTextarea', function() { - return { - restrict: 'E', - scope: { - 'label' : '@', - 'optional' : '@', - 'value' : '=', - }, - templateUrl: './html/parts/form_textarea.html', - link: function(scope, element, attrs) { - scope.required = (scope.optional != 'true'); - } - }; -}); - - - - diff --git a/apps/dnet-is-application/src/main/resources/static/js/is_simple_ctrls.js b/apps/dnet-is-application/src/main/resources/static/js/is_simple_ctrls.js deleted file mode 100644 index 5bfd08e5..00000000 --- a/apps/dnet-is-application/src/main/resources/static/js/is_simple_ctrls.js +++ /dev/null @@ -1,36 +0,0 @@ -app.controller('isMenuController', function($scope, $http) { - $scope.resTypes = []; - - call_http_get($http, './ajax/resourceTypes' , function(res) { - $scope.resTypes = res.data; - }); -}); - -// ---------------------------------------------------- - -app.controller('infoController', function($scope, $http) { - $scope.info = []; - - call_http_get($http, './ajax/info/?' + $.now(), function(res) { - angular.forEach(res.data, function(section) { - if (section.name != 'Modules') { - angular.forEach(section.data, function(r) { - if (r.k.toLowerCase().endsWith('path') || r.k.toLowerCase().endsWith('.dirs')) { - r.v = r.v.replaceAll(':', ':\n'); - } - }); - } - }); - $scope.info = res.data; - }); -}); - -// ---------------------------------------------------- - -app.controller('protocolsController', function($scope, $http) { - $scope.protocols = []; - - call_http_get($http, './ajax/protocols/?' + $.now(), function(res) { - $scope.protocols = res.data; - }); -}); diff --git a/apps/dnet-is-application/src/main/resources/static/js/is_utils.js b/apps/dnet-is-application/src/main/resources/static/js/is_utils.js deleted file mode 100644 index 020213bd..00000000 --- a/apps/dnet-is-application/src/main/resources/static/js/is_utils.js +++ /dev/null @@ -1,72 +0,0 @@ -// Spinner show/hide methods ~ Andrea Mannocci -var spinnerOpts = { - lines: 15, - length: 16, - width: 5, - radius: 25, - color: '#eeeeee', - className: 'spinner', - top: '40%' -}; - -var spinnerTarget = document.getElementById('spinnerdiv'); - -var spinner; - -function showSpinner() { - spinner = new Spinner(spinnerOpts).spin(spinnerTarget); - spinnerTarget.style.visibility = 'visible'; -} - -function hideSpinner() { - spinnerTarget.style.visibility = 'hidden'; - spinner.stop(); -} - -function call_http_get($http, url, onSuccess) { - showSpinner(); - - $http.get(url).then(function successCallback(res) { - hideSpinner(); - onSuccess(res); - }, function errorCallback(res) { - hideSpinner(); - alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); - }); -} - -function call_http_delete($http, url, onSuccess) { - showSpinner(); - - $http.delete(url).then(function successCallback(res) { - hideSpinner(); - onSuccess(res); - }, function errorCallback(res) { - hideSpinner(); - alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); - }); -} - -function json_http_post($http, url, obj, onSuccess) { - showSpinner(); - $http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8"; - $http.post(url, obj).then(function successCallback(res) { - hideSpinner(); - onSuccess(res); - }, function errorCallback(res) { - hideSpinner(); - alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); - }); -} - -function params_http_post($http, url, params, onSuccess) { - showSpinner(); - $http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8"; - $http.post(url, params).then(function successCallback(res) { - hideSpinner(); - onSuccess(res); - }, function errorCallback(res) { - hideSpinner(); - alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); - }); -} diff --git a/apps/dnet-is-application/src/main/resources/static/js/res_ctrls.js b/apps/dnet-is-application/src/main/resources/static/js/res_ctrls.js deleted file mode 100644 index 076e971f..00000000 --- a/apps/dnet-is-application/src/main/resources/static/js/res_ctrls.js +++ /dev/null @@ -1,84 +0,0 @@ -app.controller('resourcesController', function($scope, $http, $routeParams, $location) { - $scope.resources = []; - $scope.tmpRes = {}; - $scope.tmpContent = "loading..."; - $scope.type = $routeParams.type; - $scope.typeDesc = {}; - - $scope.reload = function() { - call_http_get($http, './ajax/resourceTypes/' + encodeURIComponent($scope.type) + '?' + $.now(), function(res) { - $scope.typeDesc = res.data; - }); - - call_http_get($http, './ajax/resources/' + encodeURIComponent($scope.type) + '?' + $.now(), function(res) { - $scope.resources = res.data; - }); - }; - - $scope.prepareNewResource = function() { - $scope.tmpRes = { - 'name' : '', - 'description' : '', - 'content' : '' - }; - } - - $scope.prepareEditMetadata = function(r) { - $scope.tmpRes = angular.copy(r); - } - - $scope.prepareEditContent = function(r) { - $scope.tmpRes = angular.copy(r); - $scope.tmpContent = "loading..."; - call_http_get($http, './ajax/resources/' + encodeURIComponent(r.id) + '/content?' + $.now(), function(res) { - if (res.data instanceof Object) { - $scope.tmpContent = JSON.stringify(res.data, null, "\t"); - } else { - $scope.tmpContent = res.data; - } - }); - } - - $scope.createNewResource = function(r) { - params_http_post($http, './ajax/resources/?' + $.now(), $.param({ - 'name' : r.name, - 'type' : $scope.type, - 'description' : r.description, - 'content' : r.content - }), function(res) { - alert("Resource saved"); - $('#newResourceModal').modal('hide'); - $scope.reload(); - }); - } - - $scope.saveMetadata = function(id, md) { - json_http_post($http, './ajax/resources/' + encodeURIComponent(id) + '/metadata?' + $.now(), md, function(res) { - alert("Resource saved"); - $scope.reload(); - }); - }; - - $scope.saveContent = function(id, content) { - params_http_post($http, './ajax/resources/' + encodeURIComponent(id) + '/content?' + $.now(), $.param({ - 'content' : content - }), function(res) { - alert("Resource saved"); - $('#editContentModal').modal('hide'); - }); - }; - - $scope.deleteResource = function(r) { - if (confirm("Are you sure ?")) { - call_http_delete($http, './ajax/resources/' + encodeURIComponent(r.id) + '?' + $.now(), function(res) { - alert("Resource deleted"); - $scope.reload(); - }); - } - }; - - if ($scope.type == 'context') { $location.url("/contexts"); } - else if ($scope.type == 'vocabulary') { $location.url("/vocs"); } - else if ($scope.type == 'protocol') { $location.url("/protocols"); } - else { $scope.reload(); } -}); diff --git a/apps/dnet-is-application/src/main/resources/static/js/voc_ctrls.js b/apps/dnet-is-application/src/main/resources/static/js/voc_ctrls.js deleted file mode 100644 index 0ecb730b..00000000 --- a/apps/dnet-is-application/src/main/resources/static/js/voc_ctrls.js +++ /dev/null @@ -1,125 +0,0 @@ -app.controller('vocListController', function($scope, $http) { - $scope.vocabularies = []; - $scope.tmpVoc = {}; - $scope.mode = ''; - - call_http_get($http, './ajax/vocs/?' + $.now(), function(res) { - $scope.vocabularies = res.data; - }); - - $scope.prepareNewVoc = function() { - $scope.mode = 'new'; - $scope.tmpVoc = { - 'id' : '', - 'name' : '', - 'description' : '' - }; - } - - $scope.prepareEditVoc = function(voc) { - $scope.mode = 'edit'; - $scope.tmpVoc = angular.copy(voc); - } - - $scope.saveVocabulary = function(voc) { - if ($scope.mode == 'new') { - var found = false; - - angular.forEach($scope.vocabularies, function(v) { - if (voc.id == v.id) { found = true; }; - }); - - if (found) { - alert("Insertion failed: vocabulary already exists !"); - return; - } - } - - json_http_post($http, './ajax/vocs/?' + $.now(), voc, function(res) { - $scope.vocabularies = res.data; - alert("Vocabulary saved"); - }); - }; - - $scope.deleteVocabulary = function(id) { - if (confirm("Are you sure ?")) { - call_http_delete($http, './ajax/vocs/' + encodeURIComponent(id) + '?' + $.now(), function(res) { - $scope.vocabularies = res.data; - alert("Vocabulary deleted"); - }); - } - }; -}); - -// ---------------------------------------------------- - -app.controller('vocEditorController', function($scope, $http, $routeParams) { - $scope.terms = []; - $scope.vocId = $routeParams.id; - $scope.vocInfo = {}; - $scope.editTermCode = ''; - $scope.tmpTerm = {}; - $scope.mode = ''; - $scope.currTerm = []; - - $scope.baseUrl = './ajax/vocs/' + encodeURIComponent($scope.vocId); - - call_http_get($http, $scope.baseUrl + '?' + $.now(), function(res) { - $scope.vocInfo = res.data; - - call_http_get($http, $scope.baseUrl + '/terms?' + $.now(), function(res) { - $scope.terms = res.data; - }); - }); - - $scope.setCurrTerm = function(term) { - $scope.currTerm = angular.copy(term); - } - - $scope.prepareNewTerm = function() { - $scope.mode = 'new'; - $scope.editTermCode = ''; - $scope.tmpTerm = { - 'code' : '', - 'name' : '', - 'encoding' : 'OPENAIRE', - 'synonyms' : [] - }; - } - - $scope.prepareEditTerm = function(term) { - $scope.mode = 'edit'; - $scope.editTermCode = term.code; - $scope.tmpTerm = angular.copy(term); - } - - - $scope.saveTerm = function(term) { - var url = $scope.baseUrl + '/terms?' + $.now(); - - json_http_post($http, url, term, function(res) { - if ($scope.editTermCode != '' && $scope.editTermCode != $scope.tmpTerm.code) { - var deleteUrl = $scope.baseUrl + '/terms/' + encodeURIComponent($scope.editTermCode) + '?' + $.now(); - call_http_delete($http, deleteUrl, function(res) { - $scope.terms = res.data; - alert("Term replaced"); - }); - } else { - $scope.terms = res.data; - alert("Term saved"); - } - }); - }; - - $scope.deleteTerm = function(code) { - if (confirm("Are you sure ?")) { - var url = $scope.baseUrl + '/terms/' + encodeURIComponent(code) + '?' + $.now(); - - call_http_delete($http, url, function(res) { - $scope.terms = res.data; - alert("Term deleted"); - }); - } - }; - -}); diff --git a/apps/dnet-is-application/src/main/resources/static/js/wf_ctrls.js b/apps/dnet-is-application/src/main/resources/static/js/wf_ctrls.js deleted file mode 100644 index e1125fa6..00000000 --- a/apps/dnet-is-application/src/main/resources/static/js/wf_ctrls.js +++ /dev/null @@ -1,93 +0,0 @@ -app.controller('wfHistoryController', function($scope, $http, $routeParams) { - $scope.fromDate = $routeParams.from; - $scope.toDate = $routeParams.to; - $scope.maxNumberOfRecentWfs = $routeParams.total; - - $scope.workflows = []; - $scope.currentWf = {}; - $scope.currDetailsKey = ''; - $scope.currDetailsValue = ''; - $scope.sortField = 'processId'; - $scope.sortReverse = false; - - $scope.reload = function() { - var url = './ajax/wfs/?' + $.now(); - - url += "&total=" + $scope.maxNumberOfRecentWfs; - - if ($scope.fromDate > 0) { url += "&from=" + $scope.fromDate; } - if ($scope.toDate > 0) { url += "&to=" + $scope.toDate; } - - call_http_get($http, url, function(res) { - $scope.workflows = res.data; - }); - }; - - $scope.setCurrentWf = function(wf) { - $scope.currentWf = angular.copy(wf); - $scope.currDetailsKey = ''; - $scope.currDetailsValue = ''; - $scope.currentWf.arrayDetails = []; - $scope.currentWf.duration = $scope.calculateDateDiff(parseInt(wf.details['system:startDate']), parseInt(wf.details['system:endDate'])); - - angular.forEach(wf.details, function(v,k) { - $scope.currentWf.arrayDetails.push({'k':k, 'v':v}); - }); - } - - $scope.setCurrentDetailParam = function(k, v) { - $scope.currDetailsKey = k; - $scope.currDetailsValue = v; - } - - - $scope.calculateDateDiff = function(start, end) { - if (start <= 0 || end <= 0) { - return '-'; - } - var seconds = 0; - var minutes = 0; - var hours = 0; - var days = 0; - - if (end > start) { - seconds = Math.round((end - start) / 1000); - if (seconds > 60) { - minutes = Math.floor(seconds / 60); - seconds = seconds % 60; - if (minutes > 60) { - hours = Math.floor(minutes / 60); - minutes = minutes % 60; - if (hours > 24) { - days = Math.floor(hours / 24); - hours = hours % 24; - } - } - } - } - var res = ''; - if (days > 0) { - if (res) { res += ', '; } - res += days + " day(s)" - } - if (hours > 0) { - if (res) { res += ', '; } - res += hours + " hour(s)" - } - if (minutes > 0) { - if (res) { res += ', '; } - res += minutes + " minute(s)" - } - if (seconds > 0) { - if (res) { res += ', '; } - res += seconds + " second(s)" - } - if (!res) { - res = '0 seconds'; - } - - return res; - } - - $scope.reload(); -}); \ No newline at end of file