com.atlassian.confluence.importexport.impl
Class StorageFormatUserRewriter
java.lang.Object
com.atlassian.confluence.importexport.impl.StorageFormatUserRewriter
public class StorageFormatUserRewriter
- extends java.lang.Object
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:
- v5.3
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StorageFormatUserRewriter
public StorageFormatUserRewriter(XmlEventReaderFactory xmlEventReaderFactory,
XmlOutputFactory xmlOutputFactory,
Unmarshaller<UserResourceIdentifier> userResourceIdentifierUnmarshaller,
Marshaller<UserResourceIdentifier> userResourceIdentifierMarshaller)
rewriteUserKeysInContent
public StorageFormatUserRewriter.RewriteResult rewriteUserKeysInContent(java.lang.String importedStorageFormat,
com.google.common.base.Function<com.atlassian.sal.api.user.UserKey,com.atlassian.sal.api.user.UserKey> userKeyTranslator,
ConversionContext conversionContext)
throws javax.xml.stream.XMLStreamException,
XhtmlException,
java.io.IOException
- Rewrites any
UserKey
s in UserResourceIdentifier
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:
storageFormatReader
- Supplies the input storage formatstorageFormatWriter
- The rewritten storage format will be written to thisuserKeyTranslator
- The function that translates one userkey to anotherconversionContext
-
- Returns:
- A
Map
of the userkey translations used for this content. Untranslated userkeys will be represented as null values.
- Throws:
javax.xml.stream.XMLStreamException
XhtmlException
java.io.IOException
Copyright © 2003-2013 Atlassian. All Rights Reserved.