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
I'm not sure if this is possible with ValueSetProvider script (I think it's not.).
Anyway, instead scripts, you should use HTTP Filtered Value Set, which allows you to fetch set of values from XML document via HTTP protocol.
Comments
sam detweiler
commented May 31 '13, 3:57 p.m.
right, but you have to have an HTTP server for that..
|
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?
Comments
Tom Malnar
commented May 31 '13, 4:40 p.m.
Btw, I wanted to thank you Karol, long ago I looked at both approaches, but completely forgot about the HTTP filtered approach.
Thanks!
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.