Revision 42506
Added by Sandro La Bruzzo almost 8 years ago
modules/dnet-core-components/trunk/src/test/java/eu/dnetlib/clients/ISLookUpClientTest.java | ||
---|---|---|
1 |
package eu.dnetlib.clients; |
|
2 |
|
|
3 |
import eu.dnetlib.clients.enabling.ISLookUpClient; |
|
4 |
import eu.dnetlib.rmi.provision.MDFInfo; |
|
5 |
import org.junit.Before; |
|
6 |
import org.junit.Test; |
|
7 |
|
|
8 |
/** |
|
9 |
* Created by sandro on 5/11/16. |
|
10 |
*/ |
|
11 |
public class ISLookUpClientTest { |
|
12 |
|
|
13 |
@Before |
|
14 |
public void setUp() throws Exception { |
|
15 |
|
|
16 |
} |
|
17 |
|
|
18 |
@Test |
|
19 |
public void testConstructObject() throws Exception { |
|
20 |
|
|
21 |
ISLookUpClient client = new ISLookUpClient(); |
|
22 |
final MDFInfo mdfInfo = client.constructObjectByResult(MDFInfo.class, "@", "1@2@3@4@5@6@7@8@false"); |
|
23 |
|
|
24 |
} |
|
25 |
|
|
26 |
} |
modules/dnet-core-components/trunk/src/main/java/eu/dnetlib/clients/enabling/ISLookUpClient.java | ||
---|---|---|
86 | 86 |
} |
87 | 87 |
} |
88 | 88 |
|
89 |
private <T> T constructObjectByResult(final Class<T> clazz, final String separator, final String result) {
|
|
89 |
public <T> T constructObjectByResult(final Class<T> clazz, final String separator, final String result) {
|
|
90 | 90 |
try { |
91 | 91 |
if (result == null) |
92 | 92 |
throw new RuntimeException("the result of query is null"); |
... | ... | |
96 | 96 |
} |
97 | 97 |
List<Class> types = new ArrayList<>(); |
98 | 98 |
splittedValues.forEach(it -> types.add(String.class)); |
99 |
return clazz.getDeclaredConstructor(types.toArray(new Class[] {})).newInstance(splittedValues); |
|
99 |
|
|
100 |
return clazz.getDeclaredConstructor(types.toArray(new Class[] {})).newInstance(splittedValues.toArray(new String[] {})); |
|
100 | 101 |
} catch (Exception e) { |
101 | 102 |
throw new RuntimeException(e); |
102 | 103 |
} |
modules/dnet-efg/trunk/src/main/resources/eu/dnetlib/efg/workflows/repo-hi/efg_aggregation_wf.xml.st | ||
---|---|---|
73 | 73 |
</PARAM> |
74 | 74 |
</PARAMETERS> |
75 | 75 |
<ARCS> |
76 |
<ARC to="generateThumbnails"/>
|
|
76 |
<ARC to="index"/>
|
|
77 | 77 |
</ARCS> |
78 | 78 |
</NODE> |
79 |
<NODE name="generateThumbnails" type="LaunchWorkflowTemplate"> |
|
80 |
<DESCRIPTION>Generate thumbnails from record</DESCRIPTION> |
|
81 |
<PARAMETERS> |
|
82 |
<PARAM name="wfTemplateId" value="d12a26b0-9006-4f89-b063-9a5dc1d4b70f_V29ya2Zsb3dUZW1wbGF0ZURTUmVzb3VyY2VzL1dvcmtmbG93VGVtcGxhdGVEU1Jlc291cmNlVHlwZQ=="/> |
|
83 |
<PARAM name="wfTemplateParams"> |
|
84 |
<MAP> |
|
85 |
<ENTRY key="dsId" value="$dsId$" /> |
|
86 |
<ENTRY key="cleanMdstoreId" ref="cleanMdstoreId" /> |
|
87 |
<ENTRY key="nativeObjectStoreId" ref="nativeObjectStoreId" /> |
|
88 |
</MAP> |
|
89 |
</PARAM> |
|
90 |
</PARAMETERS> |
|
91 |
<ARCS> |
|
92 |
<ARC to="index"/> |
|
93 |
</ARCS> |
|
94 |
</NODE> |
|
95 | 79 |
|
96 | 80 |
|
97 | 81 |
<NODE name="index" type="LaunchWorkflowTemplate"> |
... | ... | |
125 | 109 |
</PARAM> |
126 | 110 |
</PARAMETERS> |
127 | 111 |
<ARCS> |
112 |
<ARC to="oaiPostFeed"/> |
|
113 |
</ARCS> |
|
114 |
</NODE> |
|
115 |
|
|
116 |
|
|
117 |
<NODE name="oaiPostFeed" type="LaunchWorkflowTemplate"> |
|
118 |
<DESCRIPTION>Oai Post Feed Action</DESCRIPTION> |
|
119 |
<PARAMETERS> |
|
120 |
<PARAM name="wfTemplateId" value="c73dd31d-17ee-4a9c-b3df-c0b278668b3d_V29ya2Zsb3dUZW1wbGF0ZURTUmVzb3VyY2VzL1dvcmtmbG93VGVtcGxhdGVEU1Jlc291cmNlVHlwZQ==" /> |
|
121 |
<PARAM name="wfTemplateParams"> |
|
122 |
<MAP> |
|
123 |
<ENTRY key="dsId" value="$dsId$" /> |
|
124 |
<ENTRY key="cleanMdstoreId" ref="cleanMdstoreId" /> |
|
125 |
</MAP> |
|
126 |
</PARAM> |
|
127 |
</PARAMETERS> |
|
128 |
<ARCS> |
|
129 |
<ARC to="generateThumbnails"/> |
|
130 |
</ARCS> |
|
131 |
</NODE> |
|
132 |
|
|
133 |
<NODE name="generateThumbnails" type="LaunchWorkflowTemplate"> |
|
134 |
<DESCRIPTION>Generate thumbnails from record</DESCRIPTION> |
|
135 |
<PARAMETERS> |
|
136 |
<PARAM name="wfTemplateId" value="d12a26b0-9006-4f89-b063-9a5dc1d4b70f_V29ya2Zsb3dUZW1wbGF0ZURTUmVzb3VyY2VzL1dvcmtmbG93VGVtcGxhdGVEU1Jlc291cmNlVHlwZQ=="/> |
|
137 |
<PARAM name="wfTemplateParams"> |
|
138 |
<MAP> |
|
139 |
<ENTRY key="dsId" value="$dsId$" /> |
|
140 |
<ENTRY key="cleanMdstoreId" ref="cleanMdstoreId" /> |
|
141 |
<ENTRY key="nativeObjectStoreId" ref="nativeObjectStoreId" /> |
|
142 |
</MAP> |
|
143 |
</PARAM> |
|
144 |
</PARAMETERS> |
|
145 |
<ARCS> |
|
128 | 146 |
<ARC to="success"/> |
129 | 147 |
</ARCS> |
130 | 148 |
</NODE> |
modules/dnet-efg/trunk/src/main/resources/eu/dnetlib/bootstrap/profiles/OAIPublisherConfigurationDSResourceType/oai_efg_config.xml | ||
---|---|---|
17 | 17 |
<NAMESPACE>http://www.europeanfilmgateway.eu/efg</NAMESPACE> |
18 | 18 |
<SCHEMA>http://www.europeanfilmgateway.eu/efg/efg.xsd</SCHEMA> |
19 | 19 |
<SOURCE_METADATA_FORMAT name="oai_efg" layout="store" interpretation="cleaned"/> |
20 |
<TRANSFORMATION_RULE>oaf2dc_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU</TRANSFORMATION_RULE>
|
|
20 |
<TRANSFORMATION_RULE/>
|
|
21 | 21 |
<BASE_QUERY>*</BASE_QUERY> |
22 | 22 |
</METADATAFORMAT><!--<METADATAFORMAT exportable="true" metadataPrefix="ese">--><!--<NAMESPACE>http://www.europeana.eu/schemas/ese/</NAMESPACE>--><!--<SCHEMA>http://www.europeana.eu/schemas/ese/ESE-V3.4.xsd</SCHEMA>--><!--<SOURCE_METADATA_FORMAT interpretation="cleaned" name="ese" layout="store"/>--><!--<TRANSFORMATION_RULE/>--><!--<BASE_QUERY>*</BASE_QUERY>--><!--</METADATAFORMAT>--><!--<METADATAFORMAT metadataPrefix="oai_dc" exportable="true">--><!--<NAMESPACE>http://www.openarchives.org/OAI/2.0/oai_dc/</NAMESPACE>--><!--<SCHEMA>www.openarchives.org/OAI/2.0/oai_dc.xsd</SCHEMA>--><!--<SOURCE_METADATA_FORMAT name="ese" interpretation="cleaned" layout="store"/>--><!--<TRANSFORMATION_RULE>a5ed863b-1883-4709-82fb-b0d7c0d4c5db_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU=</TRANSFORMATION_RULE>--><!--<BASE_QUERY>*</BASE_QUERY>--><!--</METADATAFORMAT>--><!--<METADATAFORMAT exportable="true" metadataPrefix="edm">--><!--<NAMESPACE>http://www.europeana.eu/schemas/edm/</NAMESPACE>--><!--<SCHEMA>http://www.europeana.eu/schemas/edm/EDM.xsd</SCHEMA>--><!--<SOURCE_METADATA_FORMAT layout="store" interpretation="cleaned" name="ese"/>--><!--<TRANSFORMATION_RULE>10e9ebb1-085f-4cd3-b322-0e2918cf93c4_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU=</TRANSFORMATION_RULE>--><!--<BASE_QUERY>*</BASE_QUERY>--><!--</METADATAFORMAT>--> |
23 | 23 |
</METADATAFORMATS> |
modules/dnet-efg/trunk/src/main/resources/eu/dnetlib/bootstrap/profiles/workflows/efg_post_feed_oai.xml | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="c73dd31d-17ee-4a9c-b3df-c0b278668b3d_V29ya2Zsb3dUZW1wbGF0ZURTUmVzb3VyY2VzL1dvcmtmbG93VGVtcGxhdGVEU1Jlc291cmNlVHlwZQ=="/> |
|
4 |
<RESOURCE_TYPE value="WorkflowTemplateDSResourceType"/> |
|
5 |
<RESOURCE_KIND value="WorkflowTemplateDSResources"/> |
|
6 |
<RESOURCE_URI value=""/> |
|
7 |
<DATE_OF_CREATION value="2001-12-31T12:00:00"/> |
|
8 |
</HEADER> |
|
9 |
<BODY> |
|
10 |
<CONFIGURATION> |
|
11 |
<PARAMETERS> |
|
12 |
<PARAM name="cleanMdstoreId" description="Store for cleaned records" required="true" type="string"/> |
|
13 |
<PARAM name="dsId" description="Datasource Id" required="true" type="string"/> |
|
14 |
</PARAMETERS> |
|
15 |
<WORKFLOW> |
|
16 |
|
|
17 |
|
|
18 |
<NODE name="setFormat" type="SetFormatInfo" isStart="true"> |
|
19 |
<DESCRIPTION>Set Format Info</DESCRIPTION> |
|
20 |
<PARAMETERS> |
|
21 |
<PARAM name="format" value="oai_efg"/> |
|
22 |
<PARAM name="layout" value="store"/> |
|
23 |
<PARAM name="interpretation" value="cleaned"/> |
|
24 |
<PARAM name="formatParam" value="oai_format"/> |
|
25 |
<PARAM name="layoutParam" value="oai_layout"/> |
|
26 |
<PARAM name="interpretationParam" value="oai_interpretation"/> |
|
27 |
</PARAMETERS> |
|
28 |
<ARCS> |
|
29 |
<ARC to="prepareOAI"/> |
|
30 |
</ARCS> |
|
31 |
</NODE> |
|
32 |
|
|
33 |
<NODE name="prepareOAI" type="PrepareOaiJob"> |
|
34 |
<DESCRIPTION>Prepare oai feeding</DESCRIPTION> |
|
35 |
<PARAMETERS> |
|
36 |
<PARAM name="oaiStoreCollectionParam" value="oaiStoreCollection"/> |
|
37 |
<PARAM name="oaiDBName" value="oaistore_efg"/> |
|
38 |
<PARAM name="oaiDBNameParam" value="oai_dbName"/> |
|
39 |
</PARAMETERS> |
|
40 |
<ARCS> |
|
41 |
<ARC to="CompoundIndexes"/> |
|
42 |
</ARCS> |
|
43 |
</NODE> |
|
44 |
|
|
45 |
<NODE name="CompoundIndexes" type="OAICreateIndex"> |
|
46 |
<DESCRIPTION>Create composite indexes for the OAI store</DESCRIPTION> |
|
47 |
<PARAMETERS> |
|
48 |
<PARAM name="dbNameParam" value="oai_dbName"/> |
|
49 |
<PARAM name="oaiStoreCollectionParam" value="oaiStoreCollection"/> |
|
50 |
<PARAM name="fieldNames" value="set,datestamp;entitytype"/> |
|
51 |
</PARAMETERS> |
|
52 |
<ARCS> |
|
53 |
<ARC to="ConfigIndexes"/> |
|
54 |
</ARCS> |
|
55 |
</NODE> |
|
56 |
|
|
57 |
<NODE name="ConfigIndexes" type="OAIEnsureIndexes"> |
|
58 |
<DESCRIPTION>Ensure an index exists on fields as specified in the configuration profile</DESCRIPTION> |
|
59 |
<PARAMETERS> |
|
60 |
<PARAM name="dbNameParam" value="oai_dbName"/> |
|
61 |
<PARAM name="oaiStoreCollectionParam" value="oaiStoreCollection"/> |
|
62 |
</PARAMETERS> |
|
63 |
<ARCS> |
|
64 |
<ARC to="SetsCount"/> |
|
65 |
</ARCS> |
|
66 |
</NODE> |
|
67 |
|
|
68 |
<NODE name="SetsCount" type="OAISetsCountUpdate"> |
|
69 |
<DESCRIPTION>Count records in each OAI set, for each exported metadata format linked to the given oai collection</DESCRIPTION> |
|
70 |
<PARAMETERS> |
|
71 |
<PARAM name="dbNameParam" value="oai_dbName"/> |
|
72 |
<PARAM name="oaiStoreCollectionParam" value="oaiStoreCollection"/> |
|
73 |
<PARAM name="configuredOnly" value="false"/> |
|
74 |
</PARAMETERS> |
|
75 |
<ARCS> |
|
76 |
<ARC to="ConfigSets"/> |
|
77 |
</ARCS> |
|
78 |
</NODE> |
|
79 |
|
|
80 |
<NODE name="ConfigSets" type="OAIRefreshConfiguration"> |
|
81 |
<DESCRIPTION>Reads the current OAI configuration and upsert OAI sets accordingly (counts are updated as well)</DESCRIPTION> |
|
82 |
<PARAMETERS> |
|
83 |
<PARAM name="dbNameParam" value="oai_dbName"/> |
|
84 |
</PARAMETERS> |
|
85 |
<ARCS> |
|
86 |
<ARC to="success"/> |
|
87 |
</ARCS> |
|
88 |
</NODE> |
|
89 |
|
|
90 |
|
|
91 |
</WORKFLOW> |
|
92 |
</CONFIGURATION> |
|
93 |
</BODY> |
|
94 |
</RESOURCE_PROFILE> |
modules/dnet-efg/trunk/src/main/resources/eu/dnetlib/bootstrap/profiles/workflows/efg_feed_oai.xml | ||
---|---|---|
31 | 31 |
<DESCRIPTION>Clean original records</DESCRIPTION> |
32 | 32 |
<PARAMETERS> |
33 | 33 |
<PARAM name="eprParam" value="orig_epr"/> |
34 |
<PARAM name="oai_dbName" value="oaistore_eagle"/>
|
|
34 |
<PARAM name="oai_dbName" value="oaistore_efg"/>
|
|
35 | 35 |
<PARAM name="formatParam" value="oai_formatName"/> |
36 | 36 |
<PARAM name="layoutParam" value="oai_formatLayout"/> |
37 | 37 |
<PARAM name="interpretationParam" value="oai_formatInterpretation"/> |
Also available in: Unified diff
added OAI Postfeed workflows