no message
This commit is contained in:
parent
78b91ee3e0
commit
c25c9d72cf
|
@ -15,7 +15,7 @@ import java.util.*;
|
|||
@NamedEntityGraph(
|
||||
name = "dataManagementPlanListingModel",
|
||||
attributeNodes = {@NamedAttributeNode("organisations"), @NamedAttributeNode("researchers"),
|
||||
@NamedAttributeNode("project"), @NamedAttributeNode("creator"), @NamedAttributeNode("profile"), @NamedAttributeNode("dataset")}
|
||||
@NamedAttributeNode("project"),@NamedAttributeNode("users"), @NamedAttributeNode("creator"), @NamedAttributeNode("profile"), @NamedAttributeNode("dataset")}
|
||||
),
|
||||
@NamedEntityGraph(
|
||||
name = "fullyDetailed",
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.UUID;
|
|||
@NamedEntityGraph(
|
||||
name = "projectListingItem",
|
||||
attributeNodes = {@NamedAttributeNode(value = "dmps", subgraph = "dmps"), @NamedAttributeNode(value = "content")},
|
||||
subgraphs = @NamedSubgraph(name = "dmps", attributeNodes = {@NamedAttributeNode("creator"), @NamedAttributeNode("users")})
|
||||
subgraphs = @NamedSubgraph(name = "dmps", attributeNodes = {@NamedAttributeNode("creator"),@NamedAttributeNode("project"), @NamedAttributeNode("users")})
|
||||
)
|
||||
})
|
||||
public class Project implements DataEntity<Project, UUID> {
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
import eu.eudat.data.entities.DataRepository;
|
||||
import eu.eudat.query.engine.builder.QueryBuilder;
|
||||
import eu.eudat.query.engine.builder.QueryBuilderImpl;
|
||||
import eu.eudat.query.engine.predicates.ComparisonPredicate;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 7/5/2018.
|
||||
*/
|
||||
public class Main {
|
||||
public static void main(String[] args){
|
||||
new Main().Test();
|
||||
}
|
||||
public void Test(){
|
||||
QueryBuilder<DataRepository> queryBuilder = new QueryBuilderImpl<>();
|
||||
queryBuilder.where((entity, comparisonExpression) -> comparisonExpression.field("id").greaterThan(5));
|
||||
//queryBuilder.and(((entity, expression) -> expression.field("id").greaterThan(4)),((entity, expression) -> expression.field("id").greaterThan(5)));
|
||||
QueryBuilder<DataRepository> queryBuilder = new QueryBuilderImpl<>(DataRepository.class);
|
||||
queryBuilder.<ComparisonPredicate>where((comparisonExpression) -> comparisonExpression.field("id").greaterThan(5) );
|
||||
queryBuilder.<ComparisonPredicate>where((comparisonExpression) -> comparisonExpression.field("label").equal("mitsos") );
|
||||
queryBuilder.toList();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package eu.eudat.query.engine.builder;
|
||||
|
||||
import eu.eudat.query.engine.expressions.Expression;
|
||||
import eu.eudat.query.engine.predicates.AndPredicate;
|
||||
import eu.eudat.query.engine.predicates.ComparisonPredicate;
|
||||
import eu.eudat.query.engine.predicates.Predicate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 7/5/2018.
|
||||
*/
|
||||
public interface QueryBuilder<T> {
|
||||
|
||||
Expression where(ComparisonPredicate<T> wherePredicate);
|
||||
|
||||
Expression and(AndPredicate<T> andPredicate);
|
||||
<P extends Predicate> Expression where(P wherePredicate);
|
||||
|
||||
List<T> toList();
|
||||
}
|
||||
|
|
|
@ -1,22 +1,50 @@
|
|||
package eu.eudat.query.engine.builder;
|
||||
|
||||
import eu.eudat.query.engine.expressions.ComparisonExpression;
|
||||
import eu.eudat.query.engine.expressions.Expression;
|
||||
import eu.eudat.query.engine.predicates.AndPredicate;
|
||||
import eu.eudat.query.engine.predicates.ComparisonPredicate;
|
||||
import eu.eudat.query.engine.predicates.Predicate;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 7/5/2018.
|
||||
*/
|
||||
public class QueryBuilderImpl<T> implements QueryBuilder<T> {
|
||||
|
||||
private List<Expression> expressions = new LinkedList<>();
|
||||
private Class<T> tClass;
|
||||
|
||||
@Override
|
||||
public Expression where(ComparisonPredicate wherePredicate) {
|
||||
return null;
|
||||
public QueryBuilderImpl(Class<T> tClass) {
|
||||
this.tClass = tClass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression and(AndPredicate<T> andPredicate) {
|
||||
public <P extends Predicate> Expression where(P wherePredicate) {
|
||||
ComparisonExpression comparisonExpression = new ComparisonExpression();
|
||||
Expression expression = wherePredicate.apply(comparisonExpression);
|
||||
this.expressions.add(expression);
|
||||
return expression;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<T> toList() {
|
||||
String query = "Select * from ";
|
||||
Optional<Annotation> optionalAnnotation = Arrays.stream(this.tClass.getAnnotations())
|
||||
.filter(x-> x.annotationType().equals(javax.persistence.Table.class))
|
||||
.findFirst();
|
||||
|
||||
javax.persistence.Table annotation = optionalAnnotation.isPresent() ? (javax.persistence.Table)optionalAnnotation.get() : null;
|
||||
query += annotation.name()+" ";
|
||||
for (Expression expression : expressions) {
|
||||
if(expressions.indexOf(expression) > 0) query+= " and ";
|
||||
else query += " where ";
|
||||
query += expression.evaluate();
|
||||
}
|
||||
System.out.println(query);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,4 +40,8 @@ public class ComparisonExpression extends AbstractFieldExpression<ComparisonExpr
|
|||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String evaluate() {
|
||||
return this.getField() +" " + type.toString() + " " + value ;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,4 +4,5 @@ package eu.eudat.query.engine.expressions;
|
|||
* Created by ikalyvas on 7/5/2018.
|
||||
*/
|
||||
public interface Expression {
|
||||
String evaluate();
|
||||
}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
package eu.eudat.query.engine.predicates;
|
||||
|
||||
import eu.eudat.query.engine.expressions.ComparisonExpression;
|
||||
import eu.eudat.query.engine.expressions.Expression;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 7/5/2018.
|
||||
*/
|
||||
public interface AndPredicate<T> {
|
||||
<E extends Expression> Expression and(ComparisonPredicate<T>... predicates);
|
||||
}
|
|
@ -1,9 +1,10 @@
|
|||
package eu.eudat.query.engine.predicates;
|
||||
|
||||
import eu.eudat.query.engine.expressions.ComparisonExpression;
|
||||
import eu.eudat.query.engine.expressions.Expression;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 7/5/2018.
|
||||
*/
|
||||
public interface ComparisonPredicate<T> extends Predicate<T, ComparisonExpression> {
|
||||
public interface ComparisonPredicate extends Predicate<ComparisonExpression> {
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package eu.eudat.query.engine.predicates;
|
||||
|
||||
import eu.eudat.query.engine.expressions.ComparisonExpression;
|
||||
import eu.eudat.query.engine.expressions.Expression;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 7/5/2018.
|
||||
*/
|
||||
public interface Predicate<T,E extends Expression> {
|
||||
Expression where(T entity, E expression);
|
||||
|
||||
public interface Predicate<E extends Expression> {
|
||||
Expression apply( E expression);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package eu.eudat.logic.managers;
|
||||
|
||||
import eu.eudat.logic.builders.entity.UserInfoBuilder;
|
||||
import eu.eudat.configurations.dynamicproject.DynamicProjectConfiguration;
|
||||
import eu.eudat.configurations.dynamicproject.entities.Property;
|
||||
import eu.eudat.data.dao.criteria.DynamicFieldsCriteria;
|
||||
import eu.eudat.data.dao.criteria.OrganisationCriteria;
|
||||
import eu.eudat.data.dao.criteria.ProjectCriteria;
|
||||
|
@ -9,10 +10,10 @@ import eu.eudat.data.dao.entities.*;
|
|||
import eu.eudat.data.entities.*;
|
||||
import eu.eudat.data.query.items.item.dmp.DataManagementPlanCriteriaRequest;
|
||||
import eu.eudat.data.query.items.table.dmp.DataManagementPlanTableRequest;
|
||||
import eu.eudat.configurations.dynamicproject.DynamicProjectConfiguration;
|
||||
import eu.eudat.configurations.dynamicproject.entities.Property;
|
||||
import eu.eudat.exceptions.datamanagementplan.DMPWithDatasetsException;
|
||||
import eu.eudat.exceptions.security.UnauthorisedException;
|
||||
import eu.eudat.logic.builders.entity.UserInfoBuilder;
|
||||
import eu.eudat.logic.services.ApiContext;
|
||||
import eu.eudat.models.HintedModelFactory;
|
||||
import eu.eudat.models.data.dmp.DataManagementPlan;
|
||||
import eu.eudat.models.data.dmp.DataManagementPlanNewVersionModel;
|
||||
|
@ -23,7 +24,6 @@ import eu.eudat.models.data.listingmodels.DataManagementPlanListingModel;
|
|||
import eu.eudat.models.data.listingmodels.DatasetListingModel;
|
||||
import eu.eudat.models.data.security.Principal;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
import eu.eudat.logic.services.ApiContext;
|
||||
import org.springframework.http.*;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
@ -41,12 +41,19 @@ public class DataManagementPlanManager {
|
|||
QueryableList<DMP> authItems = apiContext.getOperationsContext().getDatabaseRepository().getDmpDao().getAuthenticated(items, userInfo);
|
||||
QueryableList<DMP> pagedItems = PaginationManager.applyPaging(authItems, dataManagementPlanTableRequest);
|
||||
|
||||
DataTableData<DataManagementPlanListingModel> dataTable = new DataTableData<DataManagementPlanListingModel>();
|
||||
DataTableData<DataManagementPlanListingModel> dataTable = new DataTableData<>();
|
||||
|
||||
CompletableFuture itemsFuture = pagedItems
|
||||
.selectAsync(item -> new DataManagementPlanListingModel().fromDataModel(item)).whenComplete((resultList, throwable) -> {
|
||||
dataTable.setData(resultList);
|
||||
});
|
||||
CompletableFuture itemsFuture = pagedItems.withHint(HintedModelFactory.getHint(DataManagementPlanListingModel.class))
|
||||
.selectAsync(item -> {
|
||||
item.setDataset(
|
||||
item.getDataset().stream()
|
||||
.filter(dataset -> dataset.getDmp().getCreator().getId().equals(userInfo.getId())
|
||||
|| dataset.isPublic()
|
||||
|| dataset.getDmp().getUsers().stream()
|
||||
.filter(x -> x.getId().equals(userInfo.getId())).collect(Collectors.toList()).size() > 0).collect(Collectors.toSet()));
|
||||
return new DataManagementPlanListingModel().fromDataModel(item);
|
||||
})
|
||||
.whenComplete((resultList, throwable) -> dataTable.setData(resultList));
|
||||
|
||||
CompletableFuture countFuture = authItems.countAsync().whenComplete((count, throwable) -> {
|
||||
dataTable.setTotalCount(count);
|
||||
|
|
|
@ -4,7 +4,9 @@ import eu.eudat.data.entities.DMP;
|
|||
import eu.eudat.models.DataModel;
|
||||
import eu.eudat.models.data.dmp.Organisation;
|
||||
import eu.eudat.logic.utilities.helpers.LabelBuilder;
|
||||
import eu.eudat.models.data.urls.DatasetUrlListing;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -18,7 +20,7 @@ public class DataManagementPlanListingModel implements DataModel<DMP, DataManage
|
|||
private String organisations;
|
||||
private String version;
|
||||
private UUID groupId;
|
||||
private Integer numOfDatasets;
|
||||
private List<DatasetUrlListing> datasets;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
|
@ -84,12 +86,12 @@ public class DataManagementPlanListingModel implements DataModel<DMP, DataManage
|
|||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public Integer getNumOfDatasets() {
|
||||
return numOfDatasets;
|
||||
public List<DatasetUrlListing> getDatasets() {
|
||||
return datasets;
|
||||
}
|
||||
|
||||
public void setNumOfDatasets(Integer numOfDatasets) {
|
||||
this.numOfDatasets = numOfDatasets;
|
||||
public void setDatasets(List<DatasetUrlListing> datasets) {
|
||||
this.datasets = datasets;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -102,7 +104,7 @@ public class DataManagementPlanListingModel implements DataModel<DMP, DataManage
|
|||
this.creationTime = entity.getCreated().toString();
|
||||
this.version = "" + entity.getVersion();
|
||||
this.groupId = entity.getGroupId();
|
||||
this.numOfDatasets = entity.getDataset().size();
|
||||
this.datasets = entity.getDataset().stream().map(x-> new DatasetUrlListing().fromDataModel(x)).collect(Collectors.toList());
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package eu.eudat.models.data.urls;
|
||||
|
||||
import eu.eudat.data.entities.Dataset;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 7/23/2018.
|
||||
*/
|
||||
public class DatasetUrlListing extends UrlListing<Dataset, DatasetUrlListing> {
|
||||
@Override
|
||||
public DatasetUrlListing fromDataModel(Dataset entity) {
|
||||
this.setLabel(entity.getLabel());
|
||||
this.setUrl(entity.getId().toString());
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dataset toDataModel() throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHint() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -71,5 +71,5 @@ http-logger.initial-delay = 0
|
|||
http-logger.delay = 10
|
||||
http-logger.server-address = http://logstash:31311
|
||||
#############################Elastic Search######################################
|
||||
elasticsearch.host = localhost
|
||||
elasticsearch.port = 9201
|
||||
elasticsearch.host = elasticsearch-dmp
|
||||
elasticsearch.port = 9200
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<help-content position="left"></help-content>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<app-breadcrumb *ngIf="hasBreadCrumb | async"></app-breadcrumb>
|
||||
<app-breadcrumb *ngIf="this.isAuthenticated() && (hasBreadCrumb | async)"></app-breadcrumb>
|
||||
<router-outlet (activate)='onActivate($event)' (deactivate)='onDeactivate($event)'></router-outlet>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
|
|
|
@ -4,6 +4,7 @@ import { TranslateService } from '@ngx-translate/core';
|
|||
import { LanguageResolverService } from './services/language-resolver/language-resolver.service';
|
||||
import { BreadCrumbResolverService } from './services/breadcrumb/breadcrumb-resolver.service';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { AuthService } from './services/auth/auth.service';
|
||||
|
||||
|
||||
declare const gapi: any;
|
||||
|
@ -20,10 +21,11 @@ export class AppComponent implements OnInit {
|
|||
|
||||
hasBreadCrumb = Observable.of(false);
|
||||
sideNavOpen = false;
|
||||
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private authentication: AuthService,
|
||||
private translate: TranslateService,
|
||||
private languageService: LanguageResolverService,
|
||||
private breadCrumbResolverService: BreadCrumbResolverService
|
||||
|
@ -60,6 +62,10 @@ export class AppComponent implements OnInit {
|
|||
|
||||
}
|
||||
|
||||
public isAuthenticated(): boolean {
|
||||
return !(!this.authentication.current())
|
||||
}
|
||||
|
||||
goToDMPs() {
|
||||
this.router.navigate(['/dmps'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
||||
}
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
<button mat-raised-button color="primary" *ngIf="datasetWizardModel&&datasetWizardModel?.status == 1" style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;"
|
||||
(click)="downloadXML();" type="button">Download XML</button>
|
||||
<div class="fill-space"></div>
|
||||
<button mat-button (click)="redirectToProject()">
|
||||
<!-- <button mat-button (click)="redirectToProject()">
|
||||
<mat-icon>arrow_right_alt</mat-icon>{{'DATASET-WIZARD.ACTIONS.GO-TO-PROJECT' | translate}}</button>
|
||||
<button mat-button (click)="redirectToDmp()">
|
||||
<mat-icon>arrow_right_alt</mat-icon>{{'DATASET-WIZARD.ACTIONS.GO-TO-DMP' | translate}}</button>
|
||||
<mat-icon>arrow_right_alt</mat-icon>{{'DATASET-WIZARD.ACTIONS.GO-TO-DMP' | translate}}</button> -->
|
||||
|
||||
</div>
|
||||
<mat-horizontal-stepper [linear]="isLinear" #stepper>
|
||||
|
@ -175,7 +175,7 @@
|
|||
<mat-card>
|
||||
<mat-card-header>
|
||||
<mat-card-title class="thick">
|
||||
{{'DATASET-EDITOR.FIELDS.TAG' | translate}}
|
||||
{{'DATASET-EDITOR.FIELDS.TAGS' | translate}}
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<app-external-item-listing *ngIf="formGroup.get('tags') && tagsTemplate && externalSourcesConfiguration" [options]="externalSourcesConfiguration.tags"
|
||||
|
|
|
@ -172,6 +172,29 @@ export class DatasetWizardComponent implements OnInit, IBreadCrumbComponent {
|
|||
this.datasetWizardModel.dmp = data;
|
||||
this.formGroup = this.datasetWizardModel.buildForm();
|
||||
this.loadDatasetProfiles();
|
||||
|
||||
this.breadCrumbs = Observable.of([
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: "Datasets",
|
||||
url: "/datasets",
|
||||
notFoundResolver: [
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: this.datasetWizardModel.dmp.project.label,
|
||||
url: "/projects/edit/" + this.datasetWizardModel.dmp.project.id
|
||||
},
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: this.datasetWizardModel.dmp.label,
|
||||
url: "/dmps/edit/" + this.datasetWizardModel.dmp.id,
|
||||
}]
|
||||
},
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: "New Dataset",
|
||||
url: "/datasets/new"
|
||||
}])
|
||||
});
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
</mat-card-title>
|
||||
<div class="fill-space"></div>
|
||||
<div *ngIf="!isNew" flexLayout="row">
|
||||
<div fxFlex>
|
||||
<!-- <div fxFlex>
|
||||
<button mat-button type="button" (click)="redirectToProject()">
|
||||
<mat-icon>arrow_right_alt</mat-icon>{{'DMP-EDITOR.ACTIONS.GO-TO-PROJECT' | translate}}</button>
|
||||
</div>
|
||||
</div> -->
|
||||
<div fxFlex>
|
||||
<button mat-button type="button" (click)="redirectToDatasets()">
|
||||
<mat-icon>arrow_right_alt</mat-icon>{{'DMP-EDITOR.ACTIONS.GO-TO-DATASETS' | translate}}</button>
|
||||
|
@ -52,7 +52,7 @@
|
|||
[configuration]="projectAutoCompleteConfiguration" titleKey="label" [control]="formGroup.get('project')" [required]="true">
|
||||
</auto-complete>
|
||||
|
||||
<app-dynamic-fields-project [formGroup]="formGroup"></app-dynamic-fields-project>
|
||||
<!-- <app-dynamic-fields-project [formGroup]="formGroup"></app-dynamic-fields-project> -->
|
||||
|
||||
<td-chips color="accent" [items]="filteredProfiles" formControlName="profiles" placeholder="{{'DMP-EDITOR.FIELDS.PROFILES' | translate}}"
|
||||
(inputChange)="filterProfiles($event)" requireMatch required>
|
||||
|
|
|
@ -117,11 +117,22 @@ export class DataManagementPlanEditorComponent implements AfterViewInit, IBreadC
|
|||
});
|
||||
} else {
|
||||
this.dataManagementPlan = new DataManagementPlanModel();
|
||||
setTimeout(() => {
|
||||
setTimeout(async () => {
|
||||
this.formGroup = this.dataManagementPlan.buildForm();
|
||||
if (this.formGroup.get("profile") && this.formGroup.get("profile").value) {
|
||||
this.textCtrl.patchValue(this.formGroup.get("profile").value);
|
||||
}
|
||||
this.breadCrumbs = Observable.of([
|
||||
{
|
||||
parentComponentName: "DataManagementPlanListingComponent",
|
||||
label: 'DMPs',
|
||||
url: "dmps",
|
||||
},
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: "New DMP",
|
||||
url: "/dmps/new"
|
||||
}])
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -45,11 +45,11 @@
|
|||
<mat-cell *matCellDef="let row"> {{row.version}}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Datasets(count) -->
|
||||
<ng-container cdkColumnDef="numOfDatasets">
|
||||
<!-- Column Definition: Datasets -->
|
||||
<ng-container cdkColumnDef="datasets">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="|count|dataset">{{'DMP-LISTING.COLUMNS.DATASETS' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" (click)="$event.stopPropagation();">
|
||||
<a (click)="showDatasets(row.id, row.label);">{{row.numOfDatasets}}</a>
|
||||
<mat-cell *matCellDef="let row" (click)="$event.stopPropagation()">
|
||||
<app-url-listing [items]="row.datasets" [urlLimit]="5" [parameters]="{ datasetLabel: row.label }"></app-url-listing>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ export class DataManagementPlanListingComponent implements OnInit, IBreadCrumbCo
|
|||
|
||||
breadCrumbs: Observable<BreadcrumbItem[]> = Observable.of([]);
|
||||
dataSource: DataManagementPlanDataSource | null;
|
||||
displayedColumns: String[] = ['name', 'project', 'creationTime', 'organisations', 'version', 'numOfDatasets', 'actions'];
|
||||
displayedColumns: String[] = ['name', 'project', 'creationTime', 'organisations', 'version', 'datasets', 'actions'];
|
||||
itemId: string;
|
||||
projectId: string;
|
||||
showProject: boolean;
|
||||
|
@ -180,7 +180,14 @@ export class DataManagementPlanDataSource extends DataSource<DataManagementPlanL
|
|||
.map(result => {
|
||||
if (!result) { return []; }
|
||||
if (this._paginator.pageIndex === 0) { this.totalCount = result.totalCount; }
|
||||
return result.data;
|
||||
return result.data.map(item => {
|
||||
item["datasets"].map(dmp => {
|
||||
dmp.url = "datasets/edit/" + dmp.url;
|
||||
dmp.all = "datasets/dmp/" + item.id
|
||||
return dmp;
|
||||
})
|
||||
return item;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
<div class="main-panel" id="main-panel">
|
||||
<div class="container">
|
||||
<div class="row" style="margin-top: 30px">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 col-md-offset-1">
|
||||
<h3 *ngIf="!this.isAuthenticated()">{{ 'HOMEPAGE.OPEN-DMPS.STATS' | translate }}</h3>
|
||||
<h3 *ngIf="this.isAuthenticated()">{{ 'HOMEPAGE.MY-DMPS.STATS' | translate }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 30px">
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 col-md-offset-1">
|
||||
<app-figurecard title={{dashboardStatisticsData.totalProjectCount}} headerIcon="list" [category]="this.isAuthenticated() ? 'My Projects' : 'Projects'"
|
||||
[hasFootContent]="this.isAuthenticated()" [footContent]="this.isAuthenticated() ? 'Open My Projects' : 'Open Projects'"
|
||||
routelLink='/projects' footerIcon="open_in_new" linearColor="linear-gradient(60deg, #ffa726, #fb8c00)" boxShadow="0 4px 20px 0 rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(255, 152, 0, 0.4)">
|
||||
</app-figurecard>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
|
||||
<app-figurecard title={{dashboardStatisticsData.totalDataManagementPlanCount}} headerIcon="mode_edit" [category]="this.isAuthenticated() ? 'My DMPs' : 'DMPs'"
|
||||
[hasFootContent]="this.isAuthenticated()" [footContent]="this.isAuthenticated() ? 'Open My DMPs' : 'Open DMPs'"
|
||||
routelLink='/dmps' footerIcon="open_in_new" linearColor="linear-gradient(60deg, #ef5350, #e53935)" boxShadow="0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(244, 67, 54, 0.4)">
|
||||
</app-figurecard>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
|
||||
<app-figurecard title={{dashboardStatisticsData.totalDataSetCount}} headerIcon="subject" [category]="this.isAuthenticated() ? 'My Datasets' : 'Datasets'"
|
||||
[hasFootContent]="this.isAuthenticated()" [footContent]="this.isAuthenticated() ? 'Open My Datasets' : 'Open Datasets'"
|
||||
routelLink='/datasets' footerIcon="open_in_new" linearColor="linear-gradient(60deg, #26c6da, #00acc1)" boxShadow="0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(0, 188, 212, 0.4)">
|
||||
</app-figurecard>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="this.isAuthenticated()" class="row" style="margin-top: 30px">
|
||||
<div class="col-lg-9 col-md-12 col-sm-12 col-xs-12 col-md-offset-1">
|
||||
<app-recent-activity></app-recent-activity>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="row" style="margin-top: 30px">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 col-md-offset-1">
|
||||
<h3 *ngIf="!this.isAuthenticated()">{{ 'HOMEPAGE.OPEN-DMPS.STATS' | translate }}</h3>
|
||||
<h3 *ngIf="this.isAuthenticated()">{{ 'HOMEPAGE.MY-DMPS.STATS' | translate }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 30px">
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 col-md-offset-1">
|
||||
<app-figurecard title={{dashboardStatisticsData.totalProjectCount}} headerIcon="list" [category]="this.isAuthenticated() ? 'My Projects' : 'Projects'"
|
||||
[hasFootContent]="this.isAuthenticated()" [footContent]="this.isAuthenticated() ? 'Open My Projects' : 'Open Projects'"
|
||||
routelLink='/projects' footerIcon="open_in_new" linearColor="linear-gradient(60deg, #ffa726, #fb8c00)" boxShadow="0 4px 20px 0 rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(255, 152, 0, 0.4)">
|
||||
</app-figurecard>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
|
||||
<app-figurecard title={{dashboardStatisticsData.totalDataManagementPlanCount}} headerIcon="mode_edit" [category]="this.isAuthenticated() ? 'My DMPs' : 'DMPs'"
|
||||
[hasFootContent]="this.isAuthenticated()" [footContent]="this.isAuthenticated() ? 'Open My DMPs' : 'Open DMPs'" routelLink='/dmps'
|
||||
footerIcon="open_in_new" linearColor="linear-gradient(60deg, #ef5350, #e53935)" boxShadow="0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(244, 67, 54, 0.4)">
|
||||
</app-figurecard>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
|
||||
<app-figurecard title={{dashboardStatisticsData.totalDataSetCount}} headerIcon="subject" [category]="this.isAuthenticated() ? 'My Datasets' : 'Datasets'"
|
||||
[hasFootContent]="this.isAuthenticated()" [footContent]="this.isAuthenticated() ? 'Open My Datasets' : 'Open Datasets'"
|
||||
routelLink='/datasets' footerIcon="open_in_new" linearColor="linear-gradient(60deg, #26c6da, #00acc1)" boxShadow="0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(0, 188, 212, 0.4)">
|
||||
</app-figurecard>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="this.isAuthenticated()" class="row" style="margin-top: 30px">
|
||||
<div class="col-lg-9 col-md-12 col-sm-12 col-xs-12 col-md-offset-1">
|
||||
<app-recent-activity></app-recent-activity>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
<!-- Column Definition: End -->
|
||||
<ng-container cdkColumnDef="dmps">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="dmps">{{'PROJECT-LISTING.COLUMNS.DMPS' | translate}}</mat-header-cell>
|
||||
<mat-header-cell *matHeaderCellDef>{{'PROJECT-LISTING.COLUMNS.DMPS' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" (click)="$event.stopPropagation()">
|
||||
<app-url-listing [items]="row.dmps" [urlLimit]="5" [parameters]="{ projectLabel: row.label }"></app-url-listing>
|
||||
</mat-cell>
|
||||
|
|
|
@ -31,7 +31,7 @@ export class BreadcrumbComponent implements OnInit {
|
|||
|
||||
buildBreadCrumb(route: ActivatedRoute): Observable<BreadcrumbItem[]> {
|
||||
|
||||
return this.breadCrumbService.resolve(route);
|
||||
return this.breadCrumbService.resolve(route).map(x => { x.unshift({ label: "Home", url: "/welcome" }); return x; });
|
||||
}
|
||||
|
||||
navigate(url, params) {
|
||||
|
|
|
@ -1,68 +1,68 @@
|
|||
<div class="container row">
|
||||
<div class="col-md-3">
|
||||
<mat-card class="example-card">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
{{'RECENT-ACTIVITY.MY-TITLE-PROJECT' | translate}}
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<mat-nav-list *ngIf="projectActivities!=null">
|
||||
<mat-list-item (click)="redirect(activity.id,RecentActivityTypes.PROJECT)" *ngFor="let activity of projectActivities">
|
||||
<p mat-line>
|
||||
{{activity.label}}
|
||||
</p>
|
||||
<p mat-line>
|
||||
{{activity.timestamp | date:'shortDate'}}
|
||||
</p>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
</mat-card-content>
|
||||
<div class="col-md-3">
|
||||
<mat-card class="example-card">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
{{'RECENT-ACTIVITY.MY-TITLE-PROJECT' | translate}}
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<mat-nav-list *ngIf="projectActivities!=null">
|
||||
<mat-list-item (click)="redirect(activity.id,RecentActivityTypes.PROJECT)" *ngFor="let activity of projectActivities">
|
||||
<p mat-line>
|
||||
{{activity.label}}
|
||||
</p>
|
||||
<p mat-line>
|
||||
{{activity.timestamp | date:'shortDate'}}
|
||||
</p>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
</mat-card-content>
|
||||
|
||||
</mat-card>
|
||||
</mat-card>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<mat-card class="example-card">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
{{'RECENT-ACTIVITY.MY-TITLE-DMP' | translate}}
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<mat-nav-list *ngIf="dmpActivities!=null">
|
||||
<mat-list-item (click)="redirect(activity.id,RecentActivityTypes.DMP)" *ngFor="let activity of dmpActivities">
|
||||
<p mat-line>
|
||||
{{activity.label}}
|
||||
</p>
|
||||
<p mat-line>
|
||||
{{activity.timestamp | date:'shortDate'}}
|
||||
</p>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<mat-card class="example-card">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
{{'RECENT-ACTIVITY.MY-TITLE-DATASET' | translate}}
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<mat-nav-list *ngIf="datasetActivities!=null">
|
||||
<mat-list-item (click)="redirect(activity.id,RecentActivityTypes.DATASET)" *ngFor="let activity of datasetActivities">
|
||||
<p mat-line>
|
||||
{{activity.label}}
|
||||
</p>
|
||||
<p mat-line>
|
||||
{{activity.timestamp | date:'shortDate'}}
|
||||
</p>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<mat-card class="example-card">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
{{'RECENT-ACTIVITY.MY-TITLE-DMP' | translate}}
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<mat-nav-list *ngIf="dmpActivities!=null">
|
||||
<mat-list-item (click)="redirect(activity.id,RecentActivityTypes.DMP)" *ngFor="let activity of dmpActivities">
|
||||
<p mat-line>
|
||||
{{activity.label}}
|
||||
</p>
|
||||
<p mat-line>
|
||||
{{activity.timestamp | date:'shortDate'}}
|
||||
</p>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<mat-card class="example-card">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
{{'RECENT-ACTIVITY.MY-TITLE-DATASET' | translate}}
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<mat-nav-list *ngIf="datasetActivities!=null">
|
||||
<mat-list-item (click)="redirect(activity.id,RecentActivityTypes.DATASET)" *ngFor="let activity of datasetActivities">
|
||||
<p mat-line>
|
||||
{{activity.label}}
|
||||
</p>
|
||||
<p mat-line>
|
||||
{{activity.timestamp | date:'shortDate'}}
|
||||
</p>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -24,7 +24,7 @@ export class WelcomepageComponent implements OnInit, IBreadCrumbComponent {
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.breadCrumbs = Observable.of([{ parentComponentName: null, label: 'Home', url: "/welcome" }])
|
||||
//this.breadCrumbs = Observable.of([{ parentComponentName: null, label: 'Home', url: "/welcome" }])
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -213,7 +213,8 @@
|
|||
"EXTERNAL-DATASETS": "External Datasets",
|
||||
"EXTERNAL-DATASET-TYPE": "External Datasets Type",
|
||||
"EXTERNAL-DATASET-INFO": "External Datasets Info",
|
||||
"DATAREPOSITORIES-INFO": "Data Repositories Info"
|
||||
"DATAREPOSITORIES-INFO": "Data Repositories Info",
|
||||
"TAGS": "Tags"
|
||||
},
|
||||
"ACTIONS": {
|
||||
"SAVE": "Save",
|
||||
|
|
|
@ -28,7 +28,7 @@ services:
|
|||
container_name: dmp-backend
|
||||
ports: ['0.0.0.0:8080:8080']
|
||||
links:
|
||||
- logstash:logstash
|
||||
# - logstash:logstash
|
||||
- elasticsearch-dmp:elasticsearch-dmp
|
||||
networks: ['stack','elasticsearch-dmp']
|
||||
|
||||
|
@ -48,7 +48,7 @@ services:
|
|||
container_name: elasticsearch-dmp
|
||||
volumes:
|
||||
- ./elastic-config/elasticsearch-custom.yml:/usr/share/elasticsearch/config/elasticsearch.yml
|
||||
environment: ['http.host=0.0.0.0','transport.host=0.0.0.0']
|
||||
environment: ['http.host=0.0.0.0','transport.host=0.0.0.0','discovery.type=single-node']
|
||||
ports: ['0.0.0.0:9201:9200','0.0.0.0:9301:9300']
|
||||
networks: ['elasticsearch-dmp']
|
||||
volumes:
|
||||
|
@ -56,31 +56,31 @@ services:
|
|||
|
||||
##########################ELK-STACK######################################################################
|
||||
|
||||
elasticsearch:
|
||||
image: docker.elastic.co/elasticsearch/elasticsearch:${TAG}
|
||||
container_name: elasticsearch
|
||||
environment: ['http.host=0.0.0.0', 'transport.host=127.0.0.1', 'ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
|
||||
ports: ['0.0.0.0:9200:9200']
|
||||
networks: ['stack']
|
||||
volumes:
|
||||
- esdata:/usr/share/elasticsearch/data
|
||||
# elasticsearch:
|
||||
# image: docker.elastic.co/elasticsearch/elasticsearch:${TAG}
|
||||
# container_name: elasticsearch
|
||||
# environment: ['http.host=0.0.0.0', 'transport.host=127.0.0.1', 'ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
|
||||
# ports: ['0.0.0.0:9200:9200']
|
||||
# networks: ['stack']
|
||||
# volumes:
|
||||
# - esdata:/usr/share/elasticsearch/data
|
||||
|
||||
kibana:
|
||||
image: docker.elastic.co/kibana/kibana:${TAG}
|
||||
container_name: kibana
|
||||
ports: ['0.0.0.0:5601:5601']
|
||||
networks: ['stack']
|
||||
depends_on: ['elasticsearch']
|
||||
# kibana:
|
||||
# image: docker.elastic.co/kibana/kibana:${TAG}
|
||||
# container_name: kibana
|
||||
# ports: ['0.0.0.0:5601:5601']
|
||||
# networks: ['stack']
|
||||
# depends_on: ['elasticsearch']
|
||||
|
||||
logstash:
|
||||
image: docker.elastic.co/logstash/logstash:${TAG}
|
||||
container_name: logstash
|
||||
volumes:
|
||||
- ./ELK.Docker/config/logstash.conf:/usr/share/logstash/pipeline/logstash.conf
|
||||
ports: ['0.0.0.0:31311:31311']
|
||||
# logstash:
|
||||
# image: docker.elastic.co/logstash/logstash:${TAG}
|
||||
# container_name: logstash
|
||||
# volumes:
|
||||
# - ./ELK.Docker/config/logstash.conf:/usr/share/logstash/pipeline/logstash.conf
|
||||
# ports: ['0.0.0.0:31311:31311']
|
||||
|
||||
networks: ['stack']
|
||||
depends_on: ['elasticsearch', 'setup_logstash']
|
||||
# networks: ['stack']
|
||||
# depends_on: ['elasticsearch', 'setup_logstash']
|
||||
|
||||
#filebeat:
|
||||
# image: docker.elastic.co/beats/filebeat:${TAG}
|
||||
|
@ -97,23 +97,23 @@ services:
|
|||
# depends_on: ['elasticsearch', 'setup_heartbeat']
|
||||
|
||||
# Run a short-lived container to set up Logstash.
|
||||
setup_logstash:
|
||||
image: centos:7
|
||||
container_name: setup_logstash
|
||||
volumes: ['./ELK.Docker/scripts/setup-logstash.sh:/usr/local/bin/setup-logstash.sh:ro']
|
||||
command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-logstash.sh | tr -d "\r" | bash']
|
||||
environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
|
||||
networks: ['stack']
|
||||
depends_on: ['elasticsearch']
|
||||
# setup_logstash:
|
||||
# image: centos:7
|
||||
# container_name: setup_logstash
|
||||
# volumes: ['./ELK.Docker/scripts/setup-logstash.sh:/usr/local/bin/setup-logstash.sh:ro']
|
||||
# command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-logstash.sh | tr -d "\r" | bash']
|
||||
# environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
|
||||
# networks: ['stack']
|
||||
# depends_on: ['elasticsearch']
|
||||
|
||||
setup_kibana:
|
||||
image: centos:7
|
||||
container_name: setup_kibana
|
||||
volumes: ['./ELK.Docker/scripts/setup-kibana.sh:/usr/local/bin/setup-kibana.sh:ro']
|
||||
command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-kibana.sh | tr -d "\r" | bash']
|
||||
environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
|
||||
networks: ['stack']
|
||||
depends_on: ['elasticsearch']
|
||||
# setup_kibana:
|
||||
# image: centos:7
|
||||
# container_name: setup_kibana
|
||||
# volumes: ['./ELK.Docker/scripts/setup-kibana.sh:/usr/local/bin/setup-kibana.sh:ro']
|
||||
# command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-kibana.sh | tr -d "\r" | bash']
|
||||
# environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
|
||||
# networks: ['stack']
|
||||
# depends_on: ['elasticsearch']
|
||||
|
||||
#setup_filebeat:
|
||||
# image: docker.elastic.co/beats/filebeat:${TAG}
|
||||
|
|
Loading…
Reference in New Issue