It's all about the answers!

Ask a question

Clarifications needed in RTC plugiin development


Rengasami Ramanujam (3154) | asked Aug 18 '09, 11:22 a.m.
Hi All,
I need to create a plugin which will get the current work item session and do customized validation. I need this plugin to be work in eclipse client and web UI as well.

Please suggest me how to do that.

11 answers



permanent link
Patrick Streule (4.9k21) | answered Aug 18 '09, 12:29 p.m.
JAZZ DEVELOPER
I need to create a plugin which will get the current work item session
and do customized validation. I need this plugin to be work in eclipse
client and web UI as well.

Please suggest me how to do that.

You could implement an IOperationAdvisor which does the validation. It
will be triggered regardless of whether a work item is saved in the Web or
the Eclipse UI.

Please see https://jazz.net/wiki/bin/view/Main/TeamProcessDeveloperGuide

The code snippet to get the work item in an advisor is:

public void run(AdvisableOperation operation,
IProcessConfigurationElement advisorConfiguration, IAdvisorInfoCollector
collector, IProgressMonitor monitor) throws TeamRepositoryException {
Object data= operation.getOperationData();
if (data instanceof ISaveParameter) {
ISaveParameter saveParameter= (ISaveParameter) data;
...
}
}


--
Regards,
Patrick
Jazz Work Item Team

permanent link
Rengasami Ramanujam (3154) | answered Aug 18 '09, 11:04 p.m.
I need to create a plugin which will get the current work item session
and do customized validation. I need this plugin to be work in eclipse
client and web UI as well.

Please suggest me how to do that.

You could implement an IOperationAdvisor which does the validation. It
will be triggered regardless of whether a work item is saved in the Web or
the Eclipse UI.

Please see https://jazz.net/wiki/bin/view/Main/TeamProcessDeveloperGuide

The code snippet to get the work item in an advisor is:

public void run(AdvisableOperation operation,
IProcessConfigurationElement advisorConfiguration, IAdvisorInfoCollector
collector, IProgressMonitor monitor) throws TeamRepositoryException {
Object data= operation.getOperationData();
if (data instanceof ISaveParameter) {
ISaveParameter saveParameter= (ISaveParameter) data;
...
}
}


--
Regards,
Patrick
Jazz Work Item Team


Hi ,

Thanks for your reply.

How to utilize the same code in web UI? Please suggest me in that as well

THanks in advance

permanent link
Patrick Streule (4.9k21) | answered Aug 19 '09, 3:51 a.m.
JAZZ DEVELOPER
How to utilize the same code in web UI? Please suggest me in that as
well
THanks in advance

This code will run on the server and will cover both the Web UI and the
Eclipse UI.

The approach I described would validate on the server when the work item
is saved, and not while editing the work item.

We currently don't support hooks for client-side validation. If you need
client-side validation, you could consider implementing your own Attribute
Presentations as described in
https://jazz.net/wiki/bin/view/Main/ContributingAttributePresentations

The server-side approach is certainly less effort and will not require
each Eclipse client talking to your repositories to have the custom
plug-in with your Presentation implementations installed.

--
Regards,
Patrick
Jazz Work Item Team

permanent link
Rengasami Ramanujam (3154) | answered Aug 19 '09, 5:03 a.m.
How to utilize the same code in web UI? Please suggest me in that as
well
THanks in advance

This code will run on the server and will cover both the Web UI and the
Eclipse UI.

The approach I described would validate on the server when the work item
is saved, and not while editing the work item.

We currently don't support hooks for client-side validation. If you need
client-side validation, you could consider implementing your own Attribute
Presentations as described in
https://jazz.net/wiki/bin/view/Main/ContributingAttributePresentations

The server-side approach is certainly less effort and will not require
each Eclipse client talking to your repositories to have the custom
plug-in with your Presentation implementations installed.

--
Regards,
Patrick
Jazz Work Item Team


Hi Patrick,

The code in this URL
https://jazz.net/wiki/bin/view/Main/ContributingAttributePresentations
is not getting triggered when I open a work Item. My requirement very well matches with this one. I copied it in my local express-c plugin everything. I created a plugin and used the same XML mapping in that URL. But when I open the work item window I could not see any new icon. Please help me
Thanks iin advance

permanent link
Patrick Streule (4.9k21) | answered Aug 19 '09, 8:10 a.m.
JAZZ DEVELOPER
he code in this URL
https://jazz.net/wiki/bin/view/Main/ContributingAttributePresentations
is not getting triggered when I open a work Item. My requirement very
well matches with this one. I copied it in my local express-c plugin
everything. I created a plugin and used the same XML mapping in that
URL. But when I open the work item window I could not see any new
icon. Please help me

Can you check the following:

1) Is your plugin loaded?
2) Does your presentation show up in the 'Add Presentation' dialog when
you customize an Editor Presentation?

--
Regards,
Patrick
Jazz Work Item Team

permanent link
Rengasami Ramanujam (3154) | answered Aug 19 '09, 12:08 p.m.
he code in this URL
https://jazz.net/wiki/bin/view/Main/ContributingAttributePresentations
is not getting triggered when I open a work Item. My requirement very
well matches with this one. I copied it in my local express-c plugin
everything. I created a plugin and used the same XML mapping in that
URL. But when I open the work item window I could not see any new
icon. Please help me

Can you check the following:

1) Is your plugin loaded?
2) Does your presentation show up in the 'Add Presentation' dialog when
you customize an Editor Presentation?

--
Regards,
Patrick
Jazz Work Item Team


Hi Patrick,

I have the following doubts over this,
I used the code in the above URL with the same class file. I made changes to the plugin .xml as well. Now when I open the WorkItem window. I could not see the additional icon. And I added few debug stmts as well that particular class itself is not getting triggered.
I am working RTC - express - C client and I created a new PLugin project.

Can you please let me know do I need to create a special type of plugin project using any of the templates in RTC client?

If I could trigger that code in that URL I can manipulate the same pattern according to my design.

Please let me know how could I do that.

permanent link
Rengasami Ramanujam (3154) | answered Aug 19 '09, 12:19 p.m.
he code in this URL
https://jazz.net/wiki/bin/view/Main/ContributingAttributePresentations
is not getting triggered when I open a work Item. My requirement very
well matches with this one. I copied it in my local express-c plugin
everything. I created a plugin and used the same XML mapping in that
URL. But when I open the work item window I could not see any new
icon. Please help me

Can you check the following:

1) Is your plugin loaded?
2) Does your presentation show up in the 'Add Presentation' dialog when
you customize an Editor Presentation?

--
Regards,
Patrick
Jazz Work Item Team


Hi Patrick,

I have the following doubts over this,
I used the code in the above URL with the same class file. I made changes to the plugin .xml as well. Now when I open the WorkItem window. I could not see the additional icon. And I added few debug stmts as well that particular class itself is not getting triggered.
I am working RTC - express - C client and I created a new PLugin project.

Can you please let me know do I need to create a special type of plugin project using any of the templates in RTC client?

If I could trigger that code in that URL I can manipulate the same pattern according to my design.

Please let me know how could I do that.


One more thing I wanted to mention is this.

My requirement is this.

1)I need to have a new icon in WorkItem window
2) Clicking on that icon should take me to the code which is going to get that current work item values.

So I used the code in that URL. But with that code and change in plugin.xml, I could not get the desired thing.PLease let me know if there is any simpler way to that as well.

permanent link
Patrick Streule (4.9k21) | answered Aug 19 '09, 3:23 p.m.
JAZZ DEVELOPER
Hi Patrick,
I have the following doubts over this,
I used the code in the above URL with the same class file. I made
changes to the plugin .xml as well. Now when I open the WorkItem
window. I could not see the additional icon. And I added few debug
stmts as well that particular class itself is not getting triggered.

The Wiki page describes how to implement an attribute presentation. After
you have the example code deployed as a plugin, you also need to follow
the steps to configure this presentation, see e.g.
https://jazz.net/library/LearnItem.jsp?href=content/docs/work-items-cust/workitem-editor-presentations.html

Did you do that?

--
Regards,
Patrick
Jazz Work Item Team

permanent link
Rengasami Ramanujam (3154) | answered Aug 20 '09, 3:13 a.m.
Hi Patrick,
I have the following doubts over this,
I used the code in the above URL with the same class file. I made
changes to the plugin .xml as well. Now when I open the WorkItem
window. I could not see the additional icon. And I added few debug
stmts as well that particular class itself is not getting triggered.

The Wiki page describes how to implement an attribute presentation. After
you have the example code deployed as a plugin, you also need to follow
the steps to configure this presentation, see e.g.
https://jazz.net/library/LearnItem.jsp?href=content/docs/work-items-cust/workitem-editor-presentations.html

Did you do that?


Hi Patrick,

My requirement is to display an icon which on clicking should trigger my script and I need to get the handle copy of that workItem. If I add a new attribute and trigger that code that wont help me.

Please suggest me any ideas for that.
thanks in advance.
--
Regards,
Patrick
Jazz Work Item Team

permanent link
Patrick Streule (4.9k21) | answered Aug 20 '09, 4:19 a.m.
JAZZ DEVELOPER
My requirement is to display an icon which on clicking should trigger
my script and I need to get the handle copy of that workItem. If I
add a new attribute and trigger that code that wont help me.

Please suggest me any ideas for that.
thanks in advance.

An Attribute Presentation is the right way to do this. Despite their name,
they don't require an attribute to be associated with them. But you still
need to configure the Presentation for the editor.

I would suggest that you first get the example from
http://jazz.net/wiki/bin/view/Main/ContributingAttributePresentations to
run as is, without any modifications. Consult also the following articles:

http://jazz.net/library/article/129
http://jazz.net/library/article/130

Then you can start from there.

--
Regards,
Patrick
Jazz Work Item Team

Your answer


Register or to post your answer.