|
||||||||||
| 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.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 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,
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 FieldLayoutSchemeEntitys. |
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. |
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 FieldLayoutSchemes are
"visibly equivalent". |
boolean |
isFieldLayoutsVisiblyEquivalent(Long fieldLayoutId1,
Long fieldLayoutId2)
Will determine whether or not two FieldLayouts 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
FieldLayoutManagerFieldLayout information when rendering a screen.
getFieldLayout in interface FieldLayoutManagerFieldLayoutStorageException - If there is a Data Layer error.public FieldLayout getFieldLayout(Long id)
FieldLayoutManagerFieldLayout 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 FieldLayoutManagerid - The FieldLayout ID.
FieldLayout
public FieldLayout getFieldLayout(org.ofbiz.core.entity.GenericValue issue)
throws FieldLayoutStorageException
FieldLayoutManager
getFieldLayout in interface FieldLayoutManagerissue - An issue GenericValue
FieldLayout
FieldLayoutStorageException - If there is a Data Layer error.
public FieldLayout getFieldLayout(Issue issue)
throws FieldLayoutStorageException
getFieldLayout in interface FieldLayoutManagerissue - 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 FieldLayoutManagerproject - A project GenericValueissueTypeId - 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 FieldLayoutManagerFieldLayoutSchemes.
FieldLayoutStorageException - If there is a Data Layer error.
public void updateFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
throws FieldLayoutStorageException
FieldLayoutManagerFieldLayoutScheme supplied.
NOTE: This is an enterprise ONLY feature.
updateFieldLayoutScheme in interface FieldLayoutManagerfieldLayoutScheme - The FieldLayoutScheme
FieldLayoutStorageException - If there is a Data Layer error.
public void deleteFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
throws FieldLayoutStorageException
FieldLayoutManagerFieldLayoutScheme supplied.
NOTE: This is an enterprise ONLY feature.
deleteFieldLayoutScheme in interface FieldLayoutManagerfieldLayoutScheme - The FieldLayoutScheme
FieldLayoutStorageException - If there is a Data Layer error.
public EditableDefaultFieldLayout getEditableDefaultFieldLayout()
throws FieldLayoutStorageException
FieldLayoutManagerEditableDefaultFieldLayout.
getEditableDefaultFieldLayout in interface FieldLayoutManagerEditableDefaultFieldLayout.
FieldLayoutStorageException - If there is a Data Layer error.
public void storeEditableDefaultFieldLayout(EditableDefaultFieldLayout editableDefaultFieldLayout)
throws FieldLayoutStorageException
FieldLayoutManagerEditableDefaultFieldLayout
storeEditableDefaultFieldLayout in interface FieldLayoutManagereditableDefaultFieldLayout - The EditableDefaultFieldLayout.
FieldLayoutStorageException - If there is a Data Layer error.
public void storeEditableFieldLayout(EditableFieldLayout editableFieldLayout)
throws FieldLayoutStorageException
storeEditableFieldLayout in interface FieldLayoutManagereditableFieldLayout - editable default field layout
FieldLayoutStorageExceptionprotected void refreshCaches(Long id)
public boolean hasDefaultFieldLayout()
throws FieldLayoutStorageException
FieldLayoutManagerFieldLayout entity with type FieldLayoutManager.TYPE_DEFAULT exists
hasDefaultFieldLayout in interface FieldLayoutManagerFieldLayout exists, false otherwise.
FieldLayoutStorageException - If there is a Data Layer error.
public void restoreDefaultFieldLayout()
throws FieldLayoutStorageException
FieldLayoutManager
restoreDefaultFieldLayout in interface FieldLayoutManagerFieldLayoutStorageException - If there is a Data Layer error.
public void restoreSchemeFieldLayout(org.ofbiz.core.entity.GenericValue scheme)
throws FieldLayoutStorageException
FieldLayoutManager
restoreSchemeFieldLayout in interface FieldLayoutManagerscheme - A scheme GenericValue
FieldLayoutStorageException - If there is a Data Layer error.
protected void restoreFieldLayout(Long id)
throws FieldLayoutStorageException
FieldLayoutStorageExceptionpublic Collection<org.ofbiz.core.entity.GenericValue> getProjects(FieldConfigurationScheme fieldConfigurationScheme)
FieldLayoutManager
getProjects in interface FieldLayoutManagerfieldConfigurationScheme - the FieldConfigurationScheme
public Collection<org.ofbiz.core.entity.GenericValue> getProjects(FieldLayoutScheme fieldLayoutScheme)
throws FieldLayoutStorageException
FieldLayoutManagerFieldLayoutScheme supplied.
NOTE: This is an enterprise ONLY feature.
getProjects in interface FieldLayoutManagerfieldLayoutScheme - the FieldLayoutScheme
GenericValues
FieldLayoutStorageException - If there is a Data Layer error.
public FieldLayoutScheme createFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
throws FieldLayoutStorageException
FieldLayoutManager
createFieldLayoutScheme in interface FieldLayoutManagerfieldLayoutScheme - The FieldLayoutScheme to persist.
FieldLayoutScheme object
FieldLayoutStorageException - If there is a Data Layer error.
public FieldConfigurationScheme getFieldConfigurationScheme(Long schemeId)
throws FieldLayoutStorageException
FieldLayoutManagerFieldConfigurationScheme by id
NOTE: This is an enterprise ONLY feature.
getFieldConfigurationScheme in interface FieldLayoutManagerschemeId - 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 FieldLayoutManagerproject - A project GenericValue
FieldConfigurationScheme or null if none exists.
FieldLayoutStorageException - If there is a Data Layer error.
public FieldLayoutScheme getMutableFieldLayoutScheme(Long schemeId)
throws FieldLayoutStorageException
FieldLayoutManagerFieldLayoutScheme 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 FieldLayoutManagerschemeId - the scheme ID
FieldLayoutScheme instance
FieldLayoutStorageException - if an error occurs in the DB layer
public boolean fieldConfigurationSchemeExists(String schemeName)
throws FieldLayoutStorageException
FieldLayoutManager
fieldConfigurationSchemeExists in interface FieldLayoutManagerschemeName - The scheme name
true if a FieldConfigurationScheme with the given name exists.
FieldLayoutStorageException - If there is a DB error.public List<EditableFieldLayout> getEditableFieldLayouts()
FieldLayoutManagerEditableFieldLayout 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 FieldLayoutManagerEditableFieldLayout and EditableDefaultFieldLayout
public void addSchemeAssociation(org.ofbiz.core.entity.GenericValue project,
Long fieldLayoutSchemeId)
throws FieldLayoutStorageException
FieldLayoutManagerFieldLayoutScheme to the project supplied.
NOTE: This is an enterprise ONLY feature.
addSchemeAssociation in interface FieldLayoutManagerproject - A project GenericValuefieldLayoutSchemeId - ID of the FieldLayoutScheme
FieldLayoutStorageException - If there is an error in the DB layer
public void removeSchemeAssociation(org.ofbiz.core.entity.GenericValue project,
Long fieldLayoutSchemeId)
throws FieldLayoutStorageException
FieldLayoutManager
removeSchemeAssociation in interface FieldLayoutManagerproject - A project GenericValuefieldLayoutSchemeId - The fieldLayoutScheme ID
FieldLayoutStorageException - If there is an error in the DB layer.public void refresh()
FieldLayoutManager
refresh in interface FieldLayoutManagerpublic EditableFieldLayout getEditableFieldLayout(Long id)
FieldLayoutManagerEditableFieldLayout for the id supplied.
NOTE: This is an enterprise ONLY feature.
getEditableFieldLayout in interface FieldLayoutManagerid - If the id is NULL, the default layout is returned.
EditableFieldLayoutpublic void deleteFieldLayout(FieldLayout fieldLayout)
FieldLayoutManagerFieldLayout
NOTE: This is an enterprise ONLY feature.
deleteFieldLayout in interface FieldLayoutManagerfieldLayout - The FieldLayoutpublic Collection<FieldLayoutSchemeEntity> getFieldLayoutSchemeEntities(FieldLayoutScheme fieldLayoutScheme)
FieldLayoutManagerFieldLayoutSchemeEntitys. These are used to
record mappings from IssueType -> FieldLayout
for the FieldLayoutScheme passed in.
NOTE: This is an enterprise ONLY feature.
getFieldLayoutSchemeEntities in interface FieldLayoutManagerfieldLayoutScheme - The FieldLayoutScheme
FieldLayoutSchemeEntitys.public void createFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
FieldLayoutManagerFieldLayoutSchemeEntity for a particular FieldLayoutScheme.
The appropriate scheme is retrieved using FieldLayoutSchemeEntity.getFieldLayoutScheme()
NOTE: This is an enterprise ONLY feature.
createFieldLayoutSchemeEntity in interface FieldLayoutManagerfieldLayoutSchemeEntity - The FieldLayoutSchemeEntitypublic void updateFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
FieldLayoutManagerFieldLayoutSchemeEntity.
NOTE: This is an enterprise ONLY feature.
updateFieldLayoutSchemeEntity in interface FieldLayoutManagerfieldLayoutSchemeEntity - The FieldLayoutSchemeEntitypublic void removeFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
FieldLayoutManagerFieldLayoutSchemeEntity
NOTE: This is an enterprise ONLY feature.
removeFieldLayoutSchemeEntity in interface FieldLayoutManagerfieldLayoutSchemeEntity - The FieldLayoutSchemeEntitypublic void removeFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
FieldLayoutManager
removeFieldLayoutScheme in interface FieldLayoutManagerfieldLayoutScheme - The FieldLayoutSchemepublic Collection<FieldConfigurationScheme> getFieldConfigurationSchemes(FieldLayout fieldLayout)
FieldLayoutManagerFieldConfigurationSchemes 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.
getFieldConfigurationSchemes in interface FieldLayoutManagerfieldLayout - The FieldLayout.
FieldConfigurationSchemespublic Collection<org.ofbiz.core.entity.GenericValue> getRelatedProjects(FieldLayout fieldLayout)
FieldLayoutManagerFieldLayout (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 FieldLayoutManagerfieldLayout - 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
FieldLayoutManagerFieldLayoutSchemes 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 FieldLayoutManagerfieldConfigurationSchemeId1 - 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)
FieldLayoutManagerFieldLayouts 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 FieldLayoutManagerfieldLayoutId1 - 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 | |||||||||