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 ignoreReferences)
Deletes all elements on the server.
|
static ServerActionHandle<? extends DeleteProgress,Boolean> |
delete(IDProvider element,
boolean ignoreReferences)
Deletes the the subtree specified by the given element on the server.
|
static int |
executeProcess(Writer out,
Writer err,
String... command)
Execute a programm in a native process.
|
static Language |
getLanguageForKey(Project project,
String languageKey) |
static Language |
getLanguageForKeyNotNull(Project project,
String languageKey) |
static ServerActionHandle<? extends ReleaseProgress,Boolean> |
release(IDProvider toRelease,
boolean checkOnly)
|
static ServerActionHandle<? extends ReleaseProgress,Boolean> |
release(IDProvider releaseStartNode,
boolean checkOnly,
boolean ensureAccessibility,
boolean recursive,
IDProvider.DependentReleaseType dependentType)
Starts the server release action for the given element with the given release options.
|
static ServerActionHandle<? extends ReleaseProgress,Boolean> |
release(IDProvider releaseStartNode,
boolean checkOnly,
boolean ensureAccessibility,
boolean recursive,
IDProvider.DependentReleaseType dependentType,
String comment)
Starts the server release action for the given element with the given release options.
|
static ServerActionHandle<? extends ReleaseProgress,Boolean> |
release(IDProvider toRelease,
boolean checkOnly,
String comment)
|
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) |
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 namepublic static ServerActionHandle<? extends ReleaseProgress,Boolean> release(IDProvider toRelease, boolean checkOnly)
toRelease - the startnode of releasecheckOnly - if true release would not be processedIllegalArgumentException - if given releaseStartNode doesn't support releasepublic static ServerActionHandle<? extends ReleaseProgress,Boolean> release(IDProvider toRelease, boolean checkOnly, String comment)
toRelease - the startnode of releasecheckOnly - if true release would not be processedcomment - the release comment, may be nullIllegalArgumentException - if given releaseStartNode doesn't support releasepublic static ServerActionHandle<? extends ReleaseProgress,Boolean> release(IDProvider releaseStartNode, boolean checkOnly, boolean ensureAccessibility, boolean recursive, IDProvider.DependentReleaseType dependentType)
releaseStartNode - 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 releaseIDProvider.DependentReleaseTypepublic static ServerActionHandle<? extends ReleaseProgress,Boolean> release(IDProvider releaseStartNode, boolean checkOnly, boolean ensureAccessibility, boolean recursive, IDProvider.DependentReleaseType dependentType, String comment)
releaseStartNode - 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 releaseIDProvider.DependentReleaseTypepublic static ServerActionHandle<? extends RestoreProgress,Boolean> restore(@NotNull IDProvider newParent, @NotNull ElementInfo elementInfo, boolean restoreParentIfNecessary, boolean ignoreMissingReferencedObjects, boolean checkOnlyMode) throws WorkflowLockException
elementInfonewParent - 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 testWorkflowLockExceptionStore.getDeletedChilds()public static ServerActionHandle<? extends RevertProgress,Boolean> revert(IDProvider element, Revision revision, boolean recursive, EnumSet<IDProvider.RevertType> ignoreRevertTypes, boolean ignoreMissingReferencedObjects, boolean checkOnlyMode) throws WorkflowLockException
WorkflowLockExceptionpublic static ServerActionHandle<? extends DeleteProgress,Boolean> delete(IDProvider element, boolean ignoreReferences)
element - the element to deleteignoreReferences - use true to delete elements ignoring incoming references, if false elements which are referenced will be skippedpublic static ServerActionHandle<? extends DeleteProgress,Boolean> delete(Collection<IDProvider> elements, boolean ignoreReferences)
elements - the elements to deleteignoreReferences - use true to delete elements ignoring incoming references, if false elements which are referenced will be skippedpublic static Language getLanguageForKey(Project project, String languageKey)
@NotNull public static Language getLanguageForKeyNotNull(Project project, String languageKey)
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 © 2015 e-Spirit AG. All Rights Reserved. Build 5.1.408