Example #1
0
        /// <summary>
        /// 保存插件数据到XML文件中
        /// </summary>
        public void SavePluginMetadataToXml()
        {
            string fileName = String.Concat(FwCtx.PhysicalPath, FwCtx.Variables.TempPath, "plugin_meta.xml");

            if (File.Exists(fileName))
            {
                File.Delete(fileName);
            }

            AutoObjectXml xml = new AutoObjectXml(fileName);

            base.Iterate((p, a) =>
            {
                xml.InsertObjectNode(a.WorkIndent, a.Name, a.Description,
                                     new XmlObjectProperty("version", "版本", a.Version),
                                     new XmlObjectProperty("state", "状态", ((int)a.State).ToString()),
                                     new XmlObjectProperty("author", "作者", a.Author),
                                     new XmlObjectProperty("icon", "图标", a.Icon),
                                     new XmlObjectProperty("webpage", "官网", a.WebPage),
                                     new XmlObjectProperty("portalUrl", "入口地址", a.PortalUrl),
                                     new XmlObjectProperty("configUrl", "设置地址", a.ConfigUrl)
                                     );
            });
            xml.Flush();
        }
Example #2
0
        public void Template()
        {
            string action = System.Web.HttpContext.Current.Request["action"];

            if (action == "help")
            {
                string fileName = String.Concat(Cms.PyhicPath,
                                                CmsVariables.TEMP_PATH,
                                                "tpl_lang_guid.xml");
                AutoObjectXml obj = new AutoObjectXml(fileName);
                obj.InsertFromType(typeof(CmsTemplateImpl), false);
                obj.Flush();

                var rsp = System.Web.HttpContext.Current.Response;
                rsp.Write(XmlObjectDoc.DocStyleSheet);

                int tmpInt = 0;
                foreach (XmlObject _obj in obj.GetObjects())
                {
                    rsp.Write(XmlObjectDoc.GetGrid(_obj, ++tmpInt));
                }
            }
            else
            {
                TemplateUtility.PrintTemplatesInfo();
            }
        }
        public void Template()
        {
            string action = HttpHosting.Context.Request.GetParameter("action");

            if (action == "help")
            {
                string fileName = String.Concat(Cms.PhysicPath,
                                                CmsVariables.TEMP_PATH,
                                                "tpl_lang_guid.xml");
                AutoObjectXml obj = new AutoObjectXml(fileName);
                obj.InsertFromType(typeof(CmsTemplateImpl), false);
                obj.Flush();

                var rsp = HttpHosting.Context.Response;
                rsp.WriteAsync(XmlObjectDoc.DocStyleSheet);

                int tmpInt = 0;
                foreach (XmlObject _obj in obj.GetObjects())
                {
                    rsp.WriteAsync(XmlObjectDoc.GetGrid(_obj, ++tmpInt));
                }
            }
            else
            {
                HttpHosting.Context.Response.WriteAsync(TemplateUtility.GetTemplatePagesHTML());
            }
        }
Example #4
0
		/// <summary>
		/// 保存插件数据到XML文件中
		/// </summary>
		public void SavePluginMetadataToXml()
		{
			string fileName=String.Concat(Cms.PyhicPath,CmsVariables.PLUGIN_META_FILE);
			
			if(File.Exists(fileName))
			{
				File.Delete(fileName);
			}
			
			AutoObjectXml xml=new AutoObjectXml(fileName);
			
			base.Iterate((p,a)=>{
			             	xml.InsertObjectNode(a.WorkIndent,a.Name,a.Description,
			             	                     new XmlObjectProperty("version","版本",a.Version),
			             	                     new XmlObjectProperty("state","状态",((int)a.State).ToString()),
			             	                     new XmlObjectProperty("author","作者",a.Author),
			             	                     new XmlObjectProperty("icon","图标",a.Icon),
			             	                     new XmlObjectProperty("webpage","官网",a.WebPage),
			             	                     new XmlObjectProperty("portalUrl","入口地址",a.PortalUrl),
			             	                     new XmlObjectProperty("configUrl","设置地址",a.ConfigUrl)
			             	                    );
			             	
			             });
			xml.Flush();
		}
Example #5
0
        /// <summary>
        /// 获取插件Json数据
        /// </summary>
        public void GetPluginsJson_Post()
        {
            string        jsonStr = "";
            AutoObjectXml xml     = new AutoObjectXml(
                String.Concat(Cms.PyhicPath,
                              CmsVariables.PLUGIN_META_FILE));
            XmlObject json = xml.GetObject("plugin_json_data");

            if (json == null)
            {
                jsonStr = XmlObject.ToJson(xml.GetObjects());
                xml.InsertObjectNode("plugin_json_data", "插件Json数据", jsonStr);
                xml.Flush();
            }
            else
            {
                jsonStr = json.Descript;
            }

            base.Response.Write(jsonStr);
        }
Example #6
0
     /// <summary>
     /// 获取插件Json数据
     /// </summary>
     public void GetPluginsJson_Post()
     {
     	string jsonStr="";	
 		AutoObjectXml xml=new AutoObjectXml(
             String.Concat(Cms.PyhicPath,
             CmsVariables.Plugin_META_FILE));
 		XmlObject json=xml.GetObject("plugin_json_data");
 		
 		if(json==null)
 		{
 			jsonStr=XmlObject.ToJson(xml.GetObjects());
 			xml.InsertObjectNode("plugin_json_data","插件Json数据",jsonStr);
 			xml.Flush();
 		}
 		else
 		{
 			jsonStr=json.Descript;
 		}
 		
 		base.Response.Write(jsonStr);
     }
Example #7
0
        public void Template()
        {
            string action = System.Web.HttpContext.Current.Request["action"];
            if (action == "help")
            {
                string fileName = String.Concat(AtNet.Cms.Cms.PyhicPath,
                    CmsVariables.TEMP_PATH,
                    "tpl_lang_guid.xml");
                AutoObjectXml obj = new AutoObjectXml(fileName);
                obj.InsertFromType(typeof(CmsTemplates), false);
                obj.Flush();

                var rsp = System.Web.HttpContext.Current.Response;
                rsp.Write(XmlObjectDoc.DocStyleSheet);

                int tmpInt = 0;
                foreach (XmlObject _obj in obj.GetObjects())
                {

                    rsp.Write(XmlObjectDoc.GetGrid(_obj, ++tmpInt));
                }
            }
            else
            {
                TemplateUtility.PrintTemplatesInfo();
            }
        }