Exemple #1
0
        public ServerPropertiesSheet(JiraServer server)
        {
            _server = server;
            InitializeComponent();

            _propsheet.SelectedObject = Server;
            Text = string.Format(Stringtable.JiraServerPropertiesTitle, Server.Name);
        }
Exemple #2
0
        protected void OnTestAction(IActionContext ctx)
        {
            JiraServer server;

            server = new JiraServer(Core.ResourceStore.FindUniqueResource(Types.JiraServer, Core.Props.Name, "TestJira"));

            server.Uri = "http://unit-138:8080/rpc/soap/jirasoapservice-v2";

            /*
             *      ResourceProxy proxy = ResourceProxy.BeginNewResource(Types.JiraServer);
             *      proxy.AddLink(Core.Props.Parent, Core.ResourceTreeManager.GetRootForType(Types.JiraServer));
             *      proxy.EndUpdate();
             *
             *      server = new JiraServer(proxy.Resource);
             *      server.Uri = "http://unit-138:8080/rpc/soap/jirasoapservice-v2";
             *      server.Username = "******";
             *      server.Password = "******";
             *      server.Name = "TestJira";
             */

            //return;

            /*
             * IResourceList servers = Core.ResourceStore.GetAllResources(Types.JiraServer);
             * if(servers.Count == 0)
             * {
             *      if(MessageBox.Show(Core.MainWindow, "No JIRA servers found. Create one?", "Jiffa", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) != DialogResult.Yes)
             *              return;
             *
             *      ResourceProxy proxy = ResourceProxy.BeginNewResource(Types.JiraServer);
             *      proxy.EndUpdate();
             *
             *      server = new JiraServer(proxy.Resource);
             *      server.Uri = "http://www.jetbrains.net/jira/rpc/soap/jirasoapservice-v2";
             *      server.Username = "******";
             *      server.Name = "JetBrains JIRA";
             * }
             * else if(servers.Count != 1)
             * {
             *      MessageBox.Show(Core.MainWindow, "Expecting exactly one JIRA server.", "Jiffa");
             *      return;
             * }
             * else
             *      server = new JiraServer(servers[0]);*/

            //new ResourceProxy(server.Resource).AddLink(Core.Props.Parent, Core.ResourceTreeManager.GetRootForType(Types.JiraServer));
            //new ResourceProxy(server.Resource).SetPropAsync(Core.Props.Name, "JetBrains JIRA");

            if (MessageBox.Show(Core.MainWindow, string.Format("Syncing the JIRA server at {0}.", server.Uri), Name, MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) != DialogResult.OK)
            {
                return;
            }

            server.Sync();
        }
Exemple #3
0
        /// <summary>
        /// Creates a new JIRA server resource.
        /// </summary>
        public static JiraServer CreateNew()
        {
            ResourceProxy proxy = ResourceProxy.BeginNewResource(Type);

            proxy.AddLink(Core.Props.Parent, RootResource);
            proxy.EndUpdate();

            JiraServer retval = new JiraServer(proxy.Resource);

            retval.Name = Jiffa.GetRandomName();

            return(retval);
        }
Exemple #4
0
 //public static class Props { public static readonly string JiraId = ""}
 public JiraProject(JiraServer server, IResource resource)
     : base(resource)
 {
     if (resource == null)
     {
         throw new ArgumentNullException("resource");
     }
     if (!resource.GetLinksFrom(Types.JiraServer, Core.Props.Parent).Contains(server.Resource))
     {
         throw new ArgumentException(Stringtable.Error_WrongParent);
     }
     _server = server;
 }
Exemple #5
0
 protected void OnDeleteServer(IActionContext ctx)
 {
     foreach (IResource resource in ctx.SelectedResources)
     {
         if (resource.Type != Types.JiraServer)
         {
             continue;
         }
         JiraServer server = new JiraServer(resource);
         while (MessageBox.Show(Core.MainWindow, string.Format(Stringtable.ConfirmDeleteServer, server.Name), Name, MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.No)
         {
             Thread.Sleep(500);
         }
     }
 }
Exemple #6
0
        /// <summary>
        /// Looks up a user on the given server that has the name specified.
        /// <c>Null</c> if none such found.
        /// </summary>
        public static JiraUser FromName(JiraServer server, string name)
        {
            if (server == null)
            {
                throw new ArgumentNullException("server");
            }
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            IResourceList reslist = server.Resource.GetLinksTo(Types.JiraUser, Core.Props.Parent);

            reslist = reslist.Intersect(Core.ResourceStore.FindResources(Types.JiraUser, Core.Props.Name, name), true);

            return(reslist.Count > 0 ? new JiraUser(server, reslist[0]) : null);
        }
Exemple #7
0
        ///<summary>
        ///
        ///            Registers the plugin resource types, actions and other services.
        ///
        ///</summary>
        ///
        ///<remarks>
        ///
        ///<para>
        ///This is the first method called after the plugin is loaded. It should
        ///            be used to register any resource types or services that could be used by other plugins.
        ///</para>
        ///
        ///<para>
        ///To access the services provided by the core, methods of the static class
        ///            <see cref="T:JetBrains.Omea.OpenAPI.Core" /> can be used. All core services are already available when this
        ///            method is called.
        ///</para>
        ///
        ///</remarks>
        ///
        public void Register()
        {
            try
            {
                Core.PluginLoader.RegisterPluginService(this);

                RegisterActions();

                JiraServer.Register(this);
                SubmitterOptionsPane.Register(this);

                Core.TabManager.RegisterResourceTypeTab(Name, Stringtable.Jira, new string[] { Types.JiraServer, Types.JiraProject, Types.JiraComponent, Types.JiraIssueType, Types.JiraPriority, Types.JiraStatus, Types.JiraCustomField, Types.JiraUser }, Core.Props.Parent, 10);
                IResourceTreePane pane = Core.LeftSidebar.RegisterResourceStructureTreePane(Name, Name, Stringtable.Jira, null, JiraServer.Type);
                pane.ParentProperty       = Core.Props.Parent;
                pane.WorkspaceFilterTypes = new string[] { Types.JiraServer, Types.JiraProject, Types.JiraComponent, Types.JiraIssueType, Types.JiraPriority, Types.JiraStatus, Types.JiraCustomField, Types.JiraUser };
                pane.AddNodeFilter(new ResourceTreePaneNodeFilter());
            }
            catch (Exception ex)
            {
                Core.ReportException(ex, false);
            }
        }
Exemple #8
0
 public JiraUser(JiraServer server, IResource resource)
     : base(resource)
 {
     _server = server;
 }
Exemple #9
0
 public ServerChildHelper(JiraServer server, string restype)
 {
     _server  = server;
     _restype = restype;
 }
Exemple #10
0
 public JiraPriority(JiraServer server, IResource resource)
     : base(resource)
 {
     _server = server;
 }
Exemple #11
0
        protected void OnAddServer(IActionContext ctx)
        {
            JiraServer server = JiraServer.CreateNew();

            server.ShowPropertySheet();
        }
Exemple #12
0
 /// <summary>
 /// Creates a new instance upon a resource.
 /// </summary>
 public JiraCustomField(JiraServer server, IResource resource)
     : base(resource)
 {
     _server = server;
 }
Exemple #13
0
 public JiraIssueType(JiraServer server, IResource resource)
     : base(resource)
 {
     _server = server;
 }