Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Commit

Permalink
Add AnalysisTool registration and configuration Remote API
Browse files Browse the repository at this point in the history
  • Loading branch information
aabherve committed Feb 1, 2018
1 parent fcba86a commit 00d577b
Show file tree
Hide file tree
Showing 147 changed files with 1,181 additions and 328 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/measure/platform/ApplicationStartup.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import javax.inject.Inject;

import org.measure.platform.core.api.IMeasureCatalogueService;
import org.measure.platform.measurementstorage.api.IElasticsearchIndexManager;
import org.measure.platform.service.measurement.api.IElasticsearchIndexManager;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/measure/platform/ApplicationWebXml.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.measure.platform;

import org.measure.platform.framework.config.DefaultProfileUtil;
import org.measure.platform.utils.config.DefaultProfileUtil;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/measure/platform/MeasurePlatformApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import javax.annotation.PostConstruct;
import javax.inject.Inject;

import org.measure.platform.framework.config.Constants;
import org.measure.platform.framework.config.DefaultProfileUtil;
import org.measure.platform.framework.config.JHipsterProperties;
import org.measure.platform.utils.config.Constants;
import org.measure.platform.utils.config.DefaultProfileUtil;
import org.measure.platform.utils.config.JHipsterProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
Expand Down
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);


}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.util.List;

import org.measure.platform.core.entity.MeasureView;
import org.measure.platform.core.entity.ProjectAnalysis;

/**
* Service Interface for managing MeasureView.
Expand Down Expand Up @@ -45,6 +44,6 @@ public interface MeasureViewService {

List<MeasureView> findByDashboard(Long id);

List<MeasureView> findByProjectAnalysis(Long id);
List<MeasureView> findByAnalysisCard(Long id);

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.measure.platform.framework.domain.User;
import org.measure.platform.utils.domain.User;

import com.fasterxml.jackson.annotation.JsonIgnore;

Expand Down
88 changes: 88 additions & 0 deletions src/main/java/org/measure/platform/core/entity/AnalysisCard.java
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;
}


}
22 changes: 14 additions & 8 deletions src/main/java/org/measure/platform/core/entity/MeasureView.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class MeasureView implements Serializable {
private MeasureInstance measureinstance;

@ManyToOne
private ProjectAnalysis projectanalysis;
private AnalysisCard analysiscard;


public String getName() {
Expand Down Expand Up @@ -342,6 +342,19 @@ public Phase getPhaseoverview() {
public void setPhaseoverview(Phase phaseOverview) {
this.phaseoverview = phaseOverview;
}


public AnalysisCard getAnalysiscard() {
return analysiscard;
}

public void setAnalysiscard(AnalysisCard analysiscard) {
this.analysiscard = analysiscard;
}

public Boolean getAuto() {
return auto;
}

@Override
public boolean equals(Object o) {
Expand All @@ -364,13 +377,6 @@ public int hashCode() {
}


public ProjectAnalysis getProjectanalysis() {
return projectanalysis;
}

public void setProjectanalysis(ProjectAnalysis projectanalysis) {
this.projectanalysis = projectanalysis;
}

@Override
public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.measure.platform.framework.domain.User;
import org.measure.platform.utils.domain.User;

import com.fasterxml.jackson.annotation.JsonIgnore;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class ProjectAnalysis implements Serializable {
@OneToMany(mappedBy = "projectanalysis")
@JsonIgnore
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
private Set<MeasureView> measureviews = new HashSet<>();
private Set<AnalysisCard> analysiscards = new HashSet<>();

public Long getId() {
return id;
Expand Down Expand Up @@ -128,14 +128,11 @@ public void setAlertevents(Set<AlertEvent> alertevents) {
this.alertevents = alertevents;
}

public Set<MeasureView> getMeasureviews() {
return measureviews;
public Set<AnalysisCard> getAnalysiscards() {
return analysiscards;
}

public void setMeasureviews(Set<MeasureView> measureviews) {
this.measureviews = measureviews;
public void setAnalysiscards(Set<AnalysisCard> analysiscards) {
this.analysiscards = analysiscards;
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.apache.commons.io.FileUtils;
import org.measure.platform.core.api.IMeasureCatalogueService;
import org.measure.platform.core.impl.utils.UnzipUtility;
import org.measure.platform.measurementstorage.api.IElasticsearchIndexManager;
import org.measure.platform.service.measurement.api.IElasticsearchIndexManager;
import org.measure.smm.measure.api.IMeasure;
import org.measure.smm.measure.model.SMMMeasure;
import org.measure.smm.service.MeasurePackager;
Expand Down
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);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@

import javax.inject.Inject;

import org.measure.platform.core.api.entitys.AnalysisCardService;
import org.measure.platform.core.api.entitys.DashboardService;
import org.measure.platform.core.api.entitys.MeasureViewService;
import org.measure.platform.core.api.entitys.PhaseService;
import org.measure.platform.core.api.entitys.ProjectAnalysisService;
import org.measure.platform.core.api.entitys.ProjectService;
import org.measure.platform.core.entity.AnalysisCard;
import org.measure.platform.core.entity.Dashboard;
import org.measure.platform.core.entity.MeasureView;
import org.measure.platform.core.entity.Phase;
import org.measure.platform.core.entity.Project;
import org.measure.platform.core.entity.ProjectAnalysis;
import org.measure.platform.core.impl.repository.MeasureViewRepository;
import org.measure.platform.measurementstorage.api.IElasticsearchIndexManager;
import org.measure.platform.service.measurement.api.IElasticsearchIndexManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -46,7 +46,7 @@ public class MeasureViewServiceImpl implements MeasureViewService {
private ProjectService projectService;

@Inject
private ProjectAnalysisService projectAnalysisService;
private AnalysisCardService analysisCardService;

@Inject
private PhaseService phaseService;
Expand Down Expand Up @@ -243,9 +243,9 @@ public List<MeasureView> findByDashboard(Long id) {
}

@Override
public List<MeasureView> findByProjectAnalysis(Long id) {
ProjectAnalysis projectAnalysis = projectAnalysisService.findOne(id);
return measureViewRepository.findByProjectAnalysis(projectAnalysis);
public List<MeasureView> findByAnalysisCard(Long id) {
AnalysisCard analysisCard = analysisCardService.findOne(id);
return measureViewRepository.findByAnalysisCard(analysisCard);
}


Expand Down
Loading

0 comments on commit 00d577b

Please sign in to comment.