001/* 002 * (C) Copyright 2006-2010 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * Dragos Mihalache 018 * Florent Guillaume 019 */ 020 021package org.nuxeo.ecm.platform.versioning.api; 022 023import org.nuxeo.ecm.core.api.DocumentModel; 024 025/** 026 * Interface for the Versioning Manager (a service). 027 */ 028public interface VersioningManager { 029 030 /** 031 * Get document increment options as defined by versioning rules. 032 * 033 * @param doc the document 034 * @return a list of version increment options available for the given document 035 */ 036 VersionIncEditOptions getVersionIncEditOptions(DocumentModel doc); 037 038 /** 039 * Gets the label for the current version of a document, for the UI. 040 * 041 * @param doc the document 042 * @return the version label 043 */ 044 String getVersionLabel(DocumentModel doc); 045 046 /** 047 * Returns the property name to use when setting the major version for this document type. 048 * 049 * @deprecated since 5.4, use {@link DocumentModel#MAJOR_VERSION} directly 050 */ 051 @Deprecated 052 String getMajorVersionPropertyName(String documentType); 053 054 /** 055 * Returns the property name to use when setting the minor version for this document type. 056 * 057 * @deprecated since 5.4, use {@link DocumentModel#MINOR_VERSION} directly 058 */ 059 @Deprecated 060 String getMinorVersionPropertyName(String documentType); 061 062 /** 063 * Increments the minor version of a document. 064 * 065 * @param doc the document 066 * @deprecated since 5.4 067 */ 068 @Deprecated 069 DocumentModel incrementMinor(DocumentModel doc); 070 071 /** 072 * Increments the major version of a document and sets the minor to 0. 073 * 074 * @param doc the document 075 * @deprecated since 5.4 076 */ 077 @Deprecated 078 DocumentModel incrementMajor(DocumentModel doc); 079 080}