001/*
002 * (C) Copyright 2018 Nuxeo (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 *     Nuno Cunha (ncunha@nuxeo.com)
018 */
019
020package org.nuxeo.ecm.platform.dublincore.service;
021
022import java.util.Calendar;
023
024import org.nuxeo.ecm.core.api.DocumentModel;
025import org.nuxeo.ecm.core.event.Event;
026
027/**
028 * Former implementation for DublinCore schema storage.
029 *
030 * @since 10.2
031 */
032public interface DublinCoreStorageService {
033
034    String ID = "DublinCoreStorageService";
035
036    /**
037     * Sets the document's creation date.
038     */
039    void setCreationDate(DocumentModel doc, Calendar creationDate);
040
041    /**
042     * Sets the document's creation date.
043     *
044     * @deprecated since 10.2, use directly {@link DublinCoreStorageService#setCreationDate(DocumentModel, Calendar)}
045     */
046    @Deprecated(since = "10.2")
047    default void setCreationDate(DocumentModel doc, Calendar creationDate, @SuppressWarnings("unused") Event event) {
048        setCreationDate(doc, creationDate);
049    }
050
051    /**
052     * Sets the document's issued date.
053     */
054    void setIssuedDate(DocumentModel doc, Calendar issuedDate);
055
056    /**
057     * Sets the document's modified date.
058     */
059    void setModificationDate(DocumentModel doc, Calendar modificationDate);
060
061    /**
062     * Sets the document's modified date.
063     *
064     * @deprecated since 10.2, use directly
065     *             {@link DublinCoreStorageService#setModificationDate(DocumentModel, Calendar)}
066     */
067    @Deprecated(since = "10.2")
068    default void setModificationDate(DocumentModel doc, Calendar modificationDate,
069            @SuppressWarnings("unused") Event event) {
070        setModificationDate(doc, modificationDate);
071    }
072
073    /**
074     * Adds a contributor to the document.
075     */
076    void addContributor(DocumentModel doc, Event event);
077
078}