Can valeSetProvider scripts read their data from local text files?
I'm no dojo expert by any means and I'm looking to see if it is possible to have a dojo script open a file on our server (\\server\somefile) to fetch the data for the result. I.e. All we do after uploading the script is have to modify the text file on server (dynamic list).
I'm basing on the script example shown here.
/*******************************************************************************
* Licensed Materials - Property of IBM
* (c) Copyright IBM Corporation 2011. All Rights Reserved.
*
* Note to U.S. Government Users Restricted Rights:
* Use, duplication or disclosure restricted by GSA ADP Schedule
* Contract with IBM Corp.
*******************************************************************************/
dojo.provide("com.example.ValueSetProvider");
(function() {
dojo.declare("com.example.ValueSetProvider", null, {
getValueSet: function(attributeId, workItem, configuration) {
var result= [];
result.push("a"); <-- would like to fetch this from File I/O.
result.push("b");
return result;
}
});
})();
2 answers
So I went the http filtered value set route. I setup apache and serving an xml page.
<xml>
<node>
<value>Tom 1</value>
</node>
<node>
<value>Tom 2</value>
</node>
<node>
<value>Tom 3</value>
</node>
</xml>
When I run the test everything works,
[HttpFilteredValueSetProvider]Retrieving values from HttpConnector...
[HttpConnector]Retrieving XML document...
[HttpConnector]Issue a new HTTP request
[HttpConnector]Got response 'OK'
[HttpConnector]Retrieved XML document
[HttpConnector]Identified 3 rows
[HttpFilteredValueSetProvider]Retrieved 3 values
Yay! But then I tried creating an attribute (small string) and placing it in a presentation.
No matter what I do, I always get a blank control on the presentation.
Any ideas?