Interface PictureEditorValue

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

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

import de.espirit.firstspirit.access.Language;
import de.espirit.firstspirit.access.editor.value.GraphicalMedium;
import de.espirit.firstspirit.access.editor.value.InvalidValueException;
import de.espirit.firstspirit.access.store.mediastore.Media;

import org.jetbrains.annotations.NotNull;


/**
 * Example how to store a picture (GraphicalMedium) into a PictureEditorValue
 *
 * @since 4.2.34
 */
public class PictureEditorValueExample {

	/**
	 * Stores given media as language specific value (specified by the given language) for the given editor
	 *
	 * @since 4.2.34
	 */
	public PictureEditorValue setValueForLanguage(final PictureEditorValue editor, @NotNull final Media media, final Language language) {
		// 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. check if given media is of type PICTURE
		if (media.getType() != Media.PICTURE) {
			throw new IllegalArgumentException("only media of type PICTURE allowed for PictureEditorValue");
		}

		// 3. get the editor data container for the given language
		final GraphicalMedium graphicalMedium = editor.get(language);

		// 4. store the given media in data container
		graphicalMedium.setMedium(media);

		// 5. return the instance for further processing
		return editor;

	}


	/**
	 * Gets the language specific value (GraphicalMedium) for the given language and picture editor
	 *
	 * @since 4.2.34
	 */
	public GraphicalMedium getValueForLanguage(final PictureEditorValue editor, final Language language) throws InvalidValueException {

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

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

    • WIDTH_KEY

      static final String WIDTH_KEY
      Deprecated.
      The key to store the width.
      Since:
      4.0.17
      See Also:
    • HEIGHT_KEY

      static final String HEIGHT_KEY
      Deprecated.
      The key to store the height.
      Since:
      4.0.17
      See Also:
    • HSPACE_KEY

      static final String HSPACE_KEY
      Deprecated.
      The key to store the horizontal spacing.
      Since:
      4.0.17
      See Also:
    • VSPACE_KEY

      static final String VSPACE_KEY
      Deprecated.
      The key to store the vertical spacing.
      Since:
      4.0.17
      See Also:
    • BORDER_KEY

      static final String BORDER_KEY
      Deprecated.
      The key to store the border width.
      Since:
      4.0.17
      See Also:
  • Method Details

    • getForm

      GomPicture getForm()
      Deprecated.
      Covariant return of concrete form container.
      Specified by:
      getForm in interface EditorValue<GraphicalMedium>
      Specified by:
      getForm in interface MediumEditorValue<GraphicalMedium>
      Returns:
      The form definition.
      Since:
      4.0.17
    • get

      @NotNull @NotNull GraphicalMedium get(Language language)
      Deprecated.
      Get the value object in the specified language. If the editor is not language dependent, the returned object always will be the same for any given language.
      Specified by:
      get in interface EditorValue<GraphicalMedium>
      Parameters:
      language - The language to look up.
      Returns:
      The language specific value object.
      Since:
      4.0.17