diff --git a/openbis-ipad/openBIS/openBIS.xcodeproj/project.pbxproj b/openbis-ipad/openBIS/openBIS.xcodeproj/project.pbxproj index 6eafaaea7ccbeb68c8537c5bf46f89274947b443..fdbc032e154845510a4a8e1d279627da68aa1a7c 100644 --- a/openbis-ipad/openBIS/openBIS.xcodeproj/project.pbxproj +++ b/openbis-ipad/openBIS/openBIS.xcodeproj/project.pbxproj @@ -44,6 +44,7 @@ 36F71F2E161C4F0400C87277 /* CISDOBIpadService.m in Sources */ = {isa = PBXBuildFile; fileRef = 36F71ED2161C453D00C87277 /* CISDOBIpadService.m */; }; 36F71F30161C4F0400C87277 /* CISDOBJsonRpcCall.m in Sources */ = {isa = PBXBuildFile; fileRef = 36F71ED4161C453D00C87277 /* CISDOBJsonRpcCall.m */; }; 36F71F32161C4F0400C87277 /* persistent-data-model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 36F71ED6161C453D00C87277 /* persistent-data-model.xcdatamodeld */; }; + 36F97A2E1628123F005D063E /* CISDOBOpenBisModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 36F97A2D1628123F005D063E /* CISDOBOpenBisModel.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -116,6 +117,8 @@ 36F71F1C161C4AA000C87277 /* openBISData-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "openBISData-Prefix.pch"; sourceTree = "<group>"; }; 36F71F20161C4AA000C87277 /* openBISData.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = openBISData.1; sourceTree = "<group>"; }; 36F71F25161C4AE900C87277 /* readme.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = readme.md; sourceTree = "<group>"; }; + 36F97A2C1628123F005D063E /* CISDOBOpenBisModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CISDOBOpenBisModel.h; sourceTree = "<group>"; }; + 36F97A2D1628123F005D063E /* CISDOBOpenBisModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CISDOBOpenBisModel.m; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -207,6 +210,8 @@ 36F71E9C161C3AE900C87277 /* CISDOBMasterViewController.m */, 36F71E9E161C3AE900C87277 /* CISDOBDetailViewController.h */, 36F71E9F161C3AE900C87277 /* CISDOBDetailViewController.m */, + 36F97A2C1628123F005D063E /* CISDOBOpenBisModel.h */, + 36F97A2D1628123F005D063E /* CISDOBOpenBisModel.m */, 364D509A161C6ADB00A739B0 /* DevData */, 36F71E81161C3AE900C87277 /* Supporting Files */, ); @@ -443,6 +448,7 @@ 36F71EE7161C453D00C87277 /* CISDOBIpadService.m in Sources */, 36F71EE8161C453D00C87277 /* CISDOBJsonRpcCall.m in Sources */, 36F71EE9161C453D00C87277 /* persistent-data-model.xcdatamodeld in Sources */, + 36F97A2E1628123F005D063E /* CISDOBOpenBisModel.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate b/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate index bb56a2f6ca703d822af22f183e4dad890c884509..4aafb5de0c758b66ed527e9d5bc8d8db96dc5dc4 100644 Binary files a/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate and b/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.h b/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.h index 93735ff8a678bd24fe155c055d0366beccdac6bb..0ff265b163aaa82c3d2379107d98dcb25ac460e7 100644 --- a/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.h +++ b/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.h @@ -23,6 +23,7 @@ #import <UIKit/UIKit.h> +@class CISDOBOpenBisModel; @interface CISDOBAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @@ -30,6 +31,7 @@ @property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext; @property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel; @property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator; +@property (readonly, strong, nonatomic) CISDOBOpenBisModel *openBisModel; - (void)saveContext; - (NSURL *)applicationDocumentsDirectory; diff --git a/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.m b/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.m index ec7e668ae5db531a3a4ae664a54d42d3c4816c4e..e9d068f017062c7aa61889acd3f40a2ab87f1509 100644 --- a/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.m +++ b/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.m @@ -24,28 +24,38 @@ #import "CISDOBAppDelegate.h" #import "CISDOBMasterViewController.h" +#import "CISDOBOpenBisModel.h" @implementation CISDOBAppDelegate @synthesize managedObjectContext = _managedObjectContext; @synthesize managedObjectModel = _managedObjectModel; @synthesize persistentStoreCoordinator = _persistentStoreCoordinator; +@synthesize openBisModel = _openBisModel; -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +- (CISDOBMasterViewController *)masterViewController { + CISDOBMasterViewController *controller; if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController; UINavigationController *navigationController = [splitViewController.viewControllers lastObject]; splitViewController.delegate = (id)navigationController.topViewController; UINavigationController *masterNavigationController = splitViewController.viewControllers[0]; - CISDOBMasterViewController *controller = (CISDOBMasterViewController *)masterNavigationController.topViewController; - controller.managedObjectContext = self.managedObjectContext; + controller = (CISDOBMasterViewController *)masterNavigationController.topViewController; } else { UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController; - CISDOBMasterViewController *controller = (CISDOBMasterViewController *)navigationController.topViewController; - controller.managedObjectContext = self.managedObjectContext; + controller = (CISDOBMasterViewController *)navigationController.topViewController; } + + return controller; +} + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Initialize the controller + CISDOBMasterViewController *controller = [self masterViewController]; + controller.managedObjectContext = self.managedObjectContext; return YES; } @@ -137,6 +147,16 @@ return _persistentStoreCoordinator; } +- (CISDOBOpenBisModel *)openBisModel +{ + if (_openBisModel != nil) return _openBisModel; + + _openBisModel = [[CISDOBOpenBisModel alloc] init]; + _openBisModel.managedObjectContext = self.managedObjectContext; + + return _openBisModel; +} + #pragma mark - Application's Documents directory // Returns the URL to the application's Documents directory. diff --git a/openbis-ipad/openBIS/openBIS/CISDOBMasterViewController.m b/openbis-ipad/openBIS/openBIS/CISDOBMasterViewController.m index e25a81e56589e9dee2483fb9342c9ff4bf70fc76..6f070b5d8f6fc1e34920dbcacbfeecb5e451dde4 100644 --- a/openbis-ipad/openBIS/openBIS/CISDOBMasterViewController.m +++ b/openbis-ipad/openBIS/openBIS/CISDOBMasterViewController.m @@ -147,7 +147,7 @@ CISDOBIpadEntity *object = [self.fetchedResultsController objectAtIndexPath:indexPath]; if ([object.childrenPermIds count] > 0) { UIStoryboard *storyboard = self.storyboard; - CISDOBMasterViewController *controller = [storyboard instantiateViewControllerWithIdentifier:@"Master"]; + CISDOBMasterViewController *controller = [storyboard instantiateViewControllerWithIdentifier:@"Drill"]; controller.managedObjectContext = self.managedObjectContext; controller.title = object.summaryHeader; // TODO Initialize the fetch results controller diff --git a/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.h b/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.h new file mode 100644 index 0000000000000000000000000000000000000000..d501eed5d41656f340a0a7457c664657a51a4b65 --- /dev/null +++ b/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.h @@ -0,0 +1,36 @@ +/* + * Copyright 2012 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// +// CISDOBModel.h +// openBIS +// +// Created by Ramakrishnan Chandrasekhar on 10/12/12. +// + +#import <Foundation/Foundation.h> + +/** + * \brief A model for the interaction with openBIS. + */ +@interface CISDOBOpenBisModel : NSObject { + +} + +@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController; +@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext; + + +@end diff --git a/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.m b/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.m new file mode 100644 index 0000000000000000000000000000000000000000..12867155a3cc31760b5d01caee2b34e37a1fdafd --- /dev/null +++ b/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.m @@ -0,0 +1,27 @@ +/* + * Copyright 2012 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// +// CISDOBModel.m +// openBIS +// +// Created by Ramakrishnan Chandrasekhar on 10/12/12. +// + +#import "CISDOBOpenBisModel.h" + +@implementation CISDOBOpenBisModel + +@end diff --git a/openbis-ipad/openBIS/openBIS/en.lproj/MainStoryboard_iPad.storyboard b/openbis-ipad/openBIS/openBIS/en.lproj/MainStoryboard_iPad.storyboard index 806b4def7438a74023bf6d98b34bd882abe1f412..c61bc11da637cabdee5bccbdf72b6e3b59638638 100644 --- a/openbis-ipad/openBIS/openBIS/en.lproj/MainStoryboard_iPad.storyboard +++ b/openbis-ipad/openBIS/openBIS/en.lproj/MainStoryboard_iPad.storyboard @@ -155,11 +155,11 @@ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/> <prototypes> - <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Cell" textLabel="tIi-5l-S0i" detailTextLabel="4MS-NV-KvX" style="IBUITableViewCellStyleSubtitle" id="ZSw-0O-9Pw"> + <tableViewCell contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Cell" textLabel="tIi-5l-S0i" detailTextLabel="4MS-NV-KvX" style="IBUITableViewCellStyleSubtitle" id="ZSw-0O-9Pw"> <rect key="frame" x="0.0" y="22" width="320" height="44"/> <autoresizingMask key="autoresizingMask"/> <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> - <rect key="frame" x="0.0" y="0.0" width="320" height="43"/> + <rect key="frame" x="0.0" y="0.0" width="300" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="tIi-5l-S0i"> @@ -189,11 +189,63 @@ </connections> </tableView> <navigationItem key="navigationItem" title="Entity" id="40"/> + <connections> + <segue destination="bnd-KV-hgw" kind="push" id="IOV-fM-pGv"/> + </connections> </tableViewController> <placeholder placeholderIdentifier="IBFirstResponder" id="23" sceneMemberID="firstResponder"/> </objects> <point key="canvasLocation" x="859" y="-631"/> </scene> + <!--Master View Controller - Drill--> + <scene sceneID="2DG-VL-A5G"> + <objects> + <tableViewController storyboardIdentifier="Drill" title="Drill" clearsSelectionOnViewWillAppear="NO" id="bnd-KV-hgw" customClass="CISDOBMasterViewController" sceneMemberID="viewController"> + <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="ocJ-l0-Xdp"> + <rect key="frame" x="0.0" y="64" width="320" height="704"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/> + <prototypes> + <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Cell" textLabel="R6S-e4-MrX" detailTextLabel="rFb-Zf-Pqq" style="IBUITableViewCellStyleSubtitle" id="HOg-QU-DjF"> + <rect key="frame" x="0.0" y="22" width="320" height="44"/> + <autoresizingMask key="autoresizingMask"/> + <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> + <rect key="frame" x="0.0" y="0.0" width="320" height="43"/> + <autoresizingMask key="autoresizingMask"/> + <subviews> + <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="R6S-e4-MrX"> + <rect key="frame" x="10" y="2" width="38" height="22"/> + <autoresizingMask key="autoresizingMask"/> + <fontDescription key="fontDescription" type="boldSystem" pointSize="18"/> + <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> + <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> + </label> + <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Subtitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="rFb-Zf-Pqq"> + <rect key="frame" x="10" y="24" width="47" height="18"/> + <autoresizingMask key="autoresizingMask"/> + <fontDescription key="fontDescription" type="system" pointSize="14"/> + <color key="textColor" red="0.50196078430000002" green="0.50196078430000002" blue="0.50196078430000002" alpha="1" colorSpace="calibratedRGB"/> + <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> + </label> + </subviews> + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> + </view> + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + </tableViewCell> + </prototypes> + <sections/> + <connections> + <outlet property="dataSource" destination="bnd-KV-hgw" id="1A3-FU-zTq"/> + <outlet property="delegate" destination="bnd-KV-hgw" id="wzq-ge-uU1"/> + </connections> + </tableView> + <navigationItem key="navigationItem" title="Drill" id="XAx-6Y-R2e"/> + </tableViewController> + <placeholder placeholderIdentifier="IBFirstResponder" id="xid-0A-wMU" sceneMemberID="firstResponder"/> + </objects> + <point key="canvasLocation" x="1287" y="-630"/> + </scene> <!--Navigation Controller--> <scene sceneID="50"> <objects>