public class ManyToManyAction extends AbstractPageAction
AbstractPageAction.TerminalResource
Modifier and Type | Field and Description |
---|---|
protected List |
availableAssociations |
protected Map<Object,Boolean> |
booleanRelation |
protected Form |
configurationForm |
static String |
copyright |
protected boolean |
correctlyConfigured |
protected List |
existingAssociations |
protected ManyToManyConfiguration |
m2mConfiguration |
protected TableAccessor |
manyTableAccessor |
protected Object |
onePk |
protected SelectField |
oneSelectField |
static String |
PERMISSION_UPDATE |
Persistence |
persistence |
protected List |
potentiallyAvailableAssociations |
protected TableAccessor |
relationTableAccessor |
protected List<String> |
selectedPrimaryKeys |
protected Session |
session |
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 |
---|
ManyToManyAction() |
acceptsPathParameter, cancel, consumePathFragment, createTemplateSelectionProvider, forwardTo, forwardToPageActionError, forwardToPageActionNotConfigured, getActionAPIPath, getActionPath, getButtons, getDefaultReturnUrl, getEmbeddedPageActions, getOgnlContext, getPage, getPageConfigurationForm, getPageDescription, getPageInstance, getPages, getPageTemplate, getParent, getPortofinoConfiguration, getResourcePath, getReturnUrl, getScript, getSubResource, initEmbeddedPageActions, isMultipartRequest, prepareScript, readPageConfigurationFromRequest, saveConfiguration, setPageConfigurationForm, setPageInstance, 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 PERMISSION_UPDATE
protected ManyToManyConfiguration m2mConfiguration
protected Object onePk
protected List existingAssociations
protected List availableAssociations
protected List potentiallyAvailableAssociations
protected TableAccessor relationTableAccessor
protected TableAccessor manyTableAccessor
protected SelectField oneSelectField
protected boolean correctlyConfigured
protected Session session
protected Form configurationForm
public Persistence persistence
public Resolution preparePage()
PageAction
@Before public void prepare() throws NoSuchFieldException
NoSuchFieldException
public DefaultSelectionProvider createSelectionProviderFromHql(String name, String databaseName, String hql, DisplayMode dm, SearchDisplayMode sdm)
@DefaultHandler public Resolution execute()
protected Resolution view()
protected void loadAssociations() throws NoSuchFieldException
NoSuchFieldException
public Resolution saveCheckboxes() throws Exception
Exception
protected void deleteRelation(Object rel)
protected Object saveNewRelation(Object pk, PropertyAccessor onePropertyAccessor, PropertyAccessor manyPropertyAccessor)
public Resolution configure()
public Resolution updateConfiguration()
protected void prepareConfigurationForms()
AbstractPageAction
prepareConfigurationForms
in class AbstractPageAction
protected void addSpRefSelectionProvider(List<ModelSelectionProvider> sps, Form form, String fieldName) throws NoSuchFieldException
NoSuchFieldException
protected void prepareSave(Object newRelation)
public Object getOnePk()
public void setOnePk(Object onePk)
public ManyToManyConfiguration getConfiguration()
getConfiguration
in class AbstractPageAction
public List<?> getExistingAssociations()
public List<?> getAvailableAssociations()
public TableAccessor getRelationTableAccessor()
public TableAccessor getManyTableAccessor()
public Form getConfigurationForm()
public SelectField getOneSelectField()
@GET @Produces(value="application/json;charset=UTF-8") public Resolution getAsJson()
@GET @Path(value=":availableAssociations/{key}") @Produces(value="application/json;charset=UTF-8") public Resolution selectionProviders(@PathParam(value="key") String key)
key
- the key string@POST @Produces(value="application/json;charset=UTF-8") @Consumes(value="application/json;charset=UTF-8") public Response httpPostJson(String jsonObject) throws Exception
jsonObject
- the object (in serialized JSON form)Exception
- only to make the compiler happy. Nothing should be thrown in normal operation. If this method throws, it is probably a bug.protected Response objectCreated() throws URISyntaxException
URISyntaxException
public Resolution jsonKeys() throws org.json.JSONException
org.json.JSONException
public Resolution jsonAssociations() throws org.json.JSONException
org.json.JSONException