Toggle navigation
Toggle navigation
This project
Loading...
Sign in
grogv3
/
grog-cubi
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jean-Francois Leveque
2017-02-15 17:21:28 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
901e4a28e29ff0e584371c18b439a83456df1033
901e4a28
1 parent
19a5e2a3
Comments in English
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
26 additions
and
26 deletions
src/main/java/org/legrog/entities/ActionType.java
src/main/java/org/legrog/entities/Country.java
src/main/java/org/legrog/entities/IndexedPublisher.java
src/main/java/org/legrog/entities/Publisher.java
src/main/java/org/legrog/entities/PublisherAction.java
src/main/java/org/legrog/entities/PublisherActionRepository.java
src/main/java/org/legrog/entities/PublisherSearchRepository.java
src/main/java/org/legrog/entities/PublisherSearchRepositorySolrj.java
src/main/java/org/legrog/entities/PublisherVersion.java
src/main/java/org/legrog/entities/ActionType.java
View file @
901e4a2
package
org
.
legrog
.
entities
;
/**
*
Énumération des actions possibles.
*
Available actions are an enumeration
*/
public
enum
ActionType
{
VALIDATE
;
...
...
src/main/java/org/legrog/entities/Country.java
View file @
901e4a2
...
...
@@ -3,8 +3,8 @@ package org.legrog.entities;
import
javax.persistence.*
;
/**
*
Entité persistante repésentant un pays.
*
Simplement composée d'un identitiant et d'un libellé.
*
Country persistence entity
*
Id and name seem enough
*/
@Entity
public
class
Country
{
...
...
src/main/java/org/legrog/entities/IndexedPublisher.java
View file @
901e4a2
...
...
@@ -4,7 +4,7 @@ import javax.persistence.Id;
import
javax.persistence.Lob
;
/**
*
Classe simplifiée du contenu éditeur servant à l'indexation de données du PublisherVersion valide avec l'identifiant Publisher correspondant
*
Simplified class for indexing validated publisher: content from PublisherVersion with id from Publisher
*/
public
class
IndexedPublisher
{
@Id
...
...
@@ -17,9 +17,9 @@ public class IndexedPublisher {
private
String
publisherHistory
;
/**
* Extra
it l'id du Publisher et le nom et l'historique du PublisherVersion validé pour construire l'IndexedPublisher
* Extra
cts data needed for indexing from Publisher and its validated PublisherVersion
*
* @param publisher
* @param publisher
Publisher we want to be indexed
*/
public
IndexedPublisher
(
Publisher
publisher
)
{
PublisherVersion
publisherVersion
=
publisher
.
getValidatedVersion
();
...
...
src/main/java/org/legrog/entities/Publisher.java
View file @
901e4a2
...
...
@@ -4,9 +4,10 @@ import javax.persistence.*;
import
java.util.Set
;
/**
* Entité persistante correspondant à un éditeur.
* Pointe vers la version valide si elle existe, ainsi que son validateur et la date de validation.
* Pointe vers l'ensemble de ses versions.
* Persisted entity for a publisher
* Has versions of type PublisherVersion
* May have a validated PublisherVersion among those
* Has access to PublisherAction related to it
*/
@Entity
public
class
Publisher
/* extends org.roliste.data.DbLinkableEntity */
{
...
...
src/main/java/org/legrog/entities/PublisherAction.java
View file @
901e4a2
...
...
@@ -4,7 +4,7 @@ import javax.persistence.*;
import
java.sql.Timestamp
;
/**
*
Classe des actions sur des (versions d') éditeurs.
*
Pesisted entity for actions made on PublisherVersion
*/
@Entity
public
class
PublisherAction
{
...
...
@@ -21,7 +21,7 @@ public class PublisherAction {
private
Timestamp
publisherActionDatetime
;
//
Accès simplifié plutôt que de passer par p
ublisherVersion
//
Simplified access instead of going through P
ublisherVersion
@ManyToOne
private
Publisher
publisher
;
...
...
src/main/java/org/legrog/entities/PublisherActionRepository.java
View file @
901e4a2
...
...
@@ -5,22 +5,23 @@ import org.springframework.data.jpa.repository.JpaRepository;
import
java.util.List
;
/**
* Interface
d'accès aux PublisherAction.
* Interface
for accessing PublisherAction
*/
public
interface
PublisherActionRepository
extends
JpaRepository
<
PublisherAction
,
Integer
>
{
/**
* Ret
ourne la dernière action du type indiqué sur le Publisher indiqué.
* Ret
urns last action of a type for a publisher
*
* @param actionType
* @param publisher
* @param actionType
ActionType requested
* @param publisher
Publisher concerned by the action
* @return PublisherAction
*/
PublisherAction
findFirstByActionTypeAndPublisherOrderByPublisherActionDatetimeDesc
(
ActionType
actionType
,
Publisher
publisher
);
/**
* Retourne l'ensemble des actions concernant la PublisherVersion indiquée
* @param publisherVersion
* Returns all actions for a PublisherVersion
*
* @param publisherVersion PublisherVersion concerned by the actions
* @return List<PublisherAction>
*/
List
<
PublisherAction
>
findByPublisherVersion
(
PublisherVersion
publisherVersion
);
...
...
src/main/java/org/legrog/entities/PublisherSearchRepository.java
View file @
901e4a2
package
org
.
legrog
.
entities
;
/**
* In
terface d'indexation/recherche des
IndexedPublisher
* In
dexing/Search interface for
IndexedPublisher
*/
public
interface
PublisherSearchRepository
{
/**
* Indexe
la version simplifiée de Publisher, IndexedPublisher.
* Indexe
s an IndexedPublisher
*
* @param indexedPublisher
* @param indexedPublisher
IndexedPublisher to be indexed
* @return IndexedPublisher
*/
public
IndexedPublisher
save
(
IndexedPublisher
indexedPublisher
)
throws
IndexingException
;
...
...
src/main/java/org/legrog/entities/PublisherSearchRepositorySolrj.java
View file @
901e4a2
...
...
@@ -10,7 +10,7 @@ import javax.inject.Inject;
import
java.io.IOException
;
/**
*
Classe implémentant l'interface PublisherSearchRepository avec l'API
SolrJ
*
Implementation of PublisherSearchRepository using
SolrJ
*/
public
class
PublisherSearchRepositorySolrj
implements
PublisherSearchRepository
{
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
...
...
src/main/java/org/legrog/entities/PublisherVersion.java
View file @
901e4a2
...
...
@@ -4,11 +4,9 @@ import javax.persistence.*;
import
java.sql.Timestamp
;
/**
* Entité persistente représentant une version d'un éditeur.
* Contient les données représentant un éditeur.
* Adresse découpée en suivant http://schema.org/PostalAddress.
* Pointe vers l'éditeur auquel elle correspond.
* Pointe vers l'auteur de la version et contient la date et heure de celle-ci.
* Persisted entity for a publisher version
* Contains the data
* Postal Address is split according to http://schema.org/PostalAddress
*/
@Entity
public
class
PublisherVersion
{
...
...
Please
register
or
login
to post a comment