001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
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.kuali.rice.kew.doctype.service;
017
018import org.kuali.rice.core.framework.impex.xml.XmlExporter;
019import org.kuali.rice.kew.api.rule.Rule;
020import org.kuali.rice.kew.doctype.bo.DocumentType;
021import org.springframework.cache.annotation.CacheEvict;
022import org.springframework.cache.annotation.Cacheable;
023
024import java.util.List;
025
026
027/**
028 * Service for data access of document types.
029 *
030 * @author Kuali Rice Team (rice.collab@kuali.org)
031 */
032public interface DocumentTypeService extends DocumentTypeQueryService, XmlExporter {
033    @CacheEvict(value={Rule.Cache.NAME, org.kuali.rice.kew.api.doctype.DocumentType.Cache.NAME}, allEntries = true)
034    void versionAndSave(DocumentType documentType);
035
036    @CacheEvict(value={Rule.Cache.NAME, org.kuali.rice.kew.api.doctype.DocumentType.Cache.NAME}, allEntries = true)
037    void save(DocumentType documentType);
038
039    @Cacheable(value= org.kuali.rice.kew.api.doctype.DocumentType.Cache.NAME, key="'{BO}allCurrentRootDocuments'")
040    List<DocumentType> findAllCurrentRootDocuments();
041
042    @Cacheable(value= org.kuali.rice.kew.api.doctype.DocumentType.Cache.NAME, key="'{BO}allCurrent'")
043    List<DocumentType> findAllCurrent();
044
045    @Cacheable(value= org.kuali.rice.kew.api.doctype.DocumentType.Cache.NAME, key="'{BO}{previousInstances}' + 'documentTypeName=' + #p0")
046    List<DocumentType> findPreviousInstances(String documentTypeName);
047
048    @Cacheable(value= org.kuali.rice.kew.api.doctype.DocumentType.Cache.NAME, key="'{BO}{childDocumentTypes}' + 'documentTypeId=' + #p0")
049    List<DocumentType> getChildDocumentTypes(String documentTypeId);
050
051    /**
052     *
053     * This method is similar to the findByName method except it is case insensitive.
054     *
055     * @param name
056     * @return
057     */
058    DocumentType findByNameCaseInsensitive(String name);
059}