@igea/oac_backend 1.0.41 → 1.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/config/development.json +1 -1
- package/src/config/production.json +1 -1
- package/src/controllers/auth.js +7 -0
- package/src/models/vocabolaries/parser +1 -1
- package/src/models/vocabolaries/vocabolaries.xsd +1 -0
- package/src/models/vocabolaries/vocabolaries.xslt +33 -2
- package/test/models/vocabolaries/vocabolaries.xml +2 -2
- package/test/vocabolaries.xsd +1 -0
package/package.json
CHANGED
package/src/controllers/auth.js
CHANGED
|
@@ -37,6 +37,13 @@ module.exports = function(jwtLib){
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
router.get('/exposed_config', (req, res) => {
|
|
41
|
+
res.json({
|
|
42
|
+
success: true,
|
|
43
|
+
data: EXPOSED
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
40
47
|
router.post('/authenticate', authLimiter, (req, res) => {
|
|
41
48
|
console.log("here authenticate")
|
|
42
49
|
let body = req.body
|
|
@@ -69,7 +69,7 @@ class Parser{
|
|
|
69
69
|
reject(err)
|
|
70
70
|
}else{
|
|
71
71
|
var terms = stdout.split('\n')
|
|
72
|
-
resolve(terms.map(line => line.trim()).filter(line => line.length > 0));
|
|
72
|
+
resolve(terms.map(line => line.trim().replace(/\s+/g, ' ')).filter(line => line.length > 0));
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
}catch(e){
|
|
@@ -20,24 +20,52 @@
|
|
|
20
20
|
<!-- Vocabolario -->
|
|
21
21
|
<xsl:template match="vocabulary">
|
|
22
22
|
<xsl:param name="prefix"/>
|
|
23
|
+
|
|
24
|
+
<!-- Recupero classe, di default crm:E55_Type -->
|
|
25
|
+
<xsl:variable name="type-class" select="normalize-space(@class)"/>
|
|
26
|
+
<!-- xsl:variable name="type" select="'crm:E55_Type'"/ -->
|
|
27
|
+
|
|
28
|
+
<!-- xsl:variable name="type">
|
|
29
|
+
<xsl:choose>
|
|
30
|
+
<xsl:when test="string-length($type-class) > 0">
|
|
31
|
+
<xsl:value-of select="normalize-space($type-class)"/>
|
|
32
|
+
</xsl:when>
|
|
33
|
+
<xsl:otherwise>crm:E55_Type</xsl:otherwise>
|
|
34
|
+
</xsl:choose>
|
|
35
|
+
</xsl:variable -->
|
|
36
|
+
|
|
37
|
+
<xsl:variable name="type">
|
|
38
|
+
<xsl:if test="string-length($type-class) = 0">
|
|
39
|
+
<xsl:value-of select="'crm:E55_Type'"/>
|
|
40
|
+
</xsl:if>
|
|
41
|
+
<xsl:if test="not(string-length($type-class)) = 0">
|
|
42
|
+
<xsl:value-of select="concat($type-class, ' ')"/>
|
|
43
|
+
</xsl:if>
|
|
44
|
+
</xsl:variable>
|
|
45
|
+
|
|
23
46
|
<xsl:variable name="vocab-id" select="normalize-space(@id)"/>
|
|
24
47
|
<xsl:apply-templates select="term">
|
|
25
48
|
<xsl:with-param name="path" select="concat('http://', $prefix, $vocab-id)"/>
|
|
49
|
+
<xsl:with-param name="type" select="concat($type, ' ')"/>
|
|
26
50
|
</xsl:apply-templates>
|
|
27
51
|
</xsl:template>
|
|
28
52
|
|
|
29
53
|
<!-- Term ricorsivo -->
|
|
30
54
|
<xsl:template match="term">
|
|
31
55
|
<xsl:param name="path"/>
|
|
56
|
+
<xsl:param name="type"/>
|
|
32
57
|
<xsl:variable name="current-id" select="normalize-space(@id)"/>
|
|
33
58
|
<xsl:variable name="new-path" select="concat($path, '/', $current-id)"/>
|
|
59
|
+
<xsl:variable name="new-type" select="concat($type, ' ')"/>
|
|
34
60
|
|
|
35
61
|
<xsl:choose>
|
|
36
62
|
<!-- Se NON ha sub-terms/term -->
|
|
37
63
|
<xsl:when test="not(sub-terms/term)">
|
|
38
64
|
<xsl:for-each select="name">
|
|
39
65
|
<xsl:value-of select="concat('<',$new-path,'>')"/>
|
|
40
|
-
<xsl:text> a
|
|
66
|
+
<xsl:text> a </xsl:text>
|
|
67
|
+
<xsl:value-of select="concat($new-type, ' ')"/>
|
|
68
|
+
<xsl:text> rdfs:label "</xsl:text>
|
|
41
69
|
<xsl:value-of select="."/>
|
|
42
70
|
<xsl:text>"@</xsl:text>
|
|
43
71
|
<xsl:value-of select="@lang"/>
|
|
@@ -53,7 +81,9 @@
|
|
|
53
81
|
|
|
54
82
|
<xsl:for-each select="name">
|
|
55
83
|
<xsl:value-of select="concat('<',$npath,'>')"/>
|
|
56
|
-
<xsl:text> a
|
|
84
|
+
<xsl:text> a </xsl:text>
|
|
85
|
+
<xsl:value-of select="concat($new-type, ' ')"/>
|
|
86
|
+
<xsl:text> rdfs:label "</xsl:text>
|
|
57
87
|
<xsl:value-of select="."/>
|
|
58
88
|
<xsl:text>"@</xsl:text>
|
|
59
89
|
<xsl:value-of select="@lang"/>
|
|
@@ -65,6 +95,7 @@
|
|
|
65
95
|
<xsl:apply-templates select="sub-terms/term">
|
|
66
96
|
<xsl:with-param name="prev-path" select="$path"/>
|
|
67
97
|
<xsl:with-param name="path" select="$new-path"/>
|
|
98
|
+
<xsl:with-param name="type" select="$type"/>
|
|
68
99
|
</xsl:apply-templates>
|
|
69
100
|
</xsl:otherwise>
|
|
70
101
|
</xsl:choose>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
<!-- Vocabolario per CONDIZIONI AMBIENTALI (1) -->
|
|
10
|
-
<vocabulary>
|
|
10
|
+
<vocabulary class="crm:E55_Type">
|
|
11
11
|
<term id="condizioni-ambientali">
|
|
12
12
|
<name lang="it">Condizioni ambientali</name>
|
|
13
13
|
<sub-terms>
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
</vocabulary>
|
|
74
74
|
|
|
75
75
|
<!-- Vocabolario per DEGRADO (3) -->
|
|
76
|
-
<vocabulary>
|
|
76
|
+
<vocabulary class="basecpm:CP42_Material_Decay">
|
|
77
77
|
<term id="degrado">
|
|
78
78
|
<name lang="it">Degrado</name>
|
|
79
79
|
<sub-terms>
|