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

Downloadable PDF-file only for authentificated jira-users in named user-group - Looking for ideas?

Team-efRE March 2, 2015

Hello Community,

my customer want publish a pdf-file in JIRA for a named user-group. Only authentificated members should be access this pdf-file!

So I brood over a good way to implement this.

My steps:

  1. in atlassian-plugin.xml I make a <web-item> with <condition> to create a link in JIRA menu
  2. I create a new <servlet> in atlassian-plugin.xml too
  3. In implemented class (extends HttpServlet) I implement user- and group-check.

Now my questions:

  • how can I send the content of file to browser?
  • If user not logined, how page I redirect?

 

Or have anyone a better solution for my problem.

 

Best regards

Matthias

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Midori
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.
March 3, 2015

how can I send the content of file to browser?

You write the bytes of file to the outputstream of your HttpServletResponse object. Extra hint: use the FileCopyUtils class from Spring to save you some repetitive code.

If user not logined, how page I redirect?

You simply have to return the corresponding HTTP status code and the second URL, like here: http://www.tutorialspoint.com/servlets/servlets-page-redirect.htm

Or have anyone a better solution for my problem.

You should really check out our JIRA PDF View Plugin if you want an easy to use, customizable and maintained PDF exporter for JIRA. See more details here.

Team-efRE March 3, 2015

Hello Ferenc Kiss, thank you for your respond and your first help. The pdf-file that I want to send to authentificated user, is a self written manual with some instructions to use our jira-instance. I want store this file in the jira-plugin-container (.jar-file). So nothing should be exportet or else. The redirect-question is solved by your support - thanks again! For my first toppic I need additional help: * in my JAR-File in Folder /ressources/PDF-FILE.PDF the file is stored. * the HttpServlet is implement in a separate namespace * how I open this file and use the FileCopyUtil? Is it possible to send a short example-code? Thank your for your assistance in the matter. Best regards Matthias

TAGS
AUG Leaders

Atlassian Community Events