Permalink
Browse files

Rebuilt for EPiServer 7 RTM

- Block type and property names and descriptions are localized.
- module.config is added to define module assemblies explicitely.
- Creating add-on package automatically after build.
- Dependency version is restricted.
- Module version is updated.
  • Loading branch information...
dmytroduk committed Dec 24, 2012
1 parent 52bf8ca commit 354be52feee76b7316dc2aeb1311d730753df0f2
@@ -4,13 +4,19 @@
namespace EPiServer.Samples.SharingWidget.BlockTypes
{
[ContentType(DisplayName = "Sharing Widget Block",
Description = "Adds ShareThis widget on pages where block is placed.")]
/// <summary>
/// Sharing widget block type
/// </summary>
[ContentType(GUID = "A4242E8C-0FCC-4090-93D7-453EEEDA87DF")]
public class SharingWidgetBlock : BlockData
{
[Display(Name = "Publisher ID",
Description = "Register on ShareThis.com to get your Publisher ID.")]
/// <summary>
/// Gets or sets the ShareThis publisher ID.
/// </summary>
/// <value>
/// The publisher ID.
/// </value>
[Required]
public virtual string PublisherID { get; set; }
public virtual string PublisherId { get; set; }
}
}
@@ -3,7 +3,7 @@
<script type="text/javascript"> var switchTo5x = true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript"> stLight.options({ publisher: "<%= CurrentBlock.PublisherID %>" }); </script>
<script type="text/javascript"> stLight.options({ publisher: "<%= CurrentBlock.PublisherId %>" }); </script>
<span class='st_twitter' displayText='Tweet'></span>
<span class='st_facebook' displayText='Facebook'></span>
@@ -3,6 +3,9 @@
namespace EPiServer.Samples.SharingWidget.Blocks
{
/// <summary>
/// Sharing widget Web Forms template control
/// </summary>
public partial class SharingWidget : BlockControlBase<SharingWidgetBlock>
{
}
@@ -5,11 +5,20 @@
namespace EPiServer.Samples.SharingWidget.Controllers
{
public class SharingWidgetController : BlockController<SharingWidgetBlock>
/// <summary>
/// Sharing block template controller
/// </summary>
public class SharingWidgetBlockController : BlockController<SharingWidgetBlock>
{
public override ActionResult Index(SharingWidgetBlock blockData)
/// <summary>
/// Renders Sharing widget.
/// </summary>
/// <param name="currentBlock">Current Sharing block data.</param>
/// <returns></returns>
public override ActionResult Index(SharingWidgetBlock currentBlock)
{
return PartialView(Paths.ToResource(this.GetType(), "Views/SharingWidget/SharingWidget.cshtml"), blockData);
// Hint for MVC to find the view in modules folder:
return PartialView(Paths.ToResource(GetType(), "Views/SharingWidget/SharingWidget.cshtml"), currentBlock);
}
}
}
@@ -66,14 +66,17 @@
<Content Include="Blocks\SharingWidget.ascx" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="EmbeddedLangFiles\text_en.xml" />
<Content Include="Views\SharingWidget\SharingWidget.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Web.config" />
</ItemGroup>
<ItemGroup>
<None Include="EPiServer.Samples.SharingWidget.nuspec" />
<Content Include="module.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<ProjectExtensions>
@@ -95,11 +98,15 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<!-- 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">
<!-- Creates add-on package using NuGet command line tool if NuGet.exe is found in Dependencies folder. -->
<Target Name="CreateAddOnPackage">
<PropertyGroup>
<NuGetExePath>..\Dependencies\NuGet.exe</NuGetExePath>
</PropertyGroup>
<Exec Command="&quot;$(NuGetExePath)&quot; pack $(ProjectFileName) -OutputDirectory $(OutDir)" Condition="Exists('$(NuGetExePath)')" />
</Target>
<!-- Creating add-on package after build. -->
<Target Name="AfterBuild">
<CallTarget Targets="CreateAddOnPackage" />
</Target>
-->
</Project>
@@ -12,7 +12,7 @@
<description>Enables site visitors to share the content in social networks and communities using ShareThis.com widget.</description>
<tags>EPiServerPublicModulePackage Social Sharing ShareThis</tags>
<dependencies>
<dependency id="EPiServer" version="[7.0,8.0)" />
<dependency id="EPiServer" version="[7.0,7.1)" />
</dependencies>
</metadata>
</package>
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<languages>
<language name="English" id="en">
<blocktypes>
<!-- Blocks -->
<blocktype name="SharingWidgetBlock">
<name>Sharing Widget</name>
<description>Adds ShareThis widget on pages where block is placed.</description>
</blocktype>
</blocktypes>
<pagetypes>
<common>
<!-- Sharing block properties -->
<property name="PublisherId">
<caption>Publisher ID</caption>
<help>Register on ShareThis.com to get your Publisher ID.</help>
</property>
</common>
</pagetypes>
</language>
</languages>
@@ -31,5 +31,5 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
@@ -2,7 +2,7 @@
<script type="text/javascript"> var switchTo5x = true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript"> stLight.options({ publisher: "@Model.PublisherID" }); </script>
<script type="text/javascript"> stLight.options({ publisher: "@Model.PublisherId" }); </script>
<span class='st_twitter' displayText='Tweet'></span>
<span class='st_facebook' displayText='Facebook'></span>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<module productName="SharingWidget" clientResourceRelativePath="" loadFromBin="false">
<assemblies>
<add assembly="EPiServer.Samples.SharingWidget" />
</assemblies>
</module>
View
@@ -1,22 +1,16 @@
Sharing Widget add-on for EPiServer 7 Preview
Sharing Widget add-on for EPiServer 7
=====================================
Enables site visitors to share the content in social networks and communities using ShareThis.com widget.
Sample project to demonstrate simple add-on development step by step.
Dependencies
Sample project demonstrates simple add-on development step by step. Please see following blog posts:
- [Developing simple add-on for EPiServer 7 Preview](http://dmytroduk.com/techblog/developing-simple-add-on-for-episerver-7-preview)
Dependencies and tools
------------
Create Dependencies folder in the solution root directory. Copy required EPiServer 7 Preview assemblies to Dependencies folder:
Create Dependencies folder in the solution root directory. Copy required EPiServer 7 assemblies to Dependencies folder:
- EPiServer
- EPiServer.BaseLibrary
- EPiServer.Data
- EPiServer.Shell
Creating a package
------------------
Build the project. Download NuGet command line and use it to create the package:
nuget pack EPiServer.Samples.SharingWidget.csproj
<http://nuget.codeplex.com/releases>
<http://docs.nuget.org/docs/reference/command-line-reference>
Download [NuGet.exe command line](http://nuget.codeplex.com/releases) and put NuGet.exe tool to Dependencies folder. Add-on package will be created automatically after build.

0 comments on commit 354be52

Please sign in to comment.