Revision 47288
Added by Michele Artini almost 7 years ago
modules/dnet-springboot-apps/trunk/dnet-administration-uis/src/main/java/eu/dnetlib/administration/uis/functions/ListProfilesFunction.java | ||
---|---|---|
5 | 5 |
import java.util.Map; |
6 | 6 |
import java.util.stream.Collectors; |
7 | 7 |
|
8 |
import org.apache.commons.lang3.StringUtils; |
|
8 | 9 |
import org.springframework.beans.factory.annotation.Autowired; |
9 | 10 |
import org.springframework.stereotype.Component; |
10 | 11 |
|
... | ... | |
21 | 22 |
|
22 | 23 |
@Override |
23 | 24 |
public List<Value> findValues(final Map<String, String> params) throws DnetGenericException { |
24 |
if (!params.keySet().containsAll(Arrays.asList("type", "xpath"))) { throw new DnetGenericException("A required param is missing"); } |
|
25 |
if (!params.keySet().containsAll(Arrays.asList("kind", "type", "xpath"))) { throw new DnetGenericException("A required param is missing"); }
|
|
25 | 26 |
|
26 |
final String query = "for $x in /*[.//RESOURCE_TYPE/@value='" + params.get("type") + "']" + "return concat($x//RESOURCE_IDENTIFIER/@value, ' @@@ ', $x" |
|
27 |
+ params.get("xpath") + ")"; |
|
27 |
final String query = (params.keySet().contains("cond")) |
|
28 |
? String.format("for $x in collection('/db/DRIVER/%s/%s') where $x%s return concat($x//RESOURCE_IDENTIFIER/@value, ' @@@ ', $x%s)", |
|
29 |
params.get("kind"), |
|
30 |
params.get("type"), |
|
31 |
params.get("cond"), |
|
32 |
params.get("xpath")) |
|
33 |
: String.format("for $x in collection('/db/DRIVER/%s/%s') return concat($x//RESOURCE_IDENTIFIER/@value, ' @@@ ', $x%s)", |
|
34 |
params.get("kind"), |
|
35 |
params.get("type"), |
|
36 |
params.get("xpath")); |
|
28 | 37 |
|
29 | 38 |
return isClient.find(query) |
30 | 39 |
.stream() |
... | ... | |
32 | 41 |
final String[] arr = s.split("@@@"); |
33 | 42 |
return new Value(arr[0].trim(), arr[1].trim()); |
34 | 43 |
}) |
44 |
.filter(v -> StringUtils.isNotBlank(v.getId())) |
|
45 |
.filter(v -> StringUtils.isNotBlank(v.getName())) |
|
35 | 46 |
.collect(Collectors.toList()); |
36 | 47 |
} |
37 | 48 |
|
modules/dnet-springboot-apps/trunk/dnet-administration-uis/src/main/resources/static/js/wfs/wfs.js | ||
---|---|---|
48 | 48 |
showSpinner(); |
49 | 49 |
$http.defaults.headers.post["Content-Type"] = "application/json; charset=utf-8"; |
50 | 50 |
$http.post('/ajax/wfs/validValues/listProfiles', { |
51 |
'type' : 'email', |
|
52 |
'xpath' : '//EMAIL_NAME' |
|
51 |
'kind' : 'conf', |
|
52 |
'type' : 'template', |
|
53 |
'cond' : '//TEMPLATE/@type="email"', |
|
54 |
'xpath' : '//TEMPLATE_NAME' |
|
53 | 55 |
}).success(function (data) { |
54 | 56 |
hideSpinner(); |
55 | 57 |
scope.emailMessages = data; |
modules/dnet-springboot-apps/trunk/dnet-administration-uis/src/main/resources/static/js/datasources/dnet_param_values_functions.js | ||
---|---|---|
32 | 32 |
function listFiles(path, ext) { |
33 | 33 |
return obtainValues('listFiles', {'path': path, 'ext': ext}); |
34 | 34 |
} |
35 |
function listProfiles(type, xpath) { |
|
36 |
return obtainValues('listProfiles', {'type': type, 'xpath': xpath}); |
|
35 |
function listProfiles(kind, type, xpath) {
|
|
36 |
return obtainValues('listProfiles', {'kind': kind, 'type': type, 'xpath': xpath});
|
|
37 | 37 |
} |
38 | 38 |
|
39 | 39 |
|
40 |
function listProfiles(type, xpath, filter) {
|
|
41 |
return obtainValues('listProfiles', {'type': type, 'xpath': xpath, 'filter': filter});
|
|
40 |
function listProfiles(kind, type, xpath, cond) {
|
|
41 |
return obtainValues('listProfiles', {'kind': kind, 'type': type, 'xpath': xpath, 'cond': cond});
|
|
42 | 42 |
} |
modules/dnet-springboot-apps/trunk/dnet-administration-uis/src/main/resources/isStartupResources/profiles/workflows/default_wf_email.xml | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="conf/email/5138d999-780b-4ca8-877f-9b15619c1e07"/> |
|
4 |
<RESOURCE_TYPE value="email"/> |
|
5 |
<RESOURCE_KIND value="conf"/> |
|
6 |
<DATE_OF_CREATION value="2016-04-21T12:00:00.0Z"/> |
|
7 |
</HEADER> |
|
8 |
<BODY> |
|
9 |
<EMAIL_NAME>Default workflow message</EMAIL_NAME> |
|
10 |
<SUBJECT_TEMPLATE>[D-NET WORKFLOW] $proc.status$: $proc.name$ on $infrastructure$</SUBJECT_TEMPLATE> |
|
11 |
<EMAIL_TEMPLATE> |
|
12 |
<![CDATA[ |
|
13 |
<div> |
|
14 |
<p>**** This mail has been generated automatically by D-NET Manager Service, please don't reply ****</p> |
|
15 |
<p> |
|
16 |
<b>Workflow:</b> <a href="$baseUrl$/workflows.do#/wf/$proc.profileId$">$proc.name$</a><br/> |
|
17 |
<b>Status:</b> $proc.status$<br/> |
|
18 |
<b>Infrastructure:</b> $infrastructure$ |
|
19 |
</p> |
|
20 |
<hr /> |
|
21 |
<p> |
|
22 |
<b>Workflow details:</b><br /> |
|
23 |
<table> |
|
24 |
<tr><td>Process ID: </td><td><a href="$baseUrl$/workflow_journal.do?procId=$proc.id$">$proc.id$</a></td></tr> |
|
25 |
$if(proc.outputParams.attributes)$ |
|
26 |
$proc.outputParams.attributes.keys:{k|<tr><td>$k$: </td><td><i>$proc.outputParams.attributes.(k)$</i></td></tr>}$ |
|
27 |
$endif$ |
|
28 |
</table> |
|
29 |
</p> |
|
30 |
$if(error)$ |
|
31 |
<hr /> |
|
32 |
<p> |
|
33 |
<b>Error message:</b> <i>$proc.error$</i><br /> |
|
34 |
<b>Error stacktrace:</b><br/> |
|
35 |
<pre>$proc.errorStacktrace$</pre> |
|
36 |
</p> |
|
37 |
$endif$ |
|
38 |
</div> |
|
39 |
]]> |
|
40 |
</EMAIL_TEMPLATE> |
|
41 |
</BODY> |
|
42 |
</RESOURCE_PROFILE> |
modules/dnet-springboot-apps/trunk/dnet-administration-uis/src/main/resources/isStartupResources/profiles/workflows/repohi-pubs.xml | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="conf/workflow/e5b601b9-da0a-4d34-8109-363b4872a5fa" /> |
|
4 |
<RESOURCE_TYPE value="workflow" /> |
|
5 |
<RESOURCE_KIND value="conf" /> |
|
6 |
<RESOURCE_MANAGER value="" /> |
|
7 |
<DATE_OF_CREATION value="2006-05-04T18:13:51.0Z" /> |
|
8 |
</HEADER> |
|
9 |
<BODY> |
|
10 |
<WORKFLOW_NAME>Aggregate Publications [Ingestion]</WORKFLOW_NAME> |
|
11 |
<WORKFLOW_DESCRIPTION>Collect Transform and Index Publications [Ingestion]</WORKFLOW_DESCRIPTION> |
|
12 |
<WORKFLOW_INFO> |
|
13 |
<FIELD name="Action">Aggregate Metadata</FIELD> |
|
14 |
<FIELD name="Consequence IS">Ingestion</FIELD> |
|
15 |
<FIELD name="Datasource class">PubsRepository</FIELD> |
|
16 |
<FIELD name="Content">publications</FIELD> |
|
17 |
</WORKFLOW_INFO> |
|
18 |
<WORKFLOW_FAMILY>REPO_HI</WORKFLOW_FAMILY> |
|
19 |
<WORKFLOW_PRIORITY>20</WORKFLOW_PRIORITY> |
|
20 |
<CONFIGURATION status="EXECUTABLE" start="MANUAL"> |
|
21 |
<PARAMETERS /> |
|
22 |
<WORKFLOW> |
|
23 |
<NODE name="VerifyDatasource" type="VerifyDatasource" isStart="true"> |
|
24 |
<DESCRIPTION>Verify if DS is pending</DESCRIPTION> |
|
25 |
<PARAMETERS> |
|
26 |
<PARAM name="expectedInterfaceTypologyPrefixes" value="pubsrepository::unknown" /> |
|
27 |
<PARAM name="expectedCompliancePrefixes" value="isti" /> |
|
28 |
</PARAMETERS> |
|
29 |
<ARCS> |
|
30 |
<ARC to="registerWf" /> |
|
31 |
<ARC to="validateDs" name="validateDs" /> |
|
32 |
</ARCS> |
|
33 |
</NODE> |
|
34 |
|
|
35 |
<NODE name="validateDs" type="ValidateDatasource"> |
|
36 |
<DESCRIPTION>Validate DS</DESCRIPTION> |
|
37 |
<PARAMETERS /> |
|
38 |
<ARCS> |
|
39 |
<ARC to="registerWf" /> |
|
40 |
</ARCS> |
|
41 |
</NODE> |
|
42 |
|
|
43 |
<NODE name="registerWf" type="RegisterWorkflowFromTemplate"> |
|
44 |
<DESCRIPTION>Create Workflow</DESCRIPTION> |
|
45 |
<PARAMETERS> |
|
46 |
<PARAM name="wfName" value="Aggregate ISTI publications" /> |
|
47 |
<PARAM name="wfTemplate" |
|
48 |
value="/eu/dnetlib/isti/workflows/repo-hi/pubs_aggregation_wf.xml.st" /> |
|
49 |
<PARAM name="description" value="Aggregate ISTI publications" /> |
|
50 |
</PARAMETERS> |
|
51 |
<ARCS> |
|
52 |
<ARC to="createISTINative" /> |
|
53 |
<ARC to="createISTICleaned" /> |
|
54 |
</ARCS> |
|
55 |
</NODE> |
|
56 |
<NODE name="createISTINative" type="CreateMDStore"> |
|
57 |
<DESCRIPTION>Create oai_dc store</DESCRIPTION> |
|
58 |
<PARAMETERS> |
|
59 |
<PARAM name="format" value="oai_dc" /> |
|
60 |
<PARAM name="interpretation" value="native" /> |
|
61 |
<PARAM name="layout" value="store" /> |
|
62 |
<PARAM name="outputPrefix" value="harv_" /> |
|
63 |
</PARAMETERS> |
|
64 |
<ARCS> |
|
65 |
<ARC to="updateParameters" /> |
|
66 |
</ARCS> |
|
67 |
</NODE> |
|
68 |
<NODE name="createISTICleaned" type="CreateMDStore"> |
|
69 |
<DESCRIPTION>Create oai_dc store</DESCRIPTION> |
|
70 |
<PARAMETERS> |
|
71 |
<PARAM name="format" value="PMF" /> |
|
72 |
<PARAM name="interpretation" value="cleaned" /> |
|
73 |
<PARAM name="layout" value="store" /> |
|
74 |
<PARAM name="outputPrefix" value="clean_" /> |
|
75 |
</PARAMETERS> |
|
76 |
<ARCS> |
|
77 |
<ARC to="updateParameters" /> |
|
78 |
</ARCS> |
|
79 |
</NODE> |
|
80 |
<NODE name="updateParameters" type="UpdateWfParameters" isJoin="true"> |
|
81 |
<DESCRIPTION>Update Workflow Parameters</DESCRIPTION> |
|
82 |
<PARAMETERS> |
|
83 |
<PARAM name="envParams"> |
|
84 |
<MAP> |
|
85 |
<ENTRY key="collMdstoreId" value="harv_id" /> |
|
86 |
<ENTRY key="cleanMdstoreId" value="clean_id" /> |
|
87 |
</MAP> |
|
88 |
</PARAM> |
|
89 |
</PARAMETERS> |
|
90 |
<ARCS> |
|
91 |
<ARC to="success" /> |
|
92 |
</ARCS> |
|
93 |
</NODE> |
|
94 |
</WORKFLOW> |
|
95 |
</CONFIGURATION> |
|
96 |
<NOTIFICATIONS /> |
|
97 |
<SCHEDULING enabled="false"> |
|
98 |
<CRON>9 9 9 ? * *</CRON> |
|
99 |
<MININTERVAL>10080</MININTERVAL> |
|
100 |
</SCHEDULING> |
|
101 |
<STATUS /> |
|
102 |
</BODY> |
|
103 |
</RESOURCE_PROFILE> |
modules/dnet-springboot-apps/trunk/dnet-administration-uis/src/main/resources/isStartupResources/profiles/templates/default_wf_email.xml | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="conf/template/5138d999-780b-4ca8-877f-9b15619c1e07" /> |
|
4 |
<RESOURCE_TYPE value="template" /> |
|
5 |
<RESOURCE_KIND value="conf" /> |
|
6 |
<DATE_OF_CREATION value="2016-04-21T12:00:00.0Z" /> |
|
7 |
</HEADER> |
|
8 |
<BODY> |
|
9 |
<TEMPLATE_NAME>Default workflow message</TEMPLATE_NAME> |
|
10 |
<TEMPLATE type="email_subject" language="StringTemplate"> |
|
11 |
<![CDATA[ |
|
12 |
[D-NET WORKFLOW] $proc.status$: $proc.name$ on $infrastructure$ |
|
13 |
]]> |
|
14 |
</TEMPLATE> |
|
15 |
<TEMPLATE type="email" language="StringTemplate"> |
|
16 |
<![CDATA[ |
|
17 |
<div> |
|
18 |
<p>**** This mail has been generated automatically by D-NET Manager Service, please don't reply ****</p> |
|
19 |
<p> |
|
20 |
<b>Workflow:</b> <a href="$baseUrl$/workflows.do#/wf/$proc.profileId$">$proc.name$</a><br/> |
|
21 |
<b>Status:</b> $proc.status$<br/> |
|
22 |
<b>Infrastructure:</b> $infrastructure$ |
|
23 |
</p> |
|
24 |
<hr /> |
|
25 |
<p> |
|
26 |
<b>Workflow details:</b><br /> |
|
27 |
<table> |
|
28 |
<tr><td>Process ID: </td><td><a href="$baseUrl$/workflow_journal.do?procId=$proc.id$">$proc.id$</a></td></tr> |
|
29 |
$if(proc.outputParams.attributes)$ |
|
30 |
$proc.outputParams.attributes.keys:{k|<tr><td>$k$: </td><td><i>$proc.outputParams.attributes.(k)$</i></td></tr>}$ |
|
31 |
$endif$ |
|
32 |
</table> |
|
33 |
</p> |
|
34 |
$if(error)$ |
|
35 |
<hr /> |
|
36 |
<p> |
|
37 |
<b>Error message:</b> <i>$proc.error$</i><br /> |
|
38 |
<b>Error stacktrace:</b><br/> |
|
39 |
<pre>$proc.errorStacktrace$</pre> |
|
40 |
</p> |
|
41 |
$endif$ |
|
42 |
</div> |
|
43 |
]]> |
|
44 |
</TEMPLATE> |
|
45 |
</BODY> |
|
46 |
</RESOURCE_PROFILE> |
modules/dnet-springboot-apps/trunk/dnet-administration-uis/src/main/resources/isStartupResources/profiles/templates/simple-aggregation-wf.xml | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="conf/template/304d69bb-830e-46b4-842b-1c938cf35f94" /> |
|
4 |
<RESOURCE_TYPE value="template" /> |
|
5 |
<RESOURCE_KIND value="conf" /> |
|
6 |
<DATE_OF_CREATION value="2016-04-21T12:00:00.0Z" /> |
|
7 |
</HEADER> |
|
8 |
<BODY> |
|
9 |
<TEMPLATE_NAME>Simple aggregation</TEMPLATE_NAME> |
|
10 |
<TEMPLATE type="REPO_HI" language="StringTemplate"> |
|
11 |
<![CDATA[ |
|
12 |
|
|
13 |
]]> |
|
14 |
</TEMPLATE> |
|
15 |
</BODY> |
|
16 |
</RESOURCE_PROFILE> |
modules/dnet-springboot-apps/trunk/dnet-common-utils/src/main/resources/isStartupResources/schemas/email.xsd | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> |
|
3 |
<xs:element name="RESOURCE_PROFILE"> |
|
4 |
<xs:complexType> |
|
5 |
<xs:sequence> |
|
6 |
<xs:element name="HEADER"> |
|
7 |
<xs:complexType> |
|
8 |
<xs:sequence> |
|
9 |
<xs:element name="RESOURCE_IDENTIFIER"> |
|
10 |
<xs:complexType> |
|
11 |
<xs:attribute name="value" use="required" /> |
|
12 |
</xs:complexType> |
|
13 |
</xs:element> |
|
14 |
<xs:element name="RESOURCE_TYPE"> |
|
15 |
<xs:complexType> |
|
16 |
<xs:attribute name="value" use="required" fixed="email" /> |
|
17 |
</xs:complexType> |
|
18 |
</xs:element> |
|
19 |
<xs:element name="RESOURCE_KIND"> |
|
20 |
<xs:complexType> |
|
21 |
<xs:attribute name="value" use="required" fixed="conf" /> |
|
22 |
</xs:complexType> |
|
23 |
</xs:element> |
|
24 |
<xs:element name="DATE_OF_CREATION"> |
|
25 |
<xs:complexType> |
|
26 |
<xs:attribute name="value" use="required" type="xs:dateTime" /> |
|
27 |
</xs:complexType> |
|
28 |
</xs:element> |
|
29 |
</xs:sequence> |
|
30 |
</xs:complexType> |
|
31 |
</xs:element> |
|
32 |
<xs:element name="BODY"> |
|
33 |
<xs:complexType> |
|
34 |
<xs:sequence> |
|
35 |
<xs:element name="EMAIL_NAME" type="xs:string" /> |
|
36 |
<xs:element name="SUBJECT_TEMPLATE" type="xs:string" /> |
|
37 |
<xs:element name="EMAIL_TEMPLATE" type="xs:string" /> |
|
38 |
</xs:sequence> |
|
39 |
</xs:complexType> |
|
40 |
</xs:element> |
|
41 |
</xs:sequence> |
|
42 |
</xs:complexType> |
|
43 |
</xs:element> |
|
44 |
</xs:schema> |
modules/dnet-springboot-apps/trunk/dnet-common-utils/src/main/resources/isStartupResources/schemas/template.xsd | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> |
|
3 |
<xs:element name="RESOURCE_PROFILE"> |
|
4 |
<xs:complexType> |
|
5 |
<xs:sequence> |
|
6 |
<xs:element name="HEADER"> |
|
7 |
<xs:complexType> |
|
8 |
<xs:sequence> |
|
9 |
<xs:element name="RESOURCE_IDENTIFIER"> |
|
10 |
<xs:complexType> |
|
11 |
<xs:attribute name="value" use="required"/> |
|
12 |
</xs:complexType> |
|
13 |
</xs:element> |
|
14 |
<xs:element name="RESOURCE_TYPE"> |
|
15 |
<xs:complexType> |
|
16 |
<xs:attribute name="value" use="required" fixed="template"/> |
|
17 |
</xs:complexType> |
|
18 |
</xs:element> |
|
19 |
<xs:element name="RESOURCE_KIND"> |
|
20 |
<xs:complexType> |
|
21 |
<xs:attribute name="value" use="required" fixed="conf"/> |
|
22 |
</xs:complexType> |
|
23 |
</xs:element> |
|
24 |
<xs:element name="DATE_OF_CREATION"> |
|
25 |
<xs:complexType> |
|
26 |
<xs:attribute name="value" use="required" type="xs:dateTime"/> |
|
27 |
</xs:complexType> |
|
28 |
</xs:element> |
|
29 |
</xs:sequence> |
|
30 |
</xs:complexType> |
|
31 |
</xs:element> |
|
32 |
<xs:element name="BODY"> |
|
33 |
<xs:complexType> |
|
34 |
<xs:sequence> |
|
35 |
<xs:element name="TEMPLATE_NAME" type="xs:string" minOccurs="1" maxOccurs="1"/> |
|
36 |
<xs:element name="TEMPLATE" minOccurs="1" maxOccurs="unbounded"> |
|
37 |
<xs:complexType> |
|
38 |
<xs:simpleContent> |
|
39 |
<xs:extension base="xs:string"> |
|
40 |
<xs:attribute name="type" type="xs:string" use="required"/> |
|
41 |
<xs:attribute name="language" type="xs:string" use="required"/> |
|
42 |
</xs:extension> |
|
43 |
</xs:simpleContent> |
|
44 |
</xs:complexType> |
|
45 |
</xs:element> |
|
46 |
</xs:sequence> |
|
47 |
</xs:complexType> |
|
48 |
</xs:element> |
|
49 |
</xs:sequence> |
|
50 |
</xs:complexType> |
|
51 |
</xs:element> |
|
52 |
</xs:schema> |
Also available in: Unified diff
unified email and template profiles