Fixed and closed #494: PluginPack now compiled as separate assemblies. Also implemented Updater plugin to silently replace PluginPack.dll with new DLLs.

This commit is contained in:
Dario Solera 2010-05-02 09:13:57 +00:00
parent 0a54e553cc
commit c89e576368
26 changed files with 905 additions and 936 deletions

View file

@ -66,7 +66,7 @@
<MakeDir Directories="@(WebAppOutput_SqlServer_PublicDirectory_Plugins)" /> <MakeDir Directories="@(WebAppOutput_SqlServer_PublicDirectory_Plugins)" />
<!-- Plugins Assemblies --> <!-- Plugins Assemblies -->
<CreateItem Include="Temp\PluginPack.dll;Temp\SqlServerProviders.dll;Temp\ActiveDirectoryProvider.dll"> <CreateItem Include="Temp\SqlServerProviders.dll;Temp\ActiveDirectoryProvider.dll;Temp\*Plugin.dll">
<Output ItemName="BuiltPlugins" TaskParameter="Include" /> <Output ItemName="BuiltPlugins" TaskParameter="Include" />
</CreateItem> </CreateItem>
<Copy SourceFiles="@(BuiltPlugins)" DestinationFolder=".\Artifacts\Plugins\" /> <Copy SourceFiles="@(BuiltPlugins)" DestinationFolder=".\Artifacts\Plugins\" />

View file

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{DEA4E4AA-7452-4598-8277-A7F5D6DE4985}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DownloadCounterPlugin_Tests</RootNamespace>
<AssemblyName>DownloadCounterPlugin-Tests</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=2.5.2.9222, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\References\Tools\NUnit\framework\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Rhino.Mocks, Version=3.5.0.1337, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\References\Tools\Rhino.Mocks\Rhino.Mocks.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DownloadCounterTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DownloadCounterPlugin\DownloadCounterPlugin.csproj">
<Project>{C2F2722A-0B44-4E98-965C-CC1AD1DA511C}</Project>
<Name>DownloadCounterPlugin</Name>
</ProjectReference>
<ProjectReference Include="..\PluginFramework\PluginFramework.csproj">
<Project>{531A83D6-76F9-4014-91C5-295818E2D948}</Project>
<Name>PluginFramework</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -0,0 +1,100 @@

using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using Rhino.Mocks;
using RMC = Rhino.Mocks.Constraints;
using ScrewTurn.Wiki.PluginFramework;
namespace ScrewTurn.Wiki.Plugins.PluginPack.Tests {
[TestFixture]
public class DownloadCounterTests {
[Test]
public void Format() {
MockRepository mocks = new MockRepository();
IFilesStorageProviderV30 prov = mocks.StrictMock<IFilesStorageProviderV30>();
string content = string.Format(
@"This is a test page.
<countDownloads pattern=""#CoUnT#-#DaIlY#-#WeEkLy#-#MoNtHlY#"" startDate=""{0:yyyy'/'MM'/'dd}"">
<file name=""/my/file.zip"" provider=""{1}"" />
<file name=""/my/other/file.zip"" />
<file name=""/my/inexistent-file.zip"" provider=""{1}"" />
<file name=""/my/other/inexistent-file.zip"" />
<attachment name=""attn.zip"" page=""page"" provider=""{1}"" />
<attachment name=""attn.zip"" page=""page"" />
<attachment name=""inexistent-attn.zip"" page=""page"" provider=""{1}"" />
<attachment name=""inexistent-attn.zip"" page=""page"" />
<attachment name=""attn.zip"" page=""inexistent-page"" provider=""{1}"" />
<attachment name=""attn.zip"" page=""inexistent-page"" />
</countDownloads>", DateTime.Today.AddDays(-60), prov.GetType().FullName);
// */file.zip was downloaded 13 times
// attn.zip was downloaded 56 times
// Expected output: 138-2-16-68
IHostV30 host = mocks.StrictMock<IHostV30>();
host.LogEntry(null, LogEntryType.Warning, null, null);
LastCall.On(host).IgnoreArguments().Repeat.Any();
Expect.Call(host.GetSettingValue(SettingName.DefaultFilesStorageProvider)).Return(
prov.GetType().FullName).Repeat.Times(4);
Expect.Call(host.GetFilesStorageProviders(true)).Return(
new IFilesStorageProviderV30[] { prov }).Repeat.Times(8);
StFileInfo[] myFiles = new StFileInfo[] {
new StFileInfo(1000, DateTime.Now, 13, "/my/File.zip", prov),
new StFileInfo(10000, DateTime.Now, 1000, "/my/other-file.zip", prov)
};
StFileInfo[] myOtherFiles = new StFileInfo[] {
new StFileInfo(1000, DateTime.Now, 13, "/my/OTHER/file.zip", prov),
new StFileInfo(10000, DateTime.Now, 2000, "/my/OTHER/other-file.zip", prov)
};
StFileInfo[] attachments = new StFileInfo[] {
new StFileInfo(2000, DateTime.Now, 56, "aTTn.zip", prov),
new StFileInfo(20000, DateTime.Now, 1000, "other-attn.zip", prov)
};
// /my/*
Expect.Call(host.ListFiles(null)).IgnoreArguments().Constraints(
RMC.Is.Matching(
delegate(StDirectoryInfo dir) {
return dir.FullPath == "/my/";
})).Return(myFiles).Repeat.Times(2);
// /my/other/*
Expect.Call(host.ListFiles(null)).IgnoreArguments().Constraints(
RMC.Is.Matching(
delegate(StDirectoryInfo dir) {
return dir.FullPath == "/my/other/";
})).Return(myOtherFiles).Repeat.Times(2);
PageInfo page = new PageInfo("page", null, DateTime.Now);
Expect.Call(host.FindPage("page")).Return(page).Repeat.Times(4);
Expect.Call(host.FindPage("inexistent-page")).Return(null).Repeat.Twice();
Expect.Call(host.ListPageAttachments(page)).Return(attachments).Repeat.Times(4);
mocks.ReplayAll();
DownloadCounter counter = new DownloadCounter();
counter.Init(host, "");
string output = counter.Format(content, null, FormattingPhase.Phase3);
Assert.IsTrue(output == @"This is a test page.
138-2-16-68" || output == @"This is a test page.
138-2-16-69", "Wrong output");
mocks.VerifyAll();
}
}
}

View file

@ -0,0 +1,18 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ScrewTurn Wiki Download Counter Plugin Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("acebd2f0-5ca9-4898-92f5-b9a523d10aa5")]

View file

@ -22,7 +22,7 @@ namespace ScrewTurn.Wiki.Plugins.PluginPack {
private IHostV30 _host; private IHostV30 _host;
private string _config; private string _config;
private bool _enableLogging = true; private bool _enableLogging = true;
private static readonly ComponentInformation Info = new ComponentInformation("Download Counter Plugin", "Threeplicate Srl", "3.0.1.471", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/DownloadCounter.txt"); private static readonly ComponentInformation Info = new ComponentInformation("Download Counter Plugin", "Threeplicate Srl", "3.0.1.472", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/DownloadCounter2.txt");
private static readonly Regex XmlRegex = new Regex(@"\<countDownloads(.+?)\>(.+?)\<\/countDownloads\>", private static readonly Regex XmlRegex = new Regex(@"\<countDownloads(.+?)\>(.+?)\<\/countDownloads\>",
RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);

View file

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C2F2722A-0B44-4E98-965C-CC1AD1DA511C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ScrewTurn.Wiki.Plugins.PluginPack</RootNamespace>
<AssemblyName>DownloadCounterPlugin</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Debug\DownloadCounterPlugin.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Release\DownloadCounterPlugin.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\AssemblyVersion.cs">
<Link>AssemblyVersion.cs</Link>
</Compile>
<Compile Include="DownloadCounter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PluginFramework\PluginFramework.csproj">
<Project>{531A83D6-76F9-4014-91C5-295818E2D948}</Project>
<Name>PluginFramework</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -0,0 +1,18 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ScrewTurn Wiki Download Counter Plugin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("104c716d-5ab2-45f0-9966-6ba0f2a3ef57")]

View file

@ -13,7 +13,8 @@ namespace ScrewTurn.Wiki.Plugins.PluginPack {
public class Footnotes : IFormatterProviderV30 { public class Footnotes : IFormatterProviderV30 {
// Kindly contributed by Jens Felsner // Kindly contributed by Jens Felsner
private static readonly ComponentInformation info = new ComponentInformation("Footnotes Plugin", "Threeplicate Srl", "3.0.1.471", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/Footnotes.txt");
private static readonly ComponentInformation info = new ComponentInformation("Footnotes Plugin", "Threeplicate Srl", "3.0.1.472", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/Footnotes2.txt");
private static readonly Regex ReferencesRegex = new Regex("(<[ ]*references[ ]*/[ ]*>|<[ ]*references[ ]*>.*?<[ ]*/[ ]*references[ ]*>)", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex ReferencesRegex = new Regex("(<[ ]*references[ ]*/[ ]*>|<[ ]*references[ ]*>.*?<[ ]*/[ ]*references[ ]*>)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex RefRegex = new Regex("<[ ]*ref[ ]*>.*?<[ ]*/[ ]*ref[ ]*>", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex RefRegex = new Regex("<[ ]*ref[ ]*>.*?<[ ]*/[ ]*ref[ ]*>", RegexOptions.Compiled | RegexOptions.IgnoreCase);

View file

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B7EE7C86-5031-40EB-B06C-DF5B3564BE17}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ScrewTurn.Wiki.Plugins.PluginPack</RootNamespace>
<AssemblyName>FootnotesPlugin</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Debug\FootnotesPlugin.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Release\FootnotesPlugin.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\AssemblyVersion.cs">
<Link>AssemblyVersion.cs</Link>
</Compile>
<Compile Include="Footnotes.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PluginFramework\PluginFramework.csproj">
<Project>{531A83D6-76F9-4014-91C5-295818E2D948}</Project>
<Name>PluginFramework</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -0,0 +1,18 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ScrewTurn Wiki Footnotes Plugin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f40e7384-f5cf-4ba4-b05e-a4efb5596a1f")]

Binary file not shown.

View file

@ -17,24 +17,29 @@
<OutputPath>..\Help\</OutputPath> <OutputPath>..\Help\</OutputPath>
<HtmlHelpName>ScrewTurnWiki</HtmlHelpName> <HtmlHelpName>ScrewTurnWiki</HtmlHelpName>
<DocumentationSources> <DocumentationSources>
<DocumentationSource sourceFile="..\AclEngine\AclEngine.csproj" xmlns="" /> <DocumentationSource sourceFile="..\AclEngine\AclEngine.csproj" />
<DocumentationSource sourceFile="..\ActiveDirectoryProvider\ActiveDirectoryProvider.csproj" xmlns="" /> <DocumentationSource sourceFile="..\ActiveDirectoryProvider\ActiveDirectoryProvider.csproj" />
<DocumentationSource sourceFile="..\Core\Core.csproj" xmlns="" /> <DocumentationSource sourceFile="..\Core\Core.csproj" />
<DocumentationSource sourceFile="..\PluginFramework\PluginFramework.csproj" xmlns="" /> <DocumentationSource sourceFile="..\DownloadCounterPlugin\DownloadCounterPlugin.csproj" />
<DocumentationSource sourceFile="..\PluginPack\PluginPack.csproj" xmlns="" /> <DocumentationSource sourceFile="..\FootnotesPlugin\FootnotesPlugin.csproj" />
<DocumentationSource sourceFile="..\SearchEngine\SearchEngine.csproj" xmlns="" /> <DocumentationSource sourceFile="..\MultilanguageContentPlugin\MultilanguageContentPlugin.csproj" />
<DocumentationSource sourceFile="..\SqlProvidersCommon\SqlProvidersCommon.csproj" xmlns="" /> <DocumentationSource sourceFile="..\PluginFramework\PluginFramework.csproj" />
<DocumentationSource sourceFile="..\SqlServerProviders\SqlServerProviders.csproj" xmlns="" /></DocumentationSources> <DocumentationSource sourceFile="..\RssFeedDisplayPlugin\RssFeedDisplayPlugin.csproj" />
<DocumentationSource sourceFile="..\SearchEngine\SearchEngine.csproj" />
<DocumentationSource sourceFile="..\SqlProvidersCommon\SqlProvidersCommon.csproj" />
<DocumentationSource sourceFile="..\SqlServerProviders\SqlServerProviders.csproj" />
<DocumentationSource sourceFile="..\UnfuddleTicketsPlugin\UnfuddleTicketsPlugin.csproj" /></DocumentationSources>
<NamespaceSummaries> <NamespaceSummaries>
<NamespaceSummaryItem name="ScrewTurn.Wiki.AclEngine" isDocumented="True">Namespace containing ACL Engine types.</NamespaceSummaryItem> <NamespaceSummaryItem name="ScrewTurn.Wiki.AclEngine" isDocumented="True">Namespace containing ACL Engine types.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ScrewTurn.Wiki.ImportWiki" isDocumented="False" /> <NamespaceSummaryItem name="ScrewTurn.Wiki.ImportWiki" isDocumented="False" />
<NamespaceSummaryItem name="ScrewTurn.Wiki.PluginFramework" isDocumented="True">Namespace containing Plugin Framework types.</NamespaceSummaryItem> <NamespaceSummaryItem name="ScrewTurn.Wiki.PluginFramework" isDocumented="True">Namespace containing Plugin Framework types.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ScrewTurn.Wiki.Plugins.ActiveDirectory" isDocumented="True">Namespace containing Active Directory Provider types.</NamespaceSummaryItem> <NamespaceSummaryItem name="ScrewTurn.Wiki.Plugins.ActiveDirectory" isDocumented="True">Namespace containing Active Directory Provider types.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ScrewTurn.Wiki.Plugins.PluginPack" isDocumented="True">Namespace containing Plugin Pack types.</NamespaceSummaryItem> <NamespaceSummaryItem name="ScrewTurn.Wiki.Plugins.PluginPack" isDocumented="True">Namespace containing Plugin Pack types.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ScrewTurn.Wiki.Plugins.SqlCommon" isDocumented="True">Namespace containing SQL Common types.</NamespaceSummaryItem> <NamespaceSummaryItem name="ScrewTurn.Wiki.Plugins.SqlCommon" isDocumented="True">Namespace containing SQL Common types.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ScrewTurn.Wiki.Plugins.SqlServer" isDocumented="True">Namespace containing SQL Server types.</NamespaceSummaryItem> <NamespaceSummaryItem name="ScrewTurn.Wiki.Plugins.SqlServer" isDocumented="True">Namespace containing SQL Server types.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ScrewTurn.Wiki.SearchEngine" isDocumented="True">Namespace containing Search Engine types.</NamespaceSummaryItem> <NamespaceSummaryItem name="ScrewTurn.Wiki.SearchEngine" isDocumented="True">Namespace containing Search Engine types.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ScrewTurn.Wiki" isDocumented="True">Root ScrewTurn Wiki namespace.</NamespaceSummaryItem></NamespaceSummaries> <NamespaceSummaryItem name="ScrewTurn.Wiki" isDocumented="True">Root ScrewTurn Wiki namespace.</NamespaceSummaryItem>
</NamespaceSummaries>
<ProjectSummary>API documentation for ScrewTurn Wiki version 3.0.</ProjectSummary> <ProjectSummary>API documentation for ScrewTurn Wiki version 3.0.</ProjectSummary>
<CopyrightHref>http://www.screwturn.eu</CopyrightHref> <CopyrightHref>http://www.screwturn.eu</CopyrightHref>
<CopyrightText>Copyright %28C%29 2006-2010 Threeplicate Srl. All rights reserved.</CopyrightText> <CopyrightText>Copyright %28C%29 2006-2010 Threeplicate Srl. All rights reserved.</CopyrightText>

View file

@ -14,7 +14,7 @@ namespace ScrewTurn.Wiki.Plugins.PluginPack {
private IHostV30 host; private IHostV30 host;
private string config; private string config;
private ComponentInformation info = new ComponentInformation("Multilanguage Content Plugin", "Threeplicate Srl", "3.0.1.471", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/Multilanguage.txt"); private ComponentInformation info = new ComponentInformation("Multilanguage Content Plugin", "Threeplicate Srl", "3.0.1.472", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/Multilanguage2.txt");
private string defaultLanguage = "en-us"; private string defaultLanguage = "en-us";
private bool displayWarning = false; private bool displayWarning = false;

View file

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{94DDE3D4-0595-405C-9EA6-358B74EC6BC5}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ScrewTurn.Wiki.Plugins.PluginPack</RootNamespace>
<AssemblyName>MultilanguageContentPlugin</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Debug\MultilanguageContentPlugin.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Release\MultilanguageContentPlugin.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\AssemblyVersion.cs">
<Link>AssemblyVersion.cs</Link>
</Compile>
<Compile Include="MultilanguageContentPlugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PluginFramework\PluginFramework.csproj">
<Project>{531A83D6-76F9-4014-91C5-295818E2D948}</Project>
<Name>PluginFramework</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -0,0 +1,18 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ScrewTurn Wiki Multilanguage Content Plugin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d39feb9c-97b6-4a10-b5fe-91c1eec36e55")]

View file

@ -1,798 +0,0 @@

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ScrewTurn.Wiki.PluginFramework;
using ScrewTurn.Wiki.SearchEngine;
namespace ScrewTurn.Wiki.Plugins.PluginPack {
/// <summary>
/// Implements a sandbox plugin for pages.
/// </summary>
public class PagesSandbox {
private IHostV30 host;
private string config;
private static readonly ComponentInformation info = new ComponentInformation("Pages Sandbox", "Threeplicate Srl", "3.0.1.471", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/PagesSandbox.txt");
private List<NamespaceInfo> allNamespaces = new List<NamespaceInfo>(5);
private List<PageInfo> allPages;
private Dictionary<PageInfo, PageContent> allContents;
private Dictionary<PageContent, List<PageContent>> allBackups;
private Dictionary<PageInfo, PageContent> allDrafts;
private List<CategoryInfo> allCategories;
private uint freeDocumentId = 1;
private uint freeWordId = 1;
private IInMemoryIndex index;
/// <summary>
/// Gets a namespace.
/// </summary>
/// <param name="name">The name of the namespace (cannot be <c>null</c> or empty).</param>
/// <returns>The <see cref="T:NamespaceInfo"/>, or <c>null</c> if no namespace is found.</returns>
public NamespaceInfo GetNamespace(string name) {
if(name == null) throw new ArgumentNullException("name");
if(name.Length == 0) throw new ArgumentException("Name cannot be empty");
return allNamespaces.Find(n => n.Name == name);
}
/// <summary>
/// Gets all the sub-namespaces.
/// </summary>
/// <returns>The sub-namespaces, sorted by name.</returns>
public NamespaceInfo[] GetNamespaces() {
lock(this) {
return allNamespaces.ToArray();
}
}
/// <summary>
/// Adds a new namespace.
/// </summary>
/// <param name="name">The name of the namespace.</param>
/// <returns>The correct <see cref="T:NamespaceInfo"/> object.</returns>
public NamespaceInfo AddNamespace(string name) {
throw new NotImplementedException();
/*if(name == null) throw new ArgumentNullException("name");
if(name.Length == 0) throw new ArgumentException("Name cannot be empty", "name");
lock(this) {
if(GetNamespace(name) != null) return null;
// This does not compile unless PagesSandbox implements IPagesStorageProviderV30
NamespaceInfo newSpace = new NamespaceInfo(name, this, null);
allNamespaces.Add(newSpace);
return newSpace;
}*/
}
/// <summary>
/// Renames a namespace.
/// </summary>
/// <param name="nspace">The namespace to rename.</param>
/// <param name="newName">The new name of the namespace.</param>
/// <returns>The correct <see cref="T:NamespaceInfo"/> object.</returns>
public NamespaceInfo RenameNamespace(NamespaceInfo nspace, string newName) {
if(nspace == null) throw new ArgumentNullException("nspace");
if(newName == null) throw new ArgumentNullException("newName");
if(newName.Length == 0) throw new ArgumentException("New Name cannot be empty", "newName");
lock(this) {
if(GetNamespace(newName) != null) return null;
nspace.Name = newName;
return nspace;
}
}
/// <summary>
/// Sets the default page of a namespace.
/// </summary>
/// <param name="nspace">The namespace of which to set the default page.</param>
/// <param name="page">The page to use as default page, or <c>null</c>.</param>
/// <returns>The correct <see cref="T:NamespaceInfo"/> object.</returns>
public NamespaceInfo SetNamespaceDefaultPage(NamespaceInfo nspace, PageInfo page) {
if(nspace == null) throw new ArgumentNullException("nspace");
lock(this) {
nspace.DefaultPage = page;
return nspace;
}
}
/// <summary>
/// Removes a namespace.
/// </summary>
/// <param name="nspace">The namespace to remove.</param>
/// <returns><c>true</c> if the namespace is removed, <c>false</c> otherwise.</returns>
public bool RemoveNamespace(NamespaceInfo nspace) {
if(nspace == null) throw new ArgumentNullException("nspace");
lock(this) {
return allNamespaces.Remove(nspace);
}
}
/// <summary>
/// Moves a page from its namespace into another.
/// </summary>
/// <param name="page">The page to move.</param>
/// <param name="destination">The destination namespace (<c>null</c> for the root).</param>
/// <param name="copyCategories">A value indicating whether to copy the page categories in the destination
/// namespace, if not already available.</param>
/// <returns>The correct instance of <see cref="T:PageInfo"/>.</returns>
public PageInfo MovePage(PageInfo page, NamespaceInfo destination, bool copyCategories) {
throw new NotImplementedException();
}
/// <summary>
/// Gets a category.
/// </summary>
/// <param name="fullName">The full name of the category.</param>
/// <returns>The <see cref="T:CategoryInfo"/>, or <c>null</c> if no category is found.</returns>
public CategoryInfo GetCategory(string fullName) {
throw new NotImplementedException();
}
/// <summary>
/// Gets all the Categories in a namespace.
/// </summary>
/// <param name="nspace">The namespace.</param>
/// <returns>All the Categories in the namespace, sorted by name.</returns>
public CategoryInfo[] GetCategories(NamespaceInfo nspace) {
throw new NotImplementedException();
}
/// <summary>
/// Gets all the categories of a page.
/// </summary>
/// <param name="page">The page.</param>
/// <returns>The categories, sorted by name.</returns>
public CategoryInfo[] GetCategoriesForPage(PageInfo page) {
throw new NotImplementedException();
}
/// <summary>
/// Adds a Category.
/// </summary>
/// <param name="nspace">The target namespace (<c>null</c> for the root).</param>
/// <param name="name">The Category name.</param>
/// <returns>The correct CategoryInfo object.</returns>
/// <remarks>The moethod should set category's Pages to an empty array.</remarks>
public CategoryInfo AddCategory(string nspace, string name) {
throw new NotImplementedException();
}
/// <summary>
/// Renames a Category.
/// </summary>
/// <param name="category">The Category to rename.</param>
/// <param name="newName">The new Name.</param>
/// <returns>The correct CategoryInfo object.</returns>
public CategoryInfo RenameCategory(CategoryInfo category, string newName) {
throw new NotImplementedException();
}
/// <summary>
/// Removes a Category.
/// </summary>
/// <param name="category">The Category to remove.</param>
/// <returns>True if the Category has been removed successfully.</returns>
public bool RemoveCategory(CategoryInfo category) {
throw new NotImplementedException();
}
/// <summary>
/// Merges two Categories.
/// </summary>
/// <param name="source">The source Category.</param>
/// <param name="destination">The destination Category.</param>
/// <returns>The correct <see cref="T:CategoryInfo"/> object.</returns>
/// <remarks>The <b>destination</b> Category remains, while the <b>source</b> Category is deleted, and all its Pages re-bound
/// in the <b>destination</b> Category.</remarks>
public CategoryInfo MergeCategories(CategoryInfo source, CategoryInfo destination) {
throw new NotImplementedException();
}
/// <summary>
/// Performs a search in the index.
/// </summary>
/// <param name="parameters">The search parameters.</param>
/// <returns>The results.</returns>
public SearchResultCollection PerformSearch(SearchParameters parameters) {
throw new NotImplementedException();
}
/// <summary>
/// Rebuilds the search index.
/// </summary>
public void RebuildIndex() {
throw new NotImplementedException();
}
/// <summary>
/// Gets some statistics about the search engine index.
/// </summary>
/// <param name="documentCount">The total number of documents.</param>
/// <param name="wordCount">The total number of unique words.</param>
/// <param name="occurrenceCount">The total number of word-document occurrences.</param>
/// <param name="size">The approximated size, in bytes, of the search engine index.</param>
public void GetIndexStats(out int documentCount, out int wordCount, out int occurrenceCount, out long size) {
throw new NotImplementedException();
}
/// <summary>
/// Gets a value indicating whether the search engine index is corrupted and needs to be rebuilt.
/// </summary>
public bool IsIndexCorrupted {
get { throw new NotImplementedException(); }
}
/// <summary>
/// Gets a page.
/// </summary>
/// <param name="fullName">The full name of the page.</param>
/// <returns>The <see cref="T:PageInfo"/>, or <c>null</c> if no page is found.</returns>
public PageInfo GetPage(string fullName) {
throw new NotImplementedException();
}
/// <summary>
/// Gets all the Pages in a namespace.
/// </summary>
/// <param name="nspace">The namespace (<c>null</c> for the root).</param>
/// <returns>All the Pages in the namespace, sorted by name.</returns>
public PageInfo[] GetPages(NamespaceInfo nspace) {
throw new NotImplementedException();
}
/// <summary>
/// Gets all the pages in a namespace that are bound to zero categories.
/// </summary>
/// <param name="nspace">The namespace (<c>null</c> for the root).</param>
/// <returns>The pages, sorted by name.</returns>
public PageInfo[] GetUncategorizedPages(NamespaceInfo nspace) {
throw new NotImplementedException();
}
/// <summary>
/// Gets the Content of a Page.
/// </summary>
/// <param name="page">The Page.</param>
/// <returns>The Page Content object.</returns>
public PageContent GetContent(PageInfo page) {
throw new NotImplementedException();
}
/// <summary>
/// Gets the content of a draft of a Page.
/// </summary>
/// <param name="page">The Page.</param>
/// <returns>The draft, or <c>null</c> if no draft exists.</returns>
public PageContent GetDraft(PageInfo page) {
throw new NotImplementedException();
}
/// <summary>
/// Deletes a draft of a Page.
/// </summary>
/// <param name="page">The page.</param>
/// <returns><c>true</c> if the draft is deleted, <c>false</c> otherwise.</returns>
public bool DeleteDraft(PageInfo page) {
throw new NotImplementedException();
}
/// <summary>
/// Gets the Backup/Revision numbers of a Page.
/// </summary>
/// <param name="page">The Page to get the Backups of.</param>
/// <returns>The Backup/Revision numbers.</returns>
public int[] GetBackups(PageInfo page) {
throw new NotImplementedException();
}
/// <summary>
/// Gets the Content of a Backup of a Page.
/// </summary>
/// <param name="page">The Page to get the backup of.</param>
/// <param name="revision">The Backup/Revision number.</param>
/// <returns>The Page Backup.</returns>
public PageContent GetBackupContent(PageInfo page, int revision) {
throw new NotImplementedException();
}
/// <summary>
/// Forces to overwrite or create a Backup.
/// </summary>
/// <param name="content">The Backup content.</param>
/// <param name="revision">The revision.</param>
/// <returns>True if the Backup has been created successfully.</returns>
public bool SetBackupContent(PageContent content, int revision) {
throw new NotImplementedException();
}
/// <summary>
/// Adds a Page.
/// </summary>
/// <param name="nspace">The target namespace (<c>null</c> for the root).</param>
/// <param name="name">The Page Name.</param>
/// <param name="creationDateTime">The creation Date/Time.</param>
/// <returns>The correct PageInfo object or null.</returns>
/// <remarks>This method should <b>not</b> create the content of the Page.</remarks>
public PageInfo AddPage(string nspace, string name, DateTime creationDateTime) {
throw new NotImplementedException();
}
/// <summary>
/// Renames a Page.
/// </summary>
/// <param name="page">The Page to rename.</param>
/// <param name="newName">The new Name.</param>
/// <returns>The correct <see cref="T:PageInfo"/> object.</returns>
public PageInfo RenamePage(PageInfo page, string newName) {
throw new NotImplementedException();
}
/// <summary>
/// Modifies the Content of a Page.
/// </summary>
/// <param name="page">The Page.</param>
/// <param name="title">The Title of the Page.</param>
/// <param name="username">The Username.</param>
/// <param name="dateTime">The Date/Time.</param>
/// <param name="comment">The Comment of the editor, about this revision.</param>
/// <param name="content">The Page Content.</param>
/// <param name="keywords">The keywords, usually used for SEO.</param>
/// <param name="description">The description, usually used for SEO.</param>
/// <param name="saveMode">The save mode for this modification.</param>
/// <returns><c>true</c> if the Page has been modified successfully, <c>false</c> otherwise.</returns>
/// <remarks>If <b>saveMode</b> equals <b>Draft</b> and a draft already exists, it is overwritten.</remarks>
public bool ModifyPage(PageInfo page, string title, string username, DateTime dateTime, string comment, string content, string[] keywords, string description, SaveMode saveMode) {
throw new NotImplementedException();
}
/// <summary>
/// Performs the rollback of a Page to a specified revision.
/// </summary>
/// <param name="page">The Page to rollback.</param>
/// <param name="revision">The Revision to rollback the Page to.</param>
/// <returns><c>true</c> if the rollback succeeded, <c>false</c> otherwise.</returns>
public bool RollbackPage(PageInfo page, int revision) {
throw new NotImplementedException();
}
/// <summary>
/// Deletes the Backups of a Page, up to a specified revision.
/// </summary>
/// <param name="page">The Page to delete the backups of.</param>
/// <param name="revision">The newest revision to delete (newer revision are kept) or -1 to delete all the Backups.</param>
/// <returns><c>true</c> if the deletion succeeded, <c>false</c> otherwise.</returns>
public bool DeleteBackups(PageInfo page, int revision) {
throw new NotImplementedException();
}
/// <summary>
/// Removes a Page.
/// </summary>
/// <param name="page">The Page to remove.</param>
/// <returns>True if the Page is removed successfully.</returns>
public bool RemovePage(PageInfo page) {
throw new NotImplementedException();
}
/// <summary>
/// Binds a Page with one or more Categories.
/// </summary>
/// <param name="page">The Page to bind.</param>
/// <param name="categories">The Categories to bind the Page with.</param>
/// <returns>True if the binding succeeded.</returns>
/// <remarks>After a successful operation, the Page is bound with all and only the categories passed as argument.</remarks>
public bool RebindPage(PageInfo page, string[] categories) {
throw new NotImplementedException();
}
/// <summary>
/// Gets the Page Messages.
/// </summary>
/// <param name="page">The Page.</param>
/// <returns>The list of the <b>first-level</b> Messages, containing the replies properly nested, sorted by date/time.</returns>
public Message[] GetMessages(PageInfo page) {
throw new NotImplementedException();
}
/// <summary>
/// Gets the total number of Messages in a Page Discussion.
/// </summary>
/// <param name="page">The Page.</param>
/// <returns>The number of messages.</returns>
public int GetMessageCount(PageInfo page) {
throw new NotImplementedException();
}
/// <summary>
/// Removes all messages for a page and stores the new messages.
/// </summary>
/// <param name="page">The page.</param>
/// <param name="messages">The new messages to store.</param>
/// <returns><c>true</c> if the messages are stored, <c>false</c> otherwise.</returns>
public bool BulkStoreMessages(PageInfo page, Message[] messages) {
throw new NotImplementedException();
}
/// <summary>
/// Adds a new Message to a Page.
/// </summary>
/// <param name="page">The Page.</param>
/// <param name="username">The Username.</param>
/// <param name="subject">The Subject.</param>
/// <param name="dateTime">The Date/Time.</param>
/// <param name="body">The Body.</param>
/// <param name="parent">The Parent Message ID, or -1.</param>
/// <returns>True if the Message is added successfully.</returns>
public bool AddMessage(PageInfo page, string username, string subject, DateTime dateTime, string body, int parent) {
throw new NotImplementedException();
}
/// <summary>
/// Removes a Message.
/// </summary>
/// <param name="page">The Page.</param>
/// <param name="id">The ID of the Message to remove.</param>
/// <param name="removeReplies">A value specifying whether or not to remove the replies.</param>
/// <returns>True if the Message is removed successfully.</returns>
public bool RemoveMessage(PageInfo page, int id, bool removeReplies) {
throw new NotImplementedException();
}
/// <summary>
/// Modifies a Message.
/// </summary>
/// <param name="page">The Page.</param>
/// <param name="id">The ID of the Message to modify.</param>
/// <param name="username">The Username.</param>
/// <param name="subject">The Subject.</param>
/// <param name="dateTime">The Date/Time.</param>
/// <param name="body">The Body.</param>
/// <returns>True if the Message is modified successfully.</returns>
public bool ModifyMessage(PageInfo page, int id, string username, string subject, DateTime dateTime, string body) {
throw new NotImplementedException();
}
/// <summary>
/// Gets all the Navigation Paths in a Namespace.
/// </summary>
/// <param name="nspace">The Namespace.</param>
/// <returns>All the Navigation Paths, sorted by name.</returns>
public NavigationPath[] GetNavigationPaths(NamespaceInfo nspace) {
throw new NotImplementedException();
}
/// <summary>
/// Adds a new Navigation Path.
/// </summary>
/// <param name="nspace">The target namespace (<c>null</c> for the root).</param>
/// <param name="name">The Name of the Path.</param>
/// <param name="pages">The Pages array.</param>
/// <returns>The correct <see cref="T:NavigationPath"/> object.</returns>
public NavigationPath AddNavigationPath(string nspace, string name, PageInfo[] pages) {
throw new NotImplementedException();
}
/// <summary>
/// Modifies an existing navigation path.
/// </summary>
/// <param name="path">The navigation path to modify.</param>
/// <param name="pages">The new pages array.</param>
/// <returns>The correct <see cref="T:NavigationPath"/> object.</returns>
public NavigationPath ModifyNavigationPath(NavigationPath path, PageInfo[] pages) {
throw new NotImplementedException();
}
/// <summary>
/// Removes a Navigation Path.
/// </summary>
/// <param name="path">The navigation path to remove.</param>
/// <returns><c>true</c> if the path is removed, <c>false</c> otherwise.</returns>
public bool RemoveNavigationPath(NavigationPath path) {
throw new NotImplementedException();
}
/// <summary>
/// Gets all the snippets.
/// </summary>
/// <returns>All the snippets, sorted by name.</returns>
public Snippet[] GetSnippets() {
throw new NotImplementedException();
}
/// <summary>
/// Adds a new snippet.
/// </summary>
/// <param name="name">The name of the snippet.</param>
/// <param name="content">The content of the snippet.</param>
/// <returns>The correct <see cref="T:Snippet"/> object.</returns>
public Snippet AddSnippet(string name, string content) {
throw new NotImplementedException();
}
/// <summary>
/// Modifies an existing snippet.
/// </summary>
/// <param name="name">The name of the snippet to modify.</param>
/// <param name="content">The content of the snippet.</param>
/// <returns>The correct <see cref="T:Snippet"/> object.</returns>
public Snippet ModifySnippet(string name, string content) {
throw new NotImplementedException();
}
/// <summary>
/// Removes a new Snippet.
/// </summary>
/// <param name="name">The Name of the Snippet to remove.</param>
/// <returns><c>true</c> if the snippet is removed, <c>false</c> otherwise.</returns>
public bool RemoveSnippet(string name) {
throw new NotImplementedException();
}
/// <summary>
/// Gets all the content templates.
/// </summary>
/// <returns>All the content templates, sorted by name.</returns>
public ContentTemplate[] GetContentTemplates() {
throw new NotImplementedException();
}
/// <summary>
/// Adds a new content template.
/// </summary>
/// <param name="name">The name of template.</param>
/// <param name="content">The content of the template.</param>
/// <returns>The correct <see cref="T:ContentTemplate"/> object.</returns>
public ContentTemplate AddContentTemplate(string name, string content) {
throw new NotImplementedException();
}
/// <summary>
/// Modifies an existing content template.
/// </summary>
/// <param name="name">The name of the template to modify.</param>
/// <param name="content">The content of the template.</param>
/// <returns>The correct <see cref="T:ContentTemplate"/> object.</returns>
public ContentTemplate ModifyContentTemplate(string name, string content) {
throw new NotImplementedException();
}
/// <summary>
/// Removes a content template.
/// </summary>
/// <param name="name">The name of the template to remove.</param>
/// <returns><c>true</c> if the template is removed, <c>false</c> otherwise.</returns>
public bool RemoveContentTemplate(string name) {
throw new NotImplementedException();
}
/// <summary>
/// Gets a value specifying whether the provider is read-only, i.e. it can only provide data and not store it.
/// </summary>
public bool ReadOnly {
get { throw new NotImplementedException(); }
}
/// <summary>
/// Initializes the Storage Provider.
/// </summary>
/// <param name="host">The Host of the Component.</param>
/// <param name="config">The Configuration data, if any.</param>
/// <remarks>If the configuration string is not valid, the methoud should throw a <see cref="InvalidConfigurationException"/>.</remarks>
public void Init(IHostV30 host, string config) {
if(host == null) throw new ArgumentNullException("host");
if(config == null) throw new ArgumentNullException("config");
this.host = host;
this.config = config;
allPages = new List<PageInfo>(50);
allContents = new Dictionary<PageInfo, PageContent>(50);
allBackups = new Dictionary<PageContent, List<PageContent>>(50);
allDrafts = new Dictionary<PageInfo, PageContent>(5);
allCategories = new List<CategoryInfo>(10);
// Prepare search index
index = new StandardIndex();
index.SetBuildDocumentDelegate(BuildDocumentHandler);
index.IndexChanged += index_IndexChanged;
}
private void index_IndexChanged(object sender, IndexChangedEventArgs e) {
lock(this) {
if(e.Change == IndexChangeType.DocumentAdded) {
List<WordId> newWords = new List<WordId>(e.ChangeData.Words.Count);
foreach(DumpedWord w in e.ChangeData.Words) {
newWords.Add(new WordId(w.Text, freeWordId));
freeWordId++;
}
e.Result = new IndexStorerResult(freeDocumentId, newWords);
freeDocumentId++;
}
else e.Result = null;
}
}
/// <summary>
/// Handles the construction of an <see cref="T:IDocument" /> for the search engine.
/// </summary>
/// <param name="dumpedDocument">The input dumped document.</param>
/// <returns>The resulting <see cref="T:IDocument" />.</returns>
private IDocument BuildDocumentHandler(DumpedDocument dumpedDocument) {
if(dumpedDocument.TypeTag == PageDocument.StandardTypeTag) {
string pageName = PageDocument.GetPageName(dumpedDocument.Name);
PageInfo page = GetPage(pageName);
if(page == null) return null;
else return new PageDocument(page, dumpedDocument, TokenizeContent);
}
else if(dumpedDocument.TypeTag == MessageDocument.StandardTypeTag) {
string pageFullName;
int id;
MessageDocument.GetMessageDetails(dumpedDocument.Name, out pageFullName, out id);
PageInfo page = GetPage(pageFullName);
if(page == null) return null;
else return new MessageDocument(page, id, dumpedDocument, TokenizeContent);
}
else return null;
}
/// <summary>
/// Tokenizes page content.
/// </summary>
/// <param name="content">The content to tokenize.</param>
/// <returns>The tokenized words.</returns>
private static WordInfo[] TokenizeContent(string content) {
WordInfo[] words = SearchEngine.Tools.Tokenize(content);
return words;
}
/// <summary>
/// Indexes a page.
/// </summary>
/// <param name="content">The content of the page.</param>
/// <returns>The number of indexed words, including duplicates.</returns>
private int IndexPage(PageContent content) {
lock(this) {
string documentName = PageDocument.GetDocumentName(content.PageInfo);
DumpedDocument ddoc = new DumpedDocument(0, documentName, host.PrepareTitleForIndexing(content.PageInfo, content.Title),
PageDocument.StandardTypeTag, content.LastModified);
// Store the document
// The content should always be prepared using IHost.PrepareForSearchEngineIndexing()
return index.StoreDocument(new PageDocument(content.PageInfo, ddoc, TokenizeContent),
content.Keywords, host.PrepareContentForIndexing(content.PageInfo, content.Content), null);
}
}
/// <summary>
/// Removes a page from the search engine index.
/// </summary>
/// <param name="content">The content of the page to remove.</param>
private void UnindexPage(PageContent content) {
lock(this) {
string documentName = PageDocument.GetDocumentName(content.PageInfo);
DumpedDocument ddoc = new DumpedDocument(0, documentName, host.PrepareTitleForIndexing(content.PageInfo, content.Title),
PageDocument.StandardTypeTag, content.LastModified);
index.RemoveDocument(new PageDocument(content.PageInfo, ddoc, TokenizeContent), null);
}
}
/// <summary>
/// Indexes a message.
/// </summary>
/// <param name="page">The page.</param>
/// <param name="id">The message ID.</param>
/// <param name="subject">The subject.</param>
/// <param name="dateTime">The date/time.</param>
/// <param name="body">The body.</param>
/// <returns>The number of indexed words, including duplicates.</returns>
private int IndexMessage(PageInfo page, int id, string subject, DateTime dateTime, string body) {
lock(this) {
// Trim "RE:" to avoid polluting the search engine index
if(subject.ToLowerInvariant().StartsWith("re:") && subject.Length > 3) subject = subject.Substring(3).Trim();
string documentName = MessageDocument.GetDocumentName(page, id);
DumpedDocument ddoc = new DumpedDocument(0, documentName, host.PrepareTitleForIndexing(null, subject),
MessageDocument.StandardTypeTag, dateTime);
// Store the document
// The content should always be prepared using IHost.PrepareForSearchEngineIndexing()
return index.StoreDocument(new MessageDocument(page, id, ddoc, TokenizeContent), null,
host.PrepareContentForIndexing(null, body), null);
}
}
/// <summary>
/// Indexes a message tree.
/// </summary>
/// <param name="page">The page.</param>
/// <param name="root">The tree root.</param>
private void IndexMessageTree(PageInfo page, Message root) {
IndexMessage(page, root.ID, root.Subject, root.DateTime, root.Body);
foreach(Message reply in root.Replies) {
IndexMessageTree(page, reply);
}
}
/// <summary>
/// Removes a message from the search engine index.
/// </summary>
/// <param name="page">The page.</param>
/// <param name="id">The message ID.</param>
/// <param name="subject">The subject.</param>
/// <param name="dateTime">The date/time.</param>
/// <param name="body">The body.</param>
/// <returns>The number of indexed words, including duplicates.</returns>
private void UnindexMessage(PageInfo page, int id, string subject, DateTime dateTime, string body) {
lock(this) {
// Trim "RE:" to avoid polluting the search engine index
if(subject.ToLowerInvariant().StartsWith("re:") && subject.Length > 3) subject = subject.Substring(3).Trim();
string documentName = MessageDocument.GetDocumentName(page, id);
DumpedDocument ddoc = new DumpedDocument(0, documentName, host.PrepareTitleForIndexing(null, subject),
MessageDocument.StandardTypeTag, DateTime.Now);
index.RemoveDocument(new MessageDocument(page, id, ddoc, TokenizeContent), null);
}
}
/// <summary>
/// Removes a message tree from the search engine index.
/// </summary>
/// <param name="page">The page.</param>
/// <param name="root">The tree root.</param>
private void UnindexMessageTree(PageInfo page, Message root) {
UnindexMessage(page, root.ID, root.Subject, root.DateTime, root.Body);
foreach(Message reply in root.Replies) {
UnindexMessageTree(page, reply);
}
}
/// <summary>
/// Method invoked on shutdown.
/// </summary>
/// <remarks>This method might not be invoked in some cases.</remarks>
public void Shutdown() {
// Nothing do to
}
/// <summary>
/// Gets the Information about the Provider.
/// </summary>
public ComponentInformation Information {
get { return info; }
}
/// <summary>
/// Gets a brief summary of the configuration string format, in HTML. Returns <c>null</c> if no configuration is needed.
/// </summary>
public string ConfigHelpHtml {
get { return null; }
}
}
}

View file

@ -68,13 +68,8 @@
<Compile Include="..\AssemblyVersion.cs"> <Compile Include="..\AssemblyVersion.cs">
<Link>AssemblyVersion.cs</Link> <Link>AssemblyVersion.cs</Link>
</Compile> </Compile>
<Compile Include="Footnotes.cs" />
<Compile Include="RssFeedDisplay.cs" />
<Compile Include="DownloadCounter.cs" />
<Compile Include="MultilanguageContentPlugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PagesSandbox.cs" /> <Compile Include="Updater.cs" />
<Compile Include="UnfuddleTickets.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\PluginFramework\PluginFramework.csproj"> <ProjectReference Include="..\PluginFramework\PluginFramework.csproj">
@ -103,9 +98,6 @@
<Install>false</Install> <Install>false</Install>
</BootstrapperPackage> </BootstrapperPackage>
</ItemGroup> </ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\UnfuddleTickets.xsl" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View file

@ -1,101 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="html"/>
<xsl:template match="/">
<div id="UnfuddleTicketsDiv">
<!-- Highest -->
<xsl:if test="count(/root/ticket-report/groups/group/title[text() = 'Highest']/parent::group/tickets) &gt; 0">
<h2 class="separator">Priority: Highest</h2>
</xsl:if>
<xsl:apply-templates select="/root/ticket-report/groups/group/title[text() = 'Highest']/parent::group/tickets"/>
<!-- High -->
<xsl:if test="count(/root/ticket-report/groups/group/title[text() = 'High']/parent::group/tickets) &gt; 0">
<h2 class="separator">Priority: High</h2>
</xsl:if>
<xsl:apply-templates select="/root/ticket-report/groups/group/title[text() = 'High']/parent::group/tickets"/>
<!-- Normal -->
<xsl:if test="count(/root/ticket-report/groups/group/title[text() = 'Normal']/parent::group/tickets) &gt; 0">
<h2 class="separator">Priority: Normal</h2>
</xsl:if>
<xsl:apply-templates select="/root/ticket-report/groups/group/title[text() = 'Normal']/parent::group/tickets"/>
<!-- Low -->
<xsl:if test="count(/root/ticket-report/groups/group/title[text() = 'Low']/parent::group/tickets) &gt; 0">
<h2 class="separator">Priority: Low</h2>
</xsl:if>
<xsl:apply-templates select="/root/ticket-report/groups/group/title[text() = 'Low']/parent::group/tickets"/>
<!-- Lowest -->
<xsl:if test="count(/root/ticket-report/groups/group/title[text() = 'Lowest']/parent::group/tickets) &gt; 0">
<h2 class="separator">Priority: Lowest</h2>
</xsl:if>
<xsl:apply-templates select="/root/ticket-report/groups/group/title[text() = 'Lowest']/parent::group/tickets"/>
</div>
</xsl:template>
<xsl:template match="/root/ticket-report/groups/group/tickets" priority="5">
<table style="width: 100%;" cellspacing="0" cellpadding="0">
<thead>
<tr class="tableheader">
<th style="white-space: nowrap; text-align: left; width: 50px;">
#
</th>
<th style="white-space: nowrap; text-align: left;">
Summary
</th>
<th style="white-space: nowrap; text-align: left; width: 80px;">
Status
</th>
<th style="white-space: nowrap;width: 70px;">
Priority
</th>
<th style="white-space: nowrap; text-align: left;width: 120px;">
Milestone
</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates select="ticket"/>
</tbody>
</table>
<br />
<br />
</xsl:template>
<xsl:template match="/root/ticket-report/groups/group/tickets/ticket">
<tr>
<xsl:if test="position() mod 2 != 1">
<xsl:attribute name="class">priority_{priority} tablerowalternate</xsl:attribute>
</xsl:if>
<xsl:if test="position() mod 2 != 0">
<xsl:attribute name="class">priority_{priority} tablerow</xsl:attribute>
</xsl:if>
<xsl:variable name="priority" select="priority"/>
<td class='priority_{priority}' style="text-align: left;">
<xsl:value-of select="number"/>
</td>
<td class='priority_{priority}'>
<xsl:value-of select="summary" disable-output-escaping="yes"/>
</td>
<td class='priority_{priority}'>
<xsl:variable name="c" select="substring(status,1,1)"/>
<xsl:value-of select="translate($c,'abcdefghijklmnopqrst','ABCDEFGHIJKLMNOPQRST')"/>
<xsl:value-of select="substring-after(status,$c)"/>
</td>
<td class='priority_{priority}' style="text-align: center;">
<xsl:choose>
<xsl:when test="priority = '5'">Highest</xsl:when>
<xsl:when test="priority = '4'">High</xsl:when>
<xsl:when test="priority = '3'">Normal</xsl:when>
<xsl:when test="priority = '2'">Low</xsl:when>
<xsl:when test="priority = '1'">Lowest</xsl:when>
</xsl:choose>
</td>
<td class='priority_{priority}'>
<xsl:variable name="milestoneID" select="milestone-id"/>
<xsl:if test="$milestoneID = ''">
None
</xsl:if>
<xsl:if test="$milestoneID != ''">
<xsl:value-of select="/root/milestones/milestone/id[text()=$milestoneID]/parent::milestone/title"/>
</xsl:if>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>

172
PluginPack/Updater.cs Normal file
View file

@ -0,0 +1,172 @@

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ScrewTurn.Wiki.PluginFramework;
using System.Net;
using System.IO;
namespace ScrewTurn.Wiki.Plugins.PluginPack {
/// <summary>
/// Plugin with the sole purpose of removing PluginPack.dll in favor of separate DLLs.
/// </summary>
public class Updater : IFormatterProviderV30 {
private static bool AlreadyRun = false;
private static readonly ComponentInformation _info = new ComponentInformation("Updater Plugin", "Threeplicate Srl", "3.0.2.538", "http://www.screwturn.eu", null);
/// <summary>
/// Initializes the Storage Provider.
/// </summary>
/// <param name="host">The Host of the Component.</param>
/// <param name="config">The Configuration data, if any.</param>
/// <exception cref="ArgumentNullException">If <paramref name="host"/> or <paramref name="config"/> are <c>null</c>.</exception>
/// <exception cref="InvalidConfigurationException">If <paramref name="config"/> is not valid or is incorrect.</exception>
public void Init(IHostV30 host, string config) {
if(host == null) throw new ArgumentNullException("host");
if(config == null) throw new ArgumentNullException("config");
if(AlreadyRun) return;
// 1. Delete PluginPack.dll
// 2. Download all other DLLs
string root = "http://www.screwturn.eu/Version/PluginPack/";
string[] dllNames = new string[] {
"DownloadCounterPlugin.dll",
"FootnotesPlugin.dll",
"MultilanguageContentPlugin.dll",
"RssFeedDisplayPlugin.dll",
"UnfuddleTicketsPlugin.dll"
};
string[] providerNames = new string[] {
"ScrewTurn.Wiki.Plugins.PluginPack.DownloadCounter",
"ScrewTurn.Wiki.Plugins.PluginPack.Footnotes",
"ScrewTurn.Wiki.Plugins.PluginPack.MultilanguageContentPlugin",
"ScrewTurn.Wiki.Plugins.PluginPack.RssFeedDisplay",
"ScrewTurn.Wiki.Plugins.PluginPack.UnfuddleTickets",
};
Dictionary<string, byte[]> assemblies = new Dictionary<string, byte[]>(dllNames.Length);
try {
foreach(string dll in dllNames) {
host.LogEntry("Downloading " + dll, LogEntryType.General, null, this);
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(root + dll);
req.AllowAutoRedirect = true;
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
if(resp.StatusCode == HttpStatusCode.OK) {
BinaryReader reader = new BinaryReader(resp.GetResponseStream());
byte[] content = reader.ReadBytes((int)resp.ContentLength);
reader.Close();
assemblies.Add(dll, content);
}
else {
throw new InvalidOperationException("Response status code for " + dll + ":" + resp.StatusCode.ToString());
}
}
foreach(string dll in dllNames) {
host.GetSettingsStorageProvider().StorePluginAssembly(dll, assemblies[dll]);
}
foreach(string dll in dllNames) {
LoadProvider(dll);
}
host.GetSettingsStorageProvider().DeletePluginAssembly("PluginPack.dll");
AlreadyRun = true;
}
catch(Exception ex) {
host.LogEntry("Error occurred during automatic DLL updating with Updater Plugin\n" + ex.ToString(), LogEntryType.Error, null, this);
}
}
private void LoadProvider(string dll) {
Type loader = Type.GetType("ScrewTurn.Wiki.ProviderLoader, ScrewTurn.Wiki.Core");
var method = loader.GetMethod("LoadFromAuto");
method.Invoke(null, new[] { dll });
}
/// <summary>
/// Method invoked on shutdown.
/// </summary>
/// <remarks>This method might not be invoked in some cases.</remarks>
public void Shutdown() {
}
/// <summary>
/// Specifies whether or not to execute Phase 1.
/// </summary>
public bool PerformPhase1 {
get { return false; }
}
/// <summary>
/// Specifies whether or not to execute Phase 2.
/// </summary>
public bool PerformPhase2 {
get { return false; }
}
/// <summary>
/// Specifies whether or not to execute Phase 3.
/// </summary>
public bool PerformPhase3 {
get { return false; }
}
/// <summary>
/// Gets the execution priority of the provider (0 lowest, 100 highest).
/// </summary>
public int ExecutionPriority {
get { return 50; }
}
/// <summary>
/// Performs a Formatting phase.
/// </summary>
/// <param name="raw">The raw content to Format.</param>
/// <param name="context">The Context information.</param>
/// <param name="phase">The Phase.</param>
/// <returns>The Formatted content.</returns>
public string Format(string raw, ContextInformation context, FormattingPhase phase) {
return raw;
}
/// <summary>
/// Prepares the title of an item for display (always during phase 3).
/// </summary>
/// <param name="title">The input title.</param>
/// <param name="context">The context information.</param>
/// <returns>The prepared title (no markup allowed).</returns>
public string PrepareTitle(string title, ContextInformation context) {
return title;
}
/// <summary>
/// Gets the Information about the Provider.
/// </summary>
public ComponentInformation Information {
get { return _info; }
}
/// <summary>
/// Gets a brief summary of the configuration string format, in HTML. Returns <c>null</c> if no configuration is needed.
/// </summary>
public string ConfigHelpHtml {
get { return null; }
}
}
}

View file

@ -0,0 +1,18 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ScrewTurn Wiki RSS Feed Display Plugin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ca0250d7-23e9-478e-8e17-ae494b736919")]

View file

@ -18,7 +18,7 @@ namespace ScrewTurn.Wiki.Plugins.PluginPack {
private IHostV30 _host; private IHostV30 _host;
private string _config; private string _config;
private bool _enableLogging = true; private bool _enableLogging = true;
private static readonly ComponentInformation Info = new ComponentInformation("RSS Feed Display Plugin", "Threeplicate Srl", "3.0.2.528", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/RssFeedDisplay.txt"); private static readonly ComponentInformation Info = new ComponentInformation("RSS Feed Display Plugin", "Threeplicate Srl", "3.0.2.528", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/RssFeedDisplay2.txt");
private static readonly Regex RssRegex = new Regex(@"{(RSS|Twitter):(.+?)(\|(.+?))?}", private static readonly Regex RssRegex = new Regex(@"{(RSS|Twitter):(.+?)(\|(.+?))?}",
RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);

View file

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{83363183-7B84-43BF-885F-C728A721140B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RssFeedDisplayPlugin</RootNamespace>
<AssemblyName>RssFeedDisplayPlugin</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Debug\RssFeedDisplayPlugin.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Release\RssFeedDisplayPlugin.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\AssemblyVersion.cs">
<Link>AssemblyVersion.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RssFeedDisplay.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PluginFramework\PluginFramework.csproj">
<Project>{531A83D6-76F9-4014-91C5-295818E2D948}</Project>
<Name>PluginFramework</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -49,10 +49,22 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SqlServerProviders-Tests",
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginPack", "PluginPack\PluginPack.csproj", "{88212C14-10A0-4D46-8203-D48534465181}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginPack", "PluginPack\PluginPack.csproj", "{88212C14-10A0-4D46-8203-D48534465181}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginPack-Tests", "PluginPack-Tests\PluginPack-Tests.csproj", "{C657F6C0-05E5-4873-97A4-B91ED1F51D85}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ActiveDirectoryProvider", "ActiveDirectoryProvider\ActiveDirectoryProvider.csproj", "{C7169CA4-9893-4361-96A8-09F87FCF5E8C}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ActiveDirectoryProvider", "ActiveDirectoryProvider\ActiveDirectoryProvider.csproj", "{C7169CA4-9893-4361-96A8-09F87FCF5E8C}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{F6E9DB23-D200-4CCE-B42D-7CD1D20FC92D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DownloadCounterPlugin", "DownloadCounterPlugin\DownloadCounterPlugin.csproj", "{C2F2722A-0B44-4E98-965C-CC1AD1DA511C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DownloadCounterPlugin-Tests", "DownloadCounterPlugin-Tests\DownloadCounterPlugin-Tests.csproj", "{DEA4E4AA-7452-4598-8277-A7F5D6DE4985}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FootnotesPlugin", "FootnotesPlugin\FootnotesPlugin.csproj", "{B7EE7C86-5031-40EB-B06C-DF5B3564BE17}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultilanguageContentPlugin", "MultilanguageContentPlugin\MultilanguageContentPlugin.csproj", "{94DDE3D4-0595-405C-9EA6-358B74EC6BC5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RssFeedDisplayPlugin", "RssFeedDisplayPlugin\RssFeedDisplayPlugin.csproj", "{83363183-7B84-43BF-885F-C728A721140B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnfuddleTicketsPlugin", "UnfuddleTicketsPlugin\UnfuddleTicketsPlugin.csproj", "{62EC7498-D82C-40FD-B153-5FC2F2FA6D72}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -115,16 +127,50 @@ Global
{88212C14-10A0-4D46-8203-D48534465181}.Debug|Any CPU.Build.0 = Debug|Any CPU {88212C14-10A0-4D46-8203-D48534465181}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88212C14-10A0-4D46-8203-D48534465181}.Release|Any CPU.ActiveCfg = Release|Any CPU {88212C14-10A0-4D46-8203-D48534465181}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88212C14-10A0-4D46-8203-D48534465181}.Release|Any CPU.Build.0 = Release|Any CPU {88212C14-10A0-4D46-8203-D48534465181}.Release|Any CPU.Build.0 = Release|Any CPU
{C657F6C0-05E5-4873-97A4-B91ED1F51D85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C657F6C0-05E5-4873-97A4-B91ED1F51D85}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C657F6C0-05E5-4873-97A4-B91ED1F51D85}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C657F6C0-05E5-4873-97A4-B91ED1F51D85}.Release|Any CPU.Build.0 = Release|Any CPU
{C7169CA4-9893-4361-96A8-09F87FCF5E8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C7169CA4-9893-4361-96A8-09F87FCF5E8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7169CA4-9893-4361-96A8-09F87FCF5E8C}.Debug|Any CPU.Build.0 = Debug|Any CPU {C7169CA4-9893-4361-96A8-09F87FCF5E8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7169CA4-9893-4361-96A8-09F87FCF5E8C}.Release|Any CPU.ActiveCfg = Release|Any CPU {C7169CA4-9893-4361-96A8-09F87FCF5E8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7169CA4-9893-4361-96A8-09F87FCF5E8C}.Release|Any CPU.Build.0 = Release|Any CPU {C7169CA4-9893-4361-96A8-09F87FCF5E8C}.Release|Any CPU.Build.0 = Release|Any CPU
{C2F2722A-0B44-4E98-965C-CC1AD1DA511C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C2F2722A-0B44-4E98-965C-CC1AD1DA511C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2F2722A-0B44-4E98-965C-CC1AD1DA511C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2F2722A-0B44-4E98-965C-CC1AD1DA511C}.Release|Any CPU.Build.0 = Release|Any CPU
{DEA4E4AA-7452-4598-8277-A7F5D6DE4985}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DEA4E4AA-7452-4598-8277-A7F5D6DE4985}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DEA4E4AA-7452-4598-8277-A7F5D6DE4985}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DEA4E4AA-7452-4598-8277-A7F5D6DE4985}.Release|Any CPU.Build.0 = Release|Any CPU
{B7EE7C86-5031-40EB-B06C-DF5B3564BE17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7EE7C86-5031-40EB-B06C-DF5B3564BE17}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7EE7C86-5031-40EB-B06C-DF5B3564BE17}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7EE7C86-5031-40EB-B06C-DF5B3564BE17}.Release|Any CPU.Build.0 = Release|Any CPU
{94DDE3D4-0595-405C-9EA6-358B74EC6BC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94DDE3D4-0595-405C-9EA6-358B74EC6BC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{94DDE3D4-0595-405C-9EA6-358B74EC6BC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{94DDE3D4-0595-405C-9EA6-358B74EC6BC5}.Release|Any CPU.Build.0 = Release|Any CPU
{83363183-7B84-43BF-885F-C728A721140B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{83363183-7B84-43BF-885F-C728A721140B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{83363183-7B84-43BF-885F-C728A721140B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{83363183-7B84-43BF-885F-C728A721140B}.Release|Any CPU.Build.0 = Release|Any CPU
{62EC7498-D82C-40FD-B153-5FC2F2FA6D72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{62EC7498-D82C-40FD-B153-5FC2F2FA6D72}.Debug|Any CPU.Build.0 = Debug|Any CPU
{62EC7498-D82C-40FD-B153-5FC2F2FA6D72}.Release|Any CPU.ActiveCfg = Release|Any CPU
{62EC7498-D82C-40FD-B153-5FC2F2FA6D72}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{88212C14-10A0-4D46-8203-D48534465181} = {F6E9DB23-D200-4CCE-B42D-7CD1D20FC92D}
{617D5D30-97F9-48B2-903D-29D4524492E8} = {F6E9DB23-D200-4CCE-B42D-7CD1D20FC92D}
{67590C3A-1A7C-4608-90CA-1C1632D2F643} = {F6E9DB23-D200-4CCE-B42D-7CD1D20FC92D}
{ECB488D9-C8E9-41E0-BE27-27F41F76F8A0} = {F6E9DB23-D200-4CCE-B42D-7CD1D20FC92D}
{F75DFFE1-A8CF-4CC2-B15F-3EC7EAADDCFC} = {F6E9DB23-D200-4CCE-B42D-7CD1D20FC92D}
{C7169CA4-9893-4361-96A8-09F87FCF5E8C} = {F6E9DB23-D200-4CCE-B42D-7CD1D20FC92D}
{C2F2722A-0B44-4E98-965C-CC1AD1DA511C} = {F6E9DB23-D200-4CCE-B42D-7CD1D20FC92D}
{DEA4E4AA-7452-4598-8277-A7F5D6DE4985} = {F6E9DB23-D200-4CCE-B42D-7CD1D20FC92D}
{B7EE7C86-5031-40EB-B06C-DF5B3564BE17} = {F6E9DB23-D200-4CCE-B42D-7CD1D20FC92D}
{94DDE3D4-0595-405C-9EA6-358B74EC6BC5} = {F6E9DB23-D200-4CCE-B42D-7CD1D20FC92D}
{83363183-7B84-43BF-885F-C728A721140B} = {F6E9DB23-D200-4CCE-B42D-7CD1D20FC92D}
{62EC7498-D82C-40FD-B153-5FC2F2FA6D72} = {F6E9DB23-D200-4CCE-B42D-7CD1D20FC92D}
EndGlobalSection
EndGlobal EndGlobal

View file

@ -0,0 +1,18 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ScrewTurn Wiki Unfuddle Tickets Plugin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e64d84a3-1140-4545-abf2-35ea6d4c7651")]

View file

@ -22,7 +22,7 @@ namespace ScrewTurn.Wiki.Plugins.PluginPack {
private const string ConfigHelpHtmlValue = "Config consists of three lines:<br/><i>&lt;Url&gt;</i> - The base url to the Unfuddle API (i.e. http://account_name.unfuddle.com/api/v1/projects/project_ID)<br/><i>&lt;Username&gt;</i> - The username to the unfuddle account to use for authentication<br/><i>&lt;Password&gt;</i> - The password to the unfuddle account to use for authentication<br/>"; private const string ConfigHelpHtmlValue = "Config consists of three lines:<br/><i>&lt;Url&gt;</i> - The base url to the Unfuddle API (i.e. http://account_name.unfuddle.com/api/v1/projects/project_ID)<br/><i>&lt;Username&gt;</i> - The username to the unfuddle account to use for authentication<br/><i>&lt;Password&gt;</i> - The password to the unfuddle account to use for authentication<br/>";
private const string LoadErrorMessage = "Unable to load ticket report at this time."; private const string LoadErrorMessage = "Unable to load ticket report at this time.";
private static readonly Regex UnfuddleRegex = new Regex(@"{unfuddle}", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); private static readonly Regex UnfuddleRegex = new Regex(@"{unfuddle}", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
private static readonly ComponentInformation Info = new ComponentInformation("Unfuddle Tickets Plugin", "Threeplicate Srl", "3.0.1.471", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/UnfuddleTickets.txt"); private static readonly ComponentInformation Info = new ComponentInformation("Unfuddle Tickets Plugin", "Threeplicate Srl", "3.0.1.472", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/PluginPack/UnfuddleTickets2.txt");
private string _config; private string _config;
private IHostV30 _host; private IHostV30 _host;

View file

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{62EC7498-D82C-40FD-B153-5FC2F2FA6D72}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ScrewTurn.Wiki.Plugins.PluginPack</RootNamespace>
<AssemblyName>UnfuddleTicketsPlugin</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Debug\UnfuddleTicketsPlugin.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Release\UnfuddleTicketsPlugin.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\AssemblyVersion.cs">
<Link>AssemblyVersion.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UnfuddleTickets.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PluginFramework\PluginFramework.csproj">
<Project>{531A83D6-76F9-4014-91C5-295818E2D948}</Project>
<Name>PluginFramework</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\UnfuddleTickets.xsl" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>