001/*
002 *  Copyright 2010 Anyware Services
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 */
016package org.ametys.cms.form;
017
018import org.ametys.cms.content.external.ExternalizableMetadataProvider.ExternalizableMetadataStatus;
019
020/**
021 * A field for managing externalizable metadata.
022 * This field wraps a field for local value
023 */
024public class ExternalizableField extends AbstractField
025{
026    private AbstractField _localField;
027
028    private AbstractField _extField;
029    
030    private ExternalizableMetadataStatus _status;
031
032    
033    /**
034     * Creates a {@link ExternalizableField}
035     * @param localField The field for local value
036     * @param extField The field for external value
037     * @param status The status
038     */
039    public ExternalizableField(AbstractField localField, AbstractField extField, ExternalizableMetadataStatus status)
040    {
041        _localField = localField;
042        _extField = extField;
043        _status = status;
044    }
045    
046    /**
047     * Get the field holding the local value
048     * @return the local field
049     */
050    public AbstractField getLocalField ()
051    {
052        return _localField;
053    }
054    
055    /**
056     * Get the field holding the external value
057     * @return the external field
058     */
059    public AbstractField getExternalField ()
060    {
061        return _extField;
062    }
063    
064    /**
065     * Get the status (local or external)
066     * @return the status
067     */
068    public ExternalizableMetadataStatus getStatus()
069    {
070        return _status;
071    }
072    
073    
074}