Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

how can i render a vm template file which in another plugin.

i want to implement a mvc module as jira webwork1 module type, but i dont know how to render a vm template file which in another plugin. anyone can help me. thanks.

2 answers

Suggest an answer

Log in or Sign up to answer

currently, when i call render function, velocity tell me can't find the resource file. i known why raise this error, because of not using the right classloader, so classloader can't find the resource in current bundle. but anyone can help me to resolve the question.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Aug 13, 2014

You can't really do that. A .vm file requires a "context" which is provided by the code behind it. You can't just take a .vm and render it from elsewhere because the context for it won't be there in your code. You can, of course, create your own context for a .vm file provided elsewhere, but you might as well just copy the .vm into your own plugin as you're already doing all the rest of the work.

but why jira webwork1 module type can do that.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Aug 13, 2014

It can't - it's providing a context and reusing a file. It's not rendering it without a context as you seem to be trying.

you are right, thanks.

Alexey_Rjeutski__Polontech_
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.
Aug 13, 2014

The jar plugin is a simple zip archive. Unzip the plugin you want to get vm from and copy vm into your plugin. Then render that according to your needs. Please note that you should provide needed variables to that vm file to render it. Also please note that there might be some license issues that will not allow to do that legally.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Aug 13, 2014

Yup, as I said, copy it into your own code.

TAGS
AUG Leaders

Atlassian Community Events