diff --git a/.gitignore b/.gitignore index c6b66fa..8fd606b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -**/.project.json \ No newline at end of file +**/.project.json +**/.typings \ No newline at end of file diff --git a/Sample_Applications/MDK_Demo_Application/.typings/IClientAPI.d.ts b/Sample_Applications/MDK_Demo_Application/.typings/IClientAPI.d.ts index fe46a95..42dab67 100644 --- a/Sample_Applications/MDK_Demo_Application/.typings/IClientAPI.d.ts +++ b/Sample_Applications/MDK_Demo_Application/.typings/IClientAPI.d.ts @@ -177,7 +177,7 @@ interface IClientAPI { */ isDemoMode(): Boolean; /** - * This method is to get AppId used for application in Mobile Services on SAP Cloud Platform. + * This method is to get AppId used for application in SAP Mobile Services. */ getMobileServiceAppId(): string; /** @@ -186,7 +186,7 @@ interface IClientAPI { */ getMobileServiceEndpointUrl(): string; /** - * This method is to send a request to application's mobile service on SAP Cloud Platform. + * This method is to send a request to application's SAP Mobile Services. * * * Example of the `params` parameter:
* ```json @@ -200,7 +200,7 @@ interface IClientAPI { * } * ``` * - * @param path Relative path of request via application's mobile services on SAP Cloud Platform. + * @param path Relative path of request via application's SAP Mobile Services. * @param params Optional. An object consists of `method`, `header`, and `body` of request.
* Note: If params is not given, request is set as GET method by default. See description above for the example.
*
  • `method` is string representing the HTTP Method to use. Supported value for methods are: @@ -210,7 +210,7 @@ interface IClientAPI { */ sendRequest(path: string, params?: any): Promise; /** - * Send a request to application's mobile service on SAP Cloud Platform + * Send a request to application's SAP Mobile Services * @deprecated - use the new sendRequest API */ sendMobileServiceRequest(path: string, params?: any): Promise; diff --git a/Showcase_Apps/PartialUploadDemo/Actions/CloseModalPage_Cancel.action b/Showcase_Apps/PartialUploadDemo/Actions/CloseModalPage_Cancel.action new file mode 100644 index 0000000..687d745 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/CloseModalPage_Cancel.action @@ -0,0 +1,5 @@ +{ + "DismissModal": "Action.Type.ClosePage.Canceled", + "CancelPendingActions": true, + "_Type": "Action.Type.ClosePage" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/CloseModalPage_Complete.action b/Showcase_Apps/PartialUploadDemo/Actions/CloseModalPage_Complete.action new file mode 100644 index 0000000..accb404 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/CloseModalPage_Complete.action @@ -0,0 +1,5 @@ +{ + "DismissModal": "Action.Type.ClosePage.Completed", + "CancelPendingActions": false, + "_Type": "Action.Type.ClosePage" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/ClosePage.action b/Showcase_Apps/PartialUploadDemo/Actions/ClosePage.action new file mode 100644 index 0000000..73ec62e --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/ClosePage.action @@ -0,0 +1,3 @@ +{ + "_Type": "Action.Type.ClosePage" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/CreateEntityFailureMessage.action b/Showcase_Apps/PartialUploadDemo/Actions/CreateEntityFailureMessage.action new file mode 100644 index 0000000..433acea --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/CreateEntityFailureMessage.action @@ -0,0 +1,6 @@ +{ + "Message": "Create entity failure - {#ActionResults:create/error}", + "Duration": 7, + "Animated": true, + "_Type": "Action.Type.BannerMessage" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/CreateEntitySuccessMessage.action b/Showcase_Apps/PartialUploadDemo/Actions/CreateEntitySuccessMessage.action new file mode 100644 index 0000000..12165f2 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/CreateEntitySuccessMessage.action @@ -0,0 +1,8 @@ +{ + "Animated": true, + "Duration": 2, + "Message": "Entity created", + "IsIconHidden": true, + "OnSuccess": "/PartialUpload/Actions/CloseModalPage_Complete.action", + "_Type": "Action.Type.ToastMessage" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Customers/CustomerUploadProgress.action b/Showcase_Apps/PartialUploadDemo/Actions/Customers/CustomerUploadProgress.action new file mode 100644 index 0000000..8668ba7 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Customers/CustomerUploadProgress.action @@ -0,0 +1,8 @@ +{ + "Animated": true, + "CompletionMessage": "Upload Complete", + "CompletionTimeout": 5, + "Message": "Customer Upload in Progres...", + "OnSuccess": "/PartialUpload/Actions/Customers/UploadCustomerOnly.action", + "_Type": "Action.Type.ProgressBanner" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Customers/Customers_CreateEntity.action b/Showcase_Apps/PartialUploadDemo/Actions/Customers/Customers_CreateEntity.action new file mode 100644 index 0000000..6696ea4 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Customers/Customers_CreateEntity.action @@ -0,0 +1,28 @@ +{ + "ActionResult": { + "_Name": "create" + }, + "OnFailure": "/PartialUpload/Actions/CreateEntityFailureMessage.action", + "OnSuccess": "/PartialUpload/Actions/CreateEntitySuccessMessage.action", + "Properties": { + "City": "#Control:City/#Value", + "Country": "#Control:Country/#Value", + "CustomerId": "#Control:CustomerId/#Value", + "DateOfBirth": "#Control:DateOfBirth/#Value", + "EmailAddress": "#Control:EmailAddress/#Value", + "FirstName": "#Control:FirstName/#Value", + "HouseNumber": "#Control:HouseNumber/#Value", + "LastName": "#Control:LastName/#Value", + "PhoneNumber": "#Control:PhoneNumber/#Value", + "PostalCode": "#Control:PostalCode/#Value", + "Street": "#Control:Street/#Value" + }, + "RequestOptions": { + "UploadCategory": "Customer" + }, + "Target": { + "EntitySet": "Customers", + "Service": "/PartialUpload/Services/Sample.service" + }, + "_Type": "Action.Type.ODataService.CreateEntity" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Customers/Customers_DeleteEntity.action b/Showcase_Apps/PartialUploadDemo/Actions/Customers/Customers_DeleteEntity.action new file mode 100644 index 0000000..69d3f60 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Customers/Customers_DeleteEntity.action @@ -0,0 +1,16 @@ +{ + "ActionResult": { + "_Name": "delete" + }, + "OnFailure": "/PartialUpload/Actions/DeleteEntityFailureMessage.action", + "OnSuccess": "/PartialUpload/Actions/DeleteEntitySuccessMessage.action", + "RequestOptions": { + "UploadCategory": "Customer" + }, + "Target": { + "EntitySet": "Customers", + "ReadLink": "{@odata.readLink}", + "Service": "/PartialUpload/Services/Sample.service" + }, + "_Type": "Action.Type.ODataService.DeleteEntity" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Customers/Customers_UpdateEntity.action b/Showcase_Apps/PartialUploadDemo/Actions/Customers/Customers_UpdateEntity.action new file mode 100644 index 0000000..61a2d80 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Customers/Customers_UpdateEntity.action @@ -0,0 +1,28 @@ +{ + "ActionResult": { + "_Name": "update" + }, + "OnFailure": "/PartialUpload/Actions/UpdateEntityFailureMessage.action", + "OnSuccess": "/PartialUpload/Actions/UpdateEntitySuccessMessage.action", + "Properties": { + "City": "#Control:City/#Value", + "Country": "#Control:Country/#Value", + "DateOfBirth": "#Control:DateOfBirth/#Value", + "EmailAddress": "#Control:EmailAddress/#Value", + "FirstName": "#Control:FirstName/#Value", + "HouseNumber": "#Control:HouseNumber/#Value", + "LastName": "#Control:LastName/#Value", + "PhoneNumber": "#Control:PhoneNumber/#Value", + "PostalCode": "#Control:PostalCode/#Value", + "Street": "#Control:Street/#Value" + }, + "RequestOptions": { + "UploadCategory": "Customer" + }, + "Target": { + "EntitySet": "Customers", + "ReadLink": "{@odata.readLink}", + "Service": "/PartialUpload/Services/Sample.service" + }, + "_Type": "Action.Type.ODataService.UpdateEntity" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Customers/NavToCustomers_Create.action b/Showcase_Apps/PartialUploadDemo/Actions/Customers/NavToCustomers_Create.action new file mode 100644 index 0000000..0272251 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Customers/NavToCustomers_Create.action @@ -0,0 +1,6 @@ +{ + "ModalPageFullscreen": false, + "ModalPage": true, + "PageToOpen": "/PartialUpload/Pages/Customers/Customers_Create.page", + "_Type": "Action.Type.Navigation" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Customers/NavToCustomers_Detail.action b/Showcase_Apps/PartialUploadDemo/Actions/Customers/NavToCustomers_Detail.action new file mode 100644 index 0000000..d81c875 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Customers/NavToCustomers_Detail.action @@ -0,0 +1,4 @@ +{ + "_Type": "Action.Type.Navigation", + "PageToOpen": "/PartialUpload/Pages/Customers/Customers_Detail.page" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Customers/NavToCustomers_Edit.action b/Showcase_Apps/PartialUploadDemo/Actions/Customers/NavToCustomers_Edit.action new file mode 100644 index 0000000..5b9298f --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Customers/NavToCustomers_Edit.action @@ -0,0 +1,6 @@ +{ + "ModalPageFullscreen": false, + "ModalPage": true, + "PageToOpen": "/PartialUpload/Pages/Customers/Customers_Edit.page", + "_Type": "Action.Type.Navigation" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Customers/NavToCustomers_List.action b/Showcase_Apps/PartialUploadDemo/Actions/Customers/NavToCustomers_List.action new file mode 100644 index 0000000..b1cecb7 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Customers/NavToCustomers_List.action @@ -0,0 +1,4 @@ +{ + "_Type": "Action.Type.Navigation", + "PageToOpen": "/PartialUpload/Pages/Customers/Customers_List.page" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Customers/UploadCustomerOnly.action b/Showcase_Apps/PartialUploadDemo/Actions/Customers/UploadCustomerOnly.action new file mode 100644 index 0000000..356277d --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Customers/UploadCustomerOnly.action @@ -0,0 +1,12 @@ +{ + "ActionResult": { + "_Name": "sync" + }, + "OnFailure": "/PartialUpload/Actions/Service/SyncFailureMessage.action", + "OnSuccess": "/PartialUpload/Actions/Service/SyncSuccessMessage.action", + "Service": "/PartialUpload/Services/Sample.service", + "UploadCategories": [ + "Customer" + ], + "_Type": "Action.Type.OfflineOData.Upload" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/DeleteEntityFailureMessage.action b/Showcase_Apps/PartialUploadDemo/Actions/DeleteEntityFailureMessage.action new file mode 100644 index 0000000..a3849a8 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/DeleteEntityFailureMessage.action @@ -0,0 +1,6 @@ +{ + "Message": "Delete entity failure - {#ActionResults:delete/error}", + "Duration": 7, + "Animated": true, + "_Type": "Action.Type.BannerMessage" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/DeleteEntitySuccessMessage.action b/Showcase_Apps/PartialUploadDemo/Actions/DeleteEntitySuccessMessage.action new file mode 100644 index 0000000..7de4ece --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/DeleteEntitySuccessMessage.action @@ -0,0 +1,10 @@ +{ + "Animated": true, + "Duration": 2, + "Message": "Entity deleted", + "Icon": "", + "IsIconHidden": false, + "NumberOfLines": 2, + "OnSuccess": "/PartialUpload/Actions/CloseModalPage_Complete.action", + "_Type": "Action.Type.ToastMessage" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Logout.action b/Showcase_Apps/PartialUploadDemo/Actions/Logout.action new file mode 100644 index 0000000..26fbf8c --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Logout.action @@ -0,0 +1,3 @@ +{ + "_Type": "Action.Type.Logout" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Products/NavToProducts_Create.action b/Showcase_Apps/PartialUploadDemo/Actions/Products/NavToProducts_Create.action new file mode 100644 index 0000000..dc07327 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Products/NavToProducts_Create.action @@ -0,0 +1,6 @@ +{ + "ModalPageFullscreen": false, + "ModalPage": true, + "PageToOpen": "/PartialUpload/Pages/Products/Products_Create.page", + "_Type": "Action.Type.Navigation" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Products/NavToProducts_Detail.action b/Showcase_Apps/PartialUploadDemo/Actions/Products/NavToProducts_Detail.action new file mode 100644 index 0000000..d752078 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Products/NavToProducts_Detail.action @@ -0,0 +1,4 @@ +{ + "_Type": "Action.Type.Navigation", + "PageToOpen": "/PartialUpload/Pages/Products/Products_Detail.page" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Products/NavToProducts_Edit.action b/Showcase_Apps/PartialUploadDemo/Actions/Products/NavToProducts_Edit.action new file mode 100644 index 0000000..87bf26d --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Products/NavToProducts_Edit.action @@ -0,0 +1,6 @@ +{ + "ModalPageFullscreen": false, + "ModalPage": true, + "PageToOpen": "/PartialUpload/Pages/Products/Products_Edit.page", + "_Type": "Action.Type.Navigation" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Products/NavToProducts_List.action b/Showcase_Apps/PartialUploadDemo/Actions/Products/NavToProducts_List.action new file mode 100644 index 0000000..a29f4a9 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Products/NavToProducts_List.action @@ -0,0 +1,4 @@ +{ + "_Type": "Action.Type.Navigation", + "PageToOpen": "/PartialUpload/Pages/Products/Products_List.page" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Products/ProductUploadProgress.action b/Showcase_Apps/PartialUploadDemo/Actions/Products/ProductUploadProgress.action new file mode 100644 index 0000000..9f4ba6c --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Products/ProductUploadProgress.action @@ -0,0 +1,8 @@ +{ + "Animated": true, + "CompletionMessage": "Upload Complete", + "CompletionTimeout": 5, + "Message": "Product Upload in Progress...", + "OnSuccess": "/PartialUpload/Actions/Products/UploadProductOnly.action", + "_Type": "Action.Type.ProgressBanner" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Products/Products_CreateEntity.action b/Showcase_Apps/PartialUploadDemo/Actions/Products/Products_CreateEntity.action new file mode 100644 index 0000000..1715ea9 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Products/Products_CreateEntity.action @@ -0,0 +1,33 @@ +{ + "CreateLinks": [], + "OnFailure": "/PartialUpload/Actions/CreateEntityFailureMessage.action", + "OnSuccess": "/PartialUpload/Actions/CreateEntitySuccessMessage.action", + "Properties": { + "Category": "#Control:Category/#Value", + "CategoryName": "#Control:CategoryName/#Value", + "CurrencyCode": "#Control:CurrencyCode/#Value", + "DimensionDepth": "#Control:DimensionDepth/#Value", + "DimensionHeight": "#Control:DimensionHeight/#Value", + "DimensionUnit": "#Control:DimensionUnit/#Value", + "DimensionWidth": "#Control:DimensionWidth/#Value", + "LongDescription": "#Control:LongDescription/#Value", + "Name": "#Control:Name/#Value", + "PictureUrl": "#Control:PictureUrl/#Value", + "Price": "#Control:Price/#Value", + "ProductId": "#Control:ProductId/#Value", + "QuantityUnit": "#Control:QuantityUnit/#Value", + "ShortDescription": "#Control:ShortDescription/#Value", + "SupplierId": "#Control:SupplierId/#Value", + "UpdatedTimestamp": "#Control:UpdatedTimestamp/#Value", + "Weight": "#Control:Weight/#Value", + "WeightUnit": "#Control:WeightUnit/#Value" +}, + "Target": { + "EntitySet": "Products", + "Service": "/PartialUpload/Services/Sample.service" + }, + "ActionResult": { + "_Name": "create" + }, + "_Type": "Action.Type.ODataService.CreateEntity" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Products/Products_DeleteEntity.action b/Showcase_Apps/PartialUploadDemo/Actions/Products/Products_DeleteEntity.action new file mode 100644 index 0000000..83ef5b9 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Products/Products_DeleteEntity.action @@ -0,0 +1,13 @@ +{ + "Target": { + "EntitySet": "Products", + "Service": "/PartialUpload/Services/Sample.service", + "ReadLink": "{@odata.readLink}" + }, + "OnSuccess": "/PartialUpload/Actions/DeleteEntitySuccessMessage.action", + "OnFailure": "/PartialUpload/Actions/DeleteEntityFailureMessage.action", + "ActionResult": { + "_Name": "delete" + }, + "_Type": "Action.Type.ODataService.DeleteEntity" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Products/Products_UpdateEntity.action b/Showcase_Apps/PartialUploadDemo/Actions/Products/Products_UpdateEntity.action new file mode 100644 index 0000000..fc8e09c --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Products/Products_UpdateEntity.action @@ -0,0 +1,31 @@ +{ + "ActionResult": { + "_Name": "update" + }, + "OnFailure": "/PartialUpload/Actions/UpdateEntityFailureMessage.action", + "OnSuccess": "/PartialUpload/Actions/UpdateEntitySuccessMessage.action", + "Properties": { + "CategoryName": "", + "CurrencyCode": "#Control:CurrencyCode/#Value", + "DimensionDepth": "#Control:DimensionDepth/#Value", + "DimensionHeight": "#Control:DimensionHeight/#Value", + "DimensionUnit": "#Control:DimensionUnit/#Value", + "DimensionWidth": "#Control:DimensionWidth/#Value", + "LongDescription": "#Control:LongDescription/#Value", + "Name": "#Control:Name/#Value", + "Price": "#Control:Price/#Value", + "QuantityUnit": "#Control:QuantityUnit/#Value", + "ShortDescription": "#Control:ShortDescription/#Value", + "Weight": "#Control:Weight/#Value", + "WeightUnit": "#Control:WeightUnit/#Value" + }, + "RequestOptions": { + "UploadCategory": "Product" + }, + "Target": { + "EntitySet": "Products", + "ReadLink": "{@odata.readLink}", + "Service": "/PartialUpload/Services/Sample.service" + }, + "_Type": "Action.Type.ODataService.UpdateEntity" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Products/UploadProductOnly.action b/Showcase_Apps/PartialUploadDemo/Actions/Products/UploadProductOnly.action new file mode 100644 index 0000000..5257b82 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Products/UploadProductOnly.action @@ -0,0 +1,12 @@ +{ + "ActionResult": { + "_Name": "sync" + }, + "OnFailure": "/PartialUpload/Actions/Service/SyncFailureMessage.action", + "OnSuccess": "/PartialUpload/Actions/Service/SyncSuccessMessage.action", + "Service": "/PartialUpload/Services/Sample.service", + "UploadCategories": [ + "Product" + ], + "_Type": "Action.Type.OfflineOData.Upload" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Service/CloseOffline.action b/Showcase_Apps/PartialUploadDemo/Actions/Service/CloseOffline.action new file mode 100644 index 0000000..d0c21bc --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Service/CloseOffline.action @@ -0,0 +1,10 @@ +{ + "_Type": "Action.Type.OfflineOData.Close", + "Service": "/PartialUpload/Services/Sample.service", + "Force": true, + "ActionResult": { + "_Name": "close" + }, + "OnSuccess": "/PartialUpload/Actions/Service/CloseOfflineSuccessMessage.action", + "OnFailure": "/PartialUpload/Actions/Service/CloseOfflineFailureMessage.action" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Service/CloseOfflineFailureMessage.action b/Showcase_Apps/PartialUploadDemo/Actions/Service/CloseOfflineFailureMessage.action new file mode 100644 index 0000000..b178ba0 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Service/CloseOfflineFailureMessage.action @@ -0,0 +1,8 @@ +{ + "Message": "Failure closing data service - {#ActionResults:close/error}", + "NumberOfLines": 1, + "Duration": 3, + "Animated": true, + "IsIconHidden": true, + "_Type": "Action.Type.ToastMessage" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Service/CloseOfflineSuccessMessage.action b/Showcase_Apps/PartialUploadDemo/Actions/Service/CloseOfflineSuccessMessage.action new file mode 100644 index 0000000..d737b84 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Service/CloseOfflineSuccessMessage.action @@ -0,0 +1,8 @@ +{ + "Message": "Data service closed successfully", + "NumberOfLines": 1, + "Duration": 3, + "Animated": true, + "IsIconHidden": true, + "_Type": "Action.Type.ToastMessage" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Service/DownloadOffline.action b/Showcase_Apps/PartialUploadDemo/Actions/Service/DownloadOffline.action new file mode 100644 index 0000000..10e31a9 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Service/DownloadOffline.action @@ -0,0 +1,18 @@ +{ + "Service": "/PartialUpload/Services/Sample.service", + "DefiningRequests": [ + { + "Name": "Customers", + "Query": "Customers" + }, + { + "Name": "Products", + "Query": "Products" + } +], + "_Type": "Action.Type.OfflineOData.Download", + "ActionResult": { + "_Name": "sync" + }, + "OnFailure": "/PartialUpload/Actions/Service/SyncFailureMessage.action" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Service/DownloadStartedMessage.action b/Showcase_Apps/PartialUploadDemo/Actions/Service/DownloadStartedMessage.action new file mode 100644 index 0000000..126d01f --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Service/DownloadStartedMessage.action @@ -0,0 +1,7 @@ +{ + "Message": "Download in progress...", + "CompletionMessage": "Download Successful", + "CompletionTimeout": 7, + "OnSuccess": "/PartialUpload/Actions/Service/DownloadOffline.action", + "_Type": "Action.Type.ProgressBanner" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Service/InitializeOffline.action b/Showcase_Apps/PartialUploadDemo/Actions/Service/InitializeOffline.action new file mode 100644 index 0000000..4d8a572 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Service/InitializeOffline.action @@ -0,0 +1,21 @@ +{ + "Service": "/PartialUpload/Services/Sample.service", + "DefiningRequests": [ + { + "Name": "Customers", + "Query": "Customers" + }, + { + "Name": "Products", + "Query": "Products" + } +], + "_Type": "Action.Type.ODataService.Initialize", + "ShowActivityIndicator": true, + "ActivityIndicatorText": "Downloading...", + "ActionResult": { + "_Name": "init" + }, + "OnSuccess": "/PartialUpload/Actions/Service/InitializeOfflineSuccessMessage.action", + "OnFailure": "/PartialUpload/Actions/Service/InitializeOfflineFailureMessage.action" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Service/InitializeOfflineFailureMessage.action b/Showcase_Apps/PartialUploadDemo/Actions/Service/InitializeOfflineFailureMessage.action new file mode 100644 index 0000000..4c61a58 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Service/InitializeOfflineFailureMessage.action @@ -0,0 +1,6 @@ +{ + "Message": "Failed to initialize application data service - {#ActionResults:init/error}", + "Duration": 7, + "Animated": true, + "_Type": "Action.Type.BannerMessage" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Service/InitializeOfflineSuccessMessage.action b/Showcase_Apps/PartialUploadDemo/Actions/Service/InitializeOfflineSuccessMessage.action new file mode 100644 index 0000000..0be61f0 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Service/InitializeOfflineSuccessMessage.action @@ -0,0 +1,7 @@ +{ + "Animated": true, + "Duration": 2, + "Message": "Application data service initialized", + "IsIconHidden": true, + "_Type": "Action.Type.ToastMessage" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Service/SyncFailureMessage.action b/Showcase_Apps/PartialUploadDemo/Actions/Service/SyncFailureMessage.action new file mode 100644 index 0000000..19f3234 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Service/SyncFailureMessage.action @@ -0,0 +1,6 @@ +{ + "Message": "Sync offline data service failure - {#ActionResults:sync/error}", + "Duration": 7, + "Animated": true, + "_Type": "Action.Type.BannerMessage" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Service/SyncStartedMessage.action b/Showcase_Apps/PartialUploadDemo/Actions/Service/SyncStartedMessage.action new file mode 100644 index 0000000..833fc5f --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Service/SyncStartedMessage.action @@ -0,0 +1,8 @@ +{ + "Message": "Upload in progress...", + "CompletionMessage": "Upload Successful", + "CompletionTimeout": 7, + "OnSuccess": "/PartialUpload/Actions/Service/UploadOffline.action", + "OnFailure": "/PartialUpload/Actions/Service/SyncFailureMessage.action", + "_Type": "Action.Type.ProgressBanner" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Service/SyncSuccessMessage.action b/Showcase_Apps/PartialUploadDemo/Actions/Service/SyncSuccessMessage.action new file mode 100644 index 0000000..f395332 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Service/SyncSuccessMessage.action @@ -0,0 +1,6 @@ +{ + "Animated": true, + "Duration": 2, + "Message": "Sync offline data service complete", + "_Type": "Action.Type.ToastMessage" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/Service/UploadOffline.action b/Showcase_Apps/PartialUploadDemo/Actions/Service/UploadOffline.action new file mode 100644 index 0000000..9b30508 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/Service/UploadOffline.action @@ -0,0 +1,9 @@ +{ + "Service": "/PartialUpload/Services/Sample.service", + "_Type": "Action.Type.OfflineOData.Upload", + "ActionResult": { + "_Name": "sync" + }, + "OnSuccess": "/PartialUpload/Actions/Service/DownloadStartedMessage.action", + "OnFailure": "/PartialUpload/Actions/Service/SyncFailureMessage.action" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/UpdateEntityFailureMessage.action b/Showcase_Apps/PartialUploadDemo/Actions/UpdateEntityFailureMessage.action new file mode 100644 index 0000000..3b1abad --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/UpdateEntityFailureMessage.action @@ -0,0 +1,6 @@ +{ + "Message": "Update entity failure - {#ActionResults:update/error}", + "Duration": 7, + "Animated": true, + "_Type": "Action.Type.BannerMessage" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Actions/UpdateEntitySuccessMessage.action b/Showcase_Apps/PartialUploadDemo/Actions/UpdateEntitySuccessMessage.action new file mode 100644 index 0000000..f2f22b6 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Actions/UpdateEntitySuccessMessage.action @@ -0,0 +1,10 @@ +{ + "Animated": true, + "Duration": 2, + "Message": "Entity updated", + "Icon": "", + "IsIconHidden": false, + "NumberOfLines": 2, + "OnSuccess": "/PartialUpload/Actions/CloseModalPage_Complete.action", + "_Type": "Action.Type.ToastMessage" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Application.app b/Showcase_Apps/PartialUploadDemo/Application.app new file mode 100644 index 0000000..02825ea --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Application.app @@ -0,0 +1,12 @@ +{ + "_Name": "PartialUpload", + "Version": "/PartialUpload/Globals/AppDefinition_Version.global", + "MainPage": "/PartialUpload/Pages/Main.page", + "OnLaunch": [ + "/PartialUpload/Actions/Service/InitializeOffline.action" + ], + "OnWillUpdate": "/PartialUpload/Rules/OnWillUpdate.js", + "OnDidUpdate": "/PartialUpload/Actions/Service/InitializeOffline.action", + "Styles": "/PartialUpload/Styles/Styles.less", + "Localization": "/PartialUpload/i18n/i18n.properties" +} diff --git a/Showcase_Apps/PartialUploadDemo/Globals/AppDefinition_Version.global b/Showcase_Apps/PartialUploadDemo/Globals/AppDefinition_Version.global new file mode 100644 index 0000000..905fcb6 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Globals/AppDefinition_Version.global @@ -0,0 +1,4 @@ +{ + "Value": "1.0.0", + "_Type": "String" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Pages/Customers/Customers_Create.page b/Showcase_Apps/PartialUploadDemo/Pages/Customers/Customers_Create.page new file mode 100644 index 0000000..de7ada4 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Pages/Customers/Customers_Create.page @@ -0,0 +1,91 @@ +{ + "ActionBar": { + "Items": [ + { + "IsIconCircular": false, + "OnPress": "/PartialUpload/Actions/CloseModalPage_Cancel.action", + "Position": "left", + "SystemItem": "Cancel" + }, + { + "IsIconCircular": false, + "OnPress": "/PartialUpload/Actions/Customers/Customers_CreateEntity.action", + "Position": "right", + "SystemItem": "Save" + } + ] + }, + "Caption": "Create Customer", + "Controls": [ + { + "Sections": [ + { + "Controls": [ + { + "Caption": "Customer Id", + "_Name": "CustomerId", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "First Name", + "_Name": "FirstName", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "Last Name", + "_Name": "LastName", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "Date Of Birth", + "Mode": "Date", + "_Name": "DateOfBirth", + "_Type": "Control.Type.FormCell.DatePicker" + }, + { + "Caption": "Phone Number", + "_Name": "PhoneNumber", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "Email Address", + "KeyboardType": "Email", + "_Name": "EmailAddress", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "House Number", + "_Name": "HouseNumber", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "Street", + "_Name": "Street", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "City", + "_Name": "City", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "Postal Code", + "_Name": "PostalCode", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "Country / Region", + "_Name": "Country", + "_Type": "Control.Type.FormCell.SimpleProperty" + } + ], + "Visible": true + } + ], + "_Name": "FormCellContainer", + "_Type": "Control.Type.FormCellContainer" + } + ], + "_Name": "Customers_Create", + "_Type": "Page" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Pages/Customers/Customers_Detail.page b/Showcase_Apps/PartialUploadDemo/Pages/Customers/Customers_Detail.page new file mode 100644 index 0000000..a49ac4b --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Pages/Customers/Customers_Detail.page @@ -0,0 +1,94 @@ +{ + "Caption": "Customers Details", + + "ActionBar": { + "Items": [{ + "OnPress": "/PartialUpload/Actions/Customers/NavToCustomers_Edit.action", + "Position": "right", + "SystemItem": "Edit" + }, { + "OnPress": "/PartialUpload/Rules/Customers/Customers_DeleteConfirmation.js", + "Position": "right", + "SystemItem": "Trash" + }] + }, + "Controls": [{ + "Sections": [{ + "ObjectHeader": { + "DetailImage": "", + "HeadlineText": "{City}", + "Subhead": "{CustomerId}", + "Tags": [], + "BodyText": "", + "Footnote": "{DateOfBirth}", + "Description": "{Country}", + "StatusText": "{EmailAddress}", + "StatusImage": "", + "SubstatusImage": "", + "SubstatusText": "{FirstName}" + }, + "_Type": "Section.Type.ObjectHeader" + }, { + "KeyAndValues": [ + { + "KeyName": "City", + "Value": "{City}" + }, + { + "KeyName": "Country", + "Value": "{Country}" + }, + { + "KeyName": "CustomerId", + "Value": "{CustomerId}" + }, + { + "KeyName": "DateOfBirth", + "Value": "{DateOfBirth}" + }, + { + "KeyName": "EmailAddress", + "Value": "{EmailAddress}" + }, + { + "KeyName": "FirstName", + "Value": "{FirstName}" + }, + { + "KeyName": "HouseNumber", + "Value": "{HouseNumber}" + }, + { + "KeyName": "LastName", + "Value": "{LastName}" + }, + { + "KeyName": "PhoneNumber", + "Value": "{PhoneNumber}" + }, + { + "KeyName": "PostalCode", + "Value": "{PostalCode}" + }, + { + "KeyName": "Street", + "Value": "{Street}" + }, + { + "KeyName": "UpdatedTimestamp", + "Value": "{UpdatedTimestamp}" + } +], + "Layout": { + "NumberOfColumns": 2 + }, + "MaxItemCount": 1, + "_Name": "SectionKeyValue0", + "_Type": "Section.Type.KeyValue" + }], + "_Type": "Control.Type.SectionedTable", + "_Name": "SectionedTable" + }], + "_Type": "Page", + "_Name": "Customers_Detail" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Pages/Customers/Customers_Edit.page b/Showcase_Apps/PartialUploadDemo/Pages/Customers/Customers_Edit.page new file mode 100644 index 0000000..aa5d6e3 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Pages/Customers/Customers_Edit.page @@ -0,0 +1,126 @@ +{ + "ActionBar": { + "Items": [ + { + "IsIconCircular": false, + "OnPress": "/PartialUpload/Actions/CloseModalPage_Cancel.action", + "Position": "left", + "SystemItem": "Cancel" + }, + { + "IsIconCircular": false, + "OnPress": "/PartialUpload/Actions/Customers/Customers_UpdateEntity.action", + "Position": "right", + "SystemItem": "Save" + } + ] + }, + "Caption": "Update Customer", + "Controls": [ + { + "Sections": [ + { + "Controls": [ + { + "Caption": "Customer Id", + "IsEditable": false, + "IsVisible": true, + "Value": "{CustomerId}", + "_Name": "CustomerId", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "First Name", + "IsEditable": true, + "IsVisible": true, + "Value": "{FirstName}", + "_Name": "FirstName", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "Last Name", + "IsEditable": true, + "IsVisible": true, + "Value": "{LastName}", + "_Name": "LastName", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "Date Of Birth", + "IsEditable": true, + "IsVisible": true, + "Mode": "Date", + "Value": "{DateOfBirth}", + "_Name": "DateOfBirth", + "_Type": "Control.Type.FormCell.DatePicker" + }, + { + "Caption": "Phone Number", + "IsEditable": true, + "IsVisible": true, + "KeyboardType": "Phone", + "Value": "{PhoneNumber}", + "_Name": "PhoneNumber", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "AlternateInput": "None", + "Caption": "Email Address", + "IsEditable": true, + "IsVisible": true, + "KeyboardType": "Email", + "Value": "{EmailAddress}", + "_Name": "EmailAddress", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "House Number", + "IsEditable": true, + "IsVisible": true, + "Value": "{HouseNumber}", + "_Name": "HouseNumber", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "Street", + "IsEditable": true, + "IsVisible": true, + "Value": "{Street}", + "_Name": "Street", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "City", + "IsEditable": true, + "IsVisible": true, + "Value": "{City}", + "_Name": "City", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "Postal Code", + "IsEditable": true, + "IsVisible": true, + "Value": "{PostalCode}", + "_Name": "PostalCode", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "Country", + "IsEditable": true, + "IsVisible": true, + "Value": "{Country}", + "_Name": "Country", + "_Type": "Control.Type.FormCell.SimpleProperty" + } + ], + "Visible": true + } + ], + "_Name": "PageOneFormCell", + "_Type": "Control.Type.FormCellContainer" + } + ], + "_Name": "Customers_Edit", + "_Type": "Page" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Pages/Customers/Customers_List.page b/Showcase_Apps/PartialUploadDemo/Pages/Customers/Customers_List.page new file mode 100644 index 0000000..6b04782 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Pages/Customers/Customers_List.page @@ -0,0 +1,82 @@ +{ + "ActionBar": { + "Items": [ + { + "IsIconCircular": false, + "OnPress": "/PartialUpload/Actions/Customers/NavToCustomers_Create.action", + "Position": "right", + "SystemItem": "Add" + } + ] + }, + "Caption": "Customers", + "Controls": [ + { + "Sections": [ + { + "EmptySection": { + "FooterVisible": false + }, + "Header": { + "UseTopPadding": false + }, + "ObjectCell": { + "AccessoryType": "disclosureIndicator", + "ContextMenu": { + "Items": [ + ], + "PerformFirstActionWithFullSwipe": true + }, + "Description": "{Country}", + "DetailImageIsCircular": false, + "Footnote": "{EmailAddress}", + "OnPress": "/PartialUpload/Actions/Customers/NavToCustomers_Detail.action", + "PreserveIconStackSpacing": false, + "StatusText": "{DateOfBirth}", + "Subhead": "{City}", + "Title": "{FirstName} {LastName}" + }, + "Search": { + "BarcodeScanner": true, + "Delay": 500, + "Enabled": true, + "MinimumCharacterThreshold": 3, + "Placeholder": "Item Search" + }, + "Target": { + "EntitySet": "Customers", + "QueryOptions": "", + "Service": "/PartialUpload/Services/Sample.service" + }, + "_Name": "SectionObjectTable0", + "_Type": "Section.Type.ObjectTable" + } + ], + "_Name": "SectionedTable", + "_Type": "Control.Type.SectionedTable" + } + ], + "ToolBar": { + "Controls": [ + { + "Clickable": true, + "Enabled": true, + "SystemItem": "FlexibleSpace", + "Visible": true, + "_Name": "ToolbarItem0", + "_Type": "Control.Type.ToolbarItem" + }, + { + "Caption": "Upload Customers Only", + "Clickable": true, + "Enabled": true, + "OnPress": "/PartialUpload/Actions/Customers/CustomerUploadProgress.action", + "Visible": true, + "_Name": "ToolbarItem1", + "_Type": "Control.Type.ToolbarItem" + } + ] + }, + "_Name": "Customers_List", + "_Type": "Page" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Pages/Main.page b/Showcase_Apps/PartialUploadDemo/Pages/Main.page new file mode 100644 index 0000000..596ad67 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Pages/Main.page @@ -0,0 +1,54 @@ +{ + "Caption": "Main", + "Controls": [ + { + "Sections": [ + { + "Buttons": [ + { + "OnPress": "/PartialUpload/Actions/Customers/NavToCustomers_List.action", + "TextAlignment": "center", + "Title": "Customers" + }, + { + "OnPress": "/PartialUpload/Actions/Products/NavToProducts_List.action", + "TextAlignment": "center", + "Title": "Products" + } + ], + "EmptySection": { + "FooterVisible": false + }, + "_Name": "SectionButtonTable0", + "_Type": "Section.Type.ButtonTable" + } + ], + "_Name": "SectionedTable0", + "_Type": "Control.Type.SectionedTable" + } + ], + "ToolBar": { + "Controls": [ + { + "Caption": "Logout", + "Clickable": true, + "Enabled": true, + "OnPress": "/PartialUpload/Actions/Logout.action", + "Visible": true, + "_Name": "LogoutToolbarItem", + "_Type": "Control.Type.ToolbarItem" + }, + { + "Caption": "Full Sync", + "Clickable": true, + "Enabled": true, + "OnPress": "/PartialUpload/Actions/Service/SyncStartedMessage.action", + "Visible": "$(PLT,true,true,false)", + "_Name": "UploadToolbarItem", + "_Type": "Control.Type.ToolbarItem" + } + ] + }, + "_Name": "Main", + "_Type": "Page" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Pages/Products/Products_Create.page b/Showcase_Apps/PartialUploadDemo/Pages/Products/Products_Create.page new file mode 100644 index 0000000..0f5fd34 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Pages/Products/Products_Create.page @@ -0,0 +1,115 @@ +{ + "ActionBar": { + "Items": [{ + "OnPress": "/PartialUpload/Actions/CloseModalPage_Cancel.action", + "Position": "left", + "SystemItem": "Cancel" + }, { + "OnPress": "/PartialUpload/Actions/Products/Products_CreateEntity.action", + "Position": "right", + "SystemItem": "Save" + }] + }, + "Caption": "Create Product", + "Controls": [{ + "Sections": [{ + "Controls": [ + { + "Caption": "Category", + "_Name": "Category", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "CategoryName", + "_Name": "CategoryName", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "CurrencyCode", + "_Name": "CurrencyCode", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "DimensionDepth", + "_Name": "DimensionDepth", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "DimensionHeight", + "_Name": "DimensionHeight", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "DimensionUnit", + "_Name": "DimensionUnit", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "DimensionWidth", + "_Name": "DimensionWidth", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "LongDescription", + "_Name": "LongDescription", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "Name", + "_Name": "Name", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "PictureUrl", + "_Name": "PictureUrl", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "Price", + "_Name": "Price", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "ProductId", + "_Name": "ProductId", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "QuantityUnit", + "_Name": "QuantityUnit", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "ShortDescription", + "_Name": "ShortDescription", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "SupplierId", + "_Name": "SupplierId", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Mode": "Date", + "_Name": "UpdatedTimestamp", + "Caption": "UpdatedTimestamp", + "_Type": "Control.Type.FormCell.DatePicker" + }, + { + "Caption": "Weight", + "_Name": "Weight", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "WeightUnit", + "_Name": "WeightUnit", + "_Type": "Control.Type.FormCell.SimpleProperty" + } +] + }], + "_Name": "FormCellContainer", + "_Type": "Control.Type.FormCellContainer" + }], + "_Type": "Page", + "_Name": "Products_Create" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Pages/Products/Products_Detail.page b/Showcase_Apps/PartialUploadDemo/Pages/Products/Products_Detail.page new file mode 100644 index 0000000..ca2b32e --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Pages/Products/Products_Detail.page @@ -0,0 +1,118 @@ +{ + "Caption": "Products Details", + + "ActionBar": { + "Items": [{ + "OnPress": "/PartialUpload/Actions/Products/NavToProducts_Edit.action", + "Position": "right", + "SystemItem": "Edit" + }, { + "OnPress": "/PartialUpload/Rules/Products/Products_DeleteConfirmation.js", + "Position": "right", + "SystemItem": "Trash" + }] + }, + "Controls": [{ + "Sections": [{ + "ObjectHeader": { + "DetailImage": "", + "HeadlineText": "{Category}", + "Subhead": "{CurrencyCode}", + "Tags": [], + "BodyText": "", + "Footnote": "{DimensionDepth}", + "Description": "{CategoryName}", + "StatusText": "{DimensionHeight}", + "StatusImage": "", + "SubstatusImage": "", + "SubstatusText": "{DimensionUnit}" + }, + "_Type": "Section.Type.ObjectHeader" + }, { + "KeyAndValues": [ + { + "KeyName": "Category", + "Value": "{Category}" + }, + { + "KeyName": "CategoryName", + "Value": "{CategoryName}" + }, + { + "KeyName": "CurrencyCode", + "Value": "{CurrencyCode}" + }, + { + "KeyName": "DimensionDepth", + "Value": "{DimensionDepth}" + }, + { + "KeyName": "DimensionHeight", + "Value": "{DimensionHeight}" + }, + { + "KeyName": "DimensionUnit", + "Value": "{DimensionUnit}" + }, + { + "KeyName": "DimensionWidth", + "Value": "{DimensionWidth}" + }, + { + "KeyName": "LongDescription", + "Value": "{LongDescription}" + }, + { + "KeyName": "Name", + "Value": "{Name}" + }, + { + "KeyName": "PictureUrl", + "Value": "{PictureUrl}" + }, + { + "KeyName": "Price", + "Value": "{Price}" + }, + { + "KeyName": "ProductId", + "Value": "{ProductId}" + }, + { + "KeyName": "QuantityUnit", + "Value": "{QuantityUnit}" + }, + { + "KeyName": "ShortDescription", + "Value": "{ShortDescription}" + }, + { + "KeyName": "SupplierId", + "Value": "{SupplierId}" + }, + { + "KeyName": "UpdatedTimestamp", + "Value": "{UpdatedTimestamp}" + }, + { + "KeyName": "Weight", + "Value": "{Weight}" + }, + { + "KeyName": "WeightUnit", + "Value": "{WeightUnit}" + } +], + "Layout": { + "NumberOfColumns": 2 + }, + "MaxItemCount": 1, + "_Name": "SectionKeyValue0", + "_Type": "Section.Type.KeyValue" + }], + "_Type": "Control.Type.SectionedTable", + "_Name": "SectionedTable" + }], + "_Type": "Page", + "_Name": "Products_Detail" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Pages/Products/Products_Edit.page b/Showcase_Apps/PartialUploadDemo/Pages/Products/Products_Edit.page new file mode 100644 index 0000000..d3ce7c1 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Pages/Products/Products_Edit.page @@ -0,0 +1,113 @@ +{ + "ActionBar": { + "Items": [ + { + "IsIconCircular": false, + "OnPress": "/PartialUpload/Actions/CloseModalPage_Cancel.action", + "Position": "left", + "SystemItem": "Cancel" + }, + { + "IsIconCircular": false, + "OnPress": "/PartialUpload/Actions/Products/Products_UpdateEntity.action", + "Position": "right", + "SystemItem": "Save" + } + ] + }, + "Caption": "Update Product", + "Controls": [ + { + "Sections": [ + { + "Controls": [ + { + "Caption": "ProductId", + "IsEditable": false, + "Value": "{ProductId}", + "_Name": "ProductId", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "Name", + "Value": "{Name}", + "_Name": "Name", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "ShortDescription", + "Value": "{ShortDescription}", + "_Name": "ShortDescription", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "LongDescription", + "Value": "{LongDescription}", + "_Name": "LongDescription", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "Price", + "Value": "{Price}", + "_Name": "Price", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "CurrencyCode", + "Value": "{CurrencyCode}", + "_Name": "CurrencyCode", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "DimensionHeight", + "Value": "{DimensionHeight}", + "_Name": "DimensionHeight", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "DimensionWidth", + "Value": "{DimensionWidth}", + "_Name": "DimensionWidth", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "DimensionDepth", + "Value": "{DimensionDepth}", + "_Name": "DimensionDepth", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "DimensionUnit", + "Value": "{DimensionUnit}", + "_Name": "DimensionUnit", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "Weight", + "Value": "{Weight}", + "_Name": "Weight", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "WeightUnit", + "Value": "{WeightUnit}", + "_Name": "WeightUnit", + "_Type": "Control.Type.FormCell.SimpleProperty" + }, + { + "Caption": "QuantityUnit", + "Value": "{QuantityUnit}", + "_Name": "QuantityUnit", + "_Type": "Control.Type.FormCell.SimpleProperty" + } + ], + "Visible": true + } + ], + "_Name": "PageOneFormCell", + "_Type": "Control.Type.FormCellContainer" + } + ], + "_Name": "Products_Edit", + "_Type": "Page" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Pages/Products/Products_List.page b/Showcase_Apps/PartialUploadDemo/Pages/Products/Products_List.page new file mode 100644 index 0000000..6adb876 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Pages/Products/Products_List.page @@ -0,0 +1,73 @@ +{ + "Caption": "Products", + "Controls": [ + { + "Sections": [ + { + "EmptySection": { + "FooterVisible": false + }, + "Header": { + "UseTopPadding": false + }, + "ObjectCell": { + "AccessoryType": "disclosureIndicator", + "ContextMenu": { + "Items": [ + ], + "PerformFirstActionWithFullSwipe": true + }, + "Description": "{LongDescription}", + "DetailImageIsCircular": false, + "Footnote": "{ShortDescription}", + "OnPress": "/PartialUpload/Actions/Products/NavToProducts_Detail.action", + "PreserveIconStackSpacing": false, + "StatusText": "{Price}", + "Subhead": "{Category}", + "SubstatusText": "{CurrencyCode}", + "Title": "{Name}" + }, + "Search": { + "BarcodeScanner": true, + "Delay": 500, + "Enabled": true, + "MinimumCharacterThreshold": 3, + "Placeholder": "Item Search" + }, + "Target": { + "EntitySet": "Products", + "QueryOptions": "", + "Service": "/PartialUpload/Services/Sample.service" + }, + "_Name": "SectionObjectTable0", + "_Type": "Section.Type.ObjectTable" + } + ], + "_Name": "SectionedTable", + "_Type": "Control.Type.SectionedTable" + } + ], + "ToolBar": { + "Controls": [ + { + "Clickable": true, + "Enabled": true, + "SystemItem": "FlexibleSpace", + "Visible": true, + "_Name": "ToolbarItem0", + "_Type": "Control.Type.ToolbarItem" + }, + { + "Caption": "Upload Product Only", + "Clickable": true, + "Enabled": true, + "OnPress": "/PartialUpload/Actions/Products/ProductUploadProgress.action", + "Visible": true, + "_Name": "ToolbarItem1", + "_Type": "Control.Type.ToolbarItem" + } + ] + }, + "_Name": "Products_List", + "_Type": "Page" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/README.md b/Showcase_Apps/PartialUploadDemo/README.md new file mode 100644 index 0000000..5c17cd3 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/README.md @@ -0,0 +1,59 @@ +# Partial Upload App + +This is a showcase application that demonstrates how to: + +1. Add Upload Categories to OData Create, Update, and Delete actions +2. Use Upload Categories in the Offline OData Upload action to selectively send only transactions matching the specified Upload Categeory + +*Last Updated: 17-Mar-2021* + +*** + +## Requirements + +### *Supported Platforms* + +* iOS +* Android + +### *MDK Client Version* + +* MDK 5.1 or higher + +### *Data Source* + +* Mobile Services Sample OData ESPM + +*** + +## Key Highlights + +* Categorizes Customer versus Product OData transactions +* Includes buttons on the respective List pages to upload only Customer or only Product transactions + +*** + +## Usage + +After onboarding of the application +1. Go into the Customer List / Details and Edit one or more customers +1. Go into the Product List / Details and Edit one or more products +1. Use the Upload Customer Only button on the Customer List page to send only the Customer transactions +1. Verify only the appropriate transactions were sent to the backend +1. Make additional Customer Edits +1. Use the Upload Product Only button on the Product List page to send only the Product transactions +1. Verify only the appropriate transactions were sent to the backend + +*** + +## Verification + +Verify only the customer or product transactions are sent though: +* Turning on Mobile Network Trace and capturing the headers and body to review exactly what was sent +* Opening the Mobile Connection in the browser to view the Customers and Products to see the changes after upload do not include the other changes + +*** + +For a more detailed information on the setup of the application in Mobile Services with the Sample Backend please see the following tutorial. + +* [Set Up Initial Configuration for an MDK App](https://developers.sap.com/tutorials/cp-mobile-dev-kit-ms-setup.html) \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Rules/Customers/Customers_DeleteConfirmation.js b/Showcase_Apps/PartialUploadDemo/Rules/Customers/Customers_DeleteConfirmation.js new file mode 100644 index 0000000..fed413e --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Rules/Customers/Customers_DeleteConfirmation.js @@ -0,0 +1,12 @@ +export default function DeleteConfirmation(clientAPI) { + let dialogs = clientAPI.nativescript.uiDialogsModule; + return dialogs.confirm("Delete current entity?").then((result) => { + if (result === true) { + return clientAPI.executeAction('/PartialUpload/Actions/Customers/Customers_DeleteEntity.action').then( + (success) => Promise.resolve(success), + (failure) => Promise.reject('Delete entity failed ' + failure)); + } else { + return Promise.reject('User Deferred'); + } + }); +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Rules/OnWillUpdate.js b/Showcase_Apps/PartialUploadDemo/Rules/OnWillUpdate.js new file mode 100644 index 0000000..3e7b51f --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Rules/OnWillUpdate.js @@ -0,0 +1,13 @@ +export default function OnWillUpdate(clientAPI) { + let dialogs = clientAPI.nativescript.uiDialogsModule; + return dialogs.confirm("Update now?").then((result) => { + console.log("Update now? " + result); + if (result === true) { + return clientAPI.executeAction('/PartialUpload/Actions/Service/CloseOffline.action').then( + (success) => Promise.resolve(success), + (failure) => Promise.reject('Offline Odata Close Failed ' + failure)); + } else { + return Promise.reject('User Deferred'); + } + }); +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Rules/Products/Products_DeleteConfirmation.js b/Showcase_Apps/PartialUploadDemo/Rules/Products/Products_DeleteConfirmation.js new file mode 100644 index 0000000..ce1f996 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Rules/Products/Products_DeleteConfirmation.js @@ -0,0 +1,12 @@ +export default function DeleteConfirmation(clientAPI) { + let dialogs = clientAPI.nativescript.uiDialogsModule; + return dialogs.confirm("Delete current entity?").then((result) => { + if (result === true) { + return clientAPI.executeAction('/PartialUpload/Actions/Products/Products_DeleteEntity.action').then( + (success) => Promise.resolve(success), + (failure) => Promise.reject('Delete entity failed ' + failure)); + } else { + return Promise.reject('User Deferred'); + } + }); +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Services/.Sample.xml b/Showcase_Apps/PartialUploadDemo/Services/.Sample.xml new file mode 100644 index 0000000..6957da7 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Services/.Sample.xml @@ -0,0 +1,337 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Services/Sample.service b/Showcase_Apps/PartialUploadDemo/Services/Sample.service new file mode 100644 index 0000000..2896506 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Services/Sample.service @@ -0,0 +1,8 @@ +{ + "DestinationName": "com.sap.edm.sampleservice.v2", + "OfflineEnabled": true, + "LanguageURLParam": "", + "OnlineOptions": {}, + "PathSuffix": "", + "SourceType": "Mobile" +} \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Styles/Styles.less b/Showcase_Apps/PartialUploadDemo/Styles/Styles.less new file mode 100644 index 0000000..73437d8 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Styles/Styles.less @@ -0,0 +1,21 @@ +/* The LESS stylesheet provides the ability to define styling styles that can be used to style the UI in the MDK app. + +Examples: + +@mdkYellow1: #ffbb33; +@mdkRed1: #ff0000; + +//// By-Type style: All Pages in the application will now have a yellow background +Page + +{ background-color: @mdkYellow1; } +//// By-Name style: All Buttons with _Name == "BlueButton" will now have this style +#BlueButton + +{ color: @mdkYellow1; background-color: #0000FF; } +//// By-Class style: These style classes can be referenced from rules and set using ClientAPI setStyle function + +.MyButton + +{ color: @mdkYellow1; background-color: @mdkRed1; } +*/ \ No newline at end of file diff --git a/Showcase_Apps/PartialUploadDemo/Web/App_Resources/bug.png b/Showcase_Apps/PartialUploadDemo/Web/App_Resources/bug.png new file mode 100644 index 0000000..2b85938 Binary files /dev/null and b/Showcase_Apps/PartialUploadDemo/Web/App_Resources/bug.png differ diff --git a/Showcase_Apps/PartialUploadDemo/Web/config.json b/Showcase_Apps/PartialUploadDemo/Web/config.json new file mode 100644 index 0000000..c0fd525 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/Web/config.json @@ -0,0 +1,4 @@ +{ + "DefaultAppLanguage" : "en", + "ApplicationDisplayName":"" +} diff --git a/Showcase_Apps/PartialUploadDemo/i18n/i18n.properties b/Showcase_Apps/PartialUploadDemo/i18n/i18n.properties new file mode 100644 index 0000000..e69de29 diff --git a/Showcase_Apps/PartialUploadDemo/jsconfig.json b/Showcase_Apps/PartialUploadDemo/jsconfig.json new file mode 100644 index 0000000..af8e543 --- /dev/null +++ b/Showcase_Apps/PartialUploadDemo/jsconfig.json @@ -0,0 +1,6 @@ +{ + "include": [ + "Rules/**/*", + ".typings/**/*" + ] +} \ No newline at end of file