Interface ContentAreaListValue
- All Superinterfaces:
EditorValue<SectionList>
Deprecated.
Tagging interface for an
EditorValue
representing the FirstSpirit input component CMS_INPUT_CONTENTAREALIST.- Since:
- 3.0.78
- Example:
- How to get and store the list of referenced sections
import de.espirit.firstspirit.access.editor.*; import de.espirit.firstspirit.access.Language; import de.espirit.firstspirit.access.editor.value.InvalidValueException; import de.espirit.firstspirit.access.editor.value.SectionList; import de.espirit.firstspirit.access.project.Project; import de.espirit.firstspirit.access.store.pagestore.Section; import de.espirit.firstspirit.access.store.templatestore.SectionTemplate; import org.jetbrains.annotations.Nullable; import java.util.Iterator; /** * Example how to get the list of sections and create new section(s) from a ContentAreaListValue and store a section into a ContentAreaListValue. * * @since 4.2.34 */ public class ContentAreaListValueExample { /** * Creates a new section in the given ContentAreaListValue editor - using a section template of the given template store. * * @since 4.2.200 */ public Section createSection(final ContentAreaListValue editor, final Project project) throws InvalidValueException { // 1. get project masterlanguage final Language masterLanguage = project.getMasterLanguage(); // 2. get the Section List // - ContentAreaList is language independent by contract, therefore it doesn't matter which language is used final SectionList sectionList = editor.get(masterLanguage); // 3. use the first section template of allowed templates final Iterator<SectionTemplate> allowedIterator = editor.getAllowedSectionTemplates().iterator(); if (!allowedIterator.hasNext()) { throw new IllegalStateException("no allowed templates defined for this editor"); } final SectionTemplate sectionTemplate = allowedIterator.next(); // 4. create the new section -> will be added automatically final Section section = sectionList.create("NewSection", sectionTemplate); // 5. store the modified section list to the editor editor.set(masterLanguage, sectionList); return section; } /** * Returns the first section of the given ContentAreaListValue editor. * * @since 4.2.200 */ @Nullable public Section getFirstSection(final ContentAreaListValue editor, final Project project) { // 1. get project masterlanguage final Language masterLanguage = project.getMasterLanguage(); // 2. get the SectionList // - ContentAreaList is language independent by contract, therefore it doesn't matter which language is used final SectionList sectionList = editor.get(masterLanguage); // 3. get the first Section out of the SectionList Section section = null; if (!sectionList.isEmpty()) { section = sectionList.get(0); } return section; } /** * Returns the SectionList (persistence object) of the given ContentAreaListValue editor * * @since 4.2.200 */ @Nullable public SectionList getSectionList(final ContentAreaListValue editor, final Project project) { // 1. get project masterlanguage final Language masterLanguage = project.getMasterLanguage(); // 2. get the SectionList // - ContentAreaList is language independent by contract, therefore it doesn't matter which language is used return editor.get(masterLanguage); } }
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Deprecated.Section container key.static final String
Deprecated.Section entry key.Fields inherited from interface de.espirit.firstspirit.access.editor.EditorValue
COPY_PRESET, DEFAULT, DELETE, FALLBACK_LANGUAGE, LANG_KEY, SOLE_LANGUAGE, UNSUPPORTED
-
Method Summary
Modifier and TypeMethodDescription@NotNull SectionList
Deprecated.Get the value object in the specified language.@NotNull Iterable<SectionTemplate>
Deprecated.Returns an unmodifiable iterable of allowedsection templates
which could be used tocreate
new sections.Deprecated.since 4.2.200 - usegetAllowedSectionTemplates()
insteadString[]
Deprecated.Provides the display names as array.String[]
getDisplayValues
(Section section) Deprecated.Provides the display values for the given section as array.getForm()
Deprecated.Covariant return of concrete form container.Methods inherited from interface de.espirit.firstspirit.access.editor.EditorValue
addEditorValueListener, assimilate, beSet, clear, clear, findReferences, getContentType, getDataValue, getEditorLanguages, getGuiXml, getMatches, getSearchableString, getTagName, getValueType, initialize, isDefault, isEmpty, isLanguageDependent, isSet, isSet, isValid, removeEditorValueListener, set, setTagName, setValueNode, toXml, toXml, validate
-
Field Details
-
CONTENTAREA_LIST_KEY
Deprecated.Section container key.- Since:
- 4.0.17
- See Also:
-
SECTION_KEY
Deprecated.Section entry key.- Since:
- 4.0.17
- See Also:
-
-
Method Details
-
getForm
GomContentAreaList getForm()Deprecated.Covariant return of concrete form container.- Specified by:
getForm
in interfaceEditorValue<SectionList>
- Returns:
- The form definition.
- Since:
- 4.0.17
-
getAllowedTemplates
Deprecated.since 4.2.200 - usegetAllowedSectionTemplates()
insteadForwards togetAllowedSectionTemplates()
, providing an array instead of a list.- Returns:
- Array of section templates.
- Since:
- 3.0.78
-
getAllowedSectionTemplates
Deprecated.Returns an unmodifiable iterable of allowedsection templates
which could be used tocreate
new sections.- Returns:
- an unmodifiable iterable of allowed
section templates
for this editor - Since:
- 4.2.200
-
getDisplayNames
String[] getDisplayNames()Deprecated.Provides the display names as array.- Returns:
- Thedisplay names.
- Since:
- 3.0.78
-
getDisplayValues
Deprecated.Provides the display values for the given section as array.- Parameters:
section
- The section.- Returns:
- The display values.
- Since:
- 3.0.78
-
get
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 interfaceEditorValue<SectionList>
- Parameters:
language
- The language to look up.- Returns:
- The language specific value object.
- Since:
- 4.0.17
-
FS_CATALOG
.