public class DefaultBlueprintResolver extends Object implements BlueprintResolver
| Constructor and Description |
|---|
DefaultBlueprintResolver(com.atlassian.plugin.web.WebInterfaceManager webInterfaceManager,
ContentBlueprintManager contentBlueprintManager) |
| Modifier and Type | Method and Description |
|---|---|
ContentBlueprint |
getContentBlueprint(String contentBlueprintId,
String blueprintModuleCompleteKey,
String spaceKey)
Finds the correct Blueprint for a given context.
|
com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor |
getWebItemMatchingBlueprint(String blueprintModuleKey) |
com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor |
getWebItemMatchingBlueprint(UUID blueprintId) |
ContentBlueprint |
resolveContentBlueprint(String blueprintId,
String spaceKey)
Given a Blueprint Id, finds the "nearest" Blueprint - space, global or plugin (in that order) that should be
used by calling code.
|
ContentTemplateRef |
resolveTemplateRef(ContentTemplateRef templateRef)
Given a template ref, finds the "nearest" template ref - space, global or plugin
that should be used when editing the template or creating a page from it.
|
public DefaultBlueprintResolver(com.atlassian.plugin.web.WebInterfaceManager webInterfaceManager,
ContentBlueprintManager contentBlueprintManager)
public com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor getWebItemMatchingBlueprint(UUID blueprintId)
getWebItemMatchingBlueprint in interface BlueprintResolverpublic com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor getWebItemMatchingBlueprint(String blueprintModuleKey)
getWebItemMatchingBlueprint in interface BlueprintResolverpublic ContentTemplateRef resolveTemplateRef(ContentTemplateRef templateRef)
BlueprintResolverThis resolution is required because we might get a template ref from a space-override of a Blueprint, but that template has been reverted. In that case, a globally-customised template ref for that Blueprint should be used, if it exists. If not, the template ref from the original plugin clone Blueprint.
resolveTemplateRef in interface BlueprintResolver@Nonnull public ContentBlueprint resolveContentBlueprint(@Nonnull String blueprintId, @Nullable String spaceKey) throws IllegalArgumentException
BlueprintResolverThis resolution is required because we might get a Blueprint Id from storage, but that Blueprint has been edited at the space or global level.
Note that this method does not allow for Ids that don't resolve to a Blueprint, it throws an exception rather than returning null.
resolveContentBlueprint in interface BlueprintResolverIllegalArgumentException@Nonnull public ContentBlueprint getContentBlueprint(String contentBlueprintId, String blueprintModuleCompleteKey, String spaceKey) throws IllegalArgumentException
BlueprintResolvergetContentBlueprint in interface BlueprintResolverIllegalArgumentExceptionCopyright © 2017 Atlassian. All rights reserved.