/* Copyright 2006 - 2010 Under Dusken 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 no.dusken.aranea.service; import no.dusken.aranea.model.*; import no.dusken.common.service.GenericService; import java.util.List; /** * This interface is the exposed interface to all controllers that wants an * <p/> * Implementations of this interface needs to commune with a DAO * of some sort. add setArticleDao(ArticleDao dao) to the implementation. * The implementations are free to use other daos if required. * * @author Erlend Hamnaberg<erlenha@underdusken.no> */ public interface ArticleService extends GenericService<Article> { /** * @param issue - * the issue to get the articles by * @return a list of articles */ public List<Article> getArticlesByIssue(Issue issue); /** * Gets the articles with the given title * Is used by ImportWebsysController, to check if there are several articles with the same name * @param title the title to check if it already is in the database * @return a list of articles */ public List<Article> getArticlesByTitle(String title); /** * @param year - * the year to get the articles by * @return a list of articles */ public List<Article> getArticlesByYear(int year, int number, int offset); /** * Gets articles from the section , starting with the newest ones * * @param number is the number of articles to get * @param offset is the number to skip from the beginning * @param section is the section. null = frontpage * @return the found articles, if any. Newest first */ public List<Article> getArticlesBySection(int number, int offset, Section section); /** * @param tag - * the tag to get the articles by * @return a list of articles */ public List<Article> getArticlesByTag(Tag tag); /** * Get number pages, starting from offset number of pages. * @param offset - skip offset articles * @param number - Number to fetch * @return - Articles ordered by a.timePublished desc */ public List<Article> getArticles(int offset, int number); /** * Get number pages, starting from offset number of pages. * @param offset - skip offset articles * @param number - Number to fetch * @return - Published Articles ordered by a.timePublished desc */ public List<Article> getPublishedArticles(int offset, int number); /** * @param person - Author of the articles * @return Published articles with the person as author, no ordering * specified. */ public List<Article> getPublishedArticlesByPerson(Person person); }