This repository has been archived by the owner on Nov 15, 2019. It is now read-only.
-
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.
Add AnalysisTool registration and configuration Remote API
- Loading branch information
Showing
147 changed files
with
1,181 additions
and
328 deletions.
There are no files selected for viewing
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
45 changes: 45 additions & 0 deletions
45
src/main/java/org/measure/platform/core/api/entitys/AnalysisCardService.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,45 @@ | ||
package org.measure.platform.core.api.entitys; | ||
|
||
import java.util.List; | ||
|
||
import org.measure.platform.core.entity.AnalysisCard; | ||
import org.measure.platform.core.entity.ProjectAnalysis; | ||
|
||
/** | ||
* Service Interface for managing AnalysisCard. | ||
*/ | ||
public interface AnalysisCardService { | ||
/** | ||
* Save a an AnalysisCard. | ||
* @param card the entity to save | ||
* @return the persisted entity | ||
*/ | ||
AnalysisCard save(AnalysisCard card); | ||
|
||
/** | ||
* Get all the AnalysisCard. | ||
* @return the list of entities | ||
*/ | ||
List<AnalysisCard> findAll(); | ||
|
||
/** | ||
* Get all the Project Analysis of current owner. | ||
* @return the list of entities | ||
*/ | ||
List<AnalysisCard> findAllByProjectAnalysis(ProjectAnalysis projectAnalysis); | ||
|
||
/** | ||
* Get the "id" AnalysisCard. | ||
* @param id the id of the entity | ||
* @return the entity | ||
*/ | ||
AnalysisCard findOne(Long id); | ||
|
||
/** | ||
* Delete the "id" project. | ||
* @param id the id of the entity | ||
*/ | ||
void delete(Long id); | ||
|
||
|
||
} |
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
88 changes: 88 additions & 0 deletions
88
src/main/java/org/measure/platform/core/entity/AnalysisCard.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,88 @@ | ||
package org.measure.platform.core.entity; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.ManyToOne; | ||
import javax.persistence.OneToMany; | ||
import javax.persistence.Table; | ||
import javax.validation.constraints.NotNull; | ||
|
||
import org.hibernate.annotations.Cache; | ||
import org.hibernate.annotations.CacheConcurrencyStrategy; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
|
||
|
||
@Entity | ||
@Table(name = "analysiscard") | ||
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | ||
public class AnalysisCard { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
private Long id; | ||
|
||
@NotNull | ||
@Column(name = "card_label", nullable = false) | ||
private String cardLabel; | ||
|
||
@NotNull | ||
@Column(name = "card_url", nullable = false) | ||
private String cardUrl; | ||
|
||
@ManyToOne | ||
private ProjectAnalysis projectanalysis; | ||
|
||
@OneToMany(mappedBy = "analysiscard") | ||
@JsonIgnore | ||
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | ||
private Set<MeasureView> measureviews = new HashSet<>(); | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getCardLabel() { | ||
return cardLabel; | ||
} | ||
|
||
public void setCardLabel(String cardLabel) { | ||
this.cardLabel = cardLabel; | ||
} | ||
|
||
public String getCardUrl() { | ||
return cardUrl; | ||
} | ||
|
||
public void setCardUrl(String cardUrl) { | ||
this.cardUrl = cardUrl; | ||
} | ||
|
||
public Set<MeasureView> getMeasureviews() { | ||
return measureviews; | ||
} | ||
|
||
public void setMeasureviews(Set<MeasureView> measureviews) { | ||
this.measureviews = measureviews; | ||
} | ||
|
||
public ProjectAnalysis getProjectanalysis() { | ||
return projectanalysis; | ||
} | ||
|
||
public void setProjectanalysis(ProjectAnalysis projectanalysis) { | ||
this.projectanalysis = projectanalysis; | ||
} | ||
|
||
|
||
} |
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
71 changes: 71 additions & 0 deletions
71
src/main/java/org/measure/platform/core/impl/entitys/AnalysisCardServiceImpl.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,71 @@ | ||
package org.measure.platform.core.impl.entitys; | ||
|
||
import java.util.List; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.measure.platform.core.api.entitys.AnalysisCardService; | ||
import org.measure.platform.core.api.entitys.MeasureViewService; | ||
import org.measure.platform.core.entity.AnalysisCard; | ||
import org.measure.platform.core.entity.MeasureView; | ||
import org.measure.platform.core.entity.ProjectAnalysis; | ||
import org.measure.platform.core.impl.repository.AnalysisCardRepository; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
/** | ||
* Service Implementation for managing AnalysisCard. | ||
*/ | ||
@Service | ||
@Transactional | ||
public class AnalysisCardServiceImpl implements AnalysisCardService { | ||
private final Logger log = LoggerFactory.getLogger(AnalysisCardServiceImpl.class); | ||
|
||
@Inject | ||
private AnalysisCardRepository analysisRepository; | ||
|
||
@Inject | ||
private MeasureViewService measureViewService; | ||
|
||
@Override | ||
public AnalysisCard save(AnalysisCard card) { | ||
log.debug("Request to save AnalysisCard : {}", card); | ||
AnalysisCard result = analysisRepository.save(card); | ||
return result; | ||
} | ||
|
||
@Override | ||
@Transactional(readOnly = true) | ||
public List<AnalysisCard> findAll() { | ||
List<AnalysisCard> result = analysisRepository.findAll(); | ||
return result; | ||
} | ||
|
||
@Override | ||
@Transactional(readOnly = true) | ||
public List<AnalysisCard> findAllByProjectAnalysis(ProjectAnalysis projectAnalysis) { | ||
|
||
List<AnalysisCard> result = analysisRepository.findByProjectAnalysis(projectAnalysis); | ||
return result; | ||
} | ||
|
||
@Override | ||
@Transactional(readOnly = true) | ||
public AnalysisCard findOne(Long id) { | ||
log.debug("Request to get Phase : {}", id); | ||
AnalysisCard card = analysisRepository.findOne(id); | ||
return card; | ||
} | ||
|
||
@Override | ||
public void delete(Long id) { | ||
for (MeasureView view : measureViewService.findByAnalysisCard(id)) { | ||
measureViewService.delete(view.getId()); | ||
} | ||
|
||
analysisRepository.delete(id); | ||
} | ||
|
||
} |
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
Oops, something went wrong.