|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.jira.issue.fields.layout.field.AbstractFieldLayoutManager
com.atlassian.jira.issue.fields.layout.field.DefaultFieldLayoutManager
public class DefaultFieldLayoutManager
Field Summary |
---|
Fields inherited from class com.atlassian.jira.issue.fields.layout.field.AbstractFieldLayoutManager |
---|
ofBizDelegator, SCHEME, SCHEME_ASSOCIATION |
Fields inherited from interface com.atlassian.jira.issue.fields.layout.field.FieldLayoutManager |
---|
TYPE_DEFAULT |
Constructor Summary | |
---|---|
DefaultFieldLayoutManager(FieldManager fieldManager,
OfBizDelegator ofBizDelegator,
ConstantsManager constantsManager,
SubTaskManager subTaskManager,
ProjectManager projectManager,
com.atlassian.event.api.EventPublisher eventPublisher,
I18nHelper.BeanFactory i18n,
AssociationManager associationManager)
|
Method Summary | |
---|---|
void |
addSchemeAssociation(org.ofbiz.core.entity.GenericValue project,
Long fieldLayoutSchemeId)
Associates a FieldLayoutScheme to the project supplied. |
protected void |
clearCaches()
|
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(String schemeName)
Checks if a FieldConfigurationScheme with the given name exists. |
protected List<String> |
getAllRelevantIssueTypeIds()
|
EditableFieldLayout |
getEditableFieldLayout(Long id)
Returns an EditableFieldLayout for the id supplied. |
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(Long schemeId)
Retrieves a FieldConfigurationScheme by id
NOTE: This is an enterprise ONLY feature. |
FieldConfigurationScheme |
getFieldConfigurationScheme(Project project)
Retrieves the Field Configuration Scheme associated with the supplied project. |
Collection<FieldConfigurationScheme> |
getFieldConfigurationSchemes(FieldLayout fieldLayout)
Returns a collection of FieldConfigurationScheme s that include the given FieldLayout . |
FieldLayout |
getFieldLayout(org.ofbiz.core.entity.GenericValue issue)
Returns the fieldLayout for an issue. |
FieldLayout |
getFieldLayout(org.ofbiz.core.entity.GenericValue project,
String issueTypeId)
|
FieldLayout |
getFieldLayout(Long id)
Used to retrieve FieldLayout information when rendering a screen given the id
of the field layout. |
FieldLayout |
getFieldLayout(Project project,
String issueTypeId)
|
Collection<FieldLayoutSchemeEntity> |
getFieldLayoutSchemeEntities(FieldLayoutScheme fieldLayoutScheme)
Returns a collection of FieldLayoutSchemeEntity s. |
List<FieldLayoutScheme> |
getFieldLayoutSchemes()
Retries Field Configuration Schemes. |
FieldLayoutScheme |
getMutableFieldLayoutScheme(Long schemeId)
Retrieves a mutable FieldLayoutScheme by id. |
Collection<org.ofbiz.core.entity.GenericValue> |
getProjects(FieldConfigurationScheme fieldConfigurationScheme)
Returns all projects that use the given FieldConfigurationScheme. |
Collection<org.ofbiz.core.entity.GenericValue> |
getProjects(FieldLayoutScheme fieldLayoutScheme)
Returns all associated projects for the FieldLayoutScheme supplied. |
Collection<org.ofbiz.core.entity.GenericValue> |
getRelatedProjects(FieldLayout fieldLayout)
Finds all projects that use the given FieldLayout (via the configured FieldConfigurationScheme ). |
Set<FieldLayout> |
getUniqueFieldLayouts(Project project)
Retrieves all the FieldLayout 's for a project. |
boolean |
isFieldLayoutSchemesVisiblyEquivalent(Long fieldConfigurationSchemeId1,
Long fieldConfigurationSchemeId2)
Will determine whether or not two FieldLayoutScheme s are
"visibly equivalent". |
boolean |
isFieldLayoutsVisiblyEquivalent(Long fieldLayoutId1,
Long fieldLayoutId2)
Will determine whether or not two FieldLayout s are
"visibly equivalent". |
void |
onClearCache(ClearCacheEvent event)
|
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,
Long fieldLayoutSchemeId)
Removes an association between a particular project and field configuration scheme. |
void |
restoreSchemeFieldLayout(org.ofbiz.core.entity.GenericValue scheme)
Restores the field layout associated with the provided scheme to defaults. |
void |
start()
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework. |
void |
updateFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
Persists the FieldLayoutScheme supplied. |
void |
updateFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
Updates a FieldLayoutSchemeEntity . |
Methods inherited from class com.atlassian.jira.issue.fields.layout.field.AbstractFieldLayoutManager |
---|
getDefaultDescription, getDefaultFieldLayoutItems, getEditableDefaultFieldLayout, getFieldLayout, getFieldLayout, getI18nHelper, getRelevantFieldLayout, hasDefaultFieldLayout, refreshCaches, restoreDefaultFieldLayout, restoreFieldLayout, storeEditableDefaultFieldLayout, storeEditableFieldLayout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.atlassian.jira.issue.fields.layout.field.FieldLayoutManager |
---|
getEditableDefaultFieldLayout, getFieldLayout, getFieldLayout, hasDefaultFieldLayout, restoreDefaultFieldLayout, storeEditableDefaultFieldLayout, storeEditableFieldLayout |
Constructor Detail |
---|
public DefaultFieldLayoutManager(FieldManager fieldManager, OfBizDelegator ofBizDelegator, ConstantsManager constantsManager, SubTaskManager subTaskManager, ProjectManager projectManager, com.atlassian.event.api.EventPublisher eventPublisher, I18nHelper.BeanFactory i18n, AssociationManager associationManager)
Method Detail |
---|
public void start() throws Exception
Startable
start
in interface Startable
start
in class AbstractFieldLayoutManager
Exception
- Allows implementations to throw an Exception.@EventListener public void onClearCache(ClearCacheEvent event)
public FieldLayout getFieldLayout(org.ofbiz.core.entity.GenericValue issue)
FieldLayoutManager
getFieldLayout
in interface FieldLayoutManager
getFieldLayout
in class AbstractFieldLayoutManager
issue
- An issue GenericValue
FieldLayout
public FieldLayout getFieldLayout(Project project, String issueTypeId)
getFieldLayout
in interface FieldLayoutManager
getFieldLayout
in class AbstractFieldLayoutManager
project
- A project GenericValue
issueTypeId
- The IssueType id of the issue.
FieldLayout
FieldLayoutManager.getFieldLayout(Issue)
public FieldLayout getFieldLayout(org.ofbiz.core.entity.GenericValue project, String issueTypeId)
getFieldLayout
in interface FieldLayoutManager
getFieldLayout
in class AbstractFieldLayoutManager
project
- the ProjectissueTypeId
- The IssueType id of the issue.
FieldLayout
public List<FieldLayoutScheme> getFieldLayoutSchemes()
FieldLayoutManager
getFieldLayoutSchemes
in interface FieldLayoutManager
getFieldLayoutSchemes
in class AbstractFieldLayoutManager
FieldLayoutScheme
s.public Collection<org.ofbiz.core.entity.GenericValue> getRelatedProjects(FieldLayout fieldLayout)
FieldLayoutManager
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.
getRelatedProjects
in interface FieldLayoutManager
getRelatedProjects
in class AbstractFieldLayoutManager
fieldLayout
- The FieldLayout.
public List<EditableFieldLayout> getEditableFieldLayouts()
FieldLayoutManager
EditableFieldLayout
versions of the field layouts.
Note: For standard edition this simply returns an editable version of the default field
layout. (see EditableDefaultFieldLayout
)
getEditableFieldLayouts
in interface FieldLayoutManager
getEditableFieldLayouts
in class AbstractFieldLayoutManager
EditableFieldLayout
and EditableDefaultFieldLayout
public EditableFieldLayout getEditableFieldLayout(Long id)
FieldLayoutManager
EditableFieldLayout
for the id supplied.
NOTE: This is an enterprise ONLY feature.
getEditableFieldLayout
in interface FieldLayoutManager
getEditableFieldLayout
in class AbstractFieldLayoutManager
id
- If the id is NULL, the default layout is returned.
EditableFieldLayout
public void updateFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
FieldLayoutManager
FieldLayoutScheme
supplied.
NOTE: This is an enterprise ONLY feature.
updateFieldLayoutScheme
in interface FieldLayoutManager
updateFieldLayoutScheme
in class AbstractFieldLayoutManager
fieldLayoutScheme
- The FieldLayoutSchemepublic void deleteFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
FieldLayoutManager
FieldLayoutScheme
supplied.
NOTE: This is an enterprise ONLY feature.
deleteFieldLayoutScheme
in interface FieldLayoutManager
deleteFieldLayoutScheme
in class AbstractFieldLayoutManager
fieldLayoutScheme
- The FieldLayoutSchemepublic void deleteFieldLayout(FieldLayout fieldLayout)
FieldLayoutManager
FieldLayout
NOTE: This is an enterprise ONLY feature.
deleteFieldLayout
in interface FieldLayoutManager
deleteFieldLayout
in class AbstractFieldLayoutManager
fieldLayout
- The FieldLayoutpublic Collection<FieldLayoutSchemeEntity> getFieldLayoutSchemeEntities(FieldLayoutScheme fieldLayoutScheme)
FieldLayoutManager
FieldLayoutSchemeEntity
s. These are used to
record mappings from IssueType
-> FieldLayout
for the FieldLayoutScheme
passed in.
NOTE: This is an enterprise ONLY feature.
getFieldLayoutSchemeEntities
in interface FieldLayoutManager
getFieldLayoutSchemeEntities
in class AbstractFieldLayoutManager
fieldLayoutScheme
- The FieldLayoutScheme
FieldLayoutSchemeEntity
s.public void createFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
FieldLayoutManager
FieldLayoutSchemeEntity
for a particular FieldLayoutScheme
.
The appropriate scheme is retrieved using FieldLayoutSchemeEntity.getFieldLayoutScheme()
NOTE: This is an enterprise ONLY feature.
createFieldLayoutSchemeEntity
in interface FieldLayoutManager
createFieldLayoutSchemeEntity
in class AbstractFieldLayoutManager
fieldLayoutSchemeEntity
- The FieldLayoutSchemeEntitypublic void updateFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
FieldLayoutManager
FieldLayoutSchemeEntity
.
NOTE: This is an enterprise ONLY feature.
updateFieldLayoutSchemeEntity
in interface FieldLayoutManager
updateFieldLayoutSchemeEntity
in class AbstractFieldLayoutManager
fieldLayoutSchemeEntity
- The FieldLayoutSchemeEntitypublic void removeFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
FieldLayoutManager
FieldLayoutSchemeEntity
NOTE: This is an enterprise ONLY feature.
removeFieldLayoutSchemeEntity
in interface FieldLayoutManager
removeFieldLayoutSchemeEntity
in class AbstractFieldLayoutManager
fieldLayoutSchemeEntity
- The FieldLayoutSchemeEntitypublic void removeFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
FieldLayoutManager
removeFieldLayoutScheme
in interface FieldLayoutManager
removeFieldLayoutScheme
in class AbstractFieldLayoutManager
fieldLayoutScheme
- The FieldLayoutSchemepublic Collection<FieldConfigurationScheme> getFieldConfigurationSchemes(FieldLayout fieldLayout)
FieldLayoutManager
FieldConfigurationScheme
s that include the given FieldLayout
.
This is determined by retrieving all FieldLayoutSchemeEntity
s with the FieldLayout
and
calculating a set of FieldConfigurationScheme
s using these entities.
NOTE: This is an enterprise ONLY feature.
getFieldConfigurationSchemes
in interface FieldLayoutManager
getFieldConfigurationSchemes
in class AbstractFieldLayoutManager
fieldLayout
- The FieldLayout.
FieldConfigurationScheme
spublic void restoreSchemeFieldLayout(org.ofbiz.core.entity.GenericValue scheme)
FieldLayoutManager
restoreSchemeFieldLayout
in interface FieldLayoutManager
restoreSchemeFieldLayout
in class AbstractFieldLayoutManager
scheme
- A scheme GenericValue
public Collection<org.ofbiz.core.entity.GenericValue> getProjects(FieldConfigurationScheme fieldConfigurationScheme)
FieldLayoutManager
getProjects
in interface FieldLayoutManager
getProjects
in class AbstractFieldLayoutManager
fieldConfigurationScheme
- the FieldConfigurationScheme
public Collection<org.ofbiz.core.entity.GenericValue> getProjects(FieldLayoutScheme fieldLayoutScheme)
FieldLayoutManager
FieldLayoutScheme
supplied.
NOTE: This is an enterprise ONLY feature.
getProjects
in interface FieldLayoutManager
getProjects
in class AbstractFieldLayoutManager
fieldLayoutScheme
- the FieldLayoutScheme
GenericValue
spublic FieldLayoutScheme createFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
FieldLayoutManager
createFieldLayoutScheme
in interface FieldLayoutManager
createFieldLayoutScheme
in class AbstractFieldLayoutManager
fieldLayoutScheme
- The FieldLayoutScheme
to persist.
FieldLayoutScheme
objectpublic FieldConfigurationScheme getFieldConfigurationScheme(Long schemeId)
FieldLayoutManager
FieldConfigurationScheme
by id
NOTE: This is an enterprise ONLY feature.
getFieldConfigurationScheme
in interface FieldLayoutManager
getFieldConfigurationScheme
in class AbstractFieldLayoutManager
schemeId
- FieldConfigurationScheme ID
FieldConfigurationScheme
instancepublic FieldLayoutScheme getMutableFieldLayoutScheme(Long schemeId)
FieldLayoutManager
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 FieldLayoutManager.getFieldConfigurationScheme(Long)
for access to a cached immutable scheme object.
getMutableFieldLayoutScheme
in interface FieldLayoutManager
getMutableFieldLayoutScheme
in class AbstractFieldLayoutManager
schemeId
- the scheme ID
FieldLayoutScheme
instancepublic boolean fieldConfigurationSchemeExists(String schemeName)
FieldLayoutManager
fieldConfigurationSchemeExists
in interface FieldLayoutManager
fieldConfigurationSchemeExists
in class AbstractFieldLayoutManager
schemeName
- The scheme name
true
if a FieldConfigurationScheme with the given name exists.public Set<FieldLayout> getUniqueFieldLayouts(Project project)
FieldLayoutManager
FieldLayout
's for a project.
getUniqueFieldLayouts
in interface FieldLayoutManager
getUniqueFieldLayouts
in class AbstractFieldLayoutManager
project
- a project
public FieldConfigurationScheme getFieldConfigurationScheme(Project project)
FieldLayoutManager
getFieldConfigurationScheme
in interface FieldLayoutManager
getFieldConfigurationScheme
in class AbstractFieldLayoutManager
project
- A project GenericValue
FieldConfigurationScheme
or null if none exists.public FieldConfigurationScheme getFieldConfigurationScheme(org.ofbiz.core.entity.GenericValue project)
FieldLayoutManager
getFieldConfigurationScheme
in interface FieldLayoutManager
getFieldConfigurationScheme
in class AbstractFieldLayoutManager
project
- A project GenericValue
FieldConfigurationScheme
or null if none exists.public void addSchemeAssociation(org.ofbiz.core.entity.GenericValue project, Long fieldLayoutSchemeId)
FieldLayoutManager
FieldLayoutScheme
to the project supplied.
NOTE: This is an enterprise ONLY feature.
addSchemeAssociation
in interface FieldLayoutManager
addSchemeAssociation
in class AbstractFieldLayoutManager
project
- A project GenericValue
fieldLayoutSchemeId
- ID of the FieldLayoutSchemepublic void removeSchemeAssociation(org.ofbiz.core.entity.GenericValue project, Long fieldLayoutSchemeId)
FieldLayoutManager
removeSchemeAssociation
in interface FieldLayoutManager
removeSchemeAssociation
in class AbstractFieldLayoutManager
project
- A project GenericValue
fieldLayoutSchemeId
- The fieldLayoutScheme IDpublic FieldLayout getFieldLayout(Long id)
FieldLayoutManager
FieldLayout
information when rendering a screen given the id
of the field layout. If the ID is null, the default layout is returned.
getFieldLayout
in interface FieldLayoutManager
getFieldLayout
in class AbstractFieldLayoutManager
id
- The FieldLayout ID.
FieldLayout
public void refresh()
FieldLayoutManager
refresh
in interface FieldLayoutManager
refresh
in class AbstractFieldLayoutManager
protected void clearCaches()
public boolean isFieldLayoutSchemesVisiblyEquivalent(Long fieldConfigurationSchemeId1, Long fieldConfigurationSchemeId2)
FieldLayoutManager
FieldLayoutScheme
s 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:
Note that equivalence is reflexive - all the associations in scheme1 must have equivalent associations in scheme2, and vice versa.
isFieldLayoutSchemesVisiblyEquivalent
in interface FieldLayoutManager
isFieldLayoutSchemesVisiblyEquivalent
in class AbstractFieldLayoutManager
fieldConfigurationSchemeId1
- the first scheme; can use null
for the system default schemefieldConfigurationSchemeId2
- the second scheme; can use null
for the system default scheme
public boolean isFieldLayoutsVisiblyEquivalent(Long fieldLayoutId1, Long fieldLayoutId2)
FieldLayoutManager
FieldLayout
s 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:
isFieldLayoutsVisiblyEquivalent
in interface FieldLayoutManager
isFieldLayoutsVisiblyEquivalent
in class AbstractFieldLayoutManager
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
protected List<String> getAllRelevantIssueTypeIds()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |