public class CrudAction extends AbstractCrudAction<Object>
AbstractPageAction.TerminalResource
Modifier and Type | Field and Description |
---|---|
Table |
baseTable |
static String |
copyright |
static String[][] |
CRUD_CONFIGURATION_FIELDS |
static org.slf4j.Logger |
logger |
Persistence |
persistence |
Session |
session |
protected long |
totalSearchRecords |
blobManager, classAccessor, crudConfiguration, crudConfigurationForm, firstResult, form, labelSearch, maxResults, object, objects, PERMISSION_CREATE, PERMISSION_DELETE, PERMISSION_EDIT, pk, pkHelper, popupCloseCallback, prefix, propertiesTableForm, propertyEdits, propertyName, relName, resultSetNavigation, SEARCH_STRING_PARAM, searchForm, searchPrefix, searchString, searchVisible, selection, selectionProviderEdits, selectionProviderIndex, selectionProvidersForm, selectionProviderSupport, sortDirection, sortProperty, successReturnUrl, tableForm, temporaryBlobManager
CONF_FORM_PREFIX, DEFAULT_LAYOUT_CONTAINER, PAGE_CONFIGURATION_FIELDS, PAGE_CONFIGURATION_FIELDS_NO_DETAIL, pageConfigurationForm, pageInstance, pageTemplate, PORTOFINO_PAGEACTION_EXCEPTION, portofinoConfiguration, returnUrl, script, serverInfo, templates
context
Constructor and Description |
---|
CrudAction() |
Modifier and Type | Method and Description |
---|---|
protected long |
calculateTotalSearchRecords() |
protected void |
commitTransaction()
Executes any pending updates on persistent objects.
|
protected ModelSelectionProviderSupport |
createSelectionProviderSupport() |
protected void |
doDelete(Object object)
Deletes an object from the persistent storage.
|
protected void |
doSave(Object object)
Saves a new object to the persistent storage.
|
protected void |
doUpdate(Object object)
Saves an existing object to the persistent storage.
|
protected String |
generateCountQuery(String queryString) |
protected String |
getBaseQuery()
Computes the query underlying the CRUD action.
|
Table |
getBaseTable() |
protected Resolution |
getConfigurationView()
Returns the Resolution used to show the configuration page.
|
CrudConfiguration |
getCrudConfiguration() |
long |
getTotalSearchRecords()
Returns the number of objects matching the current search criteria, not considering set limits
(first and max results).
|
protected Object |
loadObjectByPrimaryKey(Serializable pkObject)
Loads an object by its identifier and returns it.
|
void |
loadObjects()
Loads a list of objects filtered using the current search criteria and limited by the current
first and max results parameters.
|
void |
prepare() |
protected ClassAccessor |
prepare(PageInstance pageInstance)
Builds the ClassAccessor used to create, manipulate and introspect persistent objects.
|
void |
setBaseTable(Table baseTable) |
protected void |
setupConfigurationForm(FormBuilder formBuilder) |
acceptsPathParameter, addSuccessfulSaveInfoMessage, appendSearchStringParamIfNecessary, appendSearchStringParamIfNecessary, buildConfigurationForm, buildForm, buildSearchForm, buildTableForm, bulkDelete, bulkEdit, bulkUpdate, calculateBaseSearchUrl, cancel, collectVisibleFields, collectVisibleFields, configure, configureDetailLink, configureFormBuilder, configureFormSelectionProviders, configureSearchFormBuilder, configureSortLinks, configureTableFormBuilder, configureTableFormSelectionProviders, create, createFormBuilder, createPostProcess, createSearchFormBuilder, createSetup, createTableFormBuilder, createValidate, delete, deleteBlob, deleteBlobs, deleteOldBlobs, deletePostProcess, deleteValidate, describeClassAccessor, disableBlobFields, doSearch, downloadBlob, downloadBlob, edit, editPostProcess, editSetup, editValidate, execute, executeSearch, fieldsToJson, findProperty, generateObjectUrl, generateObjectUrl, getAsJson, getBlobDownloadUrl, getBlobFields, getBlobManager, getBlobsFromForm, getBlobsFromObject, getBulkEditView, getClassAccessor, getCreateTitle, getCreateView, getCrudConfigurationForm, getCrudSelectionProviders, getEditableRichTextFields, getEditTitle, getEditView, getEmbeddedReadView, getEmbeddedSearchView, getEncodedSearchStringParam, getFirstResult, getForm, getLabelSearch, getLinkToPage, getMaxResults, getObject, getObjects, getPkForUrl, getPkHelper, getPopupCloseCallback, getPropertiesTableForm, getPropertyName, getReadLinkExpression, getReadTitle, getReadURLFormat, getReadView, getRelName, getResultSetNavigation, getSearchForm, getSearchResultsPage, getSearchResultsPageView, getSearchString, getSearchTitle, getSearchView, getSelection, getSelectionProviderIndex, getSelectionProvidersForm, getSortDirection, getSortProperty, getSuccessfulDeleteView, getSuccessfulSaveView, getSuccessfulUpdateView, getSuccessReturnUrl, getTableForm, getTemporaryBlobManager, getUrlEncoding, getWhitelist, httpDelete, httpPostJson, httpPostMultipart, httpPutJson, httpPutMultipart, isBulkOperationsEnabled, isConfigured, isCreateEnabled, isDeleteEnabled, isEditEnabled, isFormWithRichTextFields, isMultipartRequest, isPopup, isRequiredFieldsPresent, isSearchVisible, isTableFormSelectable, jsonAutocompleteOptions, jsonAutocompleteSearchOptions, jsonOptions, jsonOptions, jsonReadData, jsonSearchData, jsonSelectFieldOptions, jsonSelectFieldSearchOptions, loadObject, notInUseCase, objectCreated, persistNewBlobs, preCreate, preEdit, prepareConfigurationForms, preparePage, read, readFormFromMultipartRequest, readSearchFormFromRequest, refreshBlobDownloadHref, refreshTableBlobDownloadHref, resetSearch, returnToSearch, save, saveTemporaryBlobs, search, selectionProviders, setClassAccessor, setCrudConfiguration, setCrudConfigurationForm, setFirstResult, setForm, setLabelSearch, setMaxResults, setPageInstance, setPkHelper, setPopupCloseCallback, setPropertyName, setRelName, setResultSetNavigation, setSearchForm, setSearchString, setSearchVisible, setSelection, setSelectionProviderIndex, setSortDirection, setSortProperty, setSuccessReturnUrl, setTableForm, setupForm, setupPagination, setupPropertyEdits, setupResultSetNavigation, setupResultSetNavigation, setupSearchForm, setupSelectionProviderEdits, setupSelectionProvidersForm, setupTableForm, update, updateConfiguration, updateProperties, updateSelectionProviders, uploadBlob, writeFormToObject
consumePathFragment, createTemplateSelectionProvider, forwardTo, forwardToPageActionError, forwardToPageActionNotConfigured, getActionAPIPath, getActionPath, getButtons, getConfiguration, getDefaultReturnUrl, getEmbeddedPageActions, getOgnlContext, getPage, getPageConfigurationForm, getPageDescription, getPageInstance, getPages, getPageTemplate, getParent, getPortofinoConfiguration, getResourcePath, getReturnUrl, getScript, getSubResource, initEmbeddedPageActions, prepareScript, readPageConfigurationFromRequest, saveConfiguration, setPageConfigurationForm, setPageTemplate, setReturnUrl, setScript, updatePageConfiguration, updateScript, updateTemplate, validatePageConfiguration
getContext, setContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContext
setContext
public static final String copyright
public static final String[][] CRUD_CONFIGURATION_FIELDS
public Table baseTable
public Session session
public Persistence persistence
protected long totalSearchRecords
public static final org.slf4j.Logger logger
public long getTotalSearchRecords()
AbstractCrudAction
getTotalSearchRecords
in class AbstractCrudAction<Object>
protected long calculateTotalSearchRecords()
protected String generateCountQuery(String queryString) throws net.sf.jsqlparser.JSQLParserException
net.sf.jsqlparser.JSQLParserException
protected void commitTransaction()
AbstractCrudAction
commitTransaction
in class AbstractCrudAction<Object>
protected void doSave(Object object)
AbstractCrudAction
doSave
in class AbstractCrudAction<Object>
object
- the object to save.protected void doUpdate(Object object)
AbstractCrudAction
doUpdate
in class AbstractCrudAction<Object>
object
- the object to update.protected void doDelete(Object object)
AbstractCrudAction
doDelete
in class AbstractCrudAction<Object>
object
- the object to delete.@Before public void prepare()
protected ModelSelectionProviderSupport createSelectionProviderSupport()
protected void setupConfigurationForm(FormBuilder formBuilder)
setupConfigurationForm
in class AbstractCrudAction<Object>
protected ClassAccessor prepare(PageInstance pageInstance)
AbstractCrudAction
Builds the ClassAccessor used to create, manipulate and introspect persistent objects.
This method is called during the prepare phase.
prepare
in class AbstractCrudAction<Object>
pageInstance
- the PageInstance corresponding to this action in the current dispatch.public void loadObjects()
AbstractCrudAction
objects
field.loadObjects
in class AbstractCrudAction<Object>
protected String getBaseQuery()
protected Object loadObjectByPrimaryKey(Serializable pkObject)
AbstractCrudAction
loadObjectByPrimaryKey
in class AbstractCrudAction<Object>
pkObject
- the object used as an identifier; the actual implementation is regulated by subclasses.
The only constraint is that it is serializable.protected Resolution getConfigurationView()
AbstractCrudAction
getConfigurationView
in class AbstractCrudAction<Object>
public Table getBaseTable()
public void setBaseTable(Table baseTable)
public CrudConfiguration getCrudConfiguration()
getCrudConfiguration
in class AbstractCrudAction<Object>