com.atlassian.jira.issue.fields.layout.field
Interface FieldLayoutManager

All Known Implementing Classes:
DefaultFieldLayoutManager, EnterpriseFieldLayoutManager

public interface FieldLayoutManager

The FieldLayoutManager is responsible for managing field configurations and field configuration schemes.


Field Summary
static java.lang.String TYPE_DEFAULT
          JIRA must have a default field layout.
 
Method Summary
 void addSchemeAssociation(org.ofbiz.core.entity.GenericValue project, java.lang.Long fieldLayoutSchemeId)
          Associates a FieldLayoutScheme to the project supplied.
 FieldLayoutScheme createFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
          Persists a new field Layout scheme (i.e Field Configuration Scheme).
 void createFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
          Persists a new FieldLayoutSchemeEntity for a particular FieldLayoutScheme.
 void deleteFieldLayout(FieldLayout fieldLayout)
          Deletes a custom FieldLayout NOTE: This is an enterprise ONLY feature.
 void deleteFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
          Removes the FieldLayoutScheme supplied.
 boolean fieldConfigurationSchemeExists(java.lang.String schemeName)
          Checks if a FieldConfigurationScheme with the given name exists.
 EditableDefaultFieldLayout getEditableDefaultFieldLayout()
          Returns the default EditableDefaultFieldLayout.
 EditableFieldLayout getEditableFieldLayout(java.lang.Long id)
          Returns an EditableFieldLayout for the id supplied.
 java.util.List<EditableFieldLayout> getEditableFieldLayouts()
          Retrieves editable (see EditableFieldLayout versions of the field layouts.
 FieldConfigurationScheme getFieldConfigurationScheme(org.ofbiz.core.entity.GenericValue project)
          Retrieves the Field Configuration Scheme associated with the supplied project.
 FieldConfigurationScheme getFieldConfigurationScheme(java.lang.Long schemeId)
          Retrieves a FieldConfigurationScheme by id NOTE: This is an enterprise ONLY feature.
 java.util.Collection<FieldConfigurationScheme> getFieldConfigurationSchemes(FieldLayout fieldLayout)
          Returns a collection of FieldConfigurationSchemes that include the given FieldLayout.
 FieldLayout getFieldLayout()
          Used to retrieve FieldLayout information when rendering a screen.
 FieldLayout getFieldLayout(org.ofbiz.core.entity.GenericValue issue)
          Returns the fieldLayout for an issue.
 FieldLayout getFieldLayout(org.ofbiz.core.entity.GenericValue project, java.lang.String issueTypeId)
           
 FieldLayout getFieldLayout(Issue issue)
           
 FieldLayout getFieldLayout(java.lang.Long id)
          Used to retrieve FieldLayout information when rendering a screen given the id of the field layout.
 java.util.Collection<FieldLayoutSchemeEntity> getFieldLayoutSchemeEntities(FieldLayoutScheme fieldLayoutScheme)
          Returns a collection of FieldLayoutSchemeEntitys.
 java.util.List<FieldLayoutScheme> getFieldLayoutSchemes()
          Retries Field Configuration Schemes.
 FieldLayoutScheme getMutableFieldLayoutScheme(java.lang.Long schemeId)
          Retrieves a mutable FieldLayoutScheme by id.
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getProjects(FieldConfigurationScheme fieldConfigurationScheme)
          Returns all projects that use the given FieldConfigurationScheme.
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getProjects(FieldLayoutScheme fieldLayoutScheme)
          Returns all associated projects for the FieldLayoutScheme supplied.
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getRelatedProjects(FieldLayout fieldLayout)
          Finds all projects that use the given FieldLayout (via the configured FieldConfigurationScheme).
 java.util.Set<FieldLayout> getUniqueFieldLayouts(Project project)
          Retrieves all the FieldLayout's for a project.
 boolean hasDefaultFieldLayout()
          Checks to see if a FieldLayout entity with type TYPE_DEFAULT exists
 boolean isFieldLayoutSchemesVisiblyEquivalent(java.lang.Long fieldConfigurationSchemeId1, java.lang.Long fieldConfigurationSchemeId2)
          Will determine whether or not two FieldLayoutSchemes are "visibly equivalent".
 boolean isFieldLayoutsVisiblyEquivalent(java.lang.Long fieldLayoutId1, java.lang.Long fieldLayoutId2)
          Will determine whether or not two FieldLayouts are "visibly equivalent".
 void refresh()
          Clears all local caches.
 void removeFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
          NOTE: This is an enterprise ONLY feature.
 void removeFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
          Removes a FieldLayoutSchemeEntity NOTE: This is an enterprise ONLY feature.
 void removeSchemeAssociation(org.ofbiz.core.entity.GenericValue project, java.lang.Long fieldLayoutSchemeId)
          Removes an association between a particular project and field configuration scheme.
 void restoreDefaultFieldLayout()
          This method can be used to rollback any changes to the default field configuration.
 void restoreSchemeFieldLayout(org.ofbiz.core.entity.GenericValue scheme)
          Restores the field layout associated with the provided scheme to defaults.
 void storeEditableDefaultFieldLayout(EditableDefaultFieldLayout editableDefaultFieldLayout)
          Persist the given default EditableDefaultFieldLayout
 void storeEditableFieldLayout(EditableFieldLayout editableFieldLayout)
          Persists the EditableFieldLayout provided.
 void updateFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
          Persists the FieldLayoutScheme supplied.
 void updateFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
          Updates a FieldLayoutSchemeEntity.
 

Field Detail

TYPE_DEFAULT

static final java.lang.String TYPE_DEFAULT
JIRA must have a default field layout. This is used identify the default layout.

See Also:
Constant Field Values
Method Detail

createFieldLayoutScheme

FieldLayoutScheme createFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
                                          throws FieldLayoutStorageException
Persists a new field Layout scheme (i.e Field Configuration Scheme). NOTE: This is an enterprise ONLY feature.

Parameters:
fieldLayoutScheme - The FieldLayoutScheme to persist.
Returns:
The stored FieldLayoutScheme object
Throws:
FieldLayoutStorageException - If there is a Data Layer error.
java.lang.UnsupportedOperationException - If this is executed against standard edition

getFieldConfigurationScheme

FieldConfigurationScheme getFieldConfigurationScheme(java.lang.Long schemeId)
                                                     throws FieldLayoutStorageException
Retrieves a FieldConfigurationScheme by id NOTE: This is an enterprise ONLY feature.

Parameters:
schemeId - FieldConfigurationScheme ID
Returns:
A FieldConfigurationScheme instance
Throws:
FieldLayoutStorageException - If there is a DB exception.
java.lang.UnsupportedOperationException - If this is executed against standard edition

getMutableFieldLayoutScheme

FieldLayoutScheme getMutableFieldLayoutScheme(java.lang.Long schemeId)
                                              throws FieldLayoutStorageException
Retrieves a mutable FieldLayoutScheme by id.

NOTE: This is an enterprise ONLY feature.

This returns a new copy of the object from the DB, and so will incur some performance penalty. Please use getFieldConfigurationScheme(Long) for access to a cached immutable scheme object.

Parameters:
schemeId - the scheme ID
Returns:
A FieldLayoutScheme instance
Throws:
FieldLayoutStorageException - if an error occurs in the DB layer
java.lang.UnsupportedOperationException - If this is executed against standard edition

fieldConfigurationSchemeExists

boolean fieldConfigurationSchemeExists(java.lang.String schemeName)
                                       throws FieldLayoutStorageException
Checks if a FieldConfigurationScheme with the given name exists.

Parameters:
schemeName - The scheme name
Returns:
true if a FieldConfigurationScheme with the given name exists.
Throws:
FieldLayoutStorageException - If there is a DB error.
java.lang.UnsupportedOperationException - If this is executed against standard edition

getEditableFieldLayouts

java.util.List<EditableFieldLayout> getEditableFieldLayouts()
Retrieves editable (see EditableFieldLayout versions of the field layouts. Note: For standard edition this simply returns an editable version of the default field layout. (see EditableDefaultFieldLayout)

Returns:
A list of EditableFieldLayout and EditableDefaultFieldLayout

getFieldLayoutSchemes

java.util.List<FieldLayoutScheme> getFieldLayoutSchemes()
                                                        throws FieldLayoutStorageException
Retries Field Configuration Schemes. These are used to link field configurations to projects. NOTE: This is an enterprise ONLY feature.

Returns:
A list of FieldLayoutSchemes.
Throws:
FieldLayoutStorageException - If there is a Data Layer error.
java.lang.UnsupportedOperationException - If this is executed against standard edition

updateFieldLayoutScheme

void updateFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
                             throws FieldLayoutStorageException
Persists the FieldLayoutScheme supplied. NOTE: This is an enterprise ONLY feature.

Parameters:
fieldLayoutScheme - The FieldLayoutScheme
Throws:
FieldLayoutStorageException - If there is a Data Layer error.
java.lang.UnsupportedOperationException - If this is executed against standard edition

deleteFieldLayoutScheme

void deleteFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
                             throws FieldLayoutStorageException
Removes the FieldLayoutScheme supplied. NOTE: This is an enterprise ONLY feature.

Parameters:
fieldLayoutScheme - The FieldLayoutScheme
Throws:
FieldLayoutStorageException - If there is a Data Layer error.
java.lang.UnsupportedOperationException - If this is executed against standard edition

getFieldConfigurationScheme

FieldConfigurationScheme getFieldConfigurationScheme(org.ofbiz.core.entity.GenericValue project)
                                                     throws FieldLayoutStorageException
Retrieves the Field Configuration Scheme associated with the supplied project. NOTE: This is an enterprise ONLY feature.

Parameters:
project - A project GenericValue
Returns:
A FieldConfigurationScheme or null if none exists.
Throws:
FieldLayoutStorageException - If there is a Data Layer error.
java.lang.UnsupportedOperationException - If this is executed against standard edition
java.lang.IllegalArgumentException - If the project supplied is null.

getUniqueFieldLayouts

java.util.Set<FieldLayout> getUniqueFieldLayouts(Project project)
                                                 throws FieldLayoutStorageException
Retrieves all the FieldLayout's for a project.

Parameters:
project - a project
Returns:
the unique set of FieldLayout's for the provided project, an empty set if there are none.
Throws:
FieldLayoutStorageException - If there is a Data Layer error.

addSchemeAssociation

void addSchemeAssociation(org.ofbiz.core.entity.GenericValue project,
                          java.lang.Long fieldLayoutSchemeId)
                          throws FieldLayoutStorageException
Associates a FieldLayoutScheme to the project supplied. NOTE: This is an enterprise ONLY feature.

Parameters:
project - A project GenericValue
fieldLayoutSchemeId - ID of the FieldLayoutScheme
Throws:
FieldLayoutStorageException - If there is an error in the DB layer
java.lang.UnsupportedOperationException - If this is executed against standard edition
java.lang.IllegalArgumentException - If the project supplied is null.

removeSchemeAssociation

void removeSchemeAssociation(org.ofbiz.core.entity.GenericValue project,
                             java.lang.Long fieldLayoutSchemeId)
                             throws FieldLayoutStorageException
Removes an association between a particular project and field configuration scheme. NOTE: This is an enterprise ONLY feature.

Parameters:
project - A project GenericValue
fieldLayoutSchemeId - The fieldLayoutScheme ID
Throws:
java.lang.UnsupportedOperationException - If this is executed against standard edition
FieldLayoutStorageException - If there is an error in the DB layer.

getFieldLayout

FieldLayout getFieldLayout()
                           throws FieldLayoutStorageException
Used to retrieve FieldLayout information when rendering a screen.

Returns:
the default FieldLayout
Throws:
FieldLayoutStorageException - If there is a Data Layer error.

getFieldLayout

FieldLayout getFieldLayout(java.lang.Long id)
Used to retrieve FieldLayout information when rendering a screen given the id of the field layout. If the ID is null, the default layout is returned. NOTE: This is an enterprise ONLY feature.

Parameters:
id - The FieldLayout ID.
Returns:
A FieldLayout
Throws:
java.lang.UnsupportedOperationException - If this is executed against standard edition

getFieldLayout

FieldLayout getFieldLayout(org.ofbiz.core.entity.GenericValue issue)
                           throws FieldLayoutStorageException
Returns the fieldLayout for an issue. NOTE: In standard edition this only returns the default field layout, whereas in Enterprise, the field layout for the issue's issuetype associated with the field layout scheme, associated with the issue's project is returned.

Parameters:
issue - An issue GenericValue
Returns:
A FieldLayout
Throws:
FieldLayoutStorageException - If there is a Data Layer error.

getFieldLayout

FieldLayout getFieldLayout(Issue issue)
                           throws FieldLayoutStorageException
Parameters:
issue - An Issue
Returns:
A FieldLayout
Throws:
FieldLayoutStorageException - If there is a Data Layer error.
See Also:
getFieldLayout(org.ofbiz.core.entity.GenericValue)

getFieldLayout

FieldLayout getFieldLayout(org.ofbiz.core.entity.GenericValue project,
                           java.lang.String issueTypeId)
                           throws FieldLayoutStorageException
Parameters:
project - A project GenericValue
issueTypeId - The IssueType id of the issue.
Returns:
A FieldLayout
Throws:
FieldLayoutStorageException - If there is a Data Layer error.
See Also:
getFieldLayout(org.ofbiz.core.entity.GenericValue)

getEditableDefaultFieldLayout

EditableDefaultFieldLayout getEditableDefaultFieldLayout()
                                                         throws FieldLayoutStorageException
Returns the default EditableDefaultFieldLayout.

Returns:
the default EditableDefaultFieldLayout.
Throws:
FieldLayoutStorageException - If there is a Data Layer error.

storeEditableDefaultFieldLayout

void storeEditableDefaultFieldLayout(EditableDefaultFieldLayout editableDefaultFieldLayout)
                                     throws FieldLayoutStorageException
Persist the given default EditableDefaultFieldLayout

Parameters:
editableDefaultFieldLayout - The EditableDefaultFieldLayout.
Throws:
FieldLayoutStorageException - If there is a Data Layer error.

storeEditableFieldLayout

void storeEditableFieldLayout(EditableFieldLayout editableFieldLayout)
                              throws FieldLayoutStorageException
Persists the EditableFieldLayout provided.

Parameters:
editableFieldLayout - the EditableFieldLayout.
Throws:
FieldLayoutStorageException - If there is a Data Layer error.

restoreDefaultFieldLayout

void restoreDefaultFieldLayout()
                               throws FieldLayoutStorageException
This method can be used to rollback any changes to the default field configuration.

Throws:
FieldLayoutStorageException - If there is a Data Layer error.

restoreSchemeFieldLayout

void restoreSchemeFieldLayout(org.ofbiz.core.entity.GenericValue scheme)
                              throws FieldLayoutStorageException
Restores the field layout associated with the provided scheme to defaults. Essentially this involves removing all previously configured custom items. NOTE: This is an enterprise ONLY feature.

Parameters:
scheme - A scheme GenericValue
Throws:
FieldLayoutStorageException - If there is a Data Layer error.
java.lang.IllegalArgumentException - if the scheme passes is null.
java.lang.UnsupportedOperationException - If this is executed against standard edition

hasDefaultFieldLayout

boolean hasDefaultFieldLayout()
                              throws FieldLayoutStorageException
Checks to see if a FieldLayout entity with type TYPE_DEFAULT exists

Returns:
True if a default FieldLayout exists, false otherwise.
Throws:
FieldLayoutStorageException - If there is a Data Layer error.

getProjects

java.util.Collection<org.ofbiz.core.entity.GenericValue> getProjects(FieldConfigurationScheme fieldConfigurationScheme)
Returns all projects that use the given FieldConfigurationScheme. NOTE: This is an enterprise ONLY feature.

Parameters:
fieldConfigurationScheme - the FieldConfigurationScheme
Returns:
A list of projects that use the given FieldConfigurationScheme.

getProjects

java.util.Collection<org.ofbiz.core.entity.GenericValue> getProjects(FieldLayoutScheme fieldLayoutScheme)
                                                                     throws FieldLayoutStorageException
Returns all associated projects for the FieldLayoutScheme supplied. NOTE: This is an enterprise ONLY feature.

Parameters:
fieldLayoutScheme - the FieldLayoutScheme
Returns:
A list of project GenericValues
Throws:
FieldLayoutStorageException - If there is a Data Layer error.
java.lang.UnsupportedOperationException - If this is executed against standard edition

refresh

void refresh()
Clears all local caches.


getEditableFieldLayout

EditableFieldLayout getEditableFieldLayout(java.lang.Long id)
Returns an EditableFieldLayout for the id supplied. NOTE: This is an enterprise ONLY feature.

Parameters:
id - If the id is NULL, the default layout is returned.
Returns:
An EditableFieldLayout
Throws:
java.lang.UnsupportedOperationException - If this is executed against standard edition

deleteFieldLayout

void deleteFieldLayout(FieldLayout fieldLayout)
Deletes a custom FieldLayout NOTE: This is an enterprise ONLY feature.

Parameters:
fieldLayout - The FieldLayout
Throws:
java.lang.UnsupportedOperationException - If this is executed against standard edition

getFieldLayoutSchemeEntities

java.util.Collection<FieldLayoutSchemeEntity> getFieldLayoutSchemeEntities(FieldLayoutScheme fieldLayoutScheme)
Returns a collection of FieldLayoutSchemeEntitys. These are used to record mappings from IssueType -> FieldLayout for the FieldLayoutScheme passed in. NOTE: This is an enterprise ONLY feature.

Parameters:
fieldLayoutScheme - The FieldLayoutScheme
Returns:
A collection of FieldLayoutSchemeEntitys.
Throws:
java.lang.UnsupportedOperationException - If this is executed against standard edition

createFieldLayoutSchemeEntity

void createFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
Persists a new FieldLayoutSchemeEntity for a particular FieldLayoutScheme. The appropriate scheme is retrieved using FieldLayoutSchemeEntity.getFieldLayoutScheme() NOTE: This is an enterprise ONLY feature.

Parameters:
fieldLayoutSchemeEntity - The FieldLayoutSchemeEntity
Throws:
java.lang.UnsupportedOperationException - If this is executed against standard edition

updateFieldLayoutSchemeEntity

void updateFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
Updates a FieldLayoutSchemeEntity. NOTE: This is an enterprise ONLY feature.

Parameters:
fieldLayoutSchemeEntity - The FieldLayoutSchemeEntity
Throws:
java.lang.UnsupportedOperationException - If this is executed against standard edition

removeFieldLayoutSchemeEntity

void removeFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
Removes a FieldLayoutSchemeEntity NOTE: This is an enterprise ONLY feature.

Parameters:
fieldLayoutSchemeEntity - The FieldLayoutSchemeEntity
Throws:
java.lang.UnsupportedOperationException - If this is executed against standard edition

removeFieldLayoutScheme

void removeFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
NOTE: This is an enterprise ONLY feature.

Parameters:
fieldLayoutScheme - The FieldLayoutScheme
Throws:
java.lang.UnsupportedOperationException - If this is executed against standard edition

getFieldConfigurationSchemes

java.util.Collection<FieldConfigurationScheme> getFieldConfigurationSchemes(FieldLayout fieldLayout)
Returns a collection of FieldConfigurationSchemes that include the given FieldLayout.

This is determined by retrieving all FieldLayoutSchemeEntitys with the FieldLayout and calculating a set of FieldConfigurationSchemes using these entities. NOTE: This is an enterprise ONLY feature.

Parameters:
fieldLayout - The FieldLayout.
Returns:
A collection of FieldConfigurationSchemes
Throws:
java.lang.UnsupportedOperationException - If this is executed against standard edition

getRelatedProjects

java.util.Collection<org.ofbiz.core.entity.GenericValue> getRelatedProjects(FieldLayout fieldLayout)
Finds all projects that use the given FieldLayout (via the configured FieldConfigurationScheme).

NOTE: In the case of Standard & Professional, this simply returns ALL projects, as the only fieldlayout is the default field layout.

Parameters:
fieldLayout - The FieldLayout.
Returns:
The set of Projects that use the given FieldLayout.

isFieldLayoutSchemesVisiblyEquivalent

boolean isFieldLayoutSchemesVisiblyEquivalent(java.lang.Long fieldConfigurationSchemeId1,
                                              java.lang.Long fieldConfigurationSchemeId2)
                                              throws FieldLayoutStorageException
Will determine whether or not two FieldLayoutSchemes are "visibly equivalent".

This can be useful for determining if swapping one field layout scheme for another in a project will have any affect on the visibility of fields in the project's issues. For instance, this will let us know if we need to re-index or not.

Since a scheme is a mapping from issue types to field layouts, two schemes are visibly equivalent if:

It is possible that one scheme may have a mapping for an issue type, but the other does not. In this case, equivalence is compared between the issue type specific one and the default field layout.

Note that equivalence is reflexive - all the associations in scheme1 must have equivalent associations in scheme2, and vice versa.

Parameters:
fieldConfigurationSchemeId1 - the first scheme; can use null for the system default scheme
fieldConfigurationSchemeId2 - the second scheme; can use null for the system default scheme
Returns:
the result of the equivalence comparison
Throws:
FieldLayoutStorageException - If there is a Data Layer error.

isFieldLayoutsVisiblyEquivalent

boolean isFieldLayoutsVisiblyEquivalent(java.lang.Long fieldLayoutId1,
                                        java.lang.Long fieldLayoutId2)
Will determine whether or not two FieldLayouts are "visibly equivalent".

This can be useful for determining if swapping one field layout for another in a project will have any affect on the visibility of fields in the project's issues. For instance, this will let us know if we need to re-index or not.

Two field layouts are visibly equivalent if:

Note that equivalence is reflexive: layout1 == layout2 implies layout2 == layout1.

Parameters:
fieldLayoutId1 - the first layout id; null signifies the default field layout in the system
fieldLayoutId2 - the second layout id; null signifies the default field layout in the system
Returns:
the result of the equivalence comparison


Copyright © 2002-2010 Atlassian. All Rights Reserved.