Пример #1
0
        public ServerPropertiesSheet(JiraServer server)
        {
            _server = server;
            InitializeComponent();

            _propsheet.SelectedObject = Server;
            Text = string.Format(Stringtable.JiraServerPropertiesTitle, Server.Name);
        }
Пример #2
0
Файл: Jiffa.cs Проект: mo5h/omeo
        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();
        }
Пример #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);
        }
Пример #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;
 }
Пример #5
0
Файл: Jiffa.cs Проект: mo5h/omeo
 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);
         }
     }
 }
Пример #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);
        }
Пример #7
0
Файл: Jiffa.cs Проект: mo5h/omeo
        ///<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);
            }
        }
Пример #8
0
 public JiraUser(JiraServer server, IResource resource)
     : base(resource)
 {
     _server = server;
 }
Пример #9
0
 public ServerChildHelper(JiraServer server, string restype)
 {
     _server  = server;
     _restype = restype;
 }
Пример #10
0
 public JiraPriority(JiraServer server, IResource resource)
     : base(resource)
 {
     _server = server;
 }
Пример #11
0
Файл: Jiffa.cs Проект: mo5h/omeo
        protected void OnAddServer(IActionContext ctx)
        {
            JiraServer server = JiraServer.CreateNew();

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