private String getRestResource(ApplicationLink appLink) { return appLink.getUrl() + CRUCIBLE_ADMIN_REST_ENDPOINT + appLink.getRemoteKey(); }
public void execute(Map transientVars, Map args, PropertySet propertySet) throws WorkflowException { Issue issue = (Issue) transientVars.get("issue"); String projectKey = issue.getProjectObject().getKey(); ApplicationLink crucible = appLinksManager.getLinkedApplication(Application.CRUCIBLE.name(), projectKey); Request<?> request = requestFactory.createRequest(Request.MethodType.POST, crucible.getUrl() + CREATE_REVIEW_PATH + "?key=" + crucible.getRemoteKey() + "&issueKey=" + issue.getKey()); request.addTrustedTokenAuthentication(); try { request.execute(); } catch (ResponseException re) { log.error("Error creating code review on Crucible", re); } } }
/** * @inheritDoc */ public ApplicationLink linkProjectToRemoteApp(final String localKey, final String applicationType, final String remoteKey) { final Application application = Application.fromString(applicationType); // - check if there is already link in place ApplicationLink applicationInfo = getLinkedApplication(application.toString(), localKey); if (applicationInfo == null) { // there is no link yet, let's create one final ApplicationInstance primaryApplication = getPrimaryApplicationInstance(application.toString()); if (primaryApplication == null) { throw new RuntimeException("No primary instance of '" + application.toString() + "' defined."); } setLinkedApplication(application.toString(), localKey, primaryApplication.getName(), remoteKey); applicationInfo = new DefaultApplicationLink(primaryApplication.getName(), remoteKey, primaryApplication.getUrl(), primaryApplication.getProperties()); } if (applicationInfo.getUrl() == null) { throw new RuntimeException("No URL provided for application '" + applicationInfo.getName() + "' of type '" + application.toString() + "'"); } return applicationInfo; }
try deleteRepository(project.getKey(), applicationLink.getUrl(), login, password, commitMessage); ProjectOperationResult result = new ProjectOperationResult(Application.SVN, i18nResolver.getText( "studio.project.svn.repository"),
appLink.getUrl() + FISHEYE_SUBSCRIPTION_URL + appLink.getRemoteKey() + "/commit"); request.addRequestParameters("url", JIRA_NOTIFICIATION_URL, "authenticationType", "TRUSTED_APPS", "username", ctx.getUser().getName());
appLink.getUrl() + FISHEYE_SUBSCRIPTION_URL + appLink.getRemoteKey() + "/commit"); final String baseUrl = ComponentLocator.getComponent(ApplicationProperties.class).getBaseUrl(); request.addRequestParameters("url", baseUrl + JIRA_NOTIFICIATION_URL);
public String doSynchronize() { final ApplicationLink localLink = appLinksManager.getLinkedApplication(app, getKey()); final String restUrl = localLink.getUrl() + "/plugins/servlet/applinks/projectlinks"; final Request<?> request = requestFactory.createRequest(Request.MethodType.POST, restUrl + "?key=" + localLink.getRemoteKey() + "&application=JIRA"); final ApplicationLink remoteLink = new DefaultApplicationLink("jira", getKey(), null, null); request.setRequestBody(XStreamUtils.toXML(remoteLink)); request.addTrustedTokenAuthentication(); try { request.execute(); } catch (final ResponseException re) { return getRedirect("ViewProject.jspa?message=editprojectlinks.error.synchronize&pid=" + getPid()); } return getRedirect("ViewProject.jspa?message=editprojectlinks.result.synchronized&pid=" + getPid()); }
final String restUrl = localLink.getUrl() + "/plugins/servlet/applinks/projectlinks"; final Request<?> request = createRequest(localLink, restUrl); final ApplicationLink remoteLink = new DefaultApplicationLink("jira", getKey(), null, null);