001/* 002 * This library is part of OpenCms - 003 * the Open Source Content Management System 004 * 005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com) 006 * 007 * This library is free software; you can redistribute it and/or 008 * modify it under the terms of the GNU Lesser General Public 009 * License as published by the Free Software Foundation; either 010 * version 2.1 of the License, or (at your option) any later version. 011 * 012 * This library is distributed in the hope that it will be useful, 013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015 * Lesser General Public License for more details. 016 * 017 * For further information about Alkacon Software, please see the 018 * company website: http://www.alkacon.com 019 * 020 * For further information about OpenCms, please see the 021 * project website: http://www.opencms.org 022 * 023 * You should have received a copy of the GNU Lesser General Public 024 * License along with this library; if not, write to the Free Software 025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 026 */ 027 028package org.opencms.ui.apps; 029 030import org.opencms.file.CmsObject; 031import org.opencms.security.CmsRole; 032 033import java.util.Locale; 034 035import com.vaadin.server.Resource; 036 037/** 038 * Contains the configuration of a single workplace app.<p> 039 */ 040public interface I_CmsWorkplaceAppConfiguration extends I_CmsHasOrder { 041 042 /** Default priority. */ 043 int DEFAULT_PRIORIY = 100; 044 045 /** 046 * Gets the id of the app category in which this app should be displayed (null for the root category). 047 * 048 * @return the app category id 049 */ 050 String getAppCategory(); 051 052 /** 053 * Returns a new app instance.<p> 054 * 055 * @return a new app instance 056 */ 057 I_CmsWorkplaceApp getAppInstance(); 058 059 /** 060 * Returns the button style.<p> 061 * 062 * @return the button style 063 */ 064 String getButtonStyle(); 065 066 /** 067 * Gets the help text for the app in the given locale.<p> 068 * 069 * @param locale the locale to use 070 * 071 * @return the help text 072 */ 073 String getHelpText(Locale locale); 074 075 /** 076 * Returns the app icon resource.<p> 077 * 078 * @return the icon resource 079 */ 080 Resource getIcon(); 081 082 /** 083 * Returns the unique app id. 084 * 085 * @return the app id 086 */ 087 String getId(); 088 089 /** 090 * Returns the display name of the app.<p> 091 * 092 * @param locale the user locale 093 * 094 * @return the app name 095 */ 096 String getName(Locale locale); 097 098 /** 099 * Gets the priority of the app configuration.<p> 100 * 101 * Between two apps with the same id and different priorities, the one with the higher priority will override 102 * the one with the lower priority.<p> 103 * 104 * @return the priority 105 */ 106 int getPriority(); 107 108 /** 109 * Returns the user role required for this app.<p> 110 * 111 * @return the required user role 112 */ 113 CmsRole getRequiredRole(); 114 115 /** 116 * Returns the visibility status of the app for the given user context.<p> 117 * 118 * @param cms the user context 119 * 120 * @return the visibility status 121 */ 122 CmsAppVisibilityStatus getVisibility(CmsObject cms); 123 124}