Requirements
- Xcode 9.3 or above
- iOS 11 SDK
- Liferay Portal 6.2 CE/EE, Liferay CE Portal 7.0/7.1, Liferay DXP
- Liferay Screens Compatibility app (CE or EE/DXP). This app is preinstalled in Liferay CE Portal 7.0/7.1 and Liferay DXP.
Compatibility
- iOS 9 and above
Xamarin Requirements
- Visual Studio 7.2
- Mono .NET framework 5.4.1.6
Features
Comment Add Screenlet can add a comment to an asset in a Liferay instance.
JSON Services Used
Screenlets in Liferay Screens call JSON web services in the portal. This Screenlet calls the following services and methods.
Service | Method | Notes |
---|---|---|
ScreenscommentService (Screens compatibility plugin) | addComment |
Module
- None
Themes
- Default
The Default Theme uses the iOS elements UITextField
and UIButton
to add a
comment to an asset. Other Themes may use other components to show the comment.
Offline
This Screenlet supports offline mode so it can function without a network connection. For more information on how offline mode works, see the tutorial on its architecture. Here are the offline mode policies that you can use with this Screenlet:
Policy | What happens | When to use |
---|---|---|
remote-only | The Screenlet sends the data to the Liferay instance. If a connection issue occurs, the Screenlet uses the listener to notify the developer about the error. If the Screenlet successfully sends the data, it also stores it in the local cache. | Use this policy when you always need to send updated data, and send nothing when there’s no connection. |
cache-only | The Screenlet sends the data to the local cache. If an error occurs, the Screenlet uses the listener to notify the developer. | Use this policy when you always need to store local data without sending remote information under any circumstance. |
remote-first | The Screenlet sends the data to the Liferay instance. If this succeeds, the Screenlet also stores the data in the local cache. If a connection issue occurs, the Screenlet stores the data to the local cache and sends it to the Liferay instance when the connection is restored. If an error occurs, the Screenlet uses the listener to notify the developer. | Use this policy to send the most recent version of the data when connected, and store the data for later synchronization when there’s no connection. |
cache-first | The Screenlet sends the data to the local cache, then sends it to the Liferay instance. If sending the data to the Liferay instance fails, the Screenlet still stores the data locally and then notifies the developer about any errors that occur (including connectivity errors). | Use this policy to save bandwidth and store local (but possibly outdated) data. |
Required Attributes
className
classPK
Attributes
Attribute | Data type | Explanation |
---|---|---|
className | string | The asset’s fully qualified class name. For example, a blog entry’s className is com.liferay.blogs.model.BlogsEntry . The className and classPK attributes are required to instantiate the Screenlet. |
classPK | number | The asset’s unique identifier. The className and classPK attributes are required to instantiate the Screenlet. |
offlinePolicy | string | The offline mode setting. The default value is remote-first . See the Offline section for details. |
Delegate
Comment Add Screenlet delegates some events to an object that conforms to the
CommentAddScreenletDelegate
protocol. This protocol lets you implement
the following methods:
-
- screenlet:onCommentAdded:
: Called when the Screenlet adds a comment. -
- screenlet:onAddCommentError:
: Called when an error occurs while adding a comment. TheNSError
object describes the error. -
- screenlet:onCommentUpdated:
: Called when the Screenlet prepares a comment for update. -
- screenlet:onUpdateCommentError:
: Called when an error occurs while updating a comment. TheNSError
object describes the error.