|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.issue.fields.MockFieldManager
public class MockFieldManager
| Field Summary |
|---|
| Fields inherited from interface com.atlassian.jira.issue.fields.FieldManager |
|---|
CUSTOM_FIELD_PREFIX |
| Constructor Summary | |
|---|---|
MockFieldManager()
|
|
| Method Summary | |
|---|---|
MockFieldManager |
addField(Field field)
|
MockCustomField |
addMockCustomField(int id)
|
MockOrderableField |
addMockOrderableField(int id)
|
MockFieldManager |
addUnavilableField(Field field)
|
MockFieldManager |
clear()
|
Set<NavigableField> |
getAllAvailableNavigableFields()
|
Set<SearchableField> |
getAllSearchableFields()
Return all the searchable fields in the system. |
Set<CustomField> |
getAvailableCustomFields(com.atlassian.crowd.embedded.api.User remoteUser,
Issue issue)
Retrieves custom fields in scope for the given issue |
Set<NavigableField> |
getAvailableNavigableFields(com.atlassian.crowd.embedded.api.User remoteUser)
|
Set<NavigableField> |
getAvailableNavigableFieldsWithScope(com.atlassian.crowd.embedded.api.User user)
Gets all the available fields that the user can see, this is providing no context scope. |
Set<NavigableField> |
getAvailableNavigableFieldsWithScope(com.atlassian.crowd.embedded.api.User user,
QueryContext queryContext)
Gets all the available fields within the defined scope of the QueryContext. |
ColumnLayoutManager |
getColumnLayoutManager()
|
ConfigurableField |
getConfigurableField(String id)
|
CustomField |
getCustomField(String id)
Get a CustomField by its text key (eg 'customfield_10000'). |
Field |
getField(String id)
Get a field by its id. |
FieldLayoutManager |
getFieldLayoutManager()
|
HideableField |
getHideableField(String id)
|
IssueTypeField |
getIssueTypeField()
Retrieve the IssueType system Field. |
NavigableField |
getNavigableField(String id)
|
Set<NavigableField> |
getNavigableFields()
|
OrderableField |
getOrderableField(String id)
|
Set<OrderableField> |
getOrderableFields()
|
ProjectField |
getProjectField()
Retrieve the Project system Field. |
RequirableField |
getRequiredField(String id)
|
Set<SearchableField> |
getSystemSearchableFields()
Return all the searchable systems fields. |
Set<Field> |
getUnavailableFields()
|
Set<FieldLayout> |
getVisibleFieldLayouts(com.atlassian.crowd.embedded.api.User user)
Returns all the visible FieldLayouts for the given user. |
boolean |
isCustomField(Field field)
|
boolean |
isCustomField(String id)
|
boolean |
isFieldHidden(Set<FieldLayout> fieldLayouts,
Field field)
Checks whether the given field is hidden in all of the given Field Layouts. |
boolean |
isFieldHidden(com.atlassian.crowd.embedded.api.User remoteUser,
Field field)
|
boolean |
isFieldHidden(com.atlassian.crowd.embedded.api.User remoteUser,
String fieldId)
Determines whether the field with id of fieldId is NOT hidden in AT LEAST one FieldLayout that the user can see
(assigned to projects for which the user has the Permissions.BROWSE permission). |
boolean |
isHideableField(Field field)
|
boolean |
isHideableField(String id)
|
boolean |
isMandatoryField(Field field)
|
boolean |
isMandatoryField(String id)
|
boolean |
isNavigableField(Field field)
|
boolean |
isNavigableField(String id)
|
boolean |
isOrderableField(Field field)
|
boolean |
isOrderableField(String id)
|
boolean |
isRenderableField(Field field)
|
boolean |
isRenderableField(String id)
|
boolean |
isRequirableField(Field field)
|
boolean |
isRequirableField(String id)
|
boolean |
isTimeTrackingOn()
|
boolean |
isUnscreenableField(Field field)
|
boolean |
isUnscreenableField(String id)
|
void |
refresh()
Invalidates all field-related caches in JIRA. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MockFieldManager()
| Method Detail |
|---|
public MockOrderableField addMockOrderableField(int id)
public MockCustomField addMockCustomField(int id)
public MockFieldManager addField(Field field)
public MockFieldManager addUnavilableField(Field field)
public MockFieldManager clear()
public Field getField(String id)
FieldManager
getField in interface FieldManagerid - An IssueFieldConstants constant, or custom field key (eg. "customfield_10010")
public boolean isCustomField(String id)
isCustomField in interface FieldManagerpublic boolean isCustomField(Field field)
isCustomField in interface FieldManagerpublic CustomField getCustomField(String id)
FieldManager
getCustomField in interface FieldManagerid - Eg. 'customfield_10000'
CustomField or null if not found.public boolean isHideableField(String id)
isHideableField in interface FieldManagerpublic boolean isHideableField(Field field)
isHideableField in interface FieldManagerpublic HideableField getHideableField(String id)
getHideableField in interface FieldManagerpublic boolean isOrderableField(String id)
isOrderableField in interface FieldManagerpublic boolean isOrderableField(Field field)
isOrderableField in interface FieldManagerpublic OrderableField getOrderableField(String id)
getOrderableField in interface FieldManagerpublic ConfigurableField getConfigurableField(String id)
getConfigurableField in interface FieldManagerpublic Set<OrderableField> getOrderableFields()
getOrderableFields in interface FieldManagerpublic Set<NavigableField> getNavigableFields()
getNavigableFields in interface FieldManagerpublic boolean isNavigableField(String id)
isNavigableField in interface FieldManagerpublic boolean isNavigableField(Field field)
isNavigableField in interface FieldManagerpublic NavigableField getNavigableField(String id)
getNavigableField in interface FieldManagerpublic boolean isRequirableField(String id)
isRequirableField in interface FieldManagerpublic boolean isRequirableField(Field field)
isRequirableField in interface FieldManagerpublic boolean isMandatoryField(String id)
isMandatoryField in interface FieldManagerpublic boolean isMandatoryField(Field field)
isMandatoryField in interface FieldManagerpublic boolean isRenderableField(String id)
isRenderableField in interface FieldManagerpublic boolean isRenderableField(Field field)
isRenderableField in interface FieldManagerpublic boolean isUnscreenableField(String id)
isUnscreenableField in interface FieldManagerpublic boolean isUnscreenableField(Field field)
isUnscreenableField in interface FieldManagerpublic RequirableField getRequiredField(String id)
getRequiredField in interface FieldManagerpublic FieldLayoutManager getFieldLayoutManager()
getFieldLayoutManager in interface FieldManagerpublic ColumnLayoutManager getColumnLayoutManager()
getColumnLayoutManager in interface FieldManagerpublic void refresh()
FieldManagerFooStore.updateFoo()
method, where you can invalidate a single cache entry. If the cache lives in another class then the store
should raise a FooUpdatedEvent which that class can listen to in order to keep its caches up to date.
If you add any calls to this method in JIRA I will hunt you down and subject you to a Spanish inquisition.
refresh in interface FieldManagerpublic Set<Field> getUnavailableFields()
getUnavailableFields in interface FieldManager
public boolean isFieldHidden(com.atlassian.crowd.embedded.api.User remoteUser,
Field field)
isFieldHidden in interface FieldManager
public boolean isFieldHidden(Set<FieldLayout> fieldLayouts,
Field field)
FieldManager
This method can be used in conjunction with FieldManager.getVisibleFieldLayouts(com.atlassian.crowd.embedded.api.User)
to provide a more performant way of looking up FieldManager.isFieldHidden(com.atlassian.crowd.embedded.api.User, Field) multiple times.
Instead, it is more efficient to do something like:
Set fieldLayouts = fieldManager.getVisibleFieldLayouts(loggedInUser);
for (Field field: myFields)
{
if (fieldManager.isFieldHidden(fieldLayouts1, field))
{
...
}
}
isFieldHidden in interface FieldManagerfieldLayouts - The FieldLayouts to checkfield - The field to check
FieldManager.getVisibleFieldLayouts(com.atlassian.crowd.embedded.api.User),
FieldManager.isFieldHidden(com.atlassian.crowd.embedded.api.User, Field)public Set<FieldLayout> getVisibleFieldLayouts(com.atlassian.crowd.embedded.api.User user)
FieldManager
This is used in conjunction with FieldManager.isFieldHidden(Set, Field) as a performance optimisation in usages that want to call FieldManager.isFieldHidden(User, Field) multiple times.
Instead, it is more efficient to do something like:
Set fieldLayouts = fieldManager.getVisibleFieldLayouts(loggedInUser);
for (Field field: myFields)
{
if (fieldManager.isFieldHidden(fieldLayouts1, field))
{
...
}
}
getVisibleFieldLayouts in interface FieldManageruser - the user whose project browsing permissions are used to limit visible FieldLayouts.
public boolean isFieldHidden(com.atlassian.crowd.embedded.api.User remoteUser,
String fieldId)
FieldManagerFieldLayout that the user can see
(assigned to projects for which the user has the Permissions.BROWSE permission).
isFieldHidden in interface FieldManagerremoteUser - the remote user.fieldId - The Field ID
public Set<NavigableField> getAvailableNavigableFieldsWithScope(com.atlassian.crowd.embedded.api.User user)
throws FieldException
FieldManager
getAvailableNavigableFieldsWithScope in interface FieldManageruser - the remote user.
FieldException - thrown if there is a problem looking up the fields
public Set<NavigableField> getAvailableNavigableFieldsWithScope(com.atlassian.crowd.embedded.api.User user,
QueryContext queryContext)
throws FieldException
FieldManager
getAvailableNavigableFieldsWithScope in interface FieldManageruser - the user making the requestqueryContext - the context of the search request.
FieldException - thrown if there is a problem looking up the fields
public Set<CustomField> getAvailableCustomFields(com.atlassian.crowd.embedded.api.User remoteUser,
Issue issue)
throws FieldException
FieldManager
getAvailableCustomFields in interface FieldManagerremoteUser - Remote Userissue - Issue
FieldException - if cannot retrieve the projects the user can see, or if cannot retrieve
the field layouts for the viewable projects
public Set<NavigableField> getAllAvailableNavigableFields()
throws FieldException
getAllAvailableNavigableFields in interface FieldManagerFieldException
public Set<NavigableField> getAvailableNavigableFields(com.atlassian.crowd.embedded.api.User remoteUser)
throws FieldException
getAvailableNavigableFields in interface FieldManagerFieldExceptionpublic Set<SearchableField> getAllSearchableFields()
FieldManager
getAllSearchableFields in interface FieldManagerpublic Set<SearchableField> getSystemSearchableFields()
FieldManager
getSystemSearchableFields in interface FieldManagerpublic IssueTypeField getIssueTypeField()
FieldManager
getIssueTypeField in interface FieldManagerpublic ProjectField getProjectField()
FieldManager
getProjectField in interface FieldManagerpublic boolean isTimeTrackingOn()
isTimeTrackingOn in interface FieldManagerpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||