package net.openl10n.flies.client.ant.po;

import net.openl10n.flies.client.commands.ArgsUtil;
import net.openl10n.flies.client.commands.FliesCommand;
import net.openl10n.flies.client.commands.PutVersionCommand;
import net.openl10n.flies.client.commands.PutVersionOptions;
import org.kohsuke.args4j.Option;

public class CreateIterationTask extends ConfigurableTask implements PutVersionOptions
{
   // private static final Logger log =
   // LoggerFactory.getLogger(CreateIterationTask.class);

   private String proj;
   private String iter;
   private String name;
   private String desc;

   public static void main(String[] args)
   {
      CreateIterationTask task = new CreateIterationTask();
      ArgsUtil.processArgs(args, task);
   }

   @Override
   public String getCommandName()
   {
      return "createiter";
   }

   @Override
   public String getCommandDescription()
   {
      return "Creates a project iteration in Flies";
   }


   @Option(name = "--proj", metaVar = "PROJ", usage = "Flies project ID", required = true)
   public void setVersionProject(String id)
   {
      this.proj = id;
   }

   @Option(name = "--version-slug", metaVar = "VER", usage = "Flies project version ID", required = true)
   public void setVersionSlug(String id)
   {
      this.iter = id;
   }

   @Option(name = "--version-name", metaVar = "NAME", usage = "Flies project version name", required = true)
   public void setVersionName(String name)
   {
      this.name = name;
   }


   @Option(name = "--version-desc", metaVar = "DESC", usage = "Flies project version description", required = true)
   public void setVersionDesc(String desc)
   {
      this.desc = desc;
   }


   @Override
   public FliesCommand initCommand()
   {
      return new PutVersionCommand(this);
   }


   public String getVersionProject()
   {
      return this.proj;
   }

   @Override
   public String getVersionSlug()
   {
      return this.iter;
   }

   @Override
   public String getVersionDesc()
   {
      return this.desc;
   }

   @Override
   public String getVersionName()
   {
      return this.name;
   }

}

@@ -540,56 +540,8 @@
 ter;
-%0A   private String name;%0A   private String desc;
 %0A%0A  
@@ -1247,391 +1247,8 @@
  %7D%0A%0A
-   @Option(name = %22--version-name%22, metaVar = %22NAME%22, usage = %22Flies project version name%22, required = true)%0A   public void setVersionName(String name)%0A   %7B%0A      this.name = name;%0A   %7D%0A%0A%0A   @Option(name = %22--version-desc%22, metaVar = %22DESC%22, usage = %22Flies project version description%22, required = true)%0A   public void setVersionDesc(String desc)%0A   %7B%0A      this.desc = desc;%0A   %7D%0A%0A%0A
    @
@@ -1463,32 +1463,32 @@
 sionSlug()%0A   %7B%0A
+
       return thi
@@ -1505,170 +1505,6 @@
  %7D%0A%0A
-   @Override%0A   public String getVersionDesc()%0A   %7B%0A      return this.desc;%0A   %7D%0A%0A   @Override%0A   public String getVersionName()%0A   %7B%0A      return this.name;%0A   %7D%0A%0A
 %7D%0A

Rework Create Version page (remove Name and Description from the database and UI)