Skip to content

Commit c16d93c

Browse files
author
Rob Tjalma
authored
Merge pull request #35 from com-pas/namespace-prefix-fix
Namespace prefix fix
2 parents da5c005 + 31bc9a2 commit c16d93c

File tree

15 files changed

+57
-26
lines changed

15 files changed

+57
-26
lines changed

app/src/main/java/org/lfenergy/compas/scl/data/rest/Constants.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ public final class Constants {
77
private Constants() {
88
}
99

10-
public static final String SCL_NAMESPACE = "http://www.iec.ch/61850/2003/SCL";
11-
1210
public static final String TYPE_PATH_PARAM = "type";
1311
public static final String ID_PATH_PARAM = "id";
1412
public static final String VERSION_PATH_PARAM = "version";

app/src/main/java/org/lfenergy/compas/scl/data/rest/model/CreateRequest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@
1212
import javax.xml.bind.annotation.XmlElement;
1313
import javax.xml.bind.annotation.XmlRootElement;
1414

15-
import static org.lfenergy.compas.scl.data.rest.Constants.SCL_NAMESPACE;
15+
import static org.lfenergy.compas.scl.data.model.Constants.SCL_NAMESPACE;
16+
import static org.lfenergy.compas.scl.data.model.Constants.SDS_NAMESPACE;
1617

17-
@XmlRootElement(name = "CreateRequest")
18+
@XmlRootElement(name = "CreateRequest", namespace = SDS_NAMESPACE)
1819
@XmlAccessorType(XmlAccessType.FIELD)
1920
public class CreateRequest {
2021
@Schema(example = "SCL XML...")
2122
@XmlElement(name = "SCL", namespace = SCL_NAMESPACE, required = true)
2223
private SCL scl;
2324
@Schema(example = "STATION-0012312")
24-
@XmlElement(name = "Name", required = true)
25+
@XmlElement(name = "Name", namespace = SDS_NAMESPACE, required = true)
2526
private String name;
2627

2728
public SCL getScl() {

app/src/main/java/org/lfenergy/compas/scl/data/rest/model/CreateResponse.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
import javax.xml.bind.annotation.XmlRootElement;
1111
import java.util.UUID;
1212

13-
@XmlRootElement(name = "CreateResponse")
13+
import static org.lfenergy.compas.scl.data.model.Constants.SDS_NAMESPACE;
14+
15+
@XmlRootElement(name = "CreateResponse", namespace = SDS_NAMESPACE)
1416
@XmlAccessorType(XmlAccessType.FIELD)
1517
public class CreateResponse {
16-
@XmlElement(name = "Id", required = true)
18+
@XmlElement(name = "Id", namespace = SDS_NAMESPACE, required = true)
1719
private UUID id;
1820

1921
public UUID getId() {

app/src/main/java/org/lfenergy/compas/scl/data/rest/model/GetResponse.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
import javax.xml.bind.annotation.XmlElement;
1313
import javax.xml.bind.annotation.XmlRootElement;
1414

15-
import static org.lfenergy.compas.scl.data.rest.Constants.SCL_NAMESPACE;
15+
import static org.lfenergy.compas.scl.data.model.Constants.SCL_NAMESPACE;
16+
import static org.lfenergy.compas.scl.data.model.Constants.SDS_NAMESPACE;
1617

17-
@XmlRootElement(name = "GetResponse")
18+
@XmlRootElement(name = "GetResponse", namespace = SDS_NAMESPACE)
1819
@XmlAccessorType(XmlAccessType.FIELD)
1920
public class GetResponse {
2021
@Schema(example = "SCL XML...")

app/src/main/java/org/lfenergy/compas/scl/data/rest/model/ListResponse.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
import javax.xml.bind.annotation.XmlRootElement;
1212
import java.util.List;
1313

14-
@XmlRootElement(name = "ListResponse")
14+
import static org.lfenergy.compas.scl.data.model.Constants.SDS_NAMESPACE;
15+
16+
@XmlRootElement(name = "ListResponse", namespace = SDS_NAMESPACE)
1517
@XmlAccessorType(XmlAccessType.FIELD)
1618
public class ListResponse {
17-
@XmlElement(name = "Item")
19+
@XmlElement(name = "Item", namespace = SDS_NAMESPACE)
1820
private List<Item> items;
1921

2022
public List<Item> getItems() {

app/src/main/java/org/lfenergy/compas/scl/data/rest/model/Type.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
import javax.xml.bind.annotation.XmlAccessorType;
88
import javax.xml.bind.annotation.XmlElement;
99

10+
import static org.lfenergy.compas.scl.data.model.Constants.SDS_NAMESPACE;
11+
1012
@XmlAccessorType(XmlAccessType.FIELD)
1113
public class Type {
12-
@XmlElement(name = "Code")
14+
@XmlElement(name = "Code", namespace = SDS_NAMESPACE)
1315
private String code;
14-
@XmlElement(name = "Description")
16+
@XmlElement(name = "Description", namespace = SDS_NAMESPACE)
1517
private String description;
1618

1719
public Type(String code, String description) {

app/src/main/java/org/lfenergy/compas/scl/data/rest/model/TypeListResponse.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
import java.util.ArrayList;
1111
import java.util.List;
1212

13-
@XmlRootElement(name = "TypeListResponse")
13+
import static org.lfenergy.compas.scl.data.model.Constants.SDS_NAMESPACE;
14+
15+
@XmlRootElement(name = "TypeListResponse", namespace = SDS_NAMESPACE)
1416
@XmlAccessorType(XmlAccessType.FIELD)
1517
public class TypeListResponse {
16-
@XmlElement(name = "Type")
18+
@XmlElement(name = "Type", namespace = SDS_NAMESPACE)
1719
private List<Type> types = new ArrayList<>();
1820

1921
public void setTypes(List<Type> types) {

app/src/main/java/org/lfenergy/compas/scl/data/rest/model/UpdateRequest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
import javax.xml.bind.annotation.XmlElement;
1414
import javax.xml.bind.annotation.XmlRootElement;
1515

16-
import static org.lfenergy.compas.scl.data.rest.Constants.SCL_NAMESPACE;
16+
import static org.lfenergy.compas.scl.data.model.Constants.SCL_NAMESPACE;
17+
import static org.lfenergy.compas.scl.data.model.Constants.SDS_NAMESPACE;
1718

1819
@XmlRootElement(name = "UpdateRequest")
1920
@XmlAccessorType(XmlAccessType.FIELD)
@@ -22,7 +23,7 @@ public class UpdateRequest {
2223
@XmlElement(name = "SCL", namespace = SCL_NAMESPACE, required = true)
2324
private SCL scl;
2425
@Schema(example = "MAJOR")
25-
@XmlElement(name = "ChangeSet", required = true)
26+
@XmlElement(name = "ChangeSet", namespace = SDS_NAMESPACE, required = true)
2627
private ChangeSetType changeSetType;
2728

2829
public SCL getScl() {

app/src/main/java/org/lfenergy/compas/scl/data/rest/model/VersionsResponse.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
import javax.xml.bind.annotation.XmlRootElement;
1212
import java.util.List;
1313

14+
import static org.lfenergy.compas.scl.data.model.Constants.SDS_NAMESPACE;
15+
1416
@XmlRootElement(name = "VersionsResponse")
1517
@XmlAccessorType(XmlAccessType.FIELD)
1618
public class VersionsResponse {
17-
@XmlElement(name = "Item")
19+
@XmlElement(name = "Item", namespace = SDS_NAMESPACE)
1820
private List<Item> items;
1921

2022
public List<Item> getItems() {

app/src/main/java/org/lfenergy/compas/scl/data/rest/model/package-info.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
//
33
// SPDX-License-Identifier: Apache-2.0
44
@XmlSchema(
5-
namespace = "https://www.lfenergy.org/compas/SclDataService",
5+
namespace = SDS_NAMESPACE,
66
xmlns = {
77
@XmlNs(prefix = "scl", namespaceURI = "http://www.iec.ch/61850/2003/SCL"),
88
@XmlNs(prefix = "compas", namespaceURI = "https://www.lfenergy.org/compas/v1"),
9-
@XmlNs(prefix = "sds", namespaceURI = "https://www.lfenergy.org/compas/SclDataService")
9+
@XmlNs(prefix = "sds", namespaceURI = SDS_NAMESPACE)
1010
})
1111
package org.lfenergy.compas.scl.data.rest.model;
1212

1313
import javax.xml.bind.annotation.XmlNs;
14-
import javax.xml.bind.annotation.XmlSchema;
14+
import javax.xml.bind.annotation.XmlSchema;
15+
16+
import static org.lfenergy.compas.scl.data.model.Constants.SDS_NAMESPACE;

0 commit comments

Comments
 (0)