Commit aef7c1b1 authored by Matija Obreza's avatar Matija Obreza

Upgrade to file-repository:1.0-SNAPSHOT

parent 7ef18bb4
......@@ -515,7 +515,7 @@
<dependency>
<groupId>org.genesys-pgr</groupId>
<artifactId>file-repository-ftpserver</artifactId>
<version>0.9</version>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
......
......@@ -73,7 +73,7 @@ public class FilesMetadataUpdate extends ImportFromCSV<RepositoryFile> {
RepositoryFile updatedFile = null;
try {
updatedFile = repositoryService.updateMetadata(sourceFile.getUuid(), sourceFile);
updatedFile = repositoryService.updateMetadata(sourceFile);
} catch (NoSuchRepositoryFileException e) {
LOG.error("Can not find RepositoryFile with uuid:{}", sourceFile.getUuid());
}
......
......@@ -123,7 +123,9 @@ public class InstituteFilesServiceImpl implements InstituteFilesService {
LOG.warn("{}!={}", repositoryFile.getPath(), getGalleryPath(institute, accession));
throw new ResourceNotFoundException("No such thing");
}
return this.repositoryService.updateImageMetadata(repositoryFile.getUuid(), imageData);
imageData.setUuid(repositoryFile.getUuid());
imageData.setVersion(repositoryFile.getVersion());
return this.repositoryService.updateImageMetadata(imageData);
}
@Override
......
......@@ -609,8 +609,7 @@ public class WiewsController extends BaseController {
// check user permissions
instituteService.getInstituteForEdit(wiewsCode);
RepositoryFile updatedFile = repositoryService.getFile(UUID.fromString(fileData.getUuid().toString()));
repositoryService.updateMetadata(updatedFile.getUuid(), fileData);
RepositoryFile updatedFile = repositoryService.updateMetadata(fileData);
String fileSubPath = updatedFile.getPath().replace("/wiews/" + wiewsCode, "");
return "redirect:/wiews/" + wiewsCode + "/files" + fileSubPath;
......
......@@ -125,9 +125,7 @@ public class RepositoryController extends BaseController {
@RequestMapping(value = "/update", method = RequestMethod.POST)
public String updateMetadata(@ModelAttribute RepositoryFile fileData, @RequestParam String uuid, RedirectAttributes redirectAttributes)
throws NoSuchRepositoryFileException {
RepositoryFile updatedFile = repositoryService.getFile(UUID.fromString(uuid));
updatedFile = repositoryService.updateMetadata(updatedFile.getUuid(), fileData);
RepositoryFile updatedFile = repositoryService.updateMetadata(fileData);
return "redirect:" + CONTROLLER_PATH + "/files" + updatedFile.getPath();
}
......
......@@ -9,13 +9,14 @@ changeLogFile=src/main/resources/liquibase/liquibase-changeLog.yml
# Uncomment for mvn liquibase:diff
diffChangeLogFile=src/main/resources/liquibase/liquibase-diff-changeLog.yml
## &hibernate.ejb.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy
# Existing database
url=jdbc:mysql://localhost/genesysold?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false&hibernate.ejb.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy
url=jdbc:mysql://localhost/genesysold?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
username=root
password=
driver=com.mysql.jdbc.Driver
# Upgraded database
referenceUrl=jdbc:mysql://localhost/genesys?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false&hibernate.ejb.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy
referenceUrl=jdbc:mysql://localhost/genesys?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
referenceDriver=com.mysql.jdbc.Driver
referenceUsername=root
referencePassword=
......@@ -2306,3 +2306,24 @@ databaseChangeLog:
onUpdate: NO ACTION
referencedColumnNames: id
referencedTableName: subset
- changeSet:
id: 1531941193570-18
author: mobreza (generated)
comment: Changes for file-repository@1.0-SNAPSHOT
changes:
- renameTable:
newTableName: repository_document
oldTableName: repositorydocument
- renameTable:
newTableName: repository_file
oldTableName: repositoryfile
- renameTable:
newTableName: repository_gallery
oldTableName: repositorygallery
- renameTable:
newTableName: repository_gallery_image
oldTableName: repositorygalleryimage
- renameTable:
newTableName: repository_image
oldTableName: repositoryimage
Markdown is supported
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