Package com.avoka.fc.core.dao
Class FormDao
java.lang.Object
com.avoka.core.dao.BaseDao
com.avoka.fc.core.dao.AbstractDao
com.avoka.fc.core.dao.FormDao
Provides a DAO for the Form entity.
- See Also:
-
Field Summary
Fields inherited from class com.avoka.core.dao.BaseDao
FETCH_LIMIT, STATEMENT_MAX_NO_PARAMETERS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the list of forms that are active and not in test mode and whose client is also active, sorted by form name.getActiveFilteredFormsForClient
(String clientId, Collection<String> formIdsToExclude) Return the list of active forms for a client while excluding a set of formsgetActiveFormListForClient
(String clientId) The list of active forms for a specific client This query uses a fetch limit of 10000.getActiveFormListForPortal
(Portal portal, boolean includeTestForms) Return the list of active form for a specific portalgetActiveForms
(boolean includeTestForms) Return the list of forms that are active and whose client is also active, sorted by form name.getActiveFormsWithFarKey
(String clientId, String farFormKey) Return the set of active forms for a given client matching a specified FAR form keygetActiveProductionFormByFormCode
(String formCode) Return the form with the specified form, prefetching the client.getFormByFormCode
(String formCode) Return the form with the specified form code.getFormByFormCode
(String formCode, boolean refresh) Return the form with the specified form code.getFormByFormCodeIgnoreCase
(String formCode) Return the form with the specified form code performing an ignore-case query to support Oracle database.getFormByName
(Client client, String name) Return a form with the specified name belonging to a specific clientgetFormByNameIgnoreCase
(String clientCode, String formName) Return a form with a certain name and belonging to a specific client.getFormByNormalizedName
(Client client, String formNameNormalized) Return a form with the given normalized name belonging to a specific clientgetFormByPortal
(Portal portal, String name) Gets the list of active forms by portal.getFormBySubmitKey
(String submitKey) Return the form associated with the specified submission, prefetching the client and current template versiongetFormCodesForKeywordLike
(String keyword, Portal portal, String clientName, String formNameLike, boolean includeAllForms) Return a set of form codes matching the specified search criteriagetFormForFormDesign
(Long formDesignId) Return the form with the specified form design OID.getFormFromPK
(Object id) Return the form with the specified OIDgetFormGroupNames
(Form form) Return the list of form group names for the given form.getFormList
(String clientId, boolean activeForms) Return the form list for the given client and active form flag.getFormList
(String clientId, String portalId, String keyword, Boolean active, Boolean test, String sortBy, int fetchLimit) Return information about forms that match the specified search criteria.getFormList
(String clientId, String portalId, String keyword, String formType, List<String> status, Boolean test, String sortBy) Return information about forms that match the specified search criteriagetFormList
(String clientId, String portalId, String keyword, String formType, List<String> status, Boolean test, String sortBy, int fetchLimit) Return information about forms that match the specified search criteria.getFormList
(String clientId, String portalId, String keyword, List<String> status, Boolean test, String sortBy) Return information about forms that match the specified search criteriagetFormListForClient
(String clientId) Return the list of forms filtered by client when specified, sorted by form name.getFormListForIds
(List<Long> formIds) Return the list of forms for the given form IDs.getFormListForKeywordLike
(String keyword, List<String> categoryNames, Portal portal) Return a list of forms matching the specified search criteriagetFormListIds
(List<Long> formIds, UserAccount userAccount) Return the list of forms for the given form IDs filtered for the users access.getFormsByDeliveryDetails
(DeliveryDetails deliveryDetails, boolean isTestDelivery) Gets the forms by delivery details.getFormsByName
(String clientId, String name) Return a list of forms whose name contains a certain substring and belonging to a specific client, ordered by form namegetFormsSearch
(String clientId, String value) Return a list of forms whose name or code contain the search string, or whose OID matches the search string if it is numericgetNextVersionNumber
(Form form) Return the next template version number for the given form.Methods inherited from class com.avoka.fc.core.dao.AbstractDao
andFilterClientExcludeNull, andFilterClientIncludeNull, andFilterClientOnly, isClientAccessAllowed, performQueryConfigCached
Methods inherited from class com.avoka.core.dao.BaseDao
addOrdering, addOrderingCaseInsensitive, addOrderingCaseSensitive, andQueryBetween, andQueryInExp, andQueryInExp, andQueryLikeIgnoreCaseExp, andQueryMatchDbExp, andQueryMatchExp, andQueryMatchIsNotNull, andQueryMatchIsNull, andQueryNoMatchExp, andQueryNotTrue, deleteObject, deleteObjects, findObject, getDataContext, getFetchLimit, getLogger, getObjectForPK, newObject, orQueryLikeIgnoreCaseExp, orQueryMatchExp, performNamedQuery, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, performQuery, registerNewObject, setCacheStrategy, setFetchLimit, setLocalCacheStrategy, setLocalCacheStrategy, setSharedCacheStrategy, toMap, toMap
-
Constructor Details
-
FormDao
public FormDao()
-
-
Method Details
-
getFormFromPK
Return the form with the specified OID- Parameters:
id
- the OID- Returns:
- the matching form, or null if not found
-
getFormByFormCode
Return the form with the specified form code.- Parameters:
formCode
- the form code- Returns:
- the form, or null if none was found
-
getFormByFormCode
Return the form with the specified form code.- Parameters:
formCode
- the form coderefresh
- refresh the local cache- Returns:
- the form, or null if none was found
-
getFormByFormCodeIgnoreCase
Return the form with the specified form code performing an ignore-case query to support Oracle database.- Parameters:
formCode
- the form code- Returns:
- the form, or null if none was found
- Since:
- 17.10.0
-
getActiveProductionFormByFormCode
Return the form with the specified form, prefetching the client. Only active forms that are not in test mode are considered.- Parameters:
formCode
- the form code- Returns:
- the active non-test form, or null if none was found
-
getFormBySubmitKey
Return the form associated with the specified submission, prefetching the client and current template version- Parameters:
submitKey
- the surrogate key of the submission- Returns:
- the form, or null if none was found
-
getActiveAndProductionFormList
Return the list of forms that are active and not in test mode and whose client is also active, sorted by form name.- Returns:
- the list of matching forms
-
getActiveForms
Return the list of forms that are active and whose client is also active, sorted by form name.- Parameters:
includeTestForms
- whether to include forms in test mode- Returns:
- the list of matching forms
-
getFormsByDeliveryDetails
public List<Form> getFormsByDeliveryDetails(DeliveryDetails deliveryDetails, boolean isTestDelivery) Gets the forms by delivery details.- Parameters:
deliveryDetails
- the delivery detailsisTestDelivery
- the is test delivery- Returns:
- the forms by delivery details
- Since:
- 4.0.0
-
getFormListIds
Return the list of forms for the given form IDs filtered for the users access.- Parameters:
formIds
- the list of form IDs (required)userAccount
- the logged in user account (required)- Returns:
- the list of forms for the given form IDs
- Since:
- 4.3.2
-
getFormListForIds
Return the list of forms for the given form IDs.- Parameters:
formIds
- the list of form IDs- Returns:
- the list of forms for the given form IDs
-
getFormListForClient
Return the list of forms filtered by client when specified, sorted by form name. This query uses a fetch limit of 10000.- Parameters:
clientId
- the client id- Returns:
- the list of matching forms
-
getActiveFormListForClient
The list of active forms for a specific client This query uses a fetch limit of 10000.- Parameters:
clientId
- the OID of the client (optional)- Returns:
- the list of forms
-
getActiveFormListForPortal
Return the list of active form for a specific portal- Parameters:
portal
- the portal objectincludeTestForms
- if set to false, the search will include only non-test forms; otherwise, forms will be included regardless of their test mode- Returns:
- the list of matching forms, or an empty list if no portal was specified
-
getFormList
Return the form list for the given client and active form flag.- Parameters:
clientId
- the client idactiveForms
- the active form flag- Returns:
- the form list for the given client and active form flag
-
getFormList
public List getFormList(String clientId, String portalId, String keyword, List<String> status, Boolean test, String sortBy) Return information about forms that match the specified search criteria- Parameters:
clientId
- the OID of the client (optional)portalId
- the OID of the portal associated with the form (optional)keyword
- a search keywordstatus
- a set of form status to include in the searchtest
- if set to false, only non-test forms are considered; otherwise, forms are not filtered by test modesortBy
- the sort form list by [ Form Name | Modified Date | Modified By | Created Date ]- Returns:
- a list of matching
DataRow
objects containing form-related information
-
getFormList
public List getFormList(String clientId, String portalId, String keyword, String formType, List<String> status, Boolean test, String sortBy) Return information about forms that match the specified search criteria- Parameters:
clientId
- the OID of the client (optional)portalId
- the OID of the portal associated with the form (optional)keyword
- a search keywordformType
- the template version form typestatus
- a set of form status to include in the searchtest
- if set to false, only non-test forms are considered; otherwise, forms are not filtered by test modesortBy
- the sort form list by [ Form Name | Modified Date | Modified By | Created Date ]- Returns:
- a list of matching
DataRow
objects containing form-related information - Since:
- 5.0.0
-
getFormList
public List getFormList(String clientId, String portalId, String keyword, Boolean active, Boolean test, String sortBy, int fetchLimit) Return information about forms that match the specified search criteria.- Parameters:
clientId
- the OID of the client (optional)portalId
- the OID of the portal associated with the form (optional)keyword
- a search keywordactive
- if set, only active forms are considered; otherwise, only inactive forms are returnedtest
- if set to false, only non-test forms are considered; otherwise, forms are not filtered by test modesortBy
- the sort form list by [ Form Name | Modified Date | Modified By | Created Date ]fetchLimit
- the fetch limit- Returns:
- a list of matching
DataRow
objects containing form-related information
-
getFormList
public List getFormList(String clientId, String portalId, String keyword, String formType, List<String> status, Boolean test, String sortBy, int fetchLimit) Return information about forms that match the specified search criteria.- Parameters:
clientId
- the OID of the client (optional)portalId
- the OID of the portal associated with the form (optional)keyword
- a search keywordformType
- the template version form typestatus
- a set of form status to include in the searchtest
- if set to false, only non-test forms are considered; otherwise, forms are not filtered by test modesortBy
- the sort form list by [ Form Name | Modified Date | Modified By | Created Date ]fetchLimit
- the fetch limit- Returns:
- a list of matching
DataRow
objects containing form-related information - Since:
- 5.0.0
-
getFormsByName
Return a list of forms whose name contains a certain substring and belonging to a specific client, ordered by form name- Parameters:
clientId
- the OID of the clientname
- a substring of the form name- Returns:
- the list of matching forms
-
getFormByName
Return a form with the specified name belonging to a specific client- Parameters:
client
- the client object (optional)name
- the form name (optional)- Returns:
- the form matching the criteria (if multiple forms match, one of them is returned arbitrarily)
-
getFormByNameIgnoreCase
Return a form with a certain name and belonging to a specific client.- Parameters:
clientCode
- the client code (not case sensitive)formName
- the form name (not case sensitive)- Returns:
- the matching form (if multiple forms match, one of them is returned arbitrarily)
-
getFormByNormalizedName
Return a form with the given normalized name belonging to a specific client- Parameters:
client
- the client object (optional)formNameNormalized
- the normalized form name- Returns:
- the matching form (if multiple forms match, one of them is returned arbitrarily)
-
getFormsSearch
Return a list of forms whose name or code contain the search string, or whose OID matches the search string if it is numeric- Parameters:
clientId
- the OID of the client associated with the formvalue
- the non-empty search string- Returns:
- the list of matching forms
-
getFormListForKeywordLike
public List<Form> getFormListForKeywordLike(String keyword, List<String> categoryNames, Portal portal) Return a list of forms matching the specified search criteria- Parameters:
keyword
- a keyword to match against various form-related attributescategoryNames
- the category name(s) to filter on (optional). If multiple categories are specified, at least one category has to match.portal
- the non-null portal object which the forms must belong to- Returns:
- the list of matching active non-test forms belonging to active clients
-
getFormCodesForKeywordLike
public Set<String> getFormCodesForKeywordLike(String keyword, Portal portal, String clientName, String formNameLike, boolean includeAllForms) Return a set of form codes matching the specified search criteria- Parameters:
keyword
- a keyword to match against various form-related attributesportal
- the non-null portal object which the forms must belong toclientName
- the name of the client associated with the form (optional)formNameLike
- a substring of the form name (optional)includeAllForms
- whether to include all forms (true) or only active non-test forms belonging to active clients (false)- Returns:
- the set of form codes of matching forms
-
getActiveFormsWithFarKey
Return the set of active forms for a given client matching a specified FAR form key- Parameters:
clientId
- the OID of the client (required)farFormKey
- the FAR form key (required)- Returns:
- the list of matching forms
-
getActiveFilteredFormsForClient
public List<Form> getActiveFilteredFormsForClient(String clientId, Collection<String> formIdsToExclude) Return the list of active forms for a client while excluding a set of forms- Parameters:
clientId
- the OID of the client (required)formIdsToExclude
- the collection of form IDs to exclude- Returns:
- the list of matching forms
-
getFormByPortal
Gets the list of active forms by portal.- Parameters:
portal
- the portal (required)name
- a substring of the form name (optional)- Returns:
- the list of forms
-
getNextVersionNumber
Return the next template version number for the given form. If versions already exist, this will return the highest version number of incremented patch by 1; otherwise it will return "0.1.0".- Parameters:
form
- the non-null form- Returns:
- the next version number string
-
getFormForFormDesign
Return the form with the specified form design OID.- Parameters:
formDesignId
- the form design ID (required)- Returns:
- the form, or null if none was found
- Since:
- 4.0.0
-
getFormGroupNames
Return the list of form group names for the given form.- Parameters:
form
- the form (required)- Returns:
- the list of form group names for the given form
- Since:
- 17.10.0
-