Example #1
0
        public void CreateReview(string domainKey, string threadType, Guid itemId, string itemTitle, string message, decimal?rating, string status)
        {
            var cs          = SystemManager.GetCommentsService();
            var authorProxy = new AuthorProxy(ClaimsManager.GetCurrentUserId().ToString());

            var domainProxy = new GroupProxy("TestDomain", "TestDomainDescription", authorProxy)
            {
                Key = domainKey
            };

            cs.CreateGroup(domainProxy);

            var culture = this.GetCurrentCulture();

            var threadProxy = new ThreadProxy(itemTitle, threadType, domainKey, authorProxy)
            {
                Key = itemId.ToString() + "_" + culture + "_review", Language = culture
            };
            var thread = cs.CreateThread(threadProxy);

            DateTime dateCreated = DateTime.UtcNow.AddMinutes(5);

            var commentProxy = new CommentProxy(message, thread.Key, authorProxy, SystemManager.CurrentHttpContext.Request.UserHostAddress, rating)
            {
                Status = status, DateCreated = dateCreated
            };

            cs.CreateComment(commentProxy);
        }
        private void MapToEntity(AuthorProxy proxy, Author entity)
        {
            var deceased = !string.IsNullOrWhiteSpace(proxy.DateOfDeath);

            entity.FirstName   = proxy.FirstName;
            entity.LastName    = proxy.LastName;
            entity.DateOfBirth = DateTime.Parse(proxy.DateOfBirth);
            entity.DateOfDeath = deceased ? DateTime.Parse(proxy.DateOfDeath) : (DateTime?)null;
            entity.NobelPrize  = proxy.NobelPrize.Value;
        }
Example #3
0
        private IThread GetCommentsThreadProxy(string threadTitle)
        {
            var author = new AuthorProxy(SecurityManager.GetCurrentUserId().ToString());

            return(new ThreadProxy(threadTitle, this.ThreadType, this.GroupKey, author)
            {
                IsClosed = false,
                Key = this.ThreadKey,
                DataSource = this.DataSource
            });
        }
Example #4
0
        public void Test_Lazy_Initialization()
        {
            Book   book   = bookDao.FindById(1);
            Author author = authorDao.FindById(1);

            // check if both obtained instances are proxies

            Assert.IsTrue(book is BookProxy);
            Assert.IsTrue(author is AuthorProxy);

            // check if both proxies have uninitialized collections

            BookProxy   bookProxy   = (BookProxy)book;
            AuthorProxy authorProxy = (AuthorProxy)author;

            Assert.IsFalse(bookProxy.AuthorsAreFetchedOrSet);
            Assert.IsFalse(authorProxy.BooksAreFetchedOrSet);

            // initialize collection of authors

            Console.WriteLine();

            foreach (Author a in book.Authors)
            {
                Console.WriteLine($"First Name: {a.FirstName}, LastName: {a.LastName}");
            }

            Console.WriteLine();

            foreach (Book b in author.Books)
            {
                Console.WriteLine($"Id: {b.Id}, Title: {b.Title}");
            }

            Console.WriteLine();

            // check if object inside collection is also proxy

            var authors = new List <Author>(book.Authors);
            var books   = new List <Book>(author.Books);

            Author a1 = authors[1];
            Book   b1 = books[0];

            Assert.IsTrue(a1 is AuthorProxy);
            Assert.IsTrue(b1 is BookProxy);

            authorProxy = (AuthorProxy)a1;
            bookProxy   = (BookProxy)b1;

            Assert.IsFalse(authorProxy.BooksAreFetchedOrSet);
            Assert.IsFalse(bookProxy.AuthorsAreFetchedOrSet);
        }
        public async Task UpdateAuthorAsync(int id, AuthorProxy author)
        {
            Validate(author);

            var entity = await GetByIdAsync(id);

            await ValidateUniqueness(author.FirstName, author.LastName, id);

            MapToEntity(author, entity);

            await _repository.SaveChangesAsync();
        }
        public async Task <IdResponse> CreateAuthorAsync(AuthorProxy author)
        {
            Validate(author);

            await ValidateUniqueness(author.FirstName, author.LastName, null);

            var entity = new Author();

            MapToEntity(author, entity);

            var id = await _repository.AddAsync(entity);

            return(new IdResponse(id));
        }
        public void CreateReview(string domainKey, string threadType, Guid itemId, string itemTitle, string message, decimal? rating, string status)
        {
            var cs = SystemManager.GetCommentsService();
            var authorProxy = new AuthorProxy(ClaimsManager.GetCurrentUserId().ToString());

            var domainProxy = new GroupProxy("TestDomain", "TestDomainDescription", authorProxy) { Key = domainKey };
            cs.CreateGroup(domainProxy);

            var threadProxy = new ThreadProxy(itemTitle, threadType, domainKey, authorProxy) { Key = itemId.ToString() + "_en_review", Language = "en" };
            var thread = cs.CreateThread(threadProxy);

            DateTime dateCreated = DateTime.UtcNow.AddMinutes(5);

            var commentProxy = new CommentProxy(message, thread.Key, authorProxy, SystemManager.CurrentHttpContext.Request.UserHostAddress, rating)
                                { Status = status, DateCreated = dateCreated };
            cs.CreateComment(commentProxy);
        }
        private void Validate(AuthorProxy author)
        {
            if (author == null)
            {
                ThrowHttp.BadRequest(ErrorMessage.AUTHOR_REQUIRED);
            }

            if (string.IsNullOrWhiteSpace(author.FirstName))
            {
                ThrowHttp.BadRequest(ErrorMessage.FIRST_NAME_REQUIRED);
            }

            if (string.IsNullOrWhiteSpace(author.LastName))
            {
                ThrowHttp.BadRequest(ErrorMessage.LAST_NAME_REQUIRED);
            }

            if (!author.NobelPrize.HasValue)
            {
                ThrowHttp.BadRequest(ErrorMessage.NOBEL_PRIZE_REQUIRED);
            }

            var dateOfBirthError = _dateValidator.Validate(author.DateOfBirth);

            if (dateOfBirthError != null)
            {
                ThrowHttp.BadRequest(dateOfBirthError);
            }

            if (string.IsNullOrWhiteSpace(author.DateOfDeath))
            {
                return;
            }

            var dateOfDeathError = _dateValidator.Validate(author.DateOfDeath);

            if (dateOfDeathError != null)
            {
                ThrowHttp.BadRequest(dateOfDeathError);
            }
        }
Example #9
0
        public Author Parse(XmlNode authorNode)
        {
            if (authorNode is null)
            {
                throw new ArgumentException("authorNode cannot be null");
            }

            var id        = int.Parse(authorNode.Attributes["id"].Value);
            var firstName = authorNode.SelectSingleNode("./firstName")
                            ?.FirstChild.Value;

            var lastName = authorNode.SelectSingleNode("./lastName")
                           ?.FirstChild.Value;

            var proxy = new AuthorProxy(id, firstName, lastName)
            {
                BookDao = this.BookDao
            };

            return(proxy);
        }
Example #10
0
        public static void CreateBlogPostComment(Guid blogPostId, GenericPostComment comment)
        {
            BlogPost blogPost = SFBlogsManager.GetBlogPost(blogPostId);

            var cs        = SystemManager.GetCommentsService();
            var language  = Thread.CurrentThread.CurrentUICulture.Name;
            var threadKey = ControlUtilities.GetLocalizedKey(blogPostId, language);

            var commentAuthor = new AuthorProxy(comment.Author, comment.AuthorEmail);

            EnsureBlogPostThreadExists(threadKey, commentAuthor, blogPost.Title, SFBlogsManager, language, cs);

            var commentProxy = new CommentProxy(comment.Content, threadKey, commentAuthor, comment.AuthorIP);

            commentProxy.Status = StatusConstants.Published;

            var newComment = cs.CreateComment(commentProxy);

            newComment.DateCreated  = comment.CommentDateGMT;
            newComment.LastModified = comment.CommentDateGMT;

            cs.UpdateComment(newComment);
        }
Example #11
0
        public static void CreateBlogPostComment(Guid blogPostId, GenericPostComment comment)
        {
            BlogPost blogPost = SFBlogsManager.GetBlogPost(blogPostId);

            var cs = SystemManager.GetCommentsService();
            var language = Thread.CurrentThread.CurrentUICulture.Name;
            var threadKey = ControlUtilities.GetLocalizedKey(blogPostId, language);

            var commentAuthor = new AuthorProxy(comment.Author, comment.AuthorEmail);

            EnsureBlogPostThreadExists(threadKey, commentAuthor, blogPost.Title, SFBlogsManager, language, cs);

            var commentProxy = new CommentProxy(comment.Content, threadKey, commentAuthor, comment.AuthorIP);

            commentProxy.Status = StatusConstants.Published;

            var newComment = cs.CreateComment(commentProxy);

            newComment.DateCreated = comment.CommentDateGMT;
            newComment.LastModified = comment.CommentDateGMT;

            cs.UpdateComment(newComment);
        }
        public async Task <ActionResult> UpdateAsync(int id, AuthorProxy author)
        {
            await _authorModel.UpdateAuthorAsync(id, author);

            return(Ok());
        }
        public async Task <ActionResult> CreateAsync(AuthorProxy author)
        {
            var response = await _authorModel.CreateAuthorAsync(author);

            return(StatusCode(HttpStatusCode.CREATED, response));
        }
        private void CreateBlogPosts()
        {
            List<string> cultures = new List<string>() { "en", "de" };
            var result = SampleUtilities.CreateLocalizedBlog(new Guid(SampleConstants.TIUBlogId), "TIU Blog", "TIU Blog", cultures);
            Guid userId = SampleUtilities.GetUserIdByUserName("admin");

            if (result)
            {
                // Blog post 1
                var id = Guid.NewGuid();
                var title = "International Understanding and Cooperation";
                var content = @"<p>The TIU Museum, like so many encyclopaedic museums, plays a critical role in fostering international understanding and cooperation. The Museum accomplishes this through insightful exhibitions, collaborating with community partners and sharing expertise and experience with international colleagues. The Cultures collection frequently forms the basis of this work as the 17,000 objects are evidence of intercultural engagement from the 19<sup>th</sup> century onwards.</p><p>Most recently the Museum hosted 3 curators who were participants on the International Training Programme as coordinated by the Bulgarian Museum. The Museum collaborates with the Bulgarian Museum on this programme each year as the chance to converse with international colleagues is invaluable. This years curators were especially interested in the use of post-colonial critique in the Museum&rsquo;s approach to community engagement, exhibition development and the Cultures collection.&nbsp;</p>";

                SampleUtilities.CreateLocalizedBlogPost(id, new Guid(SampleConstants.TIUBlogId), title, content, null, userId, null, null, "en");

                title = @"Internationale Verständigung und Zusammenarbeit";
                content = @"<p>Die TIU Museum, wie so viele enzyklop&auml;dische Museen, spielt eine entscheidende Rolle bei der F&ouml;rderung internationaler Verst&auml;ndigung und Zusammenarbeit. Das Museum erreicht dies durch aufschlussreiche Ausstellungen, die Zusammenarbeit mit kommunalen Partnern und Austausch von Fachwissen und Erfahrung mit internationalen Kollegen. Die Kulturen der Sammlung bildet h&auml;ufig die Grundlage dieser Arbeit, wie die 17.000 Objekte Beweis f&uuml;r interkulturelles Engagement aus dem 19. Jahrhundert sind. </p> <p>In j&uuml;ngster Zeit das Museum gehostet 3 Kuratoren, die Teilnehmer auf dem International Training, wie es von der bulgarischen Museum koordiniert wurden. Das Museum arbeitet mit dem bulgarischen Museum &uuml;ber dieses Programm jedes Jahr die Chance, mit internationalen Kollegen zu unterhalten ist von unsch&auml;tzbarem Wert. In diesem Jahr Kuratoren waren besonders daran interessiert, den Einsatz von postkolonialen Kritik in das Museum der Ansatz, um gesellschaftliches Engagement, Ausstellung Entwicklung und die Kulturen der Sammlung.</p>";

                SampleUtilities.CreateLocalizedBlogPost(id, new Guid(SampleConstants.TIUBlogId), title, content, null, userId, null, null, "de");

                // Blog post 2
                var id2 = Guid.NewGuid();
                title = "Go West";
                content = @"<p>As a young child in the 1980s I have vague memories of watching a Japanese television show called <em>Monkey</em>. The show was an explosion of martial arts, monsters and magic. The electro-psychedelic theme tune by Godiego was particularly catchy. It wasn&rsquo;t until the early 2000s as a student when I rediscovered this cult Japanese show, it was a welcome distraction from late night study. </p> <iframe width=""560"" height=""315"" frameborder=""0"" src=""http://www.youtube.com/embed/Yr5ZWYRaAyw""></iframe>
<p>&nbsp;</p> <p>The show was of course a 1970s interpretation of the 16th century Ming dynasty novel Journey to the West by author Wu Cheng&rsquo;en. The novel details the adventures of the Buddhist monk Tripitaka and his 14 year and 108,000 mile odyssey, with his 3 supernatural companions Monkey, Pigsy and Sandy, to retrieve Buddhist scriptures from the Thunderclap Monastery in India.</p> <p>Having realised that this piece of Japanese pop culture was actually based on a Chinese epic novel I began reading Wu Cheng&rsquo;en&rsquo;s text. Whilst reading volume 3 on a train a young Chinese woman was rather tickled as in her opinion I was reading a children&rsquo;s story. In China the story is very popular amongst the younger generation and many animations have been based on the novel. The story has not only been a stimulus for animators but graphic novelists, computer game designers, and television, film and theatre directors too. The characters were even used by the BBC to advertise their coverage of the 2008 Beijing Olympics.</p>";

                SampleUtilities.CreateLocalizedBlogPost(id2, new Guid(SampleConstants.TIUBlogId), title, content, null, userId, null, null, "en");

                content = @"<p> Als kleines Kind in den 1980er Jahren habe ich noch vage Erinnerungen an Ansehen eines japanischen TV-Show namens <em> Affe <!-- em-->. Die Show war eine Explosion der Kampfkunst, Monster und Magie. Die elektro-psychedelischen Titelmelodie von Godiego war besonders eing&auml;ngig. Erst Anfang der 2000er Jahre als Student, als ich diesen Kult japanische zeigen wiederentdeckt, es ist eine willkommene Ablenkung von Late-Night-Studie war. </em></p> <iframe width=""560"" height=""315"" frameborder=""0"" src=""http://www.youtube.com/embed/Yr5ZWYRaAyw""> </iframe> <p> </p> <p>Die Show war nat&uuml;rlich ein 1970er Interpretation des 16. Jahrhunderts Ming-Dynastie Roman Journey to the West nach Autor Wu Cheng'en. Der Roman beschreibt die Abenteuer der buddhistische M&ouml;nch Tripitaka und seine 14 Jahre und 108.000 Meile Odyssee, mit seinen 3 &uuml;bernat&uuml;rlichen Begleiter Monkey, Pigsy und Sandy, um buddhistische Schriften aus dem Donnerknall Kloster in Indien zu erhalten. </p> <p> Nachdem klar, dass dieses St&uuml;ck der japanischen Popkultur war eigentlich auf einem chinesischen Epos Ich begann zu lesen Wu Cheng'en Text basiert. Beim Durchlesen Band 3 in einem Zug eine junge chinesische Frau eher als in ihrer Meinung, die ich las eine Geschichte f&uuml;r Kinder war gekitzelt. In China ist die Geschichte sehr beliebt bei der j&uuml;ngeren Generation und vielen Animationen auf dem gleichnamigen Roman basiert. Die Geschichte hat nicht nur ein Ansporn f&uuml;r Animatoren, aber Grafik Romanciers, Computerspiel-Designer, und Fernsehen, Film und Theater Regisseure auch schon. Die Charaktere wurden sogar von der BBC verwendet, um die Berichterstattung &uuml;ber die Olympiade 2008 in Peking zu werben.</p>";

                SampleUtilities.CreateLocalizedBlogPost(id2, new Guid(SampleConstants.TIUBlogId), title, content, null, userId, null, null, "de");

                var author = new AuthorProxy("Veronica", "*****@*****.**");

                var blogsManager = BlogsManager.GetManager();
                var master = blogsManager.GetBlogPost(id2);
                var liveId = blogsManager.Lifecycle.GetLive(master).Id;

                SampleUtilities.CreateBlogPostComment(liveId, "Thank you for this awesome post!", author, string.Empty, "::1");
            }
        }
        private void CreateNewsItemCommentItems()
        {
            var newsCreated = App.WorkWith().NewsItems().Get().Count() > 0;

            if (!newsCreated)
            {
                //News 1
                var title = "Annual Student Leadership Awards";
                var content = @"<p>The Annual Student Leadership Awards to honor student organizations and leaders on their accomplishments during 2009-10 academic years were held on December 20. This year's Student Leadership honorees included: </p>
<ul>
    <li>Emerging Student Leader: Angel Hawkins </li>
    <li>Persevering Leader: Nathaniel Walsh </li>
    <li>Collaborative Organization Award: Bryant Freeman</li>
    <li>Outstanding Cultural Program: Rafael Weber</li>
    <li>Campus Community Development Program: Josefina Mccoy </li>
    <li>Resident Advisor of the Year: Amelia Hall</li>
    <li>Resident Advisor of the Year: Bob Wilson </li>
    <li>Advisor of the Year: Ira Jacobs </li>
    <li>Senior Athlete of the Year: Glenda Gomez<strong></strong></li>
</ul>";
                var summary = "The Annual Student Leadership Awards to honor student organizations and leaders on their accomplishments during 2009-10 academic years were held on December 20. ";
                var author = "Jordan Angelov";
                var sourceName = "Telerik international university";
                var sourceURL = "http://www.telerik.com";
                var id1 = Guid.NewGuid();

                SampleUtilities.CreateLocalizedNewsItem(id1, title, content, summary, author, sourceName, sourceURL, new List<string>() { "announcement", "awards" }, null, "en");

                title = "Jährliche Student Leadership Awards";
                content = @"<p>Die j&auml;hrlichen Student Leadership Awards wurden an studentischen Organisationen und F&uuml;hrungskr&auml;fte f&uuml;r ihre Leistungen w&auml;hrend 2009-10 Studienjahre vergeben. Die Veranstaltung fand am 20. Dezember statt. Die Preistr&auml;ger sind:</p> <ul style=""list-style-type: disc;""> <li>Neuer Studentenf&uuml;hrer: Angel Hawkins</li> <li>Anerkannter Leader: Nathaniel Walsh</li> <li>Organisation Sonderforschungsbereich Award: Bryant Freeman</li> <li>herausragend kulturelles Programm: Rafael Weber</li> <li>Campus Community Development Program: Josefina Mccoy</li> <li>Berater des Jahres: Amelia Hall</li> <li>Berater des Jahres: Bob Wilson</li> <li>Advisor of the Year: Ira Jacobs</li> </ul>";
                summary = "Die j&auml;hrlichen Student Leadership Awards wurden an studentischen Organisationen und F&uuml;hrungskr&auml;fte f&uuml;r ihre Leistungen w&auml;hrend 2009-10 Studienjahre vergeben. Die Veranstaltung fand am 20";
                author = "Jordan Angelov";
                sourceName = "Telerik international university";
                sourceURL = "http://www.telerik.com";

                SampleUtilities.CreateLocalizedNewsItem(id1, title, content, summary, author, sourceName, sourceURL, "de");

                //News 2
                var id2 = Guid.NewGuid();
                title = "Economic Historian Jordan Turner Honored for Contributions";
                content = "<p>The research of Turner will be celebrated this weekend with a conference framed by his groundbreaking work studying economic growth in the Americas. </p> <p>Turner's research is acknowledged internationally for its impact on economics and history, especially the history of slavery. Of the 30 books and more than 200 articles he has co-authored or co-edited, his analysis on the economic underpinnings of slavery.</p> <p>&nbsp;</p>";
                summary = "The research of Turner will be celebrated this weekend with a conference framed by his groundbreaking work studying economic growth in the Americas.";
                author = "Jordan Angelov";
                sourceName = "Telerik international university";
                sourceURL = "http://www.telerik.com";

                SampleUtilities.CreateLocalizedNewsItem(id2, title, content, summary, author, sourceName, sourceURL, new List<string>() { "economics", "awards" }, null, "en");

                title = "Wirtschafts-Historiker Jordan Turner erhält Anerkennung für seinen Beitrag";
                content = "<p>Die Forschung der Turner wird dieses Wochenende gefeiert mit einer Konferenz &uuml;ber seine bahnbrechenden Arbeiten in denen er das Wirtschaftswachstum in Amerika studiert hat.</p> <p>Turner-Forschung ist international bekannt und f&uuml;r ihre Auswirkungen auf die Volkswirtschaft und Geschichte, besonders die Geschichte der Sklaverei anerkannt. Als Mitautor von den 30 B&uuml;chern und mehr als 200 Artikeln stammt seine Analyse &uuml;ber die &ouml;konomischen Grundlagen der Sklaverei.</p>";
                summary = "Die Forschung der Turner wird dieses Wochenende gefeiert mit einer Konferenz über seine bahnbrechenden Arbeiten in denen er das Wirtschaftswachstum in Amerika studiert hat.";
                author = "Jordan Angelov";
                sourceName = "Telerik international university";
                sourceURL = "http://www.telerik.com";

                SampleUtilities.CreateLocalizedNewsItem(id2, title, content, summary, author, sourceName, sourceURL, "de");

                var commentContent = "Great, thanks!";
                var commentAuthor = "Stan";
                var commentEmail = "*****@*****.**";
                var commentIp = "::1";
                var authorProxy1 = new AuthorProxy(commentAuthor, commentEmail);

                var liveId2 = GetLiveVersionIdByMasterId(id2);

                SampleUtilities.CreateNewsItemComment(liveId2, commentContent, authorProxy1, commentIp);

                //News 3
                var id3 = Guid.NewGuid();
                title = "Percent Tuition Decrease for 2010-2011";
                content = @"<p>TIU tuition will go down by 3.1 percent to $13,215 for the academic year 2010-11. The total package (tuition, room and board, and student services fee) will be $31,215, a 3.1 percent decrease over last year.</p>";
                summary = "TIU tuition will go down by 3.1 percent to $13,215 for the academic year 2010-11. The total package (tuition, room and board, and student services fee) will be $31,215, a 3.1 percent decrease over last year.";
                author = "Jordan Angelov";
                sourceName = "Telerik international university";
                sourceURL = "http://www.telerik.com";

                SampleUtilities.CreateLocalizedNewsItem(id3, title, content, summary, author, sourceName, sourceURL, new List<string>() { "announcement" }, null, "en");

                title = "Studiengebührenprozentabnahme für den Zeitraum 2010-2011";
                content = @"<p>TIU Unterricht wird um 3,1 Prozent auf 13.215 $ gehen f&uuml;r das akademische Jahr 2010-11. Das gesamte Paket (Studiengeb&uuml;hren, Unterkunft und Verpflegung und Betreuung der Studierenden gegen Geb&uuml;hr) wird $ 31.215 sein, eine 3,1 Prozent gegen&uuml;ber dem Vorjahr verringern.</p>";
                summary = "TIU Unterricht wird um 3,1 Prozent auf 13.215 $ gehen für das akademische Jahr 2010-11. Das gesamte Paket (Studiengebühren, Unterkunft und Verpflegung und Betreuung der Studierenden gegen Gebühr) wird $ 31.215 sein, eine 3,1 Prozent gegenüber dem Vorjahr verringern.";
                author = "Jordan Angelov";
                sourceName = "Telerik international university";
                sourceURL = "http://www.telerik.com";

                SampleUtilities.CreateLocalizedNewsItem(id3, title, content, summary, author, sourceName, sourceURL, "de");

                //News 4
                var id4 = Guid.NewGuid();
                title = "Staff Recognition Awards shine spotlight on outstanding service";
                content = @"<p>Students from Yamanashi University, Japan, visited TIU last week to gain a valuable insight into a US university and to learn from different practices and technology.</p> <p>Five members of the party were from Japan, one from Shanghai and another from South Korea and they were accompanied by a Yamanashi lecturer.</p> <p>Yamanashi student, Yoko Shimada said: &ldquo;The visit has been extraordinary. Quite life changing and quite different from what we had been expecting. The lectures are amazing. Going into a Media class and a Tourism class is not something we do at Yamanashi.&rdquo;</p> <p>Professor Hristo Borisoff from TIU organized the visit. He said: &ldquo;The 7 students attended lectures and seminars, made presentations and were interviewed for the TIU television. They also met the Vice Chancellor and the Dean of the Medicine School. They were all personable, great fun to be with and have an amazing presentation style.&rdquo;</p>";
                summary = "TIU honored employees for outstanding service and dedication to the university during its annual Staff Recognition Awards ceremony today in Sofia Auditorium.";
                author = "Stanislav Padarev";
                sourceName = "Telerik international university";
                sourceURL = "http://www.telerik.com";

                SampleUtilities.CreateLocalizedNewsItem(id4, title, content, summary, author, sourceName, sourceURL, "en");

                title = "Staff Recognition Awards glänzen Schlaglicht auf hervorragenden Service";
                content = @"<p>TIU geehrt Mitarbeiter f&uuml;r herausragende Leistungen und Engagement f&uuml;r die Universit&auml;t w&auml;hrend der j&auml;hrlichen Mitarbeiter Recognition Awards heute in Sofia Auditorium.<p /> <p>Berufliche Entwicklung und Lernen; Integrit&auml;t und Ethik, Respekt, Vielfalt und Pluralismus, Innovation und Flexibilit&auml;t, und Teamwork und Zusammenarbeit Sch&uuml;ler-Zentriertheit: Auszeichnungen wurden basierend auf TIU Kernwerte vorgestellt.</p>";
                summary = "TIU geehrt Mitarbeiter für herausragende Leistungen und Engagement für die Universität während der jährlichen Mitarbeiter Recognition Awards heute in Sofia Auditorium.";
                author = "Stanislav Padarev";
                sourceName = "Telerik international university";
                sourceURL = "http://www.telerik.com";

                SampleUtilities.CreateLocalizedNewsItem(id4, title, content, summary, author, sourceName, sourceURL, "de");

                //News 5
                var id5 = Guid.NewGuid();
                title = "Term Dates for 2010-2011 and 2011-2012";
                content = @"<p>A full-time project administrator is needed to work in the Sports Science Department on a research project funded by FIFA. The administrator will be responsible for coordinating meetings and communications.</p>";
                summary = "A full-time project administrator is needed to work in the Sports Science Department on a research project funded by FIFA. The administrator will be responsible for coordinating meetings and communications.";
                author = "Jordan Angelov";
                sourceName = "Telerik international university";
                sourceURL = "http://www.telerik.com";

                SampleUtilities.CreateLocalizedNewsItem(id5, title, content, summary, author, sourceName, sourceURL, new List<string>() { "announcement", "FIFA", "sports" }, null, "en");

                title = "Laufzeit Termine für den Zeitraum 2010-2011 und 2011-2012";
                content = @"<p>Ein Vollzeit-Projekt-Administrator ist erforderlich, um in der Sportwissenschaft Abteilung an einem Forschungsprojekt von der FIFA finanziert arbeiten. Der Administrator ist verantwortlich f&uuml;r die Koordinierung der Meetings und Kommunikation.</p>";
                summary = "TIU geehrt Mitarbeiter für herausragende Leistungen und Engagement für die Universität während der jährlichen Mitarbeiter Recognition Awards heute in Sofia Auditorium.";
                author = "Jordan Angelov";
                sourceName = "Telerik international university";
                sourceURL = "http://www.telerik.com";

                SampleUtilities.CreateLocalizedNewsItem(id5, title, content, summary, author, sourceName, sourceURL, "de");

                commentContent = "Thanks for the announcement!";
                commentAuthor = "Anton";
                commentEmail = "*****@*****.**";

                var authorProxy2 = new AuthorProxy(commentAuthor, commentEmail);

                var liveId5 = GetLiveVersionIdByMasterId(id5);

                SampleUtilities.CreateNewsItemComment(liveId5, commentContent, authorProxy2, commentIp);

                commentContent = "Thank you very much";
                commentAuthor = "Alex";
                commentEmail = "*****@*****.**";

                var authorProxy3 = new AuthorProxy(commentAuthor, commentEmail);
                SampleUtilities.CreateNewsItemComment(liveId5, commentContent, authorProxy3, commentIp);

                commentContent = "Great! Thanks a lot!";
                commentAuthor = "Stan";
                commentEmail = "*****@*****.**";
                var authorProxy4 = new AuthorProxy(commentAuthor, commentEmail);
                SampleUtilities.CreateNewsItemComment(liveId5, commentContent, authorProxy4, commentIp);

                //News 6
                var id6 = Guid.NewGuid();
                title = "Visit from Japan";
                content = @"<p>Five members of the party were from Japan, one from Shanghai and another from South Korea and they were accompanied by a Yamanashi lecturer.</p> <p>Yamanashi student, Yoko Shimada said: &ldquo;The visit has been extraordinary. Quite life changing and quite different from what we had been expecting. The lectures are amazing. Going into a Media class and a Tourism class is not something we do at Yamanashi.&rdquo;</p> <p>Professor Hristo Borisoff from TIU organized the visit. He said: &ldquo;The 7 students attended lectures and seminars, made presentations and were interviewed for the TIU television. They also met the Vice Chancellor and the Dean of the Medicine School. They were all personable, great fun to be with and have an amazing presentation style.&rdquo;</p> <p>Students from Yamanashi University, Japan, visited TIU last week to gain a valuable insight into a US university and to learn from different practices and technology.</p>";
                summary = "Students from Yamanashi University, Japan, visited TIU last week to gain a valuable insight into a US university and to learn from different practices and technology.";
                author = "Jordan Angelov";
                sourceName = "Telerik international university";
                sourceURL = "http://www.telerik.com";

                SampleUtilities.CreateLocalizedNewsItem(id6, title, content, summary, author, sourceName, sourceURL, new List<string>() { "announcement", "tourism", "japan" }, null, "en");

                title = "Besuch aus Japan";
                content = @"<p>Studierende der Yamanashi-Universit&auml;t, Japan, besuchten TIU vergangene Woche um einen wertvollen Einblick in einer US-Universit&auml;t zu gewinnen und mehr &uuml;ber unterschiedlichen Praktiken und Technologien zu erfahren.</p> <p>F&uuml;nf Mitglieder der Gruppe waren aus Japan, einer aus Shanghai und die anderen aus S&uuml;dkorea. Sie wurden von einem Yamanashi Dozent begleitet.</p> <p>Yamanashi-Student Yoko Shimada sagte: ""Der Besuch war au&szlig;ergew&ouml;hnlich! Lebensver&auml;ndernd und ganz anders als das, was wir erwartet hatten. Die Vortr&auml;ge sind erstaunlich! Eine Medien- oder eine Tourismus-Vorlesung ist nicht etwas, was wir in Yamanashi haben.""</p> <p>Professor Hristo Borisoff von TIU organisiert den Besuch. Er sagte: ""Die 7 Studenten besuchten Vorlesungen und Seminare, Pr&auml;sentationen und wurden f&uuml;r das TIU-Fernsehen interviewt. Sie trafen auch den Vizekanzler und den Dekan der Medizinischen Fakult&auml;t. Sie alle waren sehr sympathisch, hatten unglaublich viel Spa&szlig; und konnten bei ihren Vortr&auml;gen richtig gl&auml;nzen.""</p>";
                summary = "Studierende der Yamanashi-Universität, Japan, besuchten TIU vergangene Woche um einen wertvollen Einblick in einer US-Universität zu gewinnen und mehr über unterschiedlichen Praktiken und Technologien zu erfahren.";
                author = "Jordan Angelov";
                sourceName = "Telerik international university";
                sourceURL = "http://www.telerik.com";

                SampleUtilities.CreateLocalizedNewsItem(id6, title, content, summary, author, sourceName, sourceURL, "de");

                commentContent = "Thanks";
                commentAuthor = "Stan";
                commentEmail = "*****@*****.**";
                var authorProxy5 = new AuthorProxy(commentAuthor, commentEmail);

                var liveId6 = GetLiveVersionIdByMasterId(id6);
                SampleUtilities.CreateNewsItemComment(liveId6, commentContent, authorProxy5, commentIp);

                commentContent = "Awesome! I'll be there!";
                commentAuthor = "Greg";
                commentEmail = "*****@*****.**";
                var authorProxy6 = new AuthorProxy(commentAuthor, commentEmail);
                SampleUtilities.CreateNewsItemComment(liveId6, commentContent, authorProxy6, commentIp);
            }
        }