-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
371 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/fr/insee/knowledge/data/access/ServiceDataAccess.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package fr.insee.knowledge.data.access; | ||
|
||
|
||
import com.fasterxml.jackson.core.type.TypeReference; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import fr.insee.knowledge.domain.KnowledgeFile; | ||
import fr.insee.knowledge.domain.Service; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
@org.springframework.stereotype.Service | ||
public class ServiceDataAccess { | ||
|
||
public List<Service> serializeFromFile(KnowledgeFile resource) throws IOException { | ||
|
||
ObjectMapper objectMapper = new ObjectMapper(); | ||
List<Service> services; | ||
services = objectMapper.readValue(new File(resource.getPath()), new TypeReference<List<Service>>() {}); | ||
return services; | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package fr.insee.knowledge.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
|
||
import java.util.List; | ||
|
||
public class Function { | ||
|
||
@JsonProperty("label") | ||
public String label; | ||
@JsonProperty("utilisateurs") | ||
public String users; | ||
@JsonProperty("dispo") | ||
public int available; | ||
@JsonProperty("description") | ||
public String description; | ||
@JsonProperty("gsbpm") | ||
public String gsbpm; | ||
@JsonDeserialize(contentAs = Task.class) | ||
public List<Task> taches; | ||
@JsonProperty("produit") | ||
public String products; | ||
|
||
public String getLabel() { | ||
return label; | ||
} | ||
|
||
public void setLabel(String label) { | ||
this.label = label; | ||
} | ||
|
||
public String getUsers() { | ||
return users; | ||
} | ||
|
||
public void setUsers(String users) { | ||
this.users = users; | ||
} | ||
|
||
public int getAvailable() { | ||
return available; | ||
} | ||
|
||
public void setAvailable(int available) { | ||
this.available = available; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public String getGsbpm() { | ||
return gsbpm; | ||
} | ||
|
||
public void setGsbpm(String gsbpm) { | ||
this.gsbpm = gsbpm; | ||
} | ||
|
||
public List<Task> getTaches() { | ||
return taches; | ||
} | ||
|
||
public void setTaches(List<Task> taches) { | ||
this.taches = taches; | ||
} | ||
|
||
public String getProducts() { | ||
return products; | ||
} | ||
|
||
public void setProducts(String products) { | ||
this.products = products; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package fr.insee.knowledge.domain; | ||
|
||
import java.util.List; | ||
|
||
public class Gsbpm { | ||
|
||
private String id; | ||
private String label; | ||
private String description; | ||
private List<Gsbpm> children; | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
||
public String getLabel() { | ||
return label; | ||
} | ||
|
||
public void setLabel(String label) { | ||
this.label = label; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public List<Gsbpm> getChildren() { | ||
return children; | ||
} | ||
|
||
public void setChildren(List<Gsbpm> children) { | ||
this.children = children; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package fr.insee.knowledge.domain; | ||
|
||
import java.util.List; | ||
|
||
public class Product { | ||
|
||
private String name; | ||
private String description; | ||
private String mode; | ||
private String usage; | ||
private List<Product> relatedProducts; | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public String getMode() { | ||
return mode; | ||
} | ||
|
||
public void setMode(String mode) { | ||
this.mode = mode; | ||
} | ||
|
||
public String getUsage() { | ||
return usage; | ||
} | ||
|
||
public void setUsage(String usage) { | ||
this.usage = usage; | ||
} | ||
|
||
public List<Product> getRelatedProducts() { | ||
return relatedProducts; | ||
} | ||
|
||
public void setRelatedProducts(List<Product> relatedProducts) { | ||
this.relatedProducts = relatedProducts; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package fr.insee.knowledge.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
|
||
import java.util.List; | ||
|
||
public class Service { | ||
|
||
@JsonProperty("id") | ||
public String id; | ||
@JsonProperty("label") | ||
public String label; | ||
@JsonProperty("description") | ||
public String description; | ||
@JsonProperty("niveau") | ||
public int level; | ||
@JsonProperty("gsbpm") | ||
public String gsbpm; | ||
@JsonDeserialize(contentAs=Service.class) | ||
public List<Service> service; | ||
@JsonDeserialize(contentAs=Function.class) | ||
public List<Function> fonction; | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
||
public String getLabel() { | ||
return label; | ||
} | ||
|
||
public void setLabel(String label) { | ||
this.label = label; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public int getLevel() { | ||
return level; | ||
} | ||
|
||
public void setLevel(int level) { | ||
this.level = level; | ||
} | ||
|
||
public String getGsbpm() { | ||
return gsbpm; | ||
} | ||
|
||
public void setGsbpm(String gsbpm) { | ||
this.gsbpm = gsbpm; | ||
} | ||
|
||
public List<Service> getService() { | ||
return service; | ||
} | ||
|
||
public void setService(List<Service> service) { | ||
this.service = service; | ||
} | ||
|
||
public List<Function> getFonction() { | ||
return fonction; | ||
} | ||
|
||
public void setFonction(List<Function> fonction) { | ||
this.fonction = fonction; | ||
} | ||
} |
Oops, something went wrong.