Commit 8918129f authored by Matija Obreza's avatar Matija Obreza

Merge branch '33-bump-version' into 'master'

Resolve "Bump version"

Closes #33

See merge request !39
parents 73a31dd0 f043076a
Pipeline #13541 passed with stage
in 2 minutes and 1 second
# Changelog
## 1.1 Release
April 2, 2020
- d3a2a78 Metadata for .json files is stored in .json.json
- 07ffb83 New method to load galleries list
- 0506bd2 Fix: FolderNotEmptyException is thrown for no good reason
- 577005e Revert "Fix: FolderNotEmptyException is thrown for no good reason"
- 53c8489 Fix: FolderNotEmptyException is thrown for no good reason
- f85c65e Blacklist originalFilenames in Repository
- e25f6d2 Thumbs: bugfixes
- 71ae1fa Thumbnails as JPEGs
- 7adf7dd Updated CI for artifact deployment
- 1337c5c maven-gpg-plugin version update
- 7620183 Improved generating of thumbnails
- c9d5e0c FTP: CWD only to existing folders
- 887342e Introducing AbstractRepositoryFolderAspects
- b55f11c Mapped 1-to-1 RepositoryFolder to ImageGallery
- 822f08c Added listFolders, listFiles with pagination
- b567e8d Fix: Respect metadata information over incoming file information
- 0fa2de9 mvn surefire plugin problem
- 7857634 Repository services with `sort` parameter
- e2b2fa9 RepositoryFolder: inherit permissions from alternative ACL OID
- d514b73 Fix: Thumbnail generation
- eeb3df1 Create thumbnails of pre-determined sizes when images added to Gallery
- 3b2ad71 FIX: ensureThumbnails with read-only transaction
- cf98e1f Added JSON views
- 3ded77e Additional service methods to manage Folder data
- b3bd164 RepositoryService#getFileBytes by path removed
- 7a09043 Repository path must be absolute (starting with /)
- a6317a0 Updated FTP server tests for ACL support in repository
- 1b55451 Image gallery ACL update respects folder permissions
- 5c9f96c Ensure user has write permission on parent folder
- a627ed9 FIX: ignore null paths during migration
- 9bb00fd Cleanup and tests after upgrade to using Path
- 7a2277d RepositoryFile with ACL
## 1.0 Release
September 19, 2018.
......
......@@ -20,7 +20,7 @@
<parent>
<groupId>org.genesys-pgr</groupId>
<artifactId>file-repository</artifactId>
<version>1.1-SNAPSHOT</version>
<version>1.2-SNAPSHOT</version>
</parent>
<artifactId>file-repository-core</artifactId>
<name>Genesys File Repository</name>
......@@ -159,6 +159,19 @@
<version>${spring.data.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>2.1.15.RELEASE</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Hibernate dependencies -->
<dependency>
<groupId>org.hibernate</groupId>
......@@ -191,7 +204,7 @@
<dependency>
<groupId>org.genesys-pgr</groupId>
<artifactId>application-blocks-security</artifactId>
<version>1.5-SNAPSHOT</version>
<version>1.7-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
......
/*
* Copyright 2018 Global Crop Diversity Trust
* Copyright 2020 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -40,7 +40,7 @@ import com.querydsl.jpa.impl.JPAQueryFactory;
/**
* Creates {@link RepositoryFolder} entries and their parents - Links all
* {@link RepositoryFile} to their parent folders
* {@link RepositoryFile} to their parent folders.
*
* @author Matija Obreza
*/
......@@ -65,6 +65,11 @@ public class RepositoryUpgrade20180920 {
@Autowired
private JPAQueryFactory jpaQueryFactory;
/**
* Do upgrade.
*
* @throws Exception the exception
*/
public void doUpgrade() throws Exception {
TransactionTemplate tmpl = new TransactionTemplate(txManager);
tmpl.execute(new TransactionCallbackWithoutResult() {
......
......@@ -31,7 +31,7 @@ public interface ImageGalleryPersistence extends JpaRepository<ImageGallery, Lon
/**
* Find gallery for specified path.
*
* @param path The path of image gallery in the repository
* @param folder the folder
* @return the Gallery!
*/
ImageGallery findByFolder(RepositoryFolder folder);
......
......@@ -24,7 +24,6 @@ import org.genesys.filerepository.model.RepositoryDocument;
import org.genesys.filerepository.model.RepositoryFolder;
import org.springframework.stereotype.Repository;
// TODO: Auto-generated Javadoc
/**
* The Interface RepositoryDocumentPersistence.
*/
......@@ -42,7 +41,7 @@ public interface RepositoryDocumentPersistence extends RepositoryPersistence<Rep
/**
* Find by folder.
*
* @param repositoryPath the repository folder
* @param folder the folder
* @return the list
*/
List<RepositoryDocument> findByFolder(RepositoryFolder folder);
......
......@@ -26,7 +26,6 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QueryDslPredicateExecutor;
import org.springframework.stereotype.Repository;
// TODO: Auto-generated Javadoc
/**
* The Interface RepositoryFilePersistence.
*/
......
......@@ -26,7 +26,6 @@ import org.springframework.data.domain.Sort;
import org.springframework.data.querydsl.QueryDslPredicateExecutor;
import org.springframework.stereotype.Repository;
// TODO: Auto-generated Javadoc
/**
* The Interface RepositoryImagePersistence.
*/
......@@ -51,9 +50,10 @@ public interface RepositoryImagePersistence extends RepositoryPersistence<Reposi
RepositoryImage findByUuidAndVersion(UUID fileUuid, int version);
/**
* Find by folder
* Find by folder.
*
* @param repositoryPath the repository folder
* @param folder the folder
* @param sort the sort
* @return the list
*/
List<RepositoryImage> findByFolder(RepositoryFolder folder, final Sort sort);
......
......@@ -107,9 +107,9 @@ public interface ImageGalleryService {
ImageGallery saveImageOrder(ImageGallery imageGallery);
/**
* Ensure that thumbnails are created for pre-configured thumbnail sizes
*
* @param imageGallery
* Ensure that thumbnails are created for pre-configured thumbnail sizes.
*
* @param imageGallery the image gallery
*/
void ensureThumbnails(ImageGallery imageGallery);
......@@ -135,7 +135,7 @@ public interface ImageGalleryService {
/**
* List image galleries at repository path starting with <code>prefix</code>.
*
* @param prefix the prefix
* @param root the root
* @param pageable the pageable
* @return paginated image gallery data
* @throws InvalidRepositoryPathException if path is not a valid repository path
......
......@@ -107,8 +107,8 @@ public interface RepositoryService {
* @param path the path
* @param filename the filename
* @return the file
* @throws InvalidRepositoryPathException if path is not a valid repository path
* @throws NoSuchRepositoryFileException the no such repository file exception
* @throws InvalidRepositoryPathException if path is not a valid repository path
*/
RepositoryFile getFile(Path path, String filename) throws NoSuchRepositoryFileException, InvalidRepositoryPathException;
......@@ -125,9 +125,9 @@ public interface RepositoryService {
* List all files at the specified repository path.
*
* @param folderPath the folder path
* @param sort the sort
* @return the files
* @throws InvalidRepositoryPathException if path is not a valid repository path
* @throws NoSuchRepositoryFileException
*/
List<RepositoryFile> getFiles(Path folderPath, Sort sort) throws InvalidRepositoryPathException;
......@@ -144,9 +144,10 @@ public interface RepositoryService {
/**
* Stream file info at the specified repository path.
*
* @param repositoryPath the repository path
* @param root the root
* @param sort the sort
* @return the files
* @throws InvalidRepositoryPathException
* @throws InvalidRepositoryPathException the invalid repository path exception
*/
Stream<RepositoryFile> streamFiles(Path root, Sort sort) throws InvalidRepositoryPathException;
......@@ -202,7 +203,7 @@ public interface RepositoryService {
* Move the file to a different repository path.
*
* @param repositoryFile the repository file
* @param newPath the new path
* @param target the target
* @return the repository file
* @throws NoSuchRepositoryFileException the no such repository file exception
* @throws InvalidRepositoryPathException if path is not a valid repository path
......@@ -225,6 +226,7 @@ public interface RepositoryService {
* List all {@link RepositoryImage} entries at specified path.
*
* @param path the path
* @param sort the sort
* @return the list
*/
List<RepositoryImage> listImages(Path path, Sort sort);
......@@ -233,7 +235,7 @@ public interface RepositoryService {
* List all paths within the root Path, including the root folder itself if it
* exists.
*
* @param prefix the prefix
* @param root the root
* @return the list
* @throws InvalidRepositoryPathException if path is not a valid repository path
*/
......@@ -261,15 +263,15 @@ public interface RepositoryService {
RepositoryImage removeImage(RepositoryImage repositoryImage) throws NoSuchRepositoryFileException, IOException;
/**
* Get folder by UUID
*
* Get folder by UUID.
*
* @param uuid folder UUID
* @return the folder
*/
RepositoryFolder getFolder(UUID uuid);
/**
* Gets the folder by path
* Gets the folder by path.
*
* @param folderPath the folder path
* @return the folder
......@@ -282,7 +284,8 @@ public interface RepositoryService {
*
* @param folder the folder
* @return the updated repository folder
* @throws NoSuchRepositoryFolderException
* @throws NoSuchRepositoryFolderException the no such repository folder
* exception
*/
RepositoryFolder updateFolder(RepositoryFolder folder) throws NoSuchRepositoryFolderException;
......@@ -308,27 +311,27 @@ public interface RepositoryService {
/**
* Register a folder at specified path. Creates a new record if path is not
* found.
*
*
* @param path the folder path
* @return a {@link RepositoryFolder}
* @throws InvalidRepositoryPathException
* @throws InvalidRepositoryPathException the invalid repository path exception
*/
RepositoryFolder ensureFolder(Path path) throws InvalidRepositoryPathException;
/**
* Ensure folder exists with specified ACL parent object
*
* Ensure folder exists with specified ACL parent object.
*
* @param path the folder path in repository
* @param aclParentObject business entity "owning" the folder
* @return
* @throws InvalidRepositoryPathException
* @return the repository folder
* @throws InvalidRepositoryPathException the invalid repository path exception
*/
RepositoryFolder ensureFolder(Path path, AclAwareModel aclParentObject) throws InvalidRepositoryPathException;
/**
* Delete an empty folder (no children, no files).
*
* @param string repository path
* @param path the path
* @return the deleted repository folder
* @throws FolderNotEmptyException if folder contains sub-folders or files
* @throws InvalidRepositoryPathException if path is not a valid repository path
......@@ -336,10 +339,11 @@ public interface RepositoryService {
RepositoryFolder deleteFolder(Path path) throws FolderNotEmptyException, InvalidRepositoryPathException;
/**
* Get subfolders of root
*
* @param root
* @return
* Get subfolders of root.
*
* @param root the root
* @param sort the sort
* @return the folders
* @throws InvalidRepositoryPathException if path is not a valid repository path
*/
List<RepositoryFolder> getFolders(Path root, Sort sort) throws InvalidRepositoryPathException;
......
......@@ -65,7 +65,7 @@ public abstract class AbstractImageGalleryAspects {
* Adds the image to gallery.
*
* @param repositoryImage the repository image
* @throws InvalidRepositoryPathException
* @throws InvalidRepositoryPathException the invalid repository path exception
*/
protected abstract void addImageToGallery(RepositoryImage repositoryImage) throws InvalidRepositoryPathException;
......@@ -125,7 +125,7 @@ public abstract class AbstractImageGalleryAspects {
* Removes the image from gallery.
*
* @param repositoryImage the repository image
* @throws InvalidRepositoryPathException
* @throws InvalidRepositoryPathException the invalid repository path exception
*/
protected abstract void removeImageFromGallery(RepositoryImage repositoryImage) throws InvalidRepositoryPathException;
}
\ No newline at end of file
......@@ -112,6 +112,7 @@ public abstract class AbstractRepositoryFolderAspects {
* On remove folder.
*
* @param repositoryFolder the repository folder
* @throws FileRepositoryException the file repository exception
*/
protected abstract void onRemoveFolder(RepositoryFolder repositoryFolder) throws FileRepositoryException;
......@@ -119,6 +120,7 @@ public abstract class AbstractRepositoryFolderAspects {
* On add folder.
*
* @param repositoryFolder the repository folder
* @throws FileRepositoryException the file repository exception
*/
protected abstract void onSaveFolder(RepositoryFolder repositoryFolder) throws FileRepositoryException;
}
\ No newline at end of file
......@@ -76,7 +76,7 @@ public class ImageGalleryAspectsImpl extends AbstractImageGalleryAspects impleme
* add it to the gallery if it exists.
*
* @param repositoryImage the repository image
* @throws InvalidRepositoryPathException
* @throws InvalidRepositoryPathException the invalid repository path exception
*/
@Override
public void addImageToGallery(final RepositoryImage repositoryImage) throws InvalidRepositoryPathException {
......@@ -112,7 +112,7 @@ public class ImageGalleryAspectsImpl extends AbstractImageGalleryAspects impleme
* Check if image is part of a gallery at the specified path and remove it.
*
* @param repositoryImage the repository image
* @throws InvalidRepositoryPathException
* @throws InvalidRepositoryPathException the invalid repository path exception
*/
@Override
public void removeImageFromGallery(final RepositoryImage repositoryImage) throws InvalidRepositoryPathException {
......
......@@ -116,7 +116,7 @@ public class FilesystemStorageServiceImpl implements InitializingBean, BytesStor
}
/**
* Gets the path where subPath a sub-folder of {@link #repoDir}
* Gets the path where subPath a sub-folder of {@link #repoDir}.
*
* @param subPath the normal path
* @return the dest path
......
......@@ -57,7 +57,7 @@ import com.querydsl.jpa.impl.JPAQuery;
import com.querydsl.jpa.impl.JPAQueryFactory;
/**
* Image Gallery service
* Image Gallery service.
*/
@Service
@Transactional(readOnly = true)
......@@ -437,6 +437,11 @@ public class ImageGalleryServiceImpl implements ImageGalleryService {
return new PageImpl<>(content, pageable, total);
}
/**
* Sets the thumbnail sizes.
*
* @param thumbnailSizes the new thumbnail sizes
*/
public void setThumbnailSizes(int[] thumbnailSizes) {
Arrays.sort(thumbnailSizes);
this.thumbnailSizes = thumbnailSizes;
......
......@@ -45,7 +45,7 @@ public class PathValidator {
/**
* Checks if folder name is valid.
*
* @param path the path
* @param name the name
* @return true, if path is valid
*/
protected static boolean isValidFolderName(final String name) {
......
......@@ -481,8 +481,7 @@ public class S3StorageServiceImpl implements BytesStorageService, InitializingBe
/**
* http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectHEAD.html
*
* @param path the path
* @param filename the filename
* @param bytesFile the bytes file
* @return true, if successful
* @throws IOException when other stuff is bad
* @throws InvalidRepositoryPathException when path or filename are weird
......
......@@ -20,7 +20,7 @@
<parent>
<groupId>org.genesys-pgr</groupId>
<artifactId>file-repository</artifactId>
<version>1.1-SNAPSHOT</version>
<version>1.2-SNAPSHOT</version>
</parent>
<artifactId>file-repository-ftpserver</artifactId>
<name>FTP/S for Genesys File Repository</name>
......@@ -83,20 +83,20 @@
<dependency>
<groupId>org.genesys-pgr</groupId>
<artifactId>application-blocks-security</artifactId>
<version>1.5-SNAPSHOT</version>
<version>1.7-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.genesys-pgr</groupId>
<artifactId>file-repository-core</artifactId>
<version>1.1-SNAPSHOT</version>
<version>1.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.genesys-pgr</groupId>
<artifactId>file-repository-core</artifactId>
<type>test-jar</type>
<version>1.1-SNAPSHOT</version>
<version>1.2-SNAPSHOT</version>
<scope>test</scope>
</dependency>
......
......@@ -7,13 +7,11 @@
OR CONDITIONS OF ANY KIND, either express or implied. See the License for
the specific language governing permissions and limitations under the License. -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.genesys-pgr</groupId>
<artifactId>file-repository</artifactId>
<version>1.1-SNAPSHOT</version>
<version>1.2-SNAPSHOT</version>
<name>Genesys File Repository</name>
<description>Parent project for the File Repository projects</description>
<url>https://gitlab.croptrust.org/genesys-pgr/file-repository</url>
......@@ -62,10 +60,6 @@
<url>https://gitlab.croptrust.org/genesys-pgr/file-repository/issues</url>
</issueManagement>
<prerequisites>
<maven>3.0</maven>
</prerequisites>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdk.target>1.8</jdk.target>
......
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