Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RTC 3.0.0 and JavaScript ValueSetProviders

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?

0 votes



2 answers

Permanent link


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

0 votes


Permanent link

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.

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Jul 20 '11, 8:40 a.m.

Question was seen: 5,122 times

Last updated: Jul 20 '11, 8:40 a.m.

Confirmation Cancel Confirm