Revision 35642
Added by Alessia Bardi about 9 years ago
SetInfoForValidationJobNode.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import javax.annotation.Resource; |
4 | 4 |
|
5 |
import org.apache.commons.logging.Log; |
|
6 |
import org.apache.commons.logging.LogFactory; |
|
7 |
|
|
5 | 8 |
import com.googlecode.sarasvati.Arc; |
6 | 9 |
import com.googlecode.sarasvati.NodeToken; |
7 | 10 |
|
... | ... | |
12 | 15 |
|
13 | 16 |
public class SetInfoForValidationJobNode extends SimpleJobNode { |
14 | 17 |
|
18 |
public static final Log log = LogFactory.getLog(SetInfoForValidationJobNode.class); // NOPMD by marko on 11/24/08 5:02 PM |
|
19 |
|
|
15 | 20 |
@Resource |
16 | 21 |
private UniqueServiceLocator serviceLocator; |
17 |
|
|
18 | 22 |
private String providerId; |
19 | 23 |
private String providerName; |
20 | 24 |
private String api; |
... | ... | |
34 | 38 |
token.getProcess().getEnv().setAttribute(WorkflowsConstants.DATAPROVIDER_INTERFACE, getApi()); |
35 | 39 |
|
36 | 40 |
final String query = "let $x := /*[.//RESOURCE_IDENTIFIER/@value='" + providerId + "']\n" |
37 |
+ "return concat($x//EXTRA_FIELDS/FIELD[./key='NamespacePrefix']/value, ' @@@ ', $x//INTERFACE[./@id='" + api |
|
38 |
+ "']/BASE_URL/text(), ' @@@ ', $x//INTERFACE[./@id='" + api + "']/INTERFACE_EXTRA_FIELD[./@name='last_collection_total']/text() )"; |
|
41 |
+ "return concat($x//EXTRA_FIELDS/FIELD[./key='NamespacePrefix']/value, ' @@@ ', $x//INTERFACE[./@id='" + api + "']/BASE_URL/text())"; |
|
39 | 42 |
|
43 |
log.debug("Running xquery: " + query); |
|
44 |
|
|
40 | 45 |
final String[] arr = serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(query).split("@@@"); |
41 | 46 |
|
42 | 47 |
token.getEnv().setAttribute("datasourceNamespacePrefix", arr[0].trim()); |
43 | 48 |
// INTERFACE[@id='apiId']/BASE_URL |
44 | 49 |
token.getEnv().setAttribute("baseUrl", arr[1].trim()); |
45 |
// INTERFACE[@id='apiId']/INTERFACE_EXTRA_FIELD[./@name="last_collection_total"] |
|
46 |
token.getEnv().setAttribute("totalRecords", arr[2].trim()); |
|
47 | 50 |
|
48 | 51 |
return Arc.DEFAULT_ARC; |
49 | 52 |
} |
Also available in: Unified diff
Depending on modular-mdstore version >=4.1.0 as we require the method size(mdstoreId) to show the progress bar.