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.dbmanager; 029 030import org.opencms.security.CmsRole; 031import org.opencms.ui.FontOpenCms; 032import org.opencms.ui.apps.A_CmsWorkplaceAppConfiguration; 033import org.opencms.ui.apps.I_CmsWorkplaceApp; 034import org.opencms.ui.apps.Messages; 035import org.opencms.ui.components.OpenCmsTheme; 036 037import java.util.Locale; 038 039import com.vaadin.server.Resource; 040 041/** 042 * Configuration for Database manager app.<p> 043 */ 044public class CmsDbManagerConfiguration extends A_CmsWorkplaceAppConfiguration { 045 046 /** The app id. */ 047 public static final String APP_ID = "db-admin"; 048 049 /** 050 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getAppCategory() 051 */ 052 @Override 053 public String getAppCategory() { 054 055 return CmsDbManagerFolder.ID; 056 } 057 058 /** 059 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getAppInstance() 060 */ 061 public I_CmsWorkplaceApp getAppInstance() { 062 063 return new CmsDbManager(); 064 } 065 066 /** 067 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getButtonStyle() 068 */ 069 @Override 070 public String getButtonStyle() { 071 072 return FontOpenCms.INFO.getButtonOverlayStyle() + " " + OpenCmsTheme.BUTTON_OVERLAY_BLUE; 073 } 074 075 /** 076 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getHelpText(java.util.Locale) 077 */ 078 @Override 079 public String getHelpText(Locale locale) { 080 081 return Messages.get().getBundle(locale).key(Messages.GUI_DATABASEAPP_ADMIN_TOOL_HELP_0); 082 } 083 084 /** 085 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getIcon() 086 */ 087 public Resource getIcon() { 088 089 return CmsDbManagerFolder.ICON; 090 } 091 092 /** 093 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getId() 094 */ 095 public String getId() { 096 097 return APP_ID; 098 } 099 100 /** 101 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getName(java.util.Locale) 102 */ 103 @Override 104 public String getName(Locale locale) { 105 106 return Messages.get().getBundle(locale).key(Messages.GUI_DATABASEAPP_STATS_TITLE_0); 107 } 108 109 /** 110 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getOrder() 111 */ 112 @Override 113 public int getOrder() { 114 115 return 0; 116 } 117 118 /** 119 * @see org.opencms.ui.apps.A_CmsWorkplaceAppConfiguration#getRequiredRole() 120 */ 121 @Override 122 public CmsRole getRequiredRole() { 123 124 return CmsRole.DATABASE_MANAGER; 125 } 126}