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$ 018 */ 019package org.nuxeo.ecm.webapp.admin; 020 021import java.io.Serializable; 022import java.util.Calendar; 023 024import org.jboss.seam.ScopeType; 025import org.jboss.seam.annotations.Factory; 026import org.jboss.seam.annotations.Name; 027import org.jboss.seam.annotations.Scope; 028import org.nuxeo.ecm.core.management.api.AdministrativeStatusManager; 029import org.nuxeo.ecm.platform.web.common.admin.AdminStatusHelper; 030 031/** 032 * Seam Bean to expose Administrator Message to the JSF Web Layer. (base on {@link AdministrativeStatusManager} 033 * 034 * @author tiry 035 */ 036@Name("adminMessageManager") 037@Scope(ScopeType.APPLICATION) 038public class AdminMessageActionBean implements Serializable { 039 040 private static final long serialVersionUID = 1L; 041 042 @Factory(value = "adminMessageActivated", scope = ScopeType.EVENT) 043 public boolean isAdminMessageActivated() { 044 return AdminStatusHelper.isAdminMessageActivated(); 045 } 046 047 @Factory(value = "adminMessage", scope = ScopeType.EVENT) 048 public String getAdminMessage() { 049 return AdminStatusHelper.getAdminMessage(); 050 } 051 052 @Factory(value = "adminMessageModificationDate", scope = ScopeType.EVENT) 053 public Calendar getAdminMessageModificationDate() { 054 return AdminStatusHelper.getAdminMessageModificationDate(); 055 } 056 057}