It's all about the answers!

Ask a question

RTC 3.0.0 and JavaScript ValueSetProviders


Michael Tunnicliffe (2634) | asked Jul 20 '11, 8:40 a.m.
Hi, I've been trying, with some limited success, to implement a filtered dependent enumeration with a JavaScript ValueSetProvider. I have found from other posts on the forum a couple of workarounds for my initial problems (turning on script attachments on the server, working around lack of interface for ValueSetProvider scripts, and working around the org.mozilla.NativeArray casting problem), and the script works for the Eclipse client.

However, it still doesn't work on the web interface. I have calls to console.log() in my code, which appear fine in the Error Log on the Eclipse UI, but I don't see them anywhere in the server logs when running the web interface (I assume the JS code should run on the server in response to an AJAX request - I can see the AJAX request sent and a response arrive, but without the expected values in the response).


AJAX request/response from Firefox Web Console:

Request URL:
https://localhost:9443/ccm/service/com.ibm.team.workitem.common.internal.rest.IWorkItemRestService/values?attributeName=com.ibm.service.attribute.patched.release&projectAreaItemId=_0xQGEJW8EeCzQ61anqVIWg&typeId=triage&attributeIdentifiers=com.ibm.service.attribute.minor.releaseminor&attributeValues=com.ibm.jtc.service.attribute.minor.release.literal.l10

Request Method:
GET

Status Code:
HTTP/1.1 200 OK

Request Headers
13:33:45.274

Accept:text/jsonAccept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept-Encoding:gzip, deflateAccept-Language:en-gb,en;q=0.5Connection:keep-alive
Content-Type:application/x-www-form-urlencoded; charset=utf-8
Host:localhost:9443
Referer: ***
User-Agent:Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0
X-Jazz-CSRF-Prevent:DFFE9AE3C887B2D9153BBED653830754
X-Requested-With:XMLHttpRequestX-com-ibm-team-configuration-versions:LATEST


Sent Cookie
JSESSIONID:***
JSESSIONIDSSO:***
JazzFormAuth:FormSaveStateCookie:undefinedjfs-oauth-realm-mapping:https%3A%2F%2Flocalhost%3A9443%2Fjts%3D0net-jazz-ajax-cookie-rememberUserId:***

Response Headers
90ms

Cache-Control:private
Content-Type:text/json;charset=UTF-8
Date:Wed, 20 Jul 2011 12:33:45 GMT
Expires:Thu, 01 Jan 1970 01:00:00 GMT
Server:Apache-Coyote/1.1
Transfer-Encoding:chunked

Response Body
0ms

{"soapenv:Body":{"_eQualifiedClassName":"http:\/\/schemas.xmlsoap.org\/soap\/envelope\/:Body","response":{"interface":"com.ibm.team.workitem.common.internal.rest.IWorkItemRestService","method":"getValues","_eQualifiedClassName":"http:\/\/\/com\/ibm\/team\/core\/services.ecore:Response","returnValue":{"type":"COMPLEX","_eQualifiedClassName":"http:\/\/\/com\/ibm\/team\/core\/services.ecore:ComplexArrayDataArg"}}},"_eQualifiedClassName":"http:\/\/schemas.xmlsoap.org\/soap\/envelope\/:Envelope"}

Is there some way I can get hold of the console.log() output, or check for sure that the JavaScript is running/see any errors?

2 answers



permanent link
Claudio Neves (4133) | answered Jul 21 '11, 4:54 p.m.


However, it still doesn't work on the web interface. I have calls to console.log() in my code, which appear fine in the Error Log on the Eclipse UI, but I don't see them anywhere in the server logs when running the web interface (I assume the JS code should run on the server in response to an AJAX request - I can see the AJAX request sent and a response arrive, but without the expected values in the response).



Hello,

Please try seeing the logs here:

C:\Program Files (x86)\IBM\JazzTeamServer\server\tomcat\work\Catalina\localhost\ccm\eclipse\workspace\.metadata\.log

Claudio Neves

permanent link
Michael Tunnicliffe (2634) | answered Jul 29 '11, 12:23 p.m.

Hello,

Please try seeing the logs here:

C:\Program Files (x86)\IBM\JazzTeamServer\server\tomcat\work\Catalina\localhost\ccm\eclipse\workspace\.metadata\.log

Claudio Neves


Thanks Claudio, through looking at these logs I was able to find the problem.

My value set provider was accessing the value of two different fields (both enums) on the work item to produce its valid list of values (literals for a third enum), however, the attribute it was attached to only had a dependency relationship to 1 of the 2 fields it was accessing.

This worked okay from the eclipse UI, but in the web UI the value set provider script was receiving the wrong literal value for the field on which it didn't have a dependency relationship (it came up as the default literal rather than the one which was actually selected).

Adding a second dependency relationship resolved the problem.

Your answer


Register or to post 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.