Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
85bb89b
deletion of all Project Service types
jsavell Jun 15, 2018
5d2c4ec
list Projects affected by potential ProjectService deletion
jsavell Jun 18, 2018
761990b
use correct model reference in modals
jsavell Jun 19, 2018
317c09b
projects without documents can be deleted
jsavell Jun 19, 2018
04f4524
Merge branch 'june-dame-sprint-b03511-pm-delete' into project-managem…
jsavell Jun 19, 2018
31194b7
Merge remote-tracking branch 'origin/master' into project-management-…
jsavell Jun 19, 2018
1b76d2e
restore document PublishedLocations display
jsavell Jun 26, 2018
a2ffeec
upload csv when creating CSV Authority
jsavell Jun 29, 2018
9110429
Changed delete span to button, same for reject
rladdusaw Oct 29, 2018
c0ecfdf
Item B-03566: sync single project based on project name
kaladay Oct 30, 2018
a937b81
When response status is ERROR, alter message is already added
kaladay Oct 30, 2018
d73dee6
Merge pull request #120 from TAMULib/b03513-tab-to-delete
jsavell Oct 30, 2018
6599ee5
Merge pull request #121 from TAMULib/dame-sprint-oct-b03566-sync_service
jsavell Oct 30, 2018
90800c5
project deletion ui
jsavell Nov 2, 2018
36e6691
WIP: Item B-03398: [MAGPIE] As a curator, I need an image viewer in M…
kaladay Nov 5, 2018
67633f1
Merge pull request #122 from TAMULib/dame-sprint-oct-b03674-delete
kaladay Nov 5, 2018
6cf8720
open seadragon integrated with cantaloupe (wip)
jsavell Nov 8, 2018
6e5c17d
(wip) refactor content viewing to be directive driven
jsavell Nov 8, 2018
b241107
functional proof of concept for updated content viewing
jsavell Nov 9, 2018
4ae1694
restore multi file nav, code cleanup
jsavell Nov 9, 2018
188860f
unify multi file nav across view types
jsavell Nov 9, 2018
f4c17c7
code cleanup
jsavell Nov 9, 2018
43d37ed
more clean up
jsavell Nov 9, 2018
0f94724
provide fallback to basic image viewer if cantaloupeService is null
jsavell Nov 9, 2018
d4054aa
update package-lock
jsavell Nov 9, 2018
7ebd3c8
Merge pull request #123 from TAMULib/dame-sprint-oct-b03398-imageview…
jsavell Nov 12, 2018
340c12b
Merge branch 'dame-sprint-oct-base' into project-management-feature-d…
jsavell Nov 14, 2018
be277ba
Merge branch 'dame-sprint-oct-staging' into project-management-featur…
jsavell Nov 14, 2018
f9b29c1
use consistent remove in apiMapping
jsavell Nov 14, 2018
28998e2
add a very important semi-colon
jsavell Nov 14, 2018
adb132c
Update appConfig.js
jcreel Nov 15, 2018
35a17f1
remove duplicate function, fix button tag
jsavell Nov 16, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ module.exports = function (grunt) {
'node_modules/weaver-ui-core/app/controllers/registrationController.js',
'node_modules/weaver-ui-core/app/controllers/userController.js',
'node_modules/weaver-ui-core/app/controllers/errorPageController.js',

'node_modules/openseadragon/build/openseadragon/openseadragon.min.js',
'node_modules/ng-openseadragon/dist/ng-openseadragon.min.js'
],
dest: '<%= build.app %>/resources/scripts/core_concat.js'
},
Expand Down Expand Up @@ -206,4 +209,4 @@ module.exports = function (grunt) {

grunt.registerTask('deploy', ['jshint', 'useminPrepare', 'concat', 'uglify', 'usemin', 'sass']);

};
};
3 changes: 2 additions & 1 deletion app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ var metadataTool = angular.module('metadataTool', [
'ngTable',
'ngSanitize',
'ngCsv',
'ngFileUpload'
'ngFileUpload',
'ui.openseadragon'
]);

metadataTool.model = core.model;
Expand Down
18 changes: 14 additions & 4 deletions app/config/apiMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ var apiMapping = {
remove: {
'endpoint': '/private/queue',
'controller': 'project',
'method': 'delete'
'method': 'remove'
},
ingestTypes: {
'endpoint': '/private/queue',
Expand All @@ -143,6 +143,11 @@ var apiMapping = {
'endpoint': '/private/queue',
'controller': 'project',
'method': 'get-field-profile-labels'
},
syncDocuments: {
'endpoint': '/private/queue',
'controller': 'project',
'method': 'sync'
}
},
ProjectRepository: {
Expand All @@ -165,7 +170,7 @@ var apiMapping = {
remove: {
'endpoint': '/private/queue',
'controller': 'project-repository',
'method': 'delete'
'method': 'remove'
},
types: {
'endpoint': '/private/queue',
Expand Down Expand Up @@ -193,12 +198,17 @@ var apiMapping = {
remove: {
'endpoint': '/private/queue',
'controller': 'project-authority',
'method': 'delete'
'method': 'remove'
},
types: {
'endpoint': '/private/queue',
'controller': 'project-authority',
'method': 'types'
},
uploadCsv: {
'endpoint': '/private/queue',
'controller': 'project-authority',
'method': 'upload-csv'
}
},
ProjectSuggestor: {
Expand All @@ -221,7 +231,7 @@ var apiMapping = {
remove: {
'endpoint': '/private/queue',
'controller': 'project-suggestor',
'method': 'delete'
'method': 'remove'
},
types: {
'endpoint': '/private/queue',
Expand Down
9 changes: 7 additions & 2 deletions app/config/appConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ var appConfig = {
// Set this to the webService if mocking AuthService

'authService': 'http://labs.library.tamu.edu/auth3',
'webService': 'http://localhost:9001',

'webService': 'http://localhost:9000',
'iiifService': 'http://localhost:9003',
//If cantaloupeService is null, a simple image viewer will be used instead of the OpenSeaDragon viewer
'cantaloupeService': 'http://localhost:8182/iiif/2/',

'basePath': '/metadatatool',

'storageType': 'session',

Expand All @@ -31,6 +34,8 @@ var appConfig = {
*/
'sockJsConnectionType': ['websocket', 'iframe-eventsource', 'iframe-htmlfile', 'jsonp-polling'],

'contentMap': {"image": ["image/jpeg", "image/jpg", "image/png", "image/gif", "image/svg", "image/bmp", "image/jp2", "image/jpx", "image/tif", "image/tiff"],"pdf": ["application/pdf"], "text": ["text/plain"]},

// Set this to 'admin' or 'user' if using mock AuthService
// otherwise set to null or false

Expand Down
10 changes: 0 additions & 10 deletions app/controllers/adminController.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,4 @@ metadataTool.controller('AdminController', function ($controller, $injector, $ro
$scope: $scope
}));

$scope.sync = function () {
WsApi.fetch({
endpoint: '/private/queue',
controller: 'admin',
method: 'sync'
}).then(function (data) {
logger.log(data);
});
};

});
85 changes: 27 additions & 58 deletions app/controllers/annotateController.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
metadataTool.controller('AnnotateController', function ($controller, $http, $location, $routeParams, $q, $scope, $timeout, AlertService, ControlledVocabularyRepo, DocumentRepo, ResourceRepo, StorageService, UserService) {
metadataTool.controller('AnnotateController', function ($controller, $http, $location, $routeParams, $q, $scope, $timeout, AlertService, ControlledVocabularyRepo, DocumentRepo, ResourceRepo, StorageService, UserService, ProjectRepositoryRepo) {

angular.extend(this, $controller('AbstractController', {
$scope: $scope
Expand All @@ -12,11 +12,15 @@ metadataTool.controller('AnnotateController', function ($controller, $http, $loc

$scope.cv = ControlledVocabularyRepo.getAll();

$scope.repositories = ProjectRepositoryRepo.getAll();

$scope.action = $routeParams.action;

$scope.loadingText = "Loading...";

$q.all([documentPromise, resourcesPromise, ControlledVocabularyRepo.ready()]).then(function (args) {
var types = appConfig.contentMap;

$q.all([documentPromise, resourcesPromise, ControlledVocabularyRepo.ready(), ProjectRepositoryRepo.ready()]).then(function (args) {
$scope.document = args[0];

$scope.resources = args[1];
Expand All @@ -40,29 +44,6 @@ metadataTool.controller('AnnotateController', function ($controller, $http, $loc
$scope.suggestions = payload["ArrayList<Suggestion>"] !== undefined ? payload["ArrayList<Suggestion>"] : payload.ArrayList;
});

var types = {
text: ['text/plain'],
pdf: ['application/pdf'],
image: ['image/jpeg', 'image/jpg', 'image/jp2', 'image/jpx', 'image/svg', 'image/bmp', 'image/gif', 'image/png', 'image/tif', 'image/tiff']
};

var selected = {
text: 0,
pdf: 0,
image: 0
};

var transition = function () {
$scope.loading = true;
$scope.switching = true;
$timeout(function () {
$scope.loading = false;
}, 1000);
$timeout(function () {
$scope.switching = false;
}, 250);
};

$scope.hasFileType = function (type) {
for (var k in $scope.resources) {
var resource = $scope.resources[k];
Expand All @@ -73,39 +54,15 @@ metadataTool.controller('AnnotateController', function ($controller, $http, $loc
return false;
};

$scope.active = $scope.hasFileType('text') ? 'text' : $scope.hasFileType('pdf') ? 'pdf' : $scope.hasFileType('image') ? 'image' : undefined;

$scope.select = function (type) {
$scope.active = type;
};

$scope.getFiles = function () {
$scope.getFilesOfType = function (type) {
if ($scope.resources === undefined) {
return [];
}
return $scope.resources.filter(function (resource) {
return types[$scope.active].indexOf(resource.mimeType) >= 0;
return types[type].indexOf(resource.mimeType) >= 0;
});
};

$scope.selected = function () {
return selected[$scope.active];
};

$scope.next = function () {
if ($scope.selected() < $scope.getFiles().length - 1) {
transition();
selected[$scope.active]++;
}
};

$scope.previous = function () {
if ($scope.selected() > 0) {
transition();
selected[$scope.active]--;
}
};

$scope.removeMetadataField = function (field, index) {
$scope.document.dirty(true);
field.values.splice(index, 1);
Expand Down Expand Up @@ -232,17 +189,18 @@ metadataTool.controller('AnnotateController', function ($controller, $http, $loc
var urls = [];
for (var i in $scope.document.publishedLocations) {
var publishedLocation = $scope.document.publishedLocations[i];
if (publishedLocation.repository.type === 'FEDORA_PCDM') {
var fedoraUrl = getSetting(publishedLocation.repository.settings, 'repoUrl').values[0];
var fedoraRestPath = getSetting(publishedLocation.repository.settings, 'restPath').values[0];
var publishedRepository = $scope.getRepositoryById(publishedLocation.repository);
if (publishedRepository.type === 'FEDORA_PCDM') {
var fedoraUrl = getSetting(publishedRepository.settings, 'repoUrl').values[0];
var fedoraRestPath = getSetting(publishedRepository.settings, 'restPath').values[0];
var fedoraRestBaseUrl = fedoraUrl + '/' + fedoraRestPath + '/';
var containerContextPath = publishedLocation.url.replace(fedoraRestBaseUrl, '');
urls.push(appConfig.iiifService + '/fedora/presentation?context=' + containerContextPath);
urls.push(appConfig.iiifService + '/fedora/collection?context=' + containerContextPath.substring(0, containerContextPath.lastIndexOf('/')).replace('_objects', ''));
}
if (publishedLocation.repository.type === 'DSPACE') {
var dspaceUrl = getSetting(publishedLocation.repository.settings, 'repoUrl').values[0];
var dspaceXmluiPath = getSetting(publishedLocation.repository.settings, 'repoContextPath').values[0];
if (publishedRepository.type === 'DSPACE') {
var dspaceUrl = getSetting(publishedRepository.settings, 'repoUrl').values[0];
var dspaceXmluiPath = getSetting(publishedRepository.settings, 'repoContextPath').values[0];
var dspaceXmluiBaseUrl = dspaceUrl + '/' + dspaceXmluiPath + '/';
var handlePath = publishedLocation.url.replace(dspaceXmluiBaseUrl, '');
urls.push(appConfig.iiifService + '/dspace/presentation?context=' + handlePath);
Expand All @@ -251,6 +209,17 @@ metadataTool.controller('AnnotateController', function ($controller, $http, $loc
}
return urls;
};

$scope.getRepositoryById = function(repositoryId) {
var respository = null;
for (var i in $scope.repositories) {
if (repositoryId == $scope.repositories[i].id) {
repository = $scope.repositories[i];
break;
}
}
return repository;
};
});

});
Expand All @@ -272,4 +241,4 @@ metadataTool.filter('selected', function () {
}
return output;
};
});
});
36 changes: 33 additions & 3 deletions app/controllers/projectAuthorityController.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
metadataTool.controller('ProjectAuthorityController', function ($controller, $scope, UserService, ProjectAuthorityRepo) {
metadataTool.controller('ProjectAuthorityController', function ($controller, $scope, UserService, ProjectAuthorityRepo, ProjectRepo) {

angular.extend(this, $controller('AbstractController', {$scope: $scope}));

$scope.user = UserService.getCurrentUser();

$scope.projectAuthorities = [];

$scope.projects = [];

$scope.types = [];

$scope.newAuthority = {};
Expand All @@ -20,12 +22,41 @@ metadataTool.controller('ProjectAuthorityController', function ($controller, $sc
$scope.types = serviceTypes;
});

$scope.projects = ProjectRepo.getAll();

$scope.delete = function(authority) {
manageAuthority('delete',authority);
};

$scope.update = function(authority) {
repository.dirty(true);
manageRepository('save',authority);
};

$scope.create = function(newAuthority,newAuthoritySettings) {
$scope.create = function(newAuthority,newAuthoritySettings,file) {
if (typeof file !== 'undefined') {
ProjectAuthorityRepo.uploadCsv(file).then(function(data) {
var body = angular.fromJson(data.body);
newAuthoritySettings.paths = {"value":body.payload.String};
create(newAuthority,newAuthoritySettings);
});
} else {
create(newAuthority,newAuthoritySettings);
}
};

$scope.getProjectById = function(projectId) {
var project = null;
for (var i in $scope.projects) {
if (projectId == $scope.projects[i].id) {
project = $scope.projects[i];
break;
}
}
return project;
};

var create = function(newAuthority,newAuthoritySettings) {
var settings = [];
angular.forEach(newAuthoritySettings, function(valueObj,key) {
this.push({"key":key,"values": [valueObj.value]});
Expand All @@ -35,7 +66,6 @@ metadataTool.controller('ProjectAuthorityController', function ($controller, $sc
$scope.newAuthority = {};
$scope.newAuthoritySettings = {};
});

};

var manageAuthority = function(method,authority) {
Expand Down
19 changes: 18 additions & 1 deletion app/controllers/projectController.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
metadataTool.controller('ProjectController', function ($controller, $scope, UserService, ProjectRepo, ProjectRepositoryRepo, ProjectAuthorityRepo, ProjectSuggestorRepo, MetadataRepo) {
metadataTool.controller('ProjectController', function ($controller, $scope, AlertService, UserService, ProjectRepo, ProjectRepositoryRepo, ProjectAuthorityRepo, ProjectSuggestorRepo, MetadataRepo) {

angular.extend(this, $controller('AbstractController', {$scope: $scope}));

Expand All @@ -17,6 +17,7 @@ metadataTool.controller('ProjectController', function ($controller, $scope, User
$scope.inputTypes = [];

$scope.isEditing = false;
$scope.isSyncing = false;

$scope.displayResponse = {"status":null,"message":null};

Expand Down Expand Up @@ -56,6 +57,10 @@ metadataTool.controller('ProjectController', function ($controller, $scope, User

$scope.projects = ProjectRepo.getAll();

$scope.delete = function(project) {
manageProject('delete', project);
};

$scope.update = function(project) {
angular.forEach($scope.updateableProjectServices, function(serviceIndexes, serviceType) {
project[serviceType] = [];
Expand Down Expand Up @@ -156,6 +161,18 @@ metadataTool.controller('ProjectController', function ($controller, $scope, User
}
return result;
};

$scope.syncDocuments = function (project) {
$scope.isSyncing = true;
ProjectRepo.syncDocuments(project.id).then(function (rawResponse) {
var response = angular.fromJson(rawResponse.body);
if (response.meta.status === "SUCCESS") {
AlertService.add(response.meta, "app/projects");
}
$scope.closeModal();
$scope.isSyncing = false;
});
};
}
});

Expand Down
Loading