* Web.csproj:

* App.master:
* IModule.cs:
* IRenderer.cs:
* DataManager.cs:
* ITagHandler.cs:
* ViewRenderer.cs:
* ResultPages.cs:
* BBCodeHelper.cs:
* IViewRenderer.cs:
* Entity.cs:
* YavscModel.csproj:
* OAuth2.cs:
* Calendar.cs:
* Profile.aspx:
* ApiClient.cs:
* MapTracks.cs:
* SalesCatalog.csproj:
* EntityQuery.cs:
* AdminController.cs:
* BlogsController.cs:
* GoogleController.cs:
* SimpleJsonPostMethod.cs:
* JsonReaderError.cs:
* AccountController.cs:
* JsonReaderError.aspx:
* GoogleErrorMessage.cs:
* GoogleErrorMessage.aspx: 

* Catalog.cs: refactoring

* Makefile: preprod is from local domain, and prod is for
  lua.pschneider.fr
This commit is contained in:
Paul Schneider 2015-01-21 18:50:02 +01:00
commit 8301159645
29 changed files with 969 additions and 314 deletions

View file

@ -0,0 +1,50 @@
//
// JsonReaderError.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 Paul Schneider
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Net;
using System.IO;
using Newtonsoft.Json;
namespace Yavsc.Model.Google
{
public class GoogleErrorException : Exception
{
public string Title { get; set; }
public string Content { get; set; }
public GoogleErrorException (WebException ex) {
// ASSERT ex != null;
Title = ex.Message;
using (var stream = ex.Response.GetResponseStream())
using (var reader = new StreamReader(stream))
{
Content = reader.ReadToEnd();
}
}
public GoogleErrorException(JsonReaderException ex, string message) {
Content = message;
Title = ex.Message;
}
}
}

View file

@ -22,12 +22,5 @@ namespace Yavsc.Model
void Uninstall(IDbConnection cnx,bool removeConfig);
void Initialize (string name, NameValueCollection config);
}
public interface IRenderer {
// Should set ViewData["Message|Author|Body"]
object Get(Controller c);
string Template { get; }
string Name { get; set; }
}
}

View file

@ -1,5 +1,5 @@
//
// JsonReaderError.cs
//
// IRenderer.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
@ -18,14 +18,20 @@
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Configuration;
using System.Collections.Specialized;
using System.Data;
using System.Web.Mvc;
namespace Yavsc.Model.Google
namespace Yavsc.Model
{
public class JsonReaderError
{
public string Text { get; set; }
public Exception Excepx { get; set; }
public interface IRenderer {
// Should set ViewData["Message|Author|Body"]
// and return an ActionResult
object Get(Controller c);
string Name { get; set; }
}
}
}

41
yavscModel/ITagHandler.cs Normal file
View file

@ -0,0 +1,41 @@
//
// ITagHandler.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 Paul Schneider
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Configuration;
using System.Collections.Specialized;
using System.Data;
using System.Web.Mvc;
namespace Yavsc.Model
{
public interface ITagHandler {
// Should set ViewData["Tags"] with
// an array of rendered tags
void Backup();
void Restore();
void Invoke();
string Name { get; set; }
}
}

View file

@ -0,0 +1,42 @@
//
// IViewRenderer.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 Paul Schneider
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Configuration;
using System.Collections.Specialized;
using System.Data;
using System.Web.Mvc;
namespace Yavsc.Model
{
public interface IViewRenderer : IRenderer {
// IRenderer.Get() Should set ViewData["Message|Author|Body"]
// and return an ActionResult
/// <summary>
/// Gets the template route part
/// </summary>
/// <value>The template.</value>
string Template { get; }
}
}

View file

@ -0,0 +1,54 @@
//
// ViewRenderer.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 Paul Schneider
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Configuration;
using System.Collections.Specialized;
using System.Data;
using System.Web.Mvc;
namespace Yavsc.Model
{
public abstract class ViewRenderer<T> : IViewRenderer {
#region IRenderer implementation
public object Get (Controller c)
{
return Name;
}
public string Template {
get {
return "Tag.aspx";
}
}
public string Name {
get {
throw new NotImplementedException ();
}
set {
throw new NotImplementedException ();
}
}
#endregion
}
}

View file

@ -37,6 +37,9 @@
<Reference Include="System.Data" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.Web.Mvc" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Formatting" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
@ -91,8 +94,12 @@
<Compile Include="Google\CalendarList.cs" />
<Compile Include="Google\CalendarListEntry.cs" />
<Compile Include="Google\AskForADate.cs" />
<Compile Include="Google\JsonReaderError.cs" />
<Compile Include="Google\CalendarEntryList.cs" />
<Compile Include="IRenderer.cs" />
<Compile Include="ITagHandler.cs" />
<Compile Include="IViewRenderer.cs" />
<Compile Include="ViewRenderer.cs" />
<Compile Include="Google\GoogleErrorMessage.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>