Skip to content

Commit

Permalink
Merge pull request #1510 from TexasDigitalLibrary/4.1.0_nov2020_staging
Browse files Browse the repository at this point in the history
4.1.0 nov2020 staging
  • Loading branch information
cstarcher authored Jan 7, 2021
2 parents f71a3bb + 3dba87c commit 1b5f805
Show file tree
Hide file tree
Showing 27 changed files with 239 additions and 224 deletions.
110 changes: 55 additions & 55 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ module.exports = function (grunt) {
all: [
'Gruntfile.js',
'<%= build.app %>/**/*.js',
'node_modules/weaver-ui-core/**/*',
'node_modules/weaver-ui-core/components/**/*',
'node_modules/weaver-ui-core/resources/**/*',
'node_modules/@wvr/core/**/*',
'node_modules/@wvr/core/components/**/*',
'node_modules/@wvr/core/resources/**/*',
'!node_modules/**/*',
'!<%= build.app %>/node_modules/**/*',
'!<%= build.app %>/components/**/*',
Expand Down Expand Up @@ -81,11 +81,11 @@ module.exports = function (grunt) {
},
core: {
src: [
'node_modules/weaver-ui-core/app/config/coreConfig.js',
'node_modules/@wvr/core/app/config/coreConfig.js',

'node_modules/weaver-ui-core/app/components/version/version.js',
'node_modules/weaver-ui-core/app/components/version/version-directive.js',
'node_modules/weaver-ui-core/app/components/version/interpolate-filter.js',
'node_modules/@wvr/core/app/components/version/version.js',
'node_modules/@wvr/core/app/components/version/version-directive.js',
'node_modules/@wvr/core/app/components/version/interpolate-filter.js',

'<%= build.app %>/config/appConfig.js',
'<%= build.app %>/config/apiMapping.js',
Expand All @@ -94,52 +94,52 @@ module.exports = function (grunt) {
'<%= build.app %>/components/version/version-directive.js',
'<%= build.app %>/components/version/interpolate-filter.js',

'node_modules/weaver-ui-core/app/core.js',
'node_modules/weaver-ui-core/app/setup.js',
'node_modules/weaver-ui-core/app/config/coreRuntime.js',
'node_modules/weaver-ui-core/app/config/coreAngularConfig.js',
'node_modules/weaver-ui-core/app/config/logging.js',

'node_modules/weaver-ui-core/app/constants/apiResponseActions.js',
'node_modules/weaver-ui-core/app/constants/httpMethodVerbs.js',

'node_modules/weaver-ui-core/app/directives/headerDirective.js',
'node_modules/weaver-ui-core/app/directives/footerDirective.js',
'node_modules/weaver-ui-core/app/directives/userDirective.js',
'node_modules/weaver-ui-core/app/directives/modalDirective.js',
'node_modules/weaver-ui-core/app/directives/alertDirective.js',
'node_modules/weaver-ui-core/app/directives/validationMessageDirective.js',
'node_modules/weaver-ui-core/app/directives/validatedSelectDirective.js',
'node_modules/weaver-ui-core/app/directives/validatedTextAreaDirective.js',

'node_modules/weaver-ui-core/app/services/accessControlService.js',
'node_modules/weaver-ui-core/app/services/wsService.js',
'node_modules/weaver-ui-core/app/services/wsApi.js',
'node_modules/weaver-ui-core/app/services/restApi.js',
'node_modules/weaver-ui-core/app/services/fileService.js',
'node_modules/weaver-ui-core/app/services/authService.js',
'node_modules/weaver-ui-core/app/services/storageService.js',
'node_modules/weaver-ui-core/app/services/utilityService.js',
'node_modules/weaver-ui-core/app/services/alertService.js',
'node_modules/weaver-ui-core/app/services/validationStore.js',
'node_modules/weaver-ui-core/app/services/userService.js',
'node_modules/weaver-ui-core/app/services/modalService.js',
'node_modules/weaver-ui-core/app/services/modelCache.js',
'node_modules/weaver-ui-core/app/services/modelUpdateService.js',

'node_modules/weaver-ui-core/app/repo/abstractRepo.js',

'node_modules/weaver-ui-core/app/model/abstractModel.js',
'node_modules/weaver-ui-core/app/model/assumedControl.js',
'node_modules/weaver-ui-core/app/model/user.js',

'node_modules/weaver-ui-core/app/controllers/abstractController.js',
'node_modules/weaver-ui-core/app/controllers/coreAdminController.js',
'node_modules/weaver-ui-core/app/controllers/authenticationController.js',
'node_modules/weaver-ui-core/app/controllers/loginController.js',
'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/@wvr/core/app/core.js',
'node_modules/@wvr/core/app/setup.js',
'node_modules/@wvr/core/app/config/coreRuntime.js',
'node_modules/@wvr/core/app/config/coreAngularConfig.js',
'node_modules/@wvr/core/app/config/logging.js',

'node_modules/@wvr/core/app/constants/apiResponseActions.js',
'node_modules/@wvr/core/app/constants/httpMethodVerbs.js',

'node_modules/@wvr/core/app/directives/headerDirective.js',
'node_modules/@wvr/core/app/directives/footerDirective.js',
'node_modules/@wvr/core/app/directives/userDirective.js',
'node_modules/@wvr/core/app/directives/modalDirective.js',
'node_modules/@wvr/core/app/directives/alertDirective.js',
'node_modules/@wvr/core/app/directives/validationMessageDirective.js',
'node_modules/@wvr/core/app/directives/validatedSelectDirective.js',
'node_modules/@wvr/core/app/directives/validatedTextAreaDirective.js',

'node_modules/@wvr/core/app/services/accessControlService.js',
'node_modules/@wvr/core/app/services/wsService.js',
'node_modules/@wvr/core/app/services/wsApi.js',
'node_modules/@wvr/core/app/services/restApi.js',
'node_modules/@wvr/core/app/services/fileService.js',
'node_modules/@wvr/core/app/services/authService.js',
'node_modules/@wvr/core/app/services/storageService.js',
'node_modules/@wvr/core/app/services/utilityService.js',
'node_modules/@wvr/core/app/services/alertService.js',
'node_modules/@wvr/core/app/services/validationStore.js',
'node_modules/@wvr/core/app/services/userService.js',
'node_modules/@wvr/core/app/services/modalService.js',
'node_modules/@wvr/core/app/services/modelCache.js',
'node_modules/@wvr/core/app/services/modelUpdateService.js',

'node_modules/@wvr/core/app/repo/abstractRepo.js',

'node_modules/@wvr/core/app/model/abstractModel.js',
'node_modules/@wvr/core/app/model/assumedControl.js',
'node_modules/@wvr/core/app/model/user.js',

'node_modules/@wvr/core/app/controllers/abstractController.js',
'node_modules/@wvr/core/app/controllers/coreAdminController.js',
'node_modules/@wvr/core/app/controllers/authenticationController.js',
'node_modules/@wvr/core/app/controllers/loginController.js',
'node_modules/@wvr/core/app/controllers/registrationController.js',
'node_modules/@wvr/core/app/controllers/userController.js',
'node_modules/@wvr/core/app/controllers/errorPageController.js',
],
dest: '<%= build.app %>/resources/scripts/core_concat.js'
},
Expand Down Expand Up @@ -216,8 +216,8 @@ module.exports = function (grunt) {
weaver: {
files: [{
src: [
'node_modules/weaver-ui-core/**/*.html',
'!node_modules/weaver-ui-core/docs/'
'node_modules/@wvr/core/**/*.html',
'!node_modules/@wvr/core/docs/'
],
dest: '<%= build.app %>',
expand: true
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"start-dev": "wvr server -b /vireo --uid vireo-webserver"
},
"dependencies": {
"@wvr/core": "2.2.0",
"angular-ui-tinymce": "0.0.19",
"weaver-ui-core": "git+https://github.com/TAMULib/Weaver-UI-Core.git#v2.0.0",
"file-saver": "2.0.0",
"ng-csv": "0.3.6",
"ng-sortable": "1.3.8",
Expand All @@ -44,7 +44,6 @@
"grunt-contrib-uglify": "4.0.0",
"grunt-contrib-watch": "1.1.0",
"grunt-karma-coveralls": "2.5.4",
"grunt-sass": "3.0.1",
"grunt-usemin": "3.1.1",
"jasmine-core": "3.3.0",
"jasmine-promise-matchers": "2.6.0",
Expand Down
20 changes: 10 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>edu.tamu.weaver</groupId>
<artifactId>webservice-parent</artifactId>
<version>2.x-WRO-INIT-SNAPSHOT</version>
<version>2.1.1-SNAPSHOT</version>
<relativePath></relativePath>
</parent>

Expand Down Expand Up @@ -60,37 +60,37 @@
<dependency>
<groupId>edu.tamu.weaver</groupId>
<artifactId>auth</artifactId>
<version>2.x-WRO-INIT-SNAPSHOT</version>
<version>2.1.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>edu.tamu.weaver</groupId>
<artifactId>token-provider</artifactId>
<version>2.x-WRO-INIT-SNAPSHOT</version>
<version>2.1.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>edu.tamu.weaver</groupId>
<artifactId>validation</artifactId>
<version>2.x-WRO-INIT-SNAPSHOT</version>
<version>2.1.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>edu.tamu.weaver</groupId>
<artifactId>wro</artifactId>
<version>2.x-WRO-INIT-SNAPSHOT</version>
<version>2.1.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>edu.tamu.weaver</groupId>
<artifactId>reporting</artifactId>
<version>2.x-WRO-INIT-SNAPSHOT</version>
<version>2.1.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>edu.tamu.weaver</groupId>
<artifactId>email</artifactId>
<version>2.x-WRO-INIT-SNAPSHOT</version>
<version>2.1.1-SNAPSHOT</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -286,7 +286,7 @@
</webResource>
<webResource>
<filtering>false</filtering>
<directory>node_modules/weaver-ui-core/app/resources/styles</directory>
<directory>node_modules/@wvr/core/app/resources/styles</directory>
<targetPath>WEB-INF/classes</targetPath>
<excludes>
<exclude>**/*.css</exclude>
Expand Down Expand Up @@ -359,7 +359,7 @@
</webResource>
<webResource>
<filtering>false</filtering>
<directory>node_modules/weaver-ui-core/app/resources/styles</directory>
<directory>node_modules/@wvr/core/app/resources/styles</directory>
<targetPath>WEB-INF/classes</targetPath>
<excludes>
<exclude>**/*.css</exclude>
Expand Down Expand Up @@ -473,7 +473,7 @@
</excludes>
</resource>
<resource>
<directory>node_modules/weaver-ui-core/app/resources/styles</directory>
<directory>node_modules/@wvr/core/app/resources/styles</directory>
<filtering>false</filtering>
<excludes>
<exclude>**/*.css</exclude>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,6 @@ public class ConfigurationName {
public final static String APPLICATION_FILESIZE_MAXSIZETOTAL = "fileSize.maxFileSizeTotal";

// Vireo 4 new Configuration Names
public final static String APPLICATION_MAIL_FROM = "mail.from";
public final static String APPLICATION_MAIL_REPLYTO = "mail.replyto";
public final static String APPLICATION_MAIL_FROM = "email.from";
public final static String APPLICATION_MAIL_REPLYTO = "email.replyto";
}
42 changes: 5 additions & 37 deletions src/main/java/org/tdl/vireo/controller/SubmissionController.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
Expand Down Expand Up @@ -574,7 +575,7 @@ private void processBatchExport(HttpServletResponse response, User user, String
int sfxIndx;
String licFileName = ldfv.getFileName();
if((sfxIndx = licFileName.indexOf("."))>0){
licFileName = licFileName.substring(0,sfxIndx).toUpperCase()+licFileName.substring(sfxIndx);
licFileName = licFileName.substring(0,sfxIndx).toUpperCase()+licFileName.substring(sfxIndx);
}
b.putNextEntry(new ZipEntry(personName+"_permission/"+licFileName));
b.write(fileBytes);
Expand Down Expand Up @@ -620,44 +621,11 @@ private void processBatchExport(HttpServletResponse response, User user, String
try {
ZipOutputStream zos = new ZipOutputStream(sos_mets);

// TODO: need a more dynamic way to achieve this
if (packagerName.equals("ProQuest")) {
// TODO: add filter for UMI Publication true
}

for (Submission submission : submissionRepo.batchDynamicSubmissionQuery(filter, columns)) {

String submissionName = "submission_" + submission.getId() + "/";
StringBuilder contentsText = new StringBuilder();
ExportPackage exportPackage = packagerUtility.packageExport(packager, submission);
if (exportPackage.isMap()) {
for (Map.Entry<String, File> fileEntry : ((Map<String, File>) exportPackage.getPayload()).entrySet()) {
if (packagerName.equals("MarcXML21")) {
zos.putNextEntry(new ZipEntry("MarcXML21/" + fileEntry.getKey()));
} else {
zos.putNextEntry(new ZipEntry(fileEntry.getKey()));
}
contentsText.append("MD " + fileEntry.getKey() + "\n");
zos.write(Files.readAllBytes(fileEntry.getValue().toPath()));
zos.closeEntry();
}
}
// LICENSES
for (FieldValue ldfv : submission.getLicenseDocumentFieldValues()) {
Path path = assetService.getAssetsAbsolutePath(ldfv.getValue());
byte[] fileBytes = Files.readAllBytes(path);
zos.putNextEntry(new ZipEntry(submissionName + ldfv.getFileName()));
contentsText.append(ldfv.getFileName() + " bundle:LICENSE\n");
zos.write(fileBytes);
zos.closeEntry();
}

// PRIMARY_DOC
FieldValue primaryDoc = submission.getPrimaryDocumentFieldValue();
Path path = assetService.getAssetsAbsolutePath(primaryDoc.getValue());
byte[] fileBytes = Files.readAllBytes(path);
zos.putNextEntry(new ZipEntry(submissionName + primaryDoc.getFileName()));
contentsText.append(primaryDoc.getFileName() + " bundle:CONTENT primary:true\n");
File exportFile = (File) exportPackage.getPayload();
byte[] fileBytes = FileUtils.readFileToByteArray(exportFile);
zos.putNextEntry(new ZipEntry(exportFile.getName()));
zos.write(fileBytes);
zos.closeEntry();
}
Expand Down
17 changes: 8 additions & 9 deletions src/main/java/org/tdl/vireo/model/FieldProfile.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,27 @@
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import org.tdl.vireo.model.inheritance.HeritableComponent;
import org.tdl.vireo.model.validation.FieldProfileValidator;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIdentityReference;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;

import org.tdl.vireo.model.inheritance.HeritableComponent;
import org.tdl.vireo.model.validation.FieldProfileValidator;

import edu.tamu.weaver.data.resolver.BaseEntityIdResolver;

@Entity
@DiscriminatorValue("Org")
@Table(uniqueConstraints = @UniqueConstraint(columnNames = { "originating_workflow_step", "originating_field_profile", "field_predicate" }))
public class FieldProfile extends AbstractFieldProfile<FieldProfile> implements HeritableComponent<FieldProfile> {

@ManyToOne(cascade = { REFRESH, MERGE }, fetch = EAGER)
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, scope = FieldProfile.class, property = "id")
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, scope = FieldProfile.class, resolver = BaseEntityIdResolver.class, property = "id")
@JsonIdentityReference(alwaysAsId = true)
private FieldProfile originating;

@ManyToOne(cascade = { REFRESH, MERGE }, fetch = EAGER)
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, scope = WorkflowStep.class, property = "id")
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, scope = WorkflowStep.class, resolver = BaseEntityIdResolver.class, property = "id")
@JsonIdentityReference(alwaysAsId = true)
private WorkflowStep originatingWorkflowStep;

Expand Down Expand Up @@ -177,4 +176,4 @@ public FieldProfile clone() {
return clone;
}

}
}
6 changes: 4 additions & 2 deletions src/main/java/org/tdl/vireo/model/Note.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import org.tdl.vireo.model.inheritance.HeritableComponent;
import org.tdl.vireo.model.validation.NoteValidator;

import edu.tamu.weaver.data.resolver.BaseEntityIdResolver;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIdentityReference;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
Expand All @@ -24,12 +26,12 @@
public class Note extends AbstractNote<Note> implements HeritableComponent<Note> {

@ManyToOne(cascade = { REFRESH, MERGE }, fetch = EAGER, optional = true)
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, scope = Note.class, property = "id")
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, scope = Note.class, resolver = BaseEntityIdResolver.class, property = "id")
@JsonIdentityReference(alwaysAsId = true)
private Note originating;

@ManyToOne(cascade = { REFRESH, MERGE }, fetch = EAGER)
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, scope = WorkflowStep.class, property = "id")
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, scope = WorkflowStep.class, resolver = BaseEntityIdResolver.class, property = "id")
@JsonIdentityReference(alwaysAsId = true)
private WorkflowStep originatingWorkflowStep;

Expand Down
Loading

0 comments on commit 1b5f805

Please sign in to comment.