com.atlassian.jira.issue.fields.layout.field
Class DefaultFieldLayoutManager

java.lang.Object
  extended by com.atlassian.jira.issue.fields.layout.field.DefaultFieldLayoutManager
All Implemented Interfaces:
FieldLayoutManager
Direct Known Subclasses:
EnterpriseFieldLayoutManager

public class DefaultFieldLayoutManager
extends Object
implements FieldLayoutManager


Field Summary
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)
           
 
Method Summary
 void addSchemeAssociation(org.ofbiz.core.entity.GenericValue project, FieldLayoutScheme fieldLayoutScheme)
          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.
protected  String getDefaultDesciption(String fieldId)
           
 EditableDefaultFieldLayout getEditableDefaultFieldLayout()
          Returns the default EditableDefaultFieldLayout.
 EditableFieldLayout getEditableFieldLayout(Long id)
          Returns an EditableFieldLayout for the id supplied.
 List getEditableFieldLayouts()
          Retrieves editable (see EditableFieldLayout versions of the field layouts.
 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.
 FieldLayoutScheme getFieldLayoutScheme(org.ofbiz.core.entity.GenericValue project)
          Retrieves the Field Configuration Scheme associated with the supplied project.
 FieldLayoutScheme getFieldLayoutScheme(Long schemeId)
          Retrieves a FieldLayoutScheme by id NOTE: This is an enterprise ONLY feature.
 FieldLayoutScheme getFieldLayoutScheme(String schemeName)
          Retrieves a FieldLayoutScheme by name NOTE: This is an enterprise ONLY feature.
 Collection getFieldLayoutSchemeEntities(FieldLayoutScheme fieldLayoutScheme)
          Returns a collection of FieldLayoutSchemeEntitys.
 List getFieldLayoutSchemes()
          Retries Field Configuration Schemes.
 Collection getFieldLayoutSchemes(EditableFieldLayout editableFieldLayout)
          Returns a collection of FieldLayoutSchemes that have the EditableFieldLayout supplied associated with them.
 Collection getProjects(FieldLayoutScheme fieldLayoutScheme)
          Returns all associated projects for the FieldLayoutScheme supplied.
 Collection getRelatedProjects(EditableFieldLayout editableFieldLayout)
          Finds all projects that have a certain EditableFieldLayout associated with them (via a FieldLayoutScheme.
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
 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, FieldLayoutScheme fieldLayoutScheme)
          Removes an association between a particular project and fieldlayoutscheme.
 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

SCHEME

public static final String SCHEME
See Also:
Constant Field Values

SCHEME_ASSOCIATION

public static final String SCHEME_ASSOCIATION
See Also:
Constant Field Values
Constructor Detail

DefaultFieldLayoutManager

public DefaultFieldLayoutManager(FieldManager fieldManager)
Method Detail

getFieldLayout

public FieldLayout getFieldLayout()
                           throws FieldLayoutStorageException
Description copied from interface: FieldLayoutManager
Used to retrieve FieldLayout information when rendering a screen.

Specified by:
getFieldLayout in interface FieldLayoutManager
Returns:
Throws:
FieldLayoutStorageException

getFieldLayout

public FieldLayout getFieldLayout(Long id)
Description copied from interface: FieldLayoutManager
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.

Specified by:
getFieldLayout in interface FieldLayoutManager
Returns:
A FieldLayout

getFieldLayout

public FieldLayout getFieldLayout(org.ofbiz.core.entity.GenericValue issue)
                           throws FieldLayoutStorageException
Description copied from interface: FieldLayoutManager
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.

Specified by:
getFieldLayout in interface FieldLayoutManager
Parameters:
issue - An issue GenericValue
Returns:
A FieldLayout
Throws:
FieldLayoutStorageException

getFieldLayout

public FieldLayout getFieldLayout(Issue issue)
                           throws FieldLayoutStorageException
Specified by:
getFieldLayout in interface FieldLayoutManager
Parameters:
issue - An Issue
Returns:
A FieldLayout
Throws:
FieldLayoutStorageException
See Also:
FieldLayoutManager.getFieldLayout(org.ofbiz.core.entity.GenericValue)

getFieldLayout

public FieldLayout getFieldLayout(org.ofbiz.core.entity.GenericValue project,
                                  String issueTypeId)
                           throws FieldLayoutStorageException
Specified by:
getFieldLayout in interface FieldLayoutManager
Parameters:
project - A project GenericValue
issueTypeId - The IssueType id of the issue.
Returns:
A FieldLayout
Throws:
FieldLayoutStorageException
See Also:
FieldLayoutManager.getFieldLayout(org.ofbiz.core.entity.GenericValue)

getFieldLayoutSchemes

public List getFieldLayoutSchemes()
                           throws FieldLayoutStorageException
Description copied from interface: FieldLayoutManager
Retries Field Configuration Schemes. These are used to link field configurations to projects. NOTE: This is an enterprise ONLY feature.

Specified by:
getFieldLayoutSchemes in interface FieldLayoutManager
Returns:
A list of FieldLayoutSchemes.
Throws:
FieldLayoutStorageException

updateFieldLayoutScheme

public void updateFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
                             throws FieldLayoutStorageException
Description copied from interface: FieldLayoutManager
Persists the FieldLayoutScheme supplied. NOTE: This is an enterprise ONLY feature.

Specified by:
updateFieldLayoutScheme in interface FieldLayoutManager
Throws:
FieldLayoutStorageException

deleteFieldLayoutScheme

public void deleteFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
                             throws FieldLayoutStorageException
Description copied from interface: FieldLayoutManager
Removes the FieldLayoutScheme supplied. NOTE: This is an enterprise ONLY feature.

Specified by:
deleteFieldLayoutScheme in interface FieldLayoutManager
Throws:
FieldLayoutStorageException

getEditableDefaultFieldLayout

public EditableDefaultFieldLayout getEditableDefaultFieldLayout()
                                                         throws FieldLayoutStorageException
Description copied from interface: FieldLayoutManager
Returns the default EditableDefaultFieldLayout.

Specified by:
getEditableDefaultFieldLayout in interface FieldLayoutManager
Returns:
Throws:
FieldLayoutStorageException

storeEditableDefaultFieldLayout

public void storeEditableDefaultFieldLayout(EditableDefaultFieldLayout editableDefaultFieldLayout)
                                     throws FieldLayoutStorageException
Description copied from interface: FieldLayoutManager
Persist the given default EditableDefaultFieldLayout

Specified by:
storeEditableDefaultFieldLayout in interface FieldLayoutManager
Throws:
FieldLayoutStorageException

storeEditableFieldLayout

public void storeEditableFieldLayout(EditableFieldLayout editableFieldLayout)
                              throws FieldLayoutStorageException
THIS METHOD MUST BE SYNCHRONIZED!!!! So that only one thread updates the database at any one time. "Fields are duplicated" if this method is not synchronized.

Specified by:
storeEditableFieldLayout in interface FieldLayoutManager
Parameters:
editableFieldLayout - editable default field layout
Throws:
FieldLayoutStorageException

refreshCaches

protected void refreshCaches(Long id)

hasDefaultFieldLayout

public boolean hasDefaultFieldLayout()
                              throws FieldLayoutStorageException
Description copied from interface: FieldLayoutManager
Checks to see if a FieldLayout entity with type FieldLayoutManager.TYPE_DEFAULT exists

Specified by:
hasDefaultFieldLayout in interface FieldLayoutManager
Returns:
True if a default FieldLayout exists, false otherwise.
Throws:
FieldLayoutStorageException

restoreDefaultFieldLayout

public void restoreDefaultFieldLayout()
                               throws FieldLayoutStorageException
Description copied from interface: FieldLayoutManager
This method can be used to rollback any changes to the default field configuration.

Specified by:
restoreDefaultFieldLayout in interface FieldLayoutManager
Throws:
FieldLayoutStorageException

restoreSchemeFieldLayout

public void restoreSchemeFieldLayout(org.ofbiz.core.entity.GenericValue scheme)
                              throws FieldLayoutStorageException
Description copied from interface: FieldLayoutManager
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.

Specified by:
restoreSchemeFieldLayout in interface FieldLayoutManager
Parameters:
scheme - A scheme GenericValue
Throws:
FieldLayoutStorageException

restoreFieldLayout

protected void restoreFieldLayout(Long id)
                           throws FieldLayoutStorageException
Throws:
FieldLayoutStorageException

getProjects

public Collection getProjects(FieldLayoutScheme fieldLayoutScheme)
                       throws FieldLayoutStorageException
Description copied from interface: FieldLayoutManager
Returns all associated projects for the FieldLayoutScheme supplied. NOTE: This is an enterprise ONLY feature.

Specified by:
getProjects in interface FieldLayoutManager
Returns:
A list of project GenericValues
Throws:
FieldLayoutStorageException

createFieldLayoutScheme

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

Specified by:
createFieldLayoutScheme in interface FieldLayoutManager
Parameters:
fieldLayoutScheme - The FieldLayoutScheme to persist.
Returns:
The stored FieldLayoutScheme object
Throws:
FieldLayoutStorageException

getFieldLayoutScheme

public FieldLayoutScheme getFieldLayoutScheme(Long schemeId)
                                       throws FieldLayoutStorageException
Description copied from interface: FieldLayoutManager
Retrieves a FieldLayoutScheme by id NOTE: This is an enterprise ONLY feature.

Specified by:
getFieldLayoutScheme in interface FieldLayoutManager
Returns:
A FieldLayoutScheme instance
Throws:
FieldLayoutStorageException

getFieldLayoutScheme

public FieldLayoutScheme getFieldLayoutScheme(String schemeName)
                                       throws FieldLayoutStorageException
Description copied from interface: FieldLayoutManager
Retrieves a FieldLayoutScheme by name NOTE: This is an enterprise ONLY feature.

Specified by:
getFieldLayoutScheme in interface FieldLayoutManager
Returns:
A FieldLayoutScheme instance
Throws:
FieldLayoutStorageException

getEditableFieldLayouts

public List getEditableFieldLayouts()
Description copied from interface: FieldLayoutManager
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)

Specified by:
getEditableFieldLayouts in interface FieldLayoutManager
Returns:
A list of EditableFieldLayout and EditableDefaultFieldLayout

getFieldLayoutScheme

public FieldLayoutScheme getFieldLayoutScheme(org.ofbiz.core.entity.GenericValue project)
                                       throws FieldLayoutStorageException,
                                              org.ofbiz.core.entity.GenericEntityException
Description copied from interface: FieldLayoutManager
Retrieves the Field Configuration Scheme associated with the supplied project. NOTE: This is an enterprise ONLY feature.

Specified by:
getFieldLayoutScheme in interface FieldLayoutManager
Parameters:
project - A project GenericValue
Returns:
A FieldLayoutScheme or null if none exists.
Throws:
FieldLayoutStorageException
org.ofbiz.core.entity.GenericEntityException

addSchemeAssociation

public void addSchemeAssociation(org.ofbiz.core.entity.GenericValue project,
                                 FieldLayoutScheme fieldLayoutScheme)
                          throws FieldLayoutStorageException,
                                 org.ofbiz.core.entity.GenericEntityException
Description copied from interface: FieldLayoutManager
Associates a FieldLayoutScheme to the project supplied. NOTE: This is an enterprise ONLY feature.

Specified by:
addSchemeAssociation in interface FieldLayoutManager
Parameters:
project - A project GenericValue
Throws:
FieldLayoutStorageException
org.ofbiz.core.entity.GenericEntityException

removeSchemeAssociation

public void removeSchemeAssociation(org.ofbiz.core.entity.GenericValue project,
                                    FieldLayoutScheme fieldLayoutScheme)
                             throws FieldLayoutStorageException,
                                    org.ofbiz.core.entity.GenericEntityException
Description copied from interface: FieldLayoutManager
Removes an association between a particular project and fieldlayoutscheme. NOTE: This is an enterprise ONLY feature.

Specified by:
removeSchemeAssociation in interface FieldLayoutManager
Parameters:
project - A project GenericValue
Throws:
FieldLayoutStorageException
org.ofbiz.core.entity.GenericEntityException

refresh

public void refresh()
Description copied from interface: FieldLayoutManager
Clears all local caches.

Specified by:
refresh in interface FieldLayoutManager

getEditableFieldLayout

public EditableFieldLayout getEditableFieldLayout(Long id)
Description copied from interface: FieldLayoutManager
Returns an EditableFieldLayout for the id supplied. NOTE: This is an enterprise ONLY feature.

Specified by:
getEditableFieldLayout in interface FieldLayoutManager
Parameters:
id - If the id is NULL, the default layout is returned.
Returns:
An EditableFieldLayout

deleteFieldLayout

public void deleteFieldLayout(FieldLayout fieldLayout)
Description copied from interface: FieldLayoutManager
Deletes a custom FieldLayout NOTE: This is an enterprise ONLY feature.

Specified by:
deleteFieldLayout in interface FieldLayoutManager

getFieldLayoutSchemeEntities

public Collection getFieldLayoutSchemeEntities(FieldLayoutScheme fieldLayoutScheme)
Description copied from interface: FieldLayoutManager
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.

Specified by:
getFieldLayoutSchemeEntities in interface FieldLayoutManager
Returns:
A collection of FieldLayoutSchemeEntitys.

createFieldLayoutSchemeEntity

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

Specified by:
createFieldLayoutSchemeEntity in interface FieldLayoutManager

updateFieldLayoutSchemeEntity

public void updateFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
Description copied from interface: FieldLayoutManager
Updates a FieldLayoutSchemeEntity. NOTE: This is an enterprise ONLY feature.

Specified by:
updateFieldLayoutSchemeEntity in interface FieldLayoutManager

removeFieldLayoutSchemeEntity

public void removeFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
Description copied from interface: FieldLayoutManager
Removes a FieldLayoutSchemeEntity NOTE: This is an enterprise ONLY feature.

Specified by:
removeFieldLayoutSchemeEntity in interface FieldLayoutManager

removeFieldLayoutScheme

public void removeFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
Description copied from interface: FieldLayoutManager
NOTE: This is an enterprise ONLY feature.

Specified by:
removeFieldLayoutScheme in interface FieldLayoutManager

getFieldLayoutSchemes

public Collection getFieldLayoutSchemes(EditableFieldLayout editableFieldLayout)
Description copied from interface: FieldLayoutManager
Returns a collection of FieldLayoutSchemes that have the EditableFieldLayout supplied associated with them. This is determined by retrieving all FieldLayoutSchemeEntitys with the EditableFieldLayout and calculating a set of FieldLayoutSchemes associated with these entities. NOTE: This is an enterprise ONLY feature.

Specified by:
getFieldLayoutSchemes in interface FieldLayoutManager
Returns:
A collection of FieldLayoutSchemes

getRelatedProjects

public Collection getRelatedProjects(EditableFieldLayout editableFieldLayout)
Description copied from interface: FieldLayoutManager
Finds all projects that have a certain EditableFieldLayout associated with them (via a FieldLayoutScheme.

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

Specified by:
getRelatedProjects in interface FieldLayoutManager
Returns:

getRelevantFieldLayout

protected FieldLayout getRelevantFieldLayout(Long id)
                                      throws FieldLayoutStorageException
Retrieves the field layout given a given id. If the id is null the default field layout is retrieved

Parameters:
id - field layout id
Returns:
field layout
Throws:
FieldLayoutStorageException - if can not retrieve field layout

getDefaultDesciption

protected String getDefaultDesciption(String fieldId)


Copyright © 2002-2009 Atlassian. All Rights Reserved.