Skip to content

Commit

Permalink
More updates to Atlassian example
Browse files Browse the repository at this point in the history
  • Loading branch information
cnstoll committed Jun 25, 2014
1 parent 67139cb commit b9a391f
Show file tree
Hide file tree
Showing 13 changed files with 355 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@
26FA0EE519551E07008068A2 /* MMJSONServer.m in Sources */ = {isa = PBXBuildFile; fileRef = 26FA0ED919551E07008068A2 /* MMJSONServer.m */; };
26FA0F0919551E91008068A2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26FA0F0419551E91008068A2 /* AppDelegate.swift */; };
26FA0F0A19551E91008068A2 /* PlansViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26FA0F0819551E91008068A2 /* PlansViewController.swift */; };
26FA0F0C19551EAE008068A2 /* ATLRecord.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26FA0F0B19551EAE008068A2 /* ATLRecord.swift */; };
26FA0F1019552050008068A2 /* Plan.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26FA0F0F19552050008068A2 /* Plan.swift */; };
26FA0F1219552760008068A2 /* plans.json in Resources */ = {isa = PBXBuildFile; fileRef = 26FA0F1119552760008068A2 /* plans.json */; };
26FC7C27195A5D8D0066A195 /* issue.json in Resources */ = {isa = PBXBuildFile; fileRef = 26FC7C26195A5D8D0066A195 /* issue.json */; };
26FC7C31195A64130066A195 /* InwardLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26FC7C2B195A61E10066A195 /* InwardLink.swift */; };
26FC7C32195A641F0066A195 /* Plan.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26FA0F0F19552050008068A2 /* Plan.swift */; };
26FC7C33195A64260066A195 /* ATLRecord.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26FA0F0B19551EAE008068A2 /* ATLRecord.swift */; };
26FC7C38195A64600066A195 /* Link.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26FC7C35195A64600066A195 /* Link.swift */; };
26FC7C39195A64600066A195 /* OutwardLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26FC7C36195A64600066A195 /* OutwardLink.swift */; };
26FC7C3B195A65050066A195 /* Issue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26FC7C3A195A65050066A195 /* Issue.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -60,6 +65,11 @@
26FA0F0E19551FB1008068A2 /* MMRecordAtlassian-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MMRecordAtlassian-Bridging-Header.h"; sourceTree = "<group>"; };
26FA0F0F19552050008068A2 /* Plan.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Plan.swift; sourceTree = "<group>"; };
26FA0F1119552760008068A2 /* plans.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = plans.json; sourceTree = "<group>"; };
26FC7C26195A5D8D0066A195 /* issue.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = issue.json; sourceTree = "<group>"; };
26FC7C2B195A61E10066A195 /* InwardLink.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InwardLink.swift; sourceTree = "<group>"; };
26FC7C35195A64600066A195 /* Link.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Link.swift; sourceTree = "<group>"; };
26FC7C36195A64600066A195 /* OutwardLink.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OutwardLink.swift; sourceTree = "<group>"; };
26FC7C3A195A65050066A195 /* Issue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Issue.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -168,8 +178,13 @@
isa = PBXGroup;
children = (
26FA0E9C19551BDB008068A2 /* MMRecordAtlassian.xcdatamodeld */,
26FC7C2B195A61E10066A195 /* InwardLink.swift */,
26FC7C3A195A65050066A195 /* Issue.swift */,
26FC7C35195A64600066A195 /* Link.swift */,
26FC7C36195A64600066A195 /* OutwardLink.swift */,
26FA0F0B19551EAE008068A2 /* ATLRecord.swift */,
26FA0F0F19552050008068A2 /* Plan.swift */,
26FC7C26195A5D8D0066A195 /* issue.json */,
26FA0F1119552760008068A2 /* plans.json */,
);
path = Model;
Expand Down Expand Up @@ -253,6 +268,7 @@
26FA0F1219552760008068A2 /* plans.json in Resources */,
26FA0EA319551BDB008068A2 /* Main.storyboard in Resources */,
26FA0EA519551BDB008068A2 /* Images.xcassets in Resources */,
26FC7C27195A5D8D0066A195 /* issue.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -263,20 +279,24 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
26FC7C38195A64600066A195 /* Link.swift in Sources */,
26FC7C32195A641F0066A195 /* Plan.swift in Sources */,
26AF57BA195A58FF00D1D3A7 /* IssuesViewController.swift in Sources */,
26FC7C3B195A65050066A195 /* Issue.swift in Sources */,
26FA0EDD19551E07008068A2 /* MMRecord.m in Sources */,
26FA0EE519551E07008068A2 /* MMJSONServer.m in Sources */,
26FA0F1019552050008068A2 /* Plan.swift in Sources */,
26FA0F0A19551E91008068A2 /* PlansViewController.swift in Sources */,
26FC7C39195A64600066A195 /* OutwardLink.swift in Sources */,
26FA0EE419551E07008068A2 /* MMServerPageManager.m in Sources */,
26FA0EE119551E07008068A2 /* MMRecordRepresentation.m in Sources */,
26FA0F0919551E91008068A2 /* AppDelegate.swift in Sources */,
26FA0EDF19551E07008068A2 /* MMRecordMarshaler.m in Sources */,
26FA0EE019551E07008068A2 /* MMRecordProtoRecord.m in Sources */,
26FA0F0C19551EAE008068A2 /* ATLRecord.swift in Sources */,
26FC7C33195A64260066A195 /* ATLRecord.swift in Sources */,
26FA0EE219551E07008068A2 /* MMRecordResponse.m in Sources */,
26FA0E9E19551BDB008068A2 /* MMRecordAtlassian.xcdatamodeld in Sources */,
26FA0EDE19551E07008068A2 /* MMRecordCache.m in Sources */,
26FC7C31195A64130066A195 /* InwardLink.swift in Sources */,
26FA0EE319551E07008068A2 /* MMServer.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
ATLRecord.registerServerClass(MMJSONServer);
MMJSONServer.registerResourceName("plans", forPathComponent: "/plans")
MMJSONServer.registerResourceName("issue", forPathComponent: "/issue")

return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@
import CoreData

class ATLRecord: MMRecord {
override class func keyPathForResponseObject() -> String {
return "plans.plan"
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// MMRecordAtlassian.InwardLink
// MMRecordAtlassian
//
// Created by Conrad Stoll on 6/24/14.
// Copyright (c) 2014 Mutual Mobile. All rights reserved.
//

import CoreData

class InwardLink: Link {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// MMRecordAtlassian.Issue
// MMRecordAtlassian
//
// Created by Conrad Stoll on 6/24/14.
// Copyright (c) 2014 Mutual Mobile. All rights reserved.
//

import CoreData

class Issue: ATLRecord {
@NSManaged var key: NSString
@NSManaged var id: NSString
@NSManaged var issueLinks: NSSet
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// MMRecordAtlassian.Link
// MMRecordAtlassian
//
// Created by Conrad Stoll on 6/24/14.
// Copyright (c) 2014 Mutual Mobile. All rights reserved.
//

import CoreData

class Link: ATLRecord {
@NSManaged var name: NSString
@NSManaged var id: NSString
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// MMRecordAtlassian.h
// MMRecordAtlassian
//
// Created by Conrad Stoll on 6/24/14.
// Copyright (c) 2014 Mutual Mobile. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>

@class MMRecordAtlassian.Issue;

@interface MMRecordAtlassian : NSManagedObject

@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSString * key;
@property (nonatomic, retain) NSString * id;
@property (nonatomic, retain) MMRecordAtlassian.Issue *issue;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// MMRecordAtlassian.OutwardLink
// MMRecordAtlassian
//
// Created by Conrad Stoll on 6/24/14.
// Copyright (c) 2014 Mutual Mobile. All rights reserved.
//
import CoreData

class OutwardLink: Link {
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ import CoreData
class Plan: ATLRecord {
@NSManaged var name: NSString
@NSManaged var id: NSString

override class func keyPathForResponseObject() -> String {
return "plans.plan"
}
}
200 changes: 200 additions & 0 deletions Examples/MMRecordAtlassian/MMRecordAtlassian/Classes/Model/issue.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
{
"expand": "renderedFields,names,schema,transitions,operations,editmeta,changelog",
"id": "10002",
"self": "http:https://www.example.com/jira/rest/api/2/issue/10002",
"key": "EX-1",
"fields": {
"sub-tasks": [
{
"id": "10000",
"type": {
"id": "10000",
"name": "",
"inward": "Parent",
"outward": "Sub-task"
},
"outwardIssue": {
"id": "10003",
"key": "EX-2",
"self": "http:https://www.example.com/jira/rest/api/2/issue/EX-2",
"fields": {
"status": {
"iconUrl": "http:https://www.example.com/jira//images/icons/statuses/open.png",
"name": "Open"
}
}
}
}
],
"timetracking": {
"originalEstimate": "10m",
"remainingEstimate": "3m",
"timeSpent": "6m",
"originalEstimateSeconds": 600,
"remainingEstimateSeconds": 200,
"timeSpentSeconds": 400
},
"project": {
"self": "http:https://www.example.com/jira/rest/api/2/project/EX",
"id": "10000",
"key": "EX",
"name": "Example",
"avatarUrls": {
"24x24": "http:https://www.example.com/jira/secure/projectavatar?size=small&pid=10000",
"16x16": "http:https://www.example.com/jira/secure/projectavatar?size=xsmall&pid=10000",
"32x32": "http:https://www.example.com/jira/secure/projectavatar?size=medium&pid=10000",
"48x48": "http:https://www.example.com/jira/secure/projectavatar?size=large&pid=10000"
}
},
"updated": 1,
"description": "example bug report",
"issuelinks": [
{
"id": "10001",
"type": {
"id": "10000",
"name": "Dependent",
"inward": "depends on",
"outward": "is depended by"
},
"outwardIssue": {
"id": "10004L",
"key": "PRJ-2",
"self": "http:https://www.example.com/jira/rest/api/2/issue/PRJ-2",
"fields": {
"status": {
"iconUrl": "http:https://www.example.com/jira//images/icons/statuses/open.png",
"name": "Open"
}
}
}
},
{
"id": "10002",
"type": {
"id": "10000",
"name": "Dependent",
"inward": "depends on",
"outward": "is depended by"
},
"inwardIssue": {
"id": "10004",
"key": "PRJ-3",
"self": "http:https://www.example.com/jira/rest/api/2/issue/PRJ-3",
"fields": {
"status": {
"iconUrl": "http:https://www.example.com/jira//images/icons/statuses/open.png",
"name": "Open"
}
}
}
}
],
"attachment": [
{
"self": "http:https://www.example.com/jira/rest/api/2.0/attachments/10000",
"filename": "picture.jpg",
"author": {
"self": "http:https://www.example.com/jira/rest/api/2/user?username=fred",
"name": "fred",
"avatarUrls": {
"24x24": "http:https://www.example.com/jira/secure/useravatar?size=small&ownerId=fred",
"16x16": "http:https://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred",
"32x32": "http:https://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred",
"48x48": "http:https://www.example.com/jira/secure/useravatar?size=large&ownerId=fred"
},
"displayName": "Fred F. User",
"active": false
},
"created": "2014-06-11T07:33:42.009+0000",
"size": 23123,
"mimeType": "image/jpeg",
"content": "http:https://www.example.com/jira/attachments/10000",
"thumbnail": "http:https://www.example.com/jira/secure/thumbnail/10000"
}
],
"watcher": {
"self": "http:https://www.example.com/jira/rest/api/2/issue/EX-1/watchers",
"isWatching": false,
"watchCount": 1,
"watchers": [
{
"self": "http:https://www.example.com/jira/rest/api/2/user?username=fred",
"name": "fred",
"avatarUrls": {
"24x24": "http:https://www.example.com/jira/secure/useravatar?size=small&ownerId=fred",
"16x16": "http:https://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred",
"32x32": "http:https://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred",
"48x48": "http:https://www.example.com/jira/secure/useravatar?size=large&ownerId=fred"
},
"displayName": "Fred F. User",
"active": false
}
]
},
"comment": [
{
"self": "http:https://www.example.com/jira/rest/api/2/issue/10010/comment/10000",
"id": "10000",
"author": {
"self": "http:https://www.example.com/jira/rest/api/2/user?username=fred",
"name": "fred",
"displayName": "Fred F. User",
"active": false
},
"body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semper quam laoreet nisi egestas at posuere augue semper.",
"updateAuthor": {
"self": "http:https://www.example.com/jira/rest/api/2/user?username=fred",
"name": "fred",
"displayName": "Fred F. User",
"active": false
},
"created": "2014-06-11T07:33:42.192+0000",
"updated": "2014-06-11T07:33:42.192+0000",
"visibility": {
"type": "role",
"value": "Administrators"
}
}
],
"worklog": [
{
"self": "http:https://www.example.com/jira/rest/api/2/issue/10010/worklog/10000",
"author": {
"self": "http:https://www.example.com/jira/rest/api/2/user?username=fred",
"name": "fred",
"displayName": "Fred F. User",
"active": false
},
"updateAuthor": {
"self": "http:https://www.example.com/jira/rest/api/2/user?username=fred",
"name": "fred",
"displayName": "Fred F. User",
"active": false
},
"comment": "I did some work here.",
"visibility": {
"type": "group",
"value": "jira-developers"
},
"started": "2014-06-11T07:33:42.685+0000",
"timeSpent": "3h 20m",
"timeSpentSeconds": 12000,
"id": "100028"
}
]
},
"names": {
"sub-tasks": "sub-tasks",
"timetracking": "timetracking",
"project": "project",
"updated": "updated",
"description": "description",
"issuelinks": "issuelinks",
"attachment": "attachment",
"watcher": "watcher",
"comment": "comment",
"worklog": "worklog"
},
"schema": {}
}
Loading

0 comments on commit b9a391f

Please sign in to comment.