Interface SiteStoreFolder
- All Superinterfaces:
Comparable<StoreElement>
,DataProvider
,HistoryProvider
,IDProvider
,StartNode
,StoreElement
,Workflowable
- All Known Subinterfaces:
PageRefFolder
,SiteStoreRoot
Interface providing means to operate on site store folders.
- Since:
- 3.0
- Example:
- Example how to modify variables of SiteStoreFolder
import de.espirit.firstspirit.access.store.sitestore.*; import de.espirit.firstspirit.access.Language; import de.espirit.firstspirit.access.editor.SiteStoreVariableValue; import de.espirit.firstspirit.access.editor.value.InvalidValueException; import de.espirit.firstspirit.access.store.Data; import de.espirit.firstspirit.access.store.DataValue; import de.espirit.firstspirit.access.store.ElementDeletedException; import de.espirit.firstspirit.access.store.LockException; import de.espirit.firstspirit.forms.FormField; import de.espirit.firstspirit.forms.NoSuchFormFieldException; /** * Examples how to modify variables of SiteStoreFolder. * * @since 4.2.34 */ public class SiteStoreFolderVariablesExample { /** * Example how to add a variable. * * @since 4.2.34 * @deprecated since 4.2.440 - see {@link #addVariable_FormData(SiteStoreFolder)} instead */ @Deprecated public void addVariable(final SiteStoreFolder folder) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvalidValueException, LockException, ElementDeletedException { final String variableName = "myVariable"; // 1. lock the folder folder.setLock(true, false); try { // 2. retrieve Data (variables) from SiteStoreFolder final Data data = folder.getData(); // 3. try to retrieve a DataValue (variable) with desired name DataValue dataValue = data.get(variableName); // 4. if a DataValue is existent, no new one can created using the desired name if (dataValue != null) { throw new IllegalArgumentException("Variable named " + variableName + " already existent!"); } // 5. create new DataValue (variable) dataValue = data.create(variableName, folder.getProject().getUserService(), null); // 6. retrieve the EditorValue from DataValue final SiteStoreVariableValue editor = (SiteStoreVariableValue) dataValue.getEditor(); // 7. set desired value for each language for (final Language language : folder.getProject().getLanguages()) { editor.set(language, "myValue"); } // 8. don't forget to set changed data back to folder folder.setData(data); // 9. save changes and unlock the folder folder.save("add variable", false); } finally { folder.setLock(false, false); } } /** * Example how to add a variable. * * @since 4.2.440 */ public void addVariable_FormData(final SiteStoreFolder folder) throws LockException, ElementDeletedException { final String variableName = "myVariable"; // 1. lock the folder folder.setLock(true, false); try { // 2. retrieve FormData (variables) from SiteStoreFolder final SiteStoreVariableFormData formData = folder.getFormData(); // 3. try to retrieve a DataValue (variable) with desired name FormField<String> formField; final Language masterLanguage = folder.getProject().getMasterLanguage(); try { formField = formData.get(masterLanguage, variableName); } catch (NoSuchFormFieldException e) { formField = formData.createVariable(masterLanguage, variableName); } // 4. set new value formField.set("myValue"); // 5. don't forget to set changed data back to folder folder.setFormData(formData); // 6. save changes and unlock the folder folder.save("add variable", false); } finally { folder.setLock(false, false); } } /** * Example how to change a variables value. * * @since 4.2.34 * @deprecated since 4.2.440 - see {@link #setVariableValue_FormData(SiteStoreFolder)} instead */ @Deprecated public void setVariableValue(final SiteStoreFolder folder) throws InvalidValueException, LockException, ElementDeletedException { final String variableName = "myVariable"; // 1. lock the folder folder.setLock(true, false); try { // 2. retrieve Data (variables) from SiteStoreFolder final Data data = folder.getData(); // 3. try to retrieve a DataValue (variable) with desired name final DataValue dataValue = data.get(variableName); // 4. check existence of the DataValue (variable) if (dataValue == null) { throw new IllegalArgumentException("Variable named " + variableName + " doesn't exist!"); } // 5. retrieve the EditorValue from DataValue final SiteStoreVariableValue editor = (SiteStoreVariableValue) dataValue.getEditor(); // 6. set desired value for each language for (final Language language : folder.getProject().getLanguages()) { editor.set(language, "myNewValue"); } // 7. don't forget to set changed data back to folder folder.setData(data); // 8. save changes and unlock the folder folder.save("set variable value", false); } finally { folder.setLock(false, false); } } /** * Example how to change a variable value. * * @since 4.2.440 */ public void setVariableValue_FormData(final SiteStoreFolder folder) throws InvalidValueException, LockException, ElementDeletedException { final String variableName = "myVariable"; // 1. lock the folder folder.setLock(true, false); // 2. retrieve FormData (variables) from SiteStoreFolder final SiteStoreVariableFormData formData = folder.getFormData(); try { // 3. try to retrieve a form field with desired name final FormField<String> field = formData.get(folder.getProject().getMasterLanguage(), variableName); // 4. set new value field.set("myNewValue"); // 5. don't forget to set changed formdata back to folder folder.setFormData(formData); // 6. save changes and unlock the folder folder.save("set variable value", false); } finally { folder.setLock(false, false); } } /** * Example how to remove a variable. * * @since 4.2.440 * @deprecated since 4.2.440 - see {@link #removeVariable_FormData(SiteStoreFolder)} instead */ @Deprecated public void removeVariable(final SiteStoreFolder folder) throws LockException, ElementDeletedException { final String variableName = "myVariable"; // 1. lock the folder folder.setLock(true, false); try { // 2. retrieve Data (variables) from SiteStoreFolder final Data data = folder.getData(); // 3. try to retrieve a DataValue (variable) with desired name final DataValue dataValue = data.get(variableName); // 4. check existence of the DataValue (variable) if (dataValue == null) { throw new IllegalArgumentException("Variable named " + variableName + " doesn't exist!"); } // 5. remove the DataValue data.remove(dataValue); // 6. don't forget to set changed data back to folder folder.setData(data); // 7. save changes and unlock the folder folder.save("remove variable", false); } finally { folder.setLock(false, false); } } /** * Example how to remove a variable. * * @since 4.2.34 */ public void removeVariable_FormData(final SiteStoreFolder folder) throws LockException, ElementDeletedException { final String variableName = "myVariable"; // 1. lock the folder folder.setLock(true, false); try { // 2. retrieve FormData (variables) from SiteStoreFolder final SiteStoreVariableFormData formData = folder.getFormData(); // 3. remove variable with desired name formData.removeVariable(variableName); // 4. don't forget to set changed formdata back to folder folder.setFormData(formData); // 5. save changes and unlock the folder folder.save("remove variable", false); } finally { folder.setLock(false, false); } } }
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.espirit.firstspirit.storage.HistoryProvider
HistoryProvider.RevisionProvider
Nested classes/interfaces inherited from interface de.espirit.firstspirit.access.store.IDProvider
IDProvider.DependentReleaseType, IDProvider.RevertType, IDProvider.UidType
-
Field Summary
Modifier and TypeFieldDescriptionstatic final IDProvider.UidType
Uid type as returned byIDProvider.getUidType()
.Fields inherited from interface de.espirit.firstspirit.storage.HistoryProvider
ALL_REVISIONS, EVER_SINCE, UNTIL_NOW
Fields inherited from interface de.espirit.firstspirit.access.store.IDProvider
CHANGED, NEVER_RELEASED, RELEASED
-
Method Summary
Modifier and TypeMethodDescriptioncreateDocumentGroup
(String uid, boolean unifyNameOnServer) Creates a new document group in this folder.createPageGroup
(String name) Create a new page-group for the current PageReference.createPageRef
(String uid, Page page) Create a new page reference entry.createPageRef
(String uid, Page page, boolean unifyNameOnServer) Creates a new page reference in this folder.createPageRef
(String uid, Page page, Map<Language, String> lang2DisplayName, boolean unifyNameOnServer) Creates a new page reference in this folder.
The given uid is used as suggestion.Create a new SiteStore-folder in this folder.createPageRefFolder
(String uid, boolean unifyNameOnServer) Create a new PageRefFolder as child of this folder.createPageRefFolder
(String uid, Map<Language, String> lang2DisplayName, boolean unifyNameOnServer) Create a new PageRefFolder as child of this folder.@NotNull PageRefFolder
createPageRefFolder
(String uid, Map<Language, String> lang2DisplayName, boolean unifyNameOnServer, IDProvider nextSibling) Create a new PageRefFolder as child of this folder and place it before the given next sibling.void
deletePageGroup
(PageGroup pageGroup) Delete the given page-group for the current PageReference@Nullable StartNode
Finds recursive the start node in this sub tree.@NotNull SiteStoreVariableFormData
Gets a form data container containing containig all defined sitestore variables.Get the list of the page-groups for the current PageReference@Nullable SiteStoreFolder
Get the parent folder.@Nullable StartNode
Returns the startnode of this folder which is a direct child of this folder ornull
if no start node is defined.@Nullable String
getStoredUrl
(@NotNull Language language, @NotNull TemplateSet templateSet) Get the stored URL for this node and the provided combination of language and template set.boolean
isFolder()
All implementing classes must returntrue
.void
setStartNode
(StartNode startNode) Sets the given StartNode as startnode of this sitestore folder.Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface de.espirit.firstspirit.access.store.pagestore.DataProvider
clearCachedData, getData, setData, setFormData
Methods inherited from interface de.espirit.firstspirit.storage.HistoryProvider
asRevisionProvider, getHistory, getHistory
Methods inherited from interface de.espirit.firstspirit.access.store.IDProvider
contrastWith, getDisplayName, getId, getInRevision, getLanguageInfo, getLongID, getMeta, getMetaFormData, getParent, getReleasedBy, getReleaseRevision, getReleaseStatus, getRevision, getUid, getUidType, hasMeta, hasUid, isInReleaseStore, isReleased, isReleaseSupported, moveChild, moveChild, release, release, revert, setDisplayName, setMeta, setMetaFormData, setUid
Methods inherited from interface de.espirit.firstspirit.access.store.sitestore.StartNode
isStartNode
Methods inherited from interface de.espirit.firstspirit.access.store.StoreElement
appendChild, appendChildBefore, delete, exportStoreElement, getChildCount, getChildIndex, getChildren, getChildren, getChildren, getChildren, getCreateWorkflowPermission, getDefinedPrincipalPermissions, getEditor, getElementType, getFirstChild, getIncomingReferences, getInheritedPrincipalPermissions, getLastChanged, getName, getNextSibling, getOutgoingReferences, getPermission, getPermission, getPermission, getPreviousSibling, getProject, getReferenceName, getReferences, getStore, getTreePermission, getWorkflowPermission, getWorkflowPermissions, getWriteLock, hasIncomingReferences, hasPermissions, importStoreElement, importStoreElements, inheritWorkflowPermission, isDeleted, isExportSupported, isImportSupported, isLocked, isLockedOnServer, isLockSupported, isPermissionSupported, isWorkflowAllowed, isWorkflowSupported, refresh, removeAllWorkflowPermissions, removeChild, removePermission, removePermission, removePermission, removeWorkflowPermission, replaceChild, save, save, save, setInheritWorkflowPermission, setLock, setLock, setPermission, setPermission, setPermission, setWorkflowPermission, setWorkflowPermissions, setWriteLock, toXml, toXml, toXml
Methods inherited from interface de.espirit.firstspirit.access.Workflowable
getColor, getTask, hasTask, removeTask, setColor, setTask
-
Field Details
-
UID_TYPE
Uid type as returned byIDProvider.getUidType()
.- Since:
- 4.0.43
-
-
Method Details
-
getParentFolder
Get the parent folder.- Returns:
- an instance of
SiteStoreRoot
orPageRefFolder
, ornull
if the folder is not part of the tree or the root node - Since:
- 3.0
-
isFolder
boolean isFolder()All implementing classes must returntrue
.- Specified by:
isFolder
in interfaceStoreElement
- Returns:
true
- Since:
- 3.0
-
getStartNode
Returns the startnode of this folder which is a direct child of this folder ornull
if no start node is defined.- Returns:
- The defined startnode or
null
if no start node is defined. - Since:
- 4.0.27
- See Also:
-
setStartNode
Sets the given StartNode as startnode of this sitestore folder.- Parameters:
startNode
- The node to set as start node.- Since:
- 4.0.27
- See Also:
-
findStartNode
Finds recursive the start node in this sub tree. This may returnnull
, e.g. in case this is an empty folder.
The returned node (if notnull
) is instance ofPageRef
and may not be a direct child of this folder.- Returns:
- A
PageRef
ornull
. - Since:
- 4.0.27
- See Also:
-
createPageRefFolder
Create a new SiteStore-folder in this folder. Short forcreatePageRefFolder(name, false)
.- Parameters:
uid
- uid of the new SiteStore-folder- Returns:
- SiteStore-folder as an object
- Throws:
DuplicateReferenceNameException
- if an element with the given uid in the same namescope already exists on the serverLockException
- If the folder is locked by another session.ElementDeletedException
- If the current node has been deleted.- Since:
- 3.0
-
createPageRefFolder
PageRefFolder createPageRefFolder(String uid, boolean unifyNameOnServer) throws LockException, DuplicateReferenceNameException, ElementDeletedException Create a new PageRefFolder as child of this folder.- Parameters:
uid
- uid of the new PageRefFolderunifyNameOnServer
- iffalse
aDuplicateReferenceNameException
may be thrown, iftrue
the name will be unified on the server if necessary- Returns:
- SiteStore-folder as an object
- Throws:
LockException
- if this folder is locked in another sessionDuplicateReferenceNameException
- if an element with the given uid in the same namescope already exits on the serverElementDeletedException
- if this folder is already deleted on the server- Since:
- 4.0
-
createPageRefFolder
PageRefFolder createPageRefFolder(String uid, Map<Language, String> lang2DisplayName, boolean unifyNameOnServer) throws LockException, DuplicateReferenceNameException, ElementDeletedExceptionCreate a new PageRefFolder as child of this folder.- Parameters:
uid
- uid of the new PageRefFolderlang2DisplayName
- mapping of language to language specific displayname; used to createLanguageInfo
nodesunifyNameOnServer
- iffalse
aDuplicateReferenceNameException
may be thrown, iftrue
the name will be unified on the server if necessary- Returns:
- SiteStore-folder as an object
- Throws:
LockException
- if this folder is locked in another sessionDuplicateReferenceNameException
- if unifyNameOnServer isfalse
and an element with the given uid in the same namescope already exits on the serverElementDeletedException
- if this folder is already deleted on the server- Since:
- 4.0
-
createPageRefFolder
@NotNull @NotNull PageRefFolder createPageRefFolder(String uid, Map<Language, String> lang2DisplayName, boolean unifyNameOnServer, IDProvider nextSibling) throws LockException, DuplicateReferenceNameException, ElementDeletedExceptionCreate a new PageRefFolder as child of this folder and place it before the given next sibling. If no next sibling is given or the given one is no child of this folder, the new child will be appended.- Parameters:
uid
- The uid of the new PageRefFolderlang2DisplayName
- The mapping of language to language specific displayname; used to createLanguageInfo
nodesunifyNameOnServer
- iffalse
aDuplicateReferenceNameException
may be thrown, iftrue
the name will be unified on the server if necessarynextSibling
- A sibling to add the new child before in order ornull
to append the new child.- Returns:
- SiteStore-folder as an object
- Throws:
LockException
- if this folder is locked in another sessionDuplicateReferenceNameException
- if unifyNameOnServer isfalse
and an element with the given uid in the same namescope already exits on the serverElementDeletedException
- if this folder is already deleted on the server- Since:
- 5.0.11
-
createPageRef
PageRef createPageRef(String uid, Page page) throws DuplicateReferenceNameException, LockException, ElementDeletedException Create a new page reference entry.- Parameters:
uid
- uid of the new pagerefpage
- page to which the new reference will be linked- Returns:
- the new created page ref instance
- Throws:
LockException
- if this folder is locked in another sessionDuplicateReferenceNameException
- if there is already an element with the specified uid in the same namescope on the serverElementDeletedException
- if this folder is already deleted on the server- Since:
- 3.0
-
createPageRef
PageRef createPageRef(String uid, Page page, boolean unifyNameOnServer) throws LockException, ElementDeletedException Creates a new page reference in this folder. The given name is used as suggestion ifunifyNameOnServer == true
and will be unified on the server if it is necessary.- Parameters:
uid
- of the new page refpage
- page to which the new reference will be linkedunifyNameOnServer
- iftrue
the given uid will be unified on server if necessary, otherwise aDuplicateReferenceNameException
will be thrown, if a pageref with the given uid already exists on the server- Returns:
- the new created page ref instance
- Throws:
LockException
- if this folder is locked in another sessionDuplicateReferenceNameException
- if a pageref with the given uid already exists on the serverElementDeletedException
- if this folder is already deleted on the server- Since:
- 4.0
-
createPageRef
PageRef createPageRef(String uid, Page page, Map<Language, String> lang2DisplayName, boolean unifyNameOnServer) throws LockException, ElementDeletedExceptionCreates a new page reference in this folder.
The given uid is used as suggestion. IfunifyNameOnServer == true
the given uid will be unified on server if necessary, otherwise aDuplicateReferenceNameException
will be thrown, if a pageref with the given uid already exists on the server.- Parameters:
uid
- of the new page refpage
- page to which the new reference will be linkedlang2DisplayName
- mapping of language to language specific displayname; used to createLanguageInfo
nodesunifyNameOnServer
- iftrue
the given uid will be unified on server if necessary, otherwise aDuplicateReferenceNameException
will be thrown, if a pageref with the given uid already exists on the server- Returns:
- the new created page ref instance
- Throws:
LockException
- if this folder is locked in another sessionDuplicateReferenceNameException
- if unifyNameOnServer isfalse
and a pageref with the given uid exists on the serverElementDeletedException
- if this folder is already deleted on the server- Since:
- 4.2.400
-
createDocumentGroup
DocumentGroup createDocumentGroup(String uid, boolean unifyNameOnServer) throws LockException, DuplicateReferenceNameException, LicenseException, ElementDeletedException Creates a new document group in this folder. The given uid is used as suggestion ifunifyNameOnServer == true
and will be unified on the server if it is necessary.
Attention: This functionality is license dependent. To use this method your FIRSTspirit license needs feature 'DOCUMENTGROUP'- Parameters:
uid
- of the new document groupunifyNameOnServer
- iftrue
the given uid will be unified on server if necessary, otherwise aDuplicateReferenceNameException
will be thrown, if an element with the given uid in the same namescope already exists on the server- Returns:
- the new document group
- Throws:
LockException
- if this folder is locked in another sessionDuplicateReferenceNameException
- ifunifyNameOnServer == false
and an element with the given uid already exists on the serverLicenseException
- if the installed FIRSTspirit license has no feature 'DOCUMENTGROUP'ElementDeletedException
- Since:
- 4.0.17
-
getFormData
Gets a form data container containing containig all defined sitestore variables. Inherited values are not included.- Specified by:
getFormData
in interfaceDataProvider
- Returns:
- the formdata container of this element.
- Since:
- 4.2.440
- Example:
- Example how to modify variables of SiteStoreFolder
import de.espirit.firstspirit.access.store.sitestore.*; import de.espirit.firstspirit.access.Language; import de.espirit.firstspirit.access.editor.SiteStoreVariableValue; import de.espirit.firstspirit.access.editor.value.InvalidValueException; import de.espirit.firstspirit.access.store.Data; import de.espirit.firstspirit.access.store.DataValue; import de.espirit.firstspirit.access.store.ElementDeletedException; import de.espirit.firstspirit.access.store.LockException; import de.espirit.firstspirit.forms.FormField; import de.espirit.firstspirit.forms.NoSuchFormFieldException; /** * Examples how to modify variables of SiteStoreFolder. * * @since 4.2.34 */ public class SiteStoreFolderVariablesExample { /** * Example how to add a variable. * * @since 4.2.34 * @deprecated since 4.2.440 - see {@link #addVariable_FormData(SiteStoreFolder)} instead */ @Deprecated public void addVariable(final SiteStoreFolder folder) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvalidValueException, LockException, ElementDeletedException { final String variableName = "myVariable"; // 1. lock the folder folder.setLock(true, false); try { // 2. retrieve Data (variables) from SiteStoreFolder final Data data = folder.getData(); // 3. try to retrieve a DataValue (variable) with desired name DataValue dataValue = data.get(variableName); // 4. if a DataValue is existent, no new one can created using the desired name if (dataValue != null) { throw new IllegalArgumentException("Variable named " + variableName + " already existent!"); } // 5. create new DataValue (variable) dataValue = data.create(variableName, folder.getProject().getUserService(), null); // 6. retrieve the EditorValue from DataValue final SiteStoreVariableValue editor = (SiteStoreVariableValue) dataValue.getEditor(); // 7. set desired value for each language for (final Language language : folder.getProject().getLanguages()) { editor.set(language, "myValue"); } // 8. don't forget to set changed data back to folder folder.setData(data); // 9. save changes and unlock the folder folder.save("add variable", false); } finally { folder.setLock(false, false); } } /** * Example how to add a variable. * * @since 4.2.440 */ public void addVariable_FormData(final SiteStoreFolder folder) throws LockException, ElementDeletedException { final String variableName = "myVariable"; // 1. lock the folder folder.setLock(true, false); try { // 2. retrieve FormData (variables) from SiteStoreFolder final SiteStoreVariableFormData formData = folder.getFormData(); // 3. try to retrieve a DataValue (variable) with desired name FormField<String> formField; final Language masterLanguage = folder.getProject().getMasterLanguage(); try { formField = formData.get(masterLanguage, variableName); } catch (NoSuchFormFieldException e) { formField = formData.createVariable(masterLanguage, variableName); } // 4. set new value formField.set("myValue"); // 5. don't forget to set changed data back to folder folder.setFormData(formData); // 6. save changes and unlock the folder folder.save("add variable", false); } finally { folder.setLock(false, false); } } /** * Example how to change a variables value. * * @since 4.2.34 * @deprecated since 4.2.440 - see {@link #setVariableValue_FormData(SiteStoreFolder)} instead */ @Deprecated public void setVariableValue(final SiteStoreFolder folder) throws InvalidValueException, LockException, ElementDeletedException { final String variableName = "myVariable"; // 1. lock the folder folder.setLock(true, false); try { // 2. retrieve Data (variables) from SiteStoreFolder final Data data = folder.getData(); // 3. try to retrieve a DataValue (variable) with desired name final DataValue dataValue = data.get(variableName); // 4. check existence of the DataValue (variable) if (dataValue == null) { throw new IllegalArgumentException("Variable named " + variableName + " doesn't exist!"); } // 5. retrieve the EditorValue from DataValue final SiteStoreVariableValue editor = (SiteStoreVariableValue) dataValue.getEditor(); // 6. set desired value for each language for (final Language language : folder.getProject().getLanguages()) { editor.set(language, "myNewValue"); } // 7. don't forget to set changed data back to folder folder.setData(data); // 8. save changes and unlock the folder folder.save("set variable value", false); } finally { folder.setLock(false, false); } } /** * Example how to change a variable value. * * @since 4.2.440 */ public void setVariableValue_FormData(final SiteStoreFolder folder) throws InvalidValueException, LockException, ElementDeletedException { final String variableName = "myVariable"; // 1. lock the folder folder.setLock(true, false); // 2. retrieve FormData (variables) from SiteStoreFolder final SiteStoreVariableFormData formData = folder.getFormData(); try { // 3. try to retrieve a form field with desired name final FormField<String> field = formData.get(folder.getProject().getMasterLanguage(), variableName); // 4. set new value field.set("myNewValue"); // 5. don't forget to set changed formdata back to folder folder.setFormData(formData); // 6. save changes and unlock the folder folder.save("set variable value", false); } finally { folder.setLock(false, false); } } /** * Example how to remove a variable. * * @since 4.2.440 * @deprecated since 4.2.440 - see {@link #removeVariable_FormData(SiteStoreFolder)} instead */ @Deprecated public void removeVariable(final SiteStoreFolder folder) throws LockException, ElementDeletedException { final String variableName = "myVariable"; // 1. lock the folder folder.setLock(true, false); try { // 2. retrieve Data (variables) from SiteStoreFolder final Data data = folder.getData(); // 3. try to retrieve a DataValue (variable) with desired name final DataValue dataValue = data.get(variableName); // 4. check existence of the DataValue (variable) if (dataValue == null) { throw new IllegalArgumentException("Variable named " + variableName + " doesn't exist!"); } // 5. remove the DataValue data.remove(dataValue); // 6. don't forget to set changed data back to folder folder.setData(data); // 7. save changes and unlock the folder folder.save("remove variable", false); } finally { folder.setLock(false, false); } } /** * Example how to remove a variable. * * @since 4.2.34 */ public void removeVariable_FormData(final SiteStoreFolder folder) throws LockException, ElementDeletedException { final String variableName = "myVariable"; // 1. lock the folder folder.setLock(true, false); try { // 2. retrieve FormData (variables) from SiteStoreFolder final SiteStoreVariableFormData formData = folder.getFormData(); // 3. remove variable with desired name formData.removeVariable(variableName); // 4. don't forget to set changed formdata back to folder folder.setFormData(formData); // 5. save changes and unlock the folder folder.save("remove variable", false); } finally { folder.setLock(false, false); } } }
-
getPageGroups
PageGroup[] getPageGroups()Get the list of the page-groups for the current PageReference- Returns:
- list of the page-groups objects
- Since:
- 3.0
-
createPageGroup
Create a new page-group for the current PageReference. It's necessary to callStoreElement.save(String, boolean)
on this folder afterwards- Parameters:
name
- name of the new page-group- Returns:
- new page-group as object
- Since:
- 3.0
-
deletePageGroup
Delete the given page-group for the current PageReference- Parameters:
pageGroup
- page-group to be deleted- Since:
- 3.0
-
getStoredUrl
@Nullable @Nullable String getStoredUrl(@NotNull @NotNull Language language, @NotNull @NotNull TemplateSet templateSet) Get the stored URL for this node and the provided combination of language and template set.- Parameters:
language
- Language to get the URL for.templateSet
- TemplateSet to get the URL for.- Returns:
- The stored URL (absolute, without domain prefix) or
null
if no URL has been stored (yet). - Throws:
NullPointerException
- if either parameterlanguage
ortemplateSet
isnull
.- Since:
- 5.0.4
- See Also:
-