Class StorageFormatUserRewriter
java.lang.Object
com.atlassian.confluence.importexport.impl.StorageFormatUserRewriter
Provides facilities for extracting and rewriting storage format content that contains
UserKey
s as components
of UserResourceIdentifier
s. This is required when importing content containing UserKey
s from one
Confluence installation into another, where the user keys may be different.- Since:
- 5.3
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represents the results of the content rewrite operation. -
Constructor Summary
ConstructorDescriptionStorageFormatUserRewriter
(XmlEventReaderFactory xmlEventReaderFactory, XmlOutputFactory xmlOutputFactory, Unmarshaller<UserResourceIdentifier> userResourceIdentifierUnmarshaller, Marshaller<UserResourceIdentifier> userResourceIdentifierMarshaller) -
Method Summary
Modifier and TypeMethodDescriptionrewriteUserKeysInContent
(String importedStorageFormat, com.google.common.base.Function<com.atlassian.sal.api.user.UserKey, com.atlassian.sal.api.user.UserKey> userKeyTranslator, ConversionContext conversionContext) Deprecated.since 7.0.1.transformUserKeysInContent
(String importedStorageFormat, Function<com.atlassian.sal.api.user.UserKey, com.atlassian.sal.api.user.UserKey> userKeyTranslator, ConversionContext conversionContext) Rewrites anyUserKey
s inUserResourceIdentifier
s in the supplied storage format content, by using the supplied function to map on userkey to another.
-
Constructor Details
-
StorageFormatUserRewriter
public StorageFormatUserRewriter(XmlEventReaderFactory xmlEventReaderFactory, XmlOutputFactory xmlOutputFactory, Unmarshaller<UserResourceIdentifier> userResourceIdentifierUnmarshaller, Marshaller<UserResourceIdentifier> userResourceIdentifierMarshaller)
-
-
Method Details
-
rewriteUserKeysInContent
@Deprecated public StorageFormatUserRewriter.RewriteResult rewriteUserKeysInContent(String importedStorageFormat, com.google.common.base.Function<com.atlassian.sal.api.user.UserKey, com.atlassian.sal.api.user.UserKey> userKeyTranslator, ConversionContext conversionContext) throws XMLStreamException, XhtmlException, IOExceptionDeprecated.since 7.0.1. UsetransformUserKeysInContent(String, Function, ConversionContext)
Rewrites anyUserKey
s inUserResourceIdentifier
s in the supplied storage format content, by using the supplied function to map on userkey to another. If a given userkey cannot be translated, the original userkey will be written unmodified.- Parameters:
userKeyTranslator
- The function that translates one userkey to another- Returns:
- A
Map
of the userkey translations used for this content. Untranslated userkeys will be represented as null values. - Throws:
XMLStreamException
XhtmlException
IOException
-
transformUserKeysInContent
public StorageFormatUserRewriter.RewriteResult transformUserKeysInContent(String importedStorageFormat, Function<com.atlassian.sal.api.user.UserKey, com.atlassian.sal.api.user.UserKey> userKeyTranslator, ConversionContext conversionContext) throws XMLStreamException, XhtmlException, IOExceptionRewrites anyUserKey
s inUserResourceIdentifier
s in the supplied storage format content, by using the supplied function to map on userkey to another. If a given userkey cannot be translated, the original userkey will be written unmodified.- Parameters:
userKeyTranslator
- The function that translates one userkey to another- Returns:
- A
Map
of the userkey translations used for this content. Untranslated userkeys will be represented as null values. - Throws:
XMLStreamException
XhtmlException
IOException
- Since:
- 7.0.1
-