Skip to content

Commit

Permalink
* Installed pacakge to the sandbox app
Browse files Browse the repository at this point in the history
* Few other smaller fixes
  • Loading branch information
valdisiljuconoks committed Mar 25, 2020
1 parent 7d9baa1 commit 08190df
Show file tree
Hide file tree
Showing 11 changed files with 190 additions and 38 deletions.
1 change: 1 addition & 0 deletions Geta.404Handler.sln
Expand Up @@ -9,6 +9,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Geta.404Handler.Tests", "te
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{85A82003-EBCE-48FF-B34F-52AEFAF209A8}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
CHANGELOG.md = CHANGELOG.md
LICENSE = LICENSE
pack.ps1 = pack.ps1
Expand Down
2 changes: 1 addition & 1 deletion pack.ps1
@@ -1,5 +1,5 @@
$outputDir = ".\package\"
$build = "Release"
$version = "11.4.0"
$version = "1.0.0"

nuget.exe pack ".\src\Geta.404Handler\Geta.404Handler.csproj" -IncludeReferencedProjects -properties Configuration=$build -Version $version -OutputDirectory $outputDir
Binary file not shown.
Binary file not shown.
Expand Up @@ -49,6 +49,9 @@
<Reference Include="Antlr3.Runtime, Version=3.4.1.9004, Culture=neutral, PublicKeyToken=eb42632606e9261f, processorArchitecture=MSIL">
<HintPath>..\..\packages\Antlr.3.4.1.9004\lib\Antlr3.Runtime.dll</HintPath>
</Reference>
<Reference Include="BVNetwork.EPi404, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Geta.404Handler.1.0.0\lib\net461\BVNetwork.EPi404.dll</HintPath>
</Reference>
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\..\packages\Castle.Core.4.2.1\lib\net45\Castle.Core.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -180,18 +183,19 @@
<Reference Include="System.Net" />
<Reference Include="System.Runtime.Remoting" />
<Reference Include="System.Security" />
<Reference Include="System.Security.AccessControl, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Security.AccessControl.4.4.0\lib\net461\System.Security.AccessControl.dll</HintPath>
<Reference Include="System.Security.AccessControl, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Security.AccessControl.4.5.0\lib\net461\System.Security.AccessControl.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Xml, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Security.Cryptography.Xml.4.4.2\lib\net461\System.Security.Cryptography.Xml.dll</HintPath>
<Reference Include="System.Security.Cryptography.Xml, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Security.Cryptography.Xml.4.5.0\lib\net461\System.Security.Cryptography.Xml.dll</HintPath>
</Reference>
<Reference Include="System.Security.Permissions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Security.Permissions.4.4.0\lib\net461\System.Security.Permissions.dll</HintPath>
<Reference Include="System.Security.Permissions, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Security.Permissions.4.5.0\lib\net461\System.Security.Permissions.dll</HintPath>
</Reference>
<Reference Include="System.Security.Principal.Windows, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Security.Principal.Windows.4.4.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
<Reference Include="System.Security.Principal.Windows, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Security.Principal.Windows.4.5.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
</Reference>
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Threading.AccessControl, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Threading.AccessControl.4.4.0\lib\net461\System.Threading.AccessControl.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -346,6 +350,7 @@
<Content Include="ClientResources\Styles\LayoutIcons.css" />
<Content Include="ClientResources\Styles\Styles.css" />
<Content Include="favicon.ico" />
<Content Include="NotFound.aspx" />
<Content Include="Resources\LanguageFiles\ContentTypeNames.xml" />
<Content Include="Resources\LanguageFiles\Display.xml" />
<Content Include="Resources\LanguageFiles\EditorHints.xml" />
Expand Down Expand Up @@ -405,6 +410,7 @@
<Content Include="modules\_protected\CMS\web.config" />
<Content Include="modules\_protected\CMS\CMS.zip" />
<Content Include="module.config" />
<Content Include="modules\_protected\BVNetwork.404Handler\BVNetwork.404Handler.zip" />
<None Include="packages.config" />
<Content Include="Views\_viewstart.cshtml" />
<Content Include="Views\VideoFile\Index.cshtml" />
Expand Down
151 changes: 151 additions & 0 deletions samples/Geta.404Handler.SandboxApp/NotFound.aspx
@@ -0,0 +1,151 @@
<%@ Page Language="c#" AutoEventWireup="false" Inherits="BVNetwork.NotFound.Core.NotFoundPage.NotFoundBase" %>

<%--
Note! This file has no code-behind. It inherits from the NotFoundBase class. You can
make a copy of this file into your own project, change the design and keep the inheritance
WITHOUT having to reference the BVNetwork.EPi404.dll assembly.
If you want to use your own Master Page, inherit from SimplePageNotFoundBase instead of
NotFoundBase, as that will bring in what is needed by EPiServer. Note! you do not need to
create a page type for this 404 page. If you use the EPiServer API, and inherit from
SimplePageNotFoundBase, this page will run in the context of the site start page.
Be very careful with the code you write here. If you reference resources that cannot be found
you could end up in an infinite loop.
The code behind file might do a redirect to a new page based on the redirect configuration if
it matches the url not found. The Error event (where the rest of the redirection is done)
might not run for .aspx files that are not found, instead it redirects here with the url it
could not find in the query string.
Available properties:
Content (BVNetwork.FileNotFound.Content.PageContent)
// Labels you can use - fetched from the language file
Content.BottomText
Content.CameFrom
Content.LookingFor
Content.TopText
Content.Title
UrlNotFound (string)
The url that cannot be found
Referer (string)
The url that brought the user here
It no referer, the string is empty (not null)
If you are using a master page, you should add this:
<meta content="noindex, nofollow" name="ROBOTS">
to your head tag for this page (NOT all pages)
--%>

<script runat="server" type="text/C#">
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
// Add your own logic (like databinding) here
}
</script>

<%@ Register TagPrefix="EPiServer" Namespace="EPiServer.WebControls" Assembly="EPiServer" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title><%= Content.Title %></title>
<meta content="noindex, nofollow" name="ROBOTS" />
<style type="text/css">
body
{
font-family: Verdana, Arial, Helvetica, Tahoma;
font-size: 0.65em;
color: #333;
background-color: #ffffff;
}
a
{
color: 0000cc;
}
a:hover
{
color: #000;
text-decoration: none;
}
h1
{
font-weight: bold;
font-size: 1.8em;
color: #606060;
margin-bottom: 0.5em;
margin-top: 0.5em;
}
div.lookingfor
{
border: #660033 1px solid;
padding: 10px;
background-color: #ffdab5;
width: 100%;
}
.notfoundbox
{
border-bottom: solid 1px #cccccc;
border-right: solid 1px #cccccc;
border-left: solid 1px #f8f8f8;
border-top: solid 1px #f8f8f8;
padding: 10px 10px 10px 10px;
width: 100%;
background-color: #f8f8f8;
font-weight: bold;
width: 100%;
}
.logo
{
font-family: Verdana;
font-size: 5em;
color: #a0a0a0;
padding-bottom: 0.5em;
letter-spacing: -0.08em;
}
div.floater
{
position: absolute;
bottom: 0;
right: 0;
font-family: Times New Roman;
font-size: 10em;
font-style: italic;
color: #f0f0f0;
margin: 0 20px 10px 0;
letter-spacing: -0.08em;
}
</style>
</head>
<body>
<form id="FileNotFoundForm" method="post" runat="server">
<div class="logo">
Company Logo Here
</div>
<h1>
<%= Content.Title %></h1>
<div style="width: 760px">
<div style="padding-left: 10px; float: left; width: 550px">
<%= Content.TopText %>
<%= Content.LookingFor %>
<div class="notfoundbox">
<%= HttpUtility.HtmlEncode(UrlNotFound.ToString()) %>
<%= Referer.Length > 0 ? Content.CameFrom : "" %>
<%= Referer.Length > 0 ? HttpUtility.HtmlEncode(Referer) : "" %>
</div>
<%= Content.BottomText %>
</div>
<div style="padding-right: 10px; padding-left: 10px; float: right; width: 200px">
&nbsp;
</div>
</div>
<div class="floater">
404
</div>
</form>
</body>
</html>
18 changes: 17 additions & 1 deletion samples/Geta.404Handler.SandboxApp/Web.config
Expand Up @@ -10,6 +10,7 @@
<section name="episerver" type="EPiServer.Configuration.EPiServerSection, EPiServer.Configuration" />
<section name="episerver.framework" type="EPiServer.Framework.Configuration.EPiServerFrameworkSection, EPiServer.Framework.AspNet" restartOnExternalChanges="true" />
<section name="episerver.shell" type="EPiServer.Shell.Configuration.EPiServerShellSection, EPiServer.Shell" />
<section name="bvn404Handler" type="BVNetwork.NotFound.Configuration.Bvn404HandlerConfiguration, BVNetwork.EPi404" />
</configSections>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
Expand Down Expand Up @@ -104,6 +105,11 @@
<add extension=".jpeg" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="0.00:01:00" location="Any" />
</profiles>
</caching>
<httpErrors errorMode="Custom" existingResponse="Replace">
<remove statusCode="404" />
<!-- Note! You should change this to your custom error page. See the readme on https://github.com/Geta/404handler for more information -->
<error statusCode="404" path="/notfound.aspx" responseMode="ExecuteURL" />
</httpErrors>
</system.webServer>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
Expand Down Expand Up @@ -376,4 +382,14 @@
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</location></configuration>
</location>
<bvn404Handler handlerMode="On">
<providers>
<!--
Register your own handler that will be given a chance to
rewrite the url. The type must implement INotFoundHandler
<add name="NameOfHandler" type="Your.Handler.Here" />
-->
</providers>
</bvn404Handler>
</configuration>
Binary file not shown.
9 changes: 5 additions & 4 deletions samples/Geta.404Handler.SandboxApp/packages.config
Expand Up @@ -15,6 +15,7 @@
<package id="EPiServer.Framework.AspNet" version="11.12.0" targetFramework="net472" />
<package id="EPiServer.Logging.Log4Net" version="2.2.2" targetFramework="net472" />
<package id="EPiServer.ServiceLocation.StructureMap" version="2.0.2" targetFramework="net472" />
<package id="Geta.404Handler" version="1.0.0" targetFramework="net472" />
<package id="log4net" version="2.0.8" targetFramework="net472" />
<package id="Microsoft.AspNet.Identity.Core" version="2.2.1" targetFramework="net472" />
<package id="Microsoft.AspNet.Identity.EntityFramework" version="2.2.1" targetFramework="net472" />
Expand All @@ -37,10 +38,10 @@
<package id="System.Data.SqlClient" version="4.4.0" targetFramework="net472" />
<package id="System.Reflection.Emit" version="4.3.0" targetFramework="net472" />
<package id="System.Reflection.Emit.Lightweight" version="4.3.0" targetFramework="net472" />
<package id="System.Security.AccessControl" version="4.4.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Xml" version="4.4.2" targetFramework="net472" />
<package id="System.Security.Permissions" version="4.4.0" targetFramework="net472" />
<package id="System.Security.Principal.Windows" version="4.4.0" targetFramework="net472" />
<package id="System.Security.AccessControl" version="4.5.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Xml" version="4.5.0" targetFramework="net472" />
<package id="System.Security.Permissions" version="4.5.0" targetFramework="net472" />
<package id="System.Security.Principal.Windows" version="4.5.0" targetFramework="net472" />
<package id="System.Threading.AccessControl" version="4.4.0" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
<package id="StructureMap" version="4.5.2" targetFramework="net472" />
Expand Down
22 changes: 0 additions & 22 deletions src/Geta.404Handler/.editorconfig

This file was deleted.

3 changes: 1 addition & 2 deletions src/Geta.404Handler/Geta.404Handler.csproj
Expand Up @@ -119,8 +119,7 @@
<Content Include="NotFound.aspx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="readme.txt" />
<None Include=".editorconfig" />
<None Include="readme.txt" />
<None Include="app.config" />
<None Include="Geta.404Handler.nuspec" />
<None Include="Geta.404Handler.Version.targets" />
Expand Down

0 comments on commit 08190df

Please sign in to comment.