Package com.day.cq.wcm.foundation
Class ParagraphSystem
java.lang.Object
com.day.cq.wcm.foundation.ParagraphSystem
Provides helper methods for drawing a paragraph system. It detects
columns control resources and adds the respective paragraph type and
columns control information to the paragraphs.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionParagraphSystem(Resource resource) Creates a new paragraph system based on the given resourceParagraphSystem(Resource resource, String versionLabel) Creates a new paragraph system based on the given resource and sets up the paragraph system to compare itself to a versioned resource.ParagraphSystem(Resource resource, String versionLabel, boolean isVersionDiff) Creates a new paragraph system based on the given resource and sets up the paragraph system to compare itself to a versioned resource. -
Method Summary
Modifier and TypeMethodDescriptionstatic ParagraphSystemcreate(Resource resource, SlingHttpServletRequest req) Create the paragraph system based on the given request.Returns the default layoutReturns the list of paragraphs of this systemvoidrepair()Checks the structure of this paragraph system and fixes it.voidsetColCtrlResourceType(String colCtrlResourceType) Sets the columns control resource type used when fixing the structurevoidsetDefaultLayout(String defaultLayout) Sets the default layout in the format:numCols;cssClass
-
Field Details
-
log
default logger -
PARAMETER_VERSION_DIFF
Request parameter for the version diff.- See Also:
-
PARAMETER_VERSION_VIEW
Request parameter for the version view.- See Also:
-
COL_CTL_TYPE
name of the column control type property- See Also:
-
COL_CTL_LAYOUT
name of the layout property- See Also:
-
-
Constructor Details
-
ParagraphSystem
Creates a new paragraph system based on the given resource- Parameters:
resource- underlying resource
-
ParagraphSystem
Creates a new paragraph system based on the given resource and sets up the paragraph system to compare itself to a versioned resource. If the specified version does not exists, the paragraph system is displayed as if no version has been specified.- Parameters:
resource- underlying resourceversionLabel- optional version label for comparing.- Since:
- 5.2
-
ParagraphSystem
Creates a new paragraph system based on the given resource and sets up the paragraph system to compare itself to a versioned resource. If the specified version does not exists, the paragraph system is displayed as if no version has been specified.- Parameters:
resource- underlying resourceversionLabel- optional version label for comparing.isVersionDiff-trueif this parsys is used for version diffing- Since:
- 5.2
-
-
Method Details
-
create
Create the paragraph system based on the given request. This method takes the current resource from the request and evaluates possible request parameters (for version diff etc.- Parameters:
resource- resourcereq- request- Returns:
- paragraph system
-
setColCtrlResourceType
Sets the columns control resource type used when fixing the structure- Parameters:
colCtrlResourceType- the resource type
-
getDefaultLayout
Returns the default layout- Returns:
- the default layout
-
setDefaultLayout
Sets the default layout in the format:numCols;cssClass- Parameters:
defaultLayout- default layout
-
paragraphs
Returns the list of paragraphs of this system- Returns:
- the list of paragraphs
-
repair
public void repair()Checks the structure of this paragraph system and fixes it. note that the changes are not saved.
-