AddSchedSearch - AFS

AFS Integration Guide

Product
AFS
AFS_Version
7.9
Category
Reference Guide

This widget allows to save a current search to reuse it later quickly. Each saved search can be scheduled. In that case the user receive the new results according to the scheduling settings and the ACS notifications policy.

This widget requires authentication (Login widget).

Example of an inline configuration with an auto daily scheduling:

<div data-type="AFSWidget" data-name="AddSchedSearch">
<script type="application/json">
{
"mainButtonActiveLabel": "Hide",
"mainButtonInactiveLabel": "Save",
"submitButtonLabel": "Schedule",
"nameFieldLabel": "Name",
"scheduleTime": "09:00:00",
"scheduleDaysOfWeek": ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"]
}
</script>
</div>

Example of an external configuration defining custom scheduling presets:

var AFSWidgetAddSchedSearch = {
scheduleFieldLabel: "Choose Scheduling",
useSchedulingList: false,
enableSchedule: false,
scheduling: [{
name: "By minute",
type: "MINUTE" // provided for debug purposes
}, {
name: "Hourly",
type: "HOUR",
startTime: "09:00:00"
}, {
name: "Daily",
type: "DAY",
daysOfWeek: ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY"]
}, {
name: "Weekly",
type: "DAY",
daysOfWeek: ["MONDAY"]
}, {
name: "Bimonthly",
type: "MONTH",
daysOfMonth: [1, 15]
}, {
name: "Monthly",
type: "MONTH",
daysOfMonth: [1]
}]
};

AddSchedSearch - This widget allows to save a current search

Parameter

Type

Card

Default

Description

mainButtonActiveLabel

String

Optional

Unsave

The label of the main button when the save form is shown.

mainButtonInactiveLabel

String

Optional

Save

The label of the main button when the save form is hidden.

submitButtonLabel

String

Optional

Save

The label of the submit button.

cancelButtonLabel

String

Optional

Cancel

The label of the cancel button.

nameFieldLabel

String

Optional

Name

The label of the name field.

scheduleTime

String

Optional

09:00:00

The time when saved searches have to be run. This time must respect the syntax HH:mm:ss. (Unused if scheduling is set).

scheduleDaysOfWeek

Array

Optional

all days

The list of days when scheduling can be done. (Unused if scheduling is set)

enableSchedule

Boolean

Optional

true

Activates scheduling when saving the search. If set to true, the scheduler will run it according to schedule configuration. if not, il will not run this query. By default, saved searches are scheduled.

outsideClickTogglePanel

Boolean

Optional

false

Indicates if the click has to be monitored to change the widget state. See tip below.

headerLabel

String

Optional

"Save Your Query"

The label of the panel header.

scheduleButtonActiveLabel

String

Optional

"Unfollow"

Label of the button used to unfollow a currently saved search.

scheduleButtonInactiveLabel

String

Optional

"Follow"

Label of the button used to follow a saved search.

searchInfoText

String

Optional

"This search is part of your saved searches."

Value of the text displayed to indicates that a search is currently saved.

searchScheduledInfoText

String

Optional

"You are following this search."

Value of the text displayed to indicates that a search is currently followed.

useSearchNameAsButtonLabel

Boolean

Optional

false

The search name is used as the remove button label after a creation.

removeActionAllowed

Boolean

Optional

true

Indicates if a saved search can quickly be removed from the same widget (instead of using ListSchedSearches Widget).

scheduleFieldLabel

String

Optional

Scheduling

The label of the scheduling field. (Displayed only if more than one scheduling is defined).

useSchedulingList

Boolean

Optional

false

Indicates if the scheduling selector (only if more than once) should be displayed in a list with searchbox (Chosen like), instead of the radiobuttons mode.

scheduling

Array

Optional

N/A

Allows to define scheduling presets. See example for details.

At integration time, the widget can be styled as a pop-up. The click on the main button toggles the presence of a CSS class on the widget top-level container, allowing to update the panel visibility. If styled as a pop-up, the outsideClickTogglePanel option can be useful to change the widget state when a click occurs outside of the widget panel, by removing the previously mentioned CSS class.