001/*
002 *  Copyright 2010 Anyware Services
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 */
016package org.ametys.cms.repository;
017
018import java.time.ZonedDateTime;
019
020import org.ametys.plugins.repository.AmetysRepositoryException;
021import org.ametys.plugins.workflow.repository.WorkflowAwareAmetysObject;
022
023/**
024 * {@link Content} abstraction defined by the following additional property:
025 * <dl>
026 *   <dt>workflowId
027 *   <dd>the id of the workflow instance associated with the content
028 * </dl>
029 */
030public interface WorkflowAwareContent extends Content, WorkflowAwareAmetysObject
031{
032    /**
033     * Retrieves the date at which the content was proposed for validation,
034     * i.e. put in a workflow step in which it's awaiting validation.
035     * @return the date at which the content was proposed for validation.
036     * @throws AmetysRepositoryException if an error occurs.
037     */
038    ZonedDateTime getProposalDate() throws AmetysRepositoryException;
039    
040    /**
041     * Set the date at which the content was proposed for validation, i.e.
042     * put in a workflow step in which it's awaiting validation.
043     * @param proposalDate the date at which the content was proposed for validation, or null to remove it.
044     * @throws AmetysRepositoryException if an error occurs.
045     */
046    void setProposalDate(ZonedDateTime proposalDate) throws AmetysRepositoryException;
047    
048}
049