001/*
002 * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     Nuxeo - initial API and implementation
016 *
017 * $Id: JOOoConvertPluginImpl.java 18651 2007-05-13 20:28:53Z sfermigier $
018 */
019
020package org.nuxeo.ecm.webapp.trashManagement;
021
022import static org.jboss.seam.ScopeType.APPLICATION;
023
024import java.io.Serializable;
025
026import org.apache.commons.logging.Log;
027import org.apache.commons.logging.LogFactory;
028import org.jboss.seam.annotations.Name;
029import org.jboss.seam.annotations.Scope;
030import org.nuxeo.runtime.api.Framework;
031
032@Name("conversationTrashManager")
033@Scope(APPLICATION)
034public class ConversationTrashManager implements Serializable {
035
036    private static final long serialVersionUID = 9876098763432L;
037
038    private static final Log log = LogFactory.getLog(ConversationTrashManager.class);
039
040    private static TrashManagementService trashService;
041
042    public void initTrashManager() {
043        log.debug("Initialize");
044    }
045
046    public static boolean isTrashManagementEnabled() {
047        return getService().isTrashManagementEnabled();
048    }
049
050    protected static TrashManagementService getService() {
051        if (trashService == null) {
052            trashService = (TrashManagementService) Framework.getRuntime().getComponent(TrashManagementService.NAME);
053        }
054        return trashService;
055    }
056
057}