logo资料库

jira插件开发技术指导手册.pdf

第1页 / 共512页
第2页 / 共512页
第3页 / 共512页
第4页 / 共512页
第5页 / 共512页
第6页 / 共512页
第7页 / 共512页
第8页 / 共512页
资料共512页,剩余部分请下载后查看
Cover
Copyright
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Table of Contents
Preface
Chapter 1: Plugin Development Process
Introduction
Setting up the development environment
Creating a skeleton plugin
Adding plugin modules
Deploying a JIRA plugin
Making changes to and redeploying a plugin
Using FastDev for plugin development
Testing and debugging
Chapter 2: Understanding the Plugin Framework
Introduction
Architecture explained…
Types of plugin modules
Working with the Plugins1 and Plugins2 versions
JIRA system plugins
Stable and core APIs
Modifying Atlassian bundled plugins
Converting plugins from v1 to v2
Adding resources into plugins
Adding web resources into plugins
Building JIRA from source
Adding new webwork actions to JIRA
Extending a webwork action in JIRA
Capturing plugin installation/uninstallation events
Chapter 3: Working with Custom Fields
Introduction
Writing a simple custom field
Custom field searchers
Dealing with custom fields on an issue
Programming custom field options
Overriding validation of custom fields
Customizing the change log value
Migrating from one custom field type to another
Making custom fields sortable
Displaying custom fields on subtask columns
User and date fields
Adding custom fields to notification mails
Adding help text for a custom field
Removing the "none" option from a select field
Making the custom field project importable
Changing the size of a text area custom field
Chapter 4: Programming workflows
Introduction
Writing a workflow condition
Writing a workflow validator
Writing a workflow post function
Editing an active workflow
Making an issue editable/non-editable based on workflow status
Including/excluding resolutions for specific transitions
Permissions based on workflow status
Internationalization in workflow transitions
Obtaining available workflow actions programmatically
Programmatically progressing on workflows
Obtaining workflow history from the database
Reordering workflow actions in JIRA
Creating common transitions in workflows
Creating global transitions in workflows
Jelly escalation
Chapter 5: Gadgets and Reporting in JIRA
Introduction
Writing a JIRA report
Reports in an Excel format
Data validation in JIRA reports
Restricting access to reports
Object-configurable parameters for reports
Creating a pie chart in JIRA
Writing JIRA 4 gadgets
Invoking REST services from gadgets
Configuring user preferences in gadgets
Accessing gadgets outside of JIRA
Chapter 6: The Power of JIRA Searching
Introduction
Writing a JQL function
Sanitizing JQL functions
Adding a search request view
Smart querying using quick search
Searching in plugins
Parsing JQL queries in plugins
Linking directly to search queries
Index and de-index programmatically
Managing filters programmatically
Subscribing to a filter
Chapter 7: Programming Issues
Introduction
Creating an issue from a plugin
Creating subtasks on an issue
Updating an issue
Deleting an issue
Adding new issue operations
Conditions on issue operations
Working with attachments
Time tracking and worklog management
Working with comments on issues
Programming change logs
Programming issue links
Discarding fields while cloning
JavaScript tricks on issue fields
Creating issues and comments from an e-mail
Chapter 8: Customizing the UI
Introduction
Changing the basic look and feel
Adding new web sections in the UI
Adding new web items in the UI
Use of decorators
Adding conditions for web fragments
Creating new Velocity context for web fragments
Adding a new drop-down menu on the top navigation bar
Dynamic creation of web items
Adding new tabs in the View Issue screen
Adding new tabs in the Browse Project screen
Creating the project tab panel using fragments
Adding new tabs in the Browse Version screen
Adding new tabs in the Browse Component screen
Adding issue link renderers
Extending a webwork action to add UI elements
Displaying dynamic notifications/warnings on issues
Re-ordering issue operations in the View Issue page
Re-ordering fields in the View Issue page
CHapter 9: Remote Access to JIRA
Introduction
Writing a Java client for the REST API
Creating a SOAP client
Writing a Java XML-RPC client
Working with issues
Working with attachments
Remote time tracking
Working with comments
Remote user and group management
Progressing an issue in a workflow
Managing versions
Managing components
Remote administration methods
Exposing services and data entities as REST APIs
Deploying a SOAP service in JIRA
Deploying an XML-RPC service within JIRA
Chapter 10: Dealing with the JIRA Database
Introduction
Extending the JIRA database with custom schema
Accessing database entities from plugins
Persisting plugin information in the JIRA database
Using active objects to store data
Accessing JIRA configuration properties
Getting a database connection for JDBC calls
Migrating a custom field from one type to another
Retrieving issue information from a database
Retrieving custom field details from a database
Retrieving permissions on issues from a database
Retrieving workflow details from a database
Updating the issue status in a database
Retrieving users and groups from a database
Dealing with change history in a database
Chapter 11: Useful Recipes
Introduction
Writing a service in JIRA
Adding configurable parameters to a service
Writing scheduled tasks in JIRA
Writing listeners in JIRA
Customizing e-mail content
Redirecting to a different page in webwork actions
Adding custom behavior for user details
Deploying a servlet in JIRA
Adding shared parameters to the servlet context
Writing a servlet context listener
Using filters to intercept queries in JIRA
Adding and importing components in JIRA
Adding new module types to JIRA
Enabling access logs in JIRA
Enabling SQL logging in JIRA
Overriding JIRA's default components in plugins
Internationalization in webwork plugins
Sharing common libraries across v2 plugins
Operations using direct HTML links
Index
JIRA 5.x Development Cookbook This book is your one-stop resource for mastering JIRA extensions and customizations Jobin Kuruvilla BIRMINGHAM - MUMBAI
JIRA 5.x Development Cookbook Copyright © 2013 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: April 2013 Production Reference: 1180413 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78216-908-6 www.packtpub.com Cover Image by Suresh Mogre (suresh.mogre.99@gmail.com)
Credits Author Jobin Kuruvilla Reviewers Felix Martineau Mizan Ali Sayed Acquisition Editor Kevin Colaco Lead Technical Editor Sruthi Kutty Technical Editors Dominic Pereira Kirti Pujari Mameet Singh Vasir Hardik B. Soni Project Coordinator Hardik Patel Proofreaders Maria Gould Paul Hindle Aaron Nash Indexer Rekha Nair Graphics Abhinash Sahu Production Coordinator Arvindkumar Gupta Cover Work Arvindkumar Gupta
About the Author Jobin Kuruvilla is an Atlassian Consultant with experience in customizing JIRA and writing JIRA plugins for various customers. He is currently working with Go2Group as an Atlassian platinum expert, and is involved in managing Atlassian products for big enterprises as well as small starter license installations. Jobin is the author of JIRA Development Cookbook, Packt Publishing, released in 2011, which is a well-received book in the JIRA community. He also runs a website named J-Tricks (http://www.j-tricks.com), using which he shares numerous tutorials to help the developer community, who he believes have contributed immensely to his personal development. It is indeed those tutorials that sowed the first seeds of JIRA Development Cookbook. Jobin started his career as a Java/J2EE developer in one of the biggest IT companies in India. After spending his initial years in the SOA world, he got hooked into this amazing product called JIRA, which he came across during the evaluation of a number of third-party tools. Soon, Jobin realized the power of JIRA, and pledged to spread the word. He has been doing it ever since, and he reckons there is a long way to go!
Acknowledgement No book is the product of just the author; he just happens to be the one with his name on the cover. A number of people contributed to the success of this book, and it would take more space than I have to thank each one individually. First of all, thanks to the Almighty God for helping me to sail through the difficulties in this short life and for making my life as wonderful as it is now. The next biggest thanks goes to Project Coordinator, Hardik Patel, and Lead Technical Editor, Sruthi Kutty, both of whom went through the pain of making me write another book. Also, thanks to the entire Packt Publishing team for working so diligently to help bring out another high quality product. It is amazing to work with a team of talented developers and technical geeks. Thank you STORM team, PD&B team, and RAMP team. Your encouragement and support were invaluable to me; you guys rock! I must also thank the talented JIRA community who are instrumental in helping each other, sharing solutions, being active in the forums, running user groups, and what not? I am just one of the many who have benefited. Before I wind up, thank you Atlassian for giving us JIRA and a set of other wonderful products. You don't realize how much you are making our lives easier! Last, but not the least, a big thanks to all at Go2group for the support extended in writing this book and believing in my capabilities.
About the Reviewers Felix Martineau runs the Atlassian practice at TechSolCom (http://www.techsolcom.ca) and has been working as a professional JIRA consultant since 2008. Having started with JIRA in 2007, over the years he has worked with the entire Atlassian portfolio. Felix has a rare blend of technical expertise, people skills, and business acumen. For Felix, the people are always more important than the tools. I want to thank the people at Packt Publishing for giving me this opportunity to review the book. Jobin Kuruvilla is one of the top people in the JIRA community, so it's an honor for me to be involved. I would also like to thank my girlfriend Genevieve for her continuous support, as well as Paul Gamache and Jean Perron at TechSolCom, to whom I owe a lot professionally. Mizan Ali Sayed is a Master in Computer Science from Pune university, India. Mizan currently works as an Atlassian tools specialist and has experience with implementing, customizing, and supporting large scale enterprise JIRA. He is active within the Atlassian forum "Answers" and has published open source add-ons on the Atlassian Marketplace. I would like to thank my parents and friends for their continuous support and encouragement.
www.PacktPub.com Support files, eBooks, discount offers and more You might want to visit www.PacktPub.com for support files and downloads related to your book. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@ packtpub.com for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. http://PacktLib.PacktPub.com Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books. Why Subscribe? f Fully searchable across every book published by Packt f Copy and paste, print and bookmark content f On demand and accessible via web browser Free Access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access. Instant Updates on New Packt Books Get notified! Find out when new books are published by following @PacktEnterprise on Twitter, or the Packt Enterprise Facebook page.
分享到:
收藏