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 */ 016 017package org.ametys.cms.repository; 018 019import java.util.Date; 020import java.util.Map; 021 022import org.ametys.cms.content.references.OutgoingReferences; 023import org.ametys.core.user.UserIdentity; 024import org.ametys.plugins.repository.AmetysRepositoryException; 025import org.ametys.plugins.repository.RemovableAmetysObject; 026import org.ametys.plugins.repository.dublincore.ModifiableDublinCoreAwareAmetysObject; 027import org.ametys.plugins.repository.metadata.ModifiableMetadataAwareAmetysObject; 028 029/** 030 * Modifiable content abstraction 031 */ 032public interface ModifiableContent extends Content, ModifiableMetadataAwareAmetysObject, ModifiableDublinCoreAwareAmetysObject, RemovableAmetysObject, TaggableAmetysObject 033{ 034 /** 035 * Set the types of this Content.<br> 036 * @param types the types of this content. 037 * @throws AmetysRepositoryException if an error occurs. 038 */ 039 public void setTypes(String[] types) throws AmetysRepositoryException; 040 041 /** 042 * Set the mixins of this Content.<br> 043 * @param mixins the mixins of this content. 044 * @throws AmetysRepositoryException if an error occurs. 045 */ 046 public void setMixinTypes(String[] mixins) throws AmetysRepositoryException; 047 048 /** 049 * Set the type of this Content.<br> 050 * This method may only be called on a new Content, ie. before its first save. 051 * @param language the language of this content. 052 * @throws AmetysRepositoryException if an error occurs. 053 */ 054 public void setLanguage(String language) throws AmetysRepositoryException; 055 056 /** 057 * Set the title. 058 * @param title the title. 059 * @throws AmetysRepositoryException if an error occurs. 060 */ 061 public void setTitle(String title) throws AmetysRepositoryException; 062 063 /** 064 * Set the login of the creator. 065 * @param user the creator. 066 * @throws AmetysRepositoryException if an error occurs. 067 */ 068 public void setCreator(UserIdentity user) throws AmetysRepositoryException; 069 070 /** 071 * Set the creation date. 072 * @param creationDate the creation date. 073 * @throws AmetysRepositoryException if an error occurs. 074 */ 075 public void setCreationDate(Date creationDate) throws AmetysRepositoryException; 076 077 /** 078 * Set the login of the last contributor. 079 * @param user the last contributor. 080 * @throws AmetysRepositoryException if an error occurs. 081 */ 082 public void setLastContributor(UserIdentity user) throws AmetysRepositoryException; 083 084 /** 085 * Set the last modification date. 086 * @param lastModified the last modification date. 087 * @throws AmetysRepositoryException if an error occurs. 088 */ 089 public void setLastModified(Date lastModified) throws AmetysRepositoryException; 090 091 /** 092 * Set the last validation date 093 * @param validationDate the validation date. 094 * @throws AmetysRepositoryException if an error occurs. 095 */ 096 public void setLastValidationDate (Date validationDate) throws AmetysRepositoryException; 097 098 /** 099 * Set the last validation date resulting from a major modification 100 * @param validationDate the validation date. 101 * @throws AmetysRepositoryException if an error occurs. 102 */ 103 public void setLastMajorValidationDate (Date validationDate) throws AmetysRepositoryException; 104 105 /** 106 * Store the outgoing references of the content. 107 * @param references A non null map of outgoing references grouped by metadata (key are metadata path) 108 * @throws AmetysRepositoryException if an error occurs. 109 */ 110 public void setOutgoingReferences(Map<String, OutgoingReferences> references) throws AmetysRepositoryException; 111}