001package org.nuxeo.ecm.agenda;
002
003import java.io.Serializable;
004import java.util.Date;
005import java.util.Map;
006
007import org.nuxeo.ecm.core.api.CoreSession;
008import org.nuxeo.ecm.core.api.DocumentModel;
009import org.nuxeo.ecm.core.api.DocumentModelList;
010
011/**
012 * @author <a href="mailto:akervern@nuxeo.com">Arnaud Kervern</a>
013 * @since 5.6
014 */
015public interface AgendaService {
016    /**
017     * List user readable agendum between both date
018     *
019     * @param path
020     * @param dtStart the start date
021     * @param dtEnd the end date (included)
022     * @return matching Event as a DocumentModelList object
023     */
024    DocumentModelList listEvents(CoreSession session, String path, Date dtStart, Date dtEnd);
025
026    /**
027     * List incoming user readable agendum with a limit
028     *
029     * @param path
030     * @param limit the number of events returned must be greater than 0 otherwise NuxeoException is thrown
031     * @return matching Event as a DocumentModelList object
032     */
033    DocumentModelList listEvents(CoreSession session, String path, int limit);
034
035    /**
036     * Create a new Event document to the specific path. If the path is blank or "/", the new event will be created into
037     * the UserWorkspace
038     *
039     * @param sesion CoreSession used to create the new doc
040     * @param path base path, if it is blank or "/"; the new event will be created into the UserWorkspace
041     * @param properties corresponding metadata
042     * @return a new Event created
043     */
044    DocumentModel createEvent(CoreSession session, String path, Map<String, Serializable> properties);
045
046}