org.broadleafcommerce.common.presentation
Annotation Type AdminPresentationCollection


@Retention(value=RUNTIME)
@Target(value=FIELD)
public @interface AdminPresentationCollection

This annotation is used to describe a simple persistent collection for use by the admin tool.

Author:
Jeff Fischer

Optional Element Summary
 AddMethodType addType
          Optional - only required if you want to lookup an item for this association, rather than creating a new instance of the target item.
 String[] customCriteria
          Optional - only required if you need to specially handle crud operations for this specific collection on the server
 String dataSourceName
          Optional - unique name for the backing datasource.
 boolean excluded
          Optional - fields are not excluded by default
 String friendlyName
          Optional - field name will be used if not specified
 String manyToField
          Optional - only required in the absence of a "mappedBy" property on the JPA annotation
 AdminPresentationOperationTypes operationTypes
          Optional - only required if a special operation type is required for a CRUD operation.
 int order
          Optional - only required if you want to specify ordering for this field
 boolean readOnly
          Optional - only required if you want to make the field immutable
 String securityLevel
          Optional - only required if you wish to apply security to this field
 String targetUIElementId
          Optional - only required if you want the resulting collection grid element to appear somewhere other than below the main detail form
 

friendlyName

public abstract String friendlyName

Optional - field name will be used if not specified

The friendly name to present to a user for this field in a GUI. If supporting i18N, the friendly name may be a key to retrieve a localized friendly name using the GWT support for i18N.

Returns:
the friendly name
Default:
""

securityLevel

public abstract String securityLevel

Optional - only required if you wish to apply security to this field

If a security level is specified, it is registered with the SecurityManager. The SecurityManager checks the permission of the current user to determine if this field should be disabled based on the specified level.

Returns:
the security level
Default:
""

excluded

public abstract boolean excluded

Optional - fields are not excluded by default

Specify if this field should be excluded from inclusion in the admin presentation layer

Returns:
whether or not the field should be excluded
Default:
false

readOnly

public abstract boolean readOnly

Optional - only required if you want to make the field immutable

Explicityly specify whether or not this field is mutable.

Returns:
whether or not this field is read only
Default:
false

addType

public abstract AddMethodType addType

Optional - only required if you want to lookup an item for this association, rather than creating a new instance of the target item. Note - if the type is changed to LOOKUP, this has the side effect of causing the only the association to be deleted during a remove, leaving the target lookup entity intact.

Define whether or not added items for this collection are acquired via search or construction.

Returns:
the item is acquired via lookup or construction
Default:
org.broadleafcommerce.common.presentation.client.AddMethodType.PERSIST

manyToField

public abstract String manyToField

Optional - only required in the absence of a "mappedBy" property on the JPA annotation

For the target entity of this collection, specify the field name that refers back to the parent entity.

For collection definitions that use the "mappedBy" property of the @OneToMany and @ManyToMany annotations, this value can be safely ignored as the system will be able to infer the proper value from this.

Returns:
the parent entity referring field name
Default:
""

order

public abstract int order

Optional - only required if you want to specify ordering for this field

The order in which this field will appear in a GUI relative to other collections from the same class

Returns:
the display order
Default:
99999

targetUIElementId

public abstract String targetUIElementId

Optional - only required if you want the resulting collection grid element to appear somewhere other than below the main detail form

Specify a UI element Id to which the collection grid should be added. This is useful if, for example, you want the resulting collection grid to appear in another tab, or some other location in the admin tool UI.

Returns:
UI element Id to which the collection grid should be added
Default:
""

dataSourceName

public abstract String dataSourceName

Optional - unique name for the backing datasource. If unspecified, the datasource name will be the JPA entity field name with "AdvancedCollectionDS" appended to the end.

The datasource can be retrieved programatically in admin code via PresenterSequenceSetupManager.getDataSource(..)

Returns:
unique name for the backing datasource
Default:
""

customCriteria

public abstract String[] customCriteria

Optional - only required if you need to specially handle crud operations for this specific collection on the server

Custom string values that will be passed to the server during CRUB operations on this collection. These criteria values can be detected in a custom persistence handler (@CustomPersistenceHandler) in order to engage special handling through custom server side code for this collection.

Returns:
the custom string array to pass to the server during CRUD operations
Default:
{}

operationTypes

public abstract AdminPresentationOperationTypes operationTypes

Optional - only required if a special operation type is required for a CRUD operation. This setting is not normally changed and is an advanced setting

The operation type for a CRUD operation

Returns:
the operation type
Default:
@org.broadleafcommerce.common.presentation.AdminPresentationOperationTypes(addType=org.broadleafcommerce.common.presentation.client.OperationType.BASIC, fetchType=org.broadleafcommerce.common.presentation.client.OperationType.BASIC, inspectType=org.broadleafcommerce.common.presentation.client.OperationType.BASIC, removeType=org.broadleafcommerce.common.presentation.client.OperationType.BASIC, updateType=org.broadleafcommerce.common.presentation.client.OperationType.BASIC)


Copyright © 2012. All Rights Reserved.