Mercurial > altnet-hispano
changeset 109:6bd9be78caa0
Merge
author | Nelo@Kenia.neluz.int |
---|---|
date | Tue, 07 Jun 2011 23:21:07 -0300 |
parents | 786a90e26c9b (current diff) 80c22175c9b5 (diff) |
children | a456eb519e23 |
files | Agendas/trunk/src/Agendas.Twitter.Tests/Send_twitt_tests.cs |
diffstat | 55 files changed, 1834 insertions(+), 269 deletions(-) [+] |
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Blog/Agendas.Blog.csproj Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Blog/Agendas.Blog.csproj Tue Jun 07 23:21:07 2011 -0300 @@ -32,7 +32,10 @@ </PropertyGroup> <ItemGroup> <Reference Include="System" /> + <Reference Include="System.Configuration" /> <Reference Include="System.Core" /> + <Reference Include="System.Runtime.Serialization" /> + <Reference Include="System.ServiceModel" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data.DataSetExtensions" /> <Reference Include="Microsoft.CSharp" /> @@ -40,12 +43,19 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> + <Compile Include="Exceptions\BlogNameNotFoundException.cs" /> + <Compile Include="Exceptions\PostWriterServiceUrlNotFoundException.cs" /> <Compile Include="Impl\BlogPublicador.cs" /> + <Compile Include="Exceptions\BlogWriterMasterKeyNotFoundException.cs" /> + <Compile Include="Impl\BlogPublicadorConfig.cs" /> + <Compile Include="Exceptions\TipoEventoNoSoportadoException.cs" /> <Compile Include="IPostWriter.cs" /> <Compile Include="IPostWriterFactory.cs" /> <Compile Include="Impl\NullObjectPostWriter.cs" /> <Compile Include="Impl\PostWriter.cs" /> <Compile Include="Impl\PostWriterFactory.cs" /> + <Compile Include="IPostWriterWebService.cs" /> + <Compile Include="Impl\PostWriterWebServiceAdapter.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> @@ -54,6 +64,11 @@ </Compile> <Compile Include="Impl\PublicarReunionPostWriter.cs" /> <Compile Include="Impl\AgendarReunionPostWriter.cs" /> + <Compile Include="Service References\PortalSitefinity\Reference.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Reference.svcmap</DependentUpon> + </Compile> </ItemGroup> <ItemGroup> <ProjectReference Include="..\Agendas.Domain\Agendas.Domain.csproj"> @@ -68,6 +83,32 @@ <SubType>Designer</SubType> </EmbeddedResource> </ItemGroup> + <ItemGroup> + <WCFMetadata Include="Service References\" /> + </ItemGroup> + <ItemGroup> + <None Include="app.config" /> + <None Include="Service References\PortalSitefinity\PostWriterWebService.wsdl" /> + </ItemGroup> + <ItemGroup> + <WCFMetadataStorage Include="Service References\PortalSitefinity\" /> + </ItemGroup> + <ItemGroup> + <None Include="Service References\PortalSitefinity\PostWriterWebService.disco" /> + </ItemGroup> + <ItemGroup> + <None Include="Service References\PortalSitefinity\configuration91.svcinfo" /> + </ItemGroup> + <ItemGroup> + <None Include="Service References\PortalSitefinity\configuration.svcinfo" /> + </ItemGroup> + <ItemGroup> + <None Include="Service References\PortalSitefinity\Reference.svcmap"> + <Generator>WCF Proxy Generator</Generator> + <LastGenOutput>Reference.cs</LastGenOutput> + </None> + </ItemGroup> + <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.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Blog/Exceptions/BlogNameNotFoundException.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,13 @@ +using System; + +namespace Agendas.Blog.Exceptions +{ + public class BlogNameNotFoundException : Exception + { + public BlogNameNotFoundException() + : base("Key 'PublicadorBlog.BlogName' not found in appSettings") + { + + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Blog/Exceptions/BlogWriterMasterKeyNotFoundException.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,12 @@ +using System; + +namespace Agendas.Blog.Exceptions +{ + public class BlogWriterMasterKeyNotFoundException : Exception + { + public BlogWriterMasterKeyNotFoundException() + : base("Key 'PublicadorBlog.BlogWriterMasterKey' not found in appSettings") + { + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Blog/Exceptions/PostWriterServiceUrlNotFoundException.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,12 @@ +using System; + +namespace Agendas.Blog.Exceptions +{ + public class PostWriterServiceUrlNotFoundException : Exception + { + public PostWriterServiceUrlNotFoundException() + : base("Key 'PublicadorBlog.PostWriterServiceUrl' not found in appSettings") + { + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Blog/Exceptions/TipoEventoNoSoportadoException.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,13 @@ +using System; +using System.Globalization; + +namespace Agendas.Blog.Exceptions +{ + public class TipoEventoNoSoportadoException : Exception + { + public TipoEventoNoSoportadoException(string tipoEvento) + : base(string.Format(CultureInfo.InvariantCulture, "El tipo de evento '{0}' no esta soportado por el publicador de blog", tipoEvento)) + { + } + } +} \ No newline at end of file
--- a/Agendas/trunk/src/Agendas.Blog/IPostWriter.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Blog/IPostWriter.cs Tue Jun 07 23:21:07 2011 -0300 @@ -4,6 +4,6 @@ { public interface IPostWriter { - void WritePost(Evento evento); + void WritePost(Track track); } } \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Blog/IPostWriterWebService.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,7 @@ +namespace Agendas.Blog +{ + public interface IPostWriterWebService + { + void WriteBlogPost(string postTitle, string postHtmlContent, string postAuthor, bool setPublicationDate); + } +}
--- a/Agendas/trunk/src/Agendas.Blog/Impl/AgendarReunionPostWriter.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Blog/Impl/AgendarReunionPostWriter.cs Tue Jun 07 23:21:07 2011 -0300 @@ -1,5 +1,6 @@ using System; using System.Globalization; +using Agendas.Blog.Exceptions; using Agendas.Blog.Properties; using AltNetHispano.Agendas.Domain; using System.Linq; @@ -8,25 +9,59 @@ { public class AgendarReunionPostWriter : PostWriter { - protected override string GetTitle(Evento evento) + public AgendarReunionPostWriter(IPostWriterWebService postWriterWebService) : base(postWriterWebService) + { + } + + protected override string GetTitle(Track track) + { + string resourceName = getTitleResourceName(track); + + return string.Format(CultureInfo.InvariantCulture, resourceName, + track.Evento.Ponente.Nombre, //Nombre y apellido del ponente + track.Evento.Titulo //Tema a tratar en la reunion + ); + } + + private string getTitleResourceName(Track track) + { + string resourceName; + if (track.Evento.Tipo == TipoEvento.Van) + resourceName = Resources.VAN_Agendar_Title; + else if (track.Evento.Tipo == TipoEvento.Cafe) + resourceName = Resources.Cafe_Agendar_Title; + else + throw new TipoEventoNoSoportadoException(track.Evento.Tipo.ToString()); + + return resourceName; + } + + protected override string GetBody(Track track) { - return string.Format(CultureInfo.InvariantCulture, Resources.VAN_Realizacion_Title, - evento.Ponente.Nombre, //Nombre y apellido del ponente - evento.Titulo //Tema a tratar en la reunion + string resourceName = getBodyResourceName(track); + + var fecha = getFechaFormateada(track.Evento.Fecha); + return string.Format(CultureInfo.InvariantCulture, resourceName, + fecha, //Fecha y hora en GMT+0 + track.Evento.Ponente.Nombre, //Nombre y apellido del ponente + track.Evento.Titulo, //Tema a tratar en la reunion + getUrlInvitacion(track.Evento), //Url a la invitacion realizada por el ponente (por lo general es el thread en la lista de correo) + GetNombreUsuario(track) //Usuario que postea en el blog ); } - protected override string GetBody(Evento evento) - { - var fecha = getFechaFormateada(evento.Fecha); - return string.Format(CultureInfo.InvariantCulture, Resources.VAN_Realizacion_Body, - fecha, //Fecha y hora en GMT+0 - evento.Ponente.Nombre, //Nombre y apellido del ponente - evento.Titulo, //Tema a tratar en la reunion - getUrlInvitacion(evento), //Url a la invitacion realizada por el ponente (por lo general es el thread en la lista de correo) - GetNombreUsuario(evento) //Usuario que postea en el blog - ); - } + private string getBodyResourceName(Track track) + { + string resourceName; + if (track.Evento.Tipo == TipoEvento.Van) + resourceName = Resources.VAN_Agendar_Body; + else if (track.Evento.Tipo == TipoEvento.Cafe) + resourceName = Resources.Cafe_Agendar_Body; + else + throw new TipoEventoNoSoportadoException(track.Evento.Tipo.ToString()); + + return resourceName; + } private string getFechaFormateada(DateTime? fecha) { @@ -45,7 +80,7 @@ { if (!string.IsNullOrEmpty(evento.UrlInvitacion)) { - return string.Format(CultureInfo.InvariantCulture, Resources.VAN_Realizacion_Body_UrlListaCorreo, + return string.Format(CultureInfo.InvariantCulture, Resources.Reunion_Agendar_Body_UrlListaCorreo, evento.UrlInvitacion); }
--- a/Agendas/trunk/src/Agendas.Blog/Impl/BlogPublicador.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Blog/Impl/BlogPublicador.cs Tue Jun 07 23:21:07 2011 -0300 @@ -15,7 +15,7 @@ public void Publicar(IEnumerable<Track> tracks) { foreach (var track in tracks) - _postWriterFactory.GetPostWriter(track.Accion).WritePost(track.Evento); + _postWriterFactory.GetPostWriter(track.Accion).WritePost(track); } } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Blog/Impl/BlogPublicadorConfig.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,37 @@ +using System; + +namespace Agendas.Blog.Impl +{ + public class BlogPublicadorConfig + { + public BlogPublicadorConfig(string postWriterServiceUrl, string blogName, string blogWriterMasterKey) + { + if (string.IsNullOrEmpty(postWriterServiceUrl)) throw new ArgumentNullException("postWriterServiceUrl"); + if (string.IsNullOrEmpty(blogName)) throw new ArgumentNullException("blogName"); + if (string.IsNullOrEmpty(blogWriterMasterKey)) throw new ArgumentNullException("blogWriterMasterKey"); + + _postWriterServiceUrl = postWriterServiceUrl; + _blogName = blogName; + _blogWriterMasterKey = blogWriterMasterKey; + } + + private readonly string _postWriterServiceUrl; + private readonly string _blogName; + private readonly string _blogWriterMasterKey; + + public string BlogWriterMasterKey + { + get { return _blogWriterMasterKey; } + } + + public string BlogName + { + get { return _blogName; } + } + + public string PostWriterServiceUrl + { + get { return _postWriterServiceUrl; } + } + } +}
--- a/Agendas/trunk/src/Agendas.Blog/Impl/NullObjectPostWriter.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Blog/Impl/NullObjectPostWriter.cs Tue Jun 07 23:21:07 2011 -0300 @@ -4,17 +4,21 @@ { public class NullObjectPostWriter : PostWriter { - public override void WritePost(Evento evento) + public NullObjectPostWriter(IPostWriterWebService postWriterWebService) : base(postWriterWebService) + { + } + + public override void WritePost(Track track) { //no-op } - protected override string GetBody(Evento evento) + protected override string GetBody(Track track) { throw new System.NotImplementedException(); } - protected override string GetTitle(Evento evento) + protected override string GetTitle(Track track) { throw new System.NotImplementedException(); }
--- a/Agendas/trunk/src/Agendas.Blog/Impl/PostWriter.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Blog/Impl/PostWriter.cs Tue Jun 07 23:21:07 2011 -0300 @@ -1,31 +1,38 @@ -using System; -using System.Linq; +using System.Linq; using AltNetHispano.Agendas.Domain; namespace Agendas.Blog.Impl { public abstract class PostWriter : IPostWriter { - public virtual void WritePost(Evento evento) + private readonly IPostWriterWebService _postWriterWebService; + + protected PostWriter(IPostWriterWebService postWriterWebService) { - var title = GetTitle(evento); - var body = GetBody(evento); - this.ExecuteService(title, body); + _postWriterWebService = postWriterWebService; + } + + public virtual void WritePost(Track track) + { + var title = GetTitle(track); + var body = GetBody(track); + this.ExecuteService(title, body, this.GetNombreUsuario(track)); } - protected abstract string GetBody(Evento evento); + protected abstract string GetBody(Track track); - protected abstract string GetTitle(Evento evento); + protected abstract string GetTitle(Track track); - protected string GetNombreUsuario(Evento evento) + protected string GetNombreUsuario(Track track) { - return evento.Tracks.Single(t => t.Accion == Accion.Publicar).Usuario.Nombre; + return track.Usuario.Nombre; } - protected void ExecuteService(string title, string body) + protected void ExecuteService(string title, string body, string author) { - //TODO: invocar al web service - throw new NotImplementedException(); + _postWriterWebService.WriteBlogPost(title, body, author, true); } + + } } \ No newline at end of file
--- a/Agendas/trunk/src/Agendas.Blog/Impl/PostWriterFactory.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Blog/Impl/PostWriterFactory.cs Tue Jun 07 23:21:07 2011 -0300 @@ -4,16 +4,23 @@ { public class PostWriterFactory : IPostWriterFactory { + private readonly IPostWriterWebService _postWriterWebService; + + public PostWriterFactory(IPostWriterWebService postWriterWebService) + { + _postWriterWebService = postWriterWebService; + } + public IPostWriter GetPostWriter(Accion accion) { switch (accion) { case Accion.Agendar: - return new AgendarReunionPostWriter(); + return new AgendarReunionPostWriter(_postWriterWebService); case Accion.Publicar: - return new PublicarReunionPostWriter(); + return new PublicarReunionPostWriter(_postWriterWebService); default: - return new NullObjectPostWriter(); + return new NullObjectPostWriter(_postWriterWebService); } } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Blog/Impl/PostWriterWebServiceAdapter.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,51 @@ +using System; +using System.Globalization; +using System.Security.Cryptography; +using System.ServiceModel; +using Agendas.Blog.Exceptions; +using Agendas.Blog.PortalSitefinity; + +namespace Agendas.Blog.Impl +{ + public class PostWriterWebServiceAdapter : IPostWriterWebService + { + private readonly BlogPublicadorConfig _config; + private readonly PostWriterWebServiceSoapClient _service; + + public PostWriterWebServiceAdapter(BlogPublicadorConfig config) + { + _config = config; + _service = new PortalSitefinity.PostWriterWebServiceSoapClient(new BasicHttpBinding(), + new EndpointAddress(config.PostWriterServiceUrl)); + } + + private static string buildToken(string key, DateTime time) + { + var aux = key + time.ToString(CultureInfo.InvariantCulture); + + var enc = System.Text.Encoding.ASCII.GetEncoder(); + + var data = new byte[aux.Length]; + enc.GetBytes(aux.ToCharArray(), 0, aux.Length, data, 0, true); + + var md5 = new MD5CryptoServiceProvider(); + var result = md5.ComputeHash(data); + + return BitConverter.ToString(result).Replace("-", "").ToLower(); + } + + public void WriteBlogPost(string postTitle, string postHtmlContent, string postAuthor, bool setPublicationDate) + { + var securityToken = getSecurityToken(); + _service.WriteBlogPost(securityToken, _config.BlogName, postTitle, postHtmlContent, postAuthor, setPublicationDate); + } + + private string getSecurityToken() + { + var now = DateTime.UtcNow; + now = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, 0, 0); + + return buildToken(_config.BlogWriterMasterKey, now); + } + } +} \ No newline at end of file
--- a/Agendas/trunk/src/Agendas.Blog/Impl/PublicarReunionPostWriter.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Blog/Impl/PublicarReunionPostWriter.cs Tue Jun 07 23:21:07 2011 -0300 @@ -1,5 +1,6 @@ using System; using System.Globalization; +using Agendas.Blog.Exceptions; using Agendas.Blog.Properties; using AltNetHispano.Agendas.Domain; @@ -7,21 +8,55 @@ { public class PublicarReunionPostWriter : PostWriter { - protected override string GetTitle(Evento evento) + public PublicarReunionPostWriter(IPostWriterWebService postWriterWebService) : base(postWriterWebService) + { + } + + protected override string GetTitle(Track track) { - return string.Format(CultureInfo.InvariantCulture, Resources.VAN_Publicacion_Title, - evento.NumeroOrden, //# de VAN en el historial - evento.Ponente.Nombre //Nombre y apellido del ponente + string resourceName = getTitleResourceName(track); + + return string.Format(CultureInfo.InvariantCulture, resourceName, + track.Evento.NumeroOrden, //# de VAN en el historial + track.Evento.Titulo //Titulo del evento ); } - protected override string GetBody(Evento evento) + private string getTitleResourceName(Track track) + { + string resourceName; + if (track.Evento.Tipo == TipoEvento.Van) + resourceName = Resources.VAN_Publicar_Title; + else if (track.Evento.Tipo == TipoEvento.Cafe) + resourceName = Resources.Cafe_Publicar_Title; + else + throw new TipoEventoNoSoportadoException(track.Evento.Tipo.ToString()); + + return resourceName; + } + + protected override string GetBody(Track track) { - return string.Format(CultureInfo.InvariantCulture, Resources.VAN_Realizacion_Body, - evento.UrlWiki, //Url al video publicado en la wiki - GetNombreUsuario(evento) //Usuario que postea en el blog + string resourceName = getBodyResourceName(track); + + return string.Format(CultureInfo.InvariantCulture, resourceName, + track.Evento.UrlWiki, //Url al video publicado en la wiki + GetNombreUsuario(track) //Usuario que postea en el blog ); } + + private string getBodyResourceName(Track track) + { + string resourceName; + if (track.Evento.Tipo == TipoEvento.Van) + resourceName = Resources.VAN_Publicar_Body; + else if (track.Evento.Tipo == TipoEvento.Cafe) + resourceName = Resources.Cafe_Publicar_Body; + else + throw new TipoEventoNoSoportadoException(track.Evento.Tipo.ToString()); + + return resourceName; + } } } \ No newline at end of file
--- a/Agendas/trunk/src/Agendas.Blog/Properties/Resources.Designer.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Blog/Properties/Resources.Designer.cs Tue Jun 07 23:21:07 2011 -0300 @@ -61,7 +61,32 @@ } /// <summary> - /// Looks up a localized string similar to <p>Ya está publicada la grabación de esta VAN en: </p> + /// Looks up a localized string similar to <p>El día {0}, se realizará un ALT.NET Café donde se tratará el tema "{2}"</p> + ///{3} + ///<p>&nbsp;</p> + ///<p>Para acceder, pueden hacerlo por live meeting mediante alguno de los siguientes enlaces:</p> + ///<p><a href="http://snipr.com/virtualaltnet">http://snipr.com/virtualaltnet </a></p> + ///<p><a href="https://www323.livemeeting.com/cc/usergroups/join?id=van&amp;role=attend">https://www323.livemeeting.com/cc/usergroups/join?id=van&amp;role=attend</a></p> + ///<p>&nbsp;</p> + ///<p>Más información sobre las reuniones virtuale [rest of string was truncated]";. + /// </summary> + internal static string Cafe_Agendar_Body { + get { + return ResourceManager.GetString("Cafe_Agendar_Body", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Realización de ALT.NET Café - {1}. + /// </summary> + internal static string Cafe_Agendar_Title { + get { + return ResourceManager.GetString("Cafe_Agendar_Title", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to <p>Ya está publicada la grabación de este ALT.NET Café en: </p> ///<p><a href="{0}">{0}</a></p> ///<br /> ///<p> </p> @@ -69,18 +94,29 @@ ///<p>{1}</p> ///<p></p>. /// </summary> - internal static string VAN_Publicacion_Body { + internal static string Cafe_Publicar_Body { get { - return ResourceManager.GetString("VAN_Publicacion_Body", resourceCulture); + return ResourceManager.GetString("Cafe_Publicar_Body", resourceCulture); } } /// <summary> - /// Looks up a localized string similar to Publicada la grabación de la VAN #{0} - {1}. + /// Looks up a localized string similar to Publicada la grabación del ALT.NET Café #{0} - {1}. /// </summary> - internal static string VAN_Publicacion_Title { + internal static string Cafe_Publicar_Title { get { - return ResourceManager.GetString("VAN_Publicacion_Title", resourceCulture); + return ResourceManager.GetString("Cafe_Publicar_Title", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to <p>En el siguiente enlace, podrán encontrar el detalle de los temas a tratar:</p> + ///<p><a href="{0}">{0}</a></p> + ///<p></p>. + /// </summary> + internal static string Reunion_Agendar_Body_UrlListaCorreo { + get { + return ResourceManager.GetString("Reunion_Agendar_Body_UrlListaCorreo", resourceCulture); } } @@ -94,29 +130,42 @@ ///<p>&nbsp;</p> ///<p>Más información sobre las reuniones virtuales de la comuni [rest of string was truncated]";. /// </summary> - internal static string VAN_Realizacion_Body { + internal static string VAN_Agendar_Body { get { - return ResourceManager.GetString("VAN_Realizacion_Body", resourceCulture); - } - } - - /// <summary> - /// Looks up a localized string similar to <p>En el siguiente enlace a la lista de correos, podrán encontrar el detalle de los temas a tratar:</p> - ///<p><a href="{0}">{0}</a></p> - ///<p></p>. - /// </summary> - internal static string VAN_Realizacion_Body_UrlListaCorreo { - get { - return ResourceManager.GetString("VAN_Realizacion_Body_UrlListaCorreo", resourceCulture); + return ResourceManager.GetString("VAN_Agendar_Body", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Presentación de VAN con {0} - {1}. /// </summary> - internal static string VAN_Realizacion_Title { + internal static string VAN_Agendar_Title { get { - return ResourceManager.GetString("VAN_Realizacion_Title", resourceCulture); + return ResourceManager.GetString("VAN_Agendar_Title", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to <p>Ya está publicada la grabación de esta VAN en: </p> + ///<p><a href="{0}">{0}</a></p> + ///<br /> + ///<p> </p> + ///<p>En nombre de la comunidad ALT.NET Hispano,</p> + ///<p>{1}</p> + ///<p></p>. + /// </summary> + internal static string VAN_Publicar_Body { + get { + return ResourceManager.GetString("VAN_Publicar_Body", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Publicada la grabación de la VAN #{0} - {1}. + /// </summary> + internal static string VAN_Publicar_Title { + get { + return ResourceManager.GetString("VAN_Publicar_Title", resourceCulture); } } }
--- a/Agendas/trunk/src/Agendas.Blog/Properties/Resources.resx Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Blog/Properties/Resources.resx Tue Jun 07 23:21:07 2011 -0300 @@ -117,7 +117,7 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="VAN_Publicacion_Body" xml:space="preserve"> + <data name="VAN_Publicar_Body" xml:space="preserve"> <value><p>Ya está publicada la grabación de esta VAN en: </p> <p><a href="{0}">{0}</a></p> <br /> @@ -126,10 +126,10 @@ <p>{1}</p> <p></p></value> </data> - <data name="VAN_Publicacion_Title" xml:space="preserve"> + <data name="VAN_Publicar_Title" xml:space="preserve"> <value>Publicada la grabación de la VAN #{0} - {1}</value> </data> - <data name="VAN_Realizacion_Body" xml:space="preserve"> + <data name="VAN_Agendar_Body" xml:space="preserve"> <value><p>El día {0}, {1} presentará en una nueva VAN el tema "{2}"</p> {3} <p>&nbsp;</p> @@ -144,12 +144,42 @@ <p>En nombre de la comunidad ALT.NET Hispano,</p> <p>{4}</p></value> </data> - <data name="VAN_Realizacion_Body_UrlListaCorreo" xml:space="preserve"> - <value><p>En el siguiente enlace a la lista de correos, podrán encontrar el detalle de los temas a tratar:</p> + <data name="Reunion_Agendar_Body_UrlListaCorreo" xml:space="preserve"> + <value><p>En el siguiente enlace, podrán encontrar el detalle de los temas a tratar:</p> <p><a href="{0}">{0}</a></p> <p></p></value> </data> - <data name="VAN_Realizacion_Title" xml:space="preserve"> + <data name="VAN_Agendar_Title" xml:space="preserve"> <value>Presentación de VAN con {0} - {1}</value> </data> + <data name="Cafe_Agendar_Body" xml:space="preserve"> + <value><p>El día {0}, se realizará un ALT.NET Café donde se tratará el tema "{2}"</p> +{3} +<p>&nbsp;</p> +<p>Para acceder, pueden hacerlo por live meeting mediante alguno de los siguientes enlaces:</p> +<p><a href="http://snipr.com/virtualaltnet">http://snipr.com/virtualaltnet </a></p> +<p><a href="https://www323.livemeeting.com/cc/usergroups/join?id=van&amp;role=attend">https://www323.livemeeting.com/cc/usergroups/join?id=van&amp;role=attend</a></p> +<p>&nbsp;</p> +<p>Más información sobre las reuniones virtuales de la comunidad:</p> +<p><a href="../../reuniones/descripcion.aspx">http://altnethispano.org/reuniones/descripcion.aspx</a></p> +<p> </p> +<p></p> +<p>En nombre de la comunidad ALT.NET Hispano,</p> +<p>{4}</p></value> + </data> + <data name="Cafe_Agendar_Title" xml:space="preserve"> + <value>Realización de ALT.NET Café - {1}</value> + </data> + <data name="Cafe_Publicar_Body" xml:space="preserve"> + <value><p>Ya está publicada la grabación de este ALT.NET Café en: </p> +<p><a href="{0}">{0}</a></p> +<br /> +<p> </p> +<p>En nombre de la comunidad ALT.NET Hispano,</p> +<p>{1}</p> +<p></p></value> + </data> + <data name="Cafe_Publicar_Title" xml:space="preserve"> + <value>Publicada la grabación del ALT.NET Café #{0} - {1}</value> + </data> </root> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Blog/Service References/PortalSitefinity/PostWriterWebService.disco Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<discovery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/disco/"> + <contractRef ref="http://localhost/TestAltNet/PostWriterWebService.asmx?wsdl" docRef="http://localhost/TestAltNet/PostWriterWebService.asmx" xmlns="http://schemas.xmlsoap.org/disco/scl/" /> + <soap address="http://localhost/TestAltNet/PostWriterWebService.asmx" xmlns:q1="http://tempuri.org/" binding="q1:PostWriterWebServiceSoap" xmlns="http://schemas.xmlsoap.org/disco/soap/" /> + <soap address="http://localhost/TestAltNet/PostWriterWebService.asmx" xmlns:q2="http://tempuri.org/" binding="q2:PostWriterWebServiceSoap12" xmlns="http://schemas.xmlsoap.org/disco/soap/" /> +</discovery> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Blog/Service References/PortalSitefinity/PostWriterWebService.wsdl Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="utf-8"?> +<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <wsdl:types> + <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/"> + <s:element name="WriteBlogPost"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="securityToken" type="s:string" /> + <s:element minOccurs="0" maxOccurs="1" name="blogName" type="s:string" /> + <s:element minOccurs="0" maxOccurs="1" name="postTitle" type="s:string" /> + <s:element minOccurs="0" maxOccurs="1" name="postHtmlContent" type="s:string" /> + <s:element minOccurs="0" maxOccurs="1" name="postAuthor" type="s:string" /> + <s:element minOccurs="1" maxOccurs="1" name="setPublicationDate" type="s:boolean" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="WriteBlogPostResponse"> + <s:complexType /> + </s:element> + </s:schema> + </wsdl:types> + <wsdl:message name="WriteBlogPostSoapIn"> + <wsdl:part name="parameters" element="tns:WriteBlogPost" /> + </wsdl:message> + <wsdl:message name="WriteBlogPostSoapOut"> + <wsdl:part name="parameters" element="tns:WriteBlogPostResponse" /> + </wsdl:message> + <wsdl:portType name="PostWriterWebServiceSoap"> + <wsdl:operation name="WriteBlogPost"> + <wsdl:input message="tns:WriteBlogPostSoapIn" /> + <wsdl:output message="tns:WriteBlogPostSoapOut" /> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="PostWriterWebServiceSoap" type="tns:PostWriterWebServiceSoap"> + <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="WriteBlogPost"> + <soap:operation soapAction="http://tempuri.org/WriteBlogPost" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:binding name="PostWriterWebServiceSoap12" type="tns:PostWriterWebServiceSoap"> + <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="WriteBlogPost"> + <soap12:operation soapAction="http://tempuri.org/WriteBlogPost" style="document" /> + <wsdl:input> + <soap12:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap12:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="PostWriterWebService"> + <wsdl:port name="PostWriterWebServiceSoap" binding="tns:PostWriterWebServiceSoap"> + <soap:address location="http://localhost/TestAltNet/PostWriterWebService.asmx" /> + </wsdl:port> + <wsdl:port name="PostWriterWebServiceSoap12" binding="tns:PostWriterWebServiceSoap12"> + <soap12:address location="http://localhost/TestAltNet/PostWriterWebService.asmx" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Blog/Service References/PortalSitefinity/Reference.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,148 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.225 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Agendas.Blog.PortalSitefinity { + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ServiceModel.ServiceContractAttribute(ConfigurationName="PortalSitefinity.PostWriterWebServiceSoap")] + public interface PostWriterWebServiceSoap { + + // CODEGEN: Generating message contract since element name securityToken from namespace http://tempuri.org/ is not marked nillable + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/WriteBlogPost", ReplyAction="*")] + Agendas.Blog.PortalSitefinity.WriteBlogPostResponse WriteBlogPost(Agendas.Blog.PortalSitefinity.WriteBlogPostRequest request); + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(IsWrapped=false)] + public partial class WriteBlogPostRequest { + + [System.ServiceModel.MessageBodyMemberAttribute(Name="WriteBlogPost", Namespace="http://tempuri.org/", Order=0)] + public Agendas.Blog.PortalSitefinity.WriteBlogPostRequestBody Body; + + public WriteBlogPostRequest() { + } + + public WriteBlogPostRequest(Agendas.Blog.PortalSitefinity.WriteBlogPostRequestBody Body) { + this.Body = Body; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.Runtime.Serialization.DataContractAttribute(Namespace="http://tempuri.org/")] + public partial class WriteBlogPostRequestBody { + + [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=0)] + public string securityToken; + + [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=1)] + public string blogName; + + [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=2)] + public string postTitle; + + [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=3)] + public string postHtmlContent; + + [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=4)] + public string postAuthor; + + [System.Runtime.Serialization.DataMemberAttribute(Order=5)] + public bool setPublicationDate; + + public WriteBlogPostRequestBody() { + } + + public WriteBlogPostRequestBody(string securityToken, string blogName, string postTitle, string postHtmlContent, string postAuthor, bool setPublicationDate) { + this.securityToken = securityToken; + this.blogName = blogName; + this.postTitle = postTitle; + this.postHtmlContent = postHtmlContent; + this.postAuthor = postAuthor; + this.setPublicationDate = setPublicationDate; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(IsWrapped=false)] + public partial class WriteBlogPostResponse { + + [System.ServiceModel.MessageBodyMemberAttribute(Name="WriteBlogPostResponse", Namespace="http://tempuri.org/", Order=0)] + public Agendas.Blog.PortalSitefinity.WriteBlogPostResponseBody Body; + + public WriteBlogPostResponse() { + } + + public WriteBlogPostResponse(Agendas.Blog.PortalSitefinity.WriteBlogPostResponseBody Body) { + this.Body = Body; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.Runtime.Serialization.DataContractAttribute()] + public partial class WriteBlogPostResponseBody { + + public WriteBlogPostResponseBody() { + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public interface PostWriterWebServiceSoapChannel : Agendas.Blog.PortalSitefinity.PostWriterWebServiceSoap, System.ServiceModel.IClientChannel { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public partial class PostWriterWebServiceSoapClient : System.ServiceModel.ClientBase<Agendas.Blog.PortalSitefinity.PostWriterWebServiceSoap>, Agendas.Blog.PortalSitefinity.PostWriterWebServiceSoap { + + public PostWriterWebServiceSoapClient() { + } + + public PostWriterWebServiceSoapClient(string endpointConfigurationName) : + base(endpointConfigurationName) { + } + + public PostWriterWebServiceSoapClient(string endpointConfigurationName, string remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public PostWriterWebServiceSoapClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public PostWriterWebServiceSoapClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + Agendas.Blog.PortalSitefinity.WriteBlogPostResponse Agendas.Blog.PortalSitefinity.PostWriterWebServiceSoap.WriteBlogPost(Agendas.Blog.PortalSitefinity.WriteBlogPostRequest request) { + return base.Channel.WriteBlogPost(request); + } + + public void WriteBlogPost(string securityToken, string blogName, string postTitle, string postHtmlContent, string postAuthor, bool setPublicationDate) { + Agendas.Blog.PortalSitefinity.WriteBlogPostRequest inValue = new Agendas.Blog.PortalSitefinity.WriteBlogPostRequest(); + inValue.Body = new Agendas.Blog.PortalSitefinity.WriteBlogPostRequestBody(); + inValue.Body.securityToken = securityToken; + inValue.Body.blogName = blogName; + inValue.Body.postTitle = postTitle; + inValue.Body.postHtmlContent = postHtmlContent; + inValue.Body.postAuthor = postAuthor; + inValue.Body.setPublicationDate = setPublicationDate; + Agendas.Blog.PortalSitefinity.WriteBlogPostResponse retVal = ((Agendas.Blog.PortalSitefinity.PostWriterWebServiceSoap)(this)).WriteBlogPost(inValue); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Blog/Service References/PortalSitefinity/Reference.svcmap Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> +<ReferenceGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ID="644f3d46-8f85-47a9-b8fd-d73d60a7d9c7" xmlns="urn:schemas-microsoft-com:xml-wcfservicemap"> + <ClientOptions> + <GenerateAsynchronousMethods>false</GenerateAsynchronousMethods> + <EnableDataBinding>true</EnableDataBinding> + <ExcludedTypes /> + <ImportXmlTypes>false</ImportXmlTypes> + <GenerateInternalTypes>false</GenerateInternalTypes> + <GenerateMessageContracts>false</GenerateMessageContracts> + <NamespaceMappings /> + <CollectionMappings /> + <GenerateSerializableTypes>true</GenerateSerializableTypes> + <Serializer>Auto</Serializer> + <UseSerializerForFaults>true</UseSerializerForFaults> + <ReferenceAllAssemblies>true</ReferenceAllAssemblies> + <ReferencedAssemblies /> + <ReferencedDataContractTypes /> + <ServiceContractMappings /> + </ClientOptions> + <MetadataSources> + <MetadataSource Address="http://localhost/TestAltNet/PostWriterWebService.asmx" Protocol="http" SourceId="1" /> + </MetadataSources> + <Metadata> + <MetadataFile FileName="PostWriterWebService.wsdl" MetadataType="Wsdl" ID="63e1ae81-6c06-4259-a563-7a6d97d9afae" SourceId="1" SourceUrl="http://localhost/TestAltNet/PostWriterWebService.asmx?wsdl" /> + <MetadataFile FileName="PostWriterWebService.disco" MetadataType="Disco" ID="09da924a-04ae-46ee-80f8-06e6ac979958" SourceId="1" SourceUrl="http://localhost/TestAltNet/PostWriterWebService.asmx?disco" /> + </Metadata> + <Extensions> + <ExtensionFile FileName="configuration91.svcinfo" Name="configuration91.svcinfo" /> + <ExtensionFile FileName="configuration.svcinfo" Name="configuration.svcinfo" /> + </Extensions> +</ReferenceGroup> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Blog/Service References/PortalSitefinity/configuration.svcinfo Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<configurationSnapshot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:schemas-microsoft-com:xml-wcfconfigurationsnapshot"> + <behaviors /> + <bindings> + <binding digest="System.ServiceModel.Configuration.BasicHttpBindingElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089:<?xml version="1.0" encoding="utf-16"?><Data hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" messageEncoding="Text" name="PostWriterWebServiceSoap" textEncoding="utf-8" transferMode="Buffered"><readerQuotas maxArrayLength="16384" maxBytesPerRead="4096" maxDepth="32" maxNameTableCharCount="16384" maxStringContentLength="8192" /><security mode="None"><message algorithmSuite="Default" clientCredentialType="UserName" /><transport clientCredentialType="None" proxyCredentialType="None" realm="" /></security></Data>" bindingType="basicHttpBinding" name="PostWriterWebServiceSoap" /> + </bindings> + <endpoints> + <endpoint normalizedDigest="<?xml version="1.0" encoding="utf-16"?><Data address="http://localhost/TestAltNet/PostWriterWebService.asmx" binding="basicHttpBinding" bindingConfiguration="PostWriterWebServiceSoap" contract="PortalSitefinity.PostWriterWebServiceSoap" name="PostWriterWebServiceSoap" />" digest="<?xml version="1.0" encoding="utf-16"?><Data address="http://localhost/TestAltNet/PostWriterWebService.asmx" binding="basicHttpBinding" bindingConfiguration="PostWriterWebServiceSoap" contract="PortalSitefinity.PostWriterWebServiceSoap" name="PostWriterWebServiceSoap" />" contractName="PortalSitefinity.PostWriterWebServiceSoap" name="PostWriterWebServiceSoap" /> + </endpoints> +</configurationSnapshot> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Blog/Service References/PortalSitefinity/configuration91.svcinfo Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,201 @@ +<?xml version="1.0" encoding="utf-8"?> +<SavedWcfConfigurationInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="9.1" CheckSum="Ga08cyTtTuCmaKuG7jW0IamUFY4="> + <bindingConfigurations> + <bindingConfiguration bindingType="basicHttpBinding" name="PostWriterWebServiceSoap"> + <properties> + <property path="/name" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>PostWriterWebServiceSoap</serializedValue> + </property> + <property path="/closeTimeout" isComplexType="false" isExplicitlyDefined="true" clrType="System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>00:01:00</serializedValue> + </property> + <property path="/openTimeout" isComplexType="false" isExplicitlyDefined="true" clrType="System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>00:01:00</serializedValue> + </property> + <property path="/receiveTimeout" isComplexType="false" isExplicitlyDefined="true" clrType="System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>00:10:00</serializedValue> + </property> + <property path="/sendTimeout" isComplexType="false" isExplicitlyDefined="true" clrType="System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>00:01:00</serializedValue> + </property> + <property path="/allowCookies" isComplexType="false" isExplicitlyDefined="true" clrType="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>False</serializedValue> + </property> + <property path="/bypassProxyOnLocal" isComplexType="false" isExplicitlyDefined="true" clrType="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>False</serializedValue> + </property> + <property path="/hostNameComparisonMode" isComplexType="false" isExplicitlyDefined="true" clrType="System.ServiceModel.HostNameComparisonMode, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>StrongWildcard</serializedValue> + </property> + <property path="/maxBufferSize" isComplexType="false" isExplicitlyDefined="true" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>65536</serializedValue> + </property> + <property path="/maxBufferPoolSize" isComplexType="false" isExplicitlyDefined="true" clrType="System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>524288</serializedValue> + </property> + <property path="/maxReceivedMessageSize" isComplexType="false" isExplicitlyDefined="true" clrType="System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>65536</serializedValue> + </property> + <property path="/messageEncoding" isComplexType="false" isExplicitlyDefined="true" clrType="System.ServiceModel.WSMessageEncoding, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>Text</serializedValue> + </property> + <property path="/proxyAddress" isComplexType="false" isExplicitlyDefined="false" clrType="System.Uri, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue /> + </property> + <property path="/readerQuotas" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement</serializedValue> + </property> + <property path="/readerQuotas/maxDepth" isComplexType="false" isExplicitlyDefined="true" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>32</serializedValue> + </property> + <property path="/readerQuotas/maxStringContentLength" isComplexType="false" isExplicitlyDefined="true" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>8192</serializedValue> + </property> + <property path="/readerQuotas/maxArrayLength" isComplexType="false" isExplicitlyDefined="true" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>16384</serializedValue> + </property> + <property path="/readerQuotas/maxBytesPerRead" isComplexType="false" isExplicitlyDefined="true" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>4096</serializedValue> + </property> + <property path="/readerQuotas/maxNameTableCharCount" isComplexType="false" isExplicitlyDefined="true" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>16384</serializedValue> + </property> + <property path="/security" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.BasicHttpSecurityElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>System.ServiceModel.Configuration.BasicHttpSecurityElement</serializedValue> + </property> + <property path="/security/mode" isComplexType="false" isExplicitlyDefined="true" clrType="System.ServiceModel.BasicHttpSecurityMode, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>None</serializedValue> + </property> + <property path="/security/transport" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.HttpTransportSecurityElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>System.ServiceModel.Configuration.HttpTransportSecurityElement</serializedValue> + </property> + <property path="/security/transport/clientCredentialType" isComplexType="false" isExplicitlyDefined="true" clrType="System.ServiceModel.HttpClientCredentialType, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>None</serializedValue> + </property> + <property path="/security/transport/proxyCredentialType" isComplexType="false" isExplicitlyDefined="true" clrType="System.ServiceModel.HttpProxyCredentialType, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>None</serializedValue> + </property> + <property path="/security/transport/extendedProtectionPolicy" isComplexType="true" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement</serializedValue> + </property> + <property path="/security/transport/extendedProtectionPolicy/policyEnforcement" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.PolicyEnforcement, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>Never</serializedValue> + </property> + <property path="/security/transport/extendedProtectionPolicy/protectionScenario" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.ProtectionScenario, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>TransportSelected</serializedValue> + </property> + <property path="/security/transport/extendedProtectionPolicy/customServiceNames" isComplexType="true" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.Configuration.ServiceNameElementCollection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>(Collection)</serializedValue> + </property> + <property path="/security/transport/realm" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue /> + </property> + <property path="/security/message" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.BasicHttpMessageSecurityElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>System.ServiceModel.Configuration.BasicHttpMessageSecurityElement</serializedValue> + </property> + <property path="/security/message/clientCredentialType" isComplexType="false" isExplicitlyDefined="true" clrType="System.ServiceModel.BasicHttpMessageCredentialType, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>UserName</serializedValue> + </property> + <property path="/security/message/algorithmSuite" isComplexType="false" isExplicitlyDefined="true" clrType="System.ServiceModel.Security.SecurityAlgorithmSuite, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>Default</serializedValue> + </property> + <property path="/textEncoding" isComplexType="false" isExplicitlyDefined="true" clrType="System.Text.Encoding, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>System.Text.UTF8Encoding</serializedValue> + </property> + <property path="/transferMode" isComplexType="false" isExplicitlyDefined="true" clrType="System.ServiceModel.TransferMode, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>Buffered</serializedValue> + </property> + <property path="/useDefaultWebProxy" isComplexType="false" isExplicitlyDefined="true" clrType="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>True</serializedValue> + </property> + </properties> + </bindingConfiguration> + </bindingConfigurations> + <endpoints> + <endpoint name="PostWriterWebServiceSoap" contract="PortalSitefinity.PostWriterWebServiceSoap" bindingType="basicHttpBinding" address="http://localhost/TestAltNet/PostWriterWebService.asmx" bindingConfiguration="PostWriterWebServiceSoap"> + <properties> + <property path="/address" isComplexType="false" isExplicitlyDefined="true" clrType="System.Uri, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>http://localhost/TestAltNet/PostWriterWebService.asmx</serializedValue> + </property> + <property path="/behaviorConfiguration" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue /> + </property> + <property path="/binding" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>basicHttpBinding</serializedValue> + </property> + <property path="/bindingConfiguration" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>PostWriterWebServiceSoap</serializedValue> + </property> + <property path="/contract" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>PortalSitefinity.PostWriterWebServiceSoap</serializedValue> + </property> + <property path="/headers" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.AddressHeaderCollectionElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>System.ServiceModel.Configuration.AddressHeaderCollectionElement</serializedValue> + </property> + <property path="/headers/headers" isComplexType="false" isExplicitlyDefined="true" clrType="System.ServiceModel.Channels.AddressHeaderCollection, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue><Header /></serializedValue> + </property> + <property path="/identity" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.IdentityElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>System.ServiceModel.Configuration.IdentityElement</serializedValue> + </property> + <property path="/identity/userPrincipalName" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.UserPrincipalNameElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>System.ServiceModel.Configuration.UserPrincipalNameElement</serializedValue> + </property> + <property path="/identity/userPrincipalName/value" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue /> + </property> + <property path="/identity/servicePrincipalName" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.ServicePrincipalNameElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>System.ServiceModel.Configuration.ServicePrincipalNameElement</serializedValue> + </property> + <property path="/identity/servicePrincipalName/value" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue /> + </property> + <property path="/identity/dns" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.DnsElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>System.ServiceModel.Configuration.DnsElement</serializedValue> + </property> + <property path="/identity/dns/value" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue /> + </property> + <property path="/identity/rsa" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.RsaElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>System.ServiceModel.Configuration.RsaElement</serializedValue> + </property> + <property path="/identity/rsa/value" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue /> + </property> + <property path="/identity/certificate" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.CertificateElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>System.ServiceModel.Configuration.CertificateElement</serializedValue> + </property> + <property path="/identity/certificate/encodedValue" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue /> + </property> + <property path="/identity/certificateReference" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.CertificateReferenceElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>System.ServiceModel.Configuration.CertificateReferenceElement</serializedValue> + </property> + <property path="/identity/certificateReference/storeName" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Cryptography.X509Certificates.StoreName, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>My</serializedValue> + </property> + <property path="/identity/certificateReference/storeLocation" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Cryptography.X509Certificates.StoreLocation, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>LocalMachine</serializedValue> + </property> + <property path="/identity/certificateReference/x509FindType" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Cryptography.X509Certificates.X509FindType, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>FindBySubjectDistinguishedName</serializedValue> + </property> + <property path="/identity/certificateReference/findValue" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue /> + </property> + <property path="/identity/certificateReference/isChainIncluded" isComplexType="false" isExplicitlyDefined="false" clrType="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>False</serializedValue> + </property> + <property path="/name" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue>PostWriterWebServiceSoap</serializedValue> + </property> + <property path="/kind" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue /> + </property> + <property path="/endpointConfiguration" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <serializedValue /> + </property> + </properties> + </endpoint> + </endpoints> +</SavedWcfConfigurationInformation> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Blog/app.config Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8" ?> +<configuration> + <system.serviceModel> + <bindings> + <basicHttpBinding> + <binding name="PostWriterWebServiceSoap" closeTimeout="00:01:00" + openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" + allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" + maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" + messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" + useDefaultWebProxy="true"> + <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" + maxBytesPerRead="4096" maxNameTableCharCount="16384" /> + <security mode="None"> + <transport clientCredentialType="None" proxyCredentialType="None" + realm="" /> + <message clientCredentialType="UserName" algorithmSuite="Default" /> + </security> + </binding> + </basicHttpBinding> + </bindings> + <client> + <endpoint address="http://localhost/TestAltNet/PostWriterWebService.asmx" + binding="basicHttpBinding" bindingConfiguration="PostWriterWebServiceSoap" + contract="PortalSitefinity.PostWriterWebServiceSoap" name="PostWriterWebServiceSoap" /> + </client> + </system.serviceModel> +</configuration> \ No newline at end of file
--- a/Agendas/trunk/src/Agendas.Domain/Agenda.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Domain/Agenda.cs Tue Jun 07 23:21:07 2011 -0300 @@ -63,10 +63,10 @@ return ModificarEvento(id, titulo, ponenteNombre, null, urlInvitacion); } - public Resultado Proponer(string titulo, string ponenteNombre, string urlInvitacion) + public Resultado Proponer(string titulo, string ponenteNombre, string urlInvitacion, TipoEvento tipo) { Persona persona = GetPonente(ponenteNombre); - var evento = Evento.Proponer(titulo, persona, urlInvitacion); + var evento = Evento.Proponer(titulo, persona, urlInvitacion, tipo); if (string.IsNullOrWhiteSpace(evento.Titulo)) return new Resultado(false); @@ -79,7 +79,7 @@ return new Resultado(true); } - public Resultado Agendar(string titulo, string ponenteNombre, DateTime? fecha, string urlInvitacion) + public Resultado Agendar(string titulo, string ponenteNombre, DateTime? fecha, string urlInvitacion, TipoEvento tipo) { if (!fecha.HasValue) return new Resultado(false); @@ -90,7 +90,7 @@ Evento evento = _eventosRepository.GetPropuestaByTitulo(titulo); if (evento == null) - evento = Evento.Agendar(titulo, persona, fecha.Value, urlInvitacion); + evento = Evento.Agendar(titulo, persona, fecha.Value, urlInvitacion, tipo); else evento.Agendar(persona, fecha, urlInvitacion); @@ -115,11 +115,11 @@ return new Resultado(true); } - public Resultado Publicar(Guid eventoId) + public Resultado Publicar(Guid eventoId, short numeroOrden, string urlWiki) { Evento evento = GetEvento(eventoId); - evento.Publicar(); + evento.Publicar(numeroOrden, urlWiki); Notify(evento);
--- a/Agendas/trunk/src/Agendas.Domain/Agendas.Domain.csproj Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Domain/Agendas.Domain.csproj Tue Jun 07 23:21:07 2011 -0300 @@ -40,16 +40,24 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> + <Compile Include="EventoAgendadoState.cs" /> + <Compile Include="EventoConfirmadoState.cs" /> + <Compile Include="EventoNullState.cs" /> + <Compile Include="EventoPropuestoState.cs" /> + <Compile Include="EventoPublicadoState.cs" /> + <Compile Include="Exceptions\AccionNoSoportadaException.cs" /> <Compile Include="Agenda.cs" /> <Compile Include="CompositePublicador.cs" /> <Compile Include="Cuenta.cs" /> <Compile Include="Evento.cs" /> + <Compile Include="EventoState.cs" /> <Compile Include="Exceptions\EventoNotFoundException.cs" /> <Compile Include="Exceptions\IdentityContextNotConfiguredException.cs" /> <Compile Include="Exceptions\UsuarioNoAutenticadoException.cs" /> <Compile Include="Identificable.cs" /> <Compile Include="Identification.cs" /> <Compile Include="IdentityContext.cs" /> + <Compile Include="Exceptions\InvalidStateException.cs" /> <Compile Include="ISeguridad.cs" /> <Compile Include="Persona.cs" /> <Compile Include="Repositories\IEventoRepository.cs" /> @@ -58,6 +66,7 @@ <Compile Include="Repositories\IPersonaRepository.cs" /> <Compile Include="Resultado.cs" /> <Compile Include="Services\PersonaService.cs" /> + <Compile Include="TipoEvento.cs" /> <Compile Include="Track.cs" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
--- a/Agendas/trunk/src/Agendas.Domain/Evento.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Domain/Evento.cs Tue Jun 07 23:21:07 2011 -0300 @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using AltNetHispano.Agendas.Domain.Exceptions; namespace AltNetHispano.Agendas.Domain { @@ -53,36 +54,93 @@ get { return _tracks; } } - #endregion + /// <summary> + /// Estado del evento en formato string (para persistencia a DB) + /// </summary> + public virtual string Estado + { + get + { + if (_eventoState != null) + return _eventoState.GetDescripcion(); + + return string.Empty; + } + set + { + if (value != Estado) + { + if (EventoPropuestoState.GetInstance().GetDescripcion().Equals(value)) + _eventoState = EventoPropuestoState.GetInstance(); + else if (EventoAgendadoState.GetInstance().GetDescripcion().Equals(value)) + _eventoState = EventoAgendadoState.GetInstance(); + else if (EventoConfirmadoState.GetInstance().GetDescripcion().Equals(value)) + _eventoState = EventoConfirmadoState.GetInstance(); + else if (EventoPublicadoState.GetInstance().GetDescripcion().Equals(value)) + _eventoState = EventoPublicadoState.GetInstance(); + else + throw new InvalidStateException(value); + } + } + } + + private EventoState _eventoState; + + /// <summary> + /// Obtiene una instancia de la clase que representa el estado del evento + /// </summary> + public virtual EventoState GetEstado() + { + if (_eventoState == null) + SetEstado(EventoNullState.GetInstance()); + + return _eventoState; + } + + /// <summary> + /// Asigna la instancia de la clase que representa el estado del evento + /// </summary> + /// <param name="eventoState">Instancia que representa el estado</param> + public virtual void SetEstado(EventoState eventoState) + { + _eventoState = eventoState; + } + + public virtual TipoEvento Tipo { get; private set; } + + #endregion #region Acciones sobre el evento - /// <summary> - /// Propone un evento - /// </summary> - /// <param name="titulo">Título del evento propuesto</param> - /// <param name="persona">Ponente para evento propuesto</param> - /// <returns></returns> - public static Evento Proponer(string titulo, Persona persona, string urlInvitacion) + /// <summary> + /// Propone un evento + /// </summary> + /// <param name="titulo">Título del evento propuesto</param> + /// <param name="persona">Ponente para evento propuesto</param> + /// <param name="urlInvitacion">Url con la invitación realizada por el ponente</param> + /// <param name="tipo">Tipo del evento</param> + /// <returns></returns> + public static Evento Proponer(string titulo, Persona persona, string urlInvitacion, TipoEvento tipo) { - var evento = new Evento {Titulo = titulo, Ponente = persona, UrlInvitacion = urlInvitacion}; - evento.AddTrack(new Track(evento, Accion.Proponer)); + var evento = new Evento {Titulo = titulo, Ponente = persona, UrlInvitacion = urlInvitacion, Tipo = tipo}; + evento.GetEstado().Promover(evento, Accion.Proponer); return evento; } - /// <summary> - /// Agenda un evento que no estaba propuesto - /// </summary> - /// <param name="titulo">Título del evento a agendar</param> - /// <param name="persona">Ponente para el evento</param> - /// <param name="fecha">Fecha de realización del evento</param> - /// <param name="urlInvitacion">Url con la invitación realizada por el ponente</param> - /// <returns></returns> - public static Evento Agendar(string titulo, Persona persona, DateTime fecha, string urlInvitacion) - { - var evento = new Evento { Titulo = titulo }; - evento.Agendar(persona, fecha, urlInvitacion); + /// <summary> + /// Agenda un evento que no estaba propuesto + /// </summary> + /// <param name="titulo">Título del evento a agendar</param> + /// <param name="persona">Ponente para el evento</param> + /// <param name="fecha">Fecha de realización del evento</param> + /// <param name="urlInvitacion">Url con la invitación realizada por el ponente</param> + /// <param name="tipo">Tipo del evento</param> + /// <returns></returns> + public static Evento Agendar(string titulo, Persona persona, DateTime fecha, string urlInvitacion, TipoEvento tipo) + { + var evento = new Evento {Titulo = titulo, Tipo = tipo}; + evento.Agendar(persona, fecha, urlInvitacion); return evento; } @@ -98,7 +156,7 @@ Ponente = persona; Fecha = fecha; UrlInvitacion = urlInvitacion; - AddTrack(new Track(this, Accion.Agendar)); + this.GetEstado().Promover(this, Accion.Agendar); } public virtual void Actualizar(Persona persona, DateTime? fecha, string urlInvitacion) @@ -118,17 +176,19 @@ public virtual void Confirmar() { - AddTrack(new Track(this, Accion.Confirmar)); + this.GetEstado().Promover(this, Accion.Confirmar); } - public virtual void Publicar() - { - AddTrack(new Track(this, Accion.Publicar)); + public virtual void Publicar(short numeroOrden, string urlWiki) + { + this.NumeroOrden = numeroOrden; + this.UrlWiki = urlWiki; + this.GetEstado().Promover(this, Accion.Publicar); } #endregion - private void AddTrack(Track track) + protected internal virtual void AddTrack(Track track) { _newTracks.Add(track); _tracks.Add(track);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Domain/EventoAgendadoState.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,37 @@ +using AltNetHispano.Agendas.Domain.Exceptions; + +namespace AltNetHispano.Agendas.Domain +{ + public class EventoAgendadoState : EventoState + { + private EventoAgendadoState() + { + } + + private static readonly EventoState _instance = new EventoAgendadoState(); + public static EventoState GetInstance() + { + return _instance; + } + + private const string Descripcion = "Agendado"; + + public override void Promover(Evento evento, Accion accion) + { + switch (accion) + { + case Accion.Confirmar: + evento.SetEstado(EventoConfirmadoState.GetInstance()); + evento.AddTrack(new Track(evento, Accion.Confirmar)); + break; + default: + throw new AccionNoSoportadaException(this.GetType(), accion); + } + } + + public override string GetDescripcion() + { + return Descripcion; + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Domain/EventoConfirmadoState.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,37 @@ +using AltNetHispano.Agendas.Domain.Exceptions; + +namespace AltNetHispano.Agendas.Domain +{ + public class EventoConfirmadoState : EventoState + { + private EventoConfirmadoState() + { + } + + private static readonly EventoState _instance = new EventoConfirmadoState(); + public static EventoState GetInstance() + { + return _instance; + } + + private const string Descripcion = "Confirmado"; + + public override void Promover(Evento evento, Accion accion) + { + switch (accion) + { + case Accion.Publicar: + evento.SetEstado(EventoPublicadoState.GetInstance()); + evento.AddTrack(new Track(evento, Accion.Publicar)); + break; + default: + throw new AccionNoSoportadaException(this.GetType(), accion); + } + } + + public override string GetDescripcion() + { + return Descripcion; + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Domain/EventoNullState.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,41 @@ +using AltNetHispano.Agendas.Domain.Exceptions; + +namespace AltNetHispano.Agendas.Domain +{ + public class EventoNullState : EventoState + { + private EventoNullState() + { + } + + private static readonly EventoState _instance = new EventoNullState(); + public static EventoState GetInstance() + { + return _instance; + } + + private const string Descripcion = "NullState"; + + public override void Promover(Evento evento, Accion accion) + { + switch (accion) + { + case Accion.Proponer: + evento.SetEstado(EventoPropuestoState.GetInstance()); + evento.AddTrack(new Track(evento, Accion.Proponer)); + break; + case Accion.Agendar: + evento.SetEstado(EventoAgendadoState.GetInstance()); + evento.AddTrack(new Track(evento, Accion.Agendar)); + break; + default: + throw new AccionNoSoportadaException(this.GetType(), accion); + } + } + + public override string GetDescripcion() + { + return Descripcion; + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Domain/EventoPropuestoState.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,37 @@ +using AltNetHispano.Agendas.Domain.Exceptions; + +namespace AltNetHispano.Agendas.Domain +{ + public class EventoPropuestoState : EventoState + { + private EventoPropuestoState() + { + } + + private static readonly EventoState _instance = new EventoPropuestoState(); + public static EventoState GetInstance() + { + return _instance; + } + + private const string Descripcion = "Propuesto"; + + public override void Promover(Evento evento, Accion accion) + { + switch (accion) + { + case Accion.Agendar: + evento.SetEstado(EventoAgendadoState.GetInstance()); + evento.AddTrack(new Track(evento, Accion.Agendar)); + break; + default: + throw new AccionNoSoportadaException(this.GetType(), accion); + } + } + + public override string GetDescripcion() + { + return Descripcion; + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Domain/EventoPublicadoState.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,29 @@ +using AltNetHispano.Agendas.Domain.Exceptions; + +namespace AltNetHispano.Agendas.Domain +{ + public class EventoPublicadoState : EventoState + { + private EventoPublicadoState() + { + } + + private static readonly EventoState _instance = new EventoPublicadoState(); + public static EventoState GetInstance() + { + return _instance; + } + + private const string Descripcion = "Publicado"; + + public override void Promover(Evento evento, Accion accion) + { + throw new AccionNoSoportadaException(this.GetType(), accion); + } + + public override string GetDescripcion() + { + return Descripcion; + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Domain/EventoState.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace AltNetHispano.Agendas.Domain +{ + public abstract class EventoState + { + public abstract void Promover(Evento evento, Accion accion); + + public abstract string GetDescripcion(); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Domain/Exceptions/AccionNoSoportadaException.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,15 @@ +using System; +using System.Globalization; + +namespace AltNetHispano.Agendas.Domain.Exceptions +{ + public class AccionNoSoportadaException : Exception + { + public AccionNoSoportadaException(Type stateType, Accion accion) : + base(string.Format(CultureInfo.InvariantCulture, + "No se puede realizar la accion '{0}' en el estado '{1}'", + accion, stateType.Name)) + { + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Domain/Exceptions/InvalidStateException.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,13 @@ +using System; +using System.Globalization; + +namespace AltNetHispano.Agendas.Domain.Exceptions +{ + public class InvalidStateException : Exception + { + public InvalidStateException(string state) + : base(string.Format(CultureInfo.InvariantCulture, "El estado '{0}' no es valido", state)) + { + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Domain/TipoEvento.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,9 @@ +namespace AltNetHispano.Agendas.Domain +{ + public enum TipoEvento + { + Van, + Cafe, + GrupoEstudio + } +} \ No newline at end of file
--- a/Agendas/trunk/src/Agendas.Tests/AgendarTests.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Tests/AgendarTests.cs Tue Jun 07 23:21:07 2011 -0300 @@ -31,7 +31,7 @@ var agenda = new Agenda(publicador.Object, repository.Object, DefaultPersonaRepository); - Assert.Throws<Exception>(() => agenda.Agendar("Van para publicar", "jjmontes", DateTime.Now, urlInvitacion)); + Assert.Throws<Exception>(() => agenda.Agendar("Van para publicar", "jjmontes", DateTime.Now, urlInvitacion, TipoEvento.Van)); Assert.AreEqual(0, agenda.GetEventosAgendados().Count); publicador.Verify(p => p.Publicar(It.IsAny<IEnumerable<Track>>()), Times.Exactly(1)); @@ -50,7 +50,7 @@ Assert.Throws<IdentityContextNotConfiguredException>( () => agenda.Agendar("Van para publicar", "jjmontes", DateTime.Now, - urlInvitacion)); + urlInvitacion, TipoEvento.Van)); repository.Verify(p => p.Save(It.IsAny<Evento>()), Times.Exactly(0)); } @@ -65,7 +65,7 @@ var agenda = new Agenda(publicador.Object, repository.Object, DefaultPersonaRepository); Assert.Throws<UsuarioNoAutenticadoException>(() => agenda.Agendar("Van para publicar", "jjmontes", DateTime.Now, - urlInvitacion)); + urlInvitacion, TipoEvento.Van)); publicador.Verify(p => p.Publicar(It.IsAny<IEnumerable<Track>>()), Times.Exactly(0)); repository.Verify(p => p.Save(It.IsAny<Evento>()), Times.Exactly(0)); @@ -77,7 +77,7 @@ var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository); var r = agenda.Agendar("Van para publicar", string.Empty, DateTime.Now, - urlInvitacion); + urlInvitacion, TipoEvento.Van); Assert.IsFalse(r.Succeful); } @@ -94,7 +94,7 @@ repository.Object, DefaultPersonaRepository); agenda.Agendar("Van para publicar", "jjmontes", DateTime.Now, - urlInvitacion); + urlInvitacion, TipoEvento.Van); publicador1.Verify(p => p.Publicar(It.IsAny<IEnumerable<Track>>()), Times.Exactly(1)); publicador2.Verify(p => p.Publicar(It.IsAny<IEnumerable<Track>>()), Times.Exactly(1)); @@ -109,7 +109,7 @@ var agenda = new Agenda(publicador.Object, DefaultEventoRepository, DefaultPersonaRepository); agenda.Agendar("Van para publicar", "jjmontes", DateTime.Now, - urlInvitacion); + urlInvitacion, TipoEvento.Van); Assert.AreEqual(0, agenda.GetEventosPropuestos().Count); @@ -132,7 +132,7 @@ var agenda = new Agenda(publicador.Object, repository, DefaultPersonaRepository); agenda.Agendar("Van para publicar", "jjmontes", DateTime.Now, - urlInvitacion); + urlInvitacion, TipoEvento.Van); publicador.Verify(p => p.Publicar(It.IsAny<IEnumerable<Track>>()), Times.Exactly(1)); @@ -165,7 +165,7 @@ DefaultEventoRepository, DefaultPersonaRepository); agenda.Agendar("Van para publicar", "jjmontes", DateTime.Now, - urlInvitacion); + urlInvitacion, TipoEvento.Van); var van = agenda.GetEventosAgendados().Single(v => v.Titulo == "Van para publicar"); //agenda.Recordar(van.Id); @@ -184,7 +184,7 @@ var agenda = new Agenda(new CompositePublicador(new[] { publicador1.Object, publicador2.Object }), DefaultEventoRepository, DefaultPersonaRepository); - agenda.Proponer("Html 5", "jjmontes", urlInvitacion); + agenda.Proponer("Html 5", "jjmontes", urlInvitacion, TipoEvento.Van); Assert.AreEqual(1, agenda.GetEventosPropuestos().Count); Assert.AreEqual(0, agenda.GetEventosAgendados().Count); @@ -202,5 +202,116 @@ Assert.IsNotNull(agendado.Tracks.Where(t => t.Accion == Accion.Proponer).SingleOrDefault()); Assert.IsNotNull(agendado.Tracks.Where(t => t.Accion == Accion.Agendar).SingleOrDefault()); } + + [Test] + public void Al_proponer_un_evento_debe_quedar_con_estado_EventoPropuestoState_y_debe_generar_el_track_correspondiente() + { + var publicador1 = new Mock<IPublicador>(); + + var agenda = new Agenda(publicador1.Object, DefaultEventoRepository, DefaultPersonaRepository); + agenda.Proponer("Html 5", "jjmontes", urlInvitacion, TipoEvento.Van); + + var evento = DefaultEventoRepository.GetEventosSinFecha().Single(e => e.Titulo == "Html 5"); + + Assert.IsInstanceOf(typeof(EventoPropuestoState), evento.GetEstado()); + Assert.That(evento.GetTrackNews().Count(t => t.Accion == Accion.Proponer) == 1); + } + + [Test] + public void Al_agendar_un_evento_debe_quedar_con_estado_EventoAgendadoState_y_debe_generar_el_track_correspondiente() + { + var publicador1 = new Mock<IPublicador>(); + + var agenda = new Agenda(publicador1.Object, DefaultEventoRepository, DefaultPersonaRepository); + agenda.Agendar("Html 5", "jjmontes", DateTime.MinValue, urlInvitacion, TipoEvento.Van); + + var evento = DefaultEventoRepository.GetEventosConFecha().Single(e => e.Titulo == "Html 5"); + + Assert.IsInstanceOf(typeof(EventoAgendadoState), evento.GetEstado()); + Assert.That(evento.GetTrackNews().Count(t => t.Accion == Accion.Agendar) == 1); + } + + [Test] + public void Al_confirmar_un_evento_debe_quedar_con_estado_EventoConfirmadoState_y_debe_generar_el_track_correspondiente() + { + var publicador1 = new Mock<IPublicador>(); + + var agenda = new Agenda(publicador1.Object, DefaultEventoRepository, DefaultPersonaRepository); + agenda.Agendar("Html 5", "jjmontes", DateTime.MinValue, urlInvitacion, TipoEvento.Van); + + var evento = DefaultEventoRepository.GetEventosConFecha().Single(e => e.Titulo == "Html 5"); + + agenda.Confirmar(evento.Id); + + Assert.IsInstanceOf(typeof(EventoConfirmadoState), evento.GetEstado()); + Assert.That(evento.GetTrackNews().Count(t => t.Accion == Accion.Confirmar) == 1); + } + + [Test] + public void Al_publicar_un_evento_debe_quedar_con_estado_EventoPublicadoState_y_debe_generar_el_track_correspondiente() + { + var publicador1 = new Mock<IPublicador>(); + + var agenda = new Agenda(publicador1.Object, DefaultEventoRepository, DefaultPersonaRepository); + agenda.Agendar("Html 5", "jjmontes", DateTime.MinValue, urlInvitacion, TipoEvento.Van); + + var evento = DefaultEventoRepository.GetEventosConFecha().Single(e => e.Titulo == "Html 5"); + + agenda.Confirmar(evento.Id); + agenda.Publicar(evento.Id, 0, string.Empty); + + Assert.IsInstanceOf(typeof(EventoPublicadoState), evento.GetEstado()); + Assert.That(evento.GetTrackNews().Count(t => t.Accion == Accion.Publicar) == 1); + } + + [Test] + public void Al_publicar_un_evento_debe_asignarse_el_nro_de_reunion_y_la_url_de_la_wiki() + { + var publicador1 = new Mock<IPublicador>(); + + var agenda = new Agenda(publicador1.Object, DefaultEventoRepository, DefaultPersonaRepository); + agenda.Agendar("Html 5", "jjmontes", DateTime.MinValue, urlInvitacion, TipoEvento.Van); + + var evento = DefaultEventoRepository.GetEventosConFecha().Single(e => e.Titulo == "Html 5"); + agenda.Confirmar(evento.Id); + + const string urlWiki = "http://www.altnethispano.org/wiki/van-2010-10-21-mono-cecil.ashx"; + agenda.Publicar(evento.Id, 71, urlWiki); + + Assert.AreEqual(71, evento.NumeroOrden); + Assert.AreEqual(urlWiki, evento.UrlWiki); + } + + [Test] + [ExpectedException(typeof(AccionNoSoportadaException))] + public void Al_confirmar_sin_agendar_debe_lanzarse_excepcion() + { + var publicador1 = new Mock<IPublicador>(); + + var agenda = new Agenda(publicador1.Object, DefaultEventoRepository, DefaultPersonaRepository); + agenda.Proponer("Html 5", "jjmontes", urlInvitacion, TipoEvento.Van); + + var evento = DefaultEventoRepository.GetEventosSinFecha().Single(e => e.Titulo == "Html 5"); + + Assert.IsFalse(evento.Estado.GetType() == typeof(EventoAgendadoState)); + + agenda.Confirmar(evento.Id); + } + + [Test] + [ExpectedException(typeof(AccionNoSoportadaException))] + public void Al_publicar_sin_confirmar_debe_lanzarse_excepcion() + { + var publicador1 = new Mock<IPublicador>(); + + var agenda = new Agenda(publicador1.Object, DefaultEventoRepository, DefaultPersonaRepository); + agenda.Proponer("Html 5", "jjmontes", urlInvitacion, TipoEvento.Van); + + var evento = DefaultEventoRepository.GetEventosSinFecha().Single(e => e.Titulo == "Html 5"); + + Assert.IsFalse(evento.Estado.GetType() == typeof(EventoConfirmadoState)); + + agenda.Publicar(evento.Id, 0, string.Empty); + } } } \ No newline at end of file
--- a/Agendas/trunk/src/Agendas.Tests/Agendas.Tests.csproj Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Tests/Agendas.Tests.csproj Tue Jun 07 23:21:07 2011 -0300 @@ -62,7 +62,9 @@ <HintPath>..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll</HintPath> </Reference> <Reference Include="System" /> + <Reference Include="System.Configuration" /> <Reference Include="System.Core" /> + <Reference Include="System.ServiceModel" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data.DataSetExtensions" /> <Reference Include="Microsoft.CSharp" /> @@ -70,6 +72,8 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> + <Compile Include="Blog\PostWriterWebServiceAdapterTests.cs" /> + <Compile Include="Blog\PublicadorTests.cs" /> <Compile Include="Cruds\EventoCrud.cs" /> <Compile Include="Cruds\EventoCrudNhTests.cs" /> <Compile Include="DateTimeFormattingTests.cs" /> @@ -85,6 +89,10 @@ <Compile Include="Workflows\WorkflowTests.cs" /> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\Agendas.Blog\Agendas.Blog.csproj"> + <Project>{DDD605FF-EF42-428A-AEB6-F3496A46A82B}</Project> + <Name>Agendas.Blog</Name> + </ProjectReference> <ProjectReference Include="..\Agendas.Domain\Agendas.Domain.csproj"> <Project>{A14907DF-02E4-4FA7-BE27-4292AF50AA22}</Project> <Name>Agendas.Domain</Name> @@ -107,7 +115,9 @@ </ProjectReference> </ItemGroup> <ItemGroup> - <None Include="App.config" /> + <None Include="App.config"> + <SubType>Designer</SubType> + </None> <None Include="packages.config" /> </ItemGroup> <ItemGroup>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Tests/Blog/PostWriterWebServiceAdapterTests.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.ServiceModel; +using System.Text; +using Agendas.Blog; +using Agendas.Blog.Exceptions; +using Agendas.Blog.Impl; +using AltNetHispano.Agendas.Domain; +using Moq; +using NUnit.Framework; + +namespace AltNetHispano.Agendas.Tests.Blog +{ + [TestFixture] + public class PostWriterWebServiceAdapterTests + { + [Test] + [ExpectedException(typeof(EndpointNotFoundException))] + public void Si_la_url_es_invalida_debe_lanzar_excepcion() + { + var srv = new PostWriterWebServiceAdapter(new BlogPublicadorConfig("http://dummy/dummy.aspx", "dummy", "dummy")); + srv.WriteBlogPost(null, null, null, false); + } + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Tests/Blog/PublicadorTests.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Agendas.Blog; +using Agendas.Blog.Impl; +using AltNetHispano.Agendas.Domain; +using AltNetHispano.Agendas.Repositories.Memory; +using Moq; +using NUnit.Framework; + +namespace AltNetHispano.Agendas.Tests.Blog +{ + [TestFixture] + public class PublicadorTests + { + [SetUp] + public void SetearUsuario() + { + var seguridad = new Mock<ISeguridad>(); + seguridad.Setup(s => s.GetUserName()).Returns("neluz"); + IdentityContext.Init(seguridad.Object, new PersonaRepository()); + } + + [Test] + public void El_publicador_debe_disparar_los_writers_segun_la_accion_de_cada_track() + { + //var eventoAgendar = Evento.Agendar(null, null, DateTime.MinValue, null); + //var eventoPublicar = Evento.Agendar(null, null, DateTime.MinValue, null); + + var trackAgendar = new Track(null, Accion.Agendar); + var trackPublicar = new Track(null, Accion.Publicar); + + var agendarPostWriter = new Mock<IPostWriter>(); + agendarPostWriter.Setup(writer => writer.WritePost(trackAgendar)); + + var publicarPostWriter = new Mock<IPostWriter>(); + publicarPostWriter.Setup(writer => writer.WritePost(trackPublicar)); + + var factory = new Mock<IPostWriterFactory>(); + factory.Setup(f => f.GetPostWriter(Accion.Agendar)).Returns(agendarPostWriter.Object); + factory.Setup(f => f.GetPostWriter(Accion.Publicar)).Returns(publicarPostWriter.Object); + + var publicador = new BlogPublicador(factory.Object); + publicador.Publicar(new List<Track> + { + trackAgendar, + trackPublicar + }); + + factory.Verify(f => f.GetPostWriter(Accion.Agendar), Times.Once()); + factory.Verify(f => f.GetPostWriter(Accion.Publicar), Times.Once()); + + agendarPostWriter.Verify(pw => pw.WritePost(trackAgendar), Times.Once()); + publicarPostWriter.Verify(pw => pw.WritePost(trackPublicar), Times.Once()); + } + } +}
--- a/Agendas/trunk/src/Agendas.Tests/Cruds/EventoCrud.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Tests/Cruds/EventoCrud.cs Tue Jun 07 23:21:07 2011 -0300 @@ -27,7 +27,7 @@ var ponente = new Persona("Carlos Blé"); _personaRepository.Save(ponente); - var evento = Evento.Proponer("TDD - Diseño Basado en Ejemplos", ponente, string.Empty); + var evento = Evento.Proponer("TDD - Diseño Basado en Ejemplos", ponente, string.Empty, TipoEvento.Van); _eventoRepository.Save(evento); return evento.Id;
--- a/Agendas/trunk/src/Agendas.Tests/PonentesTests.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Tests/PonentesTests.cs Tue Jun 07 23:21:07 2011 -0300 @@ -20,10 +20,10 @@ var agenda = new Agenda(publicador.Object, DefaultEventoRepository, DefaultPersonaRepository); - agenda.Agendar("Audit (parallel model) con NHibernate 3", "Fabio Maulo", new DateTime(2011, 2, 26), - urlInvitacion); + agenda.Agendar("Audit (parallel model) con NHibernate 3", "Fabio Maulo", new DateTime(2011, 2, 26), + urlInvitacion, TipoEvento.Van); agenda.Agendar("Conform - Parte 2", "Fabio Maulo", new DateTime(2011, 3, 5), - urlInvitacion); + urlInvitacion, TipoEvento.Van); var eventos = agenda.GetEventosAgendados(); Assert.AreEqual(2, eventos.Count); @@ -49,7 +49,7 @@ agenda.RegistrarPonente("Fabio Maulo", "fabiomaulo@gmail.com", "@fabiomaulo", "http://fabiomaulo.blogspot.com"); - agenda.Agendar("Audit (parallel model) con NHibernate 3", "Fabio Maulo", new DateTime(2011, 2, 26), urlInvitacion); + agenda.Agendar("Audit (parallel model) con NHibernate 3", "Fabio Maulo", new DateTime(2011, 2, 26), urlInvitacion, TipoEvento.Van); Assert.AreEqual(1, agenda.GetEventosAgendados().Count); @@ -73,7 +73,7 @@ var agenda = new Agenda(publicador.Object, DefaultEventoRepository, DefaultPersonaRepository); agenda.Agendar("Audit (parallel model) con NHibernate 3", "Fabio Maulo", new DateTime(2011, 2, 26), - urlInvitacion); + urlInvitacion, TipoEvento.Van); Assert.AreEqual(1, agenda.GetEventosAgendados().Count); @@ -92,7 +92,7 @@ const string titulo = "Audit (parallel model) con NHibernate 3"; Guid eventoId; - agenda.Proponer(titulo, "Fabio", urlInvitacion); + agenda.Proponer(titulo, "Fabio", urlInvitacion, TipoEvento.Van); Persona persona; { var eventos = agenda.GetEventosPropuestos(); @@ -123,7 +123,7 @@ const string titulo = "Audit (parallel model) con NHibernate 3"; Guid eventoId; - agenda.Proponer(titulo, "Fabio", urlInvitacion); + agenda.Proponer(titulo, "Fabio", urlInvitacion, TipoEvento.Van); { var eventos = agenda.GetEventosPropuestos(); Assert.AreEqual(1, eventos.Count);
--- a/Agendas/trunk/src/Agendas.Tests/PropuestasTests.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Tests/PropuestasTests.cs Tue Jun 07 23:21:07 2011 -0300 @@ -19,7 +19,7 @@ { var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository); - agenda.Proponer("Van", null, urlInvitacion); + agenda.Proponer("Van", null, urlInvitacion, TipoEvento.Van); { IList<Evento> eventosPropuestos = agenda.GetEventosPropuestos(); IList<Evento> eventosPublicados = agenda.GetEventosAgendados(); @@ -38,7 +38,7 @@ Assert.AreEqual("otro ponente", evento.Ponente.Nombre); } - var r = agenda.Agendar("Van 2", "jjmontes", DateTime.Now, urlInvitacion); + var r = agenda.Agendar("Van 2", "jjmontes", DateTime.Now, urlInvitacion, TipoEvento.Van); Assert.IsTrue(r.Succeful); { IList<Evento> eventosPropuestos = agenda.GetEventosPropuestos(); @@ -55,14 +55,14 @@ var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository); { - agenda.Proponer("Van propuesta", null, urlInvitacion); + agenda.Proponer("Van propuesta", null, urlInvitacion, TipoEvento.Van); } { var van = agenda.GetEventosPropuestos().FirstOrDefault(); Assert.IsNotNull(van); var r = agenda.Agendar(van.Titulo, "Ponente", null, - urlInvitacion); + urlInvitacion, TipoEvento.Van); Assert.IsFalse(r.Succeful); } } @@ -73,7 +73,7 @@ var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository); { - agenda.Proponer("Van propuesta", null, urlInvitacion); + agenda.Proponer("Van propuesta", null, urlInvitacion, TipoEvento.Van); } { @@ -82,7 +82,7 @@ van.Actualizar(null, DateTime.Today.AddDays(5), urlInvitacion); var r = agenda.Agendar(van.Titulo, string.Empty, van.Fecha, - urlInvitacion); + urlInvitacion, TipoEvento.Van); Assert.IsFalse(r.Succeful); } } @@ -104,7 +104,7 @@ var agenda = new Agenda(null, repository.Object, DefaultPersonaRepository); - var r = agenda.Proponer(string.Empty, null, urlInvitacion); + var r = agenda.Proponer(string.Empty, null, urlInvitacion, TipoEvento.Van); Assert.IsFalse(r.Succeful); repository.Verify(p => p.Save(It.IsAny<Evento>()), Times.Exactly(0)); @@ -117,14 +117,14 @@ SetCurrentUser(null, null); - Assert.Throws<UsuarioNoAutenticadoException>(() => agenda.Proponer("Inmortalidad de la meduza.", null, urlInvitacion)); + Assert.Throws<UsuarioNoAutenticadoException>(() => agenda.Proponer("Inmortalidad de la meduza.", null, urlInvitacion, TipoEvento.Van)); } [Test] public void Proponer_evento_correctamente() { var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository); - agenda.Proponer("Van propuesta", null, urlInvitacion); + agenda.Proponer("Van propuesta", null, urlInvitacion, TipoEvento.Van); IList<Evento> eventosPropuestos = agenda.GetEventosPropuestos(); Assert.IsNotNull(eventosPropuestos); @@ -137,9 +137,9 @@ { var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository); - agenda.Proponer("Van propuesta", null, urlInvitacion); + agenda.Proponer("Van propuesta", null, urlInvitacion, TipoEvento.Van); var r = agenda.Agendar("Van publicada", "jjmontes", DateTime.Now, - urlInvitacion); + urlInvitacion, TipoEvento.Van); Assert.IsTrue(r.Succeful); IList<Evento> eventosPropuestos = agenda.GetEventosPropuestos();
--- a/Agendas/trunk/src/Agendas.Tests/TrackTests.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Tests/TrackTests.cs Tue Jun 07 23:21:07 2011 -0300 @@ -18,7 +18,7 @@ var agenda = new Agenda(null, repository, DefaultPersonaRepository); var fecha = DateTime.Now.AddDays(5); - agenda.Agendar("Html 5", "jjmontes", fecha, urlInvitacion); + agenda.Agendar("Html 5", "jjmontes", fecha, urlInvitacion, TipoEvento.Van); var evento = repository.GetEventosConFecha().First(); Assert.AreEqual(1, evento.Tracks.Count()); @@ -53,7 +53,7 @@ var agenda = new Agenda(null, repository, DefaultPersonaRepository); agenda.Agendar("Html 5", "jjmontes", DateTime.Now, - urlInvitacion); + urlInvitacion, TipoEvento.Van); var evento = repository.GetEventosConFecha().First(); Assert.AreEqual(1, evento.Tracks.Count());
--- a/Agendas/trunk/src/Agendas.Tests/Workflows/Workflow.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Tests/Workflows/Workflow.cs Tue Jun 07 23:21:07 2011 -0300 @@ -17,14 +17,14 @@ public void Proponer() { - var resultado = _agenda.Proponer("SOLID", "Jorge", null); + var resultado = _agenda.Proponer("SOLID", "Jorge", null, TipoEvento.Van); Assert.IsTrue(resultado.Succeful); } public void Agendar() { - var resultado = _agenda.Agendar("SOLID", "Jorge", DateTime.Today.AddDays(5), null); + var resultado = _agenda.Agendar("SOLID", "Jorge", DateTime.Today.AddDays(5), null, TipoEvento.Van); Assert.IsTrue(resultado.Succeful); } @@ -36,7 +36,7 @@ public void Publicar(Guid eventoId) { - var resultado = _agenda.Publicar(eventoId); + var resultado = _agenda.Publicar(eventoId, 0, string.Empty); Assert.IsTrue(resultado.Succeful); } }
--- a/Agendas/trunk/src/Agendas.Twitter.Tests/Send_twitt_tests.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Twitter.Tests/Send_twitt_tests.cs Tue Jun 07 23:21:07 2011 -0300 @@ -19,7 +19,7 @@ var p = new TwitterPublicador(); string message; - var r = p.Publicar("Hello, #Twitterizer", out message); + var r = p.Publicar("Hello, #Twitterizer. Hora: " + DateTime.Now, out message); Console.WriteLine(message); Assert.IsTrue(r);
--- a/Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj Tue Jun 07 23:21:07 2011 -0300 @@ -75,6 +75,7 @@ <Compile Include="IdentityHelper.cs" /> <Compile Include="Models\AccountModels.cs" /> <Compile Include="Models\EventoModel.cs" /> + <Compile Include="Models\EventoModelHelper.cs" /> <Compile Include="Models\PropuestaModel.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Services\AccountMembershipService.cs" />
--- a/Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs Tue Jun 07 23:21:07 2011 -0300 @@ -1,80 +1,82 @@ using System; using System.Linq; using System.Web.Mvc; +using AltNetHispano.Agendas.Domain; using AltNetHispano.Agendas.Factories; using AltNetHispano.Agendas.Web.Models; namespace AltNetHispano.Agendas.Web.Controllers { - public class EventoController : Controller + public class EventoController : Controller + { + public ActionResult Index() { - public ActionResult Index() - { - var agenda = AgendaFactory.GetAgenda(); + var agenda = AgendaFactory.GetAgenda(); + + var model = new EventoIndexModel + { + ProximosEventos = from e in agenda.GetEventosAgendados() + orderby e.Fecha + select new EventoDto { Id = e.Id.ToString(), Titulo = e.Titulo, Fecha = e.Fecha.Value } + }; - var model = new EventoIndexModel - { - ProximosEventos = from e in agenda.GetEventosAgendados() orderby e.Fecha - select new EventoDto { Id = e.Id.ToString(), Titulo = e.Titulo, Fecha = e.Fecha.Value } - }; - - return View(model); - } + return View(model); + } - [Authorize] - public ActionResult New() - { - return View(); - } + [Authorize] + public ActionResult New() + { + return View(new EventoNewModel()); + } - [HttpPost] - [Authorize] - public ActionResult New(EventoNewModel model) - { - if (ModelState.IsValid) - { - var agenda = AgendaFactory.GetAgenda(); + [HttpPost] + [Authorize] + public ActionResult New(EventoNewModel model) + { + if (ModelState.IsValid) + { + var agenda = AgendaFactory.GetAgenda(); - var r = agenda.Agendar(model.Titulo, model.Ponente, model.Fecha, - model.UrlInvitacion); - if (r.Succeful) - return RedirectToAction("Index"); - ModelState.AddModelError("error", r.ToString()); - } - return View(model); - } + var r = agenda.Agendar(model.Titulo, model.Ponente, model.Fecha, + model.UrlInvitacion, (TipoEvento)model.Tipo); + if (r.Succeful) + return RedirectToAction("Index"); + ModelState.AddModelError("error", r.ToString()); + } + return View(model); + } - [Authorize] - public ActionResult Edit(string id) - { - var agenda = AgendaFactory.GetAgenda(); - var evento = agenda.GetEvento(new Guid(id)); - - var model = new EventoEditModel - { - Id = id, - Titulo = evento.Titulo, - Ponente = evento.Ponente != null ? evento.Ponente.Nombre : string.Empty, - Fecha = evento.Fecha, + [Authorize] + public ActionResult Edit(string id) + { + var agenda = AgendaFactory.GetAgenda(); + var evento = agenda.GetEvento(new Guid(id)); + + var model = new EventoEditModel + { + Id = id, + Titulo = evento.Titulo, + Ponente = evento.Ponente != null ? evento.Ponente.Nombre : string.Empty, + Fecha = evento.Fecha, UrlInvitacion = evento.UrlInvitacion - }; - return View(model); - } + }; + return View(model); + } - [HttpPost] - [Authorize] - public ActionResult Edit(EventoEditModel model) - { - if (ModelState.IsValid) - { - var agenda = AgendaFactory.GetAgenda(); + [HttpPost] + [Authorize] + public ActionResult Edit(EventoEditModel model) + { + if (ModelState.IsValid) + { + var agenda = AgendaFactory.GetAgenda(); - var r =agenda.ModificarEvento(new Guid(model.Id), model.Titulo, model.Ponente, model.Fecha.Value , model.UrlInvitacion); - if (r.Succeful) - return RedirectToAction("Index"); - ModelState.AddModelError("error", r.ToString()); - } - return View(model); - } + var r = agenda.ModificarEvento(new Guid(model.Id), model.Titulo, model.Ponente, model.Fecha.Value, model.UrlInvitacion); + if (r.Succeful) + return RedirectToAction("Index"); + ModelState.AddModelError("error", r.ToString()); + } + return View(model); } + } }
--- a/Agendas/trunk/src/Agendas.Web/Controllers/PropuestaController.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Controllers/PropuestaController.cs Tue Jun 07 23:21:07 2011 -0300 @@ -1,6 +1,7 @@ using System; using System.Linq; using System.Web.Mvc; +using AltNetHispano.Agendas.Domain; using AltNetHispano.Agendas.Factories; using AltNetHispano.Agendas.Web.Models; @@ -30,7 +31,7 @@ [Authorize] public ActionResult New() { - return View(); + return View(new PropuestaNewModel()); } [HttpPost] @@ -41,7 +42,7 @@ { var agenda = AgendaFactory.GetAgenda(); - var r = agenda.Proponer(model.Titulo, model.Ponente, model.UrlInvitacion); + var r = agenda.Proponer(model.Titulo, model.Ponente, model.UrlInvitacion, (TipoEvento)model.Tipo); if (r.Succeful) return RedirectToAction("Index"); ModelState.AddModelError("error", r.ToString());
--- a/Agendas/trunk/src/Agendas.Web/Models/EventoModel.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Models/EventoModel.cs Tue Jun 07 23:21:07 2011 -0300 @@ -6,49 +6,65 @@ namespace AltNetHispano.Agendas.Web.Models { - public class EventoIndexModel - { - public IEnumerable<EventoDto> ProximosEventos { get; set; } - } + public class EventoIndexModel + { + public IEnumerable<EventoDto> ProximosEventos { get; set; } + } - public class EventoNewModel + public class EventoNewModel + { + public EventoNewModel() { - [Required] - public string Titulo { get; set; } - - [Required] - public string Ponente { get; set; } - - [Required] - public DateTime Fecha { get; set; } - - [Url] - public string UrlInvitacion { get; set; } + Tipos = EventoModelHelper.GetTiposEventos(); } - public class EventoEditModel - { - [HiddenInput(DisplayValue = false)] - public string Id { get; set; } + [Required] + public int Tipo { get; set; } + + [Required] + public string Titulo { get; set; } + + [Required] + public string Ponente { get; set; } + + [Required] + public DateTime Fecha { get; set; } - [Required] - public string Titulo { get; set; } + [Url] + public string UrlInvitacion { get; set; } + + public IEnumerable<TipoEventoModel> Tipos { get; private set; } + } - [Required] - public string Ponente { get; set; } + public class TipoEventoModel + { + public int TipoEvento { get; set; } + public string TipoEventoStr { get; set; } + } - [Required] - public DateTime? Fecha { get; set; } + public class EventoEditModel + { + [HiddenInput(DisplayValue = false)] + public string Id { get; set; } - [Url] - public string UrlInvitacion { get; set; } - } - + [Required] + public string Titulo { get; set; } + + [Required] + public string Ponente { get; set; } - public class EventoDto - { - public string Id { get; set; } - public string Titulo { get; set; } - public DateTime Fecha { get; set; } - } + [Required] + public DateTime? Fecha { get; set; } + + [Url] + public string UrlInvitacion { get; set; } + } + + + public class EventoDto + { + public string Id { get; set; } + public string Titulo { get; set; } + public DateTime Fecha { get; set; } + } } \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Web/Models/EventoModelHelper.cs Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,19 @@ +using System.Collections.Generic; +using AltNetHispano.Agendas.Domain; + +namespace AltNetHispano.Agendas.Web.Models +{ + public static class EventoModelHelper + { + public static IEnumerable<TipoEventoModel> GetTiposEventos() + { + var tipos = new List<TipoEventoModel> + { + new TipoEventoModel {TipoEvento = (int) TipoEvento.Van, TipoEventoStr = "VAN"}, + new TipoEventoModel {TipoEvento = (int) TipoEvento.Cafe, TipoEventoStr = "ALT.NET Cafe"}, + new TipoEventoModel {TipoEvento = (int) TipoEvento.GrupoEstudio, TipoEventoStr = "Grupo Estudio"} + }; + return tipos; + } + } +} \ No newline at end of file
--- a/Agendas/trunk/src/Agendas.Web/Models/PropuestaModel.cs Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Models/PropuestaModel.cs Tue Jun 07 23:21:07 2011 -0300 @@ -5,41 +5,51 @@ namespace AltNetHispano.Agendas.Web.Models { - public class PropuestaIndexModel + public class PropuestaIndexModel + { + public IEnumerable<PropuestaDto> Propuestas { get; set; } + } + + public class PropuestaNewModel + { + public PropuestaNewModel() { - public IEnumerable<PropuestaDto> Propuestas { get; set; } + Tipos = EventoModelHelper.GetTiposEventos(); } - public class PropuestaNewModel - { - [Required] - public string Titulo { get; set; } + [Required] + public int Tipo { get; set; } - public string Ponente { get; set; } + [Required] + public string Titulo { get; set; } - [Url] - public string UrlInvitacion { get; set; } - } + public string Ponente { get; set; } - public class PropuestaEditModel - { - [HiddenInput(DisplayValue = false)] - public string Id { get; set; } + [Url] + public string UrlInvitacion { get; set; } + + public IEnumerable<TipoEventoModel> Tipos { get; private set; } + } - [Required] - public string Titulo { get; set; } + public class PropuestaEditModel + { + [HiddenInput(DisplayValue = false)] + public string Id { get; set; } - public string Ponente { get; set; } + [Required] + public string Titulo { get; set; } + + public string Ponente { get; set; } - [Url] - public string UrlInvitacion { get; set; } - } - + [Url] + public string UrlInvitacion { get; set; } + } + - public class PropuestaDto - { - public string Id { get; set; } - public string Titulo { get; set; } - public string Ponente { get; set; } - } + public class PropuestaDto + { + public string Id { get; set; } + public string Titulo { get; set; } + public string Ponente { get; set; } + } } \ No newline at end of file
--- a/Agendas/trunk/src/Agendas.Web/Views/Evento/New.cshtml Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Views/Evento/New.cshtml Tue Jun 07 23:21:07 2011 -0300 @@ -22,7 +22,47 @@ <div> <fieldset> <legend>Datos del evento:</legend> - @Html.EditorForModel() + + <div class="editor-label"> + @Html.LabelFor(model=>model.Tipo) + </div> + <div class="editor-field"> + @Html.DropDownListFor(model => model.Tipo, new SelectList(Model.Tipos, "TipoEvento", "TipoEventoStr")) + @Html.ValidationMessageFor(model => model.Tipo) + </div> + + <div class="editor-label"> + @Html.LabelFor(model=>model.Titulo) + </div> + <div class="editor-field"> + @Html.EditorFor(model=>model.Titulo) + @Html.ValidationMessageFor(model => model.Titulo) + </div> + + <div class="editor-label"> + @Html.LabelFor(model=>model.Ponente) + </div> + <div class="editor-field"> + @Html.EditorFor(model=>model.Ponente) + @Html.ValidationMessageFor(model => model.Ponente) + </div> + + <div class="editor-label"> + @Html.LabelFor(model=>model.Fecha) + </div> + <div class="editor-field"> + @Html.EditorFor(model=>model.Fecha) + @Html.ValidationMessageFor(model => model.Fecha) + </div> + + <div class="editor-label"> + @Html.LabelFor(model=>model.UrlInvitacion) + </div> + <div class="editor-field"> + @Html.EditorFor(model => model.UrlInvitacion) + @Html.ValidationMessageFor(model => model.UrlInvitacion) + </div> + <p> <input type="submit" value="Guardar" /> </p>
--- a/Agendas/trunk/src/Agendas.Web/Views/Propuesta/New.cshtml Tue Jun 07 23:07:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Views/Propuesta/New.cshtml Tue Jun 07 23:21:07 2011 -0300 @@ -13,7 +13,39 @@ <div> <fieldset> <legend>Datos de la propuesta:</legend> - @Html.EditorForModel() + + <div class="editor-label"> + @Html.LabelFor(model=>model.Tipo) + </div> + <div class="editor-field"> + @Html.DropDownListFor(model => model.Tipo, new SelectList(Model.Tipos, "TipoEvento", "TipoEventoStr")) + @Html.ValidationMessageFor(model => model.Tipo) + </div> + + <div class="editor-label"> + @Html.LabelFor(model=>model.Titulo) + </div> + <div class="editor-field"> + @Html.EditorFor(model=>model.Titulo) + @Html.ValidationMessageFor(model => model.Titulo) + </div> + + <div class="editor-label"> + @Html.LabelFor(model=>model.Ponente) + </div> + <div class="editor-field"> + @Html.EditorFor(model=>model.Ponente) + @Html.ValidationMessageFor(model => model.Ponente) + </div> + + <div class="editor-label"> + @Html.LabelFor(model=>model.UrlInvitacion) + </div> + <div class="editor-field"> + @Html.EditorFor(model => model.UrlInvitacion) + @Html.ValidationMessageFor(model => model.UrlInvitacion) + </div> + <p> <input type="submit" value="Guardar" /> </p>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PostWriterWebService blog/PostWriterWebService.asmx Tue Jun 07 23:21:07 2011 -0300 @@ -0,0 +1,93 @@ +<%@ WebService Language="C#" Class="PostWriterWebService" %> + +using System; +using System.Configuration; +using System.Globalization; +using System.Linq; +using System.Security.Cryptography; +using System.Web; +using System.Web.Services; +using System.Web.Services.Protocols; +using Telerik.Blogs; + +[WebService(Namespace = "http://tempuri.org/")] +[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] +// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. +// [System.Web.Script.Services.ScriptService] +public class PostWriterWebService : System.Web.Services.WebService { + + [WebMethod] + public void WriteBlogPost(string securityToken, string blogName, string postTitle, string postHtmlContent, string postAuthor, bool setPublicationDate) + { + checkSecurityToken(securityToken); + writePost(blogName, postTitle, postHtmlContent, postAuthor, setPublicationDate); + } + + private void checkSecurityToken(string securityToken) + { + if (string.IsNullOrEmpty(securityToken)) throw new ArgumentNullException("securityToken"); + + var now = DateTime.UtcNow; + now = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, 0, 0); + + var masterKey = System.Configuration.ConfigurationManager.AppSettings["BlogWriterMasterKey"]; + if (string.IsNullOrEmpty(masterKey)) + throw new Exception("Master key not found"); + + var token1 = buildToken(masterKey, now.AddMinutes(-1)); + var token2 = buildToken(masterKey, now); + var token3 = buildToken(masterKey, now.AddMinutes(1)); + + if (!securityToken.Equals(token1) && !securityToken.Equals(token2) && !securityToken.Equals(token3)) + throw new Exception("Invalid security token"); + } + + private string buildToken(string key, DateTime time) + { + var aux = key + time.ToString(CultureInfo.InvariantCulture); + + var enc = System.Text.Encoding.ASCII.GetEncoder(); + + var data = new byte[aux.Length]; + enc.GetBytes(aux.ToCharArray(), 0, aux.Length, data, 0, true); + + var md5 = new MD5CryptoServiceProvider(); + var result = md5.ComputeHash(data); + + return BitConverter.ToString(result).Replace("-", "").ToLower(); + } + + private void writePost(string blogName, string postTitle, string postHtmlContent, string postAuthor, bool setPublicationDate) + { + if (string.IsNullOrEmpty(blogName)) throw new ArgumentNullException("blogName"); + if (string.IsNullOrEmpty(postTitle)) throw new ArgumentNullException("postTitle"); + if (string.IsNullOrEmpty(postHtmlContent)) throw new ArgumentNullException("postHtmlContent"); + if (string.IsNullOrEmpty(postAuthor)) throw new ArgumentNullException("postAuthor"); + + try + { + var manager = new BlogManager(); + + var blogs = manager.GetBlogs(); + var blog = (blogs.Cast<IBlog>()).SingleOrDefault(b => b.Name.Equals(blogName)); + + if (blog == null) + throw new Exception(string.Format("Blog '{0}' no encontrado", blogName)); + + var postContent = manager.Content.CreateContent("text/html"); + + postContent.ParentID = blog.ID; + postContent.Content = postHtmlContent; + postContent.SetMetaData("Author", postAuthor); + postContent.SetMetaData("Title", postTitle); + if (setPublicationDate) + postContent.SetMetaData("Publication_Date", DateTime.Now); + + manager.Content.SaveContent(postContent); + } + catch (Exception e) + { + throw new Exception("Ocurrio un error creando el post", e); + } + } +} \ No newline at end of file