object helpers extends AvatarImageProvider with LinkConverter with RequestCache
Provides helper methods for Twirl templates.
- Alphabetic
- By Inheritance
- helpers
- RequestCache
- RepositoryService
- IssuesService
- AccountService
- SystemSettingsService
- LinkConverter
- AvatarImageProvider
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- implicit final class RegexReplaceString extends AnyVal
-
implicit final
class
RichHtmlSeq
extends AnyVal
Implicit conversion to add mkHtml() to Seq[Html].
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
activityMessage(message: String)(implicit context: Context): Html
Convert link notations in the activity message.
-
def
addCollaborator(userName: String, repositoryName: String, collaboratorName: String, role: String)(implicit s: (blockingApi)#Session): Unit
Add collaborator (user or group) to the repository.
Add collaborator (user or group) to the repository.
- Definition Classes
- RepositoryService
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
assets(path: String)(implicit context: Context): String
Returns the url to the path of assets.
-
def
authenticate(settings: SystemSettings, userName: String, password: String)(implicit s: (blockingApi)#Session): Option[Account]
- Definition Classes
- AccountService
-
def
avatar(commit: CommitInfo, size: Int)(implicit context: Context): Html
Returns <img> which displays the avatar icon for the given mail address.
Returns <img> which displays the avatar icon for the given mail address. This method looks up Gravatar if avatar icon has not been configured in user settings.
-
def
avatar(userName: String, size: Int, tooltip: Boolean = false, mailAddress: String = "")(implicit context: Context): Html
Returns <img> which displays the avatar icon for the given user name.
Returns <img> which displays the avatar icon for the given user name. This method looks up Gravatar if avatar icon has not been configured in user settings.
-
def
avatarLink(commit: CommitInfo, size: Int)(implicit context: Context): Html
Generates the avatar link to the account page.
Generates the avatar link to the account page. If user does not exist or disabled, this method returns avatar image without link.
-
def
avatarLink(userName: String, size: Int, mailAddress: String = "", tooltip: Boolean = false, label: Boolean = false)(implicit context: Context): Html
Generates the avatar link to the account page.
Generates the avatar link to the account page. If user does not exist or disabled, this method returns avatar image without link.
-
def
baseUrl(implicit request: HttpServletRequest): String
- Definition Classes
- SystemSettingsService
-
val
bootDate: Date
java.util.Date of boot timestamp.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
closeIssuesFromMessage(message: String, userName: String, owner: String, repository: String)(implicit s: (blockingApi)#Session): Unit
- Definition Classes
- IssuesService
- def commitStateIcon(state: CommitState): Html
- def commitStateText(state: CommitState, commitId: String): String
-
def
convertRefsLinks(text: String, repository: RepositoryInfo, issueIdPrefix: String = "#", escapeHtml: Boolean = true)(implicit context: Context): String
Converts issue id, username and commit id to link in the given text.
Converts issue id, username and commit id to link in the given text.
- Attributes
- protected
- Definition Classes
- LinkConverter
-
def
countIssue(condition: IssueSearchCondition, onlyPullRequest: Boolean, repos: (String, String)*)(implicit s: (blockingApi)#Session): Int
Returns the count of the search result against issues.
Returns the count of the search result against issues.
- condition
the search condition
- onlyPullRequest
if true then counts only pull request, false then counts both of issue and pull request.
- repos
Tuple of the repository owner and the repository name
- returns
the count of the search result
- Definition Classes
- IssuesService
-
def
countIssueGroupByLabels(owner: String, repository: String, condition: IssueSearchCondition, filterUser: Map[String, String])(implicit s: (blockingApi)#Session): Map[String, Int]
Returns the Map which contains issue count for each labels.
Returns the Map which contains issue count for each labels.
- owner
the repository owner
- repository
the repository name
- condition
the search condition
- returns
the Map which contains issue count for each labels (key is label name, value is issue count)
- Definition Classes
- IssuesService
-
def
createAccount(userName: String, password: String, fullName: String, mailAddress: String, isAdmin: Boolean, description: Option[String], url: Option[String])(implicit s: (blockingApi)#Session): Unit
- Definition Classes
- AccountService
-
def
createComment(owner: String, repository: String, loginUser: String, issueId: Int, content: String, action: String)(implicit s: (blockingApi)#Session): Int
- Definition Classes
- IssuesService
-
def
createGroup(groupName: String, description: Option[String], url: Option[String])(implicit s: (blockingApi)#Session): Unit
- Definition Classes
- AccountService
-
def
createIssueComment(owner: String, repository: String, commit: CommitInfo)(implicit s: (blockingApi)#Session): Unit
- Definition Classes
- IssuesService
-
def
createIssueLink(repository: RepositoryInfo, issueId: Int)(implicit context: Context): String
Creates a link to the issue or the pull request from the issue id.
Creates a link to the issue or the pull request from the issue id.
- Attributes
- protected
- Definition Classes
- LinkConverter
-
def
createReferComment(owner: String, repository: String, fromIssue: Issue, message: String, loginAccount: Account)(implicit s: (blockingApi)#Session): Unit
- Definition Classes
- IssuesService
- def cut(value: String, length: Int): String
-
def
date(date: Date): String
Format java.util.Date to "yyyy-MM-dd".
-
def
datetime(date: Date): String
Format java.util.Date to "yyyy-MM-dd HH:mm:ss".
-
def
datetimeAgo(date: Date): String
Format java.util.Date to "x {seconds/minutes/hours/days/months/years} ago"
-
def
datetimeAgoRecentOnly(date: Date): String
Format java.util.Date to "x {seconds/minutes/hours/days} ago" If duration over 1 month, format to "d MMM (yyyy)"
-
def
datetimeRFC3339(date: Date): String
Format java.util.Date to "yyyy-MM-dd'T'hh:mm:ss'Z'".
-
def
decorateHtml(html: String, repository: RepositoryInfo)(implicit context: Context): String
Decorate a given HTML by TextDecorators which are provided by plug-ins.
Decorate a given HTML by TextDecorators which are provided by plug-ins. TextDecorators are applied to only text parts of a given HTML.
-
def
deleteComment(commentId: Int)(implicit s: (blockingApi)#Session): Int
- Definition Classes
- IssuesService
-
def
deleteIssueLabel(owner: String, repository: String, issueId: Int, labelId: Int)(implicit s: (blockingApi)#Session): Int
- Definition Classes
- IssuesService
-
def
deleteRepository(userName: String, repositoryName: String)(implicit s: (blockingApi)#Session): Unit
- Definition Classes
- RepositoryService
- def detectAndRenderLinks(text: String, repository: RepositoryInfo)(implicit context: Context): String
-
def
editorType(fileName: String): String
Returns file type for AceEditor.
-
def
encodeRefName(value: String): String
URL encode except '/'.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
getAccountByMailAddress(mailAddress: String)(implicit context: Context): Option[Account]
- Definition Classes
- RequestCache
-
def
getAccountByMailAddress(mailAddress: String, includeRemoved: Boolean = false)(implicit s: (blockingApi)#Session): Option[Account]
- Definition Classes
- AccountService
-
def
getAccountByUserName(userName: String)(implicit context: Context): Option[Account]
- Definition Classes
- RequestCache
-
def
getAccountByUserName(userName: String, includeRemoved: Boolean = false)(implicit s: (blockingApi)#Session): Option[Account]
- Definition Classes
- AccountService
-
def
getAccountsByUserNames(userNames: Set[String], knowns: Set[Account], includeRemoved: Boolean = false)(implicit s: (blockingApi)#Session): Map[String, Account]
- Definition Classes
- AccountService
-
def
getAllRepositories(userName: String)(implicit s: (blockingApi)#Session): List[(String, String)]
Returns the repositories except private repository that user does not have access right.
Returns the repositories except private repository that user does not have access right. Include public repository, private own repository and private but collaborator repository.
- userName
the user name of collaborator
- returns
the repository information list
- Definition Classes
- RepositoryService
-
def
getAllUsers(includeRemoved: Boolean = true)(implicit s: (blockingApi)#Session): List[Account]
- Definition Classes
- AccountService
-
def
getAssignableUserNames(owner: String, repository: String)(implicit s: (blockingApi)#Session): List[String]
- Definition Classes
- IssuesService
-
def
getAvatarImageHtml(userName: String, size: Int, mailAddress: String = "", tooltip: Boolean = false)(implicit context: Context): Html
Returns <img> which displays the avatar icon.
Returns <img> which displays the avatar icon. Looks up Gravatar if avatar icon has not been configured in user settings.
- Attributes
- protected
- Definition Classes
- AvatarImageProvider
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
getCollaboratorUserNames(userName: String, repositoryName: String, filter: Seq[Role] = Nil)(implicit s: (blockingApi)#Session): List[String]
Returns the list of all collaborator name and permission which is sorted with ascending order.
Returns the list of all collaborator name and permission which is sorted with ascending order. If a group is added as a collaborator, this method returns users who are belong to that group.
- Definition Classes
- RepositoryService
-
def
getCollaborators(userName: String, repositoryName: String)(implicit s: (blockingApi)#Session): List[(Collaborator, Boolean)]
Returns the list of collaborators name (user name or group name) which is sorted with ascending order.
Returns the list of collaborators name (user name or group name) which is sorted with ascending order.
- Definition Classes
- RepositoryService
-
def
getComment(owner: String, repository: String, commentId: String)(implicit s: (blockingApi)#Session): Option[IssueComment]
- Definition Classes
- IssuesService
-
def
getComments(owner: String, repository: String, issueId: Int)(implicit s: (blockingApi)#Session): List[model.IssueCommentComponent.IssueComments.TableElementType]
- Definition Classes
- IssuesService
-
def
getCommentsForApi(owner: String, repository: String, issueId: Int)(implicit s: (blockingApi)#Session): List[(IssueComment, Account, Issue)]
- returns
IssueComment and commentedUser and Issue
- Definition Classes
- IssuesService
-
def
getCommitStatues(userName: String, repositoryName: String, issueId: Int)(implicit s: (blockingApi)#Session): Option[CommitStatusInfo]
- Definition Classes
- IssuesService
-
def
getContentTemplate(repository: RepositoryInfo, fileBaseName: String)(implicit s: (blockingApi)#Session): String
Returns content of template set per repository.
Returns content of template set per repository.
- repository
the repository information
- fileBaseName
the file basename without extension of template
- returns
The content of template if the repository has it, otherwise empty string.
- Definition Classes
- RepositoryService
-
def
getForkedRepositories(userName: String, repositoryName: String)(implicit s: (blockingApi)#Session): List[(String, String)]
- Definition Classes
- RepositoryService
-
def
getGroupMembers(groupName: String)(implicit s: (blockingApi)#Session): List[GroupMember]
- Definition Classes
- AccountService
-
def
getGroupNames(userName: String)(implicit s: (blockingApi)#Session): List[String]
- Definition Classes
- AccountService
-
def
getGroupsByUserName(userName: String)(implicit s: (blockingApi)#Session): List[String]
- Definition Classes
- AccountService
-
def
getIssue(userName: String, repositoryName: String, issueId: String)(implicit context: Context): Option[Issue]
- Definition Classes
- RequestCache
-
def
getIssue(owner: String, repository: String, issueId: String)(implicit s: (blockingApi)#Session): Option[model.IssueComponent.Issues.TableElementType]
- Definition Classes
- IssuesService
-
def
getIssueLabel(owner: String, repository: String, issueId: Int, labelId: Int)(implicit s: (blockingApi)#Session): Option[IssueLabel]
- Definition Classes
- IssuesService
-
def
getIssueLabels(owner: String, repository: String, issueId: Int)(implicit s: (blockingApi)#Session): List[Label]
- Definition Classes
- IssuesService
-
def
getMergedComment(owner: String, repository: String, issueId: Int)(implicit s: (blockingApi)#Session): Option[(IssueComment, Account)]
- Definition Classes
- IssuesService
-
def
getRepository(userName: String, repositoryName: String)(implicit s: (blockingApi)#Session): Option[RepositoryInfo]
Returns the specified repository information.
Returns the specified repository information.
- userName
the user name of the repository owner
- repositoryName
the repository name
- returns
the repository information
- Definition Classes
- RepositoryService
-
def
getRepositoryNamesOfUser(userName: String)(implicit s: (blockingApi)#Session): List[String]
Returns the repository names of the specified user.
Returns the repository names of the specified user.
- userName
the user name of repository owner
- returns
the list of repository names
- Definition Classes
- RepositoryService
-
def
getUserRepositories(userName: String, withoutPhysicalInfo: Boolean = false)(implicit s: (blockingApi)#Session): List[RepositoryInfo]
- Definition Classes
- RepositoryService
-
def
getVisibleRepositories(loginAccount: Option[Account], repositoryUserName: Option[String] = None, withoutPhysicalInfo: Boolean = false)(implicit s: (blockingApi)#Session): List[RepositoryInfo]
Returns the list of visible repositories for the specified user.
Returns the list of visible repositories for the specified user. If repositoryUserName is given then filters results by repository owner.
- loginAccount
the logged in account
- repositoryUserName
the repository owner (if None then returns all repositories which are visible for logged in user)
- withoutPhysicalInfo
if true then the result does not include physical repository information such as commit count, branches and tags
- returns
the repository information which is sorted in descending order of lastActivityDate.
- Definition Classes
- RepositoryService
-
def
hasDeveloperRole(owner: String, repository: String, loginAccount: Option[Account])(implicit s: (blockingApi)#Session): Boolean
- Definition Classes
- RepositoryService
-
def
hasGuestRole(owner: String, repository: String, loginAccount: Option[Account])(implicit s: (blockingApi)#Session): Boolean
- Definition Classes
- RepositoryService
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
hashDate(date: Date): String
Format java.util.Date to "yyyyMMDDHHmmss" (for url hash ex.
Format java.util.Date to "yyyyMMDDHHmmss" (for url hash ex. /some/path.css?19800101010203
-
def
hashQuery: String
hashDate of bootDate for /assets, /plugin-assets
-
def
insertIssue(owner: String, repository: String, loginUser: String, title: String, content: Option[String], assignedUserName: Option[String], milestoneId: Option[Int], isPullRequest: Boolean = false)(implicit s: (blockingApi)#Session): Int
- Definition Classes
- IssuesService
-
def
insertRepository(repositoryName: String, userName: String, description: Option[String], isPrivate: Boolean, originRepositoryName: Option[String] = None, originUserName: Option[String] = None, parentRepositoryName: Option[String] = None, parentUserName: Option[String] = None)(implicit s: (blockingApi)#Session): Unit
Creates a new repository.
Creates a new repository.
- repositoryName
the repository name
- userName
the user name of the repository owner
- description
the repository description
- isPrivate
the repository type (private is true, otherwise false)
- originRepositoryName
specify for the forked repository. (default is None)
- originUserName
specify for the forked repository. (default is None)
- Definition Classes
- RepositoryService
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isLastAdministrator(account: Account)(implicit s: (blockingApi)#Session): Boolean
- Definition Classes
- AccountService
-
def
isPast(date: Date): Boolean
Test whether the given Date is past date.
-
def
isRenderable(fileName: String): Boolean
Tests whether the given file is renderable.
Tests whether the given file is renderable. It's tested by the file extension.
-
def
issueLink(repository: RepositoryInfo, issueId: Int)(implicit context: Context): Html
Creates a link to the issue or the pull request from the issue id.
-
def
json(obj: AnyRef): String
Render a given object as the JSON string.
-
def
link(value: String, repository: RepositoryInfo)(implicit context: Context): Html
Converts commit id, issue id and username to the link.
-
def
loadSystemSettings(): SystemSettings
- Definition Classes
- SystemSettingsService
-
def
markdown(markdown: String, repository: RepositoryInfo, enableWikiLink: Boolean, enableRefsLink: Boolean, enableLineBreaks: Boolean, enableAnchor: Boolean = true, enableTaskList: Boolean = false, hasWritePermission: Boolean = false, pages: List[String] = Nil)(implicit context: Context): Html
Converts Markdown of Wiki pages to HTML.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
plural(count: Int, singular: String, plural: String = ""): String
Returns singular if count is 1, otherwise plural.
Returns singular if count is 1, otherwise plural. If plural is not specified, returns singular + "s" as plural.
- def pre(value: Html): Html
-
def
readableSize(size: Option[Long]): String
a human-readable display value (includes units - EB, PB, TB, GB, MB, KB or bytes)
a human-readable display value (includes units - EB, PB, TB, GB, MB, KB or bytes)
- size
total size of object in bytes
-
def
registerIssueLabel(owner: String, repository: String, issueId: Int, labelId: Int)(implicit s: (blockingApi)#Session): Int
- Definition Classes
- IssuesService
-
def
removeCollaborators(userName: String, repositoryName: String)(implicit s: (blockingApi)#Session): Unit
Remove all collaborators from the repository.
Remove all collaborators from the repository.
- Definition Classes
- RepositoryService
-
def
removeHtml(html: Html): Html
Remove html tags from the given Html instance.
-
def
removeUserRelatedData(userName: String)(implicit s: (blockingApi)#Session): Unit
- Definition Classes
- AccountService
-
def
renameRepository(oldUserName: String, oldRepositoryName: String, newUserName: String, newRepositoryName: String)(implicit s: (blockingApi)#Session): Unit
- Definition Classes
- RepositoryService
-
def
renderMarkup(filePath: List[String], fileContent: String, branch: String, repository: RepositoryInfo, enableWikiLink: Boolean, enableRefsLink: Boolean, enableAnchor: Boolean)(implicit context: Context): Html
Render the given source (only markdown is supported in default) as HTML.
Render the given source (only markdown is supported in default) as HTML. You can test if a file is renderable in this method by isRenderable().
-
def
saveRepositoryDefaultBranch(userName: String, repositoryName: String, defaultBranch: String)(implicit s: (blockingApi)#Session): Unit
- Definition Classes
- RepositoryService
-
def
saveRepositoryOptions(userName: String, repositoryName: String, description: Option[String], isPrivate: Boolean, issuesOption: String, externalIssuesUrl: Option[String], wikiOption: String, externalWikiUrl: Option[String], allowFork: Boolean)(implicit s: (blockingApi)#Session): Unit
Save repository options.
Save repository options.
- Definition Classes
- RepositoryService
-
def
saveSystemSettings(settings: SystemSettings): Unit
- Definition Classes
- SystemSettingsService
-
def
searchIssue(condition: IssueSearchCondition, pullRequest: Boolean, offset: Int, limit: Int, repos: (String, String)*)(implicit s: (blockingApi)#Session): List[IssueInfo]
Returns the search result against issues.
Returns the search result against issues.
- condition
the search condition
- pullRequest
if true then returns only pull requests, false then returns only issues.
- offset
the offset for pagination
- limit
the limit for pagination
- repos
Tuple of the repository owner and the repository name
- returns
the search result (list of tuples which contain issue, labels and comment count)
- Definition Classes
- IssuesService
-
def
searchIssueByApi(condition: IssueSearchCondition, offset: Int, limit: Int, repos: (String, String)*)(implicit s: (blockingApi)#Session): List[(Issue, Account)]
for api
-
def
searchIssuesByKeyword(owner: String, repository: String, query: String)(implicit s: (blockingApi)#Session): List[(Issue, Int, String)]
Search issues by keyword.
Search issues by keyword.
- owner
the repository owner
- repository
the repository name
- query
the keywords separated by whitespace.
- returns
issues with comment count and matched content of issue or comment
- Definition Classes
- IssuesService
-
def
searchPullRequestByApi(condition: IssueSearchCondition, offset: Int, limit: Int, repos: (String, String)*)(implicit s: (blockingApi)#Session): List[(Issue, Account, Int, PullRequest, Repository, Account)]
for api
for api
- returns
(issue, issueUser, commentCount, pullRequest, headRepo, headOwner)
- Definition Classes
- IssuesService
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- val timeUnits: List[(Long, String)]
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
updateAccount(account: Account)(implicit s: (blockingApi)#Session): Unit
- Definition Classes
- AccountService
-
def
updateAssignedUserName(owner: String, repository: String, issueId: Int, assignedUserName: Option[String])(implicit s: (blockingApi)#Session): Int
- Definition Classes
- IssuesService
-
def
updateAvatarImage(userName: String, image: Option[String])(implicit s: (blockingApi)#Session): Unit
- Definition Classes
- AccountService
-
def
updateClosed(owner: String, repository: String, issueId: Int, closed: Boolean)(implicit s: (blockingApi)#Session): Int
- Definition Classes
- IssuesService
-
def
updateComment(commentId: Int, content: String)(implicit s: (blockingApi)#Session): Int
- Definition Classes
- IssuesService
-
def
updateGroup(groupName: String, description: Option[String], url: Option[String], removed: Boolean)(implicit s: (blockingApi)#Session): Unit
- Definition Classes
- AccountService
-
def
updateGroupMembers(groupName: String, members: List[(String, Boolean)])(implicit s: (blockingApi)#Session): Unit
- Definition Classes
- AccountService
-
def
updateIssue(owner: String, repository: String, issueId: Int, title: String, content: Option[String])(implicit s: (blockingApi)#Session): Int
- Definition Classes
- IssuesService
-
def
updateLastActivityDate(userName: String, repositoryName: String)(implicit s: (blockingApi)#Session): Unit
Updates the last activity date of the repository.
Updates the last activity date of the repository.
- Definition Classes
- RepositoryService
-
def
updateLastLoginDate(userName: String)(implicit s: (blockingApi)#Session): Unit
- Definition Classes
- AccountService
-
def
updateMilestoneId(owner: String, repository: String, issueId: Int, milestoneId: Option[Int])(implicit s: (blockingApi)#Session): Int
- Definition Classes
- IssuesService
-
def
url(userName: String)(implicit context: Context): String
Generates the url to the account page.
-
def
url(repository: RepositoryInfo)(implicit context: Context): String
Generates the url to the repository.
- def urlEncode(value: Option[String]): String
- def urlEncode(value: String): String
-
def
user(userName: String, mailAddress: String = "", styleClass: String = "")(implicit context: Context): Html
Generates the text link to the account page.
Generates the text link to the account page. If user does not exist or disabled, this method returns user name as text without link.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )