001/*
002 * (C) Copyright 2007 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: ProtectedEditableModel.java 27477 2007-11-20 19:55:44Z jcarsique $
020 */
021
022package org.nuxeo.ecm.platform.ui.web.model;
023
024import javax.el.ValueExpression;
025import javax.faces.model.DataModel;
026
027/**
028 * Interface for protected editable data model.
029 * <p>
030 * Used to expose only some methods of {@link EditableModel} to user interface.
031 *
032 * @author <a href="mailto:at@nuxeo.com">Anahide Tchertchian</a>
033 */
034public interface ProtectedEditableModel {
035
036    /**
037     * Returns the originating JSF component id this model is attached to.
038     * <p>
039     * Useful to debug model exposure to the context.
040     *
041     * @since 8.1
042     */
043    String getComponentId();
044
045    /**
046     * @see DataModel#getRowCount()
047     */
048    int getRowCount();
049
050    /**
051     * @see DataModel#getRowData()
052     */
053    Object getRowData();
054
055    /**
056     * Sets row data using given value.
057     */
058    void setRowData(Object data);
059
060    /**
061     * @see DataModel#getRowIndex()
062     */
063    int getRowIndex();
064
065    /**
066     * @see EditableModel#isRowNew()
067     */
068    boolean isRowNew();
069
070    /**
071     * @since 7.2
072     */
073    ValueExpression getBinding();
074
075    /**
076     * @since 7.2
077     */
078    ProtectedEditableModel getParent();
079
080}