|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType<Collection<S>,S>
com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType<com.atlassian.crowd.embedded.api.Group>
com.atlassian.jira.issue.customfields.impl.MultiGroupCFType
public class MultiGroupCFType
Multiple User Group Select Type
Collection
of Group
sGroup
String
of group name
Nested Class Summary | |
---|---|
static interface |
MultiGroupCFType.Visitor<T>
|
Nested classes/interfaces inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType |
---|
AbstractCustomFieldType.VisitorBase<X> |
Field Summary | |
---|---|
protected MultiGroupConverter |
multiGroupConverter
|
Fields inherited from class com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType |
---|
customFieldValuePersister, genericConfigManager |
Fields inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType |
---|
DEFAULT_VALUE_TYPE |
Constructor Summary | |
---|---|
MultiGroupCFType(CustomFieldValuePersister customFieldValuePersister,
GenericConfigManager genericConfigManager,
MultiGroupConverter multiGroupConverter,
PermissionManager permissionManager,
JiraAuthenticationContext authenticationContext,
GroupManager groupManager,
FieldVisibilityManager fieldVisibilityManager,
JiraBaseUrls jiraBaseUrls)
|
Method Summary | |
---|---|
Object |
accept(AbstractCustomFieldType.VisitorBase visitor)
|
int |
compare(String customFieldObjectValue1,
String customFieldObjectValue2,
FieldConfig fieldConfig)
Compares the two custom field objects. |
protected com.atlassian.crowd.embedded.api.Group |
convertDbValueToType(Object dbValue)
Converts a given db value to Single form of Transport Object |
protected Object |
convertTypeToDbValue(com.atlassian.crowd.embedded.api.Group value)
Converts a given underlying type to its db storage value. |
protected PersistenceFieldType |
getDatabaseType()
Type of database field needed to store this field. |
FieldTypeInfo |
getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext)
Returns lower level Information about the field. |
JsonData |
getJsonDefaultValue(IssueContext issueCtx,
CustomField field)
Return The default data for this system field. |
FieldJsonRepresentation |
getJsonFromIssue(CustomField field,
Issue issue,
boolean renderedVersionRequested,
FieldLayoutItem fieldLayoutItem)
Return a JsonData representation of the field value |
JsonType |
getJsonSchema(CustomField customField)
Return a description of the shape of this field when represented as JSON. |
ProjectCustomFieldImporter |
getProjectImporter()
Returns the object that will perform the actual project import functions for the custom field type. |
org.apache.lucene.search.Query |
getQueryForGroup(String fieldName,
String groupName)
This method should be implemented in your custom type to return a Query. |
List<FieldIndexer> |
getRelatedIndexers(CustomField customField)
Returns a list of indexers that will be used for the field. |
RestFieldOperationsHandler |
getRestFieldOperation(CustomField field)
Returns the RestFieldOperationsHandler for this field. |
com.atlassian.crowd.embedded.api.Group |
getSingularObjectFromString(String s)
Returns a Singular Object, given the string value as passed by the presentation tier. |
String |
getStringFromSingularObject(com.atlassian.crowd.embedded.api.Group o)
Returns the String representation of a single value within the CustomFieldType. |
Object |
getStringValueFromCustomFieldParams(CustomFieldParams parameters)
Return the String value object from the CustomFieldParams. |
protected Comparator<com.atlassian.crowd.embedded.api.Group> |
getTypeComparator()
Returns a comparator for underlying type of this custom field. |
Collection<com.atlassian.crowd.embedded.api.Group> |
getValueFromCustomFieldParams(CustomFieldParams parameters)
Retrieves the Transport Object representing the CustomField value instance from the CustomFieldParams of Strings. |
Map<String,Object> |
getVelocityParameters(Issue issue,
CustomField field,
FieldLayoutItem fieldLayoutItem)
The custom field may wish to pass parameters to the velocity context beyond the getValueFromIssue methods (eg managers). |
boolean |
isMultiple()
|
void |
validateFromParams(CustomFieldParams relevantParams,
ErrorCollection errorCollectionToAddTo,
FieldConfig config)
Ensures that the CustomFieldParams of Strings is a valid representation of the Custom Field values. |
Methods inherited from class com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType |
---|
convertDbObjectToTypes, convertTypesToDbObjects, createValue, getChangelogValue, getDefaultValue, getValueFromIssue, remove, setDefaultValue, updateValue |
Methods inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType |
---|
assertObjectImplementsType, availableForBulkEdit, getChangelogString, getConfigurationItemTypes, getDescription, getDescriptor, getI18nBean, getKey, getName, getVelocityParameters, init, isRenderable, valuesEqual |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final MultiGroupConverter multiGroupConverter
Constructor Detail |
---|
public MultiGroupCFType(CustomFieldValuePersister customFieldValuePersister, GenericConfigManager genericConfigManager, MultiGroupConverter multiGroupConverter, PermissionManager permissionManager, JiraAuthenticationContext authenticationContext, GroupManager groupManager, FieldVisibilityManager fieldVisibilityManager, JiraBaseUrls jiraBaseUrls)
Method Detail |
---|
protected Comparator<com.atlassian.crowd.embedded.api.Group> getTypeComparator()
AbstractMultiCFType
getTypeComparator
in class AbstractMultiCFType<com.atlassian.crowd.embedded.api.Group>
public Collection<com.atlassian.crowd.embedded.api.Group> getValueFromCustomFieldParams(CustomFieldParams parameters) throws FieldValidationException
CustomFieldType
getValueFromCustomFieldParams
in interface CustomFieldType<Collection<com.atlassian.crowd.embedded.api.Group>,com.atlassian.crowd.embedded.api.Group>
parameters
- CustomFieldParams of String objects. Will contain one value for Singular field types.
CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, T)
, CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, T)
FieldValidationException
- if the String value fails to convert into ObjectsCustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, Object)
,
CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, Object)
,
CustomFieldType.getValueFromIssue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue)
public Object getStringValueFromCustomFieldParams(CustomFieldParams parameters)
CustomFieldType
getStringValueFromCustomFieldParams
in interface CustomFieldType<Collection<com.atlassian.crowd.embedded.api.Group>,com.atlassian.crowd.embedded.api.Group>
parameters
- - CustomFieldParams containing String values
public void validateFromParams(CustomFieldParams relevantParams, ErrorCollection errorCollectionToAddTo, FieldConfig config)
CustomFieldType
CustomFieldParams
of Strings is a valid representation of the Custom Field values.
Any errors should be added to the ErrorCollection
under the appropriate key as required.
validateFromParams
in interface CustomFieldType<Collection<com.atlassian.crowd.embedded.api.Group>,com.atlassian.crowd.embedded.api.Group>
relevantParams
- parameter object of StringserrorCollectionToAddTo
- errorCollection to which any erros should be added (never null)config
- FieldConfigpublic String getStringFromSingularObject(com.atlassian.crowd.embedded.api.Group o)
CustomFieldType
String
representation of a single value within the CustomFieldType. This is the value that
is passed to the presentation tier for editing. For single CustomFieldTypes the Singular Object is
the same as a Transport Object. However, for multi-dimensional CustomFieldTypes, the Singular Object is
the Object contained within the Collection
or Map
getStringFromSingularObject
in interface CustomFieldType<Collection<com.atlassian.crowd.embedded.api.Group>,com.atlassian.crowd.embedded.api.Group>
o
- the object
public com.atlassian.crowd.embedded.api.Group getSingularObjectFromString(String s) throws FieldValidationException
CustomFieldType
getSingularObjectFromString
in interface CustomFieldType<Collection<com.atlassian.crowd.embedded.api.Group>,com.atlassian.crowd.embedded.api.Group>
s
- the String
FieldValidationException
- if the string is an invalid representation of the Object.public List<FieldIndexer> getRelatedIndexers(CustomField customField)
CustomFieldType
getRelatedIndexers
in interface CustomFieldType<Collection<com.atlassian.crowd.embedded.api.Group>,com.atlassian.crowd.embedded.api.Group>
getRelatedIndexers
in class AbstractCustomFieldType<Collection<com.atlassian.crowd.embedded.api.Group>,com.atlassian.crowd.embedded.api.Group>
customField
- the custom field to get the related indexers of.
FieldIndexer
objects. Null if no related indexers.@NotNull public Map<String,Object> getVelocityParameters(Issue issue, CustomField field, FieldLayoutItem fieldLayoutItem)
CustomFieldType
getVelocityParameters
in interface CustomFieldType<Collection<com.atlassian.crowd.embedded.api.Group>,com.atlassian.crowd.embedded.api.Group>
getVelocityParameters
in class AbstractCustomFieldType<Collection<com.atlassian.crowd.embedded.api.Group>,com.atlassian.crowd.embedded.api.Group>
issue
- The issue currently in context (Note: this will be null in cases like 'default value')field
- CustomFieldfieldLayoutItem
- FieldLayoutItem
Map
of parameters to add to the velocity context, or an empty Map otherwise (never null)protected Object convertTypeToDbValue(com.atlassian.crowd.embedded.api.Group value)
AbstractMultiCFType
PersistenceFieldType
returned by AbstractMultiCFType.getDatabaseType()
convertTypeToDbValue
in class AbstractMultiCFType<com.atlassian.crowd.embedded.api.Group>
value
- Single form of Transport Object
protected com.atlassian.crowd.embedded.api.Group convertDbValueToType(Object dbValue)
AbstractMultiCFType
convertDbValueToType
in class AbstractMultiCFType<com.atlassian.crowd.embedded.api.Group>
dbValue
- db representation as returned by AbstractMultiCFType.convertTypeToDbValue(Object)
@NotNull protected PersistenceFieldType getDatabaseType()
AbstractMultiCFType
getDatabaseType
in class AbstractMultiCFType<com.atlassian.crowd.embedded.api.Group>
PersistenceFieldType
types.public boolean isMultiple()
public ProjectCustomFieldImporter getProjectImporter()
ProjectImportableCustomField
getProjectImporter
in interface ProjectImportableCustomField
public org.apache.lucene.search.Query getQueryForGroup(String fieldName, String groupName)
GroupSelectorField
fieldName:groupName
. However some custom fields, such as (@Link SelectCFType)
manipulate the field identifiers and values before storing in the index. In cases like this you will have to
implement the method such that it searches the correct fields.
getQueryForGroup
in interface GroupSelectorField
fieldName
- the id of the custom fieldgroupName
- the name of the group to filter on
public int compare(@NotNull String customFieldObjectValue1, @NotNull String customFieldObjectValue2, FieldConfig fieldConfig)
SortableCustomField
compare
in interface SortableCustomField<String>
customFieldObjectValue1
- Never nullcustomFieldObjectValue2
- Never null
public Object accept(AbstractCustomFieldType.VisitorBase visitor)
accept
in class AbstractMultiCFType<com.atlassian.crowd.embedded.api.Group>
public FieldTypeInfo getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext)
RestAwareCustomFieldType
getFieldTypeInfo
in interface RestAwareCustomFieldType
fieldTypeInfoContext
- context information for generating the FieldTypeInfo
.
public JsonType getJsonSchema(CustomField customField)
RestAwareCustomFieldType
getJsonSchema
in interface RestAwareCustomFieldType
public FieldJsonRepresentation getJsonFromIssue(CustomField field, Issue issue, boolean renderedVersionRequested, @Nullable FieldLayoutItem fieldLayoutItem)
RestAwareCustomFieldType
getJsonFromIssue
in interface RestAwareCustomFieldType
field
- configuration of the current fieldissue
- to get field data fromrenderedVersionRequested
- whether the use requested the return of rendered/pretty data as well as raw datafieldLayoutItem
- field layout for this field.
public RestFieldOperationsHandler getRestFieldOperation(CustomField field)
RestCustomFieldTypeOperations
getRestFieldOperation
in interface RestCustomFieldTypeOperations
field
- the Custom Field
public JsonData getJsonDefaultValue(IssueContext issueCtx, CustomField field)
RestCustomFieldTypeOperations
getJsonDefaultValue
in interface RestCustomFieldTypeOperations
issueCtx
- Issue (This should really only need to be an issue context, but for historical reasons we need an issue object.field
- the Custom Field
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |