本文整理汇总了Java中com.taskadapter.redmineapi.bean.Issue.getAttachments方法的典型用法代码示例。如果您正苦于以下问题:Java Issue.getAttachments方法的具体用法?Java Issue.getAttachments怎么用?Java Issue.getAttachments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.taskadapter.redmineapi.bean.Issue
的用法示例。
在下文中一共展示了Issue.getAttachments方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addMissingInformationsToIssueFromCachedConfiguration
import com.taskadapter.redmineapi.bean.Issue; //导入方法依赖的package包/类
private void addMissingInformationsToIssueFromCachedConfiguration(Issue issue,
CachedRepositoryConfiguration configuration)
{
//Data transfer object members of issue are not populated with all the info,
//we should hit the server to retrieve missing fields but instead we hit our
//local cache.
issue.setProject(configuration.getProjectById(issue.getProject().getId()));
issue.setAssignee(configuration.getUserById(issue.getAssignee().getId()));
issue.setAuthor(configuration.getUserById(issue.getAuthor().getId()));
for(Journal j : issue.getJournals())
{
j.setUser(configuration.getUserById(j.getUser().getId()));
}
for(Attachment a : issue.getAttachments())
{
a.setAuthor(configuration.getUserById(a.getAuthor().getId()));
}
}
示例2: writeIssue
import com.taskadapter.redmineapi.bean.Issue; //导入方法依赖的package包/类
public static void writeIssue(Issue issue, final JSONWriter writer) throws JSONException {
JsonOutput.addIfNotNull(writer, "id", issue.getId());
JsonOutput.addIfNotNull(writer, "subject", issue.getSubject());
JsonOutput.addIfNotNull(writer, "parent_issue_id", issue.getParentId());
JsonOutput.addIfNotNull(writer, "estimated_hours",
issue.getEstimatedHours());
JsonOutput.addIfNotNull(writer, "spent_hours", issue.getSpentHours());
if (issue.getAssignee() != null)
JsonOutput.addIfNotNull(writer, "assigned_to_id", issue
.getAssignee().getId());
JsonOutput.addIfNotNull(writer, "priority_id", issue.getPriorityId());
JsonOutput.addIfNotNull(writer, "done_ratio", issue.getDoneRatio());
if (issue.getProject() != null) {
// Checked in Redmine 2.6.0: updating issues based on
// identifier fails and only using the project id works.
// As the identifier usage is used in several places, this
// case selection is introduced. The identifier is
// used, if no real ID is provided
if (issue.getProject().getId() != null) {
JsonOutput.addIfNotNull(writer, "project_id", issue.getProject()
.getId());
} else {
throw new IllegalArgumentException("Project ID must be set on issue. " +
"You can use a factory method to create Issue object in memory: IssueFactory.create(projectId, subject)");
}
}
if (issue.getAuthor() != null)
JsonOutput.addIfNotNull(writer, "author_id", issue.getAuthor().getId());
addShort2(writer, "start_date", issue.getStartDate());
addIfNotNullShort2(writer, "due_date", issue.getDueDate());
if (issue.getTracker() != null)
JsonOutput.addIfNotNull(writer, "tracker_id", issue.getTracker().getId());
JsonOutput.addIfNotNull(writer, "description", issue.getDescription());
addIfNotNullFull(writer, "created_on", issue.getCreatedOn());
addIfNotNullFull(writer, "updated_on", issue.getUpdatedOn());
JsonOutput.addIfNotNull(writer, "status_id", issue.getStatusId());
if (issue.getTargetVersion() != null)
JsonOutput.addIfNotNull(writer, "fixed_version_id", issue
.getTargetVersion().getId());
if (issue.getCategory() != null)
JsonOutput.addIfNotNull(writer, "category_id", issue.getCategory().getId());
JsonOutput.addIfNotNull(writer, "notes", issue.getNotes());
writeCustomFields(writer, issue.getCustomFields());
Collection<Watcher> issueWatchers = issue.getWatchers();
if (issueWatchers != null && !issueWatchers.isEmpty()) {
writeWatchers(writer, issueWatchers);
}
final List<Attachment> uploads = new ArrayList<Attachment>();
for (Attachment attachment : issue.getAttachments()) {
if (attachment.getToken() != null) {
uploads.add(attachment);
}
}
JsonOutput.addArrayIfNotEmpty(writer, "uploads", uploads,
UPLOAD_WRITER);
/*
* Journals and Relations cannot be set for an issue during creation or
* updates.
*/
}
示例3: writeIssue
import com.taskadapter.redmineapi.bean.Issue; //导入方法依赖的package包/类
public static void writeIssue(Issue issue, final JSONStringer writer)
throws JSONException {
JsonOutput.addIfNotNull(writer, "id", issue.getId());
JsonOutput.addIfNotNull(writer, "subject", issue.getSubject());
JsonOutput.addIfNotNull(writer, "parent_issue_id", issue.getParentId());
JsonOutput.addIfNotNull(writer, "estimated_hours",
issue.getEstimatedHours());
JsonOutput.addIfNotNull(writer, "spent_hours", issue.getSpentHours());
if (issue.getAssignee() != null)
JsonOutput.addIfNotNull(writer, "assigned_to_id", issue
.getAssignee().getId());
JsonOutput.addIfNotNull(writer, "priority_id", issue.getPriorityId());
JsonOutput.addIfNotNull(writer, "done_ratio", issue.getDoneRatio());
if (issue.getProject() != null)
JsonOutput.addIfNotNull(writer, "project_id", issue.getProject()
.getIdentifier());
if (issue.getAuthor() != null)
JsonOutput.addIfNotNull(writer, "author_id", issue.getAuthor()
.getId());
addShort2(writer, "start_date", issue.getStartDate());
addIfNotNullShort2(writer, "due_date", issue.getDueDate());
if (issue.getTracker() != null)
JsonOutput.addIfNotNull(writer, "tracker_id", issue.getTracker()
.getId());
JsonOutput.addIfNotNull(writer, "description", issue.getDescription());
addIfNotNullFull(writer, "created_on", issue.getCreatedOn());
addIfNotNullFull(writer, "updated_on", issue.getUpdatedOn());
JsonOutput.addIfNotNull(writer, "status_id", issue.getStatusId());
if (issue.getTargetVersion() != null)
JsonOutput.addIfNotNull(writer, "fixed_version_id", issue
.getTargetVersion().getId());
if (issue.getCategory() != null)
JsonOutput.addIfNotNull(writer, "category_id", issue.getCategory()
.getId());
JsonOutput.addIfNotNull(writer, "notes", issue.getNotes());
writeCustomFields(writer, issue.getCustomFields());
if (issue.getAttachments() != null && issue.getAttachments().size() > 0) {
final List<Attachment> uploads = new ArrayList<Attachment>();
for (Attachment attach : issue.getAttachments())
if (attach.getToken() != null)
uploads.add(attach);
JsonOutput.addArrayIfNotEmpty(writer, "uploads", uploads,
UPLOAD_WRITER);
}
/*
* Journals and Relations cannot be set for an issue during creation or
* updates.
*/
}