Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Story/vspc 204 #308

Open
wants to merge 129 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
0783f6d
[story/VSPC-204] added download section in staff page
May 26, 2022
d1b15cc
[story/VSPC-204] download api
Jun 8, 2022
e1cda05
[story/VSPC-204] added jsoup dependency
Jun 30, 2022
d68de99
[story/VSPC-204] modified download api response
Jul 1, 2022
9e509e2
[story/VSPC-204] copy images to new folder structure
Jul 5, 2022
70907bb
[story/VSPC-204] store images under eaach space
Jul 6, 2022
0d2e771
[story/VSPC-204] downlaod template modified to pick up images
Jul 7, 2022
78c5003
[story-VSPC-204] copied resources for css
Jul 8, 2022
1a6da12
[story/VSPC-204] converted to zip folder. added template for slides
Jul 11, 2022
7a71f63
[story/VSPC-204] added code to consider branching points
Jul 12, 2022
737dad5
[story/VSPC-204] zip folder download working as expected
Jul 13, 2022
0a24c03
[story/VSPC-204] list of downlods
Jul 22, 2022
ef2ee5a
[story/VSPC-204] refactored downloads manager
Jul 25, 2022
0c3e206
[story/VSPC-204] refactor
Jul 25, 2022
3caf863
[story/VSPC-204] test cases
Jul 26, 2022
b7d9442
[story/VSPC-204] test cases
Jul 27, 2022
34496eb
[story/VSPC-204] removed controller call to download html template
Jul 28, 2022
e74fe71
[story/VSPC-204] refactor
Jul 29, 2022
e280828
[story/VSPC-204]
Jul 29, 2022
dff8c3d
[story/VSPC-204] removed unwanted methods
Aug 1, 2022
e1bf075
[story/VSPC-204] code factor
Aug 1, 2022
3adad85
[story/VSPC-204] code factor
Aug 1, 2022
3a86887
[story/VSPC-204]
Aug 1, 2022
d2a9a14
Merge branch 'develop' into story/VSPC-204
Aug 2, 2022
3926ce1
[story/VSPC-204] review comments
pkharge Nov 1, 2022
7d8fb37
[story/VSPC-204] added async
pkharge Nov 2, 2022
9f521c3
[story/VSPC-204] async - polling
pkharge Nov 3, 2022
88c9b87
[story/VSPC-204] modifed backend
pkharge Nov 8, 2022
c7c6df4
[story/VSPC-204]
pkharge Nov 9, 2022
0847669
[story/VSPC-204] future task
pkharge Nov 10, 2022
4896d85
[story/VSPC-204] sequencehistory
pkharge Nov 15, 2022
1f2c46d
[story/VSPC-204] polling in javascript
pkharge Nov 16, 2022
4702909
[story/VSPC-204] thymeleaf context npe pending
pkharge Nov 30, 2022
3cc5781
[story/VSPC-204] async config
pkharge Dec 1, 2022
60bc618
[story/VSPC-204] testing branching point
pkharge Dec 2, 2022
1f4b4fd
[story/VSPC-204] review comment
pkharge Dec 6, 2022
da355c1
[story/VSPC-204] added new context to process template in async method
pkharge Dec 12, 2022
2a6ce84
[story/VSPC-204] modified space download template for async method
pkharge Dec 13, 2022
1c52717
[story/VSPC-204] async exhibition folder
pkharge Dec 14, 2022
0bdf246
[story/VSPC-204]
pkharge Dec 15, 2022
9fe3a25
[story/VSPC-204] 2 rest apis for polling
pkharge Dec 16, 2022
342f195
[story/VSPC-204] fixed ajax calls
pkharge Dec 19, 2022
0b8538e
[story/VSPC-204]progress spinner
pkharge Dec 20, 2022
f8cce1c
[story/VSPC-204] added different api for polling
pkharge Dec 21, 2022
b6f9027
[story/VSPC-204] read polling response in ui
pkharge Dec 22, 2022
fbfca18
[VSPC-204] async flow working fine
pkharge Jan 3, 2023
510692d
[story/VSPC-204] pagination added
pkharge Jan 4, 2023
9f390e4
[story/VSPC-204]test cases
pkharge Jan 5, 2023
8152349
[story/VSPC-204] added snapshot task entity
pkharge Jan 6, 2023
7ae7346
[story/VSPC-204 ]ui changes
pkharge Jan 10, 2023
d84796c
[story/VSPC-204] one to oen bidirectional
pkharge Jan 12, 2023
40a83b6
[story/VSPC-204] snapshot task fixed
pkharge Jan 14, 2023
4e716bf
[story/VSPC-204] ui alert, test cases
pkharge Jan 17, 2023
ccb6a35
[story/vspc-204] REFACTOR
pkharge Jan 19, 2023
cec7445
[story/vspc-204] refactor
pkharge Jan 19, 2023
effb3a5
[story/VSPC-204] refactor, test case
pkharge Jan 20, 2023
b7ab2e7
[story/VSPC-204] pom xml
pkharge Jan 20, 2023
8c64978
[story/VSPC-204 ] refactor
pkharge Jan 20, 2023
24fbc07
[story/VSPC-204] code factor
pkharge Jan 24, 2023
72abc69
[story/VSPC-204] code factor
pkharge Jan 24, 2023
1f05362
Merge branch 'develop' into story/VSPC-204
pkharge Jan 24, 2023
eeacaea
[story/VSPC-204] refactor
pkharge Mar 16, 2023
bcde954
[story/VSPC-204]
pkharge Mar 30, 2023
d00e77b
[story/VSPC-204] added folder type
pkharge Apr 18, 2023
bd85667
[story/VSPC-204] added relative paths
pkharge Apr 20, 2023
38ee8a9
[story/VSPC-204] testing
pkharge Apr 21, 2023
3d23f6d
[story/VSPC-204] relative path working zip folder downlaoding
pkharge Apr 25, 2023
e391b62
[story/VSPC-204] test case
pkharge Apr 27, 2023
c3e29aa
[story/VSPC-204]
pkharge Apr 27, 2023
0a1add5
[story/VSPC-204] storage engine added
pkharge May 4, 2023
9c1b8ed
[story/VSPC-204] bean storage engine
pkharge May 5, 2023
4c2fa90
[story/VSPC-204] code factor
pkharge May 5, 2023
eb029f3
[story/VSPC-204] code factor
pkharge May 5, 2023
7c9b5ba
[story/VSPC-204] code factor
pkharge May 5, 2023
aad9e14
[story/VSPC-204] merge conflict
pkharge May 9, 2023
ab92dad
[story/VSPC-204] review comments
pkharge May 18, 2023
80d3796
[story/VSPC-204] review comments
pkharge May 19, 2023
b19a2b6
[story/VSPC-204] Review comments
swetalina-prusty25 Jun 19, 2023
8ba400d
[story/VSPC-214] Resolved errors
swetalina-prusty25 Jun 20, 2023
52a24b3
[story/VSPC-204] create snapshot method
swetalina-prusty25 Jun 21, 2023
92b0062
[story/VSPC-204] Async Configuration
swetalina-prusty25 Jun 22, 2023
b0a44ad
[story/VSPC-204]Number format Exception
swetalina-prusty25 Jul 13, 2023
f777e53
[story/VSPC-204]Getting string value
swetalina-prusty25 Jul 14, 2023
d61e650
Code cleanup - removed spaces, fixed few errors
pooja-thalur Apr 22, 2024
7f3ce57
fixed the config issue and removed unused imports
pooja-thalur Apr 24, 2024
b35db5b
Addressed review comments
pooja-thalur Apr 26, 2024
7b232cc
removed debug statement
pooja-thalur Apr 26, 2024
35a495c
fixed the issue with creating a snapshot
pooja-thalur Apr 26, 2024
d9b3deb
fixed exceptions occured during testing
pooja-thalur May 2, 2024
44bbd99
Removing servlet context dependency as per review comments
pooja-thalur May 2, 2024
298e3d9
Changes to download resources folder
pooja-thalur May 3, 2024
6dc1fc0
Merge branch 'develop' into story/VSPC-204
pooja-thalur May 3, 2024
2357602
Code cleanup and addressing pr comments
pooja-thalur May 6, 2024
0134549
Codefactor issue
pooja-thalur May 6, 2024
4cf5d37
Code cleanup - removed unused imports
pooja-thalur May 6, 2024
70d45f3
removed sysout and console logs (VSPC-204)
pooja-thalur May 13, 2024
966c169
VSPC-204 removed spaces
pooja-thalur May 13, 2024
38794fa
logging the error
pooja-thalur May 13, 2024
d3b7e10
[VSPC-204] addressed pr comments
pooja-thalur May 30, 2024
1091f71
[VSPC-204] addressed pr comments
pooja-thalur May 31, 2024
d270fc0
[VSPC-204] addressed pr comments - renamed download to snapshots
pooja-thalur Jun 3, 2024
57bac32
[VSPC-204] addressed pr comments - added java doc
pooja-thalur Jun 4, 2024
be69f61
[VSPC-204] code cleanup
pooja-thalur Jun 5, 2024
b5ce14d
[VSPC-204] code cleanup
pooja-thalur Jun 6, 2024
502cbb9
[VSPC-204] delete folder after creating a zip
pooja-thalur Jun 7, 2024
e12f6f0
[VSPC-204] Fixed code factor issue
pooja-thalur Jun 10, 2024
e7857e9
[VSPC-204] Code cleanup
pooja-thalur Jun 10, 2024
7d6b9f0
[VSPC-204] addressed pr comments
pooja-thalur Jun 14, 2024
246caf4
[VSPC-204] addressed pr comments
pooja-thalur Jun 17, 2024
2635356
[VSPC-204] Addressed pr comments
pooja-thalur Jun 18, 2024
9da2084
[VSPC-204] code cleanup
pooja-thalur Jun 18, 2024
26e30c8
[VSPC-204] codefactor issue fixed
pooja-thalur Jun 18, 2024
fa22d8c
[VSPC-204] addressed pr comments
pooja-thalur Jun 20, 2024
a3afc68
[VSPC-204] addressed pr comments - to store branching point slide
pooja-thalur Jun 21, 2024
6b93127
[VSPC-204] addressed pr comments
pooja-thalur Jun 24, 2024
2d28775
[VSPC-204] addressed pr comments
pooja-thalur Jun 25, 2024
2a4149b
[VSPC-204] Addressed pr comments
pooja-thalur Jun 26, 2024
de3303d
[VSPC-204] Branching point rendering changes
pooja-thalur Jun 28, 2024
fd94f74
[VSPC-204] code cleanup
pooja-thalur Jul 2, 2024
74b3372
[VSPC-204] code cleanup
pooja-thalur Jul 3, 2024
9ebe4ce
[VSPC-204] addressed review comments
pooja-thalur Jul 23, 2024
e42f6fe
[VSPC-204]changed unit tests
pooja-thalur Jul 23, 2024
229ba5f
[VSPC-204] code cleanup and fixed testcases
pooja-thalur Jul 24, 2024
8ba9281
[VSPC-204] code refactored
pooja-thalur Jul 25, 2024
e42eac9
[VSPC-204] addressed pr comment
pooja-thalur Jul 26, 2024
e269bb1
[VSPC-204] addressing review comments
pooja-thalur Sep 3, 2024
504ff0b
[VSPC-204] addressed pr comments
pooja-thalur Sep 4, 2024
27c94a7
[VSPC-204] removed console logs
pooja-thalur Nov 6, 2024
334ff22
[VSPC-204] fixing issue on creating snapshot
pooja-thalur Nov 8, 2024
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
2 changes: 1 addition & 1 deletion vspace/pom.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand Down Expand Up @@ -26,7 +26,7 @@
<db.user>vspace</db.user>
<db.password>vspace</db.password>
<uploaded.files.path></uploaded.files.path>

<downloaded.files.path></downloaded.files.path>
<email.user></email.user>
<email.password></email.password>
<email.host></email.host>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package edu.asu.diging.vspace.config;

import java.util.concurrent.Executor;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.security.core.context.SecurityContextHolder;

@Configuration
@EnableAsync
public class AsyncConfiguration {

@Value("${async_core_pool_size}")
private int corePoolSize;

@Value("${async_max_pool_size}")
private int maxPoolSize;

@Value("${async_queue_capacity}")
private int queueCapacity;

@Bean(name="asyncExecutor")
public Executor getAsyncExecutor() {
// Set the strategy so that threads can inherit the authenticated user
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);
jdamerow marked this conversation as resolved.
Show resolved Hide resolved
ThreadPoolTaskExecutor asyncExecutor = new ThreadPoolTaskExecutor();

asyncExecutor.setCorePoolSize(corePoolSize);
asyncExecutor.setMaxPoolSize(maxPoolSize);
asyncExecutor.setQueueCapacity(queueCapacity);

asyncExecutor.setThreadNamePrefix("threadAsync");
asyncExecutor.setWaitForTasksToCompleteOnShutdown(true);
asyncExecutor.initialize();

return asyncExecutor;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package edu.asu.diging.vspace.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import edu.asu.diging.vspace.core.file.IStorageEngine;
import edu.asu.diging.vspace.core.file.impl.StorageEngine;

@Component
@Configuration
public class StorageEngineConfig {

@Value("${downloads_path}")
private String downloadsPath;

@Value("${uploads_path}")
private String uploadsPath;

@Bean(name = "storageEngineDownloads")
public IStorageEngine storageEngineDownloads(){
jdamerow marked this conversation as resolved.
Show resolved Hide resolved
return new StorageEngine(downloadsPath);
}

@Bean(name = "storageEngineUploads")
public IStorageEngine storageEngineUploads(){
return new StorageEngine(uploadsPath);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package edu.asu.diging.vspace.core.data;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;

import edu.asu.diging.vspace.core.model.impl.ExhibitionSnapshot;

public interface ExhibitionSnapshotRepository extends PagingAndSortingRepository<ExhibitionSnapshot, String> {

Page<ExhibitionSnapshot> findAllByOrderByCreationDateDesc(Pageable requestedPage);

ExhibitionSnapshot findByFolderName(String exhibitionFolderName);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package edu.asu.diging.vspace.core.data;

import java.util.Optional;

import org.javers.spring.annotation.JaversSpringDataAuditable;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import edu.asu.diging.vspace.core.model.impl.SnapshotTask;

@Repository
@JaversSpringDataAuditable
public interface SnapshotTaskRepository extends PagingAndSortingRepository<SnapshotTask, String>{

SnapshotTask findFirstByOrderByCreationDateDesc();

Optional<SnapshotTask> findById(String id);

Optional<SnapshotTask> findByExhibitionSnapshotId(String exhibitionSnapshotId);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package edu.asu.diging.vspace.core.exception;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

@ResponseStatus(value = HttpStatus.NOT_FOUND, reason = "Exhibition snapshot folder not found")
public class ExhibitionSnapshotNotFoundException extends Exception{
private static final long serialVersionUID = 1L;

public ExhibitionSnapshotNotFoundException() {
super();
}

public ExhibitionSnapshotNotFoundException(String message, Throwable cause, boolean enableSuppression,
boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}

public ExhibitionSnapshotNotFoundException(String message, Throwable cause) {
super(message, cause);
}

public ExhibitionSnapshotNotFoundException(Throwable cause) {
super(cause);
}

public ExhibitionSnapshotNotFoundException(String id) {
jdamerow marked this conversation as resolved.
Show resolved Hide resolved
super("Exhibition snapshot folder with id " + id + " not found");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package edu.asu.diging.vspace.core.exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

@ResponseStatus(value = HttpStatus.NOT_FOUND, reason = "Snapshot could not be created")
public class SnapshotCouldNotBeCreatedException extends Exception{
private static final long serialVersionUID = 1L;

public SnapshotCouldNotBeCreatedException(String id) {
super("Snapshot could not be created for snapshot task id " + id + " not found");
}

public SnapshotCouldNotBeCreatedException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
package edu.asu.diging.vspace.core.file;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;

import org.springframework.core.io.Resource;

import edu.asu.diging.vspace.core.exception.ExhibitionSnapshotNotFoundException;
import edu.asu.diging.vspace.core.exception.FileStorageException;
import edu.asu.diging.vspace.core.model.IVSImage;

public interface IStorageEngine {

String storeFile(byte[] fileContent, String filename, String directory) throws FileStorageException;

String createFolder(String relativePath);

byte[] generateZip(String exhibitionFolderName) throws IOException;

void copyToFolder(String relativePath, String folderToCopy) throws IOException;

Resource downloadFile(String fileName, String directory) throws IOException;

boolean renameFile(String fileName, String newFileName, String directory);
Expand All @@ -25,5 +32,12 @@ public interface IStorageEngine {
byte[] getMediaContent(String directory, String filename) throws IOException;

boolean renameImage(IVSImage image, String newFileName);

/**
* Deletes the specified folder
*
*@param folderPath path to the folder to be deleted
*/
void deleteFolder(String folderPath, String folderName) throws IOException;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package edu.asu.diging.vspace.core.file;

import edu.asu.diging.vspace.core.exception.FileStorageException;
import edu.asu.diging.vspace.core.model.IVSImage;

public interface IStorageManager {

/**
* Copies given image from uploads to exhibition snapshot folder
*
* @param image
* @param imagesFolderPath
* @throws FileStorageException
*/
void copyImage(IVSImage image, String imagesFolderPath) throws FileStorageException;

}
Loading