Class DesignImporterContext
A context object is created for an import request and passed along to various classes participating in the import process. The participant classes (e.g. TagHandlers) can use the contextual information as per their needs.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe OSGi BundleContext that may be used by the TagHandlers to interact with the OSGi frameworkThe CanvasBuilder object associated with the current import requeststatic final String
The suffix generator that generates suffixes per component names to uniquely identify them in the node hierarchy.The page being worked upon.Represents the design node that gets created during the design import process.The name of the HTML file for which the CQ page is getting constructed.Placeholder for import warnings.Represents the CQ Page that initiates the import requestDeprecated.Usage of this field has been removed (keeping this field for backward compatibility) -
Constructor Summary
ConstructorsConstructorDescriptionDesignImporterContext
(Page page, Node designNode) DesignImporterContext
(Page page, Node designNode, String htmlName) ConstructorDesignImporterContext
(Page page, Node designNode, String htmlName, CanvasBuilder canvasBuilder) DesignImporterContext
(Page page, Node designNode, String htmlName, CanvasBuilder canvasBuilder, BundleContext bundleContext) DesignImporterContext
(Page page, Node designNode, String htmlName, CanvasBuilder canvasBuilder, BundleContext bundleContext, ArrayList<String> extractedResources) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addResourcesToRemove
(Set<String> resources) Registers resources that can be removed after the import has finished.getAttribute
(Object key) Returns the resources that can be removed after the import has finished.setAttribute
(Object key, Object value) void
setImporter
(Resource importer)
-
Field Details
-
designNode
Represents the design node that gets created during the design import process.While importing a design package, the design importer unloads all the referenced assets(images, icons, styles, scripts etc.) into a design node that is uniquely associated with the page under construction. This node acts as the design path for the page that gets constructed after the import process.
-
page
Represents the CQ Page that initiates the import requestThe current import workflow involves dropping of the design package on an existing page with a drop zone. The existing page itself gets transformed into the resultant page.
-
currentPage
The page being worked upon. This could be different frompage
for secondary canvases -
componentSuffixGenerator
The suffix generator that generates suffixes per component names to uniquely identify them in the node hierarchy. -
canvasBuilder
The CanvasBuilder object associated with the current import request -
htmlName
The name of the HTML file for which the CQ page is getting constructed.The design package should typically contain an index.html file at archive root level. However, it is possible to create multiple CQ pages from one design package itself. The mobile page creation exemplifies this fact. The htmlName identifies the html document the CQ page for which is getting constructed.
-
bundleContext
The OSGi BundleContext that may be used by the TagHandlers to interact with the OSGi framework -
slingHttpServletRequest
Deprecated.Usage of this field has been removed (keeping this field for backward compatibility)The sling request object associated with the current import request. -
CHAR_ENCODING_KEY
- See Also:
-
importWarnings
Placeholder for import warnings. Various participating classes may choose to log import errors in this list.
-
-
Constructor Details
-
DesignImporterContext
- Parameters:
page
-designNode
-
-
DesignImporterContext
Constructor- Parameters:
page
-designNode
-htmlName
-
-
DesignImporterContext
public DesignImporterContext(Page page, Node designNode, String htmlName, CanvasBuilder canvasBuilder) -
DesignImporterContext
public DesignImporterContext(Page page, Node designNode, String htmlName, CanvasBuilder canvasBuilder, BundleContext bundleContext) -
DesignImporterContext
public DesignImporterContext(Page page, Node designNode, String htmlName, CanvasBuilder canvasBuilder, BundleContext bundleContext, ArrayList<String> extractedResources)
-
-
Method Details
-
getAttributes
-
getAttribute
-
setAttribute
-
setImporter
-
getImporter
-
getExtractedResources
-
addResourcesToRemove
Registers resources that can be removed after the import has finished.- Parameters:
resources
- A set of paths relative to the design node
-
getResourcesToRemove
Returns the resources that can be removed after the import has finished.- Returns:
- A set of paths relative to the design node
-