Interface StoreElement
- All Superinterfaces:
Comparable<StoreElement>,Workflowable
- All Known Subinterfaces:
Allowed,Body,ChannelSourceProvider,Content2,Content2Params,Content2Section,ContentFolder,ContentProducer,ContentStoreRoot,DataProvider,Dataset,DocLink,DocumentGroup,File,FolderLangSpec,FormatTemplate,FormatTemplateChannel,FormatTemplateContainer,FormatTemplateFolder,FormatTemplates,GCABody,GCAFolder,GCAPage,GCASection,GlobalContentArea,GlobalStoreRoot,GomSourceProvider,IDProvider,LanguageInfo,LinkTemplate,LinkTemplates,MasterTemplate,Media,MediaElement,MediaFolder,MediaStoreRoot,PackagePoolItem,Page,PageFolder,PageGroup,PageLangSpec,PageRef,PageRefFolder,PageStoreRoot,PageTemplate,PageTemplates,Picture,PictureResolution,Previewable,PreviewImageProvider,ProjectProperties,Query,Referenceable,Schema,SchemaContainer,SchemaFolder,Schemes,Script,ScriptContainer,ScriptFolder,Scripts,Section<T>,SectionReference<T>,SectionTemplate,SectionTemplates,SiteStoreFolder,SiteStoreRoot,StartNode,Store,StyleTemplate,StyleTemplateLink,TableFormatTemplate,TableTemplate,Template,TemplateBody,TemplateContainer<T>,TemplateContentProvider,TemplateExtension,TemplateFolder<T>,TemplateProvider<T>,TemplateStoreElement,TemplateStoreRoot,URLProperties,UserProperties,Workflow,WorkflowContainer,WorkflowFolder,Workflows
- Since:
- 2.3
-
Method Summary
Modifier and TypeMethodDescriptionvoidappendChild(StoreElement child) Deprecated.voidappendChildBefore(@NotNull StoreElement child, @Nullable StoreElement nextsibling) Deprecated.since 4.2.204 - useIDProvider#moveChild(child, nextsibling)voiddelete()Deletes this storeelement.voidexportStoreElement(OutputStream out, @Nullable ExportHandler exportHandler) Exports this storeelement as zip file to the given outputstream.intintgetChildIndex(StoreElement child) Get the element's direct children.<T extends StoreElement>
Listable<T>getChildren(@NotNull Class<T> type) Get the element's direct children that are instances of the given type.<T extends StoreElement>
Listable<T>getChildren(@NotNull Class<T> type, boolean recurse) Get the element's children that are instances of the given type.<T extends StoreElement>
Listable<T>getChildren(Filter.TypedFilter<T> filter, boolean recurse) Get the element's children passing the given typed filter.@NotNull WorkflowPermissiongetCreateWorkflowPermission(@Nullable Workflow workflow) Return workflow permission object for the given workflow.Returns a list ofPrincipal'sfor which permissions are defined at this storeelement.@Nullable User@Nullable StoreElementProvides the first child node.@NotNull ReferenceEntry[]Returns all incoming references of thisStoreElement.Returns a list ofPrincipal'sfor which permissions are defined at this storelement including the inherited permissions on parent path.long@NotNull StringgetName()@Nullable StoreElementProvides the next sibling store element.@NotNull ReferenceEntry[]Returns all outgoing references of thisStoreElement.@Nullable StoreElementReturns the permission object for thecurrent usereven if permission checking is turned off.getPermission(Group group) Returns the correct permission object even if permission checking is turned off.getPermission(User user) Returns the correct permission object even if permission checking is turned off.@Nullable StoreElementProvides the previous store element.Returns the belonging project of this storeelement.@Nullable StringProvided the element's reference name.@Nullable Set<ReferenceEntry>Returns current outgoing references of this store element.@NotNull Set<ReferenceEntry>getReferences(@NotNull Language... languages) Returns current outgoing references of this store element.@NotNull StoregetStore()Provides the store related to the element.Return permissions combined from defined and inherited permissions for current user.@Nullable WorkflowPermissiongetWorkflowPermission(@Nullable Workflow workflow) Return workflow permission object for the given workflow.Return all existing workflow permissions.booleanA write lock is a flag to prevent changes e.g. while a workflow is active for this element.booleanReturnstrueif thisStoreElementhas incoming references.booleanIndicates whether for this element permissions are defined or not.importStoreElement(ZipFile exportFile, @Nullable ImportHandler importHandler) Imports the first root node from the given zip exportfile.importStoreElements(ZipFile exportFile, @Nullable ImportHandler importHandler) Imports all root nodes from the given zip exportfile.booleanReturns abooleanstate, whether the workflow permissions should be inherited for thisStoreElementor not.
Iftruethe WorkflowPermissions of parentStoreElementused,falseotherwise.
Note:
Storehas no parent and return alwaysfalsebooleanReturns the state of deletion. true if element is deleted and false if its notbooleanChecks if the element supports export.booleanisFolder()Checks if the element is a folder.booleanChecks if the element supports import.booleanisLocked()Checks if this node is locked by this session.booleanisLockedOnServer(boolean allSessions) Checks if this storeelement is locked on the server.booleanCheck this before using any lock method.booleanIndicates whether this element supports permissions or not.booleanisWorkflowAllowed(@Nullable Workflow workflow, User user) Returnstrueifworkflowis notnulland is explicitly allowed to be started on this element by givenuserorworkflowisnulland any workflow is allowed to be started on this element by givenuser. ,falseotherwise.booleanChecks if a workflow might be executed at the element.voidrefresh()Refreshes this element if there is a newer version on the server.voidvoidremoveChild(StoreElement child) Removes the given child from this element.voidremovePermission(Group group) Removes the permission object for a given group.voidremovePermission(User user) Removes the permission object for the given user.voidremovePermission(User[] users) Removes the permission object for several given users.voidremoveWorkflowPermission(Workflow workflow) voidreplaceChild(StoreElement oldChild, StoreElement newChild) Replaces an element's child by another child.voidsave()Saves the node and all childs, shortcut forsave(null, true).voidSaves the node and all childs.voidSaves this node.voidsetInheritWorkflowPermission(boolean inherit) Sets abooleanflag to enable or disable the inheritance of workflow permissions for thisStoreElement.
Iftruethe WorkflowPermissions of parentStoreElementused,falseotherwise.
Note:
Storehas no parent andinheritWorkflowPermission()return alwaysfalsevoidsetLock(boolean lock) Lock or unlock this element and all children.voidsetLock(boolean lock, boolean recursive) Lock or unlock this element, ifrecursive == trueall children are also (un)locked.voidsetPermission(Group group, Permission permission) Set the defined permission for the given group.voidsetPermission(User[] users, Permission permission) Set the defined permission for several users.voidsetPermission(User user, Permission permission) Set the defined permission for the given user.voidsetWorkflowPermission(WorkflowPermission permission) voidsetWorkflowPermissions(WorkflowPermission[] permissions) voidsetWriteLock(boolean lock) A write lock is a flag to prevent changes e.g. while a workflow is active for this element.toXml()Creates the xml representation of the node with all children but without indentation and line breaks.toXml(boolean includeChilds) Creates the xml representation with or without all children depending on the given parameter.toXml(boolean includeChildren, boolean prettyPrinting) Creates the xml representation with or without children, line breaks and indentation depending on the given parameters.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface de.espirit.firstspirit.access.Workflowable
getColor, getTask, hasTask, removeTask, setColor, setTask
-
Method Details
-
getName
- Since:
- 2.3.11
-
getChildren
@ApiDoc(comment="Get the element\'s direct children.", since="4.0") Listable<StoreElement> getChildren()Get the element's direct children.- Returns:
- A listable on this element's direct children.
- Since:
- 4.0
-
getChildren
@ApiDoc(comment="Get the element\'s direct children that are instances of the given type.", since="4.0") <T extends StoreElement> Listable<T> getChildren(@NotNull @NotNull Class<T> type) Get the element's direct children that are instances of the given type.- Parameters:
type- The type to find instances of.- Returns:
- A listable on matching children.
- Since:
- 4.0
-
getChildren
@ApiDoc(comment="Get the element\'s children that are instances of the given type.", since="4.0") <T extends StoreElement> Listable<T> getChildren(@NotNull @NotNull Class<T> type, boolean recurse) Get the element's children that are instances of the given type.- Parameters:
type- The type to find instances of.recurse- Iftrue, recursively collects children.- Returns:
- A listable on matching children.
- Since:
- 4.0
-
getChildren
@ApiDoc(comment="Get the element\'s children passing the given typed filter.", since="4.0") <T extends StoreElement> Listable<T> getChildren(@NotNull Filter.TypedFilter<T> filter, boolean recurse) Get the element's children passing the given typed filter.- Parameters:
filter- The filter to be used.recurse- Iftrue, recursively collects children.- Returns:
- A listable on matching children.
- Since:
- 4.0
- Example:
- Usage example with a StoreElementFilter.
import de.espirit.firstspirit.access.store.*; import de.espirit.common.util.Listable; import de.espirit.firstspirit.access.UserService; import de.espirit.firstspirit.access.project.Project; import de.espirit.firstspirit.access.store.Store.Type; import de.espirit.firstspirit.access.store.pagestore.Page; import de.espirit.firstspirit.access.store.pagestore.PageFolder; import de.espirit.firstspirit.access.store.pagestore.PageStoreRoot; import java.util.HashMap; import java.util.Iterator; import java.util.Map; /** * Example how to use StoreElementFilter. * * @since 4.2.410 */ public class StoreElementFilterExample { /** * Example how to use a StoreElementFilter which filters PageFolders and Pages within the {@link PageStoreRoot PageStore} of the given {@link Project} using an iterator.<br/> * * <b>Important:</b> In case of usage in a Beanshell script the usage of an iterator is mandatory, because Beanshell doesn't support java "for each" syntax. * For usage in java code the "for each" syntax is recommended -> see {@link #getFilteredChildren_ForEach(de.espirit.firstspirit.access.project.Project)} for details. * * @return the filtered storelements * @see #getFilteredChildren_ForEach(de.espirit.firstspirit.access.project.Project) * @since 4.2.410 */ public Map<String, IDProvider> getFilteredChildren_Iterator(final Project project) { final UserService userService = project.getUserService(); final Store currentPageStore = userService.getStore(Type.PAGESTORE, false); final StoreElementFilter filter = StoreElementFilter.on(PageFolder.class, Page.class); // get filtered children recursive final Listable<StoreElement> filteredListable = currentPageStore.getChildren(filter, true); final Map<String, IDProvider> result = new HashMap<String, IDProvider>(); final Iterator<StoreElement> filteredIterator = filteredListable.iterator(); while (filteredIterator.hasNext()) { // we filtered on Page and PageFolder, therefore we can cast to IdProvider without risk final IDProvider idProvider = (IDProvider) filteredIterator.next(); if (idProvider.hasUid()) { result.put(idProvider.getUid(), idProvider); } } return result; } /** * Example how to use a StoreElementFilter which filters PageFolders and Pages within the {@link PageStoreRoot PageStore} of the given {@link Project} using "for each" syntax.<br/> * * <b>Important:</b> In a Beanshell script the "for each" is not supported, therefore an iterator should be used -> see {@link #getFilteredChildren_Iterator(de.espirit.firstspirit.access.project.Project)} for details. * * @return the filtered storelements * @see #getFilteredChildren_Iterator(de.espirit.firstspirit.access.project.Project) * @since 4.2.410 */ public Map<String, IDProvider> getFilteredChildren_ForEach(final Project project) { final UserService userService = project.getUserService(); final Store currentPageStore = userService.getStore(Type.PAGESTORE, false); final StoreElementFilter filter = StoreElementFilter.on(PageFolder.class, Page.class); // get filtered children recursive final Listable<StoreElement> filteredListable = currentPageStore.getChildren(filter, true); final Map<String, IDProvider> result = new HashMap<String, IDProvider>(); for (final StoreElement storeElement : filteredListable) { // we filtered on Page and PageFolder, therefore we can cast to IdProvider without risk final IDProvider idProvider = (IDProvider) storeElement; if (idProvider.hasUid()) { result.put(idProvider.getUid(), idProvider); } } return result; } }
-
appendChild
Deprecated.since 4.2.204 - useIDProvider#moveChild(child)- Throws:
IllegalArgumentException- ifchildis not a child node fo this node.- Since:
- 3.0
- See Also:
-
appendChildBefore
@Deprecated void appendChildBefore(@NotNull @NotNull StoreElement child, @Nullable @Nullable StoreElement nextsibling) Deprecated.since 4.2.204 - useIDProvider#moveChild(child, nextsibling)Appends the given child to the children list before the givennextsiblingelement.If you want to append a child from a different parent, use
moveChild(child)ormoveChild(child, nextSiblingIndex)
Attention: It's necessary to lock and save all parts of the operation (parent and child)
You need permissioncan changeandcan append leaf(if given child is a leaf node) orcan append folder(if given child is a folder)Example 1 (position ordering - same parent):
parent.setLock(true, false); // non recursive lock move.setLock(true, false); // non recursive lock -> avoid concurrent change try { parent.removeChild(moveNode); parent.appendChildBefore(moveNode, nextSibling); // append 'moveNode' before 'nextSibling' parent.save("position changed", false); // non recursive save // it's not necessary to save 'moveNode' because parent hasn't changed } finally { move.setLock(false, false); // non recursive unlock parent.setLock(false, false); // non recursive unlock }- Parameters:
child- the child to append to the children list of this elementnextsibling- the child will be appended before the nextsibling node- Throws:
IllegalArgumentException- ifchildis not a child node fo this node.- Since:
- 3.0.3
- See Also:
-
removeChild
@ApiDoc(comment="Removes the given child from this element.", since="3.0.7") void removeChild(StoreElement child) Removes the given child from this element. If the given element isn't in the children list of this element, nothing will happen.If you want to move a child to a different parent, is recommended to use
moveChild(child)ormoveChild(child, nextSiblingIndex)
Attention: It's necessary to lock and save all parts of the operation (parent and child)
You need permissioncan changeandcan delete(if given child is a leaf node) orcan delete folder(if given child is a folder)Example 1 (position ordering - same parent):
parent.setLock(true, false); // non recursive lock move.setLock(true, false); // non recursive lock -> avoid concurrent change try { parent.removeChild(moveNode); parent.appendChildBefore(moveNode, nextSibling); // append 'moveNode' before 'nextSibling' parent.save("position changed", false); // non recursive save // it's not necessary to save 'moveNode' because parent hasn't changed } finally { move.setLock(false, false); // non recursive unlock parent.setLock(false, false); // non recursive unlock }Example 2 (move to another folder -> it's recommended to use
move(child)instead):parent.setLock(true, false); // non recursive lock move.setLock(true, false); // non recursive lock newParent.setLock(true, false); // non recursive lock try { parent.removeChild(moveNode); newParent.appendChild(moveNode); // move 'moveNode' to 'newparent' parent.save("removed", false); // non recursive save newParent.save("moveNode added", false); // non recursive save moveNode.save("parent changed", false); // non recursive save } finally { parent.setLock(false, false); // non recursive unlock move.setLock(false, false); // non recursive unlock newParent.setLock(false, false); // non recursive unlock }- Parameters:
child- the child to remove- Since:
- 3.0.7
- See Also:
-
replaceChild
@ApiDoc(comment="Replaces an element\'s child by another child.", since="3.0.7") void replaceChild(StoreElement oldChild, StoreElement newChild) Replaces an element's child by another child.- Parameters:
oldChild- The element's child which should be replaced.newChild- The new child which replaces the element's old child.- Since:
- 3.0.7
-
getChildCount
- Since:
- 3.0.115
-
getChildIndex
- Since:
- 3.0.115
-
getParent
@ApiDoc(comment="Return parent StoreElement which is null for deleted elements or store-roots.", since="2.3") @Nullable @Nullable StoreElement getParent()- Returns:
- parent
StoreElementwhich isnullfordeletedelements orstore-roots. - Since:
- 2.3
-
getNextSibling
@ApiDoc(comment="Provides the next sibling store element.", since="4.0.17") @Nullable @Nullable StoreElement getNextSibling()Provides the next sibling store element. If no such sibling element existsnullwill be returned.- Returns:
- the next sibling store element or
nullif there is none - Since:
- 4.0.17
-
getPreviousSibling
@ApiDoc(comment="Provides the previous sibling store element.", since="5.2.200804") @Nullable @Nullable StoreElement getPreviousSibling()Provides the previous store element. If no such sibling element existsnullwill be returned.- Returns:
- the previous sibling store element or
nullif there is none - Since:
- 5.2.200804
-
getFirstChild
@ApiDoc(comment="Provides the first child node.", since="4.0.17") @Nullable @Nullable StoreElement getFirstChild()Provides the first child node. If no child node existsnullwill be returned.- Returns:
- the first child node or
nullif there are no childs - Since:
- 4.0.17
-
getStore
@ApiDoc(comment="Provides the store related to the element.", since="2.3") @NotNull @NotNull Store getStore()Provides the store related to the element. Can't benull.- Returns:
- The store relating to the element.
- Since:
- 2.3
-
isFolder
Checks if the element is a folder.- Returns:
- boolean:
trueif the element is a folder, elsefalse - Since:
- 3.0
-
isPermissionSupported
@ApiDoc(comment="Indicates whether this element supports permissions or not.", since="2.3") boolean isPermissionSupported()Indicates whether this element supports permissions or not.- Returns:
trueif this element supports permissions,falseotherwise- Since:
- 2.3
-
hasPermissions
@ApiDoc(comment="Indicates whether for this element permissions are defined or not.", since="4.0.17") boolean hasPermissions()Indicates whether for this element permissions are defined or not.- Returns:
trueif this element has defined permissions,falseotherwise- Since:
- 4.0.17
-
getPermission
@ApiDoc(comment="Returns the permission object for the current user even if permission checking is turned off.", since="2.3") Permission getPermission()Returns the permission object for thecurrent usereven if permission checking is turned off.- Since:
- 2.3
-
getPermission
@ApiDoc(comment="Returns the correct permission object even if permission checking is turned off.", since="2.3") Permission getPermission(User user) Returns the correct permission object even if permission checking is turned off.- Since:
- 2.3
-
getPermission
@ApiDoc(comment="Returns the correct permission object even if permission checking is turned off.", since="2.3") Permission getPermission(Group group) Returns the correct permission object even if permission checking is turned off.- Since:
- 2.3
-
setPermission
@ApiDoc(comment="Set the defined permission for the given user.", since="2.3") void setPermission(User user, Permission permission) Set the defined permission for the given user.- Parameters:
user- The user which receives the permission.permission- The permission the user should receive.- Since:
- 2.3
-
setPermission
@ApiDoc(comment="Set the defined permission for several users.", since="2.3") void setPermission(User[] users, Permission permission) Set the defined permission for several users.- Parameters:
users- The users which receive the permission.permission- The permission that should be granted for the users.- Since:
- 2.3
-
setPermission
@ApiDoc(comment="Set the defined permission for the given group.", since="2.3") void setPermission(Group group, Permission permission) Set the defined permission for the given group.- Parameters:
group- The group which should receive the permission.permission- The permission that should be granted for the group.- Since:
- 2.3
-
removePermission
@ApiDoc(comment="Removes the permission object for the given user.", since="2.3") void removePermission(User user) Removes the permission object for the given user.- Parameters:
user- The user for which the permission object should be removed.- Since:
- 2.3
-
removePermission
@ApiDoc(comment="Removes the permission object for several given users.", since="2.3") void removePermission(User[] users) Removes the permission object for several given users.- Parameters:
users- Several user for that the permission object should be removed.- Since:
- 2.3
-
removePermission
@ApiDoc(comment="Removes the permission object for a given group.", since="2.3") void removePermission(Group group) Removes the permission object for a given group.- Parameters:
group- The group for which the permission object should be removed.- Since:
- 2.3
-
getTreePermission
@ApiDoc(comment="Return permissions combined from defined and inherited permissions for current user.", since="3.0.59") PermissionMap getTreePermission()Return permissions combined from defined and inherited permissions for current user.- Returns:
- the permission object
- Since:
- 3.0.59
-
getDefinedPrincipalPermissions
@ApiDoc(comment="Returns a list of Principal\'s for which permissions are defined at this storeelement.", since="3.1.187") @NotNull @NotNull List<Principal> getDefinedPrincipalPermissions()Returns a list ofPrincipal'sfor which permissions are defined at this storeelement.- Returns:
- list of
Principal's - Since:
- 3.1.187
-
getInheritedPrincipalPermissions
@ApiDoc(comment="Returns a list of Principal\'s for which permissions are defined at this storelement including the inherited permissions on parent path.", since="3.1.187") @NotNull @NotNull List<Principal> getInheritedPrincipalPermissions()Returns a list ofPrincipal'sfor which permissions are defined at this storelement including the inherited permissions on parent path.- Returns:
- list of
Principal's - Since:
- 3.1.187
-
getLastChanged
- Since:
- 2.3
-
getEditor
- Since:
- 2.3
-
isWorkflowSupported
@ApiDoc(comment="Checks if a workflow might be executed at the element.", since="3.0.1") boolean isWorkflowSupported()Checks if a workflow might be executed at the element.- Returns:
- boolean:
trueif the element supports workflows, elsefalse - Since:
- 3.0.1
-
getWorkflowPermissions
@ApiDoc(comment="Return all existing workflow permissions.", since="3.0.1") WorkflowPermission[] getWorkflowPermissions()Return all existing workflow permissions.- Since:
- 3.0.1
-
getWorkflowPermission
@ApiDoc(comment="Return workflow permission object for the given workflow.", since="3.0.1") @Nullable @Nullable WorkflowPermission getWorkflowPermission(@Nullable @Nullable Workflow workflow) Return workflow permission object for the given workflow. Use null as parameter for all workflows. If no permissions exist null is returned.- Since:
- 3.0.1
-
getCreateWorkflowPermission
@ApiDoc(comment="Return workflow permission object for the given workflow.", since="4.0.120") @NotNull @NotNull WorkflowPermission getCreateWorkflowPermission(@Nullable @Nullable Workflow workflow) Return workflow permission object for the given workflow. Use null as parameter for all workflows. If no permissions exist a new empty permission object is created. You have to call setWorkflowPermission afterwards to save your changes.- Since:
- 4.0.120
-
setWorkflowPermission
- Since:
- 3.0.1
-
setWorkflowPermissions
- Since:
- 3.0.1
-
removeWorkflowPermission
- Since:
- 3.0.1
-
removeAllWorkflowPermissions
- Since:
- 3.0.1
-
isWorkflowAllowed
@ApiDoc(comment="Returns true if workflow is not null and is explicitly allowed to be started on this element by given user or workflow is null and any workflow is allowed to be started on this element by given user, false otherwise.", since="3.0.1") boolean isWorkflowAllowed(@Nullable @Nullable Workflow workflow, User user) Returnstrueifworkflowis notnulland is explicitly allowed to be started on this element by givenuserorworkflowisnulland any workflow is allowed to be started on this element by givenuser.
falseotherwise.- Since:
- 3.0.1
-
inheritWorkflowPermission
@ApiDoc(comment="Returns a boolean state, whether the workflow permissions should be inherited for this StoreElement or not.", since="3.0.1") boolean inheritWorkflowPermission()Returns abooleanstate, whether the workflow permissions should be inherited for thisStoreElementor not.
Iftruethe WorkflowPermissions of parentStoreElementused,falseotherwise.
Note:
Storehas no parent and return alwaysfalse- Returns:
truefor workflow permission inheritance,falseotherwise.- Since:
- 3.0.1
-
setInheritWorkflowPermission
@ApiDoc(comment="Sets a boolean flag to enable or disable the inheritance of workflow permissions for this StoreElement.", since="3.0.1") void setInheritWorkflowPermission(boolean inherit) Sets abooleanflag to enable or disable the inheritance of workflow permissions for thisStoreElement.
Iftruethe WorkflowPermissions of parentStoreElementused,falseotherwise.
Note:
Storehas no parent andinheritWorkflowPermission()return alwaysfalse- Parameters:
inherit-truefor workflow permission inheritance,falseotherwise.- Since:
- 3.0.1
-
setWriteLock
@ApiDoc(comment="A write lock is a flag to prevent changes e.g. while a workflow is active for this element.", since="3.0.4") void setWriteLock(boolean lock) A write lock is a flag to prevent changes e.g. while a workflow is active for this element.- Parameters:
lock-trueto signal changes on this element should be prevented- Since:
- 3.0.4
- See Also:
-
getWriteLock
@ApiDoc(comment="A write lock is a flag to prevent changes e.g. while a workflow is active for this element.", since="3.0.4") boolean getWriteLock()A write lock is a flag to prevent changes e.g. while a workflow is active for this element.- Returns:
trueif the element is locked to prevent changes- Since:
- 3.0.4
- See Also:
-
isLockSupported
Check this before using any lock method.- Returns:
trueif this node supports locking- Since:
- 2.3
- See Also:
-
setLock
@ApiDoc(comment="Lock or unlock this element and all children.", since="2.3") void setLock(boolean lock) throws LockException, ElementDeletedException Lock or unlock this element and all children. Same assetLock(lock, true).- Throws:
LockExceptionElementDeletedException- Since:
- 2.3
- See Also:
-
setLock
@ApiDoc(comment="Lock or unlock this element, if recursive == true all children are also (un)locked.", since="4.0.17") void setLock(boolean lock, boolean recursive) throws LockException, ElementDeletedException Lock or unlock this element, ifrecursive == trueall children are also (un)locked.- Throws:
LockExceptionElementDeletedException- Since:
- 4.0.17
-
isLocked
@ApiDoc(comment="Checks if this node is locked by this session.", since="3.1.158") boolean isLocked()Checks if this node is locked by this session.- Returns:
trueif this node is locked- Throws:
UnsupportedOperationException- ifisLockSupported()isfalse- Since:
- 3.1.158
- See Also:
-
isLockedOnServer
@ApiDoc(comment="Checks if this storeelement is locked on the server.", since="3.1.158") boolean isLockedOnServer(boolean allSessions) Checks if this storeelement is locked on the server.- Parameters:
allSessions-trueall sessions are checked,falseonly current session is checked- Returns:
truewether this object is locked on the server,falseotherwise- Since:
- 3.1.158
-
save
@ApiDoc(comment="Saves the node and all childs, shortcut for save(null, true).", since="2.3") void save()Saves the node and all childs, shortcut forsave(null, true).Use
isLockSupported()to check if save operation is supported.- Since:
- 2.3
- See Also:
-
save
Saves the node and all childs.Use
isLockSupported()to check if save operation is supported.- Parameters:
comment- comment for therevisionwhich is created during save- Since:
- 4.0
-
save
Saves this node. UsesaveChilds == trueto save recursive all children- Parameters:
comment- commentsaveChilds-trueto save recursive all children, otherwise usefalse- Since:
- 4.0
-
delete
Deletes this storeelement. This operation needs a lock to this storeelement.- Specified by:
deletein interfaceWorkflowable- Throws:
LockException- if the direct parent is locked in a different session- Since:
- 2.3
-
refresh
@ApiDoc(comment="Refreshes this element if there is a newer version on the server.", since="2.3") void refresh()Refreshes this element if there is a newer version on the server.- Since:
- 2.3
-
toXml
@ApiDoc(comment="Creates the xml representation of the node with all children but without indentation and line breaks.", since="2.3") String toXml()Creates the xml representation of the node with all children but without indentation and line breaks.- Returns:
- the xml representation the node with all children without indentation and line breaks
- Since:
- 2.3
-
toXml
@ApiDoc(comment="Creates the xml representation with or without all children depending on the given parameter.", since="4.0") String toXml(boolean includeChilds) Creates the xml representation with or without all children depending on the given parameter.- Parameters:
includeChilds- iftruethe xml of id childs is included- Returns:
- the xml representation the node without indentation and line breaks
- Since:
- 4.0
-
toXml
@ApiDoc(comment="Creates the xml representation with or without children, line breaks and indentation depending on the given parameters.", since="4.0") String toXml(boolean includeChildren, boolean prettyPrinting) Creates the xml representation with or without children, line breaks and indentation depending on the given parameters.- Parameters:
includeChildren- iftruethe xml of id children is includedprettyPrinting- iftrueto get the xml strings with line breaks and indentation- Returns:
- the xml representation the node with indentation and line breaks
- Since:
- 4.0
-
isImportSupported
@ApiDoc(comment="Checks if the element supports import.", since="3.0.1") boolean isImportSupported()Checks if the element supports import.- Returns:
- boolean:
trueif import is supported, elsefalse - Since:
- 3.0.1
-
isExportSupported
@ApiDoc(comment="Checks if the element supports export.", since="3.0.1") boolean isExportSupported()Checks if the element supports export.- Returns:
- boolean:
trueif the element supports export, elsefalse - Since:
- 3.0.1
-
exportStoreElement
@ApiDoc(comment="Exports this storeelement as zip file to the given outputstream.", since="3.0.7") void exportStoreElement(OutputStream out, @Nullable @Nullable ExportHandler exportHandler) throws IOException Exports this storeelement as zip file to the given outputstream.- Parameters:
exportHandler- the export events will be reported to this handler (may be null)out- the output stream the zip export file will be written to- Throws:
IOException- Since:
- 3.0.7
-
importStoreElement
@ApiDoc(comment="Imports the first root node from the given zip exportfile.", since="3.0.7") StoreElement importStoreElement(ZipFile exportFile, @Nullable @Nullable ImportHandler importHandler) throws IOException, ElementDeletedException, WorkflowLockException Imports the first root node from the given zip exportfile. The created node is not locked, it is necessary tolock,saveandunlockthe imported element.- Parameters:
exportFile- Zip export file to import from.importHandler- Import handler, may benull.- Returns:
- First element from exportfile (the node mayhave an arbitrary number of child nodes).
- Throws:
IOException- If an io error occurs when handling given zip file.ElementDeletedException- If this element is already deleted.WorkflowLockException- If this element is locked in a workflow.- Since:
- 3.0.7
-
importStoreElements
@ApiDoc(comment="Imports all root nodes from the given zip exportfile.", since="4.0.47") Listable<StoreElement> importStoreElements(ZipFile exportFile, @Nullable @Nullable ImportHandler importHandler) throws IOException, ElementDeletedException, WorkflowLockException Imports all root nodes from the given zip exportfile. The created nodes are not locked, it is necessary tolock,saveandunlockthem.- Parameters:
exportFile- Zip export file to import from.importHandler- Import handler, may benull.- Returns:
- List of imported elements (each node may have an arbitrary number of child nodes).
- Throws:
IOException- If an io error occurs when handling given zip file.ElementDeletedException- If this element is already deleted.WorkflowLockException- If this element is locked in a workflow.- Since:
- 4.0.47
-
getElementType
- Since:
- 3.0.7
-
getProject
@ApiDoc(comment="Returns the belonging project of this storeelement.", since="4.0") Project getProject()Returns the belonging project of this storeelement.- Returns:
- the belonging project
- Since:
- 4.0
-
getIncomingReferences
@ApiDoc(comment="Returns all incoming references of this StoreElement.", since="3.1.172") @NotNull @NotNull ReferenceEntry[] getIncomingReferences()Returns all incoming references of thisStoreElement.- Returns:
- all incoming references for this
StoreElement. - Since:
- 3.1.172
- See Also:
-
hasIncomingReferences
@ApiDoc(comment="Returns true if this StoreElement has incoming references.", since="4.0") boolean hasIncomingReferences()Returnstrueif thisStoreElementhas incoming references. This method is more efficient and less time consuming than.getIncomingReferences().length > 0- Returns:
trueif thisStoreElementhas incoming references.- Since:
- 4.0
-
getOutgoingReferences
@ApiDoc(comment="Returns all outgoing references of this StoreElement.", since="3.1.172") @NotNull @NotNull ReferenceEntry[] getOutgoingReferences()Returns all outgoing references of thisStoreElement.- Returns:
- all outgoing references of this
StoreElement. - Since:
- 3.1.172
-
getReferenceName
@ApiDoc(comment="Provided the element\'s reference name.", since="4.0.17") @Nullable @Nullable String getReferenceName()Provided the element's reference name. If the element doesn't support referencingnullwill be provided.- Returns:
- the refernce text, e.g. used for $CMS_REF(..)$ expressions, or
nullif this element supports no referencing - Since:
- 4.0.17
-
getReferences
@ApiDoc(comment="Returns current outgoing references of this store element.", since="4.0.17") @Nullable @Nullable Set<ReferenceEntry> getReferences()Returns current outgoing references of this store element.- Returns:
- current outgoing references.
- Since:
- 4.0.17
-
getReferences
@Experimental @NotNull @NotNull Set<ReferenceEntry> getReferences(@NotNull @NotNull Language... languages) Returns current outgoing references of this store element. For references in the release store, the references for the language dependent release revisions of the given languages are also included. For the current store, the languages parameter is ignored.- Parameters:
languages- For references in the release store, only include the given languages, empty means include all languages.- Returns:
- current outgoing references.
- Since:
- 5.2.250102
-
isDeleted
@ApiDoc(comment="Returns the state of deletion. true if element is deleted and false if its not", since="4.2.9") boolean isDeleted()Returns the state of deletion. true if element is deleted and false if its not- Returns:
- true if element is deleted, false otherwise
- Since:
- 4.2.9
-
IDProvider#moveChild(child)