Exemple #1
0
        public void Remove(IKeyword keyword)
        {
            const string DELETE_KEYWORD =
                @"<PROJECT><PAGE guid=""{0}"" action=""unlink""><KEYWORD guid=""{1}"" /></PAGE></PROJECT>";

            _page.Project.ExecuteRQL(DELETE_KEYWORD.RQLFormat(_page, keyword));

            InvalidateCache();
        }
Exemple #2
0
        public void DeleteForcibly()
        {
            const string DELETE_KEYWORD = @"<KEYWORD action=""delete"" guid=""{0}"" force=""1"" password=""{1}"" />";

            var xmlDoc =
                Project.ExecuteRQL(DELETE_KEYWORD.RQLFormat(this, Project.Session.ServerLogin.AuthData.Password),
                                   RqlType.SessionKeyInProject);
            var keyword = (XmlElement)xmlDoc.SelectSingleNode("/IODATA/KEYWORD");

            //TODO execute page builder command
            if (keyword == null)
            {
                throw new SmartAPIException(Session.ServerLogin, string.Format("Could not delete keyword {0}", this));
            }

            Category.Keywords.InvalidateCache();
        }
Exemple #3
0
        public void Delete()
        {
            const string DELETE_KEYWORD = @"<KEYWORD action=""delete"" guid=""{0}"" force=""0""/>";

            var xmlDoc  = Project.ExecuteRQL(DELETE_KEYWORD.RQLFormat(this), RqlType.SessionKeyInProject);
            var keyword = (XmlElement)xmlDoc.SelectSingleNode("/IODATA/KEYWORD");

            if (keyword == null)
            {
                throw new SmartAPIException(Session.ServerLogin, string.Format("Could not delete keyword {0}", this));
            }

            if (IsKeywordStillUsed(keyword))
            {
                throw new SmartAPIException(Session.ServerLogin,
                                            string.Format(
                                                "Could not delete keyword {0}, because it is still used for page connections",
                                                this));
            }

            Category.Keywords.InvalidateCache();
        }