Skip to content

Commit c0526d5

Browse files
committed
change version
1 parent cb20dc0 commit c0526d5

File tree

5 files changed

+113
-54
lines changed

5 files changed

+113
-54
lines changed

pom.xml

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<!-- definition -->
88
<groupId>org.modelio.module</groupId>
99
<artifactId>intocps</artifactId>
10-
<version>1.7.00</version>
10+
<version>1.5.00</version>
1111

1212

1313
<name>INTOCPS</name>
@@ -23,8 +23,14 @@
2323
<id>jgit-repository</id>
2424
<url>https://repo.eclipse.org/content/groups/releases/</url>
2525
</repository>
26+
27+
<repository>
28+
<id>central</id>
29+
<url>https://repo1.maven.org/maven2/</url>
30+
</repository>
2631
</repositories>
2732

33+
2834
<pluginRepositories>
2935
<pluginRepository>
3036
<id>modelio-plugins</id>
@@ -70,19 +76,37 @@
7076
<dependency>
7177
<groupId>com.fasterxml.jackson.core</groupId>
7278
<artifactId>jackson-core</artifactId>
73-
<version>2.8.7</version>
79+
<version>2.12.7</version>
7480
</dependency>
81+
82+
<!-- <dependency>
83+
<groupId>javax.xml.bind</groupId>
84+
<artifactId>jaxb-api</artifactId>
85+
<version>2.3.1</version>
86+
</dependency>-->
87+
88+
<dependency>
89+
<groupId>com.sun.xml.bind</groupId>
90+
<artifactId>jaxb-impl</artifactId>
91+
<version>2.3.4</version>
92+
</dependency>
93+
94+
<dependency>
95+
<groupId>jakarta.xml.bind</groupId>
96+
<artifactId>jakarta.xml.bind-api</artifactId>
97+
<version>2.3.3</version>
98+
</dependency>
7599

76100
<dependency>
77101
<groupId>com.fasterxml.jackson.core</groupId>
78102
<artifactId>jackson-databind</artifactId>
79-
<version>2.8.7</version>
103+
<version>2.12.7</version>
80104
</dependency>
81105

82106
<dependency>
83107
<groupId>com.fasterxml.jackson.core</groupId>
84108
<artifactId>jackson-annotations</artifactId>
85-
<version>2.8.7</version>
109+
<version>2.12.7</version>
86110
</dependency>
87111

88112
<dependency>
@@ -93,7 +117,7 @@
93117
<dependency>
94118
<groupId>org.eclipse.jgit</groupId>
95119
<artifactId>org.eclipse.jgit</artifactId>
96-
<version>4.5.0.201609210915-r</version>
120+
<version>6.6.1.202309021850-r</version>
97121
</dependency>
98122
<dependency>
99123
<groupId>com.github.fge</groupId>
@@ -145,11 +169,13 @@
145169
<artifactId>rhino</artifactId>
146170
<version>1.7R4</version>
147171
</dependency>
148-
<dependency>
149-
<groupId>javax.xml.bind</groupId>
150-
<artifactId>jaxb-api</artifactId>
151-
<version>2.3.0</version>
172+
173+
<dependency>
174+
<groupId>org.apache.httpcomponents</groupId>
175+
<artifactId>httpclient</artifactId>
176+
<version>4.3.3</version>
152177
</dependency>
178+
153179
</dependencies>
154180

155181

src/main/conf/module.xml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,23 @@
55
<PathEntry path="lib/org.eclipse.jgit-4.5.0.201609210915-r.jar"/>
66
<PathEntry path="lib/modelermodule-8.5.14.jar"/>
77
<PathEntry path="lib/session-3.7.1.jar"/>
8+
<PathEntry path="lib/jsch-0.1.53.jar"/>
9+
<PathEntry path="lib/org.eclipse.jgit-6.6.1.202309021850-r.jar"/>
10+
<PathEntry path="lib/jaxb-api-2.3.1.jar"/>
811
<PathEntry path="lib/sysmlarchitect-5.0.00.jar"/>
912
<PathEntry path="lib/json-schema-validator-2.2.6.jar"/>
1013
<PathEntry path="lib/jsr305-3.0.0.jar"/>
1114
<PathEntry path="lib/jopt-simple-4.6.jar"/>
1215
<PathEntry path="lib/org.modelio.modelermodule-9.1.00.jar"/>
13-
<PathEntry path="lib/jackson-core-2.8.7.jar"/>
14-
<PathEntry path="lib/jackson-databind-2.8.7.jar"/>
15-
<PathEntry path="lib/jackson-annotations-2.8.7.jar"/>
16+
<PathEntry path="lib/jackson-core-2.12.7.jar"/>
17+
<PathEntry path="lib/jaxb-impl-2.3.4.jar"/>
18+
<PathEntry path="lib/jakarta.xml.bind-api-2.3.3.jar"/>
19+
<PathEntry path="lib/jakarta.activation-api-1.2.2.jar"/>
20+
<PathEntry path="lib/jackson-databind-2.12.7.jar"/>
21+
<PathEntry path="lib/jackson-annotations-2.12.7.jar"/>
1622
<PathEntry path="lib/org.apache.sling.commons.json-2.0.6.jar"/>
17-
<PathEntry path="lib/jsch-0.1.53.jar"/>
18-
<PathEntry path="lib/JavaEWAH-0.7.9.jar"/>
19-
<PathEntry path="lib/httpclient-4.3.6.jar"/>
20-
<PathEntry path="lib/httpcore-4.3.3.jar"/>
21-
<PathEntry path="lib/commons-logging-1.1.3.jar"/>
22-
<PathEntry path="lib/commons-codec-1.6.jar"/>
23-
<PathEntry path="lib/slf4j-api-1.7.2.jar"/>
23+
<PathEntry path="lib/JavaEWAH-1.2.3.jar"/>
24+
<PathEntry path="lib/slf4j-api-1.7.36.jar"/>
2425
<PathEntry path="lib/json-schema-core-1.2.5.jar"/>
2526
<PathEntry path="lib/jackson-coreutils-1.8.jar"/>
2627
<PathEntry path="lib/msg-simple-1.1.jar"/>
@@ -32,7 +33,10 @@
3233
<PathEntry path="lib/libphonenumber-6.2.jar"/>
3334
<PathEntry path="lib/uri-template-0.9.jar"/>
3435
<PathEntry path="lib/rhino-1.7R4.jar"/>
35-
<PathEntry path="lib/jaxb-api-2.3.0.jar"/>
36+
<PathEntry path="lib/httpclient-4.3.3.jar"/>
37+
<PathEntry path="lib/httpcore-4.3.2.jar"/>
38+
<PathEntry path="lib/commons-logging-1.1.3.jar"/>
39+
<PathEntry path="lib/commons-codec-1.6.jar"/>
3640
</ClassPath>
3741
<Profiles>
3842
<Profile uid="1e92b5a0-4d44-40d1-9339-b088265df590" id="INTOCPS"/>

src/main/java/org/modelio/module/intocps/model/fmi/exporter/FMIFactory.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.util.HashMap;
55
import java.util.List;
66
import java.util.Map;
7+
78
import org.eclipse.emf.common.util.EList;
89
import org.modelio.metamodel.uml.infrastructure.Dependency;
910
import org.modelio.metamodel.uml.infrastructure.ModelElement;
@@ -108,7 +109,9 @@ private void createCoSim(Class block, FmiModelDescription md) {
108109
}
109110

110111
public List<Fmi2ScalarVariable> exportBindableInstance(BindableInstance bi) {
111-
return exportBindableInstance(bi, "");
112+
List<Fmi2ScalarVariable> result = exportBindableInstance(bi, "");
113+
this.scalarVariableMap.put(bi, result);
114+
return result;
112115
}
113116

114117
private List<Fmi2ScalarVariable> exportBindableInstance(BindableInstance bi, String preFix) {
@@ -152,8 +155,7 @@ private List<Fmi2ScalarVariable> exportAttribut(Attribute att, String preFix) {
152155
private void setPrimitiveType(Fmi2ScalarVariable var,
153156
NameSpace type, String value) {
154157

155-
156-
158+
157159
if (type.equals(ModelsUtils.getReal())){
158160
Fmi2ScalarVariable.Real real = new Fmi2ScalarVariable.Real();
159161

@@ -199,7 +201,9 @@ private void setType(Fmi2ScalarVariable var,
199201

200202

201203
public List<Fmi2ScalarVariable> exportPort(Port port) {
202-
return exportPort(port, "");
204+
List<Fmi2ScalarVariable> result = exportPort(port, "");
205+
this.scalarVariableMap.put(port, result);
206+
return result;
203207
}
204208

205209
public List<Fmi2ScalarVariable> exportPort(Port port, String preFix) {
@@ -327,7 +331,6 @@ public void exportDependencies(FmiModelDescription md) {
327331
ModelVariables mv = md.getModelVariables();
328332
List<Fmi2ScalarVariable> svs = mv.getScalarVariable();
329333

330-
331334
for (Port output : this.outputs){
332335

333336
List<Fmi2ScalarVariable> fmiOutputs = this.scalarVariableMap.get(output);

src/main/java/org/modelio/module/intocps/model/fmi/exporter/MDExporter.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ public FmiModelDescription exportClass(Class block) {
9797

9898
//attributes
9999
for (Attribute att : block.getOwnedAttribute()){
100-
fmiFactory.exportAttribut(att);
100+
md.getModelVariables().getScalarVariable().addAll(fmiFactory.exportAttribut(att));
101101
}
102102

103103
//Bindable Instance and Port
104104
for (BindableInstance bi: block.getInternalStructure()){
105105
if (bi instanceof Port){
106-
fmiFactory.exportPort((Port) bi);
106+
md.getModelVariables().getScalarVariable().addAll(fmiFactory.exportPort((Port) bi));
107107
}else{
108-
fmiFactory.exportBindableInstance(bi);
108+
md.getModelVariables().getScalarVariable().addAll(fmiFactory.exportBindableInstance(bi));
109109
}
110110
}
111111

@@ -115,7 +115,4 @@ public FmiModelDescription exportClass(Class block) {
115115
}
116116

117117

118-
119-
120-
121118
}

src/main/java/org/modelio/module/intocps/traceability/WebClient.java

Lines changed: 52 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
package org.modelio.module.intocps.traceability;
22

33
import java.io.IOException;
4+
import java.net.http.HttpResponse;
45

56
import org.apache.http.HttpEntity;
6-
import org.apache.http.HttpResponse;
7-
import org.apache.http.client.HttpClient;
7+
import org.apache.http.client.methods.CloseableHttpResponse;
88
import org.apache.http.client.methods.HttpGet;
99
import org.apache.http.client.methods.HttpPost;
1010
import org.apache.http.entity.StringEntity;
11+
import org.apache.http.impl.client.CloseableHttpClient;
1112
import org.apache.http.impl.client.HttpClientBuilder;
1213
import org.apache.http.util.EntityUtils;
13-
import org.modelio.api.modelio.Modelio;
14-
import org.modelio.module.intocps.api.IINTOCPSPeerModule;
15-
import org.modelio.module.intocps.impl.INTOCPSPeerModule;
1614

1715
/**
1816
* Created by kel on 03/11/16.
@@ -21,25 +19,46 @@ public class WebClient
2119
{
2220
public static String get(String url) throws IOException
2321
{
24-
HttpClient httpClient = HttpClientBuilder.create().build();
25-
try
26-
{
22+
// Créer un client HTTP
23+
try (CloseableHttpClient httpClient = HttpClientBuilder.create().build()) {
24+
// Créer une requête HTTP GET
2725
HttpGet request = new HttpGet(url);
28-
HttpResponse response = httpClient.execute(request);
2926

30-
HttpEntity entity = response.getEntity();
31-
32-
return EntityUtils.toString(entity, "UTF-8");
33-
} finally
34-
{
35-
httpClient.getConnectionManager().shutdown(); // Deprecated
27+
// Exécuter la requête
28+
try (CloseableHttpResponse response = httpClient.execute(request)) {
29+
// Gérer la réponse
30+
HttpEntity entity = response.getEntity();
31+
if (entity != null) {
32+
return EntityUtils.toString(entity, "UTF-8");
33+
}
34+
}
35+
} catch (Exception e) {
36+
e.printStackTrace();
3637
}
38+
39+
return "";
40+
41+
// CloseableHttpClient httpClient = HttpClientBuilder.create().build();
42+
// try
43+
// {
44+
// HttpGet request = new HttpGet(url);
45+
//
46+
//
47+
// HttpResponse response = httpClient.execute(request);
48+
//
49+
// HttpEntity entity = response.getEntity();
50+
//
51+
// return EntityUtils.toString(entity, "UTF-8");
52+
// } finally
53+
// {
54+
// httpClient.getConnectionManager().shutdown(); // Deprecated
55+
// }
3756
}
3857

3958
public static void post(String url, String... data) throws IOException
4059

4160
{
42-
HttpClient httpClient = HttpClientBuilder.create().build();
61+
CloseableHttpClient httpClient = HttpClientBuilder.create().build();
4362
try
4463
{
4564

@@ -49,13 +68,23 @@ public static void post(String url, String... data) throws IOException
4968
StringEntity params = new StringEntity(message);
5069
request.addHeader("content-type", "application/json");
5170
request.setEntity(params);
52-
HttpResponse response = httpClient.execute(request);
53-
54-
HttpEntity entity = response.getEntity();
55-
56-
String responseString = EntityUtils.toString(entity, "UTF-8");
57-
58-
System.out.println(responseString);
71+
72+
// Exécuter la requête
73+
try (CloseableHttpResponse response = httpClient.execute(request)) {
74+
// Gérer la réponse
75+
HttpEntity entity = response.getEntity();
76+
if (entity != null) {
77+
System.out.println(EntityUtils.toString(entity, "UTF-8"));
78+
}
79+
}
80+
81+
// HttpResponse response = httpClient.execute(request);
82+
//
83+
// HttpEntity entity = response.getEntity();
84+
//
85+
// String responseString = EntityUtils.toString(entity, "UTF-8");
86+
//
87+
// System.out.println(responseString);
5988

6089
}
6190

0 commit comments

Comments
 (0)