graph
This commit is contained in:
parent
66437371fc
commit
4a44920db4
|
@ -28,6 +28,7 @@ import eu.dnetlib.domain.wfs.WfSection;
|
|||
import eu.dnetlib.domain.wfs.WfSubscription;
|
||||
import eu.dnetlib.domain.wfs.WfTemplate;
|
||||
import eu.dnetlib.domain.wfs.WfTemplate.Node;
|
||||
import eu.dnetlib.domain.wfs.WfTemplateDesc;
|
||||
import eu.dnetlib.domain.wfs.WorkflowsConstants;
|
||||
import eu.dnetlib.domain.wfs.jobs.WfJournalEntry;
|
||||
import eu.dnetlib.domain.wfs.jobs.WfRunningJob;
|
||||
|
@ -161,8 +162,8 @@ public class ApiController extends DnetRestController {
|
|||
}
|
||||
|
||||
@GetMapping("/template/{id}")
|
||||
public WfTemplate findWfTemplate(@PathVariable final String id) {
|
||||
return this.wfManagerService.findWfTemplate(id);
|
||||
public WfTemplateDesc findWfTemplate(@PathVariable final String id) {
|
||||
return this.wfManagerService.findWfTemplateDesc(id);
|
||||
}
|
||||
|
||||
@GetMapping("/confs/byApi/{id}")
|
||||
|
|
|
@ -18,6 +18,7 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import eu.dnetlib.common.clients.DnetServiceClientFactory;
|
||||
import eu.dnetlib.common.clients.SimpleResourceClient;
|
||||
import eu.dnetlib.domain.resource.SimpleResource;
|
||||
import eu.dnetlib.domain.wfs.WfConfiguration;
|
||||
import eu.dnetlib.domain.wfs.WfRepoHiDesc;
|
||||
import eu.dnetlib.domain.wfs.WfSection;
|
||||
|
@ -25,6 +26,7 @@ import eu.dnetlib.domain.wfs.WfSubscription;
|
|||
import eu.dnetlib.domain.wfs.WfTemplate;
|
||||
import eu.dnetlib.domain.wfs.WfTemplate.Node;
|
||||
import eu.dnetlib.domain.wfs.WfTemplate.WfParam;
|
||||
import eu.dnetlib.domain.wfs.WfTemplateDesc;
|
||||
import eu.dnetlib.domain.wfs.WorkflowsConstants;
|
||||
import eu.dnetlib.domain.wfs.jobs.JobStatus;
|
||||
import eu.dnetlib.domain.wfs.jobs.WfJournalEntry;
|
||||
|
@ -86,7 +88,9 @@ public class WorkflowManagerService {
|
|||
conf.setId("wfconf-" + UUID.randomUUID());
|
||||
}
|
||||
|
||||
final List<WfParam> wfParams = findWfTemplate(conf.getWorkflow()).getParameters();
|
||||
final List<WfParam> wfParams = this.clientFactory.getClient(SimpleResourceClient.class)
|
||||
.findResourceContent(WorkflowsConstants.WF_TEMPLATE, conf.getWorkflow(), WfTemplate.class)
|
||||
.getParameters();
|
||||
|
||||
conf.setConfigured(WfConfigurationUtils.isConfigured(wfParams, conf));
|
||||
|
||||
|
@ -95,8 +99,20 @@ public class WorkflowManagerService {
|
|||
return conf;
|
||||
}
|
||||
|
||||
public WfTemplate findWfTemplate(final String name) {
|
||||
return this.clientFactory.getClient(SimpleResourceClient.class).findResourceContent(WorkflowsConstants.WF_TEMPLATE, name, WfTemplate.class);
|
||||
public WfTemplateDesc findWfTemplateDesc(final String name) {
|
||||
final SimpleResourceClient client = this.clientFactory.getClient(SimpleResourceClient.class);
|
||||
final SimpleResource metadata = client.findResource(WorkflowsConstants.WF_TEMPLATE, name);
|
||||
final WfTemplate tmpl = client.findResourceContent(WorkflowsConstants.WF_TEMPLATE, name, WfTemplate.class);
|
||||
|
||||
final WfTemplateDesc res = new WfTemplateDesc();
|
||||
res.setId(metadata.getName());
|
||||
res.setName(metadata.getName());
|
||||
res.setDescription(metadata.getDescription());
|
||||
res.setGraph(tmpl.getGraph());
|
||||
res.setParameters(tmpl.getParameters());
|
||||
res.setInfo(tmpl.getInfo());
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public String findWfTemplateId(final String name) {
|
||||
|
|
|
@ -177,6 +177,9 @@
|
|||
<mat-icon fontIcon="edit"></mat-icon>
|
||||
config
|
||||
</button>
|
||||
<button mat-stroked-button (click)="showGraphModal(wf)">
|
||||
<mat-icon fontIcon="polyline"></mat-icon> graph
|
||||
</button>
|
||||
<button mat-stroked-button color="warn" (click)="destroyWfConf(wf.id)">
|
||||
<mat-icon fontIcon="delete"></mat-icon>
|
||||
delete
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Page, DsmConf, KeyValue, BrowseTerm, SimpleDatasource, WfRepoHi, WfConf, WfHistoryEntry } from '../common/is.model';
|
||||
import { Page, DsmConf, KeyValue, BrowseTerm, SimpleDatasource, WfRepoHi, WfConf, WfHistoryEntry, WfTemplateDesc } from '../common/is.model';
|
||||
import { ISClient } from '../common/is.client';
|
||||
|
||||
@Injectable({
|
||||
|
@ -45,6 +45,10 @@ export class DsmClient extends ISClient {
|
|||
this.httpGet<WfRepoHi>('/proxy/byType/wf_manager/api/repo-his', onSuccess);
|
||||
}
|
||||
|
||||
dsmGetWfTemplate(id: string, onSuccess: Function) {
|
||||
this.httpGet<WfTemplateDesc>('/proxy/byType/wf_manager/api/template/' + encodeURIComponent(id), onSuccess);
|
||||
}
|
||||
|
||||
dsmRepoHiWf(wfId: string, dsId: string, dsName: string, apiId: string, onSuccess: Function) {
|
||||
let params = { 'dsId': dsId, 'dsName': dsName, 'apiId': apiId };
|
||||
this.httpPost('/proxy/byType/wf_manager/api/repo-hi/' + encodeURIComponent(wfId) + '/start', params, onSuccess);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Component, Inject, Injectable, OnInit, ViewChild } from '@angular/core';
|
||||
import { Page, BrowseTerm, SimpleDatasource, KeyValue, DsmConf, ProtocolParam, Api, ApiInsert, WfRepoHi, WfTemplate, WfConf, WfHistoryEntry } from '../common/is.model';
|
||||
import { Page, BrowseTerm, SimpleDatasource, KeyValue, DsmConf, ProtocolParam, Api, ApiInsert, WfRepoHi, WfTemplate, WfConf, WfHistoryEntry, WfTemplateDesc } from '../common/is.model';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
import { MatDialog, MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { MatTableDataSource } from '@angular/material/table';
|
||||
|
@ -231,6 +231,11 @@ export class DsmApiComponent implements OnInit {
|
|||
});
|
||||
dialogRef.afterClosed().subscribe(result => this.reloadWfs());
|
||||
}
|
||||
|
||||
showGraphModal(conf: WfConf): void {
|
||||
this.client.dsmGetWfTemplate(conf.workflow, (data: WfTemplateDesc) => this.dialog.open(WfTemplateDialog, { data: data, width: '80%' }));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Component({
|
||||
|
|
|
@ -4,42 +4,15 @@ import java.io.Serializable;
|
|||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class WfRepoHiDesc extends WfTemplate implements Serializable {
|
||||
public class WfRepoHiDesc extends WfTemplateDesc implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5192964707849869720L;
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private String description;
|
||||
private Set<String> expectedEoscDsTypes = new HashSet<>();
|
||||
private Set<String> expectedCompliances = new HashSet<>();
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(final String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(final String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Set<String> getExpectedEoscDsTypes() {
|
||||
return expectedEoscDsTypes;
|
||||
return this.expectedEoscDsTypes;
|
||||
}
|
||||
|
||||
public void setExpectedEoscDsTypes(final Set<String> expectedEoscDsTypes) {
|
||||
|
@ -47,7 +20,7 @@ public class WfRepoHiDesc extends WfTemplate implements Serializable {
|
|||
}
|
||||
|
||||
public Set<String> getExpectedCompliances() {
|
||||
return expectedCompliances;
|
||||
return this.expectedCompliances;
|
||||
}
|
||||
|
||||
public void setExpectedCompliances(final Set<String> expectedCompliances) {
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
package eu.dnetlib.domain.wfs;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class WfTemplateDesc extends WfTemplate implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -7651246011953954481L;
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private String description;
|
||||
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(final String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
public void setDescription(final String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue