@Component @Named(value="extension.xar") @Singleton public class XarExtensionScriptService extends AbstractExtensionScriptService
authorization, documentAccessBridge, execution, EXTENSIONERROR_KEY, jobExecutor, PROPERTY_CALLERREFERENCE, PROPERTY_CHECKRIGHTS, PROPERTY_CONTEXT_ACTION, PROPERTY_CONTEXT_WIKI, PROPERTY_USERREFERENCE, scriptProvider, WIKI_NAMESPACE_PREFIX, xcontextProvider
Constructor and Description |
---|
XarExtensionScriptService() |
Modifier and Type | Method and Description |
---|---|
org.xwiki.job.Job |
diff(String feature,
String wiki)
Computes the differences, in unified format, between the documents of an installed XAR extension and the document
from the wiki.
|
ConflictQuestion.ConflictType[] |
getConflictTypes() |
ProtectionLevel |
getDeleteSecurityLevel(DocumentReference userReference,
DocumentReference documentReference) |
List<String> |
getDiffJobId(String feature,
String namespace)
Get the id of the previously (or currently) computed differences, in unified format, between the documents of an
installed XAR extension and the document from the wiki..
|
ProtectionLevel |
getEditSecurityLevel(DocumentReference userReference,
DocumentReference documentReference) |
Document |
getInstalledExtensionDocument(DocumentReference reference) |
Document |
getInstalledExtensionDocument(DocumentReference reference,
org.xwiki.extension.ExtensionId extensionId) |
Document |
getInstalledExtensionDocument(DocumentReference reference,
org.xwiki.extension.xar.internal.repository.XarInstalledExtension extension) |
Collection<org.xwiki.extension.InstalledExtension> |
getInstalledExtensions(DocumentReference reference) |
Boolean |
isCustomizedExtensionDocument(DocumentReference documentReference) |
boolean |
isDeleteAllowed(DocumentReference documentReference) |
boolean |
isEditAllowed(DocumentReference documentReference) |
Boolean |
isExtensionDocument(DocumentReference documentReference) |
org.xwiki.job.Job |
repairInstalledExtension(String id,
String version,
String wiki)
Make sure the provided XAR extension properly is registered in the installed extensions index.
|
boolean |
reset(DocumentReference reference,
org.xwiki.extension.ExtensionId extensionId,
List<String> jobId) |
boolean |
reset(DocumentReference reference,
List<String> jobId) |
contextualize, fromWikitoNamespace, getCallerDocument, getJobStatus, getLastError, safe, safeWrapError, setError, setRightsProperties, toWikiId, wrapError
public org.xwiki.job.Job repairInstalledExtension(String id, String version, String wiki)
Start an asynchronous Job.
id
- the extension identifierversion
- the extension versionwiki
- the wiki where the extension is installedJob
object which can be used to monitor the progress of the installation process, or
null
in case of failurepublic List<String> getDiffJobId(String feature, String namespace)
feature
- the identifier of a XAR extension (or one of its features)namespace
- the namespace where the XAR extension is installedJob
public org.xwiki.job.Job diff(String feature, String wiki)
feature
- the identifier of a XAR extension (or one of its features)wiki
- the wiki where the XAR extension is installedJob
object which can be used to monitor the progress while the differences are being
computed, or null
in case of failurepublic ConflictQuestion.ConflictType[] getConflictTypes()
public boolean reset(DocumentReference reference, org.xwiki.extension.ExtensionId extensionId, List<String> jobId)
reference
- the reference of the document to reset to its standard state (what it looks like in the
extension XAR)extensionId
- the installed extension from which to get the standard version of the documentjobId
- the id of the job which computed the diff if anyAbstractExtensionScriptService.getLastError()
)public boolean reset(DocumentReference reference, List<String> jobId)
reference
- the reference of the document to reset to its standard state (what it looks like in the
extension XAR)jobId
- the id of the job which computed the diff if anyAbstractExtensionScriptService.getLastError()
)public Collection<org.xwiki.extension.InstalledExtension> getInstalledExtensions(DocumentReference reference)
reference
- the reference of the documentpublic Document getInstalledExtensionDocument(DocumentReference reference) throws XarExtensionException
reference
- the reference of the documentXarExtensionException
- when failing to get the documentpublic Document getInstalledExtensionDocument(DocumentReference reference, org.xwiki.extension.ExtensionId extensionId) throws XarExtensionException
reference
- the reference of the documentextensionId
- the id of the extension from which to get the standard version of the documentXarExtensionException
- when failing to get the documentpublic Document getInstalledExtensionDocument(DocumentReference reference, org.xwiki.extension.xar.internal.repository.XarInstalledExtension extension) throws XarExtensionException
reference
- the reference of the documentextension
- the extension from which to get the standard version of the documentXarExtensionException
- when failing to get the documentpublic boolean isEditAllowed(DocumentReference documentReference)
documentReference
- the reference of the documentpublic boolean isDeleteAllowed(DocumentReference documentReference)
documentReference
- the reference of the documentpublic ProtectionLevel getEditSecurityLevel(DocumentReference userReference, DocumentReference documentReference)
userReference
- the reference of the userdocumentReference
- the reference of the documentpublic ProtectionLevel getDeleteSecurityLevel(DocumentReference userReference, DocumentReference documentReference)
userReference
- the reference of the userdocumentReference
- the reference of the documentpublic Boolean isExtensionDocument(DocumentReference documentReference)
documentReference
- a document referencetrue
if the specified document belongs to an installed extension (either part of a XAR or
generated by a mandatory document initializer)public Boolean isCustomizedExtensionDocument(DocumentReference documentReference)
documentReference
- a document referencetrue
if the specified document is an extension document that has customizations (e.g. compared
with the version from the XAR)Copyright © 2004–2021 XWiki. All rights reserved.