From 05c6debf730d4c2de3863bb709ecc720dcb7a6c2 Mon Sep 17 00:00:00 2001 From: JM Date: Wed, 7 Oct 2015 13:21:26 +0200 Subject: [PATCH 001/197] LSR-642 Read saveCredentials from viewModel --- ios/Framework/Core/Auth/LoginScreenlet/LoginScreenlet.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ios/Framework/Core/Auth/LoginScreenlet/LoginScreenlet.swift b/ios/Framework/Core/Auth/LoginScreenlet/LoginScreenlet.swift index bec21f98c9..c30bd308e9 100644 --- a/ios/Framework/Core/Auth/LoginScreenlet/LoginScreenlet.swift +++ b/ios/Framework/Core/Auth/LoginScreenlet/LoginScreenlet.swift @@ -102,7 +102,7 @@ public class LoginScreenlet: BaseScreenlet, BasicAuthBasedType { self.delegate?.screenlet?(self, onLoginResponseUserAttributes: interactor.resultUserAttributes!) - if self.saveCredentials { + if self.viewModel.saveCredentials { if SessionContext.storeSession() { self.delegate?.onScreenletCredentialsSaved?(self) } @@ -111,7 +111,6 @@ public class LoginScreenlet: BaseScreenlet, BasicAuthBasedType { interactor.onFailure = { self.delegate?.screenlet?(self, onLoginError: $0) - return } return interactor From 58dc7e29cbc608d995e7b748f3bff201185864c6 Mon Sep 17 00:00:00 2001 From: JM Date: Wed, 7 Oct 2015 14:26:46 +0200 Subject: [PATCH 002/197] LSR-643 Rename current operation --- ...iferayWebContentLoadFromArticleIdOperation.swift} | 2 +- .../LiferayScreens.xcodeproj/project.pbxproj | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) rename ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/{LiferayWebContentLoadOperation.swift => LiferayWebContentLoadFromArticleIdOperation.swift} (95%) diff --git a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadOperation.swift b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromArticleIdOperation.swift similarity index 95% rename from ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadOperation.swift rename to ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromArticleIdOperation.swift index 687855dde5..02527e04c0 100644 --- a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadOperation.swift +++ b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromArticleIdOperation.swift @@ -14,7 +14,7 @@ import UIKit -public class LiferayWebContentLoadOperation: ServerOperation { +public class LiferayWebContentLoadFromArticleIdOperation: ServerOperation { public var groupId: Int64? public var articleId: String? diff --git a/ios/Framework/LiferayScreens.xcodeproj/project.pbxproj b/ios/Framework/LiferayScreens.xcodeproj/project.pbxproj index 4df8ffb201..bb96f21686 100644 --- a/ios/Framework/LiferayScreens.xcodeproj/project.pbxproj +++ b/ios/Framework/LiferayScreens.xcodeproj/project.pbxproj @@ -62,7 +62,6 @@ 881E611F1ACBE5F000862B9E /* SignUpViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 881E61001ACBE5F000862B9E /* SignUpViewModel.swift */; }; 881E61271ACBE5F000862B9E /* UserPortraitScreenlet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 881E610A1ACBE5F000862B9E /* UserPortraitScreenlet.swift */; }; 881E61281ACBE5F000862B9E /* UserPortraitViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 881E610B1ACBE5F000862B9E /* UserPortraitViewModel.swift */; }; - 881E613B1ACBED7500862B9E /* LiferayWebContentLoadOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 881E61361ACBED7500862B9E /* LiferayWebContentLoadOperation.swift */; }; 881E613C1ACBED7500862B9E /* WebContentDisplayLoadInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 881E61371ACBED7500862B9E /* WebContentDisplayLoadInteractor.swift */; }; 881E613D1ACBED7500862B9E /* WebContentDisplayScreenlet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 881E61381ACBED7500862B9E /* WebContentDisplayScreenlet.swift */; }; 881E613E1ACBED7500862B9E /* WebContentDisplayViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 881E61391ACBED7500862B9E /* WebContentDisplayViewModel.swift */; }; @@ -293,6 +292,8 @@ 88BCB5621B8CAC22004349F1 /* assetlist-screenlet.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88BCB55F1B8CAC22004349F1 /* assetlist-screenlet.strings */; }; 88BCB5651B8CAD93004349F1 /* ddllist-screenlet.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88BCB5631B8CAD93004349F1 /* ddllist-screenlet.strings */; }; 88BCB5661B8CAD93004349F1 /* ddllist-screenlet.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88BCB5631B8CAD93004349F1 /* ddllist-screenlet.strings */; }; + 88BF02041BC546BE00515CB5 /* LiferayWebContentLoadFromArticleIdOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88BF02021BC546BE00515CB5 /* LiferayWebContentLoadFromArticleIdOperation.swift */; }; + 88BF02051BC546BE00515CB5 /* LiferayWebContentLoadFromClassPKOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88BF02031BC546BE00515CB5 /* LiferayWebContentLoadFromClassPKOperation.swift */; }; 88CA805B1B25AF48004C1D59 /* LoginInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88CA80581B25AF48004C1D59 /* LoginInteractor.swift */; }; 88CA805C1B25AF48004C1D59 /* LoginInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88CA80581B25AF48004C1D59 /* LoginInteractor.swift */; }; 88CA805D1B25AF48004C1D59 /* OAuthInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88CA80591B25AF48004C1D59 /* OAuthInteractor.swift */; }; @@ -414,7 +415,6 @@ 881E61001ACBE5F000862B9E /* SignUpViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SignUpViewModel.swift; sourceTree = ""; }; 881E610A1ACBE5F000862B9E /* UserPortraitScreenlet.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserPortraitScreenlet.swift; sourceTree = ""; }; 881E610B1ACBE5F000862B9E /* UserPortraitViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserPortraitViewModel.swift; sourceTree = ""; }; - 881E61361ACBED7500862B9E /* LiferayWebContentLoadOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiferayWebContentLoadOperation.swift; sourceTree = ""; }; 881E61371ACBED7500862B9E /* WebContentDisplayLoadInteractor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebContentDisplayLoadInteractor.swift; sourceTree = ""; }; 881E61381ACBED7500862B9E /* WebContentDisplayScreenlet.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebContentDisplayScreenlet.swift; sourceTree = ""; }; 881E61391ACBED7500862B9E /* WebContentDisplayViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebContentDisplayViewModel.swift; sourceTree = ""; }; @@ -570,6 +570,8 @@ 88B273141B7109E200477E5E /* MBProgressHUDPresenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MBProgressHUDPresenter.swift; sourceTree = ""; }; 88BCB5601B8CAC22004349F1 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = "en.lproj/assetlist-screenlet.strings"; sourceTree = ""; }; 88BCB5641B8CAD93004349F1 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = "en.lproj/ddllist-screenlet.strings"; sourceTree = ""; }; + 88BF02021BC546BE00515CB5 /* LiferayWebContentLoadFromArticleIdOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiferayWebContentLoadFromArticleIdOperation.swift; sourceTree = ""; }; + 88BF02031BC546BE00515CB5 /* LiferayWebContentLoadFromClassPKOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiferayWebContentLoadFromClassPKOperation.swift; sourceTree = ""; }; 88CA80581B25AF48004C1D59 /* LoginInteractor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginInteractor.swift; sourceTree = ""; }; 88CA80591B25AF48004C1D59 /* OAuthInteractor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OAuthInteractor.swift; sourceTree = ""; }; 88CA805A1B25AF48004C1D59 /* OAuthWebViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OAuthWebViewController.swift; sourceTree = ""; }; @@ -852,7 +854,8 @@ 881E61351ACBED7500862B9E /* ServerOperations */ = { isa = PBXGroup; children = ( - 881E61361ACBED7500862B9E /* LiferayWebContentLoadOperation.swift */, + 88BF02021BC546BE00515CB5 /* LiferayWebContentLoadFromArticleIdOperation.swift */, + 88BF02031BC546BE00515CB5 /* LiferayWebContentLoadFromClassPKOperation.swift */, ); path = ServerOperations; sourceTree = ""; @@ -1728,6 +1731,7 @@ 881B743E1B9EE28D00EA64ED /* SyncManager.swift in Sources */, 88CA806E1B25EE04004C1D59 /* CredentialsStore.swift in Sources */, 881E62341ACBFC3400862B9E /* DDLFieldCheckboxTableCell_default.swift in Sources */, + 88BF02051BC546BE00515CB5 /* LiferayWebContentLoadFromClassPKOperation.swift in Sources */, 881E61281ACBE5F000862B9E /* UserPortraitViewModel.swift in Sources */, 881E61871ACBEE0B00862B9E /* DDLListScreenlet.swift in Sources */, 881E611F1ACBE5F000862B9E /* SignUpViewModel.swift in Sources */, @@ -1778,7 +1782,6 @@ 881E60B91ACBE3FF00862B9E /* BaseScreenlet.swift in Sources */, 8892C6B51ACBD95400192232 /* SessionContext.swift in Sources */, 881E61831ACBEE0B00862B9E /* LiferayDDLFormUploadOperation.swift in Sources */, - 881E613B1ACBED7500862B9E /* LiferayWebContentLoadOperation.swift in Sources */, 881E610F1ACBE5F000862B9E /* ForgotPasswordViewModel.swift in Sources */, 881E618D1ACBEE0B00862B9E /* DDLFieldBoolean.swift in Sources */, 88CA805F1B25AF48004C1D59 /* OAuthWebViewController.swift in Sources */, @@ -1859,6 +1862,7 @@ 881E60C21ACBE43200862B9E /* ServerOperationInteractor.swift in Sources */, 881E617C1ACBEE0B00862B9E /* DDLFormLoadFormInteractor.swift in Sources */, 881E617A1ACBEE0B00862B9E /* DDLFormViewModel.swift in Sources */, + 88BF02041BC546BE00515CB5 /* LiferayWebContentLoadFromArticleIdOperation.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From b1102fd4d92639f039826fd78db702c92c0a9ba9 Mon Sep 17 00:00:00 2001 From: JM Date: Wed, 7 Oct 2015 14:42:09 +0200 Subject: [PATCH 003/197] LSR-643 Create base operation for loading web contents --- .../LiferayWebContentLoadBaseOperation.swift | 68 +++++++++++++++++++ ...WebContentLoadFromArticleIdOperation.swift | 51 +++++--------- .../WebContentDisplayLoadInteractor.swift | 18 ++--- .../LiferayScreens.xcodeproj/project.pbxproj | 4 ++ 4 files changed, 99 insertions(+), 42 deletions(-) create mode 100644 ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadBaseOperation.swift diff --git a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadBaseOperation.swift b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadBaseOperation.swift new file mode 100644 index 0000000000..e2c6faa883 --- /dev/null +++ b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadBaseOperation.swift @@ -0,0 +1,68 @@ +/** +* Copyright (c) 2000-present Liferay, Inc. All rights reserved. +* +* This library is free software; you can redistribute it and/or modify it under +* the terms of the GNU Lesser General Public License as published by the Free +* Software Foundation; either version 2.1 of the License, or (at your option) +* any later version. +* +* This library is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +* details. +*/ +import UIKit + + +public class LiferayWebContentLoadBaseOperation: ServerOperation { + + public var groupId: Int64? + public var templateId: Int64? + + public var resultHTML: String? + + + //MARK: ServerOperation + + override public func validateData() -> ValidationError? { + let error = super.validateData() + + if error == nil { + if groupId == nil { + return ValidationError("webcontentdisplay-screenlet", "undefined-group") + } + } + + return error + } + + override public func doRun(#session: LRSession) { + resultHTML = nil + + var result: String + + if let template = templateId { + let service = LRScreensjournalarticleService_v62(session: session) + + result = doGetJournalArticleWithTemplate(templateId!, session: session) + } + else { + result = doGetJournalArticle(session) + } + + if lastError == nil { + resultHTML = result + } + } + + internal func doGetJournalArticleWithTemplate( + templateId: Int64, + session: LRSession) -> String { + fatalError("doGetJournalArticleWithTemplate method must be overwritten") + } + + internal func doGetJournalArticle(session: LRSession) -> String { + fatalError("doGetJournalArticle method must be overwritten") + } + +} diff --git a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromArticleIdOperation.swift b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromArticleIdOperation.swift index 02527e04c0..59b0b5ec97 100644 --- a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromArticleIdOperation.swift +++ b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromArticleIdOperation.swift @@ -14,13 +14,9 @@ import UIKit -public class LiferayWebContentLoadFromArticleIdOperation: ServerOperation { +public class LiferayWebContentLoadFromArticleIdOperation: LiferayWebContentLoadBaseOperation { - public var groupId: Int64? public var articleId: String? - public var templateId: Int64? - - public var resultHTML: String? //MARK: ServerOperation @@ -29,10 +25,6 @@ public class LiferayWebContentLoadFromArticleIdOperation: ServerOperation { let error = super.validateData() if error == nil { - if groupId == nil { - return ValidationError("webcontentdisplay-screenlet", "undefined-group") - } - if (articleId ?? "") == "" { return ValidationError("webcontentdisplay-screenlet", "undefined-article") } @@ -41,33 +33,26 @@ public class LiferayWebContentLoadFromArticleIdOperation: ServerOperation { return error } - override public func doRun(#session: LRSession) { - resultHTML = nil - - var result:String - - if let template = templateId { - let service = LRScreensjournalarticleService_v62(session: session) + override internal func doGetJournalArticleWithTemplate( + templateId: Int64, + session: LRSession) -> String { + let service = LRScreensjournalarticleService_v62(session: session) - result = service.getJournalArticleContentWithGroupId(groupId!, - articleId: articleId!, - templateId: templateId!, - locale: NSLocale.currentLocaleString, - error: &lastError) - } - else { - let service = LRJournalArticleService_v62(session: session) + return service.getJournalArticleContentWithGroupId(groupId!, + articleId: articleId!, + templateId: templateId, + locale: NSLocale.currentLocaleString, + error: &lastError) + } - result = service.getArticleContentWithGroupId(groupId!, - articleId: articleId!, - languageId: NSLocale.currentLocaleString, - themeDisplay: nil, - error: &lastError) - } + override internal func doGetJournalArticle(session: LRSession) -> String { + let service = LRJournalArticleService_v62(session: session) - if lastError == nil { - resultHTML = result - } + return service.getArticleContentWithGroupId(groupId!, + articleId: articleId!, + languageId: NSLocale.currentLocaleString, + themeDisplay: nil, + error: &lastError) } } diff --git a/ios/Framework/Core/WebContentDisplayScreenlet/WebContentDisplayLoadInteractor.swift b/ios/Framework/Core/WebContentDisplayScreenlet/WebContentDisplayLoadInteractor.swift index d2f3f0a4dc..090aa50ac1 100644 --- a/ios/Framework/Core/WebContentDisplayScreenlet/WebContentDisplayLoadInteractor.swift +++ b/ios/Framework/Core/WebContentDisplayScreenlet/WebContentDisplayLoadInteractor.swift @@ -19,10 +19,10 @@ class WebContentDisplayLoadInteractor: ServerReadOperationInteractor { var resultHTML: String? - override func createOperation() -> LiferayWebContentLoadOperation { + override func createOperation() -> LiferayWebContentLoadBaseOperation { let screenlet = self.screenlet as! WebContentDisplayScreenlet - let operation = LiferayWebContentLoadOperation() + let operation = LiferayWebContentLoadFromArticleIdOperation() operation.groupId = (screenlet.groupId != 0) ? screenlet.groupId : LiferayServerContext.groupId @@ -35,17 +35,17 @@ class WebContentDisplayLoadInteractor: ServerReadOperationInteractor { } override func completedOperation(op: ServerOperation) { - self.resultHTML = (op as? LiferayWebContentLoadOperation)?.resultHTML + self.resultHTML = (op as? LiferayWebContentLoadBaseOperation)?.resultHTML } override func readFromCache(op: ServerOperation, result: AnyObject? -> Void) { - if let loadOp = op as? LiferayWebContentLoadOperation, + if let loadOp = op as? LiferayWebContentLoadFromArticleIdOperation, groupId = loadOp.groupId, articleId = loadOp.articleId { SessionContext.currentCacheManager!.getString( collection: ScreenletName(WebContentDisplayScreenlet), - key: cacheKey(groupId, articleId)) { + key: articleCacheKey(groupId, articleId)) { loadOp.resultHTML = $0 result($0) } @@ -53,14 +53,14 @@ class WebContentDisplayLoadInteractor: ServerReadOperationInteractor { } override func writeToCache(op: ServerOperation) { - if let loadOp = op as? LiferayWebContentLoadOperation, + if let loadOp = op as? LiferayWebContentLoadFromArticleIdOperation, html = loadOp.resultHTML, groupId = loadOp.groupId, articleId = loadOp.articleId { SessionContext.currentCacheManager?.setClean( collection: ScreenletName(WebContentDisplayScreenlet), - key: cacheKey(groupId, articleId), + key: articleCacheKey(groupId, articleId), value: html, attributes: [ "groupId": NSNumber(longLong: groupId), @@ -68,8 +68,8 @@ class WebContentDisplayLoadInteractor: ServerReadOperationInteractor { } } - private func cacheKey(groupId: Int64, _ articleId: String) -> String { - return "\((groupId != 0) ? groupId : LiferayServerContext.groupId)-\(articleId)" + private func articleCacheKey(groupId: Int64, _ articleId: String) -> String { + return "\((groupId != 0) ? groupId : LiferayServerContext.groupId)-articleId-\(articleId)" } } diff --git a/ios/Framework/LiferayScreens.xcodeproj/project.pbxproj b/ios/Framework/LiferayScreens.xcodeproj/project.pbxproj index bb96f21686..e3d9e12041 100644 --- a/ios/Framework/LiferayScreens.xcodeproj/project.pbxproj +++ b/ios/Framework/LiferayScreens.xcodeproj/project.pbxproj @@ -294,6 +294,7 @@ 88BCB5661B8CAD93004349F1 /* ddllist-screenlet.strings in Resources */ = {isa = PBXBuildFile; fileRef = 88BCB5631B8CAD93004349F1 /* ddllist-screenlet.strings */; }; 88BF02041BC546BE00515CB5 /* LiferayWebContentLoadFromArticleIdOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88BF02021BC546BE00515CB5 /* LiferayWebContentLoadFromArticleIdOperation.swift */; }; 88BF02051BC546BE00515CB5 /* LiferayWebContentLoadFromClassPKOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88BF02031BC546BE00515CB5 /* LiferayWebContentLoadFromClassPKOperation.swift */; }; + 88BF02091BC5497B00515CB5 /* LiferayWebContentLoadBaseOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88BF02081BC5497B00515CB5 /* LiferayWebContentLoadBaseOperation.swift */; }; 88CA805B1B25AF48004C1D59 /* LoginInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88CA80581B25AF48004C1D59 /* LoginInteractor.swift */; }; 88CA805C1B25AF48004C1D59 /* LoginInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88CA80581B25AF48004C1D59 /* LoginInteractor.swift */; }; 88CA805D1B25AF48004C1D59 /* OAuthInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88CA80591B25AF48004C1D59 /* OAuthInteractor.swift */; }; @@ -572,6 +573,7 @@ 88BCB5641B8CAD93004349F1 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = "en.lproj/ddllist-screenlet.strings"; sourceTree = ""; }; 88BF02021BC546BE00515CB5 /* LiferayWebContentLoadFromArticleIdOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiferayWebContentLoadFromArticleIdOperation.swift; sourceTree = ""; }; 88BF02031BC546BE00515CB5 /* LiferayWebContentLoadFromClassPKOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiferayWebContentLoadFromClassPKOperation.swift; sourceTree = ""; }; + 88BF02081BC5497B00515CB5 /* LiferayWebContentLoadBaseOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiferayWebContentLoadBaseOperation.swift; sourceTree = ""; }; 88CA80581B25AF48004C1D59 /* LoginInteractor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginInteractor.swift; sourceTree = ""; }; 88CA80591B25AF48004C1D59 /* OAuthInteractor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OAuthInteractor.swift; sourceTree = ""; }; 88CA805A1B25AF48004C1D59 /* OAuthWebViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OAuthWebViewController.swift; sourceTree = ""; }; @@ -855,6 +857,7 @@ isa = PBXGroup; children = ( 88BF02021BC546BE00515CB5 /* LiferayWebContentLoadFromArticleIdOperation.swift */, + 88BF02081BC5497B00515CB5 /* LiferayWebContentLoadBaseOperation.swift */, 88BF02031BC546BE00515CB5 /* LiferayWebContentLoadFromClassPKOperation.swift */, ); path = ServerOperations; @@ -1756,6 +1759,7 @@ 888DF5B41ACC9FF100EB7DA1 /* LoginView_default.swift in Sources */, 881E613E1ACBED7500862B9E /* WebContentDisplayViewModel.swift in Sources */, 88CA91B81B8DE3AD000B92F2 /* UserPortraitDefaultProgressPresenter.swift in Sources */, + 88BF02091BC5497B00515CB5 /* LiferayWebContentLoadBaseOperation.swift in Sources */, 881E62361ACBFC3400862B9E /* DDLFieldDateTableCell_default.swift in Sources */, B2F3F3521B0A1923002CEF60 /* LRScreensddlrecordService_v62.m in Sources */, 881E61481ACBEDC600862B9E /* AssetListScreenlet.swift in Sources */, From 10d91f1e8d08c1ed7b18456ca0b529e3f3ac1d04 Mon Sep 17 00:00:00 2001 From: JM Date: Wed, 7 Oct 2015 14:53:06 +0200 Subject: [PATCH 004/197] LSR-643 Support loading from classPK --- .../webcontentdisplay-screenlet.strings | 1 + .../LiferayWebContentLoadBaseOperation.swift | 2 +- ...ayWebContentLoadFromClassPKOperation.swift | 52 +++++++++++++++++++ .../WebContentDisplayLoadInteractor.swift | 20 +++++-- .../WebContentDisplayScreenlet.swift | 6 ++- 5 files changed, 75 insertions(+), 6 deletions(-) create mode 100644 ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift diff --git a/ios/Framework/Core/Resources/en.lproj/webcontentdisplay-screenlet.strings b/ios/Framework/Core/Resources/en.lproj/webcontentdisplay-screenlet.strings index a12b94b481..89c85ea1dc 100644 --- a/ios/Framework/Core/Resources/en.lproj/webcontentdisplay-screenlet.strings +++ b/ios/Framework/Core/Resources/en.lproj/webcontentdisplay-screenlet.strings @@ -1,2 +1,3 @@ "webcontentdisplay-screenlet-undefined-group"="The group is undefined"; "webcontentdisplay-screenlet-undefined-article"="The article is undefined"; +"webcontentdisplay-screenlet-undefined-classpk"="The classPK is undefined"; diff --git a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadBaseOperation.swift b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadBaseOperation.swift index e2c6faa883..94f76b412e 100644 --- a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadBaseOperation.swift +++ b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadBaseOperation.swift @@ -41,7 +41,7 @@ public class LiferayWebContentLoadBaseOperation: ServerOperation { var result: String - if let template = templateId { + if templateId ?? 0 != 0 { let service = LRScreensjournalarticleService_v62(session: session) result = doGetJournalArticleWithTemplate(templateId!, session: session) diff --git a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift new file mode 100644 index 0000000000..2b012ea2e7 --- /dev/null +++ b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift @@ -0,0 +1,52 @@ +/** +* Copyright (c) 2000-present Liferay, Inc. All rights reserved. +* +* This library is free software; you can redistribute it and/or modify it under +* the terms of the GNU Lesser General Public License as published by the Free +* Software Foundation; either version 2.1 of the License, or (at your option) +* any later version. +* +* This library is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +* details. +*/ +import UIKit + + +public class LiferayWebContentLoadFromClassPKOperation: LiferayWebContentLoadBaseOperation { + + public var classPK: Int64? + + + //MARK: ServerOperation + + override public func validateData() -> ValidationError? { + let error = super.validateData() + + if error == nil { + if (classPK ?? 0) == 0 { + return ValidationError("webcontentdisplay-screenlet", "undefined-classpk") + } + } + + return error + } + + override internal func doGetJournalArticleWithTemplate( + templateId: Int64, + session: LRSession) -> String { + fatalError("No supported yet") + } + + override internal func doGetJournalArticle(session: LRSession) -> String { + let service = LRScreensjournalarticleService_v62(session: session) + + //TODO this need to be changed to Int64 in the plugin + return service.getJournalArticleContentWithGroupId(Int32(groupId!), + classPK: Int32(classPK!), + locale: NSLocale.currentLocaleString, + error: &lastError) + } + +} diff --git a/ios/Framework/Core/WebContentDisplayScreenlet/WebContentDisplayLoadInteractor.swift b/ios/Framework/Core/WebContentDisplayScreenlet/WebContentDisplayLoadInteractor.swift index 090aa50ac1..60a8a299f4 100644 --- a/ios/Framework/Core/WebContentDisplayScreenlet/WebContentDisplayLoadInteractor.swift +++ b/ios/Framework/Core/WebContentDisplayScreenlet/WebContentDisplayLoadInteractor.swift @@ -22,13 +22,25 @@ class WebContentDisplayLoadInteractor: ServerReadOperationInteractor { override func createOperation() -> LiferayWebContentLoadBaseOperation { let screenlet = self.screenlet as! WebContentDisplayScreenlet - let operation = LiferayWebContentLoadFromArticleIdOperation() + let operation: LiferayWebContentLoadBaseOperation - operation.groupId = (screenlet.groupId != 0) - ? screenlet.groupId : LiferayServerContext.groupId + if screenlet.articleId != "" { + let articleIdOp = LiferayWebContentLoadFromArticleIdOperation() + + articleIdOp.articleId = screenlet.articleId + + operation = articleIdOp + } + else { + let classPKOp = LiferayWebContentLoadFromClassPKOperation() - operation.articleId = screenlet.articleId + classPKOp.classPK = screenlet.classPK + operation = classPKOp + } + + operation.groupId = (screenlet.groupId != 0) + ? screenlet.groupId : LiferayServerContext.groupId operation.templateId = screenlet.templateId return operation diff --git a/ios/Framework/Core/WebContentDisplayScreenlet/WebContentDisplayScreenlet.swift b/ios/Framework/Core/WebContentDisplayScreenlet/WebContentDisplayScreenlet.swift index 8f4f26bc2f..24c5617a6f 100644 --- a/ios/Framework/Core/WebContentDisplayScreenlet/WebContentDisplayScreenlet.swift +++ b/ios/Framework/Core/WebContentDisplayScreenlet/WebContentDisplayScreenlet.swift @@ -28,7 +28,11 @@ import UIKit @IBDesignable public class WebContentDisplayScreenlet: BaseScreenlet { @IBInspectable public var groupId: Int64 = 0 + + // use either articleId or classPK @IBInspectable public var articleId: String = "" + @IBInspectable public var classPK: Int64 = 0 + @IBInspectable public var autoLoad: Bool = true @IBInspectable public var templateId: Int64 = 0 @IBInspectable public var offlinePolicy: String? = CacheStrategyType.RemoteFirst.rawValue @@ -39,7 +43,7 @@ import UIKit //MARK: Public methods override public func onShow() { - if autoLoad && articleId != "" { + if autoLoad && (articleId != "" || classPK != 0) { loadWebContent() } } From 95b0b4ea7085e873b449dbb2d4460531482fa441 Mon Sep 17 00:00:00 2001 From: JM Date: Wed, 7 Oct 2015 16:20:43 +0200 Subject: [PATCH 005/197] LSR-643 Fix wrong translation key --- .../ForgotPasswordScreenlet/ForgotPasswordView_default.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Framework/Themes/Default/Auth/ForgotPasswordScreenlet/ForgotPasswordView_default.swift b/ios/Framework/Themes/Default/Auth/ForgotPasswordScreenlet/ForgotPasswordView_default.swift index f3bc879070..2c77863a6e 100644 --- a/ios/Framework/Themes/Default/Auth/ForgotPasswordScreenlet/ForgotPasswordView_default.swift +++ b/ios/Framework/Themes/Default/Auth/ForgotPasswordScreenlet/ForgotPasswordView_default.swift @@ -74,7 +74,7 @@ public class ForgotPasswordView_default: BaseScreenletView, ForgotPasswordViewMo override public func onSetTranslations() { requestPasswordButton?.replaceAttributedTitle( - LocalizedString("default", "forgot-password-button", self), + LocalizedString("default", "forgotpassword-button", self), forState: .Normal) } From c0a1dfa75291e0d8612fe5c3ce1d10e771e4b5b3 Mon Sep 17 00:00:00 2001 From: JM Date: Wed, 7 Oct 2015 16:59:22 +0200 Subject: [PATCH 006/197] LSR-643 Handle error properly --- .../LiferayWebContentLoadBaseOperation.swift | 2 +- ...erayWebContentLoadFromClassPKOperation.swift | 2 +- .../WebContentDisplayLoadInteractor.swift | 17 +++++++++++------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadBaseOperation.swift b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadBaseOperation.swift index 94f76b412e..caa8a6ec0d 100644 --- a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadBaseOperation.swift +++ b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadBaseOperation.swift @@ -28,7 +28,7 @@ public class LiferayWebContentLoadBaseOperation: ServerOperation { let error = super.validateData() if error == nil { - if groupId == nil { + if groupId ?? 0 == 0 { return ValidationError("webcontentdisplay-screenlet", "undefined-group") } } diff --git a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift index 2b012ea2e7..f9e06c66f6 100644 --- a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift +++ b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift @@ -25,7 +25,7 @@ public class LiferayWebContentLoadFromClassPKOperation: LiferayWebContentLoadBas let error = super.validateData() if error == nil { - if (classPK ?? 0) == 0 { + if classPK ?? 0 == 0 { return ValidationError("webcontentdisplay-screenlet", "undefined-classpk") } } diff --git a/ios/Framework/Core/WebContentDisplayScreenlet/WebContentDisplayLoadInteractor.swift b/ios/Framework/Core/WebContentDisplayScreenlet/WebContentDisplayLoadInteractor.swift index 60a8a299f4..63ce09cc6d 100644 --- a/ios/Framework/Core/WebContentDisplayScreenlet/WebContentDisplayLoadInteractor.swift +++ b/ios/Framework/Core/WebContentDisplayScreenlet/WebContentDisplayLoadInteractor.swift @@ -19,10 +19,10 @@ class WebContentDisplayLoadInteractor: ServerReadOperationInteractor { var resultHTML: String? - override func createOperation() -> LiferayWebContentLoadBaseOperation { + override func createOperation() -> LiferayWebContentLoadBaseOperation? { let screenlet = self.screenlet as! WebContentDisplayScreenlet - let operation: LiferayWebContentLoadBaseOperation + let operation: LiferayWebContentLoadBaseOperation? if screenlet.articleId != "" { let articleIdOp = LiferayWebContentLoadFromArticleIdOperation() @@ -31,17 +31,22 @@ class WebContentDisplayLoadInteractor: ServerReadOperationInteractor { operation = articleIdOp } - else { + else if screenlet.classPK != 0 { let classPKOp = LiferayWebContentLoadFromClassPKOperation() classPKOp.classPK = screenlet.classPK operation = classPKOp } + else { + operation = nil + } - operation.groupId = (screenlet.groupId != 0) - ? screenlet.groupId : LiferayServerContext.groupId - operation.templateId = screenlet.templateId + if let operation = operation { + operation.groupId = (screenlet.groupId != 0) + ? screenlet.groupId : LiferayServerContext.groupId + operation.templateId = screenlet.templateId + } return operation } From 26ff1b77d8dce6fbbd649a2c658e144c7b9b67ce Mon Sep 17 00:00:00 2001 From: JM Date: Wed, 7 Oct 2015 17:07:41 +0200 Subject: [PATCH 007/197] LSR-643 Trigger error method in case of operation not started --- ios/Framework/Core/Base/ServerOperationInteractor.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ios/Framework/Core/Base/ServerOperationInteractor.swift b/ios/Framework/Core/Base/ServerOperationInteractor.swift index ef0b310fa6..d4452a7ff0 100644 --- a/ios/Framework/Core/Base/ServerOperationInteractor.swift +++ b/ios/Framework/Core/Base/ServerOperationInteractor.swift @@ -42,6 +42,8 @@ public class ServerOperationInteractor: Interactor { return true } + self.callOnFailure(NSError.errorWithCause(.AbortedDueToPreconditions)) + return false } From 85e61519a3227eaa833d7af3b8b7557474e0728c Mon Sep 17 00:00:00 2001 From: JM Date: Wed, 7 Oct 2015 17:16:44 +0200 Subject: [PATCH 008/197] LSR-643 Update services: fixed wrong datatypes and added new method --- .../Services/LRScreensjournalarticleService_v62.h | 3 ++- .../Services/LRScreensjournalarticleService_v62.m | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ios/Framework/Core/Services/LRScreensjournalarticleService_v62.h b/ios/Framework/Core/Services/LRScreensjournalarticleService_v62.h index 199e11eeb7..cc01f29b4d 100644 --- a/ios/Framework/Core/Services/LRScreensjournalarticleService_v62.h +++ b/ios/Framework/Core/Services/LRScreensjournalarticleService_v62.h @@ -23,7 +23,8 @@ */ @interface LRScreensjournalarticleService_v62 : LRBaseService -- (NSString *)getJournalArticleContentWithGroupId:(int)groupId classPK:(int)classPK locale:(NSString *)locale error:(NSError **)error; +- (NSString *)getJournalArticleContentWithGroupId:(long long)groupId classPK:(long long)classPK locale:(NSString *)locale error:(NSError **)error; - (NSString *)getJournalArticleContentWithGroupId:(long long)groupId articleId:(NSString *)articleId templateId:(long long)templateId locale:(NSString *)locale error:(NSError **)error; +- (NSString *)getJournalArticleContentWithGroupId:(long long)groupId classPK:(long long)classPK templateId:(long long)templateId locale:(NSString *)locale error:(NSError **)error; @end \ No newline at end of file diff --git a/ios/Framework/Core/Services/LRScreensjournalarticleService_v62.m b/ios/Framework/Core/Services/LRScreensjournalarticleService_v62.m index c464077b8e..b7bcdfb511 100644 --- a/ios/Framework/Core/Services/LRScreensjournalarticleService_v62.m +++ b/ios/Framework/Core/Services/LRScreensjournalarticleService_v62.m @@ -19,7 +19,7 @@ */ @implementation LRScreensjournalarticleService_v62 -- (NSString *)getJournalArticleContentWithGroupId:(int)groupId classPK:(int)classPK locale:(NSString *)locale error:(NSError **)error { +- (NSString *)getJournalArticleContentWithGroupId:(long long)groupId classPK:(long long)classPK locale:(NSString *)locale error:(NSError **)error { NSMutableDictionary *_params = [NSMutableDictionary dictionaryWithDictionary:@{ @"groupId": @(groupId), @"classPK": @(classPK), @@ -44,4 +44,17 @@ - (NSString *)getJournalArticleContentWithGroupId:(long long)groupId articleId:( return (NSString *)[self.session invoke:_command error:error]; } +- (NSString *)getJournalArticleContentWithGroupId:(long long)groupId classPK:(long long)classPK templateId:(long long)templateId locale:(NSString *)locale error:(NSError **)error { + NSMutableDictionary *_params = [NSMutableDictionary dictionaryWithDictionary:@{ + @"groupId": @(groupId), + @"classPK": @(classPK), + @"templateId": @(templateId), + @"locale": locale + }]; + + NSDictionary *_command = @{@"/screens-web.screensjournalarticle/get-journal-article-content": _params}; + + return (NSString *)[self.session invoke:_command error:error]; +} + @end \ No newline at end of file From d6798626982ae63441dddcae9d83c5992d755b3f Mon Sep 17 00:00:00 2001 From: JM Date: Wed, 7 Oct 2015 17:21:26 +0200 Subject: [PATCH 009/197] LSR-643 Support web content with templateId using classPK --- .../LiferayWebContentLoadFromClassPKOperation.swift | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift index f9e06c66f6..d4db746c4a 100644 --- a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift +++ b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift @@ -36,15 +36,20 @@ public class LiferayWebContentLoadFromClassPKOperation: LiferayWebContentLoadBas override internal func doGetJournalArticleWithTemplate( templateId: Int64, session: LRSession) -> String { - fatalError("No supported yet") + let service = LRScreensjournalarticleService_v62(session: session) + + return service.getJournalArticleContentWithGroupId(groupId!, + classPK: classPK!, + templateId: templateId, + locale: NSLocale.currentLocaleString, + error: &lastError) } override internal func doGetJournalArticle(session: LRSession) -> String { let service = LRScreensjournalarticleService_v62(session: session) - //TODO this need to be changed to Int64 in the plugin - return service.getJournalArticleContentWithGroupId(Int32(groupId!), - classPK: Int32(classPK!), + return service.getJournalArticleContentWithGroupId(groupId!, + classPK: classPK!, locale: NSLocale.currentLocaleString, error: &lastError) } From f9fb22f87313a800dfe7e3eb67103113fac79bfb Mon Sep 17 00:00:00 2001 From: JM Date: Wed, 7 Oct 2015 18:16:28 +0200 Subject: [PATCH 010/197] LSR-643 Fix error on base class --- .../LiferayWebContentLoadBaseOperation.swift | 13 +++++++++---- ...iferayWebContentLoadFromArticleIdOperation.swift | 4 ++-- .../LiferayWebContentLoadFromClassPKOperation.swift | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadBaseOperation.swift b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadBaseOperation.swift index caa8a6ec0d..3e4396b5f6 100644 --- a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadBaseOperation.swift +++ b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadBaseOperation.swift @@ -39,7 +39,7 @@ public class LiferayWebContentLoadBaseOperation: ServerOperation { override public func doRun(#session: LRSession) { resultHTML = nil - var result: String + var result: String? if templateId ?? 0 != 0 { let service = LRScreensjournalarticleService_v62(session: session) @@ -51,17 +51,22 @@ public class LiferayWebContentLoadBaseOperation: ServerOperation { } if lastError == nil { - resultHTML = result + if let result = result { + resultHTML = result + } + else { + lastError = NSError.errorWithCause(.InvalidServerResponse) + } } } internal func doGetJournalArticleWithTemplate( templateId: Int64, - session: LRSession) -> String { + session: LRSession) -> String? { fatalError("doGetJournalArticleWithTemplate method must be overwritten") } - internal func doGetJournalArticle(session: LRSession) -> String { + internal func doGetJournalArticle(session: LRSession) -> String? { fatalError("doGetJournalArticle method must be overwritten") } diff --git a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromArticleIdOperation.swift b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromArticleIdOperation.swift index 59b0b5ec97..f5f2e1748b 100644 --- a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromArticleIdOperation.swift +++ b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromArticleIdOperation.swift @@ -35,7 +35,7 @@ public class LiferayWebContentLoadFromArticleIdOperation: LiferayWebContentLoadB override internal func doGetJournalArticleWithTemplate( templateId: Int64, - session: LRSession) -> String { + session: LRSession) -> String? { let service = LRScreensjournalarticleService_v62(session: session) return service.getJournalArticleContentWithGroupId(groupId!, @@ -45,7 +45,7 @@ public class LiferayWebContentLoadFromArticleIdOperation: LiferayWebContentLoadB error: &lastError) } - override internal func doGetJournalArticle(session: LRSession) -> String { + override internal func doGetJournalArticle(session: LRSession) -> String? { let service = LRJournalArticleService_v62(session: session) return service.getArticleContentWithGroupId(groupId!, diff --git a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift index d4db746c4a..42766596a1 100644 --- a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift +++ b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift @@ -35,7 +35,7 @@ public class LiferayWebContentLoadFromClassPKOperation: LiferayWebContentLoadBas override internal func doGetJournalArticleWithTemplate( templateId: Int64, - session: LRSession) -> String { + session: LRSession) -> String? { let service = LRScreensjournalarticleService_v62(session: session) return service.getJournalArticleContentWithGroupId(groupId!, @@ -45,7 +45,7 @@ public class LiferayWebContentLoadFromClassPKOperation: LiferayWebContentLoadBas error: &lastError) } - override internal func doGetJournalArticle(session: LRSession) -> String { + override internal func doGetJournalArticle(session: LRSession) -> String? { let service = LRScreensjournalarticleService_v62(session: session) return service.getJournalArticleContentWithGroupId(groupId!, From 5ce3805045696effaa593b1bd3a6f14fe58af325 Mon Sep 17 00:00:00 2001 From: JM Date: Wed, 7 Oct 2015 21:55:18 +0200 Subject: [PATCH 011/197] LSR-643 Renamed service arguments --- .../Core/Services/LRScreensjournalarticleService_v62.h | 4 ++-- .../Core/Services/LRScreensjournalarticleService_v62.m | 8 ++++---- .../LiferayWebContentLoadFromArticleIdOperation.swift | 2 +- .../LiferayWebContentLoadFromClassPKOperation.swift | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ios/Framework/Core/Services/LRScreensjournalarticleService_v62.h b/ios/Framework/Core/Services/LRScreensjournalarticleService_v62.h index cc01f29b4d..0d60bd8388 100644 --- a/ios/Framework/Core/Services/LRScreensjournalarticleService_v62.h +++ b/ios/Framework/Core/Services/LRScreensjournalarticleService_v62.h @@ -24,7 +24,7 @@ @interface LRScreensjournalarticleService_v62 : LRBaseService - (NSString *)getJournalArticleContentWithGroupId:(long long)groupId classPK:(long long)classPK locale:(NSString *)locale error:(NSError **)error; -- (NSString *)getJournalArticleContentWithGroupId:(long long)groupId articleId:(NSString *)articleId templateId:(long long)templateId locale:(NSString *)locale error:(NSError **)error; -- (NSString *)getJournalArticleContentWithGroupId:(long long)groupId classPK:(long long)classPK templateId:(long long)templateId locale:(NSString *)locale error:(NSError **)error; +- (NSString *)getJournalArticleContentWithGroupId:(long long)groupId articleId:(NSString *)articleId ddmTemplateId:(long long)ddmTemplateId locale:(NSString *)locale error:(NSError **)error; +- (NSString *)getJournalArticleContentWithGroupId:(long long)groupId classPK:(long long)classPK ddmTemplateId:(long long)ddmTemplateId locale:(NSString *)locale error:(NSError **)error; @end \ No newline at end of file diff --git a/ios/Framework/Core/Services/LRScreensjournalarticleService_v62.m b/ios/Framework/Core/Services/LRScreensjournalarticleService_v62.m index b7bcdfb511..2f63793b9f 100644 --- a/ios/Framework/Core/Services/LRScreensjournalarticleService_v62.m +++ b/ios/Framework/Core/Services/LRScreensjournalarticleService_v62.m @@ -31,11 +31,11 @@ - (NSString *)getJournalArticleContentWithGroupId:(long long)groupId classPK:(lo return (NSString *)[self.session invoke:_command error:error]; } -- (NSString *)getJournalArticleContentWithGroupId:(long long)groupId articleId:(NSString *)articleId templateId:(long long)templateId locale:(NSString *)locale error:(NSError **)error { +- (NSString *)getJournalArticleContentWithGroupId:(long long)groupId articleId:(NSString *)articleId ddmTemplateId:(long long)ddmTemplateId locale:(NSString *)locale error:(NSError **)error { NSMutableDictionary *_params = [NSMutableDictionary dictionaryWithDictionary:@{ @"groupId": @(groupId), @"articleId": articleId, - @"templateId": @(templateId), + @"ddmTemplateId": @(ddmTemplateId), @"locale": locale }]; @@ -44,11 +44,11 @@ - (NSString *)getJournalArticleContentWithGroupId:(long long)groupId articleId:( return (NSString *)[self.session invoke:_command error:error]; } -- (NSString *)getJournalArticleContentWithGroupId:(long long)groupId classPK:(long long)classPK templateId:(long long)templateId locale:(NSString *)locale error:(NSError **)error { +- (NSString *)getJournalArticleContentWithGroupId:(long long)groupId classPK:(long long)classPK ddmTemplateId:(long long)ddmTemplateId locale:(NSString *)locale error:(NSError **)error { NSMutableDictionary *_params = [NSMutableDictionary dictionaryWithDictionary:@{ @"groupId": @(groupId), @"classPK": @(classPK), - @"templateId": @(templateId), + @"ddmTemplateId": @(ddmTemplateId), @"locale": locale }]; diff --git a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromArticleIdOperation.swift b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromArticleIdOperation.swift index f5f2e1748b..a2d08c70fe 100644 --- a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromArticleIdOperation.swift +++ b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromArticleIdOperation.swift @@ -40,7 +40,7 @@ public class LiferayWebContentLoadFromArticleIdOperation: LiferayWebContentLoadB return service.getJournalArticleContentWithGroupId(groupId!, articleId: articleId!, - templateId: templateId, + ddmTemplateId: templateId, locale: NSLocale.currentLocaleString, error: &lastError) } diff --git a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift index 42766596a1..d6e8b5c9ce 100644 --- a/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift +++ b/ios/Framework/Core/WebContentDisplayScreenlet/ServerOperations/LiferayWebContentLoadFromClassPKOperation.swift @@ -40,7 +40,7 @@ public class LiferayWebContentLoadFromClassPKOperation: LiferayWebContentLoadBas return service.getJournalArticleContentWithGroupId(groupId!, classPK: classPK!, - templateId: templateId, + ddmTemplateId: templateId, locale: NSLocale.currentLocaleString, error: &lastError) } From d44c680ee0153454337f94205c0840815861a379 Mon Sep 17 00:00:00 2001 From: JM Date: Thu, 8 Oct 2015 11:28:24 +0200 Subject: [PATCH 012/197] LSR-644 New services --- ios/Framework/Core/Services/LRScreensassetentryService_v62.h | 2 +- ios/Framework/Core/Services/LRScreensassetentryService_v62.m | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ios/Framework/Core/Services/LRScreensassetentryService_v62.h b/ios/Framework/Core/Services/LRScreensassetentryService_v62.h index 1124001a90..4915bffd78 100644 --- a/ios/Framework/Core/Services/LRScreensassetentryService_v62.h +++ b/ios/Framework/Core/Services/LRScreensassetentryService_v62.h @@ -24,6 +24,6 @@ @interface LRScreensassetentryService_v62 : LRBaseService - (NSArray *)getAssetEntriesWithAssetEntryQuery:(LRJSONObjectWrapper *)assetEntryQuery locale:(NSString *)locale error:(NSError **)error; -- (NSArray *)getAssetEntriesWithCompanyId:(long long)companyId groupId:(long long)groupId portletItemName:(NSString *)portletItemName locale:(NSString *)locale error:(NSError **)error; +- (NSArray *)getAssetEntriesWithCompanyId:(long long)companyId groupId:(long long)groupId portletItemName:(NSString *)portletItemName locale:(NSString *)locale max:(int)max error:(NSError **)error; @end \ No newline at end of file diff --git a/ios/Framework/Core/Services/LRScreensassetentryService_v62.m b/ios/Framework/Core/Services/LRScreensassetentryService_v62.m index 355309b854..bad38261a1 100644 --- a/ios/Framework/Core/Services/LRScreensassetentryService_v62.m +++ b/ios/Framework/Core/Services/LRScreensassetentryService_v62.m @@ -30,12 +30,13 @@ - (NSArray *)getAssetEntriesWithAssetEntryQuery:(LRJSONObjectWrapper *)assetEntr return (NSArray *)[self.session invoke:_command error:error]; } -- (NSArray *)getAssetEntriesWithCompanyId:(long long)companyId groupId:(long long)groupId portletItemName:(NSString *)portletItemName locale:(NSString *)locale error:(NSError **)error { +- (NSArray *)getAssetEntriesWithCompanyId:(long long)companyId groupId:(long long)groupId portletItemName:(NSString *)portletItemName locale:(NSString *)locale max:(int)max error:(NSError **)error { NSMutableDictionary *_params = [NSMutableDictionary dictionaryWithDictionary:@{ @"companyId": @(companyId), @"groupId": @(groupId), @"portletItemName": portletItemName, - @"locale": locale + @"locale": locale, + @"max": @(max) }]; NSDictionary *_command = @{@"/screens-web.screensassetentry/get-asset-entries": _params}; From 1d0b5de651e2728ec9b649fd99578f9e52ad671d Mon Sep 17 00:00:00 2001 From: JM Date: Thu, 8 Oct 2015 11:31:52 +0200 Subject: [PATCH 013/197] LSR-644 Remove useless code --- .../LiferayAssetListPageOperation.swift | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/ios/Framework/Core/AssetListScreenlet/ServerOperations/LiferayAssetListPageOperation.swift b/ios/Framework/Core/AssetListScreenlet/ServerOperations/LiferayAssetListPageOperation.swift index a119276119..c528e61f59 100644 --- a/ios/Framework/Core/AssetListScreenlet/ServerOperations/LiferayAssetListPageOperation.swift +++ b/ios/Framework/Core/AssetListScreenlet/ServerOperations/LiferayAssetListPageOperation.swift @@ -70,25 +70,16 @@ public class LiferayAssetListPageOperation: LiferayPaginationOperation { override internal func doGetPageRowsOperation(#session: LRBatchSession, startRow: Int, endRow: Int) { let service = LRScreensassetentryService_v62(session: session) - if let portletItemName = portletItemName { - service.getAssetEntriesWithCompanyId(LiferayServerContext.companyId, - groupId: groupId!, - portletItemName: portletItemName, - locale: NSLocale.currentLocaleString, - error: &lastError) - } - else { - var entryQueryAttributes = configureEntryQueryAttributes() + var entryQueryAttributes = configureEntryQueryAttributes() - entryQueryAttributes["start"] = startRow - entryQueryAttributes["end"] = endRow + entryQueryAttributes["start"] = startRow + entryQueryAttributes["end"] = endRow - let entryQuery = LRJSONObjectWrapper(JSONObject: entryQueryAttributes) + let entryQuery = LRJSONObjectWrapper(JSONObject: entryQueryAttributes) - service.getAssetEntriesWithAssetEntryQuery(entryQuery, - locale: NSLocale.currentLocaleString, - error: nil) - } + service.getAssetEntriesWithAssetEntryQuery(entryQuery, + locale: NSLocale.currentLocaleString, + error: nil) } override internal func doGetRowCountOperation(#session: LRBatchSession) { From 2fe06e7af3eeb5706013b047a3e5b76bb0eca1bb Mon Sep 17 00:00:00 2001 From: JM Date: Thu, 8 Oct 2015 12:11:40 +0200 Subject: [PATCH 014/197] LSR-644 Support page count and handle fake pagination --- .../LiferayAssetListPageOperation.swift | 42 ++++++++++++------- .../LiferayPaginationOperation.swift | 6 +-- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/ios/Framework/Core/AssetListScreenlet/ServerOperations/LiferayAssetListPageOperation.swift b/ios/Framework/Core/AssetListScreenlet/ServerOperations/LiferayAssetListPageOperation.swift index c528e61f59..7e217a85c2 100644 --- a/ios/Framework/Core/AssetListScreenlet/ServerOperations/LiferayAssetListPageOperation.swift +++ b/ios/Framework/Core/AssetListScreenlet/ServerOperations/LiferayAssetListPageOperation.swift @@ -42,23 +42,35 @@ public class LiferayAssetListPageOperation: LiferayPaginationOperation { if let portletItemName = portletItemName { let service = LRScreensassetentryService_v62(session: session) - let responses = service.getAssetEntriesWithCompanyId(LiferayServerContext.companyId, - groupId: groupId!, - portletItemName: portletItemName, - locale: NSLocale.currentLocaleString, - error: &lastError) - - if lastError == nil { - if let entriesResponse = responses as? [[String:AnyObject]] { - let serverPageContent = entriesResponse - - resultPageContent = serverPageContent - resultRowCount = serverPageContent.count - } - else { - lastError = NSError.errorWithCause(.InvalidServerResponse, userInfo: nil) + if startRow == 0 { + // since the service doesn't support pagination, we ask for + // rows from the top to the endRow (whole single page) + let rowCount = endRow + + let responses = service.getAssetEntriesWithCompanyId(LiferayServerContext.companyId, + groupId: groupId!, + portletItemName: portletItemName, + locale: NSLocale.currentLocaleString, + max: Int32(endRow), + error: &lastError) + + if lastError == nil { + if let entriesResponse = responses as? [[String:AnyObject]] { + let serverPageContent = entriesResponse + + resultPageContent = serverPageContent + resultRowCount = serverPageContent.count + } + else { + lastError = NSError.errorWithCause(.InvalidServerResponse, userInfo: nil) + } } } + else { + // return empty content for pages different from the first one + resultPageContent = [] + resultRowCount = 0 + } } else { super.doRun(session: session) diff --git a/ios/Framework/Core/Base/BaseListScreenlet/ServerOperations/LiferayPaginationOperation.swift b/ios/Framework/Core/Base/BaseListScreenlet/ServerOperations/LiferayPaginationOperation.swift index 745e600a86..4d518920fe 100644 --- a/ios/Framework/Core/Base/BaseListScreenlet/ServerOperations/LiferayPaginationOperation.swift +++ b/ios/Framework/Core/Base/BaseListScreenlet/ServerOperations/LiferayPaginationOperation.swift @@ -16,9 +16,9 @@ import UIKit public class LiferayPaginationOperation: ServerOperation { - private let startRow: Int - private let endRow: Int - private let computeRowCount: Bool + public let startRow: Int + public let endRow: Int + public let computeRowCount: Bool public var resultPageContent: [[String:AnyObject]]? public var resultRowCount: Int? From 078b95bc3b164ebffc49f94aab36ce2ba8b5aad5 Mon Sep 17 00:00:00 2001 From: JM Date: Thu, 8 Oct 2015 12:15:53 +0200 Subject: [PATCH 015/197] LSR-644 Fix wrong validation --- .../ServerOperations/LiferayAssetListPageOperation.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Framework/Core/AssetListScreenlet/ServerOperations/LiferayAssetListPageOperation.swift b/ios/Framework/Core/AssetListScreenlet/ServerOperations/LiferayAssetListPageOperation.swift index 7e217a85c2..ea9762909b 100644 --- a/ios/Framework/Core/AssetListScreenlet/ServerOperations/LiferayAssetListPageOperation.swift +++ b/ios/Framework/Core/AssetListScreenlet/ServerOperations/LiferayAssetListPageOperation.swift @@ -30,7 +30,7 @@ public class LiferayAssetListPageOperation: LiferayPaginationOperation { return ValidationError("assetlist-screenlet", "undefined-group") } - if classNameId == nil { + if classNameId == nil && portletItemName == nil { return ValidationError("assetlist-screenlet", "undefined-classname") } } From 12438a504e8e7d5b42d65bfe70316bee5bc8ec4d Mon Sep 17 00:00:00 2001 From: JM Date: Tue, 13 Oct 2015 12:53:32 +0200 Subject: [PATCH 016/197] LSR-645 Function LocalizedString now returns most accurate translations --- ios/Framework/Core/Extensions/Global.swift | 24 ++++++++++++++----- .../Core/Extensions/NSLocale+Screens.swift | 8 +++++++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ios/Framework/Core/Extensions/Global.swift b/ios/Framework/Core/Extensions/Global.swift index b5e7acc1bd..8196bafeb9 100644 --- a/ios/Framework/Core/Extensions/Global.swift +++ b/ios/Framework/Core/Extensions/Global.swift @@ -99,16 +99,28 @@ public func ScreenletName(klass: AnyClass) -> String { public func LocalizedString(tableName: String, var key: String, obj: AnyObject) -> String { key = "\(tableName)-\(key)" + func getString(bundle: NSBundle) -> String? { + let res = NSLocalizedString(key, + tableName: tableName, + bundle: bundle, + value: key, + comment: ""); + + return (res.lowercaseString != key.lowercaseString) ? res : nil + } + let bundles = NSBundle.allBundles(obj.dynamicType) for bundle in bundles { - let res = NSLocalizedString(key, - tableName: tableName, - bundle: bundle, - value: key, - comment: ""); + // use forced language bundle + if let languageBundle = NSLocale.bundleForCurrentLanguageInBundle(bundle) { + if let res = getString(languageBundle) { + return res + } + } - if res.lowercaseString != key { + // try with outer bundle + if let res = getString(bundle) { return res } } diff --git a/ios/Framework/Core/Extensions/NSLocale+Screens.swift b/ios/Framework/Core/Extensions/NSLocale+Screens.swift index 497705e661..22dfe6f012 100644 --- a/ios/Framework/Core/Extensions/NSLocale+Screens.swift +++ b/ios/Framework/Core/Extensions/NSLocale+Screens.swift @@ -54,4 +54,12 @@ extension NSLocale { return "en_US" } + public class func bundleForCurrentLanguageInBundle(bundle: NSBundle) -> NSBundle? { + if let path = bundle.pathForResource(currentLanguageString, ofType: "lproj") { + return NSBundle(path: path) + } + + return nil + } + } From 58b3091c4c11fab073e2505d07b50bd603a4b4e9 Mon Sep 17 00:00:00 2001 From: JM Date: Tue, 13 Oct 2015 12:54:14 +0200 Subject: [PATCH 017/197] LSR-645 Allow to force the language to be used in the app (no matter what the global language in the Settings is) --- ios/Framework/Core/Extensions/NSLocale+Screens.swift | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ios/Framework/Core/Extensions/NSLocale+Screens.swift b/ios/Framework/Core/Extensions/NSLocale+Screens.swift index 22dfe6f012..d99345839b 100644 --- a/ios/Framework/Core/Extensions/NSLocale+Screens.swift +++ b/ios/Framework/Core/Extensions/NSLocale+Screens.swift @@ -17,12 +17,18 @@ import Foundation extension NSLocale { public class var currentLanguageString: String { - var preferredLanguage = NSLocale.preferredLanguages()[0].description as String + get { + var preferredLanguage = NSLocale.preferredLanguages()[0] as! String - preferredLanguage = preferredLanguage.substringToIndex( + preferredLanguage = preferredLanguage.substringToIndex( advance(preferredLanguage.startIndex, 2)) - return preferredLanguage + return preferredLanguage + } + set { + NSUserDefaults.standardUserDefaults().setObject([newValue], forKey: "AppleLanguages") + NSUserDefaults.standardUserDefaults().synchronize() + } } public class var currentLocaleString: String { From 3ff2ed769c1476295a0d6cc97da523af95f868f3 Mon Sep 17 00:00:00 2001 From: JM Date: Tue, 13 Oct 2015 12:55:59 +0200 Subject: [PATCH 018/197] LSR-645 Allow to refresh translations in a screenlet --- ios/Framework/Core/Base/BaseScreenlet.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ios/Framework/Core/Base/BaseScreenlet.swift b/ios/Framework/Core/Base/BaseScreenlet.swift index 6b6654215f..1614c92324 100644 --- a/ios/Framework/Core/Base/BaseScreenlet.swift +++ b/ios/Framework/Core/Base/BaseScreenlet.swift @@ -90,6 +90,11 @@ import QuartzCore } + public func refreshTranslations() { + screenletView?.onSetTranslations() + } + + //MARK: Interface Builder management methods override public func prepareForInterfaceBuilder() { From 00d2f02dc2f14982ebd93e41fad0b06737fa1ab9 Mon Sep 17 00:00:00 2001 From: JM Date: Tue, 13 Oct 2015 13:08:09 +0200 Subject: [PATCH 019/197] LSR-645 Add missing translation --- .../Themes/Default/Auth/LoginScreenlet/LoginView_default.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ios/Framework/Themes/Default/Auth/LoginScreenlet/LoginView_default.swift b/ios/Framework/Themes/Default/Auth/LoginScreenlet/LoginView_default.swift index b9ddffc1ad..1ada882f26 100644 --- a/ios/Framework/Themes/Default/Auth/LoginScreenlet/LoginView_default.swift +++ b/ios/Framework/Themes/Default/Auth/LoginScreenlet/LoginView_default.swift @@ -100,6 +100,9 @@ public class LoginView_default: BaseScreenletView, LoginViewModel { } override public func onSetTranslations() { + userNameField?.placeholder = LocalizedString("default", + BasicAuthMethod.create(basicAuthMethod).description, self) + passwordField?.placeholder = LocalizedString("default", "password-placeholder", self) loginButton?.replaceAttributedTitle(LocalizedString("default", "signin-button", self), From d9cf5126d298e3c4cc1bae732fe7987953bf7394 Mon Sep 17 00:00:00 2001 From: Javier Gamarra Date: Tue, 13 Oct 2015 13:18:20 +0200 Subject: [PATCH 020/197] auto formatting --- .../interactor/AssetListCallback.java | 6 +- .../mobile/screens/auth/BasicAuthMethod.java | 1 + .../interactor/ForgotPasswordCallback.java | 2 +- .../ForgotPasswordInteractorImpl.java | 8 +- .../interactor/LoginBasicInteractor.java | 2 +- .../interactor/LoginOAuthInteractor.java | 8 +- .../interactor/SignUpInteractorImpl.java | 14 +- .../mobile/screens/base/BaseScreenlet.java | 1 + .../mobile/screens/base/ModalProgressBar.java | 1 + .../BaseCachedRemoteInteractor.java | 1 + .../screens/base/list/BaseListAdapter.java | 1 + .../base/list/BaseListScreenletView.java | 1 + .../list/interactor/BaseListInteractor.java | 2 +- .../base/list/interactor/BaseListResult.java | 25 +- .../base/list/view/BaseListViewModel.java | 1 + .../mobile/screens/cache/CacheReceiver.java | 2 - .../DocumentUploadCacheStrategy.java | 1 - .../ddl/form/DDLRecordCacheStrategy.java | 1 - .../screens/cache/sql/BaseCacheStrategy.java | 4 +- .../screens/cache/tablecache/TableCache.java | 8 +- .../formload/DDLFormLoadInteractorImpl.java | 2 +- .../DDLFormLoadRecordInteractorImpl.java | 2 +- .../DDLFormDocumentUploadInteractorImpl.java | 1 - .../ddl/form/view/DDLFormViewModel.java | 2 + .../screens/ddl/list/DDLListScreenlet.java | 4 +- .../ddl/list/interactor/DDLListCallback.java | 6 +- .../mobile/screens/ddl/model/DateField.java | 1 + .../screens/ddl/model/DocumentField.java | 1 + .../mobile/screens/ddl/model/NumberField.java | 1 + .../mobile/screens/ddl/model/Record.java | 8 +- .../ddl/model/StringWithOptionsField.java | 2 + .../screens/push/AbstractPushService.java | 1 + .../screens/push/PushScreensActivity.java | 1 + .../v62/ScreensjournalarticleService.java | 2 - .../load/UserPortraitLoadInteractorImpl.java | 2 +- .../assetlist/AssetListAdapter.java | 14 +- .../defaultviews/assetlist/AssetListView.java | 8 +- .../forgotpassword/ForgotPasswordView.java | 16 +- .../defaultviews/auth/signup/SignUpView.java | 4 +- .../defaultviews/ddl/form/DDLFormView.java | 38 ++- .../ddl/form/fields/BaseDDLFieldTextView.java | 48 ++-- .../form/fields/CustomRatingNumberView.java | 2 +- .../ddl/form/fields/DDLFieldCheckboxView.java | 4 +- .../ddl/form/fields/DDLFieldDateView.java | 9 +- .../ddl/form/fields/DDLFieldNumberView.java | 14 +- .../ddl/form/fields/DDLFieldRadioView.java | 16 +- .../ddl/form/fields/DDLFieldSelectView.java | 15 +- .../ddl/form/fields/DDLFieldTextView.java | 8 +- .../ddl/form/fields/SelectFileDialog.java | 36 ++- .../ddl/list/DividerItemDecoration.java | 3 +- .../ddl/pager/DDLFormPagerView.java | 4 +- .../ddl/pager/DDLFormPagerViewAdapter.java | 2 +- .../userportrait/UserPortraitView.java | 2 +- .../WebContentDisplayView.java | 16 +- .../login/interactor/LoginInteractorTest.java | 20 +- ...CredentialsStoreSharedPreferencesTest.java | 30 +-- .../ddl/model/StringWithOptionsFieldTest.java | 1 + .../activities/TourActivity.java | 1 + .../gestures/FlingTouchListener.java | 1 + .../src/main/res/layout/issues.xml | 2 +- .../src/main/res/layout/main.xml | 13 +- .../mobile/screens/testapp/LoginActivity.java | 31 +-- .../src/main/res/layout/asset_list.xml | 4 +- .../test-app/src/main/res/layout/ddl_form.xml | 2 +- .../src/main/res/layout/user_portrait.xml | 4 +- .../main/res/layout/web_content_display.xml | 4 +- .../material/ddl/list/DDLListAdapter.java | 1 + .../westeros/auth/login/LoginView.java | 67 +++--- .../westeros/auth/signup/SignUpView.java | 18 +- .../westeros/ddl/list/DDLListAdapter.java | 226 +++++++++--------- .../westeros/ddl/list/DDLListView.java | 7 +- .../userportrait/UserPortraitView.java | 3 +- 72 files changed, 412 insertions(+), 408 deletions(-) diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/assetlist/interactor/AssetListCallback.java b/android/library/core/src/main/java/com/liferay/mobile/screens/assetlist/interactor/AssetListCallback.java index 2d24d27e9d..d5da71e8b7 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/assetlist/interactor/AssetListCallback.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/assetlist/interactor/AssetListCallback.java @@ -27,9 +27,9 @@ */ public class AssetListCallback extends BaseListCallback { - public AssetListCallback(int targetScreenletId, Pair rowsRange, Locale locale) { - super(targetScreenletId, rowsRange, locale); - } + public AssetListCallback(int targetScreenletId, Pair rowsRange, Locale locale) { + super(targetScreenletId, rowsRange, locale); + } @Override public AssetEntry createEntity(Map stringObjectMap) { diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/auth/BasicAuthMethod.java b/android/library/core/src/main/java/com/liferay/mobile/screens/auth/BasicAuthMethod.java index b5260575b1..1abe04259e 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/auth/BasicAuthMethod.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/auth/BasicAuthMethod.java @@ -48,6 +48,7 @@ public int getInputType() { return InputType.TYPE_NULL; } } + private int _value; } \ No newline at end of file diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/auth/forgotpassword/interactor/ForgotPasswordCallback.java b/android/library/core/src/main/java/com/liferay/mobile/screens/auth/forgotpassword/interactor/ForgotPasswordCallback.java index 6e34914c06..c7fba9e46a 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/auth/forgotpassword/interactor/ForgotPasswordCallback.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/auth/forgotpassword/interactor/ForgotPasswordCallback.java @@ -29,7 +29,7 @@ public ForgotPasswordCallback(int targetScreenletId) { @Override public Boolean transform(Object obj) throws Exception { - return (Boolean)obj; + return (Boolean) obj; } @Override diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/auth/forgotpassword/interactor/ForgotPasswordInteractorImpl.java b/android/library/core/src/main/java/com/liferay/mobile/screens/auth/forgotpassword/interactor/ForgotPasswordInteractorImpl.java index 783a993e03..b27e2027c3 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/auth/forgotpassword/interactor/ForgotPasswordInteractorImpl.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/auth/forgotpassword/interactor/ForgotPasswordInteractorImpl.java @@ -51,8 +51,8 @@ public void onEvent(ForgotPasswordEvent event) { @Override public void requestPassword( - long companyId, String login, BasicAuthMethod basicAuthMethod, - String anonymousApiUserName, String anonymousApiPassword) + long companyId, String login, BasicAuthMethod basicAuthMethod, + String anonymousApiUserName, String anonymousApiPassword) throws Exception { validate( @@ -60,7 +60,7 @@ public void requestPassword( anonymousApiPassword); ScreensuserService service = getScreensUserService( - anonymousApiUserName, anonymousApiPassword); + anonymousApiUserName, anonymousApiPassword); switch (basicAuthMethod) { case EMAIL: @@ -96,7 +96,7 @@ protected ScreensuserService getScreensUserService( protected void sendForgotPasswordByEmailRequest( ScreensuserService service, long companyId, - String emailAddress) + String emailAddress) throws Exception { service.sendPasswordByEmailAddress(companyId, emailAddress); diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/auth/login/interactor/LoginBasicInteractor.java b/android/library/core/src/main/java/com/liferay/mobile/screens/auth/login/interactor/LoginBasicInteractor.java index fcac91e570..c5c52c667d 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/auth/login/interactor/LoginBasicInteractor.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/auth/login/interactor/LoginBasicInteractor.java @@ -75,7 +75,7 @@ protected void sendGetUserByEmailRequest(UserService service, String email) thro } protected void sendGetUserByScreenNameRequest(UserService service, String screenName) - throws Exception { + throws Exception { service.getUserByScreenName(LiferayServerContext.getCompanyId(), screenName); } diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/auth/login/interactor/LoginOAuthInteractor.java b/android/library/core/src/main/java/com/liferay/mobile/screens/auth/login/interactor/LoginOAuthInteractor.java index d8ba7a810c..2a121d990e 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/auth/login/interactor/LoginOAuthInteractor.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/auth/login/interactor/LoginOAuthInteractor.java @@ -29,14 +29,14 @@ public LoginOAuthInteractor(int targetScreenletId) { super(targetScreenletId); } - public void setOAuthConfig(OAuthConfig value) { - _OAuthConfig = value; - } - public OAuthConfig getOAuthConfig() { return _OAuthConfig; } + public void setOAuthConfig(OAuthConfig value) { + _OAuthConfig = value; + } + public void login() throws Exception { if (_OAuthConfig == null) { throw new IllegalArgumentException("OAuth configuration cannot be empty"); diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/auth/signup/interactor/SignUpInteractorImpl.java b/android/library/core/src/main/java/com/liferay/mobile/screens/auth/signup/interactor/SignUpInteractorImpl.java index 3f20189789..256d8102e1 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/auth/signup/interactor/SignUpInteractorImpl.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/auth/signup/interactor/SignUpInteractorImpl.java @@ -54,10 +54,10 @@ public void onEvent(JSONObjectEvent event) { } public void signUp( - long companyId, String firstName, String middleName, - String lastName, String emailAddress, String screenName, - String password, String jobTitle, Locale locale, - String anonymousApiUserName, String anonymousApiPassword) + long companyId, String firstName, String middleName, + String lastName, String emailAddress, String screenName, + String password, String jobTitle, Locale locale, + String anonymousApiUserName, String anonymousApiPassword) throws Exception { validate( @@ -88,9 +88,9 @@ protected UserService getUserService( } protected void sendSignUpRequest( - UserService service, long companyId, String firstName, - String middleName, String lastName, String emailAddress, - String screenName, String password, String jobTitle, Locale locale) + UserService service, long companyId, String firstName, + String middleName, String lastName, String emailAddress, + String screenName, String password, String jobTitle, Locale locale) throws Exception { middleName = (middleName != null) ? middleName : ""; diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/base/BaseScreenlet.java b/android/library/core/src/main/java/com/liferay/mobile/screens/base/BaseScreenlet.java index eb1f84c01b..6bf6be3200 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/base/BaseScreenlet.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/base/BaseScreenlet.java @@ -250,6 +250,7 @@ private static int _generateScreenletId() { } } } + private static final String _STATE_SCREENLET_ID = "basescreenlet-screenletId"; private static final String _STATE_SUPER = "basescreenlet-super"; private static final String _STATE_INTERACTORS = "basescreenlet-interactors"; diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/base/ModalProgressBar.java b/android/library/core/src/main/java/com/liferay/mobile/screens/base/ModalProgressBar.java index 20cd74f317..b1fa055cd9 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/base/ModalProgressBar.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/base/ModalProgressBar.java @@ -99,6 +99,7 @@ private View findActionView(View parent, int actionViewId) { return findActionView((View) parent.getParent(), actionViewId); } + private int _actionViewId; } \ No newline at end of file diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/base/interactor/BaseCachedRemoteInteractor.java b/android/library/core/src/main/java/com/liferay/mobile/screens/base/interactor/BaseCachedRemoteInteractor.java index 9b8ba00859..1865b3ab6c 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/base/interactor/BaseCachedRemoteInteractor.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/base/interactor/BaseCachedRemoteInteractor.java @@ -121,6 +121,7 @@ protected OfflinePolicy getOfflinePolicy() { protected boolean hasToStoreToCache() { return !_retrievedFromCache; } + private boolean _retrievedFromCache; private final OfflinePolicy _offlinePolicy; diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/BaseListAdapter.java b/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/BaseListAdapter.java index 779e7c9dbb..a9c944f924 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/BaseListAdapter.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/BaseListAdapter.java @@ -106,6 +106,7 @@ public void setRowCount(int rowCount) { } protected abstract void fillHolder(E entry, H holder); + protected static final int LAYOUT_TYPE_DEFAULT = 0; protected static final int LAYOUT_TYPE_PROGRESS = 1; private List _entries; diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/BaseListScreenletView.java b/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/BaseListScreenletView.java index 3fab64da24..4cf3946bec 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/BaseListScreenletView.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/BaseListScreenletView.java @@ -235,6 +235,7 @@ private void addNewServerEntries(int page, List serverEntries, int rowCount, entries.set(i + firstRowForPage, serverEntries.get(i)); } } + private static final String _STATE_ENTRIES = "entries"; private static final String _STATE_ROW_COUNT = "rowCount"; private static final String _STATE_SUPER = "super"; diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/interactor/BaseListInteractor.java b/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/interactor/BaseListInteractor.java index 1065a9e7d6..aa614b0665 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/interactor/BaseListInteractor.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/interactor/BaseListInteractor.java @@ -8,8 +8,8 @@ import com.liferay.mobile.screens.base.context.RequestState; import com.liferay.mobile.screens.base.interactor.BaseCachedRemoteInteractor; import com.liferay.mobile.screens.cache.Cache; -import com.liferay.mobile.screens.cache.OfflinePolicy; import com.liferay.mobile.screens.cache.CachedType; +import com.liferay.mobile.screens.cache.OfflinePolicy; import com.liferay.mobile.screens.cache.sql.CacheSQL; import com.liferay.mobile.screens.cache.tablecache.TableCache; import com.liferay.mobile.screens.context.LiferayServerContext; diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/interactor/BaseListResult.java b/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/interactor/BaseListResult.java index 1da0540f76..6a82cdf71a 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/interactor/BaseListResult.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/interactor/BaseListResult.java @@ -4,22 +4,21 @@ public class BaseListResult { - public void setEntries(List values) { - _entries = values; - } + public List getEntries() { + return _entries; + } - public void setRowCount(int value) { - _rowCount = value; - } + public void setEntries(List values) { + _entries = values; + } - public List getEntries() { - return _entries; - } - - public int getRowCount() { - return _rowCount; - } + public int getRowCount() { + return _rowCount; + } + public void setRowCount(int value) { + _rowCount = value; + } private List _entries; private int _rowCount; diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/view/BaseListViewModel.java b/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/view/BaseListViewModel.java index 31bb571b90..e24e21ea07 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/view/BaseListViewModel.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/base/list/view/BaseListViewModel.java @@ -10,6 +10,7 @@ public interface BaseListViewModel extends BaseViewModel { void showFinishOperation(int page, List entries, int rowCount); + void showFinishOperation(int page, Exception e); } diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/cache/CacheReceiver.java b/android/library/core/src/main/java/com/liferay/mobile/screens/cache/CacheReceiver.java index 637c93f556..e721240327 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/cache/CacheReceiver.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/cache/CacheReceiver.java @@ -5,8 +5,6 @@ import android.content.Intent; import android.support.v4.content.WakefulBroadcastReceiver; -import com.liferay.mobile.screens.cache.CacheSyncService; - /** * @author Javier Gamarra */ diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/cache/ddl/documentupload/DocumentUploadCacheStrategy.java b/android/library/core/src/main/java/com/liferay/mobile/screens/cache/ddl/documentupload/DocumentUploadCacheStrategy.java index 4e35d7738b..1da3d95df3 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/cache/ddl/documentupload/DocumentUploadCacheStrategy.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/cache/ddl/documentupload/DocumentUploadCacheStrategy.java @@ -2,7 +2,6 @@ import com.liferay.mobile.screens.cache.sql.BaseCacheStrategy; import com.liferay.mobile.screens.cache.sql.CacheStrategy; -import com.liferay.mobile.screens.cache.userportrait.UserPortraitCache; import java.util.List; import java.util.Locale; diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/cache/ddl/form/DDLRecordCacheStrategy.java b/android/library/core/src/main/java/com/liferay/mobile/screens/cache/ddl/form/DDLRecordCacheStrategy.java index 453880d7ee..e1301ea3c0 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/cache/ddl/form/DDLRecordCacheStrategy.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/cache/ddl/form/DDLRecordCacheStrategy.java @@ -2,7 +2,6 @@ import com.liferay.mobile.screens.cache.sql.BaseCacheStrategy; import com.liferay.mobile.screens.cache.sql.CacheStrategy; -import com.liferay.mobile.screens.cache.userportrait.UserPortraitCache; import java.util.List; import java.util.Locale; diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/cache/sql/BaseCacheStrategy.java b/android/library/core/src/main/java/com/liferay/mobile/screens/cache/sql/BaseCacheStrategy.java index 1c9cf999b5..1b76b080a1 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/cache/sql/BaseCacheStrategy.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/cache/sql/BaseCacheStrategy.java @@ -1,6 +1,7 @@ package com.liferay.mobile.screens.cache.sql; import com.liferay.mobile.screens.cache.CachedContent; + import java.util.List; import static com.liferay.mobile.screens.cache.sql.CacheSQL.queryGet; @@ -28,7 +29,8 @@ public DatabaseResult set(E object) { if (result.hasError() || object == object.getTableCache()) { return result; - } else { + } + else { return CacheSQL.querySet(object); } } diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/cache/tablecache/TableCache.java b/android/library/core/src/main/java/com/liferay/mobile/screens/cache/tablecache/TableCache.java index 94492143c0..f1e476e730 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/cache/tablecache/TableCache.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/cache/tablecache/TableCache.java @@ -96,14 +96,14 @@ public int getDirty() { return _dirty; } - public void setDirty(int dirty) { - _dirty = dirty; - } - public void setDirty(boolean dirty) { _dirty = dirty ? 0 : 1; } + public void setDirty(int dirty) { + _dirty = dirty; + } + public Long getGroupId() { return _groupId; } diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/form/interactor/formload/DDLFormLoadInteractorImpl.java b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/form/interactor/formload/DDLFormLoadInteractorImpl.java index 24b6e87421..6bea4ef85d 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/form/interactor/formload/DDLFormLoadInteractorImpl.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/form/interactor/formload/DDLFormLoadInteractorImpl.java @@ -18,8 +18,8 @@ import com.liferay.mobile.android.v62.ddmstructure.DDMStructureService; import com.liferay.mobile.screens.base.interactor.BaseCachedRemoteInteractor; import com.liferay.mobile.screens.cache.Cache; -import com.liferay.mobile.screens.cache.OfflinePolicy; import com.liferay.mobile.screens.cache.DefaultCachedType; +import com.liferay.mobile.screens.cache.OfflinePolicy; import com.liferay.mobile.screens.cache.ddl.form.DDLFormCache; import com.liferay.mobile.screens.cache.ddl.form.RecordCache; import com.liferay.mobile.screens.cache.sql.CacheSQL; diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/form/interactor/recordload/DDLFormLoadRecordInteractorImpl.java b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/form/interactor/recordload/DDLFormLoadRecordInteractorImpl.java index c23c0db95a..eb87e56d13 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/form/interactor/recordload/DDLFormLoadRecordInteractorImpl.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/form/interactor/recordload/DDLFormLoadRecordInteractorImpl.java @@ -17,8 +17,8 @@ import com.liferay.mobile.android.service.Session; import com.liferay.mobile.screens.base.interactor.BaseCachedRemoteInteractor; import com.liferay.mobile.screens.cache.Cache; -import com.liferay.mobile.screens.cache.OfflinePolicy; import com.liferay.mobile.screens.cache.DefaultCachedType; +import com.liferay.mobile.screens.cache.OfflinePolicy; import com.liferay.mobile.screens.cache.ddl.form.DDLRecordCache; import com.liferay.mobile.screens.cache.sql.CacheSQL; import com.liferay.mobile.screens.context.SessionContext; diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/form/interactor/upload/DDLFormDocumentUploadInteractorImpl.java b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/form/interactor/upload/DDLFormDocumentUploadInteractorImpl.java index 9bab478ca9..f14ea8bd55 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/form/interactor/upload/DDLFormDocumentUploadInteractorImpl.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/form/interactor/upload/DDLFormDocumentUploadInteractorImpl.java @@ -2,7 +2,6 @@ import android.content.Intent; -import com.liferay.mobile.screens.base.interactor.BaseCachedRemoteInteractor; import com.liferay.mobile.screens.base.interactor.BaseCachedWriteRemoteInteractor; import com.liferay.mobile.screens.cache.OfflinePolicy; import com.liferay.mobile.screens.cache.ddl.documentupload.DocumentUploadCache; diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/form/view/DDLFormViewModel.java b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/form/view/DDLFormViewModel.java index ea61510e63..a80ece302f 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/form/view/DDLFormViewModel.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/form/view/DDLFormViewModel.java @@ -78,7 +78,9 @@ public interface DDLFormViewModel extends BaseViewModel { void showFormFields(Record record); void showStartOperation(String actionName, Object argument); + void showFinishOperation(String actionName, Object argument); + void showFailedOperation(String actionName, Exception e, Object argument); } \ No newline at end of file diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/list/DDLListScreenlet.java b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/list/DDLListScreenlet.java index efad24d5c2..5fdcca9352 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/list/DDLListScreenlet.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/list/DDLListScreenlet.java @@ -63,11 +63,11 @@ public long getUserId() { return _userId; } - public void setUserId(int userId) { + public void setUserId(long userId) { _userId = userId; } - public void setUserId(long userId) { + public void setUserId(int userId) { _userId = userId; } diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/list/interactor/DDLListCallback.java b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/list/interactor/DDLListCallback.java index d09a41b7a4..145bb79bbb 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/list/interactor/DDLListCallback.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/list/interactor/DDLListCallback.java @@ -29,9 +29,9 @@ public class DDLListCallback extends BaseListCallback { - public DDLListCallback(int targetScreenletId, Pair rowsRange, Locale locale) { - super(targetScreenletId, rowsRange, locale); - } + public DDLListCallback(int targetScreenletId, Pair rowsRange, Locale locale) { + super(targetScreenletId, rowsRange, locale); + } @Override public Record createEntity(Map stringObjectMap) { diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/DateField.java b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/DateField.java index 5b40e4afc9..c14c69fa65 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/DateField.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/DateField.java @@ -101,6 +101,7 @@ private void init(Locale locale) { _clientFormat = DateFormat.getDateInstance(DateFormat.LONG, locale); _clientFormat.setTimeZone(_GMT_TIMEZONE); } + private static final DateFormat _SERVER_YYYY_FORMAT = new SimpleDateFormat("MM/dd/yyyy"); private static final DateFormat _SERVER_YY_FORMAT = new SimpleDateFormat("MM/dd/yy"); diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/DocumentField.java b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/DocumentField.java index ddcd7ac95b..20a46034f4 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/DocumentField.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/DocumentField.java @@ -143,6 +143,7 @@ else if (isUploadFailed()) { return valid; } + private State _state = State.IDLE; } diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/NumberField.java b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/NumberField.java index 80aef3f85d..2e20587548 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/NumberField.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/NumberField.java @@ -87,6 +87,7 @@ protected String convertToFormattedString(Number value) { private void init(Locale locale) { _labelFormatter = NumberFormat.getNumberInstance(locale); } + private NumberFormat _labelFormatter; } \ No newline at end of file diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/Record.java b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/Record.java index b746e00325..4f2d81c0a5 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/Record.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/Record.java @@ -206,15 +206,15 @@ public Object getServerAttribute(String field) { return getModelAttributes() == null ? null : getModelAttributes().get(field); } + public Map getValuesAndAttributes() { + return _valuesAndAttributes; + } + public void setValuesAndAttributes(Map valuesAndAttributes) { _valuesAndAttributes = valuesAndAttributes; parseServerValues(); } - public Map getValuesAndAttributes() { - return _valuesAndAttributes; - } - public HashMap getModelValues() { return (HashMap) _valuesAndAttributes.get("modelValues"); } diff --git a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/StringWithOptionsField.java b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/StringWithOptionsField.java index 0ca25ac62c..7bff30e419 100644 --- a/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/StringWithOptionsField.java +++ b/android/library/core/src/main/java/com/liferay/mobile/screens/ddl/model/StringWithOptionsField.java @@ -242,6 +242,7 @@ protected Option findOptionByLabel(String label) { return null; } + private ArrayList