Constructor
new LiferayApp()
Methods
_clearLayoutData()
Clears and detaches event handlers for Liferay's `dataLayoutConfigReady`
event
_clearRequestTimer()
Clears the timer that notifies the user when the SPA request
takes longer than the thresshold time configured in the
`Liferay.SPA.userNotification.timeout` System Settings property
_createNotification(configurationnon-null) → (non-null) {Promise}
Creates a user notification
Parameters:
Name | Type | Description |
---|---|---|
configuration |
Object | object that's passed to `Liferay.Notification` |
Returns:
A promise that renders a notification when
resolved
- Type
- Promise
_hideTimeoutAlert()
Hides the request timeout alert
_startRequestTimer(pathnon-null)
Starts the timer that shows the user a notification when the SPA
request takes longer than the threshold time configured in the
`Liferay.SPA.userNotification.timeout` System Settings property
Parameters:
Name | Type | Description |
---|---|---|
path |
String | The path that may time out |
createScreenInstance(pathnon-null) → {Screen}
Retrieves or create a screen instance to a path. This method overrides
the default one to avoid ActionURLScreens to be cached and reused across
navigations causing different lifecycle mechanisms to be called on live
documents instead of on inert fragments
Parameters:
Name | Type | Description |
---|---|---|
path |
string | Path containing the querystring part. |
Returns:
- Type
- Screen
getCacheExpirationTime() → (non-null) {Number}
Returns the cache expiration time configuration. This value comes from
System Settings. The configuration is set upon App initialization
- Source:
- See:
Returns:
The `cacheExpirationTime` value
- Type
- Number
getValidStatusCodes() → (non-null) {Array}
Returns the valid status codes accepted by Liferay. These values
come from ServletResponseConstants.java.
Returns:
The `validStatusCodes` property
- Type
- Array
isCacheEnabled() → (non-null) {Boolean}
Returns whether the cache is enabled. Cache is considered enabled
when getCacheExpirationTime is
greater than zero.
Returns:
True if cache is enabled
- Type
- Boolean
isInPortletBlacklist(elementnon-null) → (non-null) {Boolean}
Returns whether a given portlet element is in a blacklisted portlet
that should not behave like a SPA
Parameters:
Name | Type | Description |
---|---|---|
element |
String | The portlet boundary DOM node |
Returns:
True if portlet element is blacklisted
- Type
- Boolean
isScreenCacheExpired(screennon-null) → (non-null) {Boolean}
Returns whether a given Screen's cache is expired. The expiration timeframe
is based on the value returned by getCacheExpirationTime.
Parameters:
Name | Type | Description |
---|---|---|
screen |
Screen | The Senna Screen |
Returns:
True if the cache has expired
- Type
- Boolean
onBeforeNavigate(datanon-null, eventnon-null)
A callback for Senna's `beforeNavigate` event. The cache is cleared
for all screens when the flag `Liferay.SPA.clearScreensCache`
is set or when a form submission is about to occur. This method also
exposes the `beforeNavigate` event to the Liferay global object so
anyone can listen to it.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | Data about the event |
event |
Event | The event object |
onDataLayoutConfigReady_(eventnon-null)
A private event handler function, called when the
`dataLayoutConfigReady` event is fired on the Liferay object,
that initializes `Liferay.Layout`
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | The event object |
onDocClickDelegate_(eventnon-null)
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | The event object |
onDocSubmitDelegate_(eventnon-null)
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | The event object |
onEndNavigate(eventnon-null)
Callback for Senna's `endNavigate` event that exposes it
to the Liferay global object
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | The event object |
onLiferayIOComplete()
Callback for Liferay's `io:complete` event that clears screens cache when
an async request occurs
onNavigationError(eventnon-null)
Callback for Senna's `navigationError` event that displays
an alert message to the user with information about the error
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | The event object |
onStartNavigate(eventnon-null)
Callback for Senna's `startNavigate` event that exposes it
to the Liferay global object
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | The event object |
setPortletsBlacklist(portletsBlacklistnon-null)
Sets the `portletsBlacklist` property
Parameters:
Name | Type | Description |
---|---|---|
portletsBlacklist |
Object |
setValidStatusCodes(validStatusCodesnon-null)
Sets the `validStatusCodes` property
Parameters:
Name | Type | Description |
---|---|---|
validStatusCodes |
Array |