org.broadleafcommerce.common.presentation
Annotation Type AdminPresentationMap


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

This annotation is used to describe a persisted map structure for use in the admin tool

Author:
Jeff Fischer

Optional Element Summary
 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 deleteEntityUponRemove
          Optional - only required if the value class is a JPA managed type and the persisted entity should be deleted upon removal from this map
 boolean excluded
          Optional - fields are not excluded by default
 String friendlyName
          Optional - field name will be used if not specified
 UnspecifiedBooleanType isSimpleValue
          Optional - only required if the value type cannot be derived from the map declaration in the JPA managed entity and the value type is complex (JPA managed entity)
 Class<?> keyClass
          Optional - only required if the type for the key of this map is other than java.lang.String, or if the map is not a generic type from which the key type can be derived
 String keyPropertyFriendlyName
          Optional - only required if the key field title for this map should be translated to another lang, or should be something other than the constant "Key"
 AdminPresentationMapKey[] keys
          Optional - only required when the user should select from a list of pre-defined keys when adding/editing this map.
 Class<?> mapKeyOptionEntityClass
          Optional - only required when the user should select from a list of database persisted values for keys when adding/editing this map.
 String mapKeyOptionEntityDisplayField
          Optional - only required when the user should select from a list of database persisted values for keys when adding/editing this map.
 String mapKeyOptionEntityValueField
          Optional - only required when the user should select from a list of database persisted values for keys when adding/editing this map.
 String mediaField
          Optional - only required if the value type for the map is complex (JPA managed) and one of the fields of the complex value provides a URL value that points to a resolvable image url.
 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 Explicityly specify whether or not this field is mutable.
 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
 Class<?> valueClass
          Optional - only required if the type for the value of this map is other than java.lang.String, or if the map is not a generic type from which the value type can be derived, or if there is not a @ManyToMany annotation used from which a targetEntity can be inferred.
 String valuePropertyFriendlyName
          Optional - only required if the value property for this map is simple (Not JPA managed - e.g.
 

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

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:
""

keyClass

public abstract Class<?> keyClass

Optional - only required if the type for the key of this map is other than java.lang.String, or if the map is not a generic type from which the key type can be derived

The type for the key of this map

Returns:
The type for the key of this map
Default:
void.class

keyPropertyFriendlyName

public abstract String keyPropertyFriendlyName

Optional - only required if the key field title for this map should be translated to another lang, or should be something other than the constant "Key"

The friendly name to present to a user for this key field title 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:
"Key"

valueClass

public abstract Class<?> valueClass

Optional - only required if the type for the value of this map is other than java.lang.String, or if the map is not a generic type from which the value type can be derived, or if there is not a @ManyToMany annotation used from which a targetEntity can be inferred.

The type for the value of this map

Returns:
The type for the value of this map
Default:
void.class

deleteEntityUponRemove

public abstract boolean deleteEntityUponRemove

Optional - only required if the value class is a JPA managed type and the persisted entity should be deleted upon removal from this map

Whether or not a complex (JPA managed) value should be deleted upon removal from this map

Returns:
Whether or not a complex value is deleted upon map removal
Default:
false

valuePropertyFriendlyName

public abstract String valuePropertyFriendlyName

Optional - only required if the value property for this map is simple (Not JPA managed - e.g. java.lang.String) and if the value field title for this map should be translated to another lang, or should be something other than the constant "Value"

The friendly name to present to a user for this value field title 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:
"Value"

isSimpleValue

public abstract UnspecifiedBooleanType isSimpleValue

Optional - only required if the value type cannot be derived from the map declaration in the JPA managed entity and the value type is complex (JPA managed entity)

Whether or not the value type for the map is complex (JPA managed entity), rather than an simple type (e.g. java.lang.String). This can usually be inferred from the parameterized type of the map (if available), or from the targetEntity property of a @ManyToMany annotation for the map (if available).

Returns:
Whether or not the value type for the map is complex
Default:
org.broadleafcommerce.common.presentation.client.UnspecifiedBooleanType.UNSPECIFIED

mediaField

public abstract String mediaField

Optional - only required if the value type for the map is complex (JPA managed) and one of the fields of the complex value provides a URL value that points to a resolvable image url.

The field name of complex value that provides an image url

Returns:
The field name of complex value that provides an image url
Default:
""

keys

public abstract AdminPresentationMapKey[] keys

Optional - only required when the user should select from a list of pre-defined keys when adding/editing this map. Either this value, or the mapKeyOptionEntityClass should be user - not both.

Specify the keys available for the user to select from

Returns:
the array of keys from which the user can select
Default:
{}

mapKeyOptionEntityClass

public abstract Class<?> mapKeyOptionEntityClass

Optional - only required when the user should select from a list of database persisted values for keys when adding/editing this map. Either this value, or the keys parameter should be user - not both

Specify the entity class that represents the table in the database that contains the key values for this map

Returns:
the entity class for the map keys
Default:
void.class

mapKeyOptionEntityDisplayField

public abstract String mapKeyOptionEntityDisplayField

Optional - only required when the user should select from a list of database persisted values for keys when adding/editing this map.

Specify the field in the option entity class that contains the value that will be shown to the user. This can be the same field as the value field. This option does not support i18n out-of-the-box.

Returns:
the display field in the entity class
Default:
""

mapKeyOptionEntityValueField

public abstract String mapKeyOptionEntityValueField

Optional - only required when the user should select from a list of database persisted values for keys when adding/editing this map.

Specify the field in the option entity class that contains the value that will actually be saved for the selected key. This can be the same field as the display field.

Returns:
the value field in the entity class
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 CRUD 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.MAP, fetchType=org.broadleafcommerce.common.presentation.client.OperationType.MAP, inspectType=org.broadleafcommerce.common.presentation.client.OperationType.MAP, removeType=org.broadleafcommerce.common.presentation.client.OperationType.MAP, updateType=org.broadleafcommerce.common.presentation.client.OperationType.MAP)


Copyright © 2012. All Rights Reserved.