Class StorageFormatUserRewriter
java.lang.Object
com.atlassian.confluence.importexport.impl.StorageFormatUserRewriter
Provides facilities for extracting and rewriting storage format content that contains
UserKeys as components
of UserResourceIdentifiers. This is required when importing content containing UserKeys from one
Confluence installation into another, where the user keys may be different.- Since:
- 5.3
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents the results of the content rewrite operation. -
Constructor Summary
ConstructorsConstructorDescriptionStorageFormatUserRewriter(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 anyUserKeys inUserResourceIdentifiers 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 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, IOExceptionRewrites 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
-