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