Hi all!
I have to implement a feature where I need a variable number (not known at compilation time) of menu items to display in a section (thus I need to generate them dynamically with java or js code).
Is it possible?
Community moderators have prevented the ability to post new answers.
Hi,
You can do it with java.
Great :) could you give more infos please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You know how to add a new drop-down menu on the top
navigation bar? or add web-item
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yep, from atlassian-plugin.xml... not with java code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To do it dynamicly you must code with java some trucs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, I get it... Now could you give an exemple about how to do this :) ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Yes, but it may take some time.
The following is a step-by-step to do it:
1. Create a web section in the system top navigationbar in atlassian-plugin.xml and post me your code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
so far it look like this:
<web-item key="printing_link" name="Printing Link" section="system.top.navigation.bar"
weight="47">
<label>Printing</label>
<link linkId="printing_link"></link>
<condition
class="com.atlassian.jira.plugin.webfragment.conditions.UserLoggedInCondition" />
</web-item>
<web-section key="printing_section" name="Printing Section"
location="printing_link" weight="10">
</web-section>
<web-item key="view_print_history_link" name="View Print History"
section="printing_link/printing_section" weight="10">
<label>View Print History</label>
<link linkId="view_print_history_link">/secure/FatcaPrintHistory.jspa</link>
</web-item>
<web-item key="view_failure_history_link" name="View Failures History"
section="printing_link/printing_section" weight="11">
<label>View Failures History</label>
<link linkId="view_failure_history_link">/secure/FatcaFailureHistory.jspa</link>
</web-item>
<webwork1 key="printing_action" name="Printing History Actions"
class="java.lang.Object">
<actions>
<action name="com.xxx.actions.PrintHistory"
alias="FatcaPrintHistory">
<view name="input">/templates/com/xxx/actions/printhistory.vm
</view>
</action>
<action
name="com.xxx.actions.FailureHistory"
alias="FatcaFailureHistory">
<view name="input">/templates/com/xxx/actions/printfailed.vm
</view>
</action>
</actions>
</webwork1>
I would like to generate a random number of web items under the "printing_link/printing_section"
Thanks in advance :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Your jira version?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<web-item key="printing_link" name="Printing Link" section="system.top.navigation.bar"
weight="47">
<label>Printing</label>
<link linkId="printing_link"></link>
<condition
class="com.atlassian.jira.plugin.webfragment.conditions.UserLoggedInCondition" />
</web-item>
<web-section key="printing_section" name="Printing Section"
location="printing_link" weight="10">
</web-section>
<web-item key="view_print_history_link" name="View Print History"
section="printing_link/printing_section" weight="10">
<label>View Print History</label>
<link linkId="view_print_history_link">/secure/FatcaPrintHistory.jspa</link>
</web-item>
<web-item key="view_failure_history_link" name="View Failures History"
section="printing_link/printing_section" weight="11">
<label>View Failures History</label>
<link linkId="view_failure_history_link">/secure/FatcaFailureHistory.jspa</link>
</web-item>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't understant. You want me to post the code of my templates?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I devlop in jira 5.2.8
Second step:
Create a class that implement the SimpleLinkFactory interface.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
No, i don't need your templates and actions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Third step:
add this to your atlassian-plugin.xml
<!-- dynamic web item --> <simple-link-factory key="dynamic-factory" name="Dynamic Link Factory" section="printing_link/printing_section" i18n-name-key="Dynamic menu" weight="30" lazy="true" class="ridan.link.dynamic.DynamicLinkFactory"/>
Rebuild and you have this:
Good luck
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi it works
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, It work ?
I can't download print screen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Perfect!! Thank you :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please, accept this answer to help others
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, the print screen does not work but I don't need it :)
Thanks again for your snippets!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
SimpleLinkFactory is deprecated in JIRA 6.3 onwards, I went through API and studied to use WebItemProvider instead SimpleLinkFactory but when I run the plugin it threw cast exception.
, To resolve case exception I used
<web-item-provider key="key" section="section"
name="Name"
i18n-name-key="i18nNmKey"
class="com.ora.ClassName"/>
and class implements WebItemProvider
for more info related to https://answers.atlassian.com/questions/11970940
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.