-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
290 additions
and
49 deletions.
There are no files selected for viewing
79 changes: 79 additions & 0 deletions
79
set-definitions/src/main/java/eu/europeana/set/definitions/model/BaseWebResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package eu.europeana.set.definitions.model; | ||
|
||
import java.util.Objects; | ||
|
||
public class BaseWebResource { | ||
|
||
public static final String TYPE = "WebResource"; | ||
private String source; | ||
private String id; | ||
private String thumbnail; | ||
|
||
public BaseWebResource() { | ||
super(); | ||
} | ||
|
||
public BaseWebResource(BaseWebResource copy) { | ||
this.source = copy.getSource(); | ||
this.id = copy.getId(); | ||
this.thumbnail = copy.getThumbnail(); | ||
} | ||
|
||
public BaseWebResource(String id, String source, String thumbnail) { | ||
this.id = id; | ||
this.source = source; | ||
this.thumbnail = thumbnail; | ||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public String getSource() { | ||
return source; | ||
} | ||
|
||
public String getThumbnail() { | ||
return thumbnail; | ||
} | ||
|
||
public String getType() { | ||
return TYPE; | ||
} | ||
|
||
public void setThumbnail(String thumbnailParam) { | ||
thumbnail = thumbnailParam; | ||
} | ||
|
||
public void setSource(String sourceParam) { | ||
source = sourceParam; | ||
} | ||
|
||
public void setId(String idParam) { | ||
id = idParam; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
|
||
BaseWebResource that = (BaseWebResource) o; | ||
|
||
return Objects.equals(source, that.getSource()) | ||
&& id.equals(that.getId()) | ||
&& Objects.equals(thumbnail, that.getThumbnail()); | ||
} | ||
|
||
public int hashCode() { | ||
int result = (id == null) ? 0 : id.hashCode(); | ||
result += (thumbnail == null) ? 0 : thumbnail.hashCode(); | ||
result += (source == null) ? 0 : source.hashCode(); | ||
return result; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...ration-testing/src/integration-test/resources/content/userset_gallery_with_depiction.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"type": "Collection", | ||
"collectionType": "Gallery", | ||
"title": { | ||
"en": "Sportswear" | ||
}, | ||
"description": { | ||
"en": "From tennis ensemble to golf uniforms, browse Europeana Fashion wide collection of historical sportswear and activewear designs!" | ||
}, | ||
"isShownBy":{ | ||
"id": "https://i.vimeocdn.com/video/572458027_1280x960.jpeg", | ||
"type": "WebResource", | ||
"source": "http://data.europeana.eu/item/08641/1037479000000476703", | ||
"thumbnail": "https://api.europeana.eu/thumbnail/v2/url.json?uri=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F572458027_1280x960.jpeg&type=VIDEO" | ||
}, | ||
"items":[ | ||
"http://data.europeana.eu/item/08641/1037479000000476703", | ||
"http://data.europeana.eu/item/08641/1037479000000476591", | ||
"http://data.europeana.eu/item/08641/1037479000000476903", | ||
"http://data.europeana.eu/item/08641/1037479000000476467", | ||
"http://data.europeana.eu/item/08641/1037479000000476875", | ||
"http://data.europeana.eu/item/11654/_Botany_U_1419207", | ||
"http://data.europeana.eu/item/2048128/618580" | ||
] | ||
} |
77 changes: 77 additions & 0 deletions
77
set-mongo/src/main/java/eu/europeana/set/web/model/WebResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package eu.europeana.set.web.model; | ||
|
||
import static eu.europeana.set.definitions.model.vocabulary.WebUserSetModelFields.ID; | ||
import static eu.europeana.set.definitions.model.vocabulary.WebUserSetModelFields.SOURCE; | ||
import static eu.europeana.set.definitions.model.vocabulary.WebUserSetModelFields.THUMBNAIL; | ||
import static eu.europeana.set.definitions.model.vocabulary.WebUserSetModelFields.TYPE; | ||
import java.util.Objects; | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
import dev.morphia.annotations.Embedded; | ||
import eu.europeana.set.definitions.model.BaseWebResource; | ||
|
||
@Embedded | ||
@JsonInclude(value = JsonInclude.Include.NON_EMPTY) | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonPropertyOrder({ID, TYPE, SOURCE, THUMBNAIL}) | ||
public class WebResource extends BaseWebResource { | ||
|
||
public static final String TYPE = "WebResource"; | ||
@JsonProperty(SOURCE) | ||
private String source; | ||
@JsonProperty(ID) | ||
private String id; | ||
@JsonProperty(THUMBNAIL) | ||
private String thumbnail; | ||
|
||
public WebResource() { | ||
super(); | ||
} | ||
|
||
public WebResource(BaseWebResource copy) { | ||
super(copy); | ||
} | ||
|
||
public WebResource(String id, String source, String thumbnail) { | ||
super(id, source, thumbnail); | ||
} | ||
|
||
|
||
public void setThumbnail(String thumbnailParam) { | ||
super.setThumbnail(thumbnailParam); | ||
} | ||
|
||
public void setSource(String sourceParam) { | ||
source = sourceParam; | ||
} | ||
|
||
public void setId(String idParam) { | ||
id = idParam; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
|
||
WebResource that = (WebResource) o; | ||
|
||
return Objects.equals(source, that.getSource()) | ||
&& id.equals(that.getId()) | ||
&& Objects.equals(thumbnail, that.getThumbnail()); | ||
} | ||
|
||
public int hashCode() { | ||
int result = (id == null) ? 0 : id.hashCode(); | ||
result += (thumbnail == null) ? 0 : thumbnail.hashCode(); | ||
result += (source == null) ? 0 : source.hashCode(); | ||
return result; | ||
} | ||
|
||
} |
Oops, something went wrong.