public class MockFieldLayoutManager extends Object implements FieldLayoutManager
MockFieldLayoutManager.TYPE_DEFAULT| Constructor and Description |
|---|
MockFieldLayoutManager() |
| Modifier and Type | Method and Description |
|---|---|
MockFieldLayout |
addLayoutItem(Issue issue) |
void |
addSchemeAssociation(org.ofbiz.core.entity.GenericValue project,
Long fieldLayoutSchemeId)
Associates a
FieldLayoutScheme to the project supplied. |
void |
addSchemeAssociation(Project project,
Long fieldLayoutSchemeId)
Associates a
FieldLayoutScheme to the project supplied. |
FieldLayoutScheme |
copyFieldLayoutScheme(FieldLayoutScheme scheme,
String name,
String description)
Copies an existing field layout to a new one.
|
FieldLayoutScheme |
createFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
Persists a new field Layout scheme (i.e Field Configuration Scheme).
|
FieldLayoutScheme |
createFieldLayoutScheme(String name,
String description)
Persists a new field Layout scheme (i.e Field Configuration Scheme).
|
void |
createFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
Persists a new
FieldLayoutSchemeEntity for a particular FieldLayoutScheme. |
FieldLayoutSchemeEntity |
createFieldLayoutSchemeEntity(FieldLayoutScheme fieldLayoutScheme,
String issueTypeId,
Long fieldConfigurationId)
Persists a new
FieldLayoutSchemeEntity for a particular FieldLayoutScheme. |
void |
deleteFieldLayout(FieldLayout fieldLayout)
Deletes a custom
FieldLayout |
void |
deleteFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
Removes the
FieldLayoutScheme supplied. |
boolean |
fieldConfigurationSchemeExists(String schemeName)
Checks if a FieldConfigurationScheme with the given name exists.
|
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(Long schemeId)
Retrieves a
FieldConfigurationScheme by id |
FieldConfigurationScheme |
getFieldConfigurationScheme(Project project)
Retrieves the Field Configuration Scheme associated with the supplied project.
|
FieldConfigurationScheme |
getFieldConfigurationSchemeForProject(Long projectId)
Retrieves the Field Configuration Scheme associated with the supplied project.
|
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(Issue issue)
Returns the fieldLayout for an issue.
|
FieldLayout |
getFieldLayout(Long id)
Used to retrieve
FieldLayout information when rendering a screen given the id
of the field layout. |
FieldLayout |
getFieldLayout(Long projectId,
String issueTypeId)
Find the FieldLayout for the given Project and IssueType.
|
FieldLayout |
getFieldLayout(Project project,
String issueTypeId) |
Collection<FieldLayoutSchemeEntity> |
getFieldLayoutSchemeEntities(FieldLayoutScheme fieldLayoutScheme)
Returns a collection of
FieldLayoutSchemeEntitys. |
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<Project> |
getProjectsUsing(FieldConfigurationScheme fieldConfigurationScheme)
Returns all projects that use the given FieldConfigurationScheme.
|
Collection<Project> |
getProjectsUsing(FieldLayout fieldLayout)
Finds all projects that use the given
FieldLayout (via the configured FieldConfigurationScheme). |
Collection<Project> |
getProjectsUsing(FieldLayoutScheme fieldLayoutScheme)
Returns all projects that use the given FieldLayoutScheme.
|
Collection<org.ofbiz.core.entity.GenericValue> |
getRelatedProjects(FieldLayout fieldLayout)
Finds all projects that use the given
FieldLayout (via the configured FieldConfigurationScheme). |
Set<FieldLayout> |
getUniqueFieldLayouts(Collection<Project> projects,
Collection<String> issueTypeIds)
Retrieves all the
FieldLayout's for a collection of projects and issue types. |
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
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.
|
void |
removeFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme) |
void |
removeFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
Removes a
FieldLayoutSchemeEntity |
void |
removeSchemeAssociation(org.ofbiz.core.entity.GenericValue project,
Long fieldLayoutSchemeId)
Removes an association between a particular project and field configuration scheme.
|
void |
removeSchemeAssociation(Project 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.
|
MockFieldLayoutManager |
setFieldConfigurationScheme(Long id,
FieldConfigurationScheme fieldConfigurationScheme) |
MockFieldLayoutManager |
setFieldConfigurationScheme(Project project,
FieldConfigurationScheme fieldConfigurationScheme) |
MockFieldLayoutManager |
setFieldLayout(Long id,
FieldLayout fieldLayout) |
MockFieldLayoutManager |
setFieldLayout(Project project,
String issueTypeId,
FieldLayout fieldLayout) |
MockFieldLayoutManager |
setFieldLayoutSchemes(List<FieldLayoutScheme> fieldLayoutSchemes) |
EditableFieldLayout |
storeAndReturnEditableFieldLayout(EditableFieldLayout editableFieldLayout)
Persists the
EditableFieldLayout provided and returns a new instance as stored
in the database. |
void |
storeEditableDefaultFieldLayout(EditableDefaultFieldLayout editableDefaultFieldLayout)
Persist the given default
EditableDefaultFieldLayout |
void |
storeEditableFieldLayout(EditableFieldLayout editableFieldLayout)
Persists the
EditableFieldLayout provided. |
String |
toString() |
void |
updateFieldLayoutItemAttributesForCustomField(CustomField customField,
String description,
boolean isRequired,
boolean isHidden)
Update the
description, isHidden and isRequired columns of all the
fieldlayoutitem rows associated with this custom field. |
void |
updateFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
Persists the
FieldLayoutScheme supplied. |
void |
updateFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
Updates a
FieldLayoutSchemeEntity. |
public MockFieldLayout addLayoutItem(Issue issue)
public FieldLayoutScheme createFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
FieldLayoutManagercreateFieldLayoutScheme in interface FieldLayoutManagerfieldLayoutScheme - The FieldLayoutScheme to persist.FieldLayoutScheme objectpublic FieldLayoutScheme createFieldLayoutScheme(@Nonnull String name, @Nullable String description)
FieldLayoutManagercreateFieldLayoutScheme in interface FieldLayoutManagerpublic FieldLayoutScheme copyFieldLayoutScheme(@Nonnull FieldLayoutScheme scheme, @Nonnull String name, @Nullable String description)
FieldLayoutManagercopyFieldLayoutScheme in interface FieldLayoutManagerpublic FieldConfigurationScheme getFieldConfigurationScheme(Long schemeId)
FieldLayoutManagerFieldConfigurationScheme by idgetFieldConfigurationScheme in interface FieldLayoutManagerschemeId - FieldConfigurationScheme IDFieldConfigurationScheme instancepublic FieldLayoutScheme getMutableFieldLayoutScheme(Long schemeId)
FieldLayoutManagerFieldLayoutScheme by id.
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 IDFieldLayoutScheme instancepublic boolean fieldConfigurationSchemeExists(String schemeName)
FieldLayoutManagerfieldConfigurationSchemeExists in interface FieldLayoutManagerschemeName - The scheme nametrue if a FieldConfigurationScheme with the given name exists.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 EditableDefaultFieldLayoutpublic List<FieldLayoutScheme> getFieldLayoutSchemes()
FieldLayoutManagergetFieldLayoutSchemes in interface FieldLayoutManagerFieldLayoutSchemes.public MockFieldLayoutManager setFieldLayoutSchemes(List<FieldLayoutScheme> fieldLayoutSchemes)
public void updateFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
FieldLayoutManagerFieldLayoutScheme supplied.updateFieldLayoutScheme in interface FieldLayoutManagerfieldLayoutScheme - The FieldLayoutSchemepublic void deleteFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
FieldLayoutManagerFieldLayoutScheme supplied.deleteFieldLayoutScheme in interface FieldLayoutManagerfieldLayoutScheme - The FieldLayoutSchemepublic FieldConfigurationScheme getFieldConfigurationScheme(Project project)
FieldLayoutManagergetFieldConfigurationScheme in interface FieldLayoutManagerproject - A projectFieldConfigurationScheme or null if none exists.public FieldConfigurationScheme getFieldConfigurationSchemeForProject(@Nonnull Long projectId)
FieldLayoutManagergetFieldConfigurationSchemeForProject in interface FieldLayoutManagerprojectId - The project IDFieldConfigurationScheme or null if none exists.public MockFieldLayoutManager setFieldConfigurationScheme(Project project, FieldConfigurationScheme fieldConfigurationScheme)
public MockFieldLayoutManager setFieldConfigurationScheme(Long id, FieldConfigurationScheme fieldConfigurationScheme)
public Set<FieldLayout> getUniqueFieldLayouts(Project project)
FieldLayoutManagerFieldLayout's for a project.getUniqueFieldLayouts in interface FieldLayoutManagerproject - a project@Nonnull public Set<FieldLayout> getUniqueFieldLayouts(@Nonnull Collection<Project> projects, @Nonnull Collection<String> issueTypeIds)
FieldLayoutManagerFieldLayout's for a collection of projects and issue types.getUniqueFieldLayouts in interface FieldLayoutManagerprojects - a collection of projects.issueTypeIds - An collection of issue type ids.public void addSchemeAssociation(org.ofbiz.core.entity.GenericValue project,
Long fieldLayoutSchemeId)
FieldLayoutManagerFieldLayoutScheme to the project supplied.addSchemeAssociation in interface FieldLayoutManagerproject - A project GenericValuefieldLayoutSchemeId - ID of the FieldLayoutSchemepublic void removeSchemeAssociation(org.ofbiz.core.entity.GenericValue project,
Long fieldLayoutSchemeId)
FieldLayoutManagerremoveSchemeAssociation in interface FieldLayoutManagerproject - A project GenericValuefieldLayoutSchemeId - The fieldLayoutScheme IDpublic void addSchemeAssociation(Project project, Long fieldLayoutSchemeId)
FieldLayoutManagerFieldLayoutScheme to the project supplied.addSchemeAssociation in interface FieldLayoutManagerproject - The projectfieldLayoutSchemeId - ID of the FieldLayoutSchemepublic void removeSchemeAssociation(Project project, Long fieldLayoutSchemeId)
FieldLayoutManagerremoveSchemeAssociation in interface FieldLayoutManagerproject - The projectfieldLayoutSchemeId - The fieldLayoutScheme IDpublic FieldLayout getFieldLayout()
FieldLayoutManagerFieldLayout information when rendering a screen.getFieldLayout in interface FieldLayoutManagerpublic 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.getFieldLayout in interface FieldLayoutManagerid - The FieldLayout ID.FieldLayoutpublic MockFieldLayoutManager setFieldLayout(Long id, FieldLayout fieldLayout)
public FieldLayout getFieldLayout(org.ofbiz.core.entity.GenericValue issue)
FieldLayoutManagergetFieldLayout in interface FieldLayoutManagerissue - An issue GenericValueFieldLayoutpublic FieldLayout getFieldLayout(Issue issue)
FieldLayoutManagergetFieldLayout in interface FieldLayoutManagerissue - An IssueFieldLayoutpublic FieldLayout getFieldLayout(Project project, String issueTypeId)
getFieldLayout in interface FieldLayoutManagerproject - A projectissueTypeId - The IssueType id of the issue.FieldLayoutFieldLayoutManager.getFieldLayout(Issue)public FieldLayout getFieldLayout(@Nonnull Long projectId, @Nonnull String issueTypeId)
FieldLayoutManagergetFieldLayout in interface FieldLayoutManagerprojectId - the projectissueTypeId - the issue typepublic MockFieldLayoutManager setFieldLayout(Project project, String issueTypeId, FieldLayout fieldLayout)
public EditableDefaultFieldLayout getEditableDefaultFieldLayout()
FieldLayoutManagerEditableDefaultFieldLayout.getEditableDefaultFieldLayout in interface FieldLayoutManagerEditableDefaultFieldLayout.public void storeEditableDefaultFieldLayout(EditableDefaultFieldLayout editableDefaultFieldLayout)
FieldLayoutManagerEditableDefaultFieldLayoutstoreEditableDefaultFieldLayout in interface FieldLayoutManagereditableDefaultFieldLayout - The EditableDefaultFieldLayout.public void storeEditableFieldLayout(EditableFieldLayout editableFieldLayout)
FieldLayoutManagerEditableFieldLayout provided.storeEditableFieldLayout in interface FieldLayoutManagereditableFieldLayout - the EditableFieldLayout.public EditableFieldLayout storeAndReturnEditableFieldLayout(EditableFieldLayout editableFieldLayout)
FieldLayoutManagerEditableFieldLayout provided and returns a new instance as stored
in the database.storeAndReturnEditableFieldLayout in interface FieldLayoutManagereditableFieldLayout - the EditableFieldLayout.public void restoreDefaultFieldLayout()
FieldLayoutManagerrestoreDefaultFieldLayout in interface FieldLayoutManagerpublic boolean hasDefaultFieldLayout()
FieldLayoutManagerFieldLayout entity with type FieldLayoutManager.TYPE_DEFAULT existshasDefaultFieldLayout in interface FieldLayoutManagerFieldLayout exists, false otherwise.public Collection<org.ofbiz.core.entity.GenericValue> getProjects(FieldConfigurationScheme fieldConfigurationScheme)
FieldLayoutManagergetProjects in interface FieldLayoutManagerfieldConfigurationScheme - the FieldConfigurationSchemepublic Collection<Project> getProjectsUsing(FieldConfigurationScheme fieldConfigurationScheme)
FieldLayoutManagergetProjectsUsing in interface FieldLayoutManagerfieldConfigurationScheme - the FieldConfigurationSchemepublic Collection<org.ofbiz.core.entity.GenericValue> getProjects(FieldLayoutScheme fieldLayoutScheme)
FieldLayoutManagerFieldLayoutScheme supplied.getProjects in interface FieldLayoutManagerfieldLayoutScheme - the FieldLayoutSchemeGenericValuespublic Collection<Project> getProjectsUsing(FieldLayoutScheme fieldLayoutScheme)
FieldLayoutManagergetProjectsUsing in interface FieldLayoutManagerfieldLayoutScheme - the FieldLayoutSchemepublic void refresh()
FieldLayoutManagerrefresh in interface FieldLayoutManagerpublic EditableFieldLayout getEditableFieldLayout(Long id)
FieldLayoutManagerEditableFieldLayout for the id supplied.getEditableFieldLayout in interface FieldLayoutManagerid - If the id is NULL, the default layout is returned.EditableFieldLayoutpublic void deleteFieldLayout(FieldLayout fieldLayout)
FieldLayoutManagerFieldLayoutdeleteFieldLayout 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.getFieldLayoutSchemeEntities in interface FieldLayoutManagerfieldLayoutScheme - The FieldLayoutSchemeFieldLayoutSchemeEntitys.public void createFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
FieldLayoutManagerFieldLayoutSchemeEntity for a particular FieldLayoutScheme.
The appropriate scheme is retrieved using FieldLayoutSchemeEntity.getFieldLayoutScheme()createFieldLayoutSchemeEntity in interface FieldLayoutManagerfieldLayoutSchemeEntity - The FieldLayoutSchemeEntitypublic FieldLayoutSchemeEntity createFieldLayoutSchemeEntity(FieldLayoutScheme fieldLayoutScheme, String issueTypeId, Long fieldConfigurationId)
FieldLayoutManagerFieldLayoutSchemeEntity for a particular FieldLayoutScheme.
The appropriate scheme is retrieved using FieldLayoutSchemeEntity.getFieldLayoutScheme()createFieldLayoutSchemeEntity in interface FieldLayoutManagerfieldLayoutScheme - the FieldLayoutSchemeissueTypeId - the Issue TypefieldConfigurationId - the FieldConfigpublic void updateFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
FieldLayoutManagerFieldLayoutSchemeEntity.updateFieldLayoutSchemeEntity in interface FieldLayoutManagerfieldLayoutSchemeEntity - The FieldLayoutSchemeEntitypublic void removeFieldLayoutSchemeEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
FieldLayoutManagerFieldLayoutSchemeEntityremoveFieldLayoutSchemeEntity in interface FieldLayoutManagerfieldLayoutSchemeEntity - The FieldLayoutSchemeEntitypublic void removeFieldLayoutScheme(FieldLayoutScheme fieldLayoutScheme)
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.
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.public Collection<Project> getProjectsUsing(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.
getProjectsUsing in interface FieldLayoutManagerfieldLayout - The FieldLayout.public boolean isFieldLayoutSchemesVisiblyEquivalent(Long fieldConfigurationSchemeId1, Long fieldConfigurationSchemeId2)
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 schemepublic 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 systempublic void updateFieldLayoutItemAttributesForCustomField(CustomField customField, String description, boolean isRequired, boolean isHidden)
FieldLayoutManagerdescription, isHidden and isRequired columns of all the
fieldlayoutitem rows associated with this custom field.updateFieldLayoutItemAttributesForCustomField in interface FieldLayoutManagercustomField - 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.Copyright © 2002-2019 Atlassian. All Rights Reserved.