private void ListMarquee_PreRender(object sender, EventArgs e) { try { this.EnsureChildControls(); //Create XML Document that will hold list items in XML suitable for marquee XSL XmlDocument xDoc = new XmlDocument(); XmlElement elmItems = xDoc.CreateElement("Items"); xDoc.AppendChild(elmItems); XmlElement elmItem; //Add the Title and Body fields here to make sure they're values return regardless of //selected view's ViewFields definitions. //This solves a case when the selected view does not return the fields selected for the marquee. string viewFields = string.Format("<FieldRef Name='{0}'/><FieldRef Name='{1}'/>", this.TitleFieldName, this.BodyFieldName); //If nothing was defined by the user so far - connect to Announcements list. if (base.ListName.Trim() == string.Empty) { base.ListName = "Announcements"; } //Add each item from the selected view to the XML foreach (SPListItem itm in base.GetListViewItems(viewFields)) { try { elmItem = xDoc.CreateElement("Item"); string title = itm[this.TitleFieldName] == null ? "No title" : itm[this.TitleFieldName].ToString(); string body = itm[this.BodyFieldName] == null ? "No body" : itm[this.BodyFieldName].ToString(); elmItem.SetAttribute("Title", title); elmItem.SetAttribute("Body", body); elmItem.SetAttribute("ViewItemUrl", string.Format(base.TheListViewItemFormUrlFormat, itm.ID)); elmItems.AppendChild(elmItem); } catch { } } //XSL parameters and transform. The return HTML is inserted to the literal control that writes it //to the page. System.Xml.Xsl.XsltArgumentList arguments = new System.Xml.Xsl.XsltArgumentList(); arguments.AddParam("MarqueeAmount", "", this.MarqueeAmount); arguments.AddParam("MarqueeDelay", "", this.MarqueeDelay); arguments.AddParam("MarqueeDirection", "", this.MarqueeDirection.ToString()); arguments.AddParam("LinkTarget", "", this.LinkTarget.ToString()); XmlTransformHTML.Text = Utilities.XslTransform(xDoc, arguments, getXSLFileLocation()); } catch (Exception ex) { base.AddError(ex); } }
protected override void AddXsltParameters(System.Xml.Xsl.XsltArgumentList argumentList) { base.AddXsltParameters(argumentList); var mainscenario = this.MainScenario; if (string.IsNullOrEmpty(mainscenario)) { mainscenario = "ListItem"; } argumentList.AddParam("groupBy", "", this.GroupBy ?? string.Empty); argumentList.AddParam("mainscenario", "", mainscenario); }
public string ConvertToHTML(DisplFormat format) { var dSer = new System.Runtime.Serialization.DataContractSerializer(this.GetType()); System.IO.MemoryStream ms = new System.IO.MemoryStream(); var xTrf = new System.Xml.Xsl.XslCompiledTransform(); var xTrfArg = new System.Xml.Xsl.XsltArgumentList(); var xSet = new System.Xml.Xsl.XsltSettings(true, true); var mstr = new System.Xml.XmlTextWriter(new System.IO.MemoryStream(), System.Text.Encoding.UTF8); var doc = new System.Xml.XmlDocument(); string xsltName = ""; switch (format) { case DisplFormat.single_item: xsltName = "~/xslt/ViewTransforms/RQI2SingleItemView.xslt"; break; case DisplFormat.short_title: xsltName = "~/xslt/ViewTransforms/RQI2ShortTitleView.xslt"; break; default: xsltName = "~/xslt/ViewTransforms/RQI2SingleItemView.xslt"; break; } dSer.WriteObject(ms, this); //TESTDATEI(EZEUGEN) //XmlDocument Doc = new XmlDocument(); //ms.Seek(0, System.IO.SeekOrigin.Begin); //Doc.Load(ms); //Doc.Save("C:/MVCTest.xml"); //ENDE TESTDATEI System.IO.TextReader tr = new System.IO.StringReader(System.Text.Encoding.UTF8.GetString(ms.GetBuffer(), 0, (int)ms.Position)); xTrf.Load(HttpContext.Current.Server.MapPath(xsltName), xSet, new XmlUrlResolver()); xTrfArg.AddParam("ApplPath", "", "http://" + HttpContext.Current.Request.ServerVariables.Get("HTTP_HOST") + (HttpContext.Current.Request.ApplicationPath.Equals("/") ? "" : HttpContext.Current.Request.ApplicationPath) + "/"); xTrfArg.AddParam("MyDocsPath", "", "http://" + HttpContext.Current.Request.ServerVariables.Get("HTTP_HOST") + (HttpContext.Current.Request.ApplicationPath.Equals("/") ? "" : HttpContext.Current.Request.ApplicationPath) + "/"); xTrfArg.AddExtensionObject("urn:TransformHelper", new TransformHelper.TransformUtils()); xTrf.Transform(new System.Xml.XPath.XPathDocument(tr), xTrfArg, mstr); mstr.BaseStream.Flush(); mstr.BaseStream.Seek(0, System.IO.SeekOrigin.Begin); doc.Load(mstr.BaseStream); //TESTDATEI EZEUGEN //doc.Save("C:/MVCTest.xml"); //mstr.BaseStream.Seek(0, System.IO.SeekOrigin.Begin); //var rd = new System.Xml.XmlTextReader(mstr.BaseStream); return(doc.OuterXml); }
protected virtual void AddXsltParameters(System.Xml.Xsl.XsltArgumentList argumentList) { var currentList = ContentList.GetContentListByParentWalk(this); var listPath = currentList == null ? string.Empty : currentList.Path; argumentList.AddParam("listPath", "", listPath); }
private static void Copy(System.Xml.Xsl.XsltArgumentList source, System.Xml.Xsl.XsltArgumentList target) { if (source == null) { throw new ArgumentNullException("source"); } if (target == null) { throw new ArgumentNullException("target"); } var parameters = (Hashtable)Reflector.GetField(source, "parameters"); foreach (DictionaryEntry entry in parameters) { var qn = (XmlQualifiedName)entry.Key; target.AddParam(qn.Name, qn.Namespace, entry.Value); } var extensions = (Hashtable)Reflector.GetField(source, "extensions"); foreach (DictionaryEntry entry in extensions) { target.AddExtensionObject((string)entry.Key, entry.Value); } }
protected void InitAssets() { System.Web.UI.HtmlControls.HtmlLink NetworkBrowsercss = new System.Web.UI.HtmlControls.HtmlLink(); NetworkBrowsercss.Href = Root.Domain + "/Profile/CSS/NetworkBrowser.css"; NetworkBrowsercss.Attributes["rel"] = "stylesheet"; NetworkBrowsercss.Attributes["type"] = "text/css"; NetworkBrowsercss.Attributes["media"] = "all"; Page.Header.Controls.Add(NetworkBrowsercss); HtmlGenericControl jsscript0 = new HtmlGenericControl("script"); jsscript0.Attributes.Add("type", "text/javascript"); jsscript0.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/JavaScript/watchdog.js"); Page.Header.Controls.Add(jsscript0); HtmlGenericControl jsscript1 = new HtmlGenericControl("script"); jsscript1.Attributes.Add("type", "text/javascript"); jsscript1.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkCluster/scriptaculous/lib/prototype.js"); Page.Header.Controls.Add(jsscript1); HtmlGenericControl jsscript2 = new HtmlGenericControl("script"); jsscript2.Attributes.Add("type", "text/javascript"); jsscript2.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkCluster/scriptaculous/src/scriptaculous.js"); Page.Header.Controls.Add(jsscript2); HtmlGenericControl jsscript3 = new HtmlGenericControl("script"); jsscript3.Attributes.Add("type", "text/javascript"); jsscript3.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkCluster/JavaScript/networkBrowserClass.js"); Page.Header.Controls.Add(jsscript3); HtmlGenericControl jsscript4 = new HtmlGenericControl("script"); jsscript4.Attributes.Add("type", "text/javascript"); jsscript4.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkCluster/JavaScript/networkClusterLayoutEngine.js"); Page.Header.Controls.Add(jsscript4); HtmlGenericControl jsscript5 = new HtmlGenericControl("script"); jsscript5.Attributes.Add("type", "text/javascript"); jsscript5.Attributes.Add("src", "//cdnjs.cloudflare.com/ajax/libs/d3/3.4.13/d3.min.js"); Page.Header.Controls.Add(jsscript5); HtmlGenericControl script = new HtmlGenericControl("script"); script.Attributes.Add("type", "text/javascript"); script.InnerHtml = "function loadClusterView() {" + " network_browser.Init('" + Root.Domain + "/profile/modules/NetworkCluster/NetworkClusterSvc.aspx?p='); " + " network_browser.loadNetwork('" + Request.QueryString["Subject"].ToString() + "'); " + "};"; Page.Header.Controls.Add(script); Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO(); RDFTriple request = new RDFTriple(Convert.ToInt64(Request.QueryString["subject"])); XmlDocument x = data.GetProfileNetworkForBrowserXML(request); System.Xml.Xsl.XsltArgumentList args = new System.Xml.Xsl.XsltArgumentList(); args.AddParam("root", "", Root.Domain); DateTime d = DateTime.Now; System.Xml.Xsl.XslCompiledTransform xslt = new System.Xml.Xsl.XslCompiledTransform(); litNetworkText.Text = Profiles.Framework.Utilities.XslHelper.TransformInMemory(Server.MapPath("~/profile/XSLT/NetworkTable.xslt"), args, x.InnerXml); iFrameFlashGraph.Attributes.Add("data-src", Root.Domain + "/profile/Modules/NetworkClusterFlash/Default.aspx?Subject=" + Request.QueryString["subject"] + "&Predicate=" + Request.QueryString["Predicate"]); }
public static void GenerateXMLViaXSLT(string xsltFileName, System.Xml.XmlDocument xmlMetaData, string outputFile, string outputType, ExtObject[] extObjects, params Param[] @params) { System.Xml.Xsl.XslTransform xslt = new System.Xml.Xsl.XslTransform(); System.Xml.XPath.XPathNavigator xNav; System.Xml.XmlTextWriter XMLWriter = null; System.Xml.Xsl.XsltArgumentList args = new System.Xml.Xsl.XsltArgumentList(); try { if (xmlMetaData == null) { xmlMetaData = new System.Xml.XmlDocument(); } foreach (Param param in @params) { args.AddParam(param.Name, "", param.Value); } if (extObjects == null) { // No problem, just skip } else { foreach (ExtObject extObject in extObjects) { System.Reflection.ConstructorInfo constructorInfo = ((System.Type)(extObject.value)).GetConstructor(null); object obj = constructorInfo.Invoke(null); args.AddExtensionObject(extObject.NameSpaceURI, obj); } } AddStandardExtension(args); xNav = xmlMetaData.CreateNavigator(); XMLWriter = new System.Xml.XmlTextWriter(outputFile, System.Text.Encoding.UTF8); xslt.Load(xsltFileName); xslt.Transform(xNav, args, XMLWriter, null); } catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex); throw; } finally { if (XMLWriter != null) { XMLWriter.Flush(); XMLWriter.Close(); } } }
public void CopyConstructor() { var arguments = new System.Xml.Xsl.XsltArgumentList(); _extensions.Each(e => arguments.AddExtensionObject(e.Key, e.Value)); _params.Each(p => arguments.AddParam(p.Key.Name, p.Key.Namespace, p.Value)); var copy = new XsltArgumentList(arguments); _extensions.Each(e => Assert.That(copy.GetExtensionObject(e.Key), Is.SameAs(e.Value))); _params.Each(p => Assert.That(copy.GetParam(p.Key.Name, p.Key.Namespace), Is.SameAs(p.Value))); }
public string TransformModel(string format, int fromItem, int toItem) { System.Xml.XmlTextReader r = this.RQItems.ConvertTo(format, fromItem, toItem); try { var xTrf = new System.Xml.Xsl.XslCompiledTransform(true); var xTrfArg = new System.Xml.Xsl.XsltArgumentList(); var xSet = new System.Xml.Xsl.XsltSettings(true, true); var mstr = new System.Xml.XmlTextWriter(new System.IO.MemoryStream(), System.Text.Encoding.UTF8); var doc = new System.Xml.XmlDocument(); //TESTDATEI(EZEUGEN) //System.Xml.XmlDocument Doc = new System.Xml.XmlDocument(); //Doc.Load(r); //Doc.Save("D:\\Users\\Jorge\\Desktop\\MVCTest.xml"); //ENDE TESTDATEI r.MoveToContent(); xTrf.Load(HttpContext.Current.Server.MapPath("~/xslt/ViewTransforms/RQResultList2RQSorted_Paging.xslt"), xSet, new System.Xml.XmlUrlResolver()); xTrfArg.AddParam("ApplPath", "", "http://" + HttpContext.Current.Request.ServerVariables.Get("HTTP_HOST") + (HttpContext.Current.Request.ApplicationPath.Equals("/") ? "" : HttpContext.Current.Request.ApplicationPath)); xTrfArg.AddParam("MyDocsPath", "", "http://" + HttpContext.Current.Request.ServerVariables.Get("HTTP_HOST") + (HttpContext.Current.Request.ApplicationPath.Equals("/") ? "" : HttpContext.Current.Request.ApplicationPath)); xTrfArg.AddParam("SortType", "", this.GetListPreprocessor().SortTypeString()); xTrf.Transform(new System.Xml.XPath.XPathDocument(r), xTrfArg, mstr); mstr.BaseStream.Flush(); mstr.BaseStream.Seek(0, System.IO.SeekOrigin.Begin); doc.Load(mstr.BaseStream); //TESTDATEI EZEUGEN //doc.Save("D:\\Users\\Jorge\\Desktop\\MVCTest.xml"); //mstr.BaseStream.Seek(0, System.IO.SeekOrigin.Begin); //ENDE TESTDATEI //var rd = new System.Xml.XmlTextReader(mstr.BaseStream); return(doc.OuterXml); } catch { // RQItemSet ist leer throw new NotImplementedException("Could not find a RiQuest item with requested document number."); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["id"] != null) { var versionid = int.Parse(Request.QueryString["id"]); VersionHistory version = _mBs.GetVersion(versionid); if (version != null) { string s = version.versionXml; XmlReader reader; XmlReaderSettings rs = new XmlReaderSettings(); StringBuilder sb = new StringBuilder(); rs.CloseInput = true; rs.IgnoreComments = true; rs.ConformanceLevel = ConformanceLevel.Fragment; reader = XmlReader.Create(new System.IO.StringReader(s), rs); // Create the XslCompiledTransform and load the stylesheet. System.Xml.Xsl.XslCompiledTransform xslt = new System.Xml.Xsl.XslCompiledTransform(); String path = Server.MapPath(ResolveUrl("Version.xslt")); xslt.Load(path); // Create the XsltArgumentList. System.Xml.Xsl.XsltArgumentList xslArg = new System.Xml.Xsl.XsltArgumentList(); xslArg.AddParam("modificationdate", "", version.modificationDate.ToString()); xslArg.AddParam("versionid", "", version.id.ToString()); xslArg.AddParam("modifiedby", "", version.modifiedBy); System.IO.TextWriter tw = new System.IO.StringWriter(sb); //Transform the version xml. xslt.Transform(reader, xslArg, tw); litVersionData.Text = sb.ToString(); } } }
private static void GenerateXSLTToStream(System.Xml.Xsl.XslTransform xsltTransform, System.Xml.XPath.XPathNavigator xNavMetaData, System.IO.Stream stream, string outputType, ExtObject[] extObjects, params Param[] @params) { System.IO.StreamWriter streamWriter = null; System.Xml.XmlTextWriter xmlWriter = null; System.Xml.Xsl.XsltArgumentList args = new System.Xml.Xsl.XsltArgumentList(); try { if (@params != null) { foreach (Param param in @params) { args.AddParam(param.Name, "", param.Value); } } if (extObjects == null) { // No problem, just skip } else { foreach (ExtObject extObject in extObjects) { System.Reflection.ConstructorInfo constructorInfo = ((System.Type)(extObject.value)).GetConstructor(Type.EmptyTypes); object obj = constructorInfo.Invoke(null); args.AddExtensionObject(extObject.NameSpaceURI, obj); } } AddStandardExtension(args); streamWriter = new System.IO.StreamWriter(stream); xsltTransform.Transform(xNavMetaData, args, streamWriter, null); } catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex); throw; } finally { if (streamWriter != null) { streamWriter.Flush(); } if (xmlWriter != null) { xmlWriter.Flush(); } } }
/// <summary> /// Validate and read XML files /// </summary> /// <param name="filePaths"></param> private void ReadAndValidateFiles(IEnumerable <string> filePaths) { // Validate and read data from each XML file foreach (string filePath in filePaths) { try { // Validate each XML file before processing FileHelper.ValidateXMLFile(filePath, schemaPath, targetSchemaNamespace); // Get filename from filepath string fileName = Path.GetFileName(filePath); // Convert ISO-XML to EDI var objFileXsltSettings = new System.Xml.Xsl.XsltSettings(); var objFileXsltTrnsfrm = new System.Xml.Xsl.XslCompiledTransform(); System.Xml.Xsl.XsltArgumentList xslArgs = new System.Xml.Xsl.XsltArgumentList(); using (var objFileXmlWriter = new XmlTextWriter(@"C:\Users\shubham.chauhan\Desktop\EDIFiles\" + fileName + "-EDI.txt", Encoding.Default)) { objFileXsltSettings.EnableScript = true; objFileXsltTrnsfrm.Load(xsltPath, objFileXsltSettings, null); xslArgs.AddParam("fileid", "", "1"); objFileXsltTrnsfrm.Transform(filePath, xslArgs, objFileXmlWriter); } // Read XML File in C# objects Document document = FileHelper.ReadXMLFile <Document>(filePath); // Send XML data to API //SendXMLData<Document>(fileName, document); Console.WriteLine($"FileName = {fileName}, MessageId = {document.CstmrCdtTrfInitn.GrpHdr.MsgId}"); } catch (XmlSchemaValidationException ex) { Console.WriteLine($"Unable to process file: {filePath} due to below error"); Console.WriteLine(ex.Message); continue; } catch (Exception e) { Console.WriteLine($"Error occured while processing the file: {filePath}"); Console.WriteLine(e.Message); continue; } } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["L"] != null) { xmlLocation.DocumentSource = "~/App_Data/AdminPost.xml"; xmlLocation.TransformSource = "~/App_Data/LocationBased.xsl"; System.Xml.Xsl.XsltArgumentList xsltArg = new System.Xml.Xsl.XsltArgumentList(); xsltArg.AddParam("_locationString", "", Request.QueryString["L"]); xmlLocation.TransformArgumentList = xsltArg; } else if (Request.QueryString["L"] == null) { ClientScript.RegisterStartupScript(this.GetType(), "My title", "alert(' null ');", true); return; } }
// Write the SMIL files from the Z composite document private void WriteSMILFiles(System.Xml.XPath.XPathDocument z) { System.Xml.Xsl.XslCompiledTransform smilXslt = new System.Xml.Xsl.XslCompiledTransform(true); smilXslt.Load(System.IO.Path.Combine(mAssemblyLocation, SMIL_XSLT), null, mResolver); System.Xml.XPath.XPathNavigator navigator = z.CreateNavigator(); System.Xml.XmlNamespaceManager nsmgr = new System.Xml.XmlNamespaceManager(navigator.NameTable); nsmgr.AddNamespace("smil", "http://www.w3.org/2001/SMIL20/"); System.Xml.XPath.XPathNodeIterator it = navigator.Select("/z/smil:smil/smil:body/smil:seq", nsmgr); while (it.MoveNext()) { System.Xml.Xsl.XsltArgumentList args = new System.Xml.Xsl.XsltArgumentList(); string id = it.Current.GetAttribute("id", ""); args.AddParam("id", "", id); System.Xml.XmlWriter smilFile = System.Xml.XmlWriter.Create(FullPath(".smil", id), smilXslt.OutputSettings); smilXslt.Transform(z, args, smilFile); } }
public static string ProcessString(string localhost, string xmlstring, string xslt, Hashtable htParams, Hashtable htExtObjs) { System.Xml.Xsl.XslCompiledTransform xsl = new System.Xml.Xsl.XslCompiledTransform(); xsl.Load(localhost + xslt); XmlDocument xmldoc = new XmlDocument(); xmldoc.LoadXml(xmlstring); StringWriter sw = new StringWriter(); System.Xml.Xsl.XsltArgumentList arg = new System.Xml.Xsl.XsltArgumentList(); if (htParams != null) { foreach (string k in htParams.Keys) arg.AddParam(k, "", htParams[k]); } if (htExtObjs != null) { foreach (string k in htExtObjs.Keys) arg.AddExtensionObject(k, htExtObjs[k]); } xsl.Transform(xmldoc, arg, sw); return System.Web.HttpUtility.HtmlDecode(sw.ToString()); }
public string ConvertProject(string xsltPath, string projectName) { var xTrf = new System.Xml.Xsl.XslCompiledTransform(true); var xTrfArg = new System.Xml.Xsl.XsltArgumentList(); var xSet = new System.Xml.Xsl.XsltSettings(true, true); var wSet = new System.Xml.XmlWriterSettings(); var mstr = new System.Xml.XmlTextWriter(new System.IO.MemoryStream(), System.Text.Encoding.UTF8); //var mstr = new System.Xml.XmlTextWriter(xsltPath + "test.xml", System.Text.Encoding.UTF8); var doc = new System.Xml.XmlDocument(); wSet = xTrf.OutputSettings; xTrf.Load(CopyXSLTFile(xsltPath), xSet, new XmlUrlResolver()); xTrfArg.AddParam("ProjectName", "", projectName); mstr.WriteStartDocument(); mstr.WriteDocType("Article", "-//RiQuest Software//DTD JBArticle v1.0 20020724//EN", "../dtd/JBArticle/jbarticle.dtd", null); xTrf.Transform(_extractPath + "/desktop.xml", xTrfArg, mstr); mstr.BaseStream.Flush(); mstr.BaseStream.Seek(0, System.IO.SeekOrigin.Begin); return(new StreamReader(mstr.BaseStream).ReadToEnd()); }
public void Union() { var arguments = new XsltArgumentList(); _extensions.Each(e => arguments.AddExtensionObject(e.Key, e.Value)); _params.Each(p => arguments.AddParam(p.Key.Name, p.Key.Namespace, p.Value)); _extensions.Add("urn:extensions:six", new object()); _params.Add(new XmlQualifiedName("p4", "urn:parameters"), new object()); var newArguments = new System.Xml.Xsl.XsltArgumentList(); newArguments.AddExtensionObject(_extensions.Last().Key, _extensions.Last().Value); newArguments.AddParam(_params.Last().Key.Name, _params.Last().Key.Namespace, _params.Last().Value); var union = arguments.Union(newArguments); _extensions.Each(e => Assert.That(union.GetExtensionObject(e.Key), Is.SameAs(e.Value))); _params.Each(p => Assert.That(union.GetParam(p.Key.Name, p.Key.Namespace), Is.SameAs(p.Value))); }
public void UnionThrowsWhenDuplicate() { var arguments = new XsltArgumentList(); _extensions.Each(e => arguments.AddExtensionObject(e.Key, e.Value)); _params.Each(p => arguments.AddParam(p.Key.Name, p.Key.Namespace, p.Value)); var union1 = new System.Xml.Xsl.XsltArgumentList(); union1.AddExtensionObject(_extensions.First().Key, _extensions.First().Value); Assert.That( () => arguments.Union(union1), Throws.ArgumentException); var union2 = new System.Xml.Xsl.XsltArgumentList(); union2.AddParam(_params.First().Key.Name, _params.First().Key.Namespace, _params.First().Value); Assert.That( () => arguments.Union(union2), Throws.ArgumentException); }
public void Convert(System.IO.FileInfo output, int size) { var converters = new Output_aa[_bmpFiles.Length]; var captionDire = new System.IO.DirectoryInfo(output.Directory.FullName + "\\Captions"); var cssFileInfo = new System.IO.FileInfo(output.Directory.FullName + "\\" + System.IO.Path.GetFileNameWithoutExtension(output.Name) + ".css"); var jsFileInfo = new System.IO.FileInfo(output.Directory.FullName + "\\" + System.IO.Path.GetFileNameWithoutExtension(output.Name) + ".js"); captionDire.Create(); //Js�t�@�C���� OutputCaptions(captionDire, converters, size); //��i�{�̂ł���html������ using (var fileStrm = new System.IO.FileStream(output.FullName, System.IO.FileMode.Create)) { var htmlDocBase = new XmlDocument(); var importList = htmlDocBase.CreateElement("import-files"); //���搧��p�̃X�N���v�g�̎Q�� var main_js = htmlDocBase.CreateElement("file"); main_js.AppendChild(htmlDocBase.CreateTextNode(jsFileInfo.Name)); importList.AppendChild(main_js); //�e�t���[���̕������i�[�����X�N���v�g�̎Q�� for (int i = 0; i < converters.Length; i++) { var item = htmlDocBase.CreateElement("file"); item.AppendChild(htmlDocBase.CreateTextNode(captionDire.Name + "/" + _jsName + i + ".js")); importList.AppendChild(item); } htmlDocBase.AppendChild(importList); var xsltDoc = new XmlDocument(); var xsl = new System.Xml.Xsl.XslCompiledTransform(true); var xsl_args = new System.Xml.Xsl.XsltArgumentList(); xsltDoc.LoadXml(Properties.Resources.Xslt); xsl_args.AddParam("StyleSheetHref", "", cssFileInfo.Name); xsl_args.AddParam("Mode", "", "MoviePlayer"); xsl.Load(xsltDoc); xsl.Transform(htmlDocBase, xsl_args, fileStrm); } //css &JavaScript�̏����o�� System.IO.File.WriteAllText(cssFileInfo.FullName, Properties.Resources.Style_AA); System.IO.File.WriteAllText(jsFileInfo.FullName, Properties.Resources.JScript); }
protected override void AddParameters(System.Xml.Xsl.XsltArgumentList arguments) { base.AddParameters(arguments); arguments.AddParam("sc_datasource", string.Empty, this.Rendering.DataSource); }
protected override void AddXsltParameters(System.Xml.Xsl.XsltArgumentList argumentList) { base.AddXsltParameters(argumentList); argumentList.AddParam("groupBy", "", this.GroupBy ?? string.Empty); }
protected void InitAssets() { System.Web.UI.HtmlControls.HtmlLink NetworkBrowsercss = new System.Web.UI.HtmlControls.HtmlLink(); NetworkBrowsercss.Href = Root.Domain + "/Profile/CSS/NetworkBrowser.css"; NetworkBrowsercss.Attributes["rel"] = "stylesheet"; NetworkBrowsercss.Attributes["type"] = "text/css"; NetworkBrowsercss.Attributes["media"] = "all"; Page.Header.Controls.Add(NetworkBrowsercss); System.Web.UI.HtmlControls.HtmlLink vizcss = new System.Web.UI.HtmlControls.HtmlLink(); vizcss.Href = Root.Domain + "/Profile/CSS/viz.css"; vizcss.Attributes["rel"] = "stylesheet"; vizcss.Attributes["type"] = "text/css"; vizcss.Attributes["media"] = "all"; Page.Header.Controls.Add(vizcss); HtmlGenericControl jsscript0 = new HtmlGenericControl("script"); jsscript0.Attributes.Add("type", "text/javascript"); jsscript0.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/JavaScript/watchdog.js"); Page.Header.Controls.Add(jsscript0); HtmlGenericControl jsscript1 = new HtmlGenericControl("script"); jsscript1.Attributes.Add("type", "text/javascript"); jsscript1.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/scriptaculous/lib/prototype.js"); Page.Header.Controls.Add(jsscript1); HtmlGenericControl jsscript2 = new HtmlGenericControl("script"); jsscript2.Attributes.Add("type", "text/javascript"); jsscript2.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/scriptaculous/src/scriptaculous.js"); Page.Header.Controls.Add(jsscript2); HtmlGenericControl jsscript3 = new HtmlGenericControl("script"); jsscript3.Attributes.Add("type", "text/javascript"); jsscript3.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/JavaScript/layout_balanced.js"); Page.Header.Controls.Add(jsscript3); HtmlGenericControl jsscript4 = new HtmlGenericControl("script"); jsscript4.Attributes.Add("type", "text/javascript"); jsscript4.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/JavaScript/sliders.js"); Page.Header.Controls.Add(jsscript4); HtmlGenericControl jsscript5 = new HtmlGenericControl("script"); jsscript5.Attributes.Add("type", "text/javascript"); jsscript5.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/JavaScript/viz.js"); Page.Header.Controls.Add(jsscript5); HtmlGenericControl jsscript6 = new HtmlGenericControl("script"); jsscript6.Attributes.Add("type", "text/javascript"); jsscript6.Attributes.Add("src", "//cdnjs.cloudflare.com/ajax/libs/d3/3.4.13/d3.min.js"); Page.Header.Controls.Add(jsscript6); Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO(); int personID = data.GetPersonId(Int64.Parse(Request.QueryString["Subject"].ToString())); HtmlGenericControl script = new HtmlGenericControl("script"); script.Attributes.Add("type", "text/javascript"); script.InnerHtml = "jQuery(document).ready(function() {try{" + " radial_viz = new RadialGraph_Visualization(jQuery('#radial_view')[0], {radius: 100});" + //" radial_viz.loadNetwork('" + Root.Domain + "/profile/modules/NetworkRadial/NetworkRadialSvc.aspx?p=" + Request.QueryString["Subject"].ToString() + "', '" + Request.QueryString["Subject"].ToString() + "'); " + " radial_viz.loadNetwork('" + Root.Domain + "/profile/modules/NetworkRadial/NetworkRadialSvc.aspx?p=" + Request.QueryString["Subject"].ToString() + "', '" + personID + "'); " + "} catch(e){}});"; Page.Header.Controls.Add(script); //Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO(); RDFTriple request = new RDFTriple(Convert.ToInt64(Request.QueryString["subject"])); XmlDocument x = data.GetProfileNetworkForBrowserXML(request); System.Xml.Xsl.XsltArgumentList args = new System.Xml.Xsl.XsltArgumentList(); args.AddParam("root", "", Root.Domain); System.Xml.Xsl.XslCompiledTransform xslt = new System.Xml.Xsl.XslCompiledTransform(); lblProfileName.Text = x.SelectSingleNode("LocalNetwork/NetworkPeople/NetworkPerson[@d='0']").Attributes["fn"].Value + " " + x.SelectSingleNode("LocalNetwork/NetworkPeople/NetworkPerson[@d='0']").Attributes["ln"].Value; litNetworkText.Text = Profiles.Framework.Utilities.XslHelper.TransformInMemory(Server.MapPath("~/profile/XSLT/NetworkTable.xslt"), args, x.InnerXml); iFrameFlashGraph.Attributes.Add("data-src", Root.Domain + "/profile/Modules/NetworkRadialFlash/Default.aspx?Subject=" + Request.QueryString["subject"] + "&Predicate=" + Request.QueryString["Predicate"]); }
protected void InitAssets() { System.Web.UI.HtmlControls.HtmlLink NetworkBrowsercss = new System.Web.UI.HtmlControls.HtmlLink(); NetworkBrowsercss.Href = Root.Domain + "/Profile/CSS/NetworkBrowser.css"; NetworkBrowsercss.Attributes["rel"] = "stylesheet"; NetworkBrowsercss.Attributes["type"] = "text/css"; NetworkBrowsercss.Attributes["media"] = "all"; Page.Header.Controls.Add(NetworkBrowsercss); HtmlGenericControl jsscript1 = new HtmlGenericControl("script"); jsscript1.Attributes.Add("type", "text/javascript"); jsscript1.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/scriptaculous/lib/prototype.js"); Page.Header.Controls.Add(jsscript1); HtmlGenericControl jsscript2 = new HtmlGenericControl("script"); jsscript2.Attributes.Add("type", "text/javascript"); jsscript2.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/scriptaculous/src/scriptaculous.js"); Page.Header.Controls.Add(jsscript2); HtmlGenericControl jsscript3 = new HtmlGenericControl("script"); jsscript3.Attributes.Add("type", "text/javascript"); jsscript3.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/javascript/networkBrowserClass.js"); Page.Header.Controls.Add(jsscript3); divSwfScript.InnerHtml = "<script language=\"JavaScript\" type=\"text/javascript\"> " + "AC_FL_RunContent(" + "'codebase', '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0'," + "'width', '600'," + "'height', '600'," + "'src', '" + Root.Domain + "/profile/Modules/NetworkRadial/network_browser.swf'," + "'movie', '" + Root.Domain + "/profile/Modules/NetworkRadial/network_browser'," + "'quality', 'high'," + "'pluginspage', '//www.adobe.com/go/getflashplayer'," + "'align', 'middle'," + "'play', 'true'," + "'loop', 'true'," + "'scale', 'showall'," + "'wmode', 'transparent'," + "'devicefont', 'false'," + "'id', 'network_browserFLASH'," + "'bgcolor', '#ffffff'," + "'name', 'network_browserFLASH'," + "'menu', 'true'," + "'allowFullScreen', 'false'," + "'allowScriptAccess', 'always'," + "'salign', ''" + "); //end AC code" + "</script>"; HtmlGenericControl script = new HtmlGenericControl("script"); script.Attributes.Add("type", "text/javascript"); script.InnerHtml = "window.onload = function() {" + " network_browser._cfg.profile_network_path = '/" + Request.QueryString["Predicate"].ToString() + "/radial'; " + " network_browser.Init('" + Root.Domain + "/profile/modules/NetworkRadial/NetworkRadialSvc.aspx?p='); " + " network_browser.loadNetwork('" + Request.QueryString["Subject"].ToString() + "'); " + "}"; Page.Header.Controls.Add(script); Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO(); RDFTriple request = new RDFTriple(Convert.ToInt64(Request.QueryString["subject"])); XmlDocument x = data.GetProfileNetworkForBrowser(request); System.Xml.Xsl.XsltArgumentList args = new System.Xml.Xsl.XsltArgumentList(); args.AddParam("root", "", Root.Domain); System.Xml.Xsl.XslCompiledTransform xslt = new System.Xml.Xsl.XslCompiledTransform(); lblProfileName.Text = x.SelectSingleNode("LocalNetwork/NetworkPeople/NetworkPerson[@d='0']").Attributes["fn"].Value + " " + x.SelectSingleNode("LocalNetwork/NetworkPeople/NetworkPerson[@d='0']").Attributes["ln"].Value; litNetworkText.Text = Profiles.Framework.Utilities.XslHelper.TransformInMemory(Server.MapPath("~/profile/XSLT/NetworkTable.xslt"), args, x.InnerXml); }
protected void InitAssets() { System.Web.UI.HtmlControls.HtmlLink NetworkBrowsercss = new System.Web.UI.HtmlControls.HtmlLink(); NetworkBrowsercss.Href = Root.Domain + "/Profile/CSS/NetworkBrowser.css"; NetworkBrowsercss.Attributes["rel"] = "stylesheet"; NetworkBrowsercss.Attributes["type"] = "text/css"; NetworkBrowsercss.Attributes["media"] = "all"; Page.Header.Controls.Add(NetworkBrowsercss); HtmlGenericControl jsscript1 = new HtmlGenericControl("script"); jsscript1.Attributes.Add("type", "text/javascript"); jsscript1.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/scriptaculous/lib/prototype.js"); Page.Header.Controls.Add(jsscript1); HtmlGenericControl jsscript2 = new HtmlGenericControl("script"); jsscript2.Attributes.Add("type", "text/javascript"); jsscript2.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/scriptaculous/src/scriptaculous.js"); Page.Header.Controls.Add(jsscript2); HtmlGenericControl jsscript3 = new HtmlGenericControl("script"); jsscript3.Attributes.Add("type", "text/javascript"); jsscript3.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/javascript/networkBrowserClass.js"); Page.Header.Controls.Add(jsscript3); divSwfScript.InnerHtml = "<script language=\"JavaScript\" type=\"text/javascript\"> " + "AC_FL_RunContent(" + "'codebase', '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0'," + "'width', '600'," + "'height', '600'," + "'src', '" + Root.Domain + "/profile/Modules/NetworkRadial/network_browser.swf'," + "'movie', '" + Root.Domain + "/profile/Modules/NetworkRadial/network_browser'," + "'quality', 'high'," + "'pluginspage', '//www.adobe.com/go/getflashplayer'," + "'align', 'middle'," + "'play', 'true'," + "'loop', 'true'," + "'scale', 'showall'," + "'wmode', 'transparent'," + "'devicefont', 'false'," + "'id', 'network_browserFLASH'," + "'bgcolor', '#ffffff'," + "'name', 'network_browserFLASH'," + "'menu', 'true'," + "'allowFullScreen', 'false'," + "'allowScriptAccess', 'always'," + "'salign', ''" + "); //end AC code" + "</script>"; HtmlGenericControl script = new HtmlGenericControl("script"); script.Attributes.Add("type", "text/javascript"); script.InnerHtml = "window.onload = function() {" + " network_browser._cfg.profile_network_path = '/"+Request.QueryString["Predicate"].ToString()+"/radial'; " + " network_browser.Init('" + Root.Domain + "/profile/modules/NetworkRadial/NetworkRadialSvc.aspx?p='); " + " network_browser.loadNetwork('" + Request.QueryString["Subject"].ToString() + "'); " + "}"; Page.Header.Controls.Add(script); Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO(); RDFTriple request = new RDFTriple(Convert.ToInt64(Request.QueryString["subject"])); XmlDocument x = data.GetProfileNetworkForBrowser(request); System.Xml.Xsl.XsltArgumentList args = new System.Xml.Xsl.XsltArgumentList(); args.AddParam("root", "", Root.Domain); System.Xml.Xsl.XslCompiledTransform xslt = new System.Xml.Xsl.XslCompiledTransform(); litNetworkText.Text = Profiles.Framework.Utilities.XslHelper.TransformInMemory(Server.MapPath("~/profile/XSLT/NetworkTable.xslt"), args, x.InnerXml); }
protected void InitAssets() { System.Web.UI.HtmlControls.HtmlLink NetworkBrowsercss = new System.Web.UI.HtmlControls.HtmlLink(); NetworkBrowsercss.Href = Root.Domain + "/Profile/CSS/NetworkBrowser.css"; NetworkBrowsercss.Attributes["rel"] = "stylesheet"; NetworkBrowsercss.Attributes["type"] = "text/css"; NetworkBrowsercss.Attributes["media"] = "all"; Page.Header.Controls.Add(NetworkBrowsercss); System.Web.UI.HtmlControls.HtmlLink vizcss = new System.Web.UI.HtmlControls.HtmlLink(); vizcss.Href = Root.Domain + "/Profile/CSS/viz.css"; vizcss.Attributes["rel"] = "stylesheet"; vizcss.Attributes["type"] = "text/css"; vizcss.Attributes["media"] = "all"; Page.Header.Controls.Add(vizcss); HtmlGenericControl jsscript0 = new HtmlGenericControl("script"); jsscript0.Attributes.Add("type", "text/javascript"); jsscript0.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/JavaScript/watchdog.js"); Page.Header.Controls.Add(jsscript0); HtmlGenericControl jsscript1 = new HtmlGenericControl("script"); jsscript1.Attributes.Add("type", "text/javascript"); jsscript1.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/scriptaculous/lib/prototype.js"); Page.Header.Controls.Add(jsscript1); HtmlGenericControl jsscript2 = new HtmlGenericControl("script"); jsscript2.Attributes.Add("type", "text/javascript"); jsscript2.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/scriptaculous/src/scriptaculous.js"); Page.Header.Controls.Add(jsscript2); HtmlGenericControl jsscript3 = new HtmlGenericControl("script"); jsscript3.Attributes.Add("type", "text/javascript"); jsscript3.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/JavaScript/layout_balanced.js"); Page.Header.Controls.Add(jsscript3); HtmlGenericControl jsscript4 = new HtmlGenericControl("script"); jsscript4.Attributes.Add("type", "text/javascript"); jsscript4.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/JavaScript/sliders.js"); Page.Header.Controls.Add(jsscript4); HtmlGenericControl jsscript5 = new HtmlGenericControl("script"); jsscript5.Attributes.Add("type", "text/javascript"); jsscript5.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/JavaScript/viz.js"); Page.Header.Controls.Add(jsscript5); HtmlGenericControl jsscript6 = new HtmlGenericControl("script"); jsscript6.Attributes.Add("type", "text/javascript"); jsscript6.Attributes.Add("src", "//cdnjs.cloudflare.com/ajax/libs/d3/3.4.13/d3.min.js"); Page.Header.Controls.Add(jsscript6); Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO(); int personID = data.GetPersonId(Int64.Parse(Request.QueryString["Subject"].ToString())); HtmlGenericControl script = new HtmlGenericControl("script"); script.Attributes.Add("type", "text/javascript"); script.InnerHtml = "jQuery(document).ready(function() {try{" + " radial_viz = new RadialGraph_Visualization(jQuery('#radial_view')[0], {radius: 100});" + //" radial_viz.loadNetwork('" + Root.Domain + "/profile/modules/NetworkRadial/NetworkRadialSvc.aspx?p=" + Request.QueryString["Subject"].ToString() + "', '" + Request.QueryString["Subject"].ToString() + "'); " + " radial_viz.loadNetwork('" + Root.Domain + "/profile/modules/NetworkRadial/NetworkRadialSvc.aspx?p=" + Request.QueryString["Subject"].ToString() + "', '" + personID + "'); " + "} catch(e){}});"; Page.Header.Controls.Add(script); //Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO(); RDFTriple request = new RDFTriple(Convert.ToInt64(Request.QueryString["subject"])); XmlDocument x = data.GetProfileNetworkForBrowserXML(request); System.Xml.Xsl.XsltArgumentList args = new System.Xml.Xsl.XsltArgumentList(); args.AddParam("root", "", Root.Domain); System.Xml.Xsl.XslCompiledTransform xslt = new System.Xml.Xsl.XslCompiledTransform(); lblProfileName.Text = x.SelectSingleNode("LocalNetwork/NetworkPeople/NetworkPerson[@d='0']").Attributes["fn"].Value + " " + x.SelectSingleNode("LocalNetwork/NetworkPeople/NetworkPerson[@d='0']").Attributes["ln"].Value; litNetworkText.Text = Profiles.Framework.Utilities.XslHelper.TransformInMemory(Server.MapPath("~/profile/XSLT/NetworkTable.xslt"), args, x.InnerXml); iFrameFlashGraph.Attributes.Add("data-src", Root.Domain + "/profile/Modules/NetworkRadialFlash/Default.aspx?Subject=" + Request.QueryString["subject"] + "&Predicate=" + Request.QueryString["Predicate"]); }
public string ConvertProject(string xsltPath, string projectName) { var xTrf = new System.Xml.Xsl.XslCompiledTransform(true); var xTrfArg = new System.Xml.Xsl.XsltArgumentList(); var xSet = new System.Xml.Xsl.XsltSettings(true, true); var wSet = new System.Xml.XmlWriterSettings(); var mstr = new System.Xml.XmlTextWriter(new System.IO.MemoryStream(), System.Text.Encoding.UTF8); //var mstr = new System.Xml.XmlTextWriter(xsltPath + "test.xml", System.Text.Encoding.UTF8); var doc = new System.Xml.XmlDocument(); wSet = xTrf.OutputSettings; xTrf.Load(CopyXSLTFile(xsltPath), xSet, new XmlUrlResolver()); xTrfArg.AddParam("ProjectName", "", projectName); mstr.WriteStartDocument(); mstr.WriteDocType("Article", "-//RiQuest Software//DTD JBArticle v1.0 20020724//EN", "../dtd/JBArticle/jbarticle.dtd", null); xTrf.Transform(_extractPath + "/desktop.xml", xTrfArg, mstr); mstr.BaseStream.Flush(); mstr.BaseStream.Seek(0, System.IO.SeekOrigin.Begin); return new StreamReader(mstr.BaseStream).ReadToEnd(); }
public override void Convert(System.IO.FileInfo output, int size) { using (var memory = new System.IO.MemoryStream(Encoding.UTF8.GetBytes(Properties.Resources.Xslt))) using (var fileStrm = new System.IO.FileStream( output.FullName, System.IO.FileMode.Create, System.IO.FileAccess.Write)) { memory.Position = 0; var xsltReader = new XmlTextReader(memory); var cssPath = output.Directory.FullName + "\\" + System.IO.Path.GetFileNameWithoutExtension(output.FullName) + ".css"; var args_xsl = new System.Xml.Xsl.XsltArgumentList(); //Xsl�ւ̈�����p�� args_xsl.AddParam("Mode", "", "AsciiArt"); args_xsl.AddParam("StyleSheetHref", "", System.IO.Path.GetFileName(cssPath)); //_bmp��ϊ����A�o�͌��ʂ�fileStrm�ɏ������� Transform(size, fileStrm, xsltReader, args_xsl); //CSS������o�� System.IO.File.WriteAllText(cssPath, Properties.Resources.Style_AA); } }
public override void Convert(System.IO.FileInfo output, int size) { using (var fileStrm = new System.IO.FileStream( output.FullName, System.IO.FileMode.Create, System.IO.FileAccess.Write)) { var cssPath = output.Directory.FullName + "\\" + System.IO.Path.GetFileNameWithoutExtension(output.FullName) + ".css"; var xsltDoc = new XmlDocument(); var args_xsl = new System.Xml.Xsl.XsltArgumentList(); //Transform�O�Ɉ�����xslt������� args_xsl.AddParam("Mode", "", "HtmlArt"); args_xsl.AddParam("StyleSheetHref", "", System.IO.Path.GetFileName(cssPath)); xsltDoc.LoadXml(Properties.Resources.Xslt); //_bmp��ϊ����A�o�͌��ʂ�fileStrm�֏����o�� Transform(size, fileStrm, xsltDoc, args_xsl); //CSS������o�� System.IO.File.WriteAllText(cssPath, Properties.Resources.Style_txt); } }
protected void InitAssets() { System.Web.UI.HtmlControls.HtmlLink NetworkBrowsercss = new System.Web.UI.HtmlControls.HtmlLink(); NetworkBrowsercss.Href = Root.Domain + "/Profile/CSS/NetworkBrowser.css"; NetworkBrowsercss.Attributes["rel"] = "stylesheet"; NetworkBrowsercss.Attributes["type"] = "text/css"; NetworkBrowsercss.Attributes["media"] = "all"; Page.Header.Controls.Add(NetworkBrowsercss); HtmlGenericControl jsscript0 = new HtmlGenericControl("script"); jsscript0.Attributes.Add("type", "text/javascript"); jsscript0.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/JavaScript/watchdog.js"); Page.Header.Controls.Add(jsscript0); HtmlGenericControl jsscript1 = new HtmlGenericControl("script"); jsscript1.Attributes.Add("type", "text/javascript"); jsscript1.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkCluster/scriptaculous/lib/prototype.js"); Page.Header.Controls.Add(jsscript1); HtmlGenericControl jsscript2 = new HtmlGenericControl("script"); jsscript2.Attributes.Add("type", "text/javascript"); jsscript2.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkCluster/scriptaculous/src/scriptaculous.js"); Page.Header.Controls.Add(jsscript2); HtmlGenericControl jsscript3 = new HtmlGenericControl("script"); jsscript3.Attributes.Add("type", "text/javascript"); jsscript3.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkClusterGroup/JavaScript/networkBrowserClass.js"); Page.Header.Controls.Add(jsscript3); HtmlGenericControl jsscript4 = new HtmlGenericControl("script"); jsscript4.Attributes.Add("type", "text/javascript"); jsscript4.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkClusterGroup/JavaScript/networkClusterLayoutEngine.js"); Page.Header.Controls.Add(jsscript4); HtmlGenericControl jsscript5 = new HtmlGenericControl("script"); jsscript5.Attributes.Add("type", "text/javascript"); jsscript5.Attributes.Add("src", "//cdnjs.cloudflare.com/ajax/libs/d3/3.4.13/d3.min.js"); Page.Header.Controls.Add(jsscript5); HtmlGenericControl script = new HtmlGenericControl("script"); script.Attributes.Add("type", "text/javascript"); script.InnerHtml = "function loadClusterView() {" + " network_browser.Init('" + Root.Domain + "/profile/modules/NetworkClusterGroup/NetworkClusterGroupSvc.aspx?p='); " + " network_browser.loadNetwork('" + Request.QueryString["Subject"].ToString() + "'); " + "};"; Page.Header.Controls.Add(script); Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO(); RDFTriple request = new RDFTriple(Convert.ToInt64(Request.QueryString["subject"])); XmlDocument x = data.GetGroupNetworkForBrowserXML(request); System.Xml.Xsl.XsltArgumentList args = new System.Xml.Xsl.XsltArgumentList(); args.AddParam("root", "", Root.Domain); DateTime d = DateTime.Now; System.Xml.Xsl.XslCompiledTransform xslt = new System.Xml.Xsl.XslCompiledTransform(); litNetworkText.Text = Profiles.Framework.Utilities.XslHelper.TransformInMemory(Server.MapPath("~/profile/XSLT/NetworkTableGroup.xslt"), args, x.InnerXml); }
void OutputCaptions(System.IO.DirectoryInfo output, Output_aa[] converters, int size) { //xslt��ǂݍ��� var xsltDoc = new XmlDocument(); var xslt_args = new System.Xml.Xsl.XsltArgumentList(); xsltDoc.LoadXml(Properties.Resources.Xslt); xslt_args.AddParam("Mode", "", "Movie"); for (int i = 0; i < converters.Length; i++) using (var fileStrm = new System.IO.FileStream(output.FullName + "\\" + _jsName + i + ".js", System.IO.FileMode.Create)) using (var bmp = new System.Drawing.Bitmap(_bmpFiles[i].OpenRead())) { xslt_args.AddParam("captionIndex", "", i); converters[i] = new Output_aa(bmp, _chars); converters[i].ReducingImage += delegate(object sender, EventArgs e) { Console.WriteLine(i + "�ԖڊJ�n"); }; converters[i].CreatingHtml += delegate(object sender, EventArgs e) { Console.WriteLine(i + "�Ԗڊ���"); }; converters[i].Transform(size, fileStrm, xsltDoc, xslt_args); xslt_args.RemoveParam("captionIndex", ""); } }