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.userdata;
029
030import org.opencms.security.CmsRole;
031import org.opencms.ui.CmsCssIcon;
032import org.opencms.ui.apps.A_CmsWorkplaceAppConfiguration;
033import org.opencms.ui.apps.CmsWorkplaceAppManager;
034import org.opencms.ui.apps.I_CmsWorkplaceApp;
035import org.opencms.ui.components.OpenCmsTheme;
036
037import java.util.Locale;
038
039import com.vaadin.server.Resource;
040
041/**
042 * App configuration for the 'user data' app.
043 */
044public class CmsUserDataAppConfiguration extends A_CmsWorkplaceAppConfiguration {
045
046    /** The app id. */
047    public static final String APP_ID = "userdata";
048
049    /**
050     * Creates a new instance.
051     */
052    public CmsUserDataAppConfiguration() {
053        // do nothing
054
055    }
056
057    /**
058     * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getAppCategory()
059     */
060    @Override
061    public String getAppCategory() {
062
063        return CmsWorkplaceAppManager.ADMINISTRATION_CATEGORY_ID;
064    }
065
066    /**
067     * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getAppInstance()
068     */
069    @Override
070    public I_CmsWorkplaceApp getAppInstance() {
071
072        return new CmsUserDataApp();
073    }
074
075    /**
076     * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getIcon()
077     */
078    @Override
079    public Resource getIcon() {
080
081        return new CmsCssIcon(OpenCmsTheme.ICON_PERSON_DATA);
082    }
083
084    /**
085     * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getId()
086     */
087    @Override
088    public String getId() {
089
090        return APP_ID;
091    }
092
093    /**
094     * @see org.opencms.ui.apps.A_CmsWorkplaceAppConfiguration#getName(java.util.Locale)
095     */
096    @Override
097    public String getName(Locale locale) {
098
099        return org.opencms.ui.apps.Messages.get().getBundle(locale).key(
100            org.opencms.ui.apps.Messages.GUI_USERDATA_APP_0);
101    }
102
103    /**
104     * @see org.opencms.ui.apps.A_CmsWorkplaceAppConfiguration#getOrder()
105     */
106    @Override
107    public int getOrder() {
108
109        return 100;
110    }
111
112    /**
113     * @see org.opencms.ui.apps.A_CmsWorkplaceAppConfiguration#getPriority()
114     */
115    @Override
116    public int getPriority() {
117
118        return 0;
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
130}