Skip to content

Commit

Permalink
Merge branch 'main' into fix-tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
milospp authored Nov 19, 2024
2 parents ca2839a + 04a0e75 commit f2bb517
Show file tree
Hide file tree
Showing 80 changed files with 887 additions and 1,369 deletions.
26 changes: 22 additions & 4 deletions .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
LOCAL_VIVO_HOME=./vivo-home
RESET_HOME=false
RESET_CORE=false
VERBOSE=no
# Variable substitution for docker-compose.yml

# solr service variable substitution
SOLR_RESET_CORE=false
SOLR_VERBOSE=no

SOLR_HOST_PORT=8983
SOLR_CONTAINER_PORT=8983

SOLR_CORES=./vivo-cores

# tomcat service variable substitution
VIVO_RESET_HOME=false
VIVO_VERBOSE=no

VIVO_TDB_FILE_MODE=direct

VIVO_HOST_VIVO_HOME=./vivo-home
VIVO_CONTAINER_VIVO_HOME=/usr/local/vivo/home

VIVO_HOST_PORT=8080
VIVO_CONTAINER_PORT=8080
36 changes: 32 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,39 @@ A description of what steps someone could take to:
Any additional information that you think would be helpful when reviewing this PR.

Example:
* Does this change require documentation to be updated?
* Does this change add any new dependencies?
* Does this change require any other modifications to be made to the repository?
* Does this change require documentation to be updated?
* Does this change add any new dependencies?
* Does this change require any other modifications to be made to the repository?
* Could this change impact execution of existing code?
* Large pull requests should be avoided. If this PR is large (more than 1,000 lines of codes), please provide short explanation why your contribution can't be decoupled in smaller PRs.
* Large pull requests should be avoided. If this PR is large (more than 1,000 lines of codes), please provide short explanation why your contribution can't be decoupled in smaller PRs.

# Interested parties
Tag (@ mention) interested parties or, if unsure, @VIVO-project/vivo-committers

# Reviewers' expertise
**Please add any new expertise in the list which might be needed for reviewing your PR or remove any of the listed if it is not needed.**

Candidates for reviewing this PR should have some of the following expertises:
1. Java
1. HTML, CSS, JavaScript
1. FreeMarker
1. SPARQL
1. Ontologies
1. Docker
1. Natural language knowledge
1. English
2. German
3. Spanish
4. French
5. Portuguese
6. Russian
7. Serbian

# Reviewers' report template
**Please update the following template which should be used by reviewers.**
## General comment
A reviewer should provide here comments and suggestions for requested changes if any.
## Testing
A reviewer should briefly describe here how it was tested
## Code reviewing
A reviewer should briefly describe here which part was code reviewed
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ utilities/rdbmigration/.work
**/.project
**/bin/

vivo-cores/
vivo-home/

.fake
Expand Down
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
FROM tomcat:9-jdk11-openjdk

ARG SOLR_URL=http://localhost:8983/solr/vivocore
ARG VIVO_DIR=/usr/local/vivo/home
ARG TDB_FILE_MODE=direct
ARG VIVO_HOME=/usr/local/vivo/home
ARG SOLR_URL=http://localhost:8983/solr/vivocore

ENV SOLR_URL=${SOLR_URL}
ENV JAVA_OPTS="${JAVA_OPTS} -Dtdb:fileMode=$TDB_FILE_MODE"
ENV VIVO_HOME=${VIVO_HOME}
ENV SOLR_URL=${SOLR_URL}

RUN mkdir /usr/local/vivo
RUN mkdir /usr/local/vivo/home
RUN mkdir -p ${VIVO_HOME}

# Copy VIVO home onto image for backup, initialization, and reset
COPY ./installer/home/target/vivo /vivo-home
COPY ./installer/webapp/target/vivo.war /usr/local/tomcat/webapps/ROOT.war

Expand Down
67 changes: 36 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ desired information across disciplines.
## Resources

### VIVO Project web site
http://vivoweb.org/
[https://vivo.lyrasis.org/](https://vivo.lyrasis.org/)

### VIVO Project Wiki
https://wiki.lyrasis.org/display/VIVO/
Expand All @@ -29,18 +29,43 @@ VIVO docker container is available at [vivoweb/vivo](https://hub.docker.com/repo

### Docker Compose

Docker Compose environment variables:
Docker Compose variable substitution:

.env defaults
```
LOCAL_VIVO_HOME=./vivo-home
RESET_HOME=false
RESET_CORE=false
SOLR_RESET_CORE=false
SOLR_VERBOSE=no
SOLR_HOST_PORT=8983
SOLR_CONTAINER_PORT=8983
SOLR_CORES=./vivo-cores
VIVO_RESET_HOME=false
VIVO_VERBOSE=no
VIVO_TDB_FILE_MODE=direct
VIVO_HOST_VIVO_HOME=./vivo-home
VIVO_CONTAINER_VIVO_HOME=/usr/local/vivo/home
VIVO_HOST_PORT=8080
VIVO_CONTAINER_PORT=8080
```

- `LOCAL_VIVO_HOME`: VIVO home directory on your host machine which will mount to volume in docker container. Set this environment variable to persist your VIVO data on your host machine.
- `RESET_HOME`: Convenience to reset VIVO home when starting container. **Caution**, will delete local configuration, content, and configuration model.
- `RESET_CORE`: Convenience to reset VIVO Solr core when starting container. **Caution**, will require complete reindex.
- `SOLR_RESET_CORE`: Convenience to reset VIVO Solr core when starting container. **Caution**, will require complete reindex.
- `SOLR_VERBOSE`: Increase log verbosity.
- `SOLR_HOST_PORT`: Host port binding for solr service port mapping.
- `SOLR_CONTAINER_PORT`: Container port binding for solr service port mapping.
- `SOLR_CORES`: Solr cores data directories on your host machine which will mount to volume in docker container. Set this environment variable to persist your Solr data on your host machine.

- `VIVO_RESET_HOME`: Convenience to reset VIVO home when starting container. **Caution**, will delete local configuration, content, and configuration model.
- `VIVO_VERBOSE`: Increase log verbosity.
- `VIVO_TDB_FILE_MODE`: TDB file mode. See https://jena.apache.org/documentation/tdb/configuration.html#file-access-mode.
- `VIVO_HOST_VIVO_HOME`: VIVO home directory on your host machine which will mount to volume in docker container. Set this environment variable to persist your VIVO data on your host machine.
- `VIVO_CONTAINER_VIVO_HOME`: VIVO home directory within the container.
- `VIVO_HOST_PORT`: Host port binding for VIVO Tomcat service port mapping.
- `VIVO_CONTAINER_PORT`: Container port binding for VIVO Tomcat service port mapping.

Before building VIVO, you will also need to clone (and switch to the same branch, if other than main) of [Vitro](https://github.com/vivo-project/Vitro). The Vitro project must be cloned to a sibling directory next to VIVO so that it can be found during the build.

Expand All @@ -61,31 +86,11 @@ docker build -t vivoweb/vivo:development .
docker run -p 8080:8080 vivoweb/vivo:development
```

## Contact us
There are several ways to contact the VIVO community.
Whatever your interest, we would be pleased to hear from you.

### Contact form
https://vivo.lyrasis.org/contact/

### Mailing lists

#### [vivo-all](https://groups.google.com/forum/#!forum/vivo-all)
This updates list provides news to the VIVO community of interest to all.

#### [vivo-community](https://groups.google.com/forum/#!forum/vivo-community)
Join the VIVO community! Here you'll find non-technical discussion regarding participation, the VIVO
conference, policy, project management, outreach, and engagement.

#### [vivo-tech](https://groups.google.com/forum/#!forum/vivo-tech)
The best place to get your hands dirty in the VIVO Project.
Developers and implementers frequent this list to get the latest on feature design,
development, implementation, and testing.
## Community
There are several ways to contact and join the VIVO community. All of them are listed at https://vivo.lyrasis.org/contact/

## Contributing Code
If you would like to contribute code to the VIVO project, please open a ticket
in our [JIRA](https://jira.lyrasis.org/projects/VIVO), and prepare a
pull request that references your ticket. Contributors welcome!
If you would like to contribute code to the VIVO project, please read instructions at [this page](https://github.com/vivo-project/VIVO/wiki/Development-Processes#process-for-suggesting-contribution). Contributors welcome!

## Citing VIVO
If you are using VIVO in your publications or projects, please cite the software paper in the Journal of Open Source Software:
Expand Down
4 changes: 2 additions & 2 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

<groupId>org.vivoweb</groupId>
<artifactId>vivo-api</artifactId>
<version>1.14.1-SNAPSHOT</version>
<version>1.15.1-SNAPSHOT</version>
<packaging>jar</packaging>

<parent>
<groupId>org.vivoweb</groupId>
<artifactId>vivo-project</artifactId>
<version>1.14.1-SNAPSHOT</version>
<version>1.15.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import javax.servlet.http.HttpSession;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

Expand Down Expand Up @@ -60,6 +61,7 @@ protected EditConfigurationVTwo setupConfig(VitroRequest vreq, HttpSession sessi

config.setVarNameForSubject("subject");
config.setVarNameForObject("vcard");
config.addFormSpecificData("fauxContextUri", vreq.getParameter("fauxContextUri"));

config.addNewResource("vcard", DEFAULT_NS_FOR_NEW_RESOURCE);
config.addNewResource("link", DEFAULT_NS_FOR_NEW_RESOURCE);
Expand Down Expand Up @@ -238,6 +240,7 @@ private String getUrlPatternToReturnTo(VitroRequest vreq) {
String rangeUri = (String) vreq.getParameter("rangeUri");
String generatorName = "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.ManageWebpagesForIndividualGenerator";
String editUrl = EditConfigurationUtils.getEditUrlWithoutContext(vreq);
String fauxContextUri = vreq.getParameter("fauxContextUri");
String returnPath = editUrl + "?subjectUri=" + UrlBuilder.urlEncode(subjectUri) +
"&predicateUri=" + UrlBuilder.urlEncode(predicateUri) +
"&editForm=" + UrlBuilder.urlEncode(generatorName);
Expand All @@ -247,6 +250,9 @@ private String getUrlPatternToReturnTo(VitroRequest vreq) {
if(rangeUri != null && !rangeUri.isEmpty()) {
returnPath += "&rangeUri=" + UrlBuilder.urlEncode(rangeUri);
}
if (StringUtils.isNotBlank(fauxContextUri)) {
returnPath += "&fauxContextUri=" + UrlBuilder.urlEncode(fauxContextUri);
}
return returnPath;

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
* This mainly sets up pageData for the template to use.
*/
public class ManageWebpagesForIndividualGenerator extends BaseEditConfigurationGenerator implements EditConfigurationGenerator {
private static final String OBO_HAS_CONTACT_INFO_URI = "http://purl.obolibrary.org/obo/ARG_2000028";

public static Log log = LogFactory.getLog(ManageWebpagesForIndividualGenerator.class);

@Override
Expand All @@ -59,10 +61,12 @@ public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession
config.addFormSpecificData("rankPredicate", "http://vivoweb.org/ontology/core#rank" );
config.addFormSpecificData("reorderUrl", "/edit/reorder" );
config.addFormSpecificData("deleteWebpageUrl", "/edit/primitiveDelete");
String fauxContextUri = vreq.getParameter("fauxContextUri");

ParamMap paramMap = new ParamMap();
paramMap.put("subjectUri", config.getSubjectUri());
paramMap.put("editForm", this.getEditForm());
paramMap.put("fauxContextUri", fauxContextUri);
paramMap.put("view", "form");
String path = UrlBuilder.getUrl( UrlBuilder.Route.EDIT_REQUEST_DISPATCH ,paramMap);

Expand All @@ -76,6 +80,8 @@ public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession
paramMap.put("predicateUri", config.getPredicateUri());
paramMap.put("editForm" , this.getEditForm() );
paramMap.put("cancelTo", "manage");
paramMap.put("fauxContextUri", fauxContextUri);

if(domainUri != null && !domainUri.isEmpty()) {
paramMap.put("domainUri", domainUri);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
import static edu.cornell.mannlib.vitro.webapp.auth.objects.AccessObject.SOME_LITERAL;
import static edu.cornell.mannlib.vitro.webapp.auth.objects.AccessObject.SOME_PREDICATE;
import static edu.cornell.mannlib.vitro.webapp.auth.objects.AccessObject.SOME_URI;
import static edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary.Precision.DAY;
import static edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary.Precision.MONTH;
import static edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary.Precision.YEAR;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
Expand Down Expand Up @@ -1218,19 +1221,19 @@ protected boolean addDateToResource(VitroRequest vreq, Resource work, ResourceMo
if (date.month != null) {
if (date.day != null) {
formattedDate = String.format("%04d-%02d-%02dT00:00:00", date.year, date.month, date.day);
precision = "http://vivoweb.org/ontology/core#dayPrecision";
precision = DAY.uri();
} else {
formattedDate = String.format("%04d-%02d-01T00:00:00", date.year, date.month);
precision = "http://vivoweb.org/ontology/core#monthPrecision";
precision = MONTH.uri();
}
} else {
formattedDate = String.format("%04d-01-01T00:00:00", date.year);
precision = "http://vivoweb.org/ontology/core#yearPrecision";
precision = YEAR.uri();
}

Resource dateResource = model.createResource(getUnusedUri(vreq)).addProperty(RDF.type, model.getResource("http://vivoweb.org/ontology/core#DateTimeValue"));
dateResource.addProperty(model.createProperty(VIVO_DATETIME), formattedDate);
dateResource.addProperty(model.createProperty(VIVO_DATETIMEPRECISION), precision);
dateResource.addProperty(model.createProperty(VIVO_DATETIMEPRECISION), model.createResource(precision));

work.addProperty(model.createProperty(VIVO_DATETIMEVALUE), dateResource);
return true;
Expand Down
42 changes: 27 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,47 @@ version: '3.2'

services:

solr:
vivo-solr:
container_name: vivo-solr
image: vivoweb/vivo-solr:latest
environment:
- RESET_CORE=${RESET_CORE}
- VERBOSE=${VERBOSE}
- RESET_CORE=${SOLR_RESET_CORE}
- VERBOSE=${SOLR_VERBOSE}
ports:
- 8983:8983
- ${SOLR_HOST_PORT}:${SOLR_CONTAINER_PORT}
volumes:
- ${SOLR_CORES}:/opt/solr/server/solr/mycores
networks:
- vivo
- vivoweb
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:8983/solr/vivocore/admin/ping || exit 1"]
interval: 15s
timeout: 5s
retries: 3

tomcat:
vivo:
container_name: vivo
image: vivoweb/vivo:latest
hostname: vivo
build:
context: ./
dockerfile: Dockerfile
args:
- VIVO_DIR=/usr/local/vivo/home
- TDB_FILE_MODE=direct
- SOLR_URL=http://solr:8983/solr/vivocore
- TDB_FILE_MODE=${VIVO_TDB_FILE_MODE}
- VIVO_HOME=${VIVO_CONTAINER_VIVO_HOME}
- SOLR_URL=http://vivo-solr:${SOLR_CONTAINER_PORT}/solr/vivocore
environment:
- RESET_HOME=${RESET_HOME}
- VERBOSE=${VERBOSE}
- RESET_HOME=${VIVO_RESET_HOME}
- VERBOSE=${VIVO_VERBOSE}
ports:
- 8080:8080
- ${VIVO_HOST_PORT}:${VIVO_CONTAINER_PORT}
volumes:
- ${LOCAL_VIVO_HOME}:/usr/local/vivo/home
- ${VIVO_HOST_VIVO_HOME}:${VIVO_CONTAINER_VIVO_HOME}
networks:
- vivo
- vivoweb
depends_on:
vivo-solr:
condition: service_healthy

networks:
vivo:
vivoweb:
4 changes: 2 additions & 2 deletions home/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

<groupId>org.vivoweb</groupId>
<artifactId>vivo-home</artifactId>
<version>1.14.1-SNAPSHOT</version>
<version>1.15.1-SNAPSHOT</version>
<packaging>pom</packaging>

<parent>
<groupId>org.vivoweb</groupId>
<artifactId>vivo-project</artifactId>
<version>1.14.1-SNAPSHOT</version>
<version>1.15.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down
Loading

0 comments on commit f2bb517

Please sign in to comment.