001/* 002 * (C) Copyright 2006-2010 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.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 * Dragos Mihalache 016 * Florent Guillaume 017 */ 018 019package org.nuxeo.ecm.platform.versioning.api; 020 021import org.nuxeo.ecm.core.api.DocumentModel; 022 023/** 024 * Interface for the Versioning Manager (a service). 025 */ 026public interface VersioningManager { 027 028 /** 029 * Get document increment options as defined by versioning rules. 030 * 031 * @param doc the document 032 * @return a list of version increment options available for the given document 033 */ 034 VersionIncEditOptions getVersionIncEditOptions(DocumentModel doc); 035 036 /** 037 * Gets the label for the current version of a document, for the UI. 038 * 039 * @param doc the document 040 * @return the version label 041 */ 042 String getVersionLabel(DocumentModel doc); 043 044 /** 045 * Returns the property name to use when setting the major version for this document type. 046 * 047 * @deprecated since 5.4, use {@link DocumentModel#MAJOR_VERSION} directly 048 */ 049 @Deprecated 050 String getMajorVersionPropertyName(String documentType); 051 052 /** 053 * Returns the property name to use when setting the minor version for this document type. 054 * 055 * @deprecated since 5.4, use {@link DocumentModel#MINOR_VERSION} directly 056 */ 057 @Deprecated 058 String getMinorVersionPropertyName(String documentType); 059 060 /** 061 * Increments the minor version of a document. 062 * 063 * @param doc the document 064 * @deprecated since 5.4 065 */ 066 @Deprecated 067 DocumentModel incrementMinor(DocumentModel doc); 068 069 /** 070 * Increments the major version of a document and sets the minor to 0. 071 * 072 * @param doc the document 073 * @deprecated since 5.4 074 */ 075 @Deprecated 076 DocumentModel incrementMajor(DocumentModel doc); 077 078}