Class DefaultShortcutsService
java.lang.Object
com.atlassian.jira.projects.shortcuts.DefaultShortcutsService
- All Implemented Interfaces:
ShortcutsService
Default implementation of the
ShortcutsService interface.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultShortcutsService(ShortcutsManager shortcutsManager, ProjectPermissionsHelper projectPermissionsHelper, I18nHelper.BeanFactory i18nHelperFactory, com.atlassian.event.api.EventPublisher eventPublisher, com.atlassian.sal.api.features.DarkFeatureManager darkFeatureManager) -
Method Summary
Modifier and TypeMethodDescriptionio.atlassian.fugue.Either<ErrorCollection, ProjectShortcut> addShortcut(ProjectShortcut shortcut, ApplicationUser user) Adds new shortcut to given projectio.atlassian.fugue.Either<ErrorCollection, ProjectShortcut> deleteShortcut(Integer id, ApplicationUser user) Delete shortcut with given IDio.atlassian.fugue.Either<ErrorCollection, ProjectShortcut> getShortcut(Integer id, ApplicationUser user) Find shortcut with given ID in selected projectgetShortcuts(Project project, ApplicationUser user) Fetch shortcuts for given projectbooleanCheck whether given URL is safe as per URI scheme Allow listingio.atlassian.fugue.Either<ErrorCollection, ProjectShortcut> updateShortcut(ProjectShortcut shortcut, ApplicationUser user) Updates shortcut
-
Field Details
-
MAX_NAME_LENGTH
public static final int MAX_NAME_LENGTH- See Also:
-
-
Constructor Details
-
DefaultShortcutsService
@Autowired public DefaultShortcutsService(ShortcutsManager shortcutsManager, ProjectPermissionsHelper projectPermissionsHelper, I18nHelper.BeanFactory i18nHelperFactory, com.atlassian.event.api.EventPublisher eventPublisher, com.atlassian.sal.api.features.DarkFeatureManager darkFeatureManager)
-
-
Method Details
-
addShortcut
public io.atlassian.fugue.Either<ErrorCollection,ProjectShortcut> addShortcut(ProjectShortcut shortcut, ApplicationUser user) Description copied from interface:ShortcutsServiceAdds new shortcut to given project- Specified by:
addShortcutin interfaceShortcutsService- Parameters:
shortcut- shortcut's data to be added. Note that the operation will ignore {ProjectShortcut.getId()} valueuser- user performing the operation- Returns:
- updated shortcut object or
ErrorCollectionin case of error
-
updateShortcut
public io.atlassian.fugue.Either<ErrorCollection,ProjectShortcut> updateShortcut(ProjectShortcut shortcut, ApplicationUser user) Description copied from interface:ShortcutsServiceUpdates shortcut- Specified by:
updateShortcutin interfaceShortcutsService- Parameters:
shortcut- a new shortcut's data. Object's ID will be used to find the one to update.user- user performing the operation- Returns:
- updated shortcut object or
ErrorCollectionin case of error
-
isUrlSafe
Check whether given URL is safe as per URI scheme Allow listing- Specified by:
isUrlSafein interfaceShortcutsService- Parameters:
url- the URL- Returns:
truewhen URL is safe,falseotherwise
-
getShortcuts
Description copied from interface:ShortcutsServiceFetch shortcuts for given project- Specified by:
getShortcutsin interfaceShortcutsService- Parameters:
project- the projectuser- user performing the operation- Returns:
- a list of shortcuts.
nullshould never happen
-
getShortcut
public io.atlassian.fugue.Either<ErrorCollection,ProjectShortcut> getShortcut(Integer id, ApplicationUser user) Description copied from interface:ShortcutsServiceFind shortcut with given ID in selected project- Specified by:
getShortcutin interfaceShortcutsService- Parameters:
id- the shortcut's IDuser- user performing the operation- Returns:
- either {
ProjectShortcut} orErrorCollectionin case of error
-
deleteShortcut
public io.atlassian.fugue.Either<ErrorCollection,ProjectShortcut> deleteShortcut(Integer id, ApplicationUser user) Description copied from interface:ShortcutsServiceDelete shortcut with given ID- Specified by:
deleteShortcutin interfaceShortcutsService- Parameters:
id- the shortcut's IDuser- user performing the operation- Returns:
ProjectShortcutwhen shortcut was existing and was successfully deletedErrorCollectionin case of error
-