adding mat-select components and logic to manage changes in facet
default relation
This commit is contained in:
parent
835a116b5e
commit
21a2e40495
|
@ -37,7 +37,7 @@
|
|||
"src/main/webapp/assets"
|
||||
],
|
||||
"styles": ["src/main/webapp/content/scss/vendor.scss", "src/main/webapp/content/scss/global.scss"],
|
||||
"scripts": [ "node_modules/jsonpath-plus/src/jsonpath.js"]
|
||||
"scripts": []
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
"bootstrap-icons": "^1.11.1",
|
||||
"cytoscape": "3.25.0",
|
||||
"dayjs": "1.11.5",
|
||||
"jsonpath-plus": "^8.1.0",
|
||||
"mat-select-filter": "^2.4.1",
|
||||
"material-icons-font": "^2.1.0",
|
||||
"mdb-angular-ui-kit": "^3.0.1",
|
||||
|
@ -17024,18 +17023,6 @@
|
|||
"node >= 0.2.0"
|
||||
]
|
||||
},
|
||||
"node_modules/jsonpath-plus": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-8.1.0.tgz",
|
||||
"integrity": "sha512-qVTiuKztFGw0dGhYi3WNqvddx3/SHtyDT0xJaeyz4uP0d1tkpG+0y5uYQ4OcIo1TLAz3PE/qDOW9F0uDt3+CTw==",
|
||||
"bin": {
|
||||
"jsonpath": "bin/jsonpath-cli.js",
|
||||
"jsonpath-plus": "bin/jsonpath-cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/jsprim": {
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz",
|
||||
|
@ -38645,11 +38632,6 @@
|
|||
"integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==",
|
||||
"dev": true
|
||||
},
|
||||
"jsonpath-plus": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-8.1.0.tgz",
|
||||
"integrity": "sha512-qVTiuKztFGw0dGhYi3WNqvddx3/SHtyDT0xJaeyz4uP0d1tkpG+0y5uYQ4OcIo1TLAz3PE/qDOW9F0uDt3+CTw=="
|
||||
},
|
||||
"jsprim": {
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz",
|
||||
|
|
|
@ -97,7 +97,6 @@
|
|||
"bootstrap-icons": "^1.11.1",
|
||||
"cytoscape": "3.25.0",
|
||||
"dayjs": "1.11.5",
|
||||
"jsonpath-plus": "^8.1.0",
|
||||
"mat-select-filter": "^2.4.1",
|
||||
"material-icons-font": "^2.1.0",
|
||||
"mdb-angular-ui-kit": "^3.0.1",
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.gcube.informationsystem.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
@ -37,6 +38,11 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.jayway.jsonpath.JsonPath;
|
||||
import com.nimbusds.jose.shaded.json.JSONUtil;
|
||||
|
||||
import net.minidev.json.JSONArray;
|
||||
|
||||
/**
|
||||
* Service class for managing InformationSystem resources.
|
||||
*/
|
||||
|
@ -154,100 +160,109 @@ public class InformationSystemService {
|
|||
ArrayList<FacetTypeDTO> facetTypes = new ArrayList<FacetTypeDTO>();
|
||||
//TODO: RIEMPI LE FACET
|
||||
for(LinkedEntity le: fcts) {
|
||||
/*
|
||||
log.debug("le.getRelation()..."+le.getRelation());
|
||||
log.debug("le.getTarget()..."+le.getTarget());
|
||||
log.debug("le.getDescription()..."+le.getDescription());
|
||||
log.debug("le.getMin()..."+le.getMin());
|
||||
log.debug("le.getMax()..."+le.getMax());
|
||||
*/
|
||||
FacetTypeDTO ftDto = new FacetTypeDTO(le.getRelation(),le.getTarget(),le.getDescription(),le.getMin(),le.getMax());
|
||||
facetTypes.add(new FacetTypeDTO(le.getRelation(),le.getTarget(),le.getDescription(),le.getMin(),le.getMax()));
|
||||
}
|
||||
dto.setFacetTypes(facetTypes);
|
||||
}
|
||||
return dto;
|
||||
}
|
||||
|
||||
/*
|
||||
//questa ritorna anche le facet figlie che possono essere usate nella select per il campo relation
|
||||
//in caso si parta da zero si sceglie ConsistsOf
|
||||
//String jsonResult = resourceRegistryClient.getType("IsIdentifiedBy", true);
|
||||
*/
|
||||
public String getResourceTypeJson(String typeName) throws Exception {
|
||||
String currentCtx = SecretManagerProvider.instance.get().getContext();
|
||||
ResourceRegistryClient resourceRegistryClient= ResourceRegistryClientFactory.create(currentCtx);
|
||||
String jsonResult = resourceRegistryClient.getType(typeName, true);
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
|
||||
//per i tipi di risorse come HostingNode, EService, ecc.
|
||||
public String getResourceTypeSpecs(String typeName) throws Exception {
|
||||
String currentCtx = SecretManagerProvider.instance.get().getContext();
|
||||
ResourceRegistryClient resourceRegistryClient= ResourceRegistryClientFactory.create(currentCtx);
|
||||
String jsonResult = resourceRegistryClient.getType(typeName, true);
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
public List<ContextDTO> getAllContexts() throws Exception {
|
||||
ArrayList<ContextDTO> res = new ArrayList<ContextDTO>();
|
||||
//log.debug("GetAllContext: [rootCtx=]",rootCtx);
|
||||
ResourceRegistryClient resourceRegistryClient= ResourceRegistryClientFactory.create();
|
||||
List<Context>contexts=resourceRegistryClient.getAllContext();
|
||||
for(Context ctx:contexts) {
|
||||
String pnt = " - "; //for the root
|
||||
//TODO: da dove tiro fuori il path?
|
||||
ContextDTO dto = new ContextDTO();
|
||||
dto.setId(ctx.getID().toString());
|
||||
dto.setName(ctx.getName());
|
||||
if(ctx.getParent()!=null) {
|
||||
if(ctx.getParent().getSource()!=null) {
|
||||
pnt = ctx.getParent().getSource().getName();
|
||||
}
|
||||
}
|
||||
dto.setParent(pnt);
|
||||
dto.setPath(extractPath(ctx));
|
||||
res.add(dto);
|
||||
public String[] getFacetRelationsOptions(String parentRelation) throws Exception {
|
||||
JSONArray res = new JSONArray();
|
||||
String tmp = this.getResourceTypeJson(parentRelation);
|
||||
try {
|
||||
res = JsonPath.parse(tmp).read("$[*].name");
|
||||
}catch(Exception e) {
|
||||
log.error(e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
log.debug("AllContexts: {}",contexts);
|
||||
return res;
|
||||
|
||||
return this.toStringArray(res);
|
||||
}
|
||||
|
||||
/*
|
||||
* per prendere tutti i tipi (albero a sin)
|
||||
*/
|
||||
public List<Type> getResourceTypes() throws Exception {
|
||||
|
||||
String currentCtx = SecretManagerProvider.instance.get().getContext();
|
||||
log.debug("getResourceTypes : [currentCtx=]",currentCtx);
|
||||
ResourceRegistryClient resourceRegistryClient= ResourceRegistryClientFactory.create(currentCtx);
|
||||
List<Type> types = resourceRegistryClient.getType(Resource.class, true);
|
||||
log.debug("getResourceTypes:",types);
|
||||
return types;
|
||||
|
||||
}
|
||||
|
||||
public ArrayList<ResourceTypeDTO> getResourceTypesTree() throws Exception {
|
||||
String currentCtx = SecretManagerProvider.instance.get().getContext();
|
||||
ResourceRegistryClient resourceRegistryClient= ResourceRegistryClientFactory.create(currentCtx);
|
||||
ModelKnowledge <Type, TypeInformation> modelKnowledge = resourceRegistryClient.getModelKnowledge();
|
||||
Type resourcesType = modelKnowledge.getTypeByName(AccessType.RESOURCE.getName());
|
||||
Tree<Type> typeTree = modelKnowledge.getTree(resourcesType.getAccessType());
|
||||
SimpleTreeMaker treeMaker = new SimpleTreeMaker();
|
||||
typeTree.elaborate(treeMaker);
|
||||
ArrayList<ResourceTypeDTO> orderedNodes = treeMaker.getNodeList();
|
||||
fatherIds = new ArrayList<>();
|
||||
for(ResourceTypeDTO node:orderedNodes) {
|
||||
//to set HostingNode as default type in the resources tree
|
||||
// if(node.getName().equals(Constants.RES_TYPE_HOSTINGNODE)) {
|
||||
// node.setIsSelected(true);
|
||||
// }
|
||||
if(!node.getChildren().isEmpty()) {
|
||||
fatherIds.add(node.getId());
|
||||
}
|
||||
}
|
||||
return cleanTree(orderedNodes);
|
||||
private String[] toStringArray(JSONArray jsonArray) {
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
String str = jsonArray.get(i).toString();
|
||||
list.add(str);
|
||||
}
|
||||
return list.toArray(new String[0]);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
//questa ritorna anche le facet figlie che possono essere usate nella select per il campo relation
|
||||
//in caso si parta da zero si sceglie ConsistsOf
|
||||
//String jsonResult = resourceRegistryClient.getType("IsIdentifiedBy", true);
|
||||
*/
|
||||
public String getResourceTypeJson(String typeName) throws Exception {
|
||||
String currentCtx = SecretManagerProvider.instance.get().getContext();
|
||||
ResourceRegistryClient resourceRegistryClient= ResourceRegistryClientFactory.create(currentCtx);
|
||||
String jsonResult = resourceRegistryClient.getType(typeName, true);
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
|
||||
public List<ContextDTO> getAllContexts() throws Exception {
|
||||
ArrayList<ContextDTO> res = new ArrayList<ContextDTO>();
|
||||
//log.debug("GetAllContext: [rootCtx=]",rootCtx);
|
||||
ResourceRegistryClient resourceRegistryClient= ResourceRegistryClientFactory.create();
|
||||
List<Context>contexts=resourceRegistryClient.getAllContext();
|
||||
for(Context ctx:contexts) {
|
||||
String pnt = " - "; //for the root
|
||||
//TODO: da dove tiro fuori il path?
|
||||
ContextDTO dto = new ContextDTO();
|
||||
dto.setId(ctx.getID().toString());
|
||||
dto.setName(ctx.getName());
|
||||
if(ctx.getParent()!=null) {
|
||||
if(ctx.getParent().getSource()!=null) {
|
||||
pnt = ctx.getParent().getSource().getName();
|
||||
}
|
||||
}
|
||||
dto.setParent(pnt);
|
||||
dto.setPath(extractPath(ctx));
|
||||
res.add(dto);
|
||||
}
|
||||
log.debug("AllContexts: {}",contexts);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* per prendere tutti i tipi (albero a sin)
|
||||
*/
|
||||
public List<Type> getResourceTypes() throws Exception {
|
||||
|
||||
String currentCtx = SecretManagerProvider.instance.get().getContext();
|
||||
log.debug("getResourceTypes : [currentCtx=]",currentCtx);
|
||||
ResourceRegistryClient resourceRegistryClient= ResourceRegistryClientFactory.create(currentCtx);
|
||||
List<Type> types = resourceRegistryClient.getType(Resource.class, true);
|
||||
log.debug("getResourceTypes:",types);
|
||||
return types;
|
||||
|
||||
}
|
||||
|
||||
public ArrayList<ResourceTypeDTO> getResourceTypesTree() throws Exception {
|
||||
String currentCtx = SecretManagerProvider.instance.get().getContext();
|
||||
ResourceRegistryClient resourceRegistryClient= ResourceRegistryClientFactory.create(currentCtx);
|
||||
ModelKnowledge <Type, TypeInformation> modelKnowledge = resourceRegistryClient.getModelKnowledge();
|
||||
Type resourcesType = modelKnowledge.getTypeByName(AccessType.RESOURCE.getName());
|
||||
Tree<Type> typeTree = modelKnowledge.getTree(resourcesType.getAccessType());
|
||||
SimpleTreeMaker treeMaker = new SimpleTreeMaker();
|
||||
typeTree.elaborate(treeMaker);
|
||||
ArrayList<ResourceTypeDTO> orderedNodes = treeMaker.getNodeList();
|
||||
fatherIds = new ArrayList<>();
|
||||
for(ResourceTypeDTO node:orderedNodes) {
|
||||
//to set HostingNode as default type in the resources tree
|
||||
// if(node.getName().equals(Constants.RES_TYPE_HOSTINGNODE)) {
|
||||
// node.setIsSelected(true);
|
||||
// }
|
||||
if(!node.getChildren().isEmpty()) {
|
||||
fatherIds.add(node.getId());
|
||||
}
|
||||
}
|
||||
return cleanTree(orderedNodes);
|
||||
}
|
||||
|
||||
|
||||
private ArrayList<ResourceTypeDTO> cleanTree(ArrayList<ResourceTypeDTO> ordered) {
|
||||
|
|
|
@ -8,6 +8,7 @@ public class FacetPropGui {
|
|||
private String name;
|
||||
private String value;
|
||||
private ArrayList<ValidationObjDTO> validations;
|
||||
|
||||
|
||||
private String pattern;
|
||||
public String getPattern() {
|
||||
|
|
|
@ -28,6 +28,8 @@ public class FacetSpecDTO {
|
|||
private String description; //descrizione della facet
|
||||
private ArrayList<FacetPropertyDTO> properties;
|
||||
private ArrayList<FacetPropGui> guiProps; //per costruire le GUI
|
||||
|
||||
|
||||
public ArrayList<FacetPropGui> getGuiProps() {
|
||||
return guiProps;
|
||||
}
|
||||
|
@ -41,7 +43,16 @@ public class FacetSpecDTO {
|
|||
this.properties = properties;
|
||||
}
|
||||
//questi campi sono presi dalla descrizione del tipo di risorsa (ad es. HostingNode)
|
||||
private String relation;
|
||||
private String[] relationOptions;
|
||||
|
||||
public String[] getRelationOptions() {
|
||||
return relationOptions;
|
||||
}
|
||||
public void setRelationOptions(String[] relationOptions) {
|
||||
this.relationOptions = relationOptions;
|
||||
}
|
||||
|
||||
private String relation;
|
||||
public String getRelation() {
|
||||
return relation;
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ public class FacetTypeDTO {
|
|||
this.relation = relation;
|
||||
this.target = target;
|
||||
this.description = description;
|
||||
this.relation = relation;
|
||||
this.min = min;
|
||||
if(max==null) {
|
||||
//prefer to avoid null in a field (MEANS MAX>1)
|
||||
|
@ -26,7 +27,15 @@ public class FacetTypeDTO {
|
|||
private String description;
|
||||
private Integer min;
|
||||
private Integer max;
|
||||
|
||||
|
||||
private String[] relationOptions;
|
||||
|
||||
public String[] getRelationOptions() {
|
||||
return relationOptions;
|
||||
}
|
||||
public void setRelationOptions(String[] relationOptions) {
|
||||
this.relationOptions = relationOptions;
|
||||
}
|
||||
|
||||
public String getRelation() {
|
||||
return relation;
|
||||
|
|
|
@ -33,7 +33,10 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.util.UriUtils;
|
||||
|
||||
import com.jayway.jsonpath.JsonPath;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.minidev.json.JSONArray;
|
||||
import tech.jhipster.web.util.HeaderUtil;
|
||||
|
||||
|
||||
|
@ -149,6 +152,7 @@ public class InformationSystemResource {
|
|||
fs.setMax(ft.getMax());
|
||||
fs.setMin(ft.getMin());
|
||||
fs.setRelation(ft.getRelation());
|
||||
fs.setRelationOptions(informationSystemService.getFacetRelationsOptions(ft.getRelation()));
|
||||
facetSpecs.add(fs);
|
||||
}
|
||||
builderDto.setFacetSpecs(facetSpecs);
|
||||
|
@ -165,7 +169,7 @@ public class InformationSystemResource {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/resourcetypejson")
|
||||
// e.g. http://localhost:8081/api/is/resourcetype?typeName=HostingNode
|
||||
|
|
|
@ -1,209 +0,0 @@
|
|||
# ===================================================================
|
||||
# Spring Boot configuration.
|
||||
#
|
||||
# This configuration will be overridden by the Spring profile you use,
|
||||
# for example application-dev.yml if you use the "dev" profile.
|
||||
#
|
||||
# More information on profiles: https://www.jhipster.tech/profiles/
|
||||
# More information on configuration properties: https://www.jhipster.tech/common-application-properties/
|
||||
# ===================================================================
|
||||
|
||||
# ===================================================================
|
||||
# Standard Spring Boot properties.
|
||||
# Full reference is available at:
|
||||
# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
|
||||
# ===================================================================
|
||||
|
||||
---
|
||||
# Conditionally disable springdoc on missing api-docs profile
|
||||
spring:
|
||||
config:
|
||||
activate:
|
||||
on-profile: '!api-docs'
|
||||
springdoc:
|
||||
api-docs:
|
||||
enabled: false
|
||||
---
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
base-path: /management
|
||||
exposure:
|
||||
include:
|
||||
['configprops', 'env', 'health', 'info', 'jhimetrics', 'jhiopenapigroups', 'logfile', 'loggers', 'prometheus', 'threaddump']
|
||||
endpoint:
|
||||
health:
|
||||
show-details: when-authorized
|
||||
roles: 'ROLE_ADMIN'
|
||||
probes:
|
||||
enabled: true
|
||||
group:
|
||||
liveness:
|
||||
include: livenessState
|
||||
readiness:
|
||||
include: readinessState
|
||||
jhimetrics:
|
||||
enabled: true
|
||||
info:
|
||||
git:
|
||||
mode: full
|
||||
env:
|
||||
enabled: true
|
||||
health:
|
||||
mail:
|
||||
enabled: false # When using the MailService, configure an SMTP server and set this to true
|
||||
metrics:
|
||||
export:
|
||||
# Prometheus is the default metrics backend
|
||||
prometheus:
|
||||
enabled: true
|
||||
step: 60
|
||||
enable:
|
||||
http: true
|
||||
jvm: true
|
||||
logback: true
|
||||
process: true
|
||||
system: true
|
||||
distribution:
|
||||
percentiles-histogram:
|
||||
all: true
|
||||
percentiles:
|
||||
all: 0, 0.5, 0.75, 0.95, 0.99, 1.0
|
||||
tags:
|
||||
application: ${spring.application.name}
|
||||
web:
|
||||
server:
|
||||
request:
|
||||
autotime:
|
||||
enabled: true
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: information-system-gui
|
||||
profiles:
|
||||
# The commented value for `active` can be replaced with valid Spring profiles to load.
|
||||
# Otherwise, it will be filled in by maven when building the JAR file
|
||||
# Either way, it can be overridden by `--spring.profiles.active` value passed in the commandline or `-Dspring.profiles.active` set in `JAVA_OPTS`
|
||||
active: #spring.profiles.active#
|
||||
group:
|
||||
dev:
|
||||
- dev
|
||||
- api-docs
|
||||
# Uncomment to activate TLS for the dev profile
|
||||
#- tls
|
||||
jmx:
|
||||
enabled: false
|
||||
messages:
|
||||
basename: i18n/messages
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
mvc:
|
||||
pathmatch:
|
||||
matching-strategy: ant-path-matcher
|
||||
task:
|
||||
execution:
|
||||
thread-name-prefix: information-system-gui-task-
|
||||
pool:
|
||||
core-size: 2
|
||||
max-size: 50
|
||||
queue-capacity: 10000
|
||||
scheduling:
|
||||
thread-name-prefix: information-system-gui-scheduling-
|
||||
pool:
|
||||
size: 2
|
||||
thymeleaf:
|
||||
mode: HTML
|
||||
output:
|
||||
ansi:
|
||||
enabled: always
|
||||
security:
|
||||
oauth2:
|
||||
#resourceserver:
|
||||
# jwt:
|
||||
# issuer-uri: http://localhost:8083/auth/realms/baeldung
|
||||
# jwk-set-uri: http://localhost:8083/auth/realms/baeldung/protocol/openid-connect/certs
|
||||
client:
|
||||
provider:
|
||||
oidc:
|
||||
issuer-uri: https://accounts.dev.d4science.org/auth/realms/d4science
|
||||
authorization-uri: https://accounts.dev.d4science.org/auth/realms/d4science/protocol/openid-connect/auth
|
||||
token-uri: https://accounts.dev.d4science.org/auth/realms/d4science/protocol/openid-connect/token
|
||||
user-info-uri: https://accounts.dev.d4science.org/auth/realms/d4science/protocol/openid-connect/userinfo
|
||||
jwk-set-uri: https://accounts.dev.d4science.org/auth/realms/d4science/protocol/openid-connect/certs
|
||||
registration:
|
||||
oidc:
|
||||
client-id: pc-paratore.isti.cnr.it
|
||||
client-secret: LlyFPtjlHdv95PQ3wb7rYp0PVVDK2fNj
|
||||
scope: openid, profile, email, phone, offline_access # last one for refresh tokens
|
||||
#authorization-grant-type: urn:ietf:params:oauth:grant-type:jwt-bearer
|
||||
#redirect-uri: '{baseUrl}/code/{registrationId}'
|
||||
#redirect-uri: '{baseUrl}/login/oauth2/code/{registrationId}'
|
||||
server:
|
||||
servlet:
|
||||
session:
|
||||
cookie:
|
||||
http-only: true
|
||||
#forward-headers-strategy: native
|
||||
#forward-headers-strategy: true
|
||||
#tomcat:
|
||||
# use-relative-redirects: true
|
||||
# protocol-header: x-forwarded-proto
|
||||
# remote-ip-header: x-forwarded-for
|
||||
|
||||
springdoc:
|
||||
show-actuator: true
|
||||
|
||||
# Properties to be exposed on the /info management endpoint
|
||||
info:
|
||||
# Comma separated list of profiles that will trigger the ribbon to show
|
||||
display-ribbon-on-profiles: 'dev'
|
||||
|
||||
# ===================================================================
|
||||
# JHipster specific properties
|
||||
#
|
||||
# Full reference is available at: https://www.jhipster.tech/common-application-properties/
|
||||
# ===================================================================
|
||||
|
||||
jhipster:
|
||||
clientApp:
|
||||
name: 'InformationSystemGUIApp'
|
||||
#cors:
|
||||
# allowed-origins: "http://accounts.dev.d4science.org,http://localhost:8080,http://127.0.0.1:8080"
|
||||
# By default CORS is disabled. Uncomment to enable.
|
||||
# cors:
|
||||
# allowed-origins: "http://localhost:8100,http://localhost:9000"
|
||||
# allowed-methods: "*"
|
||||
# allowed-headers: "*"
|
||||
# exposed-headers: "Authorization,Link,X-Total-Count,X-${jhipster.clientApp.name}-alert,X-${jhipster.clientApp.name}-error,X-${jhipster.clientApp.name}-params"
|
||||
# allow-credentials: true
|
||||
# max-age: 1800
|
||||
mail:
|
||||
from: information-system-gui@localhost
|
||||
api-docs:
|
||||
default-include-pattern: ${server.servlet.context-path:}/api/**
|
||||
management-include-pattern: ${server.servlet.context-path:}/management/**
|
||||
title: IS Monitor API
|
||||
description: IS Monitor API documentation
|
||||
version: 1.0.0
|
||||
terms-of-service-url:
|
||||
contact-name:
|
||||
contact-url:
|
||||
contact-email:
|
||||
license: unlicensed
|
||||
license-url:
|
||||
security:
|
||||
content-security-policy: "default-src 'self'; frame-src 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://storage.googleapis.com; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:"
|
||||
oauth2:
|
||||
audience:
|
||||
- account
|
||||
- api://default
|
||||
# ===================================================================
|
||||
# Application specific properties
|
||||
# Add your own application properties here, see the ApplicationProperties class
|
||||
# to have type-safe configuration, like in the JHipsterProperties above
|
||||
#
|
||||
# More documentation is available at:
|
||||
# https://www.jhipster.tech/common-application-properties/
|
||||
# ===================================================================
|
||||
|
||||
# application:
|
|
@ -33,12 +33,13 @@
|
|||
<!--TODO: trasforma in una select-->
|
||||
<mat-label for="relation">relation</mat-label>
|
||||
<input matInput formControlName="relation" id="relation" type="text" value="{{typeSpec.facetSpecs[ind].relation}}"/>
|
||||
<!--
|
||||
<mat-select placeholder="relation" formControlName="relation">
|
||||
<mat-option *ngFor="let item of relationOptions(typeSpec.facetSpecs[ind].relation)" [value]="item">
|
||||
</mat-option>
|
||||
|
||||
<mat-select formControlName="relation">
|
||||
<mat-option *ngFor="let item of typeSpec.facetSpecs[ind].relationOptions" [value]="item">
|
||||
{{item}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
-->
|
||||
|
||||
</mat-form-field>
|
||||
<!--
|
||||
<mat-form-field id="pathfield" [style.width.px]="200" class="form-field">
|
||||
|
|
|
@ -13,7 +13,8 @@ import { MatButtonModule } from '@angular/material/button';
|
|||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatExpansionModule } from '@angular/material/expansion';
|
||||
import { IFacetComposer, IFacetProps } from './i-facet-composer';
|
||||
import {JSONPath} from 'jsonpath-plus'
|
||||
import { SharedModule } from 'app/shared/shared.module';
|
||||
import { MatSelectFilterModule } from 'mat-select-filter';
|
||||
|
||||
|
||||
|
||||
|
@ -22,9 +23,9 @@ import {JSONPath} from 'jsonpath-plus'
|
|||
selector: 'jhi-facet-composer',
|
||||
templateUrl: './facet-composer.component.html',
|
||||
styleUrls: ['./facet-composer.component.scss'],
|
||||
imports:[CommonModule,MatFormFieldModule,
|
||||
imports:[CommonModule,MatFormFieldModule,SharedModule,
|
||||
ReactiveFormsModule,MatButtonModule,
|
||||
MatDialogModule,MatInputModule,MatExpansionModule],
|
||||
MatDialogModule,MatInputModule,MatExpansionModule,MatSelectFilterModule],
|
||||
providers: [FacetComposerService]
|
||||
})
|
||||
|
||||
|
@ -36,6 +37,7 @@ export class FacetComposerComponent implements OnInit {
|
|||
myForm: FormGroup; //form complessiva
|
||||
|
||||
typeSpec: ITypeSpecification;
|
||||
// relationOptions: string[]|undefined;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/member-ordering
|
||||
constructor(private guiService: FacetComposerService, private fb: FormBuilder,
|
||||
|
@ -66,24 +68,18 @@ export class FacetComposerComponent implements OnInit {
|
|||
this.typeSpec = res;
|
||||
this.createForm(res);
|
||||
});
|
||||
this.relationOptions('ConsistsOf');
|
||||
}
|
||||
|
||||
|
||||
relationOptions(relationName:string): void{
|
||||
let options : string[];
|
||||
/*
|
||||
relationOptions(relationName:string): string[]{
|
||||
let options: string[]=[];
|
||||
this.guiService.getRelationOptions(this.titlePath, relationName).subscribe(res => {
|
||||
/*
|
||||
this.City = values.json() as string[];
|
||||
this.var1 = this.City[0];
|
||||
this.var2 = this.City[1];
|
||||
*/
|
||||
const result = JSONPath({path: '$[*].name', json: res});
|
||||
console.debug('******* OGGETTI *******');
|
||||
console.debug(result);
|
||||
console.debug('******* ******* *******');
|
||||
options = JSONPath({path: '$[*].name', json: res});
|
||||
})
|
||||
}
|
||||
return options;
|
||||
}*/
|
||||
|
||||
|
||||
//TODO: NOTA BENE--> FormGroup->access by NAME, FormArray->access by INDEX!!
|
||||
createForm(facetData:ITypeSpecification):void{
|
||||
|
@ -140,6 +136,7 @@ export class FacetComposerComponent implements OnInit {
|
|||
//const relationFc = new FormControl('relation',Validators.required);
|
||||
const relationFc = this.fb.control(item.relation,Validators.required);
|
||||
facetFg.addControl('relation', relationFc);
|
||||
|
||||
//1. creo formArray con le properties
|
||||
const propertiesFa = this.createPropertyArray(item.guiProps);
|
||||
//2. aggiungo formarray delle properties ai controls per la facet
|
||||
|
|
|
@ -4,6 +4,8 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
|||
import { ApplicationConfigService } from 'app/core/config/application-config.service';
|
||||
import { IFacetComposer } from './i-facet-composer';
|
||||
|
||||
|
||||
|
||||
export interface ITypeSpecification{
|
||||
name:string, //nome tipo
|
||||
description:string; //descrizione tipo
|
||||
|
|
|
@ -2,6 +2,7 @@ export interface IFacetComposer {
|
|||
name:string //facet name (name)
|
||||
description:string //facet description (textarea)
|
||||
relation:string
|
||||
relationOptions: string[]
|
||||
min:number
|
||||
max:number
|
||||
guiProps:IFacetProps[]
|
||||
|
@ -15,7 +16,7 @@ export interface IFacetProps {
|
|||
value: string;
|
||||
pattern: string;
|
||||
propDescription: string;
|
||||
validations: IValidation[]
|
||||
validations: IValidation[];
|
||||
}
|
||||
|
||||
export interface IValidation {
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
import { HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FacetBuilderService {
|
||||
|
||||
httpOptions = {
|
||||
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
|
||||
}
|
||||
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ApplicationConfigService } from 'app/core/config/application-config.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
|
||||
export class RestypesService {
|
||||
httpOptions = {
|
||||
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
|
||||
};
|
||||
|
||||
constructor(private http: HttpClient, private applicationConfigService: ApplicationConfigService){ }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,312 +0,0 @@
|
|||
[
|
||||
{
|
||||
"serviceType": "EService",
|
||||
"facets": [
|
||||
{
|
||||
"facetName": "SoftwareFacet",
|
||||
"relation": "IsIdentifiedBy",
|
||||
"notNull": "true",
|
||||
"unique": "true",
|
||||
"properties": [
|
||||
{
|
||||
"name": "qualifier",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "optional",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "version",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "group",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"facetName": "SoftwareFacet",
|
||||
"relation": "ConsistsOf",
|
||||
"notNull": "false",
|
||||
"unique": "false",
|
||||
"properties": [
|
||||
{
|
||||
"name": "qualifier",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "optional",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "version",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "group",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"facetName": "AccessPointFacet",
|
||||
"relation": "ConsistsOf",
|
||||
"notNull": "true",
|
||||
"unique": "false",
|
||||
"properties": [
|
||||
{
|
||||
"name": "endpoint",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "protocol",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "entryName",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"facetName": "EventFacet",
|
||||
"relation": "ConsistsOf",
|
||||
"notNull": "true",
|
||||
"unique": "false",
|
||||
"properties": [
|
||||
{
|
||||
"name": "date",
|
||||
"type": "date"
|
||||
},
|
||||
{
|
||||
"name": "event",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"facetName": "StateFacet",
|
||||
"relation": "ConsistsOf",
|
||||
"notNull": "true",
|
||||
"unique": "true",
|
||||
"properties": [
|
||||
{
|
||||
"name": "date",
|
||||
"type": "date"
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"facetName": "LicenseFacet",
|
||||
"relation": "ConsistsOf",
|
||||
"notNull": "false",
|
||||
"unique": "false",
|
||||
"properties": [
|
||||
{
|
||||
"name": "textURL",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"serviceType": "HostingNode",
|
||||
"facets": [
|
||||
{
|
||||
"facetName": "NetworkingFacet",
|
||||
"relation": "IsIdentifiedBy",
|
||||
"notNull": "true",
|
||||
"unique": "true",
|
||||
"properties": [
|
||||
{
|
||||
"name": "hostName",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "domainName",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "Port",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "IPAddress",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "mask",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "broadcastAddress",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"facetName": "CPUFacet",
|
||||
"relation": "ConsistsOf",
|
||||
"notNull": "true",
|
||||
"unique": "false",
|
||||
"properties": [
|
||||
{
|
||||
"name": "model",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "vendor",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "clockSpeed",
|
||||
"type": "number"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"facetName": "MemoryFacet",
|
||||
"relation": "HasPersistentMemory",
|
||||
"notNull": "true",
|
||||
"unique": "false",
|
||||
"properties": [
|
||||
{
|
||||
"name": "used",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "unit",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "size",
|
||||
"type": "number"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"facetName": "EventFacet",
|
||||
"relation": "ConsistsOf",
|
||||
"notNull": "true",
|
||||
"unique": "false",
|
||||
"properties": [
|
||||
{
|
||||
"name": "event",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "date",
|
||||
"type": "date"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"facetName": "StateFacet",
|
||||
"relation": "ConsistsOf",
|
||||
"notNull": "true",
|
||||
"unique": "true",
|
||||
"properties": [
|
||||
{
|
||||
"name": "value",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"facetName": "SimplePropertyFacet",
|
||||
"relation": "ConsistsOf",
|
||||
"notNull": "false",
|
||||
"unique": "false",
|
||||
"properties": [
|
||||
{
|
||||
"name": "value",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"facetName": "SimplePropertyFacet",
|
||||
"relation": "ConsistsOf",
|
||||
"notNull": "false",
|
||||
"unique": "false",
|
||||
"properties": [
|
||||
{
|
||||
"name": "value",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"facetName": "SoftwareFacet",
|
||||
"relation": "ConsistsOf",
|
||||
"notNull": "false",
|
||||
"unique": "false",
|
||||
"properties": [
|
||||
{
|
||||
"name": "optional",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "group",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "qualifier",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "version",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
Loading…
Reference in New Issue