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 * The editor app configuration.<p> 039 */ 040public class CmsEditorConfiguration extends A_CmsWorkplaceAppConfiguration { 041 042 /** The app id. */ 043 public static final String APP_ID = "editor"; 044 045 /** 046 * @see org.opencms.ui.apps.A_CmsWorkplaceAppConfiguration#getAppCategory() 047 */ 048 @Override 049 public String getAppCategory() { 050 051 return "none"; 052 } 053 054 /** 055 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getAppInstance() 056 */ 057 public I_CmsWorkplaceApp getAppInstance() { 058 059 return new CmsEditor(); 060 } 061 062 /** 063 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getIcon() 064 */ 065 public Resource getIcon() { 066 067 // no icon needed, the editor will not be called directly 068 return null; 069 } 070 071 /** 072 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getId() 073 */ 074 public String getId() { 075 076 return APP_ID; 077 } 078 079 /** 080 * @see org.opencms.ui.apps.A_CmsWorkplaceAppConfiguration#getName(java.util.Locale) 081 */ 082 @Override 083 public String getName(Locale locale) { 084 085 return Messages.get().getBundle(locale).key(Messages.GUI_EDITOR_TITLE_0); 086 } 087 088 /** 089 * @see org.opencms.ui.apps.A_CmsWorkplaceAppConfiguration#getRequiredRole() 090 */ 091 @Override 092 public CmsRole getRequiredRole() { 093 094 return CmsRole.ELEMENT_AUTHOR; 095 } 096 097 /** 098 * @see org.opencms.ui.apps.A_CmsWorkplaceAppConfiguration#getVisibility(org.opencms.file.CmsObject) 099 */ 100 @Override 101 public CmsAppVisibilityStatus getVisibility(CmsObject cms) { 102 103 // the editor should no be called directly so it is hidden 104 return new CmsAppVisibilityStatus(false, true, ""); 105 } 106}