Exemple #1
0
        public Page(WbpsResquest req, string sessionId, ISecurity security, ISession session)
        {
            this.sessionId = sessionId;
            this.url       = req.Url;
            this.security  = security;
            this.session   = session;


            this.pageId = getPageId(req.PageId);
            string query = req.Query;

            if (!string.IsNullOrEmpty(query))
            {
                queryStrings = new Dictionary <string, string>();
                string[] nameValues = query.Split('&');
                for (int i = 0; i < nameValues.Length; i++)
                {
                    string[] nameValue = nameValues[i].Split('=');
                    if (nameValue.Length > 1)
                    {
                        queryStrings.Add(nameValue[0], nameValue[1].Trim());
                    }
                }
            }

            pageSchema = null;
            if (WbdlSchemaContainer.Instance().Contains(this.pageId))
            {
                pageSchema = WbdlSchemaContainer.Instance().GetItem(this.pageId);
                pageSchema.ChangedEvent += new Schema.SchemaEventHandler(PageSchema_Changed);
                Initialize();
            }
            this.isOpen = true;
        }
Exemple #2
0
        /// <summary>
        /// 保存页面的Wbdl配置信息
        /// </summary>
        /// <param name="pageFullName"></param>
        /// <param name="wbdl"></param>
        public static void saveWbdl(string pageFullName, WbdlSchema wbdl)
        {
            string pageFile = XSite.MapPath(pageFullName);
            string pageId   = pageFile.Remove(0, XSite.SitePhysicalPath.Length);

            wbdl.Id = pageId;
            WbdlSchemaContainer.Instance().UpdateItem(pageId, wbdl);
        }
Exemple #3
0
        public static string getPageId(string path)
        {
            string pageFile = XSite.MapPath(path);

            string pageId = pageFile.Remove(0, XSite.SitePhysicalPath.Length);

            if (WbdlSchemaContainer.Instance().Contains(pageId))
            {
                return(pageId);
            }

            string oldPageId = Path.ChangeExtension(pageFile, "").TrimEnd('.');

            oldPageId = oldPageId.Remove(0, XSite.SitePhysicalPath.Length);
            if (WbdlSchemaContainer.Instance().Contains(oldPageId))
            {
                return(oldPageId);
            }

            return(pageId);
        }
Exemple #4
0
        public static WbdlSchema getWbdl(string pageFullName)
        {
            string pageFile = XSite.MapPath(pageFullName);

            string pageId = pageFile.Remove(0, XSite.SitePhysicalPath.Length);

            if (WbdlSchemaContainer.Instance().Contains(pageId))
            {
                return(WbdlSchemaContainer.Instance().GetItem(pageId));
            }

            string oldPageId = Path.ChangeExtension(pageFile, "").TrimEnd('.');

            oldPageId = oldPageId.Remove(0, XSite.SitePhysicalPath.Length);

            if (WbdlSchemaContainer.Instance().Contains(oldPageId))
            {
                return(WbdlSchemaContainer.Instance().GetItem(oldPageId));
            }

            return(new WbdlSchema());
        }