Project

General

Profile

« Previous | Next » 

Revision 45613

View differences:

modules/dnet-springboot-apps/trunk/pom.xml
6 6
	<parent>
7 7
		<groupId>org.springframework.boot</groupId>
8 8
		<artifactId>spring-boot-starter-parent</artifactId>
9
		<version>1.4.2.RELEASE</version>
9
		<version>1.4.3.RELEASE</version>
10 10
	</parent>
11 11

  
12 12
	<artifactId>dnet-springboot-apps</artifactId>
modules/dnet-springboot-apps/trunk/dnet-common-utils/src/main/java/eu/dnetlib/clients/locators/DefaultServiceClientLocator.java
90 90
	private synchronized ServiceRunningInstance obtainRunningInstance(final String profile) {
91 91
		try {
92 92
			final Document doc = reader.read(new StringReader(profile));
93
			final String url = doc.valueOf("/profile/baseUrl").trim();
94
			final String id = doc.valueOf("/profile/id").trim();
93
			final String url = doc.valueOf("//RESOURCE_URI").trim();
94
			final String id = doc.valueOf("//RESOURCE_IDENTIFIER/@value").trim();
95 95

  
96 96
			// TODO: call the service to obtain the ServiceRunningInstance
97 97

  
modules/dnet-springboot-apps/trunk/dnet-common-utils/src/main/resources/eu/dnetlib/services/ServiceProfileTemplate.st
1 1
<?xml version="1.0" encoding="UTF-8"?>
2
<profile>
3
	<id></id>
4
	<kind>dnetService</kind>
5
	<type>$resourceType$</type>
6
	<date></date>
7
	<baseUrl>$baseUrl$</baseUrl>
8
	<extraProperties>
9
		$properties.keys:{k|<property key="$k$" value="$properties.(k)$" />}$
10
	</extraProperties>
11
</profile>
2

  
3
<RESOURCE_PROFILE>
4
    <HEADER>
5
        <RESOURCE_IDENTIFIER value=""/>
6
        <RESOURCE_TYPE value="$resourceType$"/>
7
        <RESOURCE_KIND value="dnetService"/>
8
        <RESOURCE_URI value="$baseUrl$"/>
9
        <DATE_OF_CREATION value=""/>
10
    </HEADER>
11
    <BODY>
12
    	<SERVICE_PROPERTIES>
13
			$properties.keys:{k|<PROPERTY key="$k$" value="$properties.(k)$" />}$
14
		</SERVICE_PROPERTIES>
15
    </BODY>
16
</RESOURCE_PROFILE>
modules/dnet-springboot-apps/trunk/dnet-common-utils/src/main/resources/eu/dnetlib/services/ServiceProfileSchemaTemplate.st
1 1
<?xml version="1.0" encoding="UTF-8"?>
2 2
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
3
    <xs:element name="profile">
3
    <xs:element name="RESOURCE_PROFILE">
4 4
        <xs:complexType>
5 5
            <xs:sequence>
6
                <xs:element name="id" type="xs:string"/>
7
                <xs:element name="kind">
8
                    <xs:simpleType>
9
                        <xs:restriction base="xs:string">
10
                            <xs:enumeration value="dnetService"/>
11
                        </xs:restriction>
12
                    </xs:simpleType>
6
                <xs:element name="HEADER">
7
                    <xs:complexType>
8
                        <xs:all>
9
                            <xs:element name="RESOURCE_IDENTIFIER">
10
                                <xs:complexType>
11
                                    <xs:attribute name="value" type="xs:string" use="required"/>
12
                                </xs:complexType>
13
                            </xs:element>
14
                            <xs:element name="RESOURCE_TYPE">
15
                                <xs:complexType>
16
                                    <xs:attribute name="value" use="required">
17
                                        <xs:simpleType>
18
                                            <xs:restriction base="xs:string">
19
                                                <xs:enumeration value="$resourceType$"/>
20
                                            </xs:restriction>
21
                                        </xs:simpleType>
22
                                    </xs:attribute>
23
                                </xs:complexType>
24
                            </xs:element>
25
                            <xs:element name="RESOURCE_KIND">
26
                                <xs:complexType>
27
                                    <xs:attribute name="value" type="xs:string" use="required"/>
28
                                </xs:complexType>
29
                            </xs:element>
30
                            <xs:element name="RESOURCE_URI">
31
                                <xs:complexType>
32
                                    <xs:attribute name="value" type="xs:anyURI" use="required"/>
33
                                </xs:complexType>
34
                            </xs:element>
35
                            <xs:element name="DATE_OF_CREATION">
36
                                <xs:complexType>
37
                                    <xs:attribute name="value" type="xs:dateTime" use="required"/>
38
                                </xs:complexType>
39
                            </xs:element>
40
                        </xs:all>
41
                    </xs:complexType>
13 42
                </xs:element>
14
                <xs:element name="type">
15
                	<xs:simpleType>
16
                        <xs:restriction base="xs:string">
17
                            <xs:enumeration value="$resourceType$"/>
18
                        </xs:restriction>
19
                    </xs:simpleType>
20
                </xs:element>
21
                <xs:element name="date" type="xs:dateTime"/>
22
                <xs:element name="baseUrl" type="xs:string"/>
23
                <xs:element name="extraProperties">
43
                <xs:element name="BODY">
24 44
                    <xs:complexType>
25
                        <xs:sequence>
26
                            <xs:element name="property" maxOccurs="unbounded" minOccurs="0">
45
                        <xs:all>
46
                            <xs:element name="SERVICE_PROPERTIES">
27 47
                                <xs:complexType>
28
                                    <xs:attribute name="key" use="required" type="xs:string"/>
29
                                    <xs:attribute name="value" use="required" type="xs:string"/>
48
                                    <xs:sequence>
49
                                        <xs:element name="PROPERTY" maxOccurs="unbounded"
50
                                            minOccurs="0">
51
                                            <xs:complexType>
52
                                                <xs:attribute name="key" use="required"
53
                                                  type="xs:string"/>
54
                                                <xs:attribute name="value" use="required"
55
                                                  type="xs:string"/>
56
                                            </xs:complexType>
57
                                        </xs:element>
58
                                    </xs:sequence>
30 59
                                </xs:complexType>
31 60
                            </xs:element>
32
                        </xs:sequence>
61
                        </xs:all>
33 62
                    </xs:complexType>
34 63
                </xs:element>
35 64
            </xs:sequence>

Also available in: Unified diff