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
-
public class FormDao extends AbstractDao
Provides a DAO for the Form entity.- See Also:
Form
-
-
Field Summary
-
Fields inherited from class com.avoka.core.dao.BaseDao
FETCH_LIMIT, STATEMENT_MAX_NO_PARAMETERS
-
-
Constructor Summary
Constructors Constructor Description FormDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Form>
getActiveAndProductionFormList()
Return the list of forms that are active and not in test mode and whose client is also active, sorted by form name.List<Form>
getActiveFilteredFormsForClient(String clientId, Collection<String> formIdsToExclude)
Return the list of active forms for a client while excluding a set of formsList<Form>
getActiveFormListForClient(String clientId)
The list of active forms for a specific client This query uses a fetch limit of 10000.List<Form>
getActiveFormListForPortal(Portal portal, boolean includeTestForms)
Return the list of active form for a specific portalList<Form>
getActiveForms(boolean includeTestForms)
Return the list of forms that are active and whose client is also active, sorted by form name.List<Form>
getActiveFormsWithFarKey(String clientId, String farFormKey)
Return the set of active forms for a given client matching a specified FAR form keyForm
getActiveProductionFormByFormCode(String formCode)
Return the form with the specified form, prefetching the client.Form
getFormByFormCode(String formCode)
Return the form with the specified form code.Form
getFormByFormCode(String formCode, boolean refresh)
Return the form with the specified form code.Form
getFormByFormCodeIgnoreCase(String formCode)
Return the form with the specified form code performing an ignore-case query to support Oracle database.Form
getFormByName(Client client, String name)
Return a form with the specified name belonging to a specific clientForm
getFormByNameIgnoreCase(String clientCode, String formName)
Return a form with a certain name and belonging to a specific client.Form
getFormByNormalizedName(Client client, String formNameNormalized)
Return a form with the given normalized name belonging to a specific clientList<Form>
getFormByPortal(Portal portal, String name)
Gets the list of active forms by portal.Form
getFormBySubmitKey(String submitKey)
Return the form associated with the specified submission, prefetching the client and current template versionSet<String>
getFormCodesForKeywordLike(String keyword, Portal portal, String clientName, String formNameLike, boolean includeAllForms)
Return a set of form codes matching the specified search criteriaForm
getFormForFormDesign(Long formDesignId)
Return the form with the specified form design OID.Form
getFormFromPK(Object id)
Return the form with the specified OIDList<String>
getFormGroupNames(Form form)
Return the list of form group names for the given form.List<Form>
getFormList(String clientId, boolean activeForms)
Return the form list for the given client and active form flag.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.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 criteriaList
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.List
getFormList(String clientId, String portalId, String keyword, List<String> status, Boolean test, String sortBy)
Return information about forms that match the specified search criteriaList<Form>
getFormListForClient(String clientId)
Return the list of forms filtered by client when specified, sorted by form name.List<Form>
getFormListForIds(List<Long> formIds)
Return the list of forms for the given form IDs.List<Form>
getFormListForKeywordLike(String keyword, List<String> categoryNames, Portal portal)
Return a list of forms matching the specified search criteriaList<Form>
getFormListIds(List<Long> formIds, UserAccount userAccount)
Return the list of forms for the given form IDs filtered for the users access.List<Form>
getFormsByDeliveryDetails(DeliveryDetails deliveryDetails, boolean isTestDelivery)
Gets the forms by delivery details.List<Form>
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 nameList<Form>
getFormsSearch(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 numericString
getNextVersionNumber(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
-
-
-
-
Method Detail
-
getFormFromPK
public Form getFormFromPK(Object id)
Return the form with the specified OID- Parameters:
id
- the OID- Returns:
- the matching form, or null if not found
-
getFormByFormCode
public Form getFormByFormCode(String formCode)
Return the form with the specified form code.- Parameters:
formCode
- the form code- Returns:
- the form, or null if none was found
-
getFormByFormCode
public Form getFormByFormCode(String formCode, boolean refresh)
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
public Form getFormByFormCodeIgnoreCase(String formCode)
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
public Form getActiveProductionFormByFormCode(String formCode)
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
public Form getFormBySubmitKey(String submitKey)
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
public List<Form> 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
public List<Form> getActiveForms(boolean includeTestForms)
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
public List<Form> getFormListIds(List<Long> formIds, UserAccount userAccount)
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
public List<Form> getFormListForIds(List<Long> formIds)
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
public List<Form> getFormListForClient(String clientId)
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
public List<Form> getActiveFormListForClient(String clientId)
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
public List<Form> getActiveFormListForPortal(Portal portal, boolean includeTestForms)
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
public List<Form> getFormList(String clientId, boolean activeForms)
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
public List<Form> 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 name- Parameters:
clientId
- the OID of the clientname
- a substring of the form name- Returns:
- the list of matching forms
-
getFormByName
public Form getFormByName(Client client, String name)
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
public Form getFormByNameIgnoreCase(String clientCode, String formName)
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
public Form getFormByNormalizedName(Client client, String formNameNormalized)
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
public List<Form> getFormsSearch(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 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
public List<Form> getActiveFormsWithFarKey(String clientId, String farFormKey)
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
public List<Form> getFormByPortal(Portal portal, String name)
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
public String getNextVersionNumber(Form form)
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
public Form getFormForFormDesign(Long formDesignId)
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
-
-