Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Authentication
Find out how many teams I am part of
Get team project list
Get project details
Get project topology
Get project disciplines
Upload project thumbnail
Create an issue in the project
Get the issue list from the project
Delete all the issues from the project
Create a new pin for the issue
Get all the pins of the issue
Create/Upload a new attachment for the issue
Get the attachment list from the issue

...

Deck of Cards
idgetProjectDisciplines
Card
labelObjectiveC
Code Block
borderColorGreen
langjava
titleJSON
    Project* proj = [[ProjectManager sharedProjectManager] getProjectbyID:mProjectID];
    
    maxNodes = [[proj getAllNodesWithoutParents] count];
    
    // Don't download nodes data if we want to download them dynamically
    // we are still going to need the parents
    if ( ![[[NSUserDefaults standardUserDefaults] valueForKey:kDownloadNodesDynamically] boolValue] ) {
        
        dispatch_async(dispatch_get_main_queue(), ^(void){

            mDownloadManager = [[DownloadManager alloc] init];
            mDownloadManager.delegate = self;
            
            //get disciplines
            NSArray *disciplineIds = proj.projectsDisciplineIDs;
            for (int i = 0; i < [disciplineIds count]; i++) {
                [mDownloadManager downloadFiles:[proj getAllNodesWithoutParents] forProject:mProjectID forDiscipline:[disciplineIds objectAtIndex:i]];
            }
            
            if ([disciplineIds count] < 1) {
                [mDownloadManager downloadFiles:[proj getAllNodesWithoutParents] forProject:mProjectID forDiscipline:NULL];
            }
            
        });
    }

In "downloadFiles" method there are some logic and data storage operations and for each of the discipline you can call this snippet:


	NodeHeaderDatas *nodeDatas = [mFilesToProcess objectAtIndex:0];
	NSString *nodeidForAPICall = nodeDatas.nodeID;
    
	CommunicationSingleton *CSS = [CommunicationSingleton sharedSingleton];
	NSMutableURLRequest *requestForNodeData = [[NSMutableURLRequest alloc] init];
	NSString *nodesURL;
        if (nodeDatas.disciplineForDownloading != NULL) {
            nodesURL = [NSString stringWithFormat:
                        @"%@%@/objects/%@/disciplines/%@/geometries/threejs",
                        [CSS getDefaultAPIURL],
                        [CSS getSlug],
                        nodeidForAPICall,
                        nodeDatas.disciplineForDownloading];
        }else{
            nodesURL = [NSString stringWithFormat:
                        @"%@%@/objects/%@/geometries/threejs",
                        [CSS getDefaultAPIURL],
                        [CSS getSlug],
                        nodeidForAPICall];
            
        }
        [requestForNodeData setURL:[NSURL URLWithString:nodesURL]];
        [requestForNodeData setHTTPMethod:@"GET"];
        [requestForNodeData setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
        [requestForNodeData setValue:[CSS getAuthorization] forHTTPHeaderField:@"Authorization"];

        
        if(requestForNodeData){
            mConnection = [[NSURLConnection alloc] initWithRequest:requestForNodeData delegate:self startImmediately:YES];
        }
if (!mConnection)
        {
            // Connection Failed
        }
        else
        {
            [mConnection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
            [mConnection start];
        }
        [requestForNodeData release];

Card
labelC#


Anchor
uploadThumbnailCode
uploadThumbnailCode

Upload project thumbnail

Deck of Cards
iduploadThumbnailCode
Card
labelObjectiveC
Code Block
borderColorGreen
langjava
titleJSON

CommunicationSingleton *CSS = [CommunicationSingleton sharedSingleton];
	NSString *urlString = [[CSS getDefaultAPIURL] stringByAppendingFormat:@"%@/projects/%@/thumbnail",[CSS getSlug],currentProject.mID];
	MultIPartFormCommunication *MPC = [MultIPartFormCommunication sharedSingleton];
	if (![MPC uploadImage:imagePlaceholder.image withExtension:@"jpeg" withFileName:@"thumbnail" ToURLString:urlString]){
		[[ProjectManager sharedProjectManager] addUnUploadedThumbnailsProjectIdToList:currentProject.mID];
	}
Card
labelC#