Class StorageFormatUserRewriter
- java.lang.Object
-
- com.atlassian.confluence.importexport.impl.StorageFormatUserRewriter
-
public class StorageFormatUserRewriter extends Object
Provides facilities for extracting and rewriting storage format content that containsUserKey
s as components ofUserResourceIdentifier
s. This is required when importing content containingUserKey
s from one Confluence installation into another, where the user keys may be different.- Since:
- 5.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StorageFormatUserRewriter.RewriteResult
Represents the results of the content rewrite operation.
-
Constructor Summary
Constructors Constructor Description StorageFormatUserRewriter(XmlEventReaderFactory xmlEventReaderFactory, XmlOutputFactory xmlOutputFactory, Unmarshaller<UserResourceIdentifier> userResourceIdentifierUnmarshaller, Marshaller<UserResourceIdentifier> userResourceIdentifierMarshaller)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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)
Deprecated.since 7.0.1.StorageFormatUserRewriter.RewriteResult
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 Detail
-
StorageFormatUserRewriter
public StorageFormatUserRewriter(XmlEventReaderFactory xmlEventReaderFactory, XmlOutputFactory xmlOutputFactory, Unmarshaller<UserResourceIdentifier> userResourceIdentifierUnmarshaller, Marshaller<UserResourceIdentifier> userResourceIdentifierMarshaller)
-
-
Method Detail
-
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, IOException
Deprecated.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, IOException
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
- Since:
- 7.0.1
-
-