001 /** 002 * Copyright (c) 2000-present Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portlet.ratings.definition; 016 017 import com.liferay.portlet.ratings.RatingsType; 018 019 /** 020 * Provides an interface for defining the ratings used by an entity (or 021 * entities) in a portlet. 022 * 023 * <p> 024 * This information is used to render a user interface with the entities using 025 * ratings, grouped by portlet to allow changing the ratings type. 026 * </p> 027 * 028 * <p> 029 * Implementations must be registered in the OSGI Registry with the property 030 * "model.class.name" to specify which entity this definition applies 031 * to. 032 * </p> 033 * 034 * @author Roberto D??az 035 * @author Sergio Gonz??lez 036 */ 037 public interface PortletRatingsDefinition { 038 039 /** 040 * Returns the default ratings type of the entity. This ratings type is used 041 * as long as no other ratings type has been set. 042 * 043 * @return the default ratings type of the entity 044 */ 045 public RatingsType getDefaultRatingsType(); 046 047 /** 048 * Returns the ID of the main portlet associated to the entity. This portlet 049 * ID is used to group the entity; so if the entity is used by more than one 050 * portlet, the ID of the most relevant portlet is returned. 051 * 052 * @return the main portlet ID associated to the entity. 053 */ 054 public String getPortletId(); 055 056 }