Commit c1724525 authored by Gerrit Hübbers's avatar Gerrit Hübbers 🃏
Browse files

Rename enum to XML_XSLT_SOURCE

parent 5d03dfe1
......@@ -118,7 +118,7 @@ public class BundlesStreamSourceFactory {
Map<String, String> map = dto.getMetadataPrefix2XsltMap();
result = new XsltTransformerOaiPmhBundlesStreamSource(url, map, dto.getFrom(), dto.getUntil());
}
else if (BundlesSourceType.XML_XSLT_FILE == bundlesSourceType) {
else if (BundlesSourceType.XML_XSLT_SOURCE == bundlesSourceType) {
XmlXsltDto dto = PersistableHelper.instantiate(data, XmlXsltDto.class);
String xmlContent = dto.getXmlContent();
String xsltContent = dto.getXsltContent();
......
......@@ -4,5 +4,5 @@ package org.gesis.dda.wizard.domain.enumeration;
* The BundlesSourceType enumeration.
*/
public enum BundlesSourceType {
OAI_PMH, EXCEL_SPREADSHEET, XML_FILE, UNAPI, XSLT_OAI_PMH, XML_XSLT_FILE
OAI_PMH, EXCEL_SPREADSHEET, XML_FILE, UNAPI, XSLT_OAI_PMH, XML_XSLT_SOURCE
}
......@@ -81,7 +81,7 @@ public class BundlesSourceResource {
return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert("bundlesSource", "idexists", "A new bundlesSource cannot already have an ID")).body(null);
}
BundlesSource result = bundlesSourceRepository.save(bundlesSource);
if ( result.getType().equals(BundlesSourceType.XML_XSLT_FILE) ) {
if ( result.getType().equals(BundlesSourceType.XML_XSLT_SOURCE) ) {
result.setReference("xmlxslt-bundlessource-" + result.getId() );
result = bundlesSourceRepository.save(result);
}
......
......@@ -6,7 +6,6 @@ angular.module('ddaApp').controller('PublicationsSourcesXmlXsltSourceCreateDialo
$scope.xmlContent = '';
$scope.xsltContent = '';
$scope.reference = '';
$scope.clear = function() {
$uibModalInstance.dismiss('cancel');
......@@ -31,7 +30,7 @@ angular.module('ddaApp').controller('PublicationsSourcesXmlXsltSourceCreateDialo
BundlesSource.createForCurrentUser(
{
'data': angular.toJson(dataObject),
'type': 'XML_XSLT_FILE',
'type': 'XML_XSLT_SOURCE',
},
onSaveSuccess,
onSaveError
......
'use strict';
angular.module('ddaApp')
.controller('PublicationsSourcesXsltOaiPmhAddressDeleteDialogController', function($scope, $uibModalInstance, entity, BundlesSource) {
.controller('PublicationsSourcesXmlXsltSourceDeleteDialogController', function($scope, $uibModalInstance, entity, BundlesSource) {
$scope.entity = entity;
$scope.clear = function() {
......
......@@ -6,7 +6,7 @@
</div>
<div class="modal-body">
<jh-alert-error></jh-alert-error>
<p>Are you sure you want to delete XSLT-based OAI-PMH publication source <i>{{entity.data | jsonstring2object:"oaiPmhEndpoint" }}</i>?</p>
<p>Are you sure you want to delete XSLT-transformed XML publication source <i>{{entity.reference}}</i>?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" ng-click="clear()">
......
......@@ -8,7 +8,7 @@ angular.module('ddaApp')
$scope.oaiPmhAddresses = [];
$scope.unapiSources = [];
$scope.xsltOaiPmhAddresses = [];
$scope.xmlXsltFiles = [];
$scope.xmlXsltSources = [];
$scope.bundles = [];
$scope.page = 1;
......@@ -27,8 +27,8 @@ angular.module('ddaApp')
$scope.xsltOaiPmhAddresses = result.filter( function(bundlesSource) {
return bundlesSource.type === 'XSLT_OAI_PMH';
});
$scope.xmlXsltFiles = result.filter( function(bundlesSource) {
return bundlesSource.type === 'XML_XSLT_FILE';
$scope.xmlXsltSources = result.filter( function(bundlesSource) {
return bundlesSource.type === 'XML_XSLT_SOURCE';
});
$scope.unapiSources = result.filter( function(bundlesSource) {
return bundlesSource.type === 'UNAPI';
......
......@@ -84,33 +84,33 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="xmlXsltFile in xmlXsltFiles track by xmlXsltFile.id">
<td>{{xmlXsltFile.reference}}</td>
<td>{{xmlXsltFile.metadataTransformer.name}}</td>
<td>{{xmlXsltFile.bundlesSourceState}}</td>
<td translate="{{'ddaApp.BundlesSourceState.' + bundlesSource.bundlesSourceState}}">{{xmlXsltFile.bundlesSource.bundlesSourceState}}</td>
<tr ng-repeat="xmlXsltSource in xmlXsltSources track by xmlXsltSource.id">
<td>{{xmlXsltSource.reference}}</td>
<td>{{xmlXsltSource.metadataTransformer.name}}</td>
<td>{{xmlXsltSource.bundlesSourceState}}</td>
<td translate="{{'ddaApp.BundlesSourceState.' + bundlesSource.bundlesSourceState}}">{{xmlXsltSource.bundlesSource.bundlesSourceState}}</td>
<td class="text-right">
<div class="btn-group flex-btn-group-container">
<button type="submit"
ng-click="showBundles(xmlXsltFile.id)"
ng-click="showBundles(xmlXsltSource.id)"
class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-eye-open"></span>
<span class="hidden-xs hidden-sm"></span>
</button>
<button has-authority="ROLE_ADMIN" type="submit"
ui-sref="userRepositories.editXmlXsltFile({id:xmlXsltFile.id})"
ui-sref="userRepositories.editXmlXsltSource({id:xmlXsltSource.id})"
class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-pencil"></span>
<span class="hidden-xs hidden-sm"></span>
</button>
<button has-authority="ROLE_ADMIN" type="submit"
ng-click="harvest({id:xmlXsltFile.id})"
ng-click="harvest({id:xmlXsltSource.id})"
class="btn btn-warning btn-sm">
<span class="glyphicon glyphicon-apple"></span>
<span class="hidden-xs hidden-sm"></span>
</button>
<button has-authority="ROLE_ADMIN" type="submit"
ui-sref="userRepositories.deleteXmlXsltFile({id:xmlXsltFile.id})"
ui-sref="userRepositories.deleteXmlXsltSource({id:xmlXsltSource.id})"
class="btn btn-danger btn-sm">
<span class="glyphicon glyphicon-remove-circle"></span>
<span class="hidden-xs hidden-sm"></span>
......
......@@ -458,8 +458,8 @@ angular.module('ddaApp')
},
onEnter: ['$stateParams', '$state', '$uibModal', function($stateParams, $state, $uibModal) {
$uibModal.open({
templateUrl: 'scripts/app/account/userRepositories/publicationsSources-xsltoaipmhaddress-delete-dialog.html',
controller: 'PublicationsSourcesXsltOaiPmhAddressDeleteDialogController',
templateUrl: 'scripts/app/account/userRepositories/publicationsSources-xmlxsltsource-delete-dialog.html',
controller: 'PublicationsSourcesXmlXsltSourceDeleteDialogController',
size: 'md',
resolve: {
entity: ['BundlesSource', function(BundlesSource) {
......
......@@ -409,7 +409,7 @@ public class FeederServiceIntTest {
long bseId = underTest.getId();
String reference = "xmlxslt-bundlessource-" + bseId;
underTest.setType(BundlesSourceType.XML_XSLT_FILE);
underTest.setType(BundlesSourceType.XML_XSLT_SOURCE);
String xmlString = IOUtils.toString(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment