001/*
002 * Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 * Nuxeo - initial API and implementation
011 */
012
013package org.nuxeo.ecm.core.api.localconfiguration;
014
015import org.nuxeo.ecm.core.api.DocumentModel;
016
017/**
018 * Service handling {@code LocalConfiguration} classes.
019 *
020 * @author <a href="mailto:troger@nuxeo.com">Thomas Roger</a>
021 * @since 5.4.2
022 */
023public interface LocalConfigurationService {
024
025    /**
026     * Returns the first {@code LocalConfiguration} accessible from the {@code currentDoc}, {@code null} otherwise.
027     * <p>
028     * Find the first parent of the {@code currentDoc} having the given {@code configurationFacet}, if any, and adapt it
029     * on the {@code configurationClass}.
030     */
031    public <T extends LocalConfiguration> T getConfiguration(Class<T> configurationClass, String configurationFacet,
032            DocumentModel currentDoc);
033
034}