Writing a Web UI work item editor presentation in JDojo
![]()
I'm trying to carry a custom work item attribute part editor presentation over from Eclipse UI to Web UI. In Eclipse UI, I derive from com.ibm.team.workitem.ide.ui.internal.editor.presentations.AttributePart, and all is well. However, using JDojo to create the analogous logic for Web UI, what do I need to do for my widget to gain access to the same sort of runtime properties (such as the work item working copy, and presentation properties, etc.)?
I created a simple "hello world" widget that extends com.ibm.jdojo.dijit._Widget, and it shows up in a Web UI work item. However, _Widget and its ancestor classes do not provide access to the work item properties and methods. So I'm guessing that there's a subclass of _Widget that knows about work items, and that I need to extend that. Can you point me in the right direction? Sample code for creating a custom work item attribute part editor presentation in JDojo would be greatly appreciated. Also, if you can let me know any special changes for the MANIFEST.MF Dependencies Required Plug-ins, or other project properties that I may need to configure. Thanks! |
6 answers
![]()
Hi Robert,
a document describing how to write editor presentations for the Eclipe and Web/UI can be found here: https://jazz.net/wiki/bin/view/Main/ContributingAttributePresentations I am a little bit surprised that you are talking about writing the Web/UI presentation in JDojo. Currently presentations can only be written using Dojo as you can see from the documentation. The use of JDojo is not supported outside the RTC development team. Regards Dirk Bumer On 11/04/2011 4:38 AM, toccataconsulting wrote: I'm trying to carry a custom work item attribute part editor |
![]()
Hi Dirk,
Thank you for the note. I've just about memorized the ContributingAttributePresentations page over the past few months :-) The problem that I run into is the lack of documentation for what methods are available for creating a work item attribute editor presentation from within Javascript, hence the attempt to clarify the situation through the use of JDojo. If Dojo/Javascript is the recommended approach, can you point me to documentation for what I can do from within my editor presentation widget? I need to (1) be able to access the work item working copy, (2) obtain the current values for other attributes within the work item, based on their attribute identifiers, and (3) listen for changes (the standard dependency notification mechanism available for work item attributes). If you can point me in the direction of documentation for what's available to Javascript developers, that would be great. The ContributingAttributePresentations entry is not sufficient, as it is more of an anecdotal "how to" guide, than a proper API reference document. Cheers, Roger |
![]()
Hello Roger,
You are correct the API is not documented well enough. I created task 161587 to improve this. https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/161587 When a presentation is created in the web UI, this.workingCopy will get you the WorkItemProxy representing the work item. Attributes are accesses with getValue setting a path and setValue passing a path and value. The addListener function is used to listen for changes to particular attributes. The path is an array of propertied drilling down into the work item structure, where the top properties are "attributes", "linkTypes" or "approvals". The widget property this.attributeId is the current attribute id, such as "internalPriority". In addition: this.attributeId is the attribute id for the current widget. this.possibleValues is the selection options for an enumeration. For example: var value = this.workingCopy.getValue({ path: }); this.workingCopy.addListener({ path: , event: "onchange", listener: this, functionName: "_handleAttributeChange" }); this.workingCopy.setValue({ path: , attributeId: "myAttributeId", value: theValue }); Although "The use of JDojo is not supported outside the RTC development team", looking at the JDojo stub for WorkItemProxy (and WorkItemProxyClient, ItemProxyClient and ItemProxy) can provide some documentation. Looking at the JDojo stubs in com.ibm.team.workitem.web.client.dtos can be helpful for looking at many of the values stored in the working copy. In addition, this.workingCopy.workItemSpec includes the editProps and presentationProps... this.workingCopy.workItemSpec.editProps includes "allValues" representing the possible values for an option list, and "requiredProperties". See WorkItemEditableProperties. this.workingCopy.workItemSpec.presentationProps includes "pages" which contains sections etc. as represented by EditorPresentationDTO. I'm not sure this is helpful but in v3 ReferencedWorkItemList.java and Target.java ("Planned For" in 3.0.1) are JDojo presentations. See package com.ibm.team.workitem.web.ui2.internal.presentation. Regards, Larry Smith Work Items Web UI Developer Hi Dirk, |
![]()
Please note, as the wiki says, that some APIs are intended to change in future version.
Therefore it would be good if you could just use workingCopy.getValue/setValue and addListener to listen to changes so the chances that you presentation works in coming releases of RTC are bigger. All other APIs are probably going to change at some point, in particular the access to possible values of other attributes. We will improve the wiki as soon as we can to clarify this. |
![]()
Hi Dirk,
I found that you mentioned 'The use of JDojo is not supported outside the RTC development team', and I'm planning to make some change about planning components. As I know, the planning component is realized by JDOJO. So I will be really appreciate if you guys could provider related development tools about JDOJO for us . Thank you very much. Hi Robert, I'm trying to carry a custom work item attribute part editor |
![]()
Hi,
In version 5.0.2 I've detected a new way of defining widgets presentations, its
inherits "com.ibm.team.workitem.web.ui.internal.view.editor.presentations.attribute.AttributePresentation" and "com.ibm.team.rtc.foundation.web.ui.views.AbstractView"
Then you need to redefine a method doCreateView : function(context, params, domNode); then inside context you have the workingCopy among other things
Amaury
|
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.