Permalink
Browse files

internal: initial commit

  • Loading branch information...
0 parents commit 99af1d67c340e4f2342c8f9842bf14f7c44f03cb @grundic committed Jun 9, 2012
@@ -0,0 +1,4 @@
+target
+.idea
+*.iml
+
@@ -0,0 +1,6 @@
+To avoid future confusion, we recommend that you include a license with your plugin.
+This file is simply a reminder.
+
+For a template license you can have a look at: http://www.opensource.org/licenses/
+
+Atlassian releases most of its modules under a BSD license: http://www.opensource.org/licenses/bsd-license.php
@@ -0,0 +1,13 @@
+You have successfully created a plugin using the JIRA plugin archetype!
+
+Here are the SDK commands you'll use immediately:
+
+* atlas-run -- installs this plugin into JIRA and starts it on http://localhost:2990/jira
+* atlas-debug -- same as atlas-run, but allows a debugger to attach at port 5005
+* atlas-cli -- after atlas-run or atlas-debug, opens a Maven command line window:
+ - 'pi' reinstalls the plugin into the running JIRA instance
+* atlas-help -- prints description for all commands in the SDK
+
+Full documentation is always available at:
+
+https://developer.atlassian.com/display/DOCS/Developing+with+the+Atlassian+Plugin+SDK
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>ru.mail.jira.plugins</groupId>
+ <artifactId>jira-issues-disposition</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <organization>
+ <name>Mail.ru</name>
+ <url>http://www.mail.ru/</url>
+ </organization>
+ <name>jira-issues-disposition</name>
+ <description>Plugin for Atlassian JIRA for drag'n'drop issue reordering.</description>
+ <packaging>atlassian-plugin</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>com.atlassian.jira</groupId>
+ <artifactId>jira-api</artifactId>
+ <version>${jira.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.atlassian.jira</groupId>
+ <artifactId>atlassian-jira</artifactId>
+ <version>${jira.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <!-- Add dependency on jira-core if you want access to JIRA implementation classes as well as the sanctioned API. -->
+ <!-- This is not normally recommended, but may be required eg when migrating a plugin originally developed against JIRA 4.x -->
+ <!--
+ <dependency>
+ <groupId>com.atlassian.jira</groupId>
+ <artifactId>jira-core</artifactId>
+ <version>${jira.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.atlassian.jira</groupId>
+ <artifactId>jira-tests</artifactId>
+ <version>${jira.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.atlassian.jira</groupId>
+ <artifactId>jira-func-tests</artifactId>
+ <version>${jira.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.8.5</version>
+ <scope>test</scope>
+ </dependency>
+
+
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ <version>1.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.2.6</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.intellij</groupId>
+ <artifactId>annotations</artifactId>
+ <version>9.0.4</version>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.atlassian.maven.plugins</groupId>
+ <artifactId>maven-jira-plugin</artifactId>
+ <version>${amps.version}</version>
+ <extensions>true</extensions>
+ <configuration>
+ <productVersion>${jira.version}</productVersion>
+ <productDataVersion>${jira.version}</productDataVersion>
+ <instructions/>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ <jira.version>5.0.4</jira.version>
+ <amps.version>3.9.1</amps.version>
+ </properties>
+</project>
@@ -0,0 +1,86 @@
+package ru.mail.jira.plugins.disposition.customfields;
+
+import com.atlassian.jira.issue.customfields.converters.DoubleConverter;
+import com.atlassian.jira.issue.customfields.impl.NumberCFType;
+import com.atlassian.jira.issue.customfields.manager.GenericConfigManager;
+import com.atlassian.jira.issue.customfields.persistence.CustomFieldValuePersister;
+
+/**
+ * User: g.chernyshev
+ * Date: 6/8/12
+ * Time: 1:35 PM
+ */
+
+
+/**
+ * Custom field for ordering issues
+ * <p/>
+ * Disposition query - query, which return list of issues for ordering.
+ * <p/>
+ * <p/>
+ * project = FP
+ * <p/>
+ * issue 1: project = FP
+ * issue 2: project = GG
+ */
+public class IssueDispositionCF extends NumberCFType {
+
+ public IssueDispositionCF(CustomFieldValuePersister customFieldValuePersister, DoubleConverter doubleConverter, GenericConfigManager genericConfigManager) {
+ super(customFieldValuePersister, doubleConverter, genericConfigManager);
+ }
+}
+
+
+//public class IssueDispositionCF extends AbstractSingleFieldType<BigDecimal> {
+//
+// protected IssueDispositionCF(CustomFieldValuePersister customFieldValuePersister, GenericConfigManager genericConfigManager) {
+// super(customFieldValuePersister, genericConfigManager);
+// }
+//
+// @Override
+// @NotNull
+// protected PersistenceFieldType getDatabaseType() {
+// return PersistenceFieldType.
+// }
+//
+// @Override
+// @Nullable
+// protected Object getDbValueFromObject(BigDecimal bigDecimal) {
+// return getStringFromSingularObject(bigDecimal);
+// }
+//
+// @Override
+// @Nullable
+// protected BigDecimal getObjectFromDbValue(@NotNull final Object databaseValue) throws FieldValidationException {
+// return getSingularObjectFromString((String) databaseValue);
+// }
+//
+// @Override
+// @Nullable
+// public String getStringFromSingularObject(BigDecimal bigDecimal) {
+// if (bigDecimal == null) {
+// return null;
+// } else {
+// return bigDecimal.toString();
+// }
+// }
+//
+// @Override
+// @Nullable
+// public BigDecimal getSingularObjectFromString(String string) throws FieldValidationException {
+// if (string == null) {
+// return null;
+// }
+//
+// try {
+// final BigDecimal bigDecimal = new BigDecimal(string);
+// // Check that we don't have too many decimal places
+// if (bigDecimal.scale() > 2) {
+// throw new FieldValidationException("Maximum of 2 decimal places are allowed.");
+// }
+// return bigDecimal.setScale(2);
+// } catch (NumberFormatException ex) {
+// throw new FieldValidationException("Not a valid number.");
+// }
+// }
+//}
@@ -0,0 +1,45 @@
+package ru.mail.jira.plugins.disposition.manager;
+
+/**
+ * User: g.chernyshev
+ * Date: 6/8/12
+ * Time: 3:47 PM
+ */
+
+import com.atlassian.crowd.embedded.api.User;
+import com.atlassian.jira.issue.Issue;
+import com.atlassian.jira.issue.search.SearchException;
+import com.atlassian.jira.jql.parser.JqlParseException;
+
+/**
+ * Manager for disposition custom field
+ */
+public interface DispositionManager {
+
+
+ /**
+ * @param currentUser
+ * @throws JqlParseException
+ * @throws SearchException
+ */
+ public void resetDisposition(User currentUser) throws JqlParseException, SearchException;
+
+
+ /**
+ * Set order for issue
+ *
+ * @param issue - issue to be ordered
+ * @param value - value for order
+ */
+ public void setDisposition(Issue issue, Double value) throws JqlParseException, SearchException;
+
+
+ /**
+ * Change order for dragged issue
+ *
+ * @param above - issue above current (should have higher order)
+ * @param dragged - current issue
+ * @param below - issue below current (should have lower order)
+ */
+ public void setDisposition(Issue above, Issue dragged, Issue below) throws SearchException, JqlParseException;
+}
Oops, something went wrong.

0 comments on commit 99af1d6

Please sign in to comment.