Loading Audio...
Creating a Dashboard for Contact Us Responses
As Clarity continues to receive contact requests, its team needs a reliable way to track and respond to submissions. To support this, Clarity wants to define a workflow for the Contact Us object and create dashboard for viewing unanswered requests from site visitors. In this article, you’ll implement both of these elements.
Exercise: Creating a Workflow
To improve visibility for pending requests, Clarity needs a workflow that notifies Distributor Representatives of new submissions. Here you’ll create a simple workflow that sends a notification to the Distributor Representatives role for new requests as the Clarity Admin user.
-
In your Liferay instance, sign in as the Clarity Admin user.
- Username:
admin@clarityvisionsolutions.com
- Password:
learn
- Username:
-
Open the Global Menu (
) and click Process Builder in the Applications tab.
-
Click New to create a new workflow.
-
For name, enter
Contact Us Follow Up
. -
In the Nodes panel, find the Task node and drag it into the workflow editor.
-
In the side panel, configure these settings for the Task node.
Field Value Label Follow Up Node Name followUp Description Ask Distributor Representative to verify new Contact Us submission. -
Hover your mouse over the Start node and drag an arrow to the Task node.
-
In the side panel, configure these settings for the Transition Label.
Field Value Label Review Transition Name review_contact_us_entry Default Yes -
In the same way, drag an arrow from the Task node to the End node.
This defines the progression of the workflow. -
In the side panel, configure these settings for the second Transition Label.
Field Value Label Approve Transition Name approve_contact_us_entry Default Yes
-
Click the Follow Up node to begin configuring it.
-
Under Assignments, click Asset Creator.
-
For Assignment Type, select Role.
-
For Role, select Distributor Representative.
-
Click Back (
) to continue editing the Follow Up node.
-
Under Notifications, click New.
-
For Name, enter
Follow Up Task
. -
For Template, enter this text:
There is a new ${entryType} request for you to follow up with.
-
For Notification Types, select User Notification.
-
For Recipient Type, select Role.
-
For Role Name, select Distributor Representative.
-
Click the End node to begin configuring it.
-
Under Actions, click New.
-
Set the following attributes for the new action:
Field Value Name Approved Entry Type Updated Status Status Approved Execution Type On Entry -
Click Publish.
Clarity now has a workflow that routes entries to users with the Distributor Representatives role. Next, you'll use it with the Contact Us object.
Exercise: Attaching the Workflow to the Object
Once you create a workflow, you can configure Liferay applications to use it. Here you'll configure the Contact Us object to use the new workflow as the Clarity Admin user.
-
Open the Global Menu (
) and go to the Clarity Public Enterprise Website.
-
Open the Site Menu (
), expand Configuration, and select Workflow.
-
Click Edit for the Contact Us asset type.
-
Select the Contact Us Follow Up workflow and click Save.
Great! You’ve successfully configured the Contact Us object to use the workflow. This ensures that users with the Distributor Representatives role receive notifications for new submissions, so they can review and address reach one. Next, you’ll create a UI for displaying pending tasks.
Exercise: Creating the Contact Us Responses Data Set
To help representatives monitor incoming requests, Clarity needs a way to display pending contact submissions in a clear, structured UI. Here you’ll enable Liferay Data Sets and use it to implement this UI as the Clarity Admin user.
-
Open the Global Menu (
), go to the Control Panel tab, and click Instance Settings.
-
Under the Platform section, click Feature Flags.
-
In the Release tab, enable these features:
- Root Object Definitions (LPD-34594)
- Data Set Manager (LPS-164563)
Now you can create a data set. -
Open the Global Menu (
), go to the Control Panel tab, and click Data Sets.
-
Click Add to create a new data set and enter these details:
Field Value Name Contact Us Responses REST Application /c/contactuses
REST Schema ContactUs
REST Endpoint /scopes/{scopeKey}
-
Click Save.
-
Click the Contact Us Responses data set to begin editing it.
-
Add this parameter to the Parameters input box:
filter=(status/any(x:(x eq 1)))
NOTE
This filter checks whether any status value equals1
, which corresponds to entries in a pending status. -
Click Save.
-
Go to the Visualization Modes tab.
Here you can determine what data users can view for different visualizations (i.e., table, list, or cards). -
Go to the List tab.
-
Click Add (
) for the Title row and select Assign from Data Source.
-
Select the fullName field.
-
Click Save.
-
Click Add (
) for the Description row and select Assign from Data Source.
-
Select the comment field.
-
Click Save.
Now when users view the data set as a list, these data points appear. The list should also only include entries with a ‘Pending’ workflow status. Next, you’ll display the data set on a site page.
Exercise: Displaying the Data Set on a Page
Clarity wants to display their new data set on a dedicated page. Here you’ll create the Contact Us Responses page and add the data set to it as the Clarity Admin user.
-
Go to the Clarity Public Enterprise Website.
-
Open the Site Menu (
), expand Site Builder, and select Pages.
-
Click New to create a new page.
-
Select the Primary Master Page template and name it
Contact Us Responses
. -
Click Add.
-
Drag and drop the Data Set fragment into the page’s drop zone.
-
In the General panel, click Add (
) to select a data set.
-
Select the Contact Us Responses data set and click Save.
-
Click Publish.
Since no tickets have been submitted after setting up the workflow, there are currently no pending entries to display. -
Verify everything works as expected:
- Use the Contact Us form to submit a few sample entries.
- Then return to the Contact Us Responses page to see the pending requests appear in the data set.
- Next, sign in as (or impersonate) Daniel Raymond to confirm that the Distributor Representative received the workflow notifications.
- Finally, assign the ticket to Daniel Raymond, approve it, and return to the data set page to confirm the entry has been removed.
Great! The data set is now published on a page, allowing users to view pending Contact Us entries in real time.
Conclusion
Congratulations! You’ve completed Module 6: Content Authoring and Management. Throughout this module, you’ve learned best practices for creating, storing, organizing, and displaying content in Liferay DXP. You also learned about setting up publishing workflows for facilitating and streamlining content collaboration.
In the next module, you’ll learn about using Liferay analytics and personalization features to create and improve user experiences.
Capabilities
Product
Education
Contact Us