예제 #1
0
        void SpaceComboBox_SelectedValueChanged(object sender, EventArgs e)
        {
            string             spaceName = SpaceComboBox.Text;
            RemoteSpaceSummary space     = m_spaces.ContainsKey(spaceName) ? m_spaces[spaceName] : null;

            SpaceExistsLabel.Text = (space == null) ? "New" : "Exists";
            SetRootPages(space);
        }
예제 #2
0
        internal Space(RemoteSpaceSummary space)
        {
            SpaceKey = space.key;
            Name     = space.name;
            Type     = (SpaceType)Enum.Parse(typeof(SpaceType), space.type, true);
            Url      = space.url;

            // if RemoteSpace, then extract additional information
            if (space.GetType() == typeof(RemoteSpace))
            {
                HomePage    = ((RemoteSpace)space).homePage;
                Description = ((RemoteSpace)space).description;
            }
        }
예제 #3
0
        private string ComputeSpaceRootPath(string basePath, RemoteSpaceSummary space, string teamlabel)
        {
            string ret = string.Empty;

            if (space.type == ConfluencePersonalSpaceTypeName)
            {
                //Personal space path. Confluence uses "~username" as key of personal space
                string userName              = space.key.Substring(1);
                string dekiUserName          = userName;
                ACConverterUserInfo userInfo = null;
                if (_convertedUsers.TryGetValue(userName.ToLower(), out userInfo))
                {
                    dekiUserName = userInfo.DekiUserName;
                }

                ret = basePath;
                if (!string.IsNullOrEmpty(basePath))
                {
                    ret += XUri.DoubleEncode("/");
                }
                //append team label path here if it exists
                if (!String.IsNullOrEmpty(teamlabel))
                {
                    ret += Utils.DoubleUrlEncode(teamlabel + "/");
                }

                ret = Utils.DoubleUrlEncode(Utils.GetDekiUserPageByUserName(dekiUserName));
            }
            else
            {
                // Global space path
                ret = basePath;
                if (!string.IsNullOrEmpty(basePath))
                {
                    ret += XUri.DoubleEncode("/");
                }
                //append team label path here if it exists
                if (!String.IsNullOrEmpty(teamlabel))
                {
                    //there is already a slash at the end of the ret so no need to add it
                    // if (( ret.Length == 0) || (ret.LastIndexOf('/') != ret.Length))
                    //    ret += XUri.DoubleEncode("/");
                    ret += Utils.DoubleUrlEncode(teamlabel + "/");
                }
                ret += Utils.DoubleUrlEncode(space.key);
            }
            return(ret);
        }
예제 #4
0
        void SetRootPages(RemoteSpaceSummary space)
        {
            m_pages.Clear();
            RootPageComboBox.Items.Clear();
            RootPageComboBox.Items.Add(m_initialRootPageName);

            if (space != null)
            {
                List <RemotePageSummary> pages = m_confluenceService.GetPages(space.key);
                foreach (RemotePageSummary page in pages)
                {
                    m_pages[page.title] = page;

                    if (page.title != m_initialRootPageName)
                    {
                        RootPageComboBox.Items.Add(page.title);
                    }
                }
            }

            RootPageComboBox.SelectedItem = m_initialRootPageName;
        }
예제 #5
0
 public Space(RemoteSpaceSummary space)
 {
     Key  = space.key;
     Name = space.name;
 }