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.datesearch; 029 030import org.opencms.file.CmsObject; 031import org.opencms.security.CmsRole; 032import org.opencms.ui.CmsCssIcon; 033import org.opencms.ui.apps.A_CmsWorkplaceAppConfiguration; 034import org.opencms.ui.apps.CmsAppVisibilityStatus; 035import org.opencms.ui.apps.I_CmsWorkplaceApp; 036import org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration; 037import org.opencms.ui.apps.Messages; 038 039import java.util.Locale; 040 041import com.vaadin.server.Resource; 042 043/** 044 * Date search app configuration. 045 */ 046public class CmsDateSearchConfiguration extends A_CmsWorkplaceAppConfiguration { 047 048 /** Id of the app. */ 049 public static final String APP_ID = "date-search"; 050 051 /** 052 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getAppInstance() 053 */ 054 @Override 055 public I_CmsWorkplaceApp getAppInstance() { 056 057 return new CmsDateSearchApp(); 058 } 059 060 /** 061 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getHelpText(java.util.Locale) 062 */ 063 @Override 064 public String getHelpText(Locale locale) { 065 066 return Messages.get().getBundle(locale).key(Messages.GUI_DATE_SEARCH_HELP_0); 067 } 068 069 /** 070 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getIcon() 071 */ 072 @Override 073 public Resource getIcon() { 074 075 return new CmsCssIcon("oc-icon-32-date-search"); 076 } 077 078 /** 079 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getId() 080 */ 081 @Override 082 public String getId() { 083 084 return APP_ID; 085 } 086 087 /** 088 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getName(java.util.Locale) 089 */ 090 @Override 091 public String getName(Locale locale) { 092 093 return Messages.get().getBundle(locale).key(Messages.GUI_DATE_SEARCH_TITLE_0); 094 } 095 096 /** 097 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getOrder() 098 */ 099 @Override 100 public int getOrder() { 101 102 return 13; 103 } 104 105 /** 106 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getPriority() 107 */ 108 @Override 109 public int getPriority() { 110 111 return I_CmsWorkplaceAppConfiguration.DEFAULT_PRIORIY; 112 } 113 114 /** 115 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getRequiredRole() 116 */ 117 @Override 118 public CmsRole getRequiredRole() { 119 120 return CmsRole.WORKPLACE_USER; 121 } 122 123 /** 124 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getVisibility(org.opencms.file.CmsObject) 125 */ 126 @Override 127 public CmsAppVisibilityStatus getVisibility(CmsObject cms) { 128 129 return new CmsAppVisibilityStatus(true, true, null); 130 } 131}