Interface FileEditorValue

All Superinterfaces:
EditorValue<BinaryMedium>, MediumEditorValue<BinaryMedium>

@Deprecated public interface FileEditorValue extends MediumEditorValue<BinaryMedium>
Deprecated.
Since 5.0.107 - usages of CMS_INPUT_FILE should be replaced with FS_REFERENCE.
Tagging interface for an EditorValue working on BinaryMedium and representing the FirstSpirit input component CMS_IMPUT_FILE. Contains the deprecated definition for file editor values.
Since:
2.3.17
Example:
How to store and get the BinaryMedium from the EditorValue
import de.espirit.firstspirit.access.editor.*;

import de.espirit.firstspirit.access.Language;
import de.espirit.firstspirit.access.editor.value.BinaryMedium;
import de.espirit.firstspirit.access.editor.value.InvalidValueException;


/**
 * Example how to store a file (BinaryMedium) into a FileEditorValue.
 *
 * @since 4.2.34
 */
public class FileEditorValueExample {

	/**
	 * Stores given binary object as language specific value (specified by the given language) for the given editor.
	 *
	 * @since 4.2.34
	 */
	public FileEditorValue setValueForLanguage(final FileEditorValue editor, final BinaryMedium object, final Language language) throws InvalidValueException {

		// 1. check if language is provided if editor is language dependent ("useLanguages='yes'" in gom syntax)
		if (editor.isLanguageDependent() && (language == null)) {
			throw new NullPointerException("Language is missing!");
		}

		// 2. store this instance in the editor value
		editor.set(language, object);

		// 3. and return the instance for further processing
		return editor;
	}


	/**
	 * Gets the language specific value (BinaryMedium) for the given language and file editor.
	 *
	 * @since 4.2.34
	 */
	public BinaryMedium getValueForLanguage(final FileEditorValue editor, final Language language) throws InvalidValueException {

		// 1. get the stored instance in the editor value
		final BinaryMedium medium = editor.get(language);

		// 2. and return the reference container for further processing
		return medium;
	}
}