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 containsUserKeys as components ofUserResourceIdentifiers. This is required when importing content containingUserKeys 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 classStorageFormatUserRewriter.RewriteResultRepresents 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.RewriteResultrewriteUserKeysInContent(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.RewriteResulttransformUserKeysInContent(String importedStorageFormat, Function<com.atlassian.sal.api.user.UserKey,com.atlassian.sal.api.user.UserKey> userKeyTranslator, ConversionContext conversionContext)Rewrites anyUserKeys inUserResourceIdentifiers 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 anyUserKeys inUserResourceIdentifiers 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
Mapof the userkey translations used for this content. Untranslated userkeys will be represented as null values. - Throws:
XMLStreamExceptionXhtmlExceptionIOException
-
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 anyUserKeys inUserResourceIdentifiers 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
Mapof the userkey translations used for this content. Untranslated userkeys will be represented as null values. - Throws:
XMLStreamExceptionXhtmlExceptionIOException- Since:
- 7.0.1
-
-