public RemoteIssueLinkUICreateEvent(RemoteIssueLink remoteIssueLink) { super(remoteIssueLink); this.applicationType = remoteIssueLink.getApplicationType(); }
public RemoteIssueLinkCreateEvent(RemoteIssueLink remoteIssueLink) { super(remoteIssueLink); this.applicationType = remoteIssueLink.getApplicationType(); }
public RemoteIssueLinkUpdateEvent(RemoteIssueLink remoteIssueLink) { super(remoteIssueLink); this.applicationType = remoteIssueLink.getApplicationType(); }
@Override public RemoteIssueLink decorate(final RemoteIssueLink remoteIssueLink) throws CredentialsRequiredException, IOException, PermissionException { if (!RemoteIssueLink.APPLICATION_TYPE_CONFLUENCE.equals(remoteIssueLink.getApplicationType())) { throw new IllegalArgumentException("Remote link is not to Confluence"); } final ConfluenceGlobalId globalId = confluenceGlobalIdFactory.create(remoteIssueLink); try { final RemoteResponse<ConfluencePage> response = confluenceRpcService.getPage(globalId.getApplicationLink(), globalId.getPageId()); return handleResponse(response, remoteIssueLink, globalId.getApplicationLink()); } catch (final ResponseException e) { throw new IOException("Failed to load Confluence Page from remote server", e); } }
@Override public RemoteIssueLink decorate(final RemoteIssueLink remoteIssueLink) throws CredentialsRequiredException, IOException, PermissionException { if (!RemoteIssueLink.APPLICATION_TYPE_JIRA.equals(remoteIssueLink.getApplicationType())) { throw new IllegalArgumentException("Remote link is not to JIRA"); } final RemoteJiraGlobalId remoteJiraGlobalId = remoteJiraGlobalIdFactory.decode(remoteIssueLink.getGlobalId()); final ApplicationLink jiraAppLink = remoteJiraGlobalId.getApplicationLink(); final String remoteIssueID = String.valueOf(remoteJiraGlobalId.getRemoteIssueId()); try { final RemoteResponse<RemoteJiraIssue> response = remoteJiraRestService.getIssue(jiraAppLink, remoteIssueID, RemoteJiraRestService.RestVersion.VERSION_2); return handleJiraResponse(response, remoteIssueLink, jiraAppLink); } catch (final ResponseException exception) { throw new IOException("Failed to load JIRA issue from remote server", exception); } // TODO: Retrieval of non-AppLinked issues was here. See r163408. }
private void validateFieldLengths(RemoteIssueLink remoteIssueLink, I18nHelper i18n, ErrorCollection errors) { if (isLongerThan(remoteIssueLink.getGlobalId(), MAX_LONG_VARCHAR_LENGTH)) { errors.addError("globalId", i18n.getText("remotelink.service.field.too.long", i18n.getText("remotelink.service.globalid"), String.valueOf(MAX_LONG_VARCHAR_LENGTH)), Reason.VALIDATION_FAILED); } if (isLongerThan(remoteIssueLink.getTitle(), MAX_LONG_VARCHAR_LENGTH)) { errors.addError("title", i18n.getText("remotelink.service.field.too.long", i18n.getText("remotelink.service.title"), String.valueOf(MAX_LONG_VARCHAR_LENGTH)), Reason.VALIDATION_FAILED); } if (isLongerThan(remoteIssueLink.getRelationship(), MAX_LONG_VARCHAR_LENGTH)) { errors.addError("relationship", i18n.getText("remotelink.service.field.too.long", i18n.getText("remotelink.service.relationship"), String.valueOf(MAX_LONG_VARCHAR_LENGTH)), Reason.VALIDATION_FAILED); } if (isLongerThan(remoteIssueLink.getApplicationType(), MAX_LONG_VARCHAR_LENGTH)) { errors.addError("applicationType", i18n.getText("remotelink.service.field.too.long", i18n.getText("remotelink.service.applicationtype"), String.valueOf(MAX_LONG_VARCHAR_LENGTH)), Reason.VALIDATION_FAILED); } if (isLongerThan(remoteIssueLink.getApplicationName(), MAX_LONG_VARCHAR_LENGTH)) { errors.addError("applicationName", i18n.getText("remotelink.service.field.too.long", i18n.getText("remotelink.service.applicationname"), String.valueOf(MAX_LONG_VARCHAR_LENGTH)), Reason.VALIDATION_FAILED); } }
if (RemoteIssueLink.APPLICATION_TYPE_JIRA.equals(remoteIssueLink.getApplicationType())) { final Map<String, String> values = GlobalIdFactory.decode(remoteIssueLink.getGlobalId(), GLOBAL_ID_KEYS); if (internalHostApplication.getId().get().equals(values.get("appId"))) {
public RemoteIssueLinkBean build() { final URI self = createSelfLink(remoteIssueLink); return new RemoteIssueLinkBean( remoteIssueLink.getId(), self, remoteIssueLink.getGlobalId(), remoteIssueLink.getApplicationType(), remoteIssueLink.getApplicationName(), remoteIssueLink.getRelationship(), remoteIssueLink.getUrl(), remoteIssueLink.getTitle(), remoteIssueLink.getSummary(), remoteIssueLink.getIconUrl(), remoteIssueLink.getIconTitle(), remoteIssueLink.isResolved(), remoteIssueLink.getStatusIconUrl(), remoteIssueLink.getStatusIconTitle(), remoteIssueLink.getStatusIconLink() ); }
private Result validateFieldLengths(final RemoteIssueLink remoteIssueLink) { if (isLongerThan(remoteIssueLink.getGlobalId(), MAX_LONG_VARCHAR_LENGTH)) { return new Result(false, tooLongFieldMessage("globalId", MAX_LONG_VARCHAR_LENGTH)); } if (isLongerThan(remoteIssueLink.getTitle(), MAX_LONG_VARCHAR_LENGTH)) { return new Result(false, tooLongFieldMessage("title", MAX_LONG_VARCHAR_LENGTH)); } if (isLongerThan(remoteIssueLink.getRelationship(), MAX_LONG_VARCHAR_LENGTH)) { return new Result(false, tooLongFieldMessage("relationship", MAX_LONG_VARCHAR_LENGTH)); } if (isLongerThan(remoteIssueLink.getApplicationType(), MAX_LONG_VARCHAR_LENGTH)) { return new Result(false, tooLongFieldMessage("applicationType", MAX_LONG_VARCHAR_LENGTH)); } if (isLongerThan(remoteIssueLink.getApplicationName(), MAX_LONG_VARCHAR_LENGTH)) { return new Result(false, tooLongFieldMessage("applicationName", MAX_LONG_VARCHAR_LENGTH)); } return TRUE; }
application.put("type", remoteIssueLink.getApplicationType()); application.put("name", remoteIssueLink.getApplicationName()); json.put("application", application);
@Override public FieldMap fieldMapFrom(final RemoteIssueLink value) { return new FieldMap("id", value.getId()) .add("issueid", value.getIssueId()) .add("globalid", value.getGlobalId()) .add("title", value.getTitle()) .add("summary", value.getSummary()) .add("url", value.getUrl()) .add("iconurl", value.getIconUrl()) .add("icontitle", value.getIconTitle()) .add("relationship", value.getRelationship()) .add("resolved", booleanToString(value.isResolved())) .add("statusname", value.getStatusName()) .add("statusdescription", value.getStatusDescription()) .add("statusiconurl", value.getStatusIconUrl()) .add("statusicontitle", value.getStatusIconTitle()) .add("statusiconlink", value.getStatusIconLink()) .add("statuscategorykey", value.getStatusCategoryKey()) .add("statuscategorycolorname", value.getStatusCategoryColorName()) .add("applicationtype", value.getApplicationType()) .add("applicationname", value.getApplicationName()); }
public RemoteIssueLinkBuilder(final RemoteIssueLink remoteIssueLink) { id(remoteIssueLink.getId()); issueId(remoteIssueLink.getIssueId()); globalId(remoteIssueLink.getGlobalId()); title(remoteIssueLink.getTitle()); summary(remoteIssueLink.getSummary()); url(remoteIssueLink.getUrl()); iconUrl(remoteIssueLink.getIconUrl()); iconTitle(remoteIssueLink.getIconTitle()); relationship(remoteIssueLink.getRelationship()); resolved(remoteIssueLink.isResolved()); statusName(remoteIssueLink.getStatusName()); statusDescription(remoteIssueLink.getStatusDescription()); statusIconUrl(remoteIssueLink.getStatusIconUrl()); statusIconTitle(remoteIssueLink.getStatusIconTitle()); statusIconLink(remoteIssueLink.getStatusIconLink()); statusCategoryKey(remoteIssueLink.getStatusCategoryKey()); statusCategoryColorName(remoteIssueLink.getStatusCategoryColorName()); applicationType(remoteIssueLink.getApplicationType()); applicationName(remoteIssueLink.getApplicationName()); }
remoteJiraIssue.getStatusIconTitle(), BaseUrlSwapper.swapRpcUrlToDisplayUrl(remoteIssueLink.getStatusIconLink(), jiraAppLink), remoteIssueLink.getApplicationType(), jiraAppLink.getName(), remoteJiraIssue.getStatusName(),