From graffito-commits-return-716-apmail-incubator-graffito-commits-archive=www.apache.org@incubator.apache.org Wed Jun 14 19:48:17 2006 Return-Path: Delivered-To: apmail-incubator-graffito-commits-archive@www.apache.org Received: (qmail 5359 invoked from network); 14 Jun 2006 19:48:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Jun 2006 19:48:17 -0000 Received: (qmail 20882 invoked by uid 500); 14 Jun 2006 19:48:16 -0000 Mailing-List: contact graffito-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: graffito-dev@incubator.apache.org Delivered-To: mailing list graffito-commits@incubator.apache.org Received: (qmail 20870 invoked by uid 99); 14 Jun 2006 19:48:16 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2006 12:48:16 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2006 12:48:15 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id A636F1A983A; Wed, 14 Jun 2006 12:47:55 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r414366 - in /incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test: components/impl/ components/impl/ArticleServiceImpl.java components/impl/NewsServiceImpl.java model/ model/Article.java model/News.java Date: Wed, 14 Jun 2006 19:47:54 -0000 To: graffito-commits@incubator.apache.org From: clombart@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060614194755.A636F1A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: clombart Date: Wed Jun 14 12:47:54 2006 New Revision: 414366 URL: http://svn.apache.org/viewvc?rev=414366&view=rev Log: Add component impl & model used in the unit tests Added: incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/components/impl/ incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/components/impl/ArticleServiceImpl.java (with props) incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/components/impl/NewsServiceImpl.java (with props) incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/model/ incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/model/Article.java (with props) incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/model/News.java (with props) Added: incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/components/impl/ArticleServiceImpl.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/components/impl/ArticleServiceImpl.java?rev=414366&view=auto ============================================================================== --- incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/components/impl/ArticleServiceImpl.java (added) +++ incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/components/impl/ArticleServiceImpl.java Wed Jun 14 12:47:54 2006 @@ -0,0 +1,97 @@ +/* + * Copyright 2000-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.portals.graffito.jcr.spring.test.components.impl; + +import java.util.Collection; +import java.util.Date; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.portals.graffito.jcr.query.Filter; +import org.apache.portals.graffito.jcr.query.Query; +import org.apache.portals.graffito.jcr.query.QueryManager; +import org.apache.portals.graffito.jcr.spring.JcrMappingTemplate; +import org.apache.portals.graffito.jcr.spring.test.components.ArticleService; +import org.apache.portals.graffito.jcr.spring.test.components.NewsService; +import org.apache.portals.graffito.jcr.spring.test.model.Article; +import org.apache.portals.graffito.jcr.spring.test.model.News; + +/** + * Default implementation for {@link org.apache.portals.graffito.jcr.spring.test.components.ArticleService} + * + * @author Lombart Christophe + * + */ +public class ArticleServiceImpl implements ArticleService { + private static final Log log = LogFactory.getLog(ArticleServiceImpl.class); + + private JcrMappingTemplate jcrMappingtemplate; + private NewsService newsService; + + + public void createArticle(Article article) + { + + jcrMappingtemplate.insert(article); + jcrMappingtemplate.save(); + + + News news = new News(); + news.setContent("A new article has been created by " + article.getAuthor()); + news.setCreationDate(new Date()); + news.setPath("/news-" + System.currentTimeMillis()); + newsService.createNews(news); + } + + public Collection getArticles() + { + + QueryManager queryManager = jcrMappingtemplate.createQueryManager(); + Filter filter = queryManager.createFilter(Article.class); + + Query query = queryManager.createQuery(filter); + return jcrMappingtemplate.getObjects(query); + } + + + public NewsService getNewsService() + { + return newsService; + } + + public void setNewsService(NewsService newsService) + { + this.newsService = newsService; + } + + /** + * @return Returns the template. + */ + public JcrMappingTemplate getJcrMappingTemplate() { + return jcrMappingtemplate; + } + + /** + * @param template The template to set. + */ + public void setJcrMappingTemplate(JcrMappingTemplate template) { + this.jcrMappingtemplate = template; + } + + + +} Propchange: incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/components/impl/ArticleServiceImpl.java ------------------------------------------------------------------------------ svn:executable = * Added: incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/components/impl/NewsServiceImpl.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/components/impl/NewsServiceImpl.java?rev=414366&view=auto ============================================================================== --- incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/components/impl/NewsServiceImpl.java (added) +++ incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/components/impl/NewsServiceImpl.java Wed Jun 14 12:47:54 2006 @@ -0,0 +1,75 @@ +/* + * Copyright 2000-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.portals.graffito.jcr.spring.test.components.impl; + +import java.util.Collection; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.portals.graffito.jcr.query.Filter; +import org.apache.portals.graffito.jcr.query.Query; +import org.apache.portals.graffito.jcr.query.QueryManager; +import org.apache.portals.graffito.jcr.spring.JcrMappingTemplate; +import org.apache.portals.graffito.jcr.spring.test.components.NewsService; +import org.apache.portals.graffito.jcr.spring.test.model.News; + +/** + * Default implementation for {@link org.apache.portals.graffito.jcr.spring.test.components.ArticleService} + * + * @author Lombart Christophe + * + */ +public class NewsServiceImpl implements NewsService { + private static final Log log = LogFactory.getLog(NewsServiceImpl.class); + + private JcrMappingTemplate jcrMappingtemplate; + + public void createNews(News news) + { + jcrMappingtemplate.insert(news); + jcrMappingtemplate.save(); + + } + + public Collection getNews() + { + + QueryManager queryManager = jcrMappingtemplate.createQueryManager(); + Filter filter = queryManager.createFilter(News.class); + + Query query = queryManager.createQuery(filter); + return jcrMappingtemplate.getObjects(query); + } + + + /** + * @return Returns the template. + */ + public JcrMappingTemplate getJcrMappingTemplate() { + return jcrMappingtemplate; + } + + /** + * @param template The template to set. + */ + public void setJcrMappingTemplate(JcrMappingTemplate template) { + this.jcrMappingtemplate = template; + } + + + +} Propchange: incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/components/impl/NewsServiceImpl.java ------------------------------------------------------------------------------ svn:executable = * Added: incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/model/Article.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/model/Article.java?rev=414366&view=auto ============================================================================== --- incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/model/Article.java (added) +++ incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/model/Article.java Wed Jun 14 12:47:54 2006 @@ -0,0 +1,93 @@ +/* + * Copyright 2000-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.portals.graffito.jcr.spring.test.model; + + +import java.util.*; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Simple Article class + * + * @author Christophe Lombart + * + */ +public class Article +{ + protected final static Log log = LogFactory.getLog(Article.class); + + protected String path; + protected String title; + protected String description; + protected String author; + protected Date creationDate; + protected String content; + + + public String getPath() + { + return path; + } + public void setPath(String path) + { + this.path = path; + } + public String getAuthor() + { + return author; + } + public void setAuthor(String author) + { + this.author = author; + } + public String getContent() + { + return content; + } + public void setContent(String content) + { + this.content = content; + } + public Date getCreationDate() + { + return creationDate; + } + public void setCreationDate(Date creationDate) + { + this.creationDate = creationDate; + } + public String getDescription() + { + return description; + } + public void setDescription(String description) + { + this.description = description; + } + public String getTitle() + { + return title; + } + public void setTitle(String title) + { + this.title = title; + } + + +} + Propchange: incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/model/Article.java ------------------------------------------------------------------------------ svn:executable = * Added: incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/model/News.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/model/News.java?rev=414366&view=auto ============================================================================== --- incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/model/News.java (added) +++ incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/model/News.java Wed Jun 14 12:47:54 2006 @@ -0,0 +1,66 @@ +/* + * Copyright 2000-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.portals.graffito.jcr.spring.test.model; + + +import java.util.*; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Simple New class + * + * @author Christophe Lombart + * + */ +public class News +{ + protected final static Log log = LogFactory.getLog(News.class); + + protected String path; + protected Date creationDate; + protected String content; + + + + public String getPath() + { + return path; + } + public void setPath(String path) + { + this.path = path; + } + public String getContent() + { + return content; + } + public void setContent(String content) + { + this.content = content; + } + public Date getCreationDate() + { + return creationDate; + } + public void setCreationDate(Date creationDate) + { + this.creationDate = creationDate; + } + +} + Propchange: incubator/graffito/trunk/jcr/spring/src/test/org/apache/portals/graffito/jcr/spring/test/model/News.java ------------------------------------------------------------------------------ svn:executable = *