Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Merge dev and master #36

Merged
merged 8 commits into from

3 participants

Commits on Apr 17, 2012
  1. @meSte

    Update DIOSView.m

    meSte authored
  2. @meSte

    Update README.md

    meSte authored
  3. @meSte

    Update README.md

    meSte authored
  4. @meSte

    Update DIOSView.m

    meSte authored
  5. @meSte

    Update DIOSView.m

    meSte authored
  6. Merge pull request #32 from meSte/master

    authored
    Generic support for views params
Commits on Apr 25, 2012
  1. @voidberg

    Support for system.connect

    voidberg authored
  2. Merge pull request #35 from voidberg/master

    authored
    Support for system.connect
This page is out of date. Refresh to see the latest.
Showing with 110 additions and 1 deletion.
  1. +46 −0 DIOSSystem.h
  2. +56 −0 DIOSSystem.m
  3. +8 −1 DIOSView.m
View
46 DIOSSystem.h
@@ -0,0 +1,46 @@
+//
+// DIOSSystem.h
+//
+// ***** BEGIN LICENSE BLOCK *****
+// Version: MPL 1.1/GPL 2.0
+//
+// The contents of this file are subject to the Mozilla Public License Version
+// 1.1 (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+// http://www.mozilla.org/MPL/
+//
+// Software distributed under the License is distributed on an "AS IS" basis,
+// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+// for the specific language governing rights and limitations under the
+// License.
+//
+// The Original Code is Kyle Browning, released June 27, 2010.
+//
+// The Initial Developer of the Original Code is
+// Kyle Browning
+// Portions created by the Initial Developer are Copyright (C) 2010
+// the Initial Developer. All Rights Reserved.
+//
+// Contributor(s):
+// - Alexandru Badiu (andu@ctrlz.ro)
+//
+// Alternatively, the contents of this file may be used under the terms of
+// the GNU General Public License Version 2 or later (the "GPL"), in which
+// case the provisions of the GPL are applicable instead of those above. If
+// you wish to allow use of your version of this file only under the terms of
+// the GPL and not to allow others to use your version of this file under the
+// MPL, indicate your decision by deleting the provisions above and replacing
+// them with the notice and other provisions required by the GPL. If you do
+// not delete the provisions above, a recipient may use your version of this
+// file under either the MPL or the GPL.
+//
+// ***** END LICENSE BLOCK *****
+
+#import "AFHTTPRequestOperation.h"
+
+@interface DIOSSystem : NSObject
+
+- (void)systemConnectwithSuccess: (void (^)(AFHTTPRequestOperation *operation, id responseObject)) success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error)) failure;
+
+@end
View
56 DIOSSystem.m
@@ -0,0 +1,56 @@
+//
+// DIOSSystem.m
+//
+// ***** BEGIN LICENSE BLOCK *****
+// Version: MPL 1.1/GPL 2.0
+//
+// The contents of this file are subject to the Mozilla Public License Version
+// 1.1 (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+// http://www.mozilla.org/MPL/
+//
+// Software distributed under the License is distributed on an "AS IS" basis,
+// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+// for the specific language governing rights and limitations under the
+// License.
+//
+// The Original Code is Kyle Browning, released June 27, 2010.
+//
+// The Initial Developer of the Original Code is
+// Kyle Browning
+// Portions created by the Initial Developer are Copyright (C) 2010
+// the Initial Developer. All Rights Reserved.
+//
+// Contributor(s):
+// - Alexandru Badiu (andu@ctrlz.ro)
+//
+// Alternatively, the contents of this file may be used under the terms of
+// the GNU General Public License Version 2 or later (the "GPL"), in which
+// case the provisions of the GPL are applicable instead of those above. If
+// you wish to allow use of your version of this file only under the terms of
+// the GPL and not to allow others to use your version of this file under the
+// MPL, indicate your decision by deleting the provisions above and replacing
+// them with the notice and other provisions required by the GPL. If you do
+// not delete the provisions above, a recipient may use your version of this
+// file under either the MPL or the GPL.
+//
+// ***** END LICENSE BLOCK *****
+
+
+#import "DIOSSystem.h"
+#import "DIOSSession.h"
+
+
+@implementation DIOSSystem
+
+#pragma mark UserGets
+- (void)systemConnectwithSuccess: (void (^)(AFHTTPRequestOperation *operation, id responseObject)) success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error)) failure {
+
+ [[DIOSSession sharedSession] postPath:[NSString stringWithFormat:@"%@/system/connect", kDiosEndpoint]
+ parameters:nil
+ success:success
+ failure:failure];
+}
+
+@end
View
9 DIOSView.m
@@ -38,6 +38,13 @@
@implementation DIOSView
- (void)viewGet:(NSDictionary *)params success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error)) failure {
- [[DIOSSession sharedSession] getPath:[NSString stringWithFormat:@"%@/%@/%@", kDiosEndpoint, kDiosBaseView, [params objectForKey:@"view_name"]] parameters:nil success:success failure:failure];
+ NSMutableString *path = [NSMutableString stringWithFormat:@"%@/%@/%@?", kDiosEndpoint, kDiosBaseView, [params objectForKey:@"view_name"]];
+ for (NSString *key in params) {
+ id value = [params objectForKey:key];
+ if (![key isEqualToString:@"view_name"]) {
+ [path appendFormat:@"%@=%@&", key, value];
+ }
+ }
+ [[DIOSSession sharedSession] getPath:path parameters:nil success:success failure:failure];
}
@end
Something went wrong with that request. Please try again.