Interface FieldLayoutManager
- All Known Implementing Classes:
AbstractFieldLayoutManager,DefaultFieldLayoutManager,MockFieldLayoutManager
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSchemeAssociation(Project project, Long fieldLayoutSchemeId) Associates aFieldLayoutSchemeto the project supplied.voidaddSchemeAssociation(org.ofbiz.core.entity.GenericValue project, Long fieldLayoutSchemeId) Deprecated.copyFieldLayoutScheme(FieldLayoutScheme scheme, String name, String description) Copies an existing field layout to a new one.createFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme) Persists a new field Layout scheme (i.e Field Configuration Scheme).createFieldLayoutScheme(String name, String description) Persists a new field Layout scheme (i.e Field Configuration Scheme).voidcreateFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity) Persists a newFieldLayoutSchemeEntityfor a particularFieldLayoutScheme.createFieldLayoutSchemeEntity(FieldLayoutScheme fieldLayoutScheme, String issueTypeId, Long fieldConfigurationId) Persists a newFieldLayoutSchemeEntityfor a particularFieldLayoutScheme.voiddeleteFieldLayout(FieldLayout fieldLayout) Deletes a customFieldLayoutvoiddeleteFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme) Removes theFieldLayoutSchemesupplied.booleanfieldConfigurationSchemeExists(String schemeName) Checks if a FieldConfigurationScheme with the given name exists.Returns the defaultEditableDefaultFieldLayout.Returns anEditableFieldLayoutfor the id supplied.Retrieves editable (seeEditableFieldLayoutversions of the field layouts.getFieldConfigurationScheme(Project project) Retrieves the Field Configuration Scheme associated with the supplied project.getFieldConfigurationScheme(Long schemeId) Retrieves aFieldConfigurationSchemeby idgetFieldConfigurationSchemeForProject(Long projectId) Retrieves the Field Configuration Scheme associated with the supplied project.getFieldConfigurationSchemes(FieldLayout fieldLayout) Returns a collection ofFieldConfigurationSchemes that include the givenFieldLayout.Used to retrieveFieldLayoutinformation when rendering a screen.getFieldLayout(Issue issue) Returns the fieldLayout for an issue.getFieldLayout(Project project, String issueTypeId) getFieldLayout(Long id) Used to retrieveFieldLayoutinformation when rendering a screen given the id of the field layout.getFieldLayout(Long projectId, String issueTypeId) Find the FieldLayout for the given Project and IssueType.getFieldLayout(org.ofbiz.core.entity.GenericValue issue) Deprecated.UsegetFieldLayout(com.atlassian.jira.issue.Issue)instead.getFieldLayoutSchemeEntities(FieldLayoutScheme fieldLayoutScheme) Returns a collection ofFieldLayoutSchemeEntitys.Retries Field Configuration Schemes.getMutableFieldLayoutScheme(Long schemeId) Retrieves a mutableFieldLayoutSchemeby id.Collection<org.ofbiz.core.entity.GenericValue>getProjects(FieldConfigurationScheme fieldConfigurationScheme) Deprecated.UsegetProjectsUsing(FieldConfigurationScheme)instead.Collection<org.ofbiz.core.entity.GenericValue>getProjects(FieldLayoutScheme fieldLayoutScheme) Deprecated.UsegetProjectsUsing(FieldLayoutScheme)instead.getProjectsUsing(FieldConfigurationScheme fieldConfigurationScheme) Returns all projects that use the given FieldConfigurationScheme.getProjectsUsing(FieldLayout fieldLayout) Finds all projects that use the givenFieldLayout(via the configuredFieldConfigurationScheme).getProjectsUsing(FieldLayoutScheme fieldLayoutScheme) Returns all projects that use the given FieldLayoutScheme.Collection<org.ofbiz.core.entity.GenericValue>getRelatedProjects(FieldLayout fieldLayout) Deprecated.UsegetProjectsUsing(FieldLayout)instead.getUniqueFieldLayouts(Project project) Retrieves all theFieldLayout's for a project.getUniqueFieldLayouts(Collection<Project> projects, Collection<String> issueTypeIds) Retrieves all theFieldLayout's for a collection of projects and issue types.booleanChecks to see if aFieldLayoutentity with typeTYPE_DEFAULTexistsbooleanisFieldLayoutSchemesVisiblyEquivalent(Long fieldConfigurationSchemeId1, Long fieldConfigurationSchemeId2) Will determine whether or not twoFieldLayoutSchemes are "visibly equivalent".booleanisFieldLayoutsVisiblyEquivalent(Long fieldLayoutId1, Long fieldLayoutId2) Will determine whether or not twoFieldLayouts are "visibly equivalent".voidrefresh()Clears all local caches.voidremoveFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme) voidremoveFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity) Removes aFieldLayoutSchemeEntityvoidremoveSchemeAssociation(Project project, Long fieldLayoutSchemeId) Removes an association between a particular project and field configuration scheme.voidremoveSchemeAssociation(org.ofbiz.core.entity.GenericValue project, Long fieldLayoutSchemeId) Deprecated.voidThis method can be used to rollback any changes to the default field configuration.storeAndReturnEditableFieldLayout(EditableFieldLayout editableFieldLayout) Persists theEditableFieldLayoutprovided and returns a new instance as stored in the database.voidstoreEditableDefaultFieldLayout(EditableDefaultFieldLayout editableDefaultFieldLayout) Persist the given defaultEditableDefaultFieldLayoutvoidstoreEditableFieldLayout(EditableFieldLayout editableFieldLayout) Persists theEditableFieldLayoutprovided.voidupdateFieldLayoutItemAttributesForCustomField(CustomField customField, String description, boolean isRequired, boolean isHidden) Update thedescription,isHiddenandisRequiredcolumns of all thefieldlayoutitemrows associated with this custom field.voidupdateFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme) Persists theFieldLayoutSchemesupplied.voidupdateFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity) Updates aFieldLayoutSchemeEntity.
-
Field Details
-
TYPE_DEFAULT
JIRA must have a default field layout. This is used identify the default layout.- See Also:
-
-
Method Details
-
createFieldLayoutScheme
Persists a new field Layout scheme (i.e Field Configuration Scheme).- Parameters:
fieldLayoutScheme- TheFieldLayoutSchemeto persist.- Returns:
- The stored
FieldLayoutSchemeobject - Throws:
DataAccessException- If there is a Data Layer error.UnsupportedOperationException- If this is executed against standard edition
-
createFieldLayoutScheme
Persists a new field Layout scheme (i.e Field Configuration Scheme). -
copyFieldLayoutScheme
FieldLayoutScheme copyFieldLayoutScheme(@Nonnull FieldLayoutScheme scheme, @Nonnull String name, @Nullable String description) Copies an existing field layout to a new one. -
getFieldConfigurationScheme
Retrieves aFieldConfigurationSchemeby id- Parameters:
schemeId- FieldConfigurationScheme ID- Returns:
- A
FieldConfigurationSchemeinstance - Throws:
DataAccessException- If there is a DB exception.UnsupportedOperationException- If this is executed against standard edition
-
getMutableFieldLayoutScheme
Retrieves a mutableFieldLayoutSchemeby id.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
FieldLayoutSchemeinstance - Throws:
DataAccessException- if an error occurs in the DB layerUnsupportedOperationException- If this is executed against standard edition
-
fieldConfigurationSchemeExists
Checks if a FieldConfigurationScheme with the given name exists.- Parameters:
schemeName- The scheme name- Returns:
trueif a FieldConfigurationScheme with the given name exists.- Throws:
DataAccessException- If there is a DB error.UnsupportedOperationException- If this is executed against standard edition
-
getEditableFieldLayouts
List<EditableFieldLayout> getEditableFieldLayouts()Retrieves editable (seeEditableFieldLayoutversions of the field layouts. Note: For standard edition this simply returns an editable version of the default field layout. (seeEditableDefaultFieldLayout)- Returns:
- A list of
EditableFieldLayoutandEditableDefaultFieldLayout
-
getFieldLayoutSchemes
List<FieldLayoutScheme> getFieldLayoutSchemes()Retries Field Configuration Schemes. These are used to link field configurations to projects.- Returns:
- A list of
FieldLayoutSchemes. - Throws:
DataAccessException- If there is a Data Layer error.UnsupportedOperationException- If this is executed against standard edition
-
updateFieldLayoutScheme
Persists theFieldLayoutSchemesupplied.- Parameters:
fieldLayoutScheme- The FieldLayoutScheme- Throws:
DataAccessException- If there is a Data Layer error.UnsupportedOperationException- If this is executed against standard edition
-
deleteFieldLayoutScheme
Removes theFieldLayoutSchemesupplied.- Parameters:
fieldLayoutScheme- The FieldLayoutScheme- Throws:
DataAccessException- If there is a Data Layer error.UnsupportedOperationException- If this is executed against standard edition
-
getFieldConfigurationScheme
Retrieves the Field Configuration Scheme associated with the supplied project.- Parameters:
project- A project- Returns:
- A
FieldConfigurationSchemeor null if none exists.
-
getFieldConfigurationSchemeForProject
Retrieves the Field Configuration Scheme associated with the supplied project.- Parameters:
projectId- The project ID- Returns:
- A
FieldConfigurationSchemeor null if none exists. - Since:
- 6.4
-
getUniqueFieldLayouts
Retrieves all theFieldLayout'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:
DataAccessException- If there is a Data Layer error.
-
getUniqueFieldLayouts
@Nonnull Set<FieldLayout> getUniqueFieldLayouts(@Nonnull Collection<Project> projects, @Nonnull Collection<String> issueTypeIds) Retrieves all theFieldLayout's for a collection of projects and issue types.- Parameters:
projects- a collection of projects.issueTypeIds- An collection of issue type ids.- Returns:
- the unique set of FieldLayout's for the provided projects, an empty set if there are none.
- Since:
- v6.4
-
addSchemeAssociation
Deprecated.UseaddSchemeAssociation(com.atlassian.jira.project.Project, Long)instead. Since v5.2.Associates aFieldLayoutSchemeto the project supplied.- Parameters:
project- A projectGenericValuefieldLayoutSchemeId- ID of the FieldLayoutScheme- Throws:
DataAccessException- If there is an error in the DB layerUnsupportedOperationException- If this is executed against standard editionIllegalArgumentException- If the project supplied is null.
-
removeSchemeAssociation
Deprecated.UseremoveSchemeAssociation(com.atlassian.jira.project.Project, Long)instead. Since v5.2.Removes an association between a particular project and field configuration scheme.- Parameters:
project- A projectGenericValuefieldLayoutSchemeId- The fieldLayoutScheme ID- Throws:
UnsupportedOperationException- If this is executed against standard editionDataAccessException- If there is an error in the DB layer.
-
addSchemeAssociation
Associates aFieldLayoutSchemeto the project supplied.- Parameters:
project- The projectfieldLayoutSchemeId- ID of the FieldLayoutScheme- Throws:
IllegalArgumentException- If the project supplied is null.
-
removeSchemeAssociation
Removes an association between a particular project and field configuration scheme.- Parameters:
project- The projectfieldLayoutSchemeId- The fieldLayoutScheme ID
-
getFieldLayout
FieldLayout getFieldLayout()Used to retrieveFieldLayoutinformation when rendering a screen.- Returns:
- the default FieldLayout
- Throws:
DataAccessException- If there is a Data Layer error.
-
getFieldLayout
Used to retrieveFieldLayoutinformation when rendering a screen given the id of the field layout. If the ID is null, the default layout is returned.- Parameters:
id- The FieldLayout ID.- Returns:
- The
FieldLayout - Throws:
UnsupportedOperationException- If this is executed against standard edition
-
getFieldLayout
Deprecated.UsegetFieldLayout(com.atlassian.jira.issue.Issue)instead. Since v5.0.Returns the fieldLayout for an issue.- Parameters:
issue- An issueGenericValue- Returns:
- A
FieldLayout - Throws:
DataAccessException- If there is a Data Layer error.
-
getFieldLayout
Returns the fieldLayout for an issue.- Parameters:
issue- AnIssue- Returns:
- A
FieldLayout
-
getFieldLayout
- Parameters:
project- A projectissueTypeId- The IssueType id of the issue.- Returns:
- A
FieldLayout - Throws:
DataAccessException- If there is a Data Layer error.- See Also:
-
getFieldLayout
Find the FieldLayout for the given Project and IssueType.- Parameters:
projectId- the projectissueTypeId- the issue type- Returns:
- the FieldLayout for the given Project and IssueType.
-
getEditableDefaultFieldLayout
EditableDefaultFieldLayout getEditableDefaultFieldLayout()Returns the defaultEditableDefaultFieldLayout.- Returns:
- the default
EditableDefaultFieldLayout. - Throws:
DataAccessException- If there is a Data Layer error.
-
storeEditableDefaultFieldLayout
Persist the given defaultEditableDefaultFieldLayout- Parameters:
editableDefaultFieldLayout- The EditableDefaultFieldLayout.- Throws:
DataAccessException- If there is a Data Layer error.
-
storeEditableFieldLayout
Persists theEditableFieldLayoutprovided.- Parameters:
editableFieldLayout- the EditableFieldLayout.- Throws:
DataAccessException- If there is a Data Layer error.
-
storeAndReturnEditableFieldLayout
Persists theEditableFieldLayoutprovided and returns a new instance as stored in the database.- Parameters:
editableFieldLayout- the EditableFieldLayout.- Returns:
- the layout as stored in the database.
- Throws:
DataAccessException- If there is a Data Layer error.
-
restoreDefaultFieldLayout
void restoreDefaultFieldLayout()This method can be used to rollback any changes to the default field configuration.- Throws:
DataAccessException- If there is a Data Layer error.
-
hasDefaultFieldLayout
boolean hasDefaultFieldLayout()Checks to see if aFieldLayoutentity with typeTYPE_DEFAULTexists- Returns:
- True if a default
FieldLayoutexists, false otherwise. - Throws:
DataAccessException- If there is a Data Layer error.
-
getProjects
Collection<org.ofbiz.core.entity.GenericValue> getProjects(FieldConfigurationScheme fieldConfigurationScheme) Deprecated.UsegetProjectsUsing(FieldConfigurationScheme)instead. Since v6.4.Returns all projects that use the given FieldConfigurationScheme.- Parameters:
fieldConfigurationScheme- the FieldConfigurationScheme- Returns:
- A list of projects that use the given FieldConfigurationScheme.
-
getProjectsUsing
Returns all projects that use the given FieldConfigurationScheme.- Parameters:
fieldConfigurationScheme- the FieldConfigurationScheme- Returns:
- A list of projects that use the given FieldConfigurationScheme.
-
getProjects
Deprecated.UsegetProjectsUsing(FieldLayoutScheme)instead. Since v6.4.Returns all associated projects for theFieldLayoutSchemesupplied.- Parameters:
fieldLayoutScheme- the FieldLayoutScheme- Returns:
- A list of project
GenericValues - Throws:
DataAccessException- If there is a Data Layer error.UnsupportedOperationException- If this is executed against standard edition
-
getProjectsUsing
Returns all projects that use the given FieldLayoutScheme.- Parameters:
fieldLayoutScheme- the FieldLayoutScheme- Returns:
- A list of projects that use the given FieldLayoutScheme.
-
refresh
void refresh()Clears all local caches. -
getEditableFieldLayout
Returns anEditableFieldLayoutfor the id supplied.- Parameters:
id- If the id is NULL, the default layout is returned.- Returns:
- An
EditableFieldLayout - Throws:
UnsupportedOperationException- If this is executed against standard edition
-
deleteFieldLayout
Deletes a customFieldLayout- Parameters:
fieldLayout- The FieldLayout- Throws:
UnsupportedOperationException- If this is executed against standard edition
-
getFieldLayoutSchemeEntities
Collection<FieldLayoutSchemeEntity> getFieldLayoutSchemeEntities(FieldLayoutScheme fieldLayoutScheme) Returns a collection ofFieldLayoutSchemeEntitys. These are used to record mappings fromIssueType->FieldLayoutfor theFieldLayoutSchemepassed in.- Parameters:
fieldLayoutScheme- The FieldLayoutScheme- Returns:
- A collection of
FieldLayoutSchemeEntitys. - Throws:
UnsupportedOperationException- If this is executed against standard edition
-
createFieldLayoutSchemeEntity
Persists a newFieldLayoutSchemeEntityfor a particularFieldLayoutScheme. The appropriate scheme is retrieved usingFieldLayoutSchemeEntity.getFieldLayoutScheme()- Parameters:
fieldLayoutSchemeEntity- The FieldLayoutSchemeEntity- Throws:
UnsupportedOperationException- If this is executed against standard edition
-
createFieldLayoutSchemeEntity
FieldLayoutSchemeEntity createFieldLayoutSchemeEntity(FieldLayoutScheme fieldLayoutScheme, String issueTypeId, Long fieldConfigurationId) Persists a newFieldLayoutSchemeEntityfor a particularFieldLayoutScheme. The appropriate scheme is retrieved usingFieldLayoutSchemeEntity.getFieldLayoutScheme()- Parameters:
fieldLayoutScheme- the FieldLayoutSchemeissueTypeId- the Issue TypefieldConfigurationId- the FieldConfig- Throws:
UnsupportedOperationException- If this is executed against standard edition
-
updateFieldLayoutSchemeEntity
Updates aFieldLayoutSchemeEntity.- Parameters:
fieldLayoutSchemeEntity- The FieldLayoutSchemeEntity- Throws:
UnsupportedOperationException- If this is executed against standard edition
-
removeFieldLayoutSchemeEntity
Removes aFieldLayoutSchemeEntity- Parameters:
fieldLayoutSchemeEntity- The FieldLayoutSchemeEntity- Throws:
UnsupportedOperationException- If this is executed against standard edition
-
removeFieldLayoutScheme
- Parameters:
fieldLayoutScheme- The FieldLayoutScheme- Throws:
UnsupportedOperationException- If this is executed against standard edition
-
getFieldConfigurationSchemes
Returns a collection ofFieldConfigurationSchemes that include the givenFieldLayout.This is determined by retrieving all
FieldLayoutSchemeEntitys with theFieldLayoutand calculating a set ofFieldConfigurationSchemes using these entities.- Parameters:
fieldLayout- The FieldLayout.- Returns:
- A collection of
FieldConfigurationSchemes - Throws:
UnsupportedOperationException- If this is executed against standard edition
-
getRelatedProjects
Deprecated.UsegetProjectsUsing(FieldLayout)instead. Since v6.4.Finds all projects that use the givenFieldLayout(via the configuredFieldConfigurationScheme).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.
-
getProjectsUsing
Finds all projects that use the givenFieldLayout(via the configuredFieldConfigurationScheme).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(Long fieldConfigurationSchemeId1, Long fieldConfigurationSchemeId2) Will determine whether or not twoFieldLayoutSchemes 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:
- All issue types map to the same field layouts; or else
- The field layouts that an issue type is associated with in each scheme are visibly equivalent
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 usenullfor the system default schemefieldConfigurationSchemeId2- the second scheme; can usenullfor the system default scheme- Returns:
- the result of the equivalence comparison
- Throws:
DataAccessException- If there is a Data Layer error.
-
isFieldLayoutsVisiblyEquivalent
Will determine whether or not twoFieldLayouts 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:
- They contain the same fields, and
- Each field has the same shown/hidden flag
- Parameters:
fieldLayoutId1- the first layout id; null signifies the default field layout in the systemfieldLayoutId2- the second layout id; null signifies the default field layout in the system- Returns:
- the result of the equivalence comparison
-
updateFieldLayoutItemAttributesForCustomField
void updateFieldLayoutItemAttributesForCustomField(@Nonnull CustomField customField, @Nonnull String description, boolean isRequired, boolean isHidden) Update thedescription,isHiddenandisRequiredcolumns of all thefieldlayoutitemrows associated with this custom field.- Parameters:
customField- a CustomField which owns the affected fieldlayoutitemsdescription- a String containing the new descriptionisRequired- a boolean containing the new valueisHidden- a boolean containing the new value.
-
addSchemeAssociation(com.atlassian.jira.project.Project, Long)instead.