{"id":256283,"date":"2015-04-29T11:37:02","date_gmt":"2015-04-29T07:37:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=256283"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=256283","title":{"rendered":"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043b\u044f JIRA \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445: \u0427\u0430\u0441\u0442\u044c 1"},"content":{"rendered":"<p>     \t\u041f\u043b\u0430\u0433\u0438\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u0431\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u0432 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438 \u0431\u0443\u0434\u0435\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>  \u041f\u043b\u0430\u0433\u0438\u043d \u0431\u0443\u0434\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u0434\u0436\u0438\u0440\u0430 4.4.4. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u041f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Atlassian SDK, \u0430 \u0437\u0430\u0442\u0435\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0432 \u043b\u044e\u0431\u0438\u043c\u043e\u0439 IDE. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f \u0431\u0443\u0434\u0443 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Netbeans. \u0424\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/bd6\/e1f\/35b\/bd6e1f35baca4831998aeab64d11898c.png\"\/><br \/>  <a name=\"habracut\"><\/a>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0443, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u0448 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b. \u0412 \u0434\u0436\u0438\u0440\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u2013 <a href=\"https:\/\/developer.atlassian.com\/display\/JIRADEV\/Creating+a+JIRA+Report\">report<\/a>, <a href=\"https:\/\/developer.atlassian.com\/display\/JIRADEV\/Webwork+plugin+module\">webwork actions<\/a>, <a href=\"https:\/\/developer.atlassian.com\/display\/JIRADEV\/Servlet+Plugin+Module\">servlet<\/a>, \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u044b\u0431\u0435\u0440\u0435\u043c webwork actions. \u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0430 \u0441 JIRA \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0435 \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438 \u0437\u043d\u0430\u043a\u043e\u043c\u043e (\u043f\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u0442\u043e\u0442 \u0436\u0435 Apache Struts). \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 MyAction.java, \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 JiraWebActionSupport. \u0418 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c <a href=\"https:\/\/developer.atlassian.com\/display\/JIRADEV\/Velocity+Templates\">velocity<\/a> \u0448\u0430\u0431\u043b\u043e\u043d succeess.vm \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"javascript\">MyAction template <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 atlassian-plugin.xml \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b:<\/p>\n<pre><code class=\"xml\">&lt;webwork1 key=&quot;actions&quot; name=&quot;MyActions&quot;&gt;  &lt;actions&gt;               &lt;action name=&quot;com.edsd.jira.plugins.simpleplugin.action.MyAction&quot; alias=&quot;action&quot; roles-required=&quot;admin&quot;&gt;    &lt;view name=&quot;success&quot;&gt;\/myaction\/success.vm&lt;\/view&gt;   &lt;\/action&gt;  &lt;\/actions&gt; &lt;\/webwork1&gt; <\/code><\/pre>\n<p>  \u0418 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"http:\/\/myserver\/secure\/action.jspa\">http:\/\/myserver\/secure\/action.jspa<\/a> \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u043d\u0430\u043c\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443:<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/cda\/db8\/99b\/cdadb899b11c4839876c2a84ea360816.png\"\/> <\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431 \u044d\u0442\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0430 \u0441\u0442\u0430\u043b\u0430 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435, \u043a\u0430\u043a \u0432\u043a\u043b\u0430\u0434\u043a\u0430 \u0432 \u0430\u0434\u043c\u0438\u043d\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u0430\u043c\u0443 \u0441\u0441\u044b\u043b\u043a\u0443:<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/d4c\/91d\/ee0\/d4c91dee08854a0680dbb87cd5b7d2ad.png\"\/><\/p>\n<p>  \u0427\u0442\u043e\u0431 \u0441\u0441\u044b\u043b\u043a\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u043e\u0439, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 atlassian-plugin.xml \u043d\u043e\u0432\u0443\u044e \u0441\u0435\u043a\u0446\u0438\u044e (<a href=\"https:\/\/developer.atlassian.com\/display\/JIRADEV\/Web+Section+Plugin+Module\">web-section<\/a>). \u0417\u0430\u0442\u0435\u043c \u0432 \u044d\u0442\u0443 \u0441\u0435\u043a\u0446\u0438\u044e \u0443\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0430\u043c\u0443 \u0441\u0441\u044b\u043b\u043a\u0443 (<a href=\"https:\/\/developer.atlassian.com\/display\/JIRADEV\/Web+Item+Plugin+Module\">web-item<\/a>):<\/p>\n<pre><code class=\"html\">&lt;web-section key=&quot;my_section&quot; name=&quot;MySection&quot; location=&quot;atl.jira.proj.config&quot; weight=&quot;50&quot;\/&gt; &lt;web-item key=&quot;my_item_link&quot; name=&quot;MyTab&quot; section=&quot;atl.jira.proj.config\/my_section&quot;  weight=&quot;10&quot;&gt;   &lt;label key=&quot;MyLink&quot; \/&gt;   &lt;link linkId=&quot;my_item_link&quot;&gt;\/secure\/action.jspa&lt;\/link&gt; &lt;\/web-item&gt; <\/code><\/pre>\n<p>  \u041d\u043e \u043f\u0440\u0438 \u043a\u043b\u0438\u043a\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u043c\u044b \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0431\u0435\u0437 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0432\u043d\u0435\u0441\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 MyAction.java. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"http:\/\/myserver\/secure\/action.jspa\">http:\/\/myserver\/secure\/action.jspa<\/a> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 execute() \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2013\u044d\u0442\u043e success \u043f\u043e\u044d\u0442\u043e\u043c\u0443-\u0442\u043e \u043c\u044b \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u043d\u0430\u0448 action \u0432 atlassian-plugin.xml. \u0422\u0430\u043a \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u044f\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u0435\u0439\u0447\u0430\u0441 \u0430\u043a\u0442\u0438\u0432\u0435\u043d, \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u00ab\u0448\u0430\u043f\u043a\u0443\u00bb \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043a \u0432\u043a\u043b\u0430\u0434\u043a\u0435. <\/p>\n<pre><code class=\"javascript\">public class MyAction extends JiraWebActionSupport {   private Project project;   @Override   public String execute() throws Exception {     project = getSelectedProjectObject(); \/\/\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0448\u0430\u043f\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043a \u0432\u043a\u043b\u0430\u0434\u043a\u0435     request.setAttribute(&quot;com.atlassian.jira.projectconfig.util.ServletRequestProjectConfigRequestCache:project&quot;, project);     return super.execute();   } } <\/code><\/pre>\n<p>  \u041d\u043e \u0442\u0430\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e html \u043a\u043e\u0434 \u0431\u0435\u0437 css. \u0427\u0442\u043e\u0431 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c css \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0434\u043e\u043f\u0438\u0448\u0435\u043c \u0432 atlassian-plugin.xml<\/p>\n<pre><code class=\"xml\">&lt;web-resource key=&quot;my-resources&quot;&gt;     &lt;dependency&gt;com.atlassian.jira.jira-project-config-plugin:project-config-global&lt;\/dependency&gt;     &lt;context&gt;my-resources&lt;\/context&gt;   &lt;\/web-resource&gt; <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c dependency \u0434\u043b\u044f \u0441\u0430\u043c\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438 \u043e\u0431\u044a\u044f\u0432\u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 context \u0442\u043e, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044d\u0442\u0438\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430.<br \/>  \u0422\u043e\u0433\u0434\u0430 velocity \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u0432\u0438\u0434\u0443:<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE HTML&gt; &lt;html&gt;     &lt;head&gt;         &lt;title&gt;MyTestPage&lt;\/title&gt;         &lt;meta name=&quot;decorator&quot; content=&quot;atl.admin&quot;\/&gt;         &lt;meta name=&quot;projectKey&quot; content=&quot;$project.getKey()&quot;\/&gt;         &lt;meta name=&quot;projectId&quot; content=&quot;$project.getId()&quot;\/&gt;         &lt;meta name=&quot;admin.active.tab&quot; content=&quot;my_item_link&quot;\/&gt;         &lt;meta name=&quot;admin.active.section&quot; content=&quot;atl.jira.proj.config&quot;\/&gt;         $webResourceManager.requireResourcesForContext(&quot;my-resources&quot;)     &lt;\/head&gt;      &lt;body&gt;         MyAction template     &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443:<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/2a8\/116\/012\/2a81160125d54778964e2d5beb915f93.png\"\/><br \/>  \u2003<br \/>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u0434\u0435\u043c <a href=\"https:\/\/developer.atlassian.com\/display\/DOCS\/Active+Objects\">Active Objects<\/a> (\u0434\u0430\u043b\u044c\u0448\u0435 AO). \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043a\u0435\u0442 logic. \u0412 \u043d\u0435\u043c \u043e\u043f\u0438\u0448\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043f\u0443\u0441\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0439 Student:<\/p>\n<pre><code class=\"javascript\">public interface Student {     public void setName(String name);     public String getName(); } <\/code><\/pre>\n<p>  \u0412 \u043f\u0430\u043a\u0435\u0442\u0435 entity \u043e\u043f\u0438\u0448\u0435\u043c \u043d\u0430\u0448 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441-\u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0411\u0414. \u041f\u0443\u0441\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432 \u0431\u0430\u0437\u0435 \u0435\u0449\u0435 \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438:<\/p>\n<pre><code class=\"javascript\">import java.util.Date; import net.java.ao.Entity; public interface StudentEntity extends Entity, Student {     public Date getCreated();     public void setCreated(Date created); } <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 AO \u0432 atlassian-plugin.xml:<\/p>\n<pre><code class=\"xml\">&lt;component-import key=&quot;ao&quot; name=&quot;Active Objects service&quot; interface=&quot;com.atlassian.activeobjects.external.ActiveObjects&quot;&gt;   &lt;description&gt;Component to access Active Objects functionality from the plugin&lt;\/description&gt; &lt;\/component-import&gt;      &lt;ao key=&quot;ao-module&quot;&gt;   &lt;entity&gt;com.edsd.jira.plugins.simpleplugin.entity.StudentEntity&lt;\/entity&gt; &lt;\/ao&gt; <\/code><\/pre>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 AO \u043a \u043f\u043b\u0430\u0433\u0438\u043d\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/developer.atlassian.com\/display\/DOCS\/Getting+Started+with+Active+Objects\">\u0442\u0443\u0442<\/a>.<br \/>  \u2003<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0441 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 StudentDAO \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 DAO, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043d\u0430\u0431\u043e\u0440 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n<pre><code class=\"javascript\">public interface StudentDAO {     public StudentEntity addStudent(Student student) throws Exception;      public StudentEntity[] getStudents() throws Exception;  } \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 DAO.Impl \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 StudentDAOImpl.  public class StudentDAOImpl implements StudentDAO {     private final ActiveObjects ao;      public StudentDAOImpl(ActiveObjects ao) {         this.ao = ao;     }     @Override     public StudentEntity addStudent(final Student student) throws Exception {         return ao.executeInTransaction(new TransactionCallback&lt;StudentEntity&gt;() {             @Override             public StudentEntity doInTransaction() {                 StudentEntity entity = ao.create(StudentEntity.class);                  entity.setName(student.getName());                 entity.setCreated(new Date(System.currentTimeMillis()));                 entity.save();                 return entity;             }         });     }     @Override     public StudentEntity[] getStudents() throws Exception {         return ao.executeInTransaction(new TransactionCallback&lt;StudentEntity[]&gt;() {             @Override             public StudentEntity[] doInTransaction() {                 return ao.find(StudentEntity.class);             }         });     } } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 DAOFactory \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 DAO, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0437\u0430 \u043d\u0430\u0448\u0438\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438 DAO, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438 \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u043c \u043c\u0435\u0442\u043e\u0434\u044b:<\/p>\n<pre><code class=\"javascript\">public class DAOFactory {     private static StudentDAO studentDAO = null;     private static DAOFactory instance = null;     private static ActiveObjects ao;     public DAOFactory(ActiveObjects ao) {         DAOFactory.ao = ao;     }     public static synchronized DAOFactory getInstance() {         if (instance == null) {             instance = new DAOFactory(ao);         }         return instance;     }     public StudentDAO getStudentDAO() {         if (studentDAO == null) {             studentDAO = new StudentDAOImpl(ao);         }         return studentDAO;     } } <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 atlassian-plugin.xml \u043d\u0430\u0448\u0443 DAOFactory. \u042d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u043a AO. \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e: \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u043d\u0430 \u0442\u0435\u043c\u0443 <a href=\"http:\/\/www.j-tricks.com\/1\/post\/2012\/07\/active-objects-injection.html\">Active Objects injection<\/a>.<\/p>\n<pre><code class=\"xml\">   &lt;component key=&quot;dao-factory&quot; class=&quot;com.edsd.jira.plugins.simpleplugin.DAO.DAOFactory&quot;&gt;     &lt;\/component&gt; <\/code><\/pre>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438, \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 MyAction:<\/p>\n<pre><code class=\"javascript\">public class MyAction extends JiraWebActionSupport {     private Project project;     private StudentEntity[] students;     @Override     public String execute() throws Exception {         project = getSelectedProjectObject(); request.setAttribute(&quot;com.atlassian.jira.projectconfig.util.ServletRequestProjectConfigRequestCache:project&quot;, project);         students = DAOFactory.getInstance().getStudentDAO().getStudents();         return super.execute();     }     public String doAdd() throws Exception {         String name = request.getParameterValues(&quot;name&quot;)[0];          Student student = new StudentImpl(name);          DAOFactory.getInstance().getStudentDAO().addStudent(student);          ServletActionContext.getResponse().sendRedirect(&quot;\/secure\/action.jspa&quot;);         return NONE;     } } <\/code><\/pre>\n<p>  \u0418 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 velocity \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0442\u0435\u0433 body \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u0432\u0438\u0434\u0443:<\/p>\n<pre><code class=\"xml\">&lt;body&gt;         &lt;form action=&quot;\/secure\/action!add.jspa&quot;&gt;             &lt;input type=&quot;text&quot; name=&quot;name&quot;\/&gt;             &lt;input type=&quot;submit&quot; value=&quot;OK&quot;\/&gt;         &lt;\/form&gt;         &lt;table&gt;             &lt;thead&gt;                 &lt;th&gt;id&lt;\/th&gt;                 &lt;th&gt;name&lt;\/th&gt;                 &lt;th&gt;created&lt;\/th&gt;             &lt;\/thead&gt;             &lt;tbody&gt;             #foreach($student in $students)                 &lt;tr&gt;                     &lt;td&gt;$student.getID()&lt;\/td&gt;                     &lt;td&gt;$student.getName()&lt;\/td&gt;                     &lt;td&gt;$student.getCreated()&lt;\/td&gt;                 &lt;\/tr&gt;             #end             &lt;\/tbody&gt;         &lt;\/table&gt;     &lt;\/body&gt; <\/code><\/pre>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/b37\/042\/cc8\/b37042cc8f8f443285811a1bdf275b48.png\"\/><\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0432\u0441\u0435, \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443:<\/p>\n<ul>\n<li>\u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0430\u0445 \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438 \u0412\u0435\u0440\u0441\u0438\u0438,<\/li>\n<li>\u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a, \u0441 \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u0430\u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432 JIRA,<\/li>\n<li>\u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 JIRA.Restfultable <\/li>\n<li>\u0438 \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f JIRA REST API.<\/li>\n<\/ul>\n<p>  \u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043d\u0430 <a href=\"https:\/\/github.com\/edsd\/jira-simple-plugin\">GitHub<\/a>     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/256789\/\"> http:\/\/habrahabr.ru\/post\/256789\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t\u041f\u043b\u0430\u0433\u0438\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u0431\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u0432 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438 \u0431\u0443\u0434\u0435\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>  \u041f\u043b\u0430\u0433\u0438\u043d \u0431\u0443\u0434\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u0434\u0436\u0438\u0440\u0430 4.4.4. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u041f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Atlassian SDK, \u0430 \u0437\u0430\u0442\u0435\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0432 \u043b\u044e\u0431\u0438\u043c\u043e\u0439 IDE. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f \u0431\u0443\u0434\u0443 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Netbeans. \u0424\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/bd6\/e1f\/35b\/bd6e1f35baca4831998aeab64d11898c.png\"\/>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-256283","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/256283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=256283"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/256283\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=256283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=256283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=256283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}