public class AccessUtil extends Object
server release
,
server delete
Constructor and Description |
---|
AccessUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
cleanUpName(String name)
Remove illegal chars from a name.
|
static <T extends StoreElement> |
copyStoreElement(T element,
StoreElement parent)
Creates a copy of the given element below the parent.
|
static ServerActionHandle<? extends DeleteProgress,Boolean> |
delete(Collection<IDProvider> elements,
boolean ignoreIncomingReferences)
Deprecated.
use
DeleteOperation instead ; since 5.2.1804 |
static ServerActionHandle<? extends DeleteProgress,Boolean> |
delete(IDProvider element,
boolean ignoreIncomingReferences)
Deprecated.
use
DeleteOperation instead ; since 5.2.1804 |
static int |
executeProcess(Writer out,
Writer err,
String... command)
Execute a programm in a native process.
|
static Language |
getLanguageForKey(Project project,
String languageKey)
Gets a single project language by its unique abbreviation.
|
static Language |
getLanguageForKeyNotNull(Project project,
String languageKey)
Gets a single project language by its unique abbreviation.
|
static ServerActionHandle<? extends ReleaseProgress,Boolean> |
release(IDProvider toRelease,
boolean checkOnly)
Deprecated.
use
ReleaseOperation instead ; since 5.2.180606 |
static ServerActionHandle<? extends ReleaseProgress,Boolean> |
release(IDProvider releaseStartNode,
boolean checkOnly,
boolean ensureAccessibility,
boolean recursive,
IDProvider.DependentReleaseType dependentType)
Deprecated.
use
ReleaseOperation instead ; since 5.2.180606 |
static ServerActionHandle<? extends ReleaseProgress,Boolean> |
release(IDProvider releaseStartNode,
boolean checkOnly,
boolean ensureAccessibility,
boolean recursive,
IDProvider.DependentReleaseType dependentType,
String comment)
Deprecated.
use
ReleaseOperation instead ; since 5.2.180606 |
static ServerActionHandle<? extends ReleaseProgress,Boolean> |
release(IDProvider toRelease,
boolean checkOnly,
String comment)
Deprecated.
use
ReleaseOperation instead ; since 5.2.180606 |
static ServerActionHandle<? extends RestoreProgress,Boolean> |
restore(IDProvider newParent,
ElementInfo elementInfo,
boolean restoreParentIfNecessary,
boolean ignoreMissingReferencedObjects,
boolean checkOnlyMode)
Starts a restore action on the server, which restores the deleted element specified by the given
elementInfo |
static ServerActionHandle<? extends RevertProgress,Boolean> |
revert(IDProvider element,
Revision revision,
boolean recursive,
EnumSet<IDProvider.RevertType> ignoreRevertTypes,
boolean ignoreMissingReferencedObjects,
boolean checkOnlyMode)
Reverts an element of type
IDProvider to a specific revision. |
public static <T extends StoreElement> T copyStoreElement(T element, StoreElement parent) throws IOException
element
- The element to copyparent
- The parent of the new elementIOException
- thrown during temp-file operations.public static String cleanUpName(String name)
name
- The name@Deprecated public static ServerActionHandle<? extends ReleaseProgress,Boolean> release(IDProvider toRelease, boolean checkOnly)
ReleaseOperation
instead ; since 5.2.180606toRelease
- the startnode of releasecheckOnly
- if true
release would not be processedIllegalArgumentException
- if given releaseStartNode doesn't support release
@Deprecated public static ServerActionHandle<? extends ReleaseProgress,Boolean> release(IDProvider toRelease, boolean checkOnly, String comment)
ReleaseOperation
instead ; since 5.2.180606toRelease
- the startnode of releasecheckOnly
- if true
release would not be processedcomment
- the release comment, may be nullIllegalArgumentException
- if given releaseStartNode doesn't support release
@Deprecated public static ServerActionHandle<? extends ReleaseProgress,Boolean> release(IDProvider releaseStartNode, boolean checkOnly, boolean ensureAccessibility, boolean recursive, IDProvider.DependentReleaseType dependentType)
ReleaseOperation
instead ; since 5.2.180606releaseStartNode
- the startnode of the releasecheckOnly
- if true
release would not be processedensureAccessibility
- if true
each element on the parent path of the given releaseStartNode will be released
which has never been releasedrecursive
- if true
the subtree of given releaseStartNode will be released recursivedependentType
- the dependent type specifying the behaviour for referenced elements of the given releaseStartNode (see IDProvider.DependentReleaseType
for details)
if null
then IDProvider.DependentReleaseType.NO_DEPENDENT_RELEASE
is usedIllegalArgumentException
- if given releaseStartNode doesn't support release
IDProvider.DependentReleaseType
@Deprecated public static ServerActionHandle<? extends ReleaseProgress,Boolean> release(IDProvider releaseStartNode, boolean checkOnly, boolean ensureAccessibility, boolean recursive, IDProvider.DependentReleaseType dependentType, String comment)
ReleaseOperation
instead ; since 5.2.180606releaseStartNode
- the startnode of the releasecheckOnly
- if true
release would not be processedensureAccessibility
- if true
each element on the parent path of the given releaseStartNode will be released
which has never been releaseddependentType
- the dependent type specifying the behaviour for referenced elements of the given releaseStartNode (see IDProvider.DependentReleaseType
for details)
if null
then IDProvider.DependentReleaseType.NO_DEPENDENT_RELEASE
is usedcomment
- the release comment, may be nullIllegalArgumentException
- if given releaseStartNode doesn't support release
IDProvider.DependentReleaseType
public static ServerActionHandle<? extends RestoreProgress,Boolean> restore(@NotNull IDProvider newParent, @NotNull ElementInfo elementInfo, boolean restoreParentIfNecessary, boolean ignoreMissingReferencedObjects, boolean checkOnlyMode) throws WorkflowLockException
elementInfo
newParent
- the parent node, the restored node should be added as childcheckOnlyMode
- use false
to test the restore of the element, progress
of returned handle will contain infos about the restore testWorkflowLockException
Store.getDeletedChilds()
public static ServerActionHandle<? extends RevertProgress,Boolean> revert(IDProvider element, Revision revision, boolean recursive, EnumSet<IDProvider.RevertType> ignoreRevertTypes, boolean ignoreMissingReferencedObjects, boolean checkOnlyMode) throws WorkflowLockException
IDProvider
to a specific revision.element
- Element to be reverted.revision
- Revision
object that specifies the revision that the element should be reverted to.recursive
- If true
, elements will be reverted recursive. If false
, only the given element will be reverted.ignoreRevertTypes
- Set of IDProvider.RevertType
that specifies attributes and elements that should not be reverted.
If this set does not contain IDProvider.RevertType.CHILD_LIST
, i.e. children should be reverted as well,
recursive will be set to true
.ignoreMissingReferencedObjects
- If true
the element will be reverted even if a referenced element can not be found.
If false
, a missing referenced element will cause the revert operation to fail.checkOnlyMode
- If true
, the element will not actually be reverted. Instead only all preconditions will be checked and
violations will be reported.
If false
and all preconditions are met, the element will actually be reverted.WorkflowLockException
- if the given element is locked
by a workflow@Deprecated public static ServerActionHandle<? extends DeleteProgress,Boolean> delete(IDProvider element, boolean ignoreIncomingReferences)
DeleteOperation
instead ; since 5.2.1804element
- the element to deleteignoreIncomingReferences
- use true
to delete elements ignoring incoming references, if false
elements which are referenced will be skippedIllegalArgumentException
- if given element is a Dataset
@Deprecated public static ServerActionHandle<? extends DeleteProgress,Boolean> delete(Collection<IDProvider> elements, boolean ignoreIncomingReferences)
DeleteOperation
instead ; since 5.2.1804elements
- the elements to deleteignoreIncomingReferences
- use true
to delete elements ignoring incoming references, if false
elements which are referenced will be skippedIllegalArgumentException
- if one of the given elements is a Dataset
public static Language getLanguageForKey(Project project, String languageKey)
null
if no language with the
given abbreviation can be found.project
- Languages of this project will be searched for the sought language.languageKey
- Unique abbreviation of the sought language.@NotNull public static Language getLanguageForKeyNotNull(Project project, String languageKey)
IllegalArgumentException
if no
language with the given abbreviation can be found.project
- Languages of this project will be searched for the sought language.languageKey
- Unique abbreviation of the sought language.IllegalArgumentException
- if no language with the given abbreviation can be found.public static int executeProcess(Writer out, Writer err, String... command) throws IOException
out
- the output writer the process will append its output to. Writer will be closed after execution.err
- the error writer the process will append its error output to. Writer will be closed after execution.command
- the program and its argumentsIOException
- if process creation failsCopyright © 2021 e-Spirit AG. All Rights Reserved. Build 5.2.210210