private static string WriteExampleWebConfig() { HtmlStringWriter w = new HtmlStringWriter(); w.Write("<blockquote><pre>"); w.Write(HtmlStringWriter.Escape(@"<?xml version=""1.0"" encoding=""utf-8"" ?> <configuration> <appSettings> <!-- PUT THE LOGICAL PATH TO THE FEDERATION CONFIGURATION FILE HERE --> <add key=""FederationNamespaceMapFile"" value=""/NamespaceMap.xml"" /> <!-- SET THE FOLLOWING KEY TO AN SMTP SERVER THAT WILL DELIVER MAIL. NEEDED IF YOU WANT YOUR WIKI SITE TO BE ABLE TO DELIVER NEWSLETTERS --> <add key=""SMTPServer"" value=""mail.my-server.com"" /> <!-- SET THE FOLLOWING KEY TO THE FULL FULLY-QUALIFIED ADDRESS OF THE USER NAME TO USE TO AUTHENTICATE AGAINST THE SMTP SERVER --> <add key=""SMTPUser"" value=""*****@*****.**"" /> <!-- SET THE FOLLOWING KEY IF THE SMTP SERVER NEEDS LOGIN AUTHENTICATION --> <add key=""SMTPPassword"" value=""password goes here"" /> <!-- SET THE FOLLOWING KEY TO THE DESIRED FROM ADDRESS FOR NEWSLETTERS --> <add key=""NewslettersFrom"" value=""*****@*****.**"" /> </appSettings> <system.web> <authentication mode=""Windows"" /> <authorization> <deny users=""?""/> </authorization> <pages validateRequest = ""false"" /> </system.web> </configuration>")); w.Write("</pre></blockquote>"); return w.ToString(); }
private string ExampleConfig() { HtmlStringWriter w = new HtmlStringWriter(); w.Write("<blockquote><pre>"); FlexWikiWebApplicationConfiguration appConfig = new FlexWikiWebApplicationConfiguration(); appConfig.FederationConfiguration = new FederationConfiguration(); appConfig.FederationConfiguration.AboutWikiString = "Text about the wiki here"; appConfig.FederationConfiguration.AuthorizationRules.Add( new WikiAuthorizationRule( new AuthorizationRule( new AuthorizationRuleWho(AuthorizationRuleWhoType.GenericAll), AuthorizationRulePolarity.Allow, AuthorizationRuleScope.Wiki, SecurableAction.Edit, 0) ) ); appConfig.FederationConfiguration.AuthorizationRules.Add( new WikiAuthorizationRule( new AuthorizationRule( new AuthorizationRuleWho(AuthorizationRuleWhoType.GenericAuthenticated), AuthorizationRulePolarity.Allow, AuthorizationRuleScope.Wiki, SecurableAction.ManageNamespace, 1) ) ); appConfig.FederationConfiguration.DefaultNamespace = "SampleNamespaceOne"; NamespaceProviderDefinition sampleNamespaceOne = new NamespaceProviderDefinition( typeof(FileSystemNamespaceProvider).Assembly.FullName, typeof(FileSystemNamespaceProvider).FullName, string.Empty); sampleNamespaceOne.Parameters.Add(new NamespaceProviderParameter("Root", @".\SampleNamespaceOne")); appConfig.FederationConfiguration.NamespaceMappings.Add(sampleNamespaceOne); appConfig.FederationConfiguration.WikiTalkVersion = 1; XmlSerializer serializer = new XmlSerializer(typeof(FlexWikiWebApplicationConfiguration)); XmlWriterSettings writerSettings = new XmlWriterSettings(); writerSettings.Indent = true; writerSettings.IndentChars = " "; StringWriter stringWriter = new StringWriter(); XmlWriter xmlWriter = XmlWriter.Create(stringWriter, writerSettings); serializer.Serialize(xmlWriter, appConfig); xmlWriter.Close(); w.Write(HtmlStringWriter.Escape(stringWriter.ToString())); w.Write("</pre></blockquote>"); return w.ToString(); }
private static string ExampleConfig() { HtmlStringWriter w = new HtmlStringWriter(); w.Write("<blockquote><pre>"); w.Write(HtmlStringWriter.Escape(@"<?xml version=""1.0"" encoding=""utf-8""?> <FederationConfiguration> <DefaultNamespace>FlexWiki</DefaultNamespace> <Namespaces> <Namespace Id=""238f8774-a470-4f2e-93a0-07252e99fcb9"" Type=""FlexWiki.FileSystemStore"" Connection="".\wikibases\FlexWiki"" Namespace=""FlexWiki"" /> <Namespace Id=""890e8874-a470-4f2e-93a0-07252e99ed19"" Type=""FlexWiki.FileSystemStore"" Connection="".\wikibases\Some.Other.Namespace"" Namespace=""Some.Other.Namespace"" /> </Namespaces> <About>This site is the home of FlexWiki, an experimental collaboration tool.</About> </FederationConfiguration>")); w.Write("</pre></blockquote>"); return w.ToString(); }