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 *     bstefanescu
011 *
012 * $Id$
013 */
014
015package org.nuxeo.ecm.core.api.model;
016
017import org.nuxeo.ecm.core.api.PropertyException;
018import org.nuxeo.ecm.core.schema.types.Field;
019import org.nuxeo.ecm.core.schema.types.Schema;
020
021/**
022 * A document part is the root of a property tree which is specified by a schema
023 *
024 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a>
025 */
026public interface DocumentPart extends Property {
027
028    /**
029     * The document schema.
030     *
031     * @return the schema
032     */
033    @Override
034    Schema getSchema();
035
036    Property createProperty(Property parent, Field field);
037
038    Property createProperty(Property parent, Field field, int flags);
039
040    PropertyDiff exportDiff() throws PropertyException;
041
042    void importDiff(PropertyDiff diff) throws PropertyException;
043
044    //
045    // public void setContextData(String key, Object value);
046    //
047    // public Object getContextData(String key);
048
049}