001/* 002 * (C) Copyright 2008 Nuxeo SA (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 * Nuxeo - initial API and implementation 018 * 019 * $Id: CreationContainerListProvider.java 30586 2008-02-26 14:30:17Z ogrisel $ 020 */ 021 022package org.nuxeo.ecm.platform.filemanager.service.extension; 023 024import org.nuxeo.ecm.core.api.CoreSession; 025import org.nuxeo.ecm.core.api.DocumentModelList; 026 027/** 028 * Interface to implement for contributions to the FileManagerService creationContainerListProvider extension point. 029 * <p> 030 * The provider should tell for a given (handled) document type the list of candidate container the user can create new 031 * document in. 032 * 033 * @author Olivier Grisel <ogrisel@nuxeo.com> 034 */ 035public interface CreationContainerListProvider { 036 037 /** 038 * Unique name of the CreationContainerListProvider. The name of a provider should be used for the equals. 039 * 040 * @return the name 041 */ 042 String getName(); 043 044 void setName(String name); 045 046 /** 047 * Arrays of the document types accepted by the CreationContainerListProvider instance. null or empty array mean any 048 * document type is accepted. 049 * 050 * @return arrays of document types 051 */ 052 String[] getDocTypes(); 053 054 void setDocTypes(String[] docTypes); 055 056 /** 057 * Tell whether docType is handled by the provider. 058 * 059 * @param docType name of the document core type 060 * @return true is the docType is accepted 061 */ 062 boolean accept(String docType); 063 064 /** 065 * Build the list of candidate containers for the given document type and session. 066 * 067 * @param documentManager the current session context 068 * @param docType the type of document to create 069 * @return the list of candidate containers 070 */ 071 DocumentModelList getCreationContainerList(CoreSession documentManager, String docType); 072 073}