Commit aef7c1b1 authored by Matija Obreza's avatar Matija Obreza
Browse files

Upgrade to file-repository:1.0-SNAPSHOT

parent 7ef18bb4
...@@ -515,7 +515,7 @@ ...@@ -515,7 +515,7 @@
<dependency> <dependency>
<groupId>org.genesys-pgr</groupId> <groupId>org.genesys-pgr</groupId>
<artifactId>file-repository-ftpserver</artifactId> <artifactId>file-repository-ftpserver</artifactId>
<version>0.9</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mockito</groupId> <groupId>org.mockito</groupId>
......
...@@ -73,7 +73,7 @@ public class FilesMetadataUpdate extends ImportFromCSV<RepositoryFile> { ...@@ -73,7 +73,7 @@ public class FilesMetadataUpdate extends ImportFromCSV<RepositoryFile> {
RepositoryFile updatedFile = null; RepositoryFile updatedFile = null;
try { try {
updatedFile = repositoryService.updateMetadata(sourceFile.getUuid(), sourceFile); updatedFile = repositoryService.updateMetadata(sourceFile);
} catch (NoSuchRepositoryFileException e) { } catch (NoSuchRepositoryFileException e) {
LOG.error("Can not find RepositoryFile with uuid:{}", sourceFile.getUuid()); LOG.error("Can not find RepositoryFile with uuid:{}", sourceFile.getUuid());
} }
......
...@@ -123,7 +123,9 @@ public class InstituteFilesServiceImpl implements InstituteFilesService { ...@@ -123,7 +123,9 @@ public class InstituteFilesServiceImpl implements InstituteFilesService {
LOG.warn("{}!={}", repositoryFile.getPath(), getGalleryPath(institute, accession)); LOG.warn("{}!={}", repositoryFile.getPath(), getGalleryPath(institute, accession));
throw new ResourceNotFoundException("No such thing"); 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 @Override
......
...@@ -609,8 +609,7 @@ public class WiewsController extends BaseController { ...@@ -609,8 +609,7 @@ public class WiewsController extends BaseController {
// check user permissions // check user permissions
instituteService.getInstituteForEdit(wiewsCode); instituteService.getInstituteForEdit(wiewsCode);
RepositoryFile updatedFile = repositoryService.getFile(UUID.fromString(fileData.getUuid().toString())); RepositoryFile updatedFile = repositoryService.updateMetadata(fileData);
repositoryService.updateMetadata(updatedFile.getUuid(), fileData);
String fileSubPath = updatedFile.getPath().replace("/wiews/" + wiewsCode, ""); String fileSubPath = updatedFile.getPath().replace("/wiews/" + wiewsCode, "");
return "redirect:/wiews/" + wiewsCode + "/files" + fileSubPath; return "redirect:/wiews/" + wiewsCode + "/files" + fileSubPath;
......
...@@ -125,9 +125,7 @@ public class RepositoryController extends BaseController { ...@@ -125,9 +125,7 @@ public class RepositoryController extends BaseController {
@RequestMapping(value = "/update", method = RequestMethod.POST) @RequestMapping(value = "/update", method = RequestMethod.POST)
public String updateMetadata(@ModelAttribute RepositoryFile fileData, @RequestParam String uuid, RedirectAttributes redirectAttributes) public String updateMetadata(@ModelAttribute RepositoryFile fileData, @RequestParam String uuid, RedirectAttributes redirectAttributes)
throws NoSuchRepositoryFileException { throws NoSuchRepositoryFileException {
RepositoryFile updatedFile = repositoryService.getFile(UUID.fromString(uuid)); RepositoryFile updatedFile = repositoryService.updateMetadata(fileData);
updatedFile = repositoryService.updateMetadata(updatedFile.getUuid(), fileData);
return "redirect:" + CONTROLLER_PATH + "/files" + updatedFile.getPath(); return "redirect:" + CONTROLLER_PATH + "/files" + updatedFile.getPath();
} }
......
...@@ -9,13 +9,14 @@ changeLogFile=src/main/resources/liquibase/liquibase-changeLog.yml ...@@ -9,13 +9,14 @@ changeLogFile=src/main/resources/liquibase/liquibase-changeLog.yml
# Uncomment for mvn liquibase:diff # Uncomment for mvn liquibase:diff
diffChangeLogFile=src/main/resources/liquibase/liquibase-diff-changeLog.yml diffChangeLogFile=src/main/resources/liquibase/liquibase-diff-changeLog.yml
## &hibernate.ejb.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy
# Existing database # 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 username=root
password= password=
driver=com.mysql.jdbc.Driver driver=com.mysql.jdbc.Driver
# Upgraded database # 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 referenceDriver=com.mysql.jdbc.Driver
referenceUsername=root referenceUsername=root
referencePassword= referencePassword=
...@@ -2306,3 +2306,24 @@ databaseChangeLog: ...@@ -2306,3 +2306,24 @@ databaseChangeLog:
onUpdate: NO ACTION onUpdate: NO ACTION
referencedColumnNames: id referencedColumnNames: id
referencedTableName: subset 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