Overriding existing Jira component.

한우람 May 21, 2012

Hi! I'm currently in charge of customizing Jira 5.0.3 version in my company.(NHN)

Because we're using the custom authorization method, We've make a own plugin(version 1) override existing CrowdServiceImpl's authenticate.

== atlanssian-plugin.xml ==

<component key="crowdService" name="Extended Crowd Service" class="com.nhncorp.jira.security.login.ExtendedCrowdServiceImpl">

<interface>com.atlassian.crowd.embedded.api.CrowdService</interface>

</component>

It just works well.. CrowdService component is replaced with my ExtendedCrowdServiceImpl when it's used in jira core.

However, It seems that my ExtendedCrowdServiceImpl is not replacing existing CrowdServiceImpl when when CrowdService component is used in another plugin(plugin-version2).

Existing jira-rpc-plugin(plugin-version 2) uess CrowdService component for authentification.

What I expected was that overriding existing CrowdService component from the my plugin (version1) affects the all plugin regardless that it's version1 or version2, but it doens't work that way.

Plugin initialization order may cause the problem??

Well.. I know If I change the Jira core's com.atlassian.jira.ContainerRegistrar#registerComponents, It will works.

However I like to minimize the changes in the jira core and I'm seeking the other way to achieve it.

The option remained for me seems the use of jira.extension.container.provider.

https://developer.atlassian.com/display/JIRADEV/Customising+JIRA+code

However this method id deprecated from JIRA 4.3

Is there any way to override existing component regardless the plugin versions..

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
한우람 May 22, 2012

Thanks to Dieter and Jamie.

The reason I decided to override CrowdService is that "custom authenticator" doesn't affect soap call.

I thought only way I can change login behavior in Web and SOAP both is to customize CrowdService.

In addition, our ldap operation team doesn't allow Jira to connect to LDAP directly, so we're using a proxy which gets the HTTP GET based auth request and validate id/pw.

In such a case implementing custom CrowdService was only option remained for me.

Dieter's previous problem is exactly same as me. Did you found some solution for it?

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 22, 2012

Yes, what Dieter says.

https://answers.atlassian.com/questions/53136/what-s-the-best-way-to-add-additional-validation-logic-to-issueservice.

If it's a private plugin, modifying ContainerRegistrar is probably the best way... I'm not sure what changes you have made to the component, but perhaps it be done with a custom authenticator rather than overriding the component?

0 votes
Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 22, 2012
I'm afraid you will not get a better answer than what you have already found. I remember a similar very bountyful question about replacing the IssueService posted by Jamie and there was no answer. Meanwhile i can't find Jamie's question anymore. Maybe he can post here if there is some news about that. It's not nice but i think you should use the ComponentProvider which i think is still in the 5.0 source code or change Atlassian classes. I know this solution can't be packaged in a plugin which is really bad.

Maybe you could share with us what you intend to do in your modified code. i saw lately that the Crowd raises events when user details are updated from LDAP so there are some chances to hook into Crowd ...

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events