|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.issue.fields.layout.field.DefaultFieldLayoutManager
public class DefaultFieldLayoutManager
Field Summary | |
---|---|
protected OfBizDelegator |
ofBizDelegator
|
static String |
SCHEME
|
static String |
SCHEME_ASSOCIATION
|
Fields inherited from interface com.atlassian.jira.issue.fields.layout.field.FieldLayoutManager |
---|
TYPE_DEFAULT |
Constructor Summary | |
---|---|
DefaultFieldLayoutManager(FieldManager fieldManager,
OfBizDelegator ofBizDelegator)
|
Method Summary | |
---|---|
void |
addSchemeAssociation(org.ofbiz.core.entity.GenericValue project,
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(String schemeName)
Checks if a FieldConfigurationScheme with the given name exists. |
protected String |
getDefaultDescription(String fieldId)
|
protected List<FieldLayoutItem> |
getDefaultFieldLayoutItems()
|
EditableDefaultFieldLayout |
getEditableDefaultFieldLayout()
Returns the default EditableDefaultFieldLayout . |
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. |
Collection<FieldConfigurationScheme> |
getFieldConfigurationSchemes(FieldLayout fieldLayout)
Returns a collection of FieldConfigurationScheme s 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,
String issueTypeId)
|
FieldLayout |
getFieldLayout(Issue issue)
|
FieldLayout |
getFieldLayout(Long id)
Used to retrieve FieldLayout information when rendering a screen given the id
of the field layout. |
Collection<FieldLayoutSchemeEntity> |
getFieldLayoutSchemeEntities(FieldLayoutScheme fieldLayoutScheme)
Returns a collection of FieldLayoutSchemeEntity s. |
List<FieldLayoutScheme> |
getFieldLayoutSchemes()
Retries Field Configuration Schemes. |
protected I18nHelper |
getI18nHelper()
|
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 ). |
protected FieldLayout |
getRelevantFieldLayout(Long id)
Retrieves the field layout given a given id. |
Set<FieldLayout> |
getUniqueFieldLayouts(Project project)
Retrieves all the FieldLayout 's for a project. |
boolean |
hasDefaultFieldLayout()
Checks to see if a FieldLayout entity with type FieldLayoutManager.TYPE_DEFAULT exists |
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 |
refresh()
Clears all local caches. |
protected void |
refreshCaches(Long id)
|
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 |
restoreDefaultFieldLayout()
This method can be used to rollback any changes to the default field configuration. |
protected void |
restoreFieldLayout(Long id)
|
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)
THIS METHOD MUST BE SYNCHRONIZED!!!! So that only one thread updates the database at any one time. |
void |
updateFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
Persists the FieldLayoutScheme supplied. |
void |
updateFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
Updates a FieldLayoutSchemeEntity . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SCHEME
public static final String SCHEME_ASSOCIATION
protected OfBizDelegator ofBizDelegator
Constructor Detail |
---|
public DefaultFieldLayoutManager(FieldManager fieldManager, OfBizDelegator ofBizDelegator)
Method Detail |
---|
protected List<FieldLayoutItem> getDefaultFieldLayoutItems()
public FieldLayout getFieldLayout() throws FieldLayoutStorageException
FieldLayoutManager
FieldLayout
information when rendering a screen.
getFieldLayout
in interface FieldLayoutManager
FieldLayoutStorageException
- If there is a Data Layer error.public 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.
NOTE: This is an enterprise ONLY feature.
getFieldLayout
in interface FieldLayoutManager
id
- The FieldLayout ID.
FieldLayout
public FieldLayout getFieldLayout(org.ofbiz.core.entity.GenericValue issue) throws FieldLayoutStorageException
FieldLayoutManager
getFieldLayout
in interface FieldLayoutManager
issue
- An issue GenericValue
FieldLayout
FieldLayoutStorageException
- If there is a Data Layer error.public FieldLayout getFieldLayout(Issue issue) throws FieldLayoutStorageException
getFieldLayout
in interface FieldLayoutManager
issue
- An Issue
FieldLayout
FieldLayoutStorageException
- If there is a Data Layer error.FieldLayoutManager.getFieldLayout(org.ofbiz.core.entity.GenericValue)
public FieldLayout getFieldLayout(org.ofbiz.core.entity.GenericValue project, String issueTypeId) throws FieldLayoutStorageException
getFieldLayout
in interface FieldLayoutManager
project
- A project GenericValue
issueTypeId
- The IssueType id of the issue.
FieldLayout
FieldLayoutStorageException
- If there is a Data Layer error.FieldLayoutManager.getFieldLayout(org.ofbiz.core.entity.GenericValue)
public List<FieldLayoutScheme> getFieldLayoutSchemes() throws FieldLayoutStorageException
FieldLayoutManager
getFieldLayoutSchemes
in interface FieldLayoutManager
FieldLayoutScheme
s.
FieldLayoutStorageException
- If there is a Data Layer error.public void updateFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme) throws FieldLayoutStorageException
FieldLayoutManager
FieldLayoutScheme
supplied.
NOTE: This is an enterprise ONLY feature.
updateFieldLayoutScheme
in interface FieldLayoutManager
fieldLayoutScheme
- The FieldLayoutScheme
FieldLayoutStorageException
- If there is a Data Layer error.public void deleteFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme) throws FieldLayoutStorageException
FieldLayoutManager
FieldLayoutScheme
supplied.
NOTE: This is an enterprise ONLY feature.
deleteFieldLayoutScheme
in interface FieldLayoutManager
fieldLayoutScheme
- The FieldLayoutScheme
FieldLayoutStorageException
- If there is a Data Layer error.public EditableDefaultFieldLayout getEditableDefaultFieldLayout() throws FieldLayoutStorageException
FieldLayoutManager
EditableDefaultFieldLayout
.
getEditableDefaultFieldLayout
in interface FieldLayoutManager
EditableDefaultFieldLayout
.
FieldLayoutStorageException
- If there is a Data Layer error.public void storeEditableDefaultFieldLayout(EditableDefaultFieldLayout editableDefaultFieldLayout) throws FieldLayoutStorageException
FieldLayoutManager
EditableDefaultFieldLayout
storeEditableDefaultFieldLayout
in interface FieldLayoutManager
editableDefaultFieldLayout
- The EditableDefaultFieldLayout.
FieldLayoutStorageException
- If there is a Data Layer error.public void storeEditableFieldLayout(EditableFieldLayout editableFieldLayout) throws FieldLayoutStorageException
storeEditableFieldLayout
in interface FieldLayoutManager
editableFieldLayout
- editable default field layout
FieldLayoutStorageException
protected void refreshCaches(Long id)
public boolean hasDefaultFieldLayout() throws FieldLayoutStorageException
FieldLayoutManager
FieldLayout
entity with type FieldLayoutManager.TYPE_DEFAULT
exists
hasDefaultFieldLayout
in interface FieldLayoutManager
FieldLayout
exists, false otherwise.
FieldLayoutStorageException
- If there is a Data Layer error.public void restoreDefaultFieldLayout() throws FieldLayoutStorageException
FieldLayoutManager
restoreDefaultFieldLayout
in interface FieldLayoutManager
FieldLayoutStorageException
- If there is a Data Layer error.public void restoreSchemeFieldLayout(org.ofbiz.core.entity.GenericValue scheme) throws FieldLayoutStorageException
FieldLayoutManager
restoreSchemeFieldLayout
in interface FieldLayoutManager
scheme
- A scheme GenericValue
FieldLayoutStorageException
- If there is a Data Layer error.protected void restoreFieldLayout(Long id) throws FieldLayoutStorageException
FieldLayoutStorageException
public Collection<org.ofbiz.core.entity.GenericValue> getProjects(FieldConfigurationScheme fieldConfigurationScheme)
FieldLayoutManager
getProjects
in interface FieldLayoutManager
fieldConfigurationScheme
- the FieldConfigurationScheme
public Collection<org.ofbiz.core.entity.GenericValue> getProjects(FieldLayoutScheme fieldLayoutScheme) throws FieldLayoutStorageException
FieldLayoutManager
FieldLayoutScheme
supplied.
NOTE: This is an enterprise ONLY feature.
getProjects
in interface FieldLayoutManager
fieldLayoutScheme
- the FieldLayoutScheme
GenericValue
s
FieldLayoutStorageException
- If there is a Data Layer error.public FieldLayoutScheme createFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme) throws FieldLayoutStorageException
FieldLayoutManager
createFieldLayoutScheme
in interface FieldLayoutManager
fieldLayoutScheme
- The FieldLayoutScheme
to persist.
FieldLayoutScheme
object
FieldLayoutStorageException
- If there is a Data Layer error.public FieldConfigurationScheme getFieldConfigurationScheme(Long schemeId) throws FieldLayoutStorageException
FieldLayoutManager
FieldConfigurationScheme
by id
NOTE: This is an enterprise ONLY feature.
getFieldConfigurationScheme
in interface FieldLayoutManager
schemeId
- FieldConfigurationScheme ID
FieldConfigurationScheme
instance
FieldLayoutStorageException
- If there is a DB exception.public FieldConfigurationScheme getFieldConfigurationScheme(org.ofbiz.core.entity.GenericValue project) throws FieldLayoutStorageException
FieldLayoutManager
getFieldConfigurationScheme
in interface FieldLayoutManager
project
- A project GenericValue
FieldConfigurationScheme
or null if none exists.
FieldLayoutStorageException
- If there is a Data Layer error.public Set<FieldLayout> getUniqueFieldLayouts(Project project) throws FieldLayoutStorageException
FieldLayoutManager
FieldLayout
's for a project.
getUniqueFieldLayouts
in interface FieldLayoutManager
project
- a project
FieldLayoutStorageException
- If there is a Data Layer error.public FieldLayoutScheme getMutableFieldLayoutScheme(Long schemeId) throws FieldLayoutStorageException
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
schemeId
- the scheme ID
FieldLayoutScheme
instance
FieldLayoutStorageException
- if an error occurs in the DB layerpublic boolean fieldConfigurationSchemeExists(String schemeName) throws FieldLayoutStorageException
FieldLayoutManager
fieldConfigurationSchemeExists
in interface FieldLayoutManager
schemeName
- The scheme name
true
if a FieldConfigurationScheme with the given name exists.
FieldLayoutStorageException
- If there is a DB error.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
EditableFieldLayout
and EditableDefaultFieldLayout
public void addSchemeAssociation(org.ofbiz.core.entity.GenericValue project, Long fieldLayoutSchemeId) throws FieldLayoutStorageException
FieldLayoutManager
FieldLayoutScheme
to the project supplied.
NOTE: This is an enterprise ONLY feature.
addSchemeAssociation
in interface FieldLayoutManager
project
- A project GenericValue
fieldLayoutSchemeId
- ID of the FieldLayoutScheme
FieldLayoutStorageException
- If there is an error in the DB layerpublic void removeSchemeAssociation(org.ofbiz.core.entity.GenericValue project, Long fieldLayoutSchemeId) throws FieldLayoutStorageException
FieldLayoutManager
removeSchemeAssociation
in interface FieldLayoutManager
project
- A project GenericValue
fieldLayoutSchemeId
- The fieldLayoutScheme ID
FieldLayoutStorageException
- If there is an error in the DB layer.public void refresh()
FieldLayoutManager
refresh
in interface FieldLayoutManager
public EditableFieldLayout getEditableFieldLayout(Long id)
FieldLayoutManager
EditableFieldLayout
for the id supplied.
NOTE: This is an enterprise ONLY feature.
getEditableFieldLayout
in interface FieldLayoutManager
id
- If the id is NULL, the default layout is returned.
EditableFieldLayout
public void deleteFieldLayout(FieldLayout fieldLayout)
FieldLayoutManager
FieldLayout
NOTE: This is an enterprise ONLY feature.
deleteFieldLayout
in interface FieldLayoutManager
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
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
fieldLayoutSchemeEntity
- The FieldLayoutSchemeEntitypublic void updateFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
FieldLayoutManager
FieldLayoutSchemeEntity
.
NOTE: This is an enterprise ONLY feature.
updateFieldLayoutSchemeEntity
in interface FieldLayoutManager
fieldLayoutSchemeEntity
- The FieldLayoutSchemeEntitypublic void removeFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
FieldLayoutManager
FieldLayoutSchemeEntity
NOTE: This is an enterprise ONLY feature.
removeFieldLayoutSchemeEntity
in interface FieldLayoutManager
fieldLayoutSchemeEntity
- The FieldLayoutSchemeEntitypublic void removeFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
FieldLayoutManager
removeFieldLayoutScheme
in interface FieldLayoutManager
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
fieldLayout
- The FieldLayout.
FieldConfigurationScheme
spublic 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
fieldLayout
- The FieldLayout.
protected FieldLayout getRelevantFieldLayout(Long id) throws FieldLayoutStorageException
id
- field layout id
FieldLayoutStorageException
- if can not retrieve field layoutprotected String getDefaultDescription(String fieldId)
protected I18nHelper getI18nHelper()
public boolean isFieldLayoutSchemesVisiblyEquivalent(Long fieldConfigurationSchemeId1, Long fieldConfigurationSchemeId2) throws FieldLayoutStorageException
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
fieldConfigurationSchemeId1
- the first scheme; can use null
for the system default schemefieldConfigurationSchemeId2
- the second scheme; can use null
for the system default scheme
FieldLayoutStorageException
- If there is a Data Layer error.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
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |