001/* 002 * (C) Copyright 2014 Nuxeo SA (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-2.1.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 * Antoine Taillefer <ataillefer@nuxeo.com> 016 */ 017package org.nuxeo.drive.operations; 018 019import java.io.IOException; 020 021import org.nuxeo.ecm.automation.core.Constants; 022import org.nuxeo.ecm.automation.core.annotations.Operation; 023import org.nuxeo.ecm.automation.core.annotations.OperationMethod; 024import org.nuxeo.ecm.core.api.Blob; 025import org.nuxeo.runtime.api.Framework; 026 027/** 028 * Gets the information needed for the Nuxeo Drive client update: 029 * <ul> 030 * <li>Server version</li> 031 * <li>Nuxeo Drive update site URL</li> 032 * </ul> 033 * 034 * @author Antoine Taillefer 035 */ 036@Operation(id = NuxeoDriveGetClientUpdateInfo.ID, category = Constants.CAT_SERVICES, label = "Nuxeo Drive: Get client update information") 037public class NuxeoDriveGetClientUpdateInfo { 038 039 public static final String ID = "NuxeoDrive.GetClientUpdateInfo"; 040 041 @OperationMethod 042 public Blob run() throws IOException { 043 044 String serverVersion = Framework.getProperty("org.nuxeo.ecm.product.version"); 045 String updateSiteURL = Framework.getProperty("org.nuxeo.drive.update.site.url"); 046 String betaUpdateSiteURL = Framework.getProperty("org.nuxeo.drive.beta.update.site.url"); 047 NuxeoDriveClientUpdateInfo info = new NuxeoDriveClientUpdateInfo(serverVersion, updateSiteURL, 048 betaUpdateSiteURL); 049 return NuxeoDriveOperationHelper.asJSONBlob(info); 050 } 051 052}