How to create Work Item using Javascript within an OpenSocial Gadget?
I want to develop an OpenSocial Gadget that can create Work Item automatically with the logged in credential. I've tried several approaches but have no positive result until now.
AFAIK, there is no RTC Javascript API for doing this, so I use OSLC API. To create a Work Item, I send a POST request to the creation factory URL with the Work Item RDF description. A header "X-Jazz-CSRF-Prevent" has to be added into the request for a successful creation, the value of this header is the value of JSESSIONID cookie. The problem is within Javascript, it is not allowed to retrieve the value of JSESSIONID programmatically due to security reason (I use Firefox as my web client).
--> Is there any work around for this problem?
--> If no, then is there any other approach to create a Work Item using Javascript within an OpenSocial Gadget?
AFAIK, there is no RTC Javascript API for doing this, so I use OSLC API. To create a Work Item, I send a POST request to the creation factory URL with the Work Item RDF description. A header "X-Jazz-CSRF-Prevent" has to be added into the request for a successful creation, the value of this header is the value of JSESSIONID cookie. The problem is within Javascript, it is not allowed to retrieve the value of JSESSIONID programmatically due to security reason (I use Firefox as my web client).
--> Is there any work around for this problem?
--> If no, then is there any other approach to create a Work Item using Javascript within an OpenSocial Gadget?
Accepted answer
Morning Gentlemens,
I worked the last 6 months with Open Social Widgets (Javascript/JQuery) to create hundreds of new Workitems with Input from DNG Artefacts and link them together. For this job I used OSLC and other CLM REST APIs. If you take care about some minor differences...it works on Firefox and Chrome.
Authentification is not necessary because when you use a Open Social Widget/Gadget you are still logged in. With every GET/PUT/POST Request to the same domain, the browser send the necessary information (inside the header) to the CLM Server.
If you want I can give you code snippets do to the task.
BTW, currently I'm working on a new and better way to extend the CLM Webinterface, because Widget have their limitation too. No hack!
:-)
Thx
Stefan
I worked the last 6 months with Open Social Widgets (Javascript/JQuery) to create hundreds of new Workitems with Input from DNG Artefacts and link them together. For this job I used OSLC and other CLM REST APIs. If you take care about some minor differences...it works on Firefox and Chrome.
Authentification is not necessary because when you use a Open Social Widget/Gadget you are still logged in. With every GET/PUT/POST Request to the same domain, the browser send the necessary information (inside the header) to the CLM Server.
If you want I can give you code snippets do to the task.
BTW, currently I'm working on a new and better way to extend the CLM Webinterface, because Widget have their limitation too. No hack!
:-)
Thx
Stefan
Comments
2 other answers
Hi Tuan,
great that you find the solution.
Open Social Gadget Deployment:
* With Tomcat it is simple...place it inside the C:\IBM\JazzTeamServer\server\tomcat\webapps\extensions\... and the URL would be https://server:9443/extensions/.../status.xml
* WAS needs a WAR File with static content, create it with "jar cvf keyfile.war ." (you need java sdk installed) inside your extension folder.
great that you find the solution.
Open Social Gadget Deployment:
* With Tomcat it is simple...place it inside the C:\IBM\JazzTeamServer\server\tomcat\webapps\extensions\... and the URL would be https://server:9443/extensions/.../status.xml
* WAS needs a WAR File with static content, create it with "jar cvf keyfile.war ." (you need java sdk installed) inside your extension folder.
Stefan
Comments
Donald Nong
Dec 04 '15, 2:21 a.m.Tuan Nguyen Minh
Dec 06 '15, 10:43 p.m.Thomas Kirstätter
Dec 15 '15, 8:25 a.m.Dr. Hans-Joachim Pross
JAZZ DEVELOPER Jan 26 '16, 3:36 a.m.1 vote
Thomas Kirstätter
Jan 26 '16, 3:38 p.m.Thomas Kirstätter
Jan 27 '16, 3:23 a.m.