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

domain - set some columns to arbitrary length (TEXT type) #304

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
- [ ] PR only involves cherry-picked commits from upstream.
- [ ] PR contains custom code which will soon be available in an upstream release and can be overriden => mention core-geonetwork version if possible.
- [ ] PR contains custom geOrchestra code, which need to be verified during future migrations.
- [ ] I have properly filled the [migration-helper-changelog.md](../georchestra-migration/migration-helper-changelog.md) file.
- [ ] I have properly filled the [migration-dev-guide.md](/georchestra/geonetwork/blob/georchestra-gn4.4.x/georchestra-migration/migration-dev-guide.md) file.

1 change: 0 additions & 1 deletion .github/workflows/georchestra-gn4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,3 @@ jobs:
with:
name: geonetwork.war
path: web/target/geonetwork.war

27 changes: 4 additions & 23 deletions domain/src/main/java/org/fao/geonet/domain/Group.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,8 @@

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Cacheable;
import javax.persistence.CascadeType;
import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.MapKeyColumn;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.*;

import org.fao.geonet.domain.converter.BooleanToYNConverter;

import org.fao.geonet.entitylistener.GroupEntityListenerManager;
Expand Down Expand Up @@ -141,7 +121,7 @@ public Group setName(String name) {
*
* @return the description.
*/
@Column(length = 255)
@Column(columnDefinition = "TEXT")
public String getDescription() {
return _description;
}
Expand Down Expand Up @@ -245,6 +225,7 @@ public boolean isReserved() {
* @return the filename of the logo or null if there is no logo associated with this group.
*/
@Nullable
@Column(columnDefinition = "TEXT")
public String getLogo() {
return logo;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@

import java.util.Objects;

import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.*;

import org.fao.geonet.domain.Group;

Expand Down Expand Up @@ -55,6 +50,7 @@ public enum GroupSyncMode {
private String externalId;
private GroupSyncMode origin;
private String name;

private String description;
private String linkage;
private String lastUpdated;
Expand Down Expand Up @@ -108,6 +104,12 @@ public ExternalGroupLink setName(String name) {
return this;
}

/**
* Note: this is not portable, as the TEXT definition does not
* exist on all DBMS. But considering geOrchestra, we are supposed
* to rely on a PostGreSQL server.
*/
@Column(columnDefinition = "TEXT")
public String getDescription() {
return description;
}
Expand Down
18 changes: 8 additions & 10 deletions georchestra-migration/migration-dev-guide.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Geonetwork migration in Georchestra

This document aims to help simplify future migration for geonetwork in Georchestra.
This document aims to help simplify future migration for geonetwork in Georchestra.

## Upgrade Process

Expand All @@ -17,14 +17,12 @@ A more detailed guide is available in [upgrade_geonetwork.md](upgrade_geonetwork

## Georchestra custom implementations

### Georchestra 4.2.7 and Gn 4.2.7

All versions in `pom.xml` files must be updated. E.g. for this version `4.4.5-georchestra`.
All italic folder just have the `pom.xml` change.

- .github
- workflows `linux.yml` `mvn-dep-tree.yml` `sonarcloud.yml` `dependabot.yml` are deleted. Only `georchestra-gn4.yml` is used
- *cachingxslt*
- *cachingxslt*
- common
- `ZipUtilTest.java` : In `assertExampleZip` method, assertions which are supposed check folders must check with trailing slash too.
- core
Expand All @@ -36,17 +34,18 @@ All italic folder just have the `pom.xml` change.
- `CswFilter2Es.java` : Keep `{@}` instead of `%s` until it is fixed upstream (not supporting some CSW request)
- `CswFilter2EsTest.java` : Keep `{@}` instead of `%s`
- `SearchController.java` : Keep `{@}` instead of `%s` with StringUtils.replace
- **docker**
- **docker**
- Mandatory, get everything from geOrchestra
- *docs*
- *doi*
- domain
- ExternalGroupLink.java : get file from geOrchestra
- ExternalUserLink.java : get file from geOrchestra
- `ExternalGroupLink.java` : get file from geOrchestra
- `ExternalUserLink.java` : get file from geOrchestra
- `Group.java` : set column definition to `TEXT` (which is PostGreSQL specific) on `description` and `logo`
- *es*
- *estest*
- *events*
- **georchestra-integration**
- **georchestra-integration**
- Mandatory, get everything from geOrchestra
- *harvesters*
- *healthmonitor*
Expand Down Expand Up @@ -99,7 +98,7 @@ All italic folder just have the `pom.xml` change.
- `src/main/resources/catalog/views/georchestra/`: Get files from georchestra
- *workers*
- *wro4j*
- .gitignore
- .gitignore
- add idea and settings to it
- pom.xml
- Add georchestra-integration module, set db-type
Expand All @@ -111,4 +110,3 @@ All italic folder just have the `pom.xml` change.
A branch has been created from core-geonetwork 4.2.7 tag and merged into `georchestra-gn4.2.x`.
All conflicts files have been resolved with taking gn changes and not grochestra's one.
Then changes have been reimplemented.

Loading