From 9cbf29b1bad180ec0bd118e8a9ed035b1b06ce28 Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Wed, 25 Nov 2015 17:28:50 +0100
Subject: [PATCH 01/35] Update Version Number + Gradle + Support
---
alfresco-mobile-android/build.gradle | 8 ++++----
build.gradle | 5 ++++-
extensions/hockeyapp/build.gradle | 6 +++---
extensions/samsung/build.gradle | 6 +++---
extensions/scansnap/build.gradle | 6 +++---
extensions/tools/build.gradle | 6 +++---
mdm/mobileiron/build.gradle | 6 +++---
platform/foundation/build.gradle | 6 +++---
.../exception/CloudExceptionUtils.java | 3 +--
platform/thirdparty/build.gradle | 20 ++++++++++---------
10 files changed, 38 insertions(+), 34 deletions(-)
diff --git a/alfresco-mobile-android/build.gradle b/alfresco-mobile-android/build.gradle
index 1f13ebff..1da48d41 100644
--- a/alfresco-mobile-android/build.gradle
+++ b/alfresco-mobile-android/build.gradle
@@ -1,15 +1,15 @@
apply plugin: 'com.android.application'
android {
- compileSdkVersion 22
- buildToolsVersion "22.0.1"
+ compileSdkVersion 23
+ buildToolsVersion "23.0.1"
defaultConfig {
applicationId APPLICATION_ID
minSdkVersion 15
- targetSdkVersion 22
- versionCode 50
+ targetSdkVersion 23
+ versionCode 60
versionName VERSION_NAME
manifestPlaceholders = [PROVIDER_AUTHORITY: PROVIDER_AUTHORITY]
diff --git a/build.gradle b/build.gradle
index 413a669a..683d0652 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,7 +4,7 @@ buildscript {
mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:1.2.3'
+ classpath 'com.android.tools.build:gradle:1.5.0'
}
}
@@ -17,6 +17,9 @@ allprojects {
maven {
url "https://artifacts.alfresco.com/nexus/content/groups/public-snapshots"
}
+ maven {
+ url "https://jitpack.io"
+ }
jcenter()
mavenCentral()
}
diff --git a/extensions/hockeyapp/build.gradle b/extensions/hockeyapp/build.gradle
index 234bb64d..92c0f5e7 100644
--- a/extensions/hockeyapp/build.gradle
+++ b/extensions/hockeyapp/build.gradle
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'
android {
- compileSdkVersion 22
- buildToolsVersion "22.0.1"
+ compileSdkVersion 23
+ buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 15
- targetSdkVersion 22
+ targetSdkVersion 23
versionCode 1
versionName "1.0"
}
diff --git a/extensions/samsung/build.gradle b/extensions/samsung/build.gradle
index edd28799..3cc75712 100644
--- a/extensions/samsung/build.gradle
+++ b/extensions/samsung/build.gradle
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'
android {
- compileSdkVersion 22
- buildToolsVersion "22.0.1"
+ compileSdkVersion 23
+ buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 15
- targetSdkVersion 22
+ targetSdkVersion 23
versionCode 1
versionName "1.0"
}
diff --git a/extensions/scansnap/build.gradle b/extensions/scansnap/build.gradle
index a5a44abe..0dca89f8 100644
--- a/extensions/scansnap/build.gradle
+++ b/extensions/scansnap/build.gradle
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'
android {
- compileSdkVersion 22
- buildToolsVersion "22.0.1"
+ compileSdkVersion 23
+ buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 15
- targetSdkVersion 22
+ targetSdkVersion 23
versionCode 1
versionName "1.0"
}
diff --git a/extensions/tools/build.gradle b/extensions/tools/build.gradle
index a5a44abe..0dca89f8 100644
--- a/extensions/tools/build.gradle
+++ b/extensions/tools/build.gradle
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'
android {
- compileSdkVersion 22
- buildToolsVersion "22.0.1"
+ compileSdkVersion 23
+ buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 15
- targetSdkVersion 22
+ targetSdkVersion 23
versionCode 1
versionName "1.0"
}
diff --git a/mdm/mobileiron/build.gradle b/mdm/mobileiron/build.gradle
index 36188128..afef3292 100644
--- a/mdm/mobileiron/build.gradle
+++ b/mdm/mobileiron/build.gradle
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'
android {
- compileSdkVersion 22
- buildToolsVersion "22.0.1"
+ compileSdkVersion 23
+ buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 15
- targetSdkVersion 22
+ targetSdkVersion 23
versionCode 1
versionName "1.0"
}
diff --git a/platform/foundation/build.gradle b/platform/foundation/build.gradle
index ffdd8b18..b2be52fd 100644
--- a/platform/foundation/build.gradle
+++ b/platform/foundation/build.gradle
@@ -19,12 +19,12 @@
apply plugin: 'com.android.library'
android {
- compileSdkVersion 22
- buildToolsVersion "22.0.1"
+ compileSdkVersion 23
+ buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 15
- targetSdkVersion 22
+ targetSdkVersion 23
versionCode 1
versionName "1.0"
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/exception/CloudExceptionUtils.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/exception/CloudExceptionUtils.java
index 852e8ded..adc8fcd4 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/exception/CloudExceptionUtils.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/exception/CloudExceptionUtils.java
@@ -30,7 +30,6 @@
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccountManager;
import org.alfresco.mobile.android.platform.utils.SessionUtils;
import org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException;
-import org.apache.http.HttpStatus;
import android.content.Context;
import android.text.Html;
@@ -105,7 +104,7 @@ public static void handleCloudException(Context context, Long accountId, Excepti
int messageId = R.string.error_session_notfound;
AlfrescoSessionException se = ((AlfrescoSessionException) exception);
if (se.getErrorCode() == ErrorCodeRegistry.GENERAL_HTTP_RESP && se.getMessage() != null
- && se.getMessage().contains(HttpStatus.SC_SERVICE_UNAVAILABLE + ""))
+ && se.getMessage().contains("503"))
{
messageId = R.string.error_session_cloud_unavailable;
}
diff --git a/platform/thirdparty/build.gradle b/platform/thirdparty/build.gradle
index f65b07e4..7bfbc68a 100644
--- a/platform/thirdparty/build.gradle
+++ b/platform/thirdparty/build.gradle
@@ -19,12 +19,12 @@
apply plugin: 'com.android.library'
android {
- compileSdkVersion 22
- buildToolsVersion "22.0.1"
+ compileSdkVersion 23
+ buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 15
- targetSdkVersion 22
+ targetSdkVersion 23
versionCode 1
versionName "1.0"
}
@@ -44,11 +44,11 @@ dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//Support
- compile 'com.android.support:design:22.2.1'
- compile 'com.android.support:support-v4:22.2.1'
- compile 'com.android.support:appcompat-v7:22.2.1'
- compile 'com.android.support:cardview-v7:22.2.1'
- compile 'com.android.support:recyclerview-v7:22.2.1'
+ compile 'com.android.support:design:23.1.1'
+ compile 'com.android.support:support-v4:23.1.1'
+ compile 'com.android.support:appcompat-v7:23.1.1'
+ compile 'com.android.support:cardview-v7:23.1.1'
+ compile 'com.android.support:recyclerview-v7:23.1.1'
//Square
compile 'com.squareup.picasso:picasso:2.5.2'
@@ -58,7 +58,9 @@ dependencies {
//3rd Party Lib
compile 'com.cocosw:bottomsheet:1.1.1@aar'
- compile 'com.afollestad:material-dialogs:0.7.6.0'
+ compile('com.github.afollestad.material-dialogs:core:0.8.5.1@aar') {
+ transitive = true
+ }
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.mattprecious.telescope:telescope:1.4.0@aar'
compile 'com.jmpergar:AwesomeText:1.0.0'
From baf8712b5bb282b9fac7b9651391b0aec7ae2022 Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Wed, 10 Feb 2016 16:25:29 +0100
Subject: [PATCH 02/35] ANDROID-241 ANDROID-233 ANDROID-245 ANDROID-238 Revert
to 1.6.1 Update Dependencies
---
alfresco-mobile-android/build.gradle | 26 +-
alfresco-mobile-android/google-services.json | 45 ++
.../assets/Configuration/embedded_config.json | 7 +
.../application/AlfrescoApplication.java | 34 +-
.../application/activity/MainActivity.java | 17 +-
.../capture/DeviceCaptureHelper.java | 36 +-
.../configuration/ConfigurationConstant.java | 27 +-
.../configuration/model/ViewConfigModel.java | 24 +
.../fragments/about/AboutFragment.java | 2 +
.../account/AccountEditFragment.java | 6 +
.../fragments/account/NetworksFragment.java | 6 +
.../fragments/actions/NodeActions.java | 18 +
.../activitystream/ActivityFeedFragment.java | 3 +-
.../builder/AlfrescoFragmentBuilder.java | 32 ++
.../fragments/config/MenuConfigFragment.java | 10 +
.../create/DocumentTypesDialogFragment.java | 5 +
.../fileexplorer/FileExplorerFragment.java | 2 +
.../fileexplorer/FileExplorerHelper.java | 2 +-
.../FileExplorerMenuFragment.java | 2 +
.../fragments/help/HelpDialogFragment.java | 3 +
.../fragments/menu/MainMenuFragment.java | 1 +
.../DocumentFolderBrowserFragment.java | 35 ++
.../node/comment/CommentsFragment.java | 1 +
.../create/CreateDocumentDialogFragment.java | 2 +
.../create/CreateFolderDialogFragment.java | 2 +
.../node/details/NodeDetailsFragment.java | 48 ++
.../node/details/NodePropertiesFragment.java | 1 +
.../node/details/NodeSummaryFragment.java | 1 +
.../details/PagerNodeDetailsFragment.java | 79 ++-
.../node/favorite/FavoritesFragment.java | 2 +
.../rendition/CarouselPreviewFragment.java | 2 +
.../node/rendition/PreviewFragment.java | 1 +
.../search/DocumentFolderSearchFragment.java | 2 +
.../node/update/EditPropertiesFragment.java | 2 +
.../node/versions/VersionFragment.java | 1 +
.../preferences/AccountSettingsFragment.java | 31 +-
.../preferences/GeneralPreferences.java | 68 ++-
.../preferences/PasscodePreferences.java | 14 +-
.../profile/ProfilesConfigFragment.java | 6 +
.../search/AdvancedSearchFragment.java | 52 +-
.../fragments/search/SearchFragment.java | 34 +-
.../signin/AccountCredentialsFragment.java | 4 +-
.../fragments/signin/AccountNameFragment.java | 2 +
.../signin/AccountOAuthFragment.java | 30 +-
.../signin/AccountOptionalFragment.java | 2 +-
.../signin/AccountServerFragment.java | 2 +
.../signin/AccountSignInFragment.java | 2 +
.../fragments/signin/WelcomeFragment.java | 2 +
.../browser/BrowserSitesPagerFragment.java | 52 +-
.../fragments/site/browser/SitesFragment.java | 1 +
.../request/JoinSiteRequestsFragment.java | 2 +
.../site/search/SearchSitesFragment.java | 2 +
.../fragments/sync/SyncFragment.java | 2 +
.../fragments/user/UserProfileFragment.java | 60 +-
.../fragments/user/UsersFragment.java | 21 +-
.../workflow/CreateTaskFragment.java | 2 +
.../CreateTaskTypePickerFragment.java | 28 +-
.../process/ProcessTasksFragment.java | 2 +
.../workflow/task/TaskDetailsFragment.java | 2 +
.../workflow/task/TaskFilterFragment.java | 9 +-
.../workflow/task/TasksFragment.java | 2 +
.../fragments/workflow/task/TasksHelper.java | 4 +-
.../application/managers/ConfigManager.java | 29 +-
.../managers/extensions/AnalyticHelper.java | 224 ++++++++
.../managers/upgrade/UpgradeManager.java | 34 +-
.../StorageAccessDocumentsProvider.java | 44 ++
.../application/security/DataCleaner.java | 6 +-
.../DataProtectionUserDialogFragment.java | 4 +-
.../security/PassCodeDialogFragment.java | 8 +-
.../widgets/ActionShortcutActivity.java | 45 +-
.../widgets/FolderShortcutActivity.java | 41 +-
.../widgets/ToolbarWidgetProvider.java | 40 +-
.../src/main/res/layout/fr_settings.xml | 48 +-
.../src/main/res/values/strings.xml | 3 +
build.gradle | 19 +
extensions/analytics/.gitignore | 1 +
extensions/analytics/build.gradle | 43 ++
extensions/analytics/google-services.json | 45 ++
extensions/analytics/proguard-rules.pro | 17 +
.../analytics/src/main/AndroidManifest.xml | 50 ++
.../analytics/GAnalyticsManagerImpl.java | 265 +++++++++
.../src/main/res/values/config_extension.xml | 26 +
.../analytics/src/main/res/values/keys.xml | 25 +
.../src/main/res/xml/global_tracker.xml | 42 ++
extensions/hockeyapp/build.gradle | 20 +-
extensions/samsung/build.gradle | 20 +-
.../samsung/pen/SNoteEditorActivity.java | 4 +
extensions/scansnap/build.gradle | 20 +-
gradle.properties | 31 +-
mdm/mobileiron/build.gradle | 20 +-
platform/foundation/build.gradle | 2 +-
.../foundation/src/main/AndroidManifest.xml | 23 +
.../android/accounts/AccountSchema.java | 28 +-
.../api/model/config/ConfigConstants.java | 21 +
.../api/model/config/ConfigTypeIds.java | 26 +-
.../api/model/config/FeatureConfig.java | 35 ++
.../model/config/impl/ConfigurationImpl.java | 76 ++-
.../model/config/impl/FeatureConfigImpl.java | 68 +++
.../api/model/config/impl/FeatureHelper.java | 62 ++
.../android/api/services/ConfigService.java | 32 +-
.../impl/AbstractConfigServiceImpl.java | 17 +
.../services/impl/LocalConfigServiceImpl.java | 25 +-
.../async/account/CreateAccountOperation.java | 20 +-
.../node/comment/CreateCommentOperation.java | 36 +-
.../node/create/CreateDocumentOperation.java | 34 +-
.../node/create/CreateFolderOperation.java | 37 +-
.../node/delete/DeleteNodeOperation.java | 36 +-
.../node/favorite/FavoriteNodeOperation.java | 53 +-
.../async/node/like/LikeNodeOperation.java | 36 +-
.../async/node/search/SearchOperation.java | 27 +-
.../async/node/sync/SyncNodeOperation.java | 36 +-
.../node/update/UpdateContentOperation.java | 34 +-
.../node/update/UpdateNodeOperation.java | 39 +-
.../async/session/LoadSessionCallBack.java | 53 +-
.../session/oauth/AccountOAuthHelper.java | 4 +-
.../async/site/SiteFavoriteOperation.java | 35 +-
.../CancelPendingMembershipOperation.java | 33 +-
.../site/member/SiteMembershipOperation.java | 34 +-
.../process/start/StartProcessOperation.java | 33 +-
.../task/complete/CompleteTaskOperation.java | 34 +-
.../task/delegate/ReassignTaskOperation.java | 32 +-
.../accounts/AccountsPreferences.java | 28 +-
.../accounts/AlfrescoAccountManager.java | 2 +-
.../platform/extensions/AnalyticsHelper.java | 282 ++++++++++
.../platform/extensions/AnalyticsManager.java | 531 ++++++++++++++++++
.../platform/favorite/FavoritesManager.java | 42 +-
.../security/DataProtectionManager.java | 32 +-
.../android/sync/SyncContentManager.java | 16 +-
.../android/sync/SyncContentSchema.java | 2 +
.../android/sync/SyncContentSyncAdapter.java | 48 +-
.../mobile/android/sync/SyncScanInfo.java | 32 +-
.../sync/prepare/PrepareBaseHelper.java | 26 +-
.../android/ui/activity/AlfrescoActivity.java | 13 +-
.../ui/fragments/AlfrescoFragment.java | 22 +-
.../ui/network/CloudNetworksFragment.java | 28 +-
.../ui/node/browse/NodeBrowserTemplate.java | 28 +-
.../res/values/config_default_managers.xml | 22 +
platform/thirdparty/build.gradle | 2 +-
settings.gradle | 27 +-
139 files changed, 3604 insertions(+), 739 deletions(-)
create mode 100644 alfresco-mobile-android/google-services.json
create mode 100644 alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/extensions/AnalyticHelper.java
create mode 100644 extensions/analytics/.gitignore
create mode 100644 extensions/analytics/build.gradle
create mode 100644 extensions/analytics/google-services.json
create mode 100644 extensions/analytics/proguard-rules.pro
create mode 100644 extensions/analytics/src/main/AndroidManifest.xml
create mode 100644 extensions/analytics/src/main/java/org/alfresco/mobile/android/application/extension/analytics/GAnalyticsManagerImpl.java
create mode 100644 extensions/analytics/src/main/res/values/config_extension.xml
create mode 100644 extensions/analytics/src/main/res/values/keys.xml
create mode 100644 extensions/analytics/src/main/res/xml/global_tracker.xml
create mode 100644 platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/FeatureConfig.java
create mode 100644 platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/impl/FeatureConfigImpl.java
create mode 100644 platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/impl/FeatureHelper.java
create mode 100644 platform/foundation/src/main/java/org/alfresco/mobile/android/platform/extensions/AnalyticsHelper.java
create mode 100644 platform/foundation/src/main/java/org/alfresco/mobile/android/platform/extensions/AnalyticsManager.java
diff --git a/alfresco-mobile-android/build.gradle b/alfresco-mobile-android/build.gradle
index 1da48d41..7ce674b3 100644
--- a/alfresco-mobile-android/build.gradle
+++ b/alfresco-mobile-android/build.gradle
@@ -1,8 +1,26 @@
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
- buildToolsVersion "23.0.1"
+ buildToolsVersion "23.0.2"
defaultConfig {
applicationId APPLICATION_ID
@@ -23,6 +41,8 @@ android {
resValue "string", "oauth_callback", OAUTH_CALLBACK
resValue "string", "oauth_scope", OAUTH_SCOPE
resValue "string", "bamboo_buildnumber", BUILDNUMBER
+
+ resValue "string", "ga_trackId", TRACKER_ID
}
lintOptions {
@@ -57,7 +77,7 @@ android {
resValue "string", "favorites_adapter", FAVORITES_ADAPTER_DEBUG
resValue "string", "hockeyapp_key", HOCKEYAPP_KEY
-
+ resValue "string", "ga_trackId", TRACKER_ID_DEBUG
}
release {
@@ -89,9 +109,11 @@ android {
dependencies {
//DEBUG BUILD TYPE
debugCompile project(':extensions:hockeyapp')
+ debugCompile project(':extensions:analytics')
storeCompile project(':extensions:samsung')
storeCompile project(':extensions:scansnap')
+ storeCompile project(':extensions:analytics')
}
}
diff --git a/alfresco-mobile-android/google-services.json b/alfresco-mobile-android/google-services.json
new file mode 100644
index 00000000..2a78c3c1
--- /dev/null
+++ b/alfresco-mobile-android/google-services.json
@@ -0,0 +1,45 @@
+{
+ "project_info": {
+ "project_id": "alfresco-mobile",
+ "project_number": "1053450300169",
+ "name": "Alfresco Mobile"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:1053450300169:android:4c82694870595779",
+ "client_id": "android:org.alfresco.mobile.android.application",
+ "client_type": 1,
+ "android_client_info": {
+ "package_name": "org.alfresco.mobile.android.application"
+ }
+ },
+ "oauth_client": [],
+ "api_key": [],
+ "services": {
+ "analytics_service": {
+ "status": 2,
+ "analytics_property": {
+ "tracking_id": "UA-70658012-1"
+ }
+ },
+ "cloud_messaging_service": {
+ "status": 1,
+ "apns_config": []
+ },
+ "appinvite_service": {
+ "status": 1,
+ "other_platform_oauth_client": []
+ },
+ "google_signin_service": {
+ "status": 1
+ },
+ "ads_service": {
+ "status": 1
+ }
+ }
+ }
+ ],
+ "client_info": [],
+ "ARTIFACT_VERSION": "1"
+}
\ No newline at end of file
diff --git a/alfresco-mobile-android/src/main/assets/Configuration/embedded_config.json b/alfresco-mobile-android/src/main/assets/Configuration/embedded_config.json
index b83855d2..634422e9 100644
--- a/alfresco-mobile-android/src/main/assets/Configuration/embedded_config.json
+++ b/alfresco-mobile-android/src/main/assets/Configuration/embedded_config.json
@@ -10,6 +10,13 @@
"root-view-id": "views-menu-default"
}
},
+ "features": [
+ {
+ "id": "feature-analytics-default",
+ "type": "org.alfresco.client.feature.analytics",
+ "enable": false
+ }
+ ],
"view-groups": [
{
"id": "views-menu-default",
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/AlfrescoApplication.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/AlfrescoApplication.java
index ff5eb248..471089b8 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/AlfrescoApplication.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/AlfrescoApplication.java
@@ -1,25 +1,26 @@
-/*******************************************************************************
- * Copyright (C) 2005-2014 Alfresco Software Limited.
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
*
- * This file is part of Alfresco Mobile for Android.
+ * This file is part of Alfresco Mobile for Android.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *******************************************************************************/
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.alfresco.mobile.android.application;
import org.alfresco.mobile.android.application.managers.upgrade.UpgradeManager;
import org.alfresco.mobile.android.async.OperationsUtils;
import org.alfresco.mobile.android.platform.SessionManager;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import android.app.Application;
@@ -27,6 +28,8 @@ public class AlfrescoApplication extends Application
{
protected SessionManager sessionManager;
+ private AnalyticsManager analyticsManager;
+
@Override
public void onCreate()
{
@@ -39,4 +42,9 @@ public void onCreate()
// Remove operations if necessary
OperationsUtils.clean(this);
}
+
+ synchronized public AnalyticsManager getAnalyticsTracker()
+ {
+ return AnalyticsManager.getInstance(this);
+ }
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/activity/MainActivity.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/activity/MainActivity.java
index 6f7ad0d9..fcd6e894 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/activity/MainActivity.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/activity/MainActivity.java
@@ -47,6 +47,7 @@
import org.alfresco.mobile.android.application.intent.RequestCode;
import org.alfresco.mobile.android.application.managers.ConfigManager;
import org.alfresco.mobile.android.application.managers.RenditionManagerImpl;
+import org.alfresco.mobile.android.application.managers.extensions.AnalyticHelper;
import org.alfresco.mobile.android.application.security.DataProtectionUserDialogFragment;
import org.alfresco.mobile.android.async.Operator;
import org.alfresco.mobile.android.async.account.CreateAccountEvent;
@@ -67,6 +68,7 @@
import org.alfresco.mobile.android.platform.accounts.AccountsPreferences;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccountManager;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.favorite.FavoritesManager;
import org.alfresco.mobile.android.platform.intent.AlfrescoIntentAPI;
import org.alfresco.mobile.android.platform.intent.PrivateIntent;
@@ -212,7 +214,7 @@ public void onCreate(Bundle savedInstanceState)
// re-created after the AlfrescoAccount is created.
DataProtectionUserDialogFragment.newInstance(true).show(getSupportFragmentManager(),
DataProtectionUserDialogFragment.TAG);
- prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).commit();
+ prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).apply();
}
}
}
@@ -276,6 +278,11 @@ public void onDrawerOpened(View drawerView)
@Override
protected void onStart()
{
+ if (AnalyticsManager.getInstance(this) != null && AnalyticsManager.getInstance(this).isEnable())
+ {
+ AnalyticsManager.getInstance(this).startReport(this);
+ }
+
registerPublicReceiver(new NetworkReceiver(), new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
super.onStart();
@@ -778,7 +785,7 @@ public void onAccountCreated(CreateAccountEvent event)
{
DataProtectionUserDialogFragment.newInstance(true).show(getSupportFragmentManager(),
DataProtectionUserDialogFragment.TAG);
- prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).commit();
+ prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).apply();
}
}
}
@@ -939,7 +946,7 @@ public void onAccountLoaded(LoadAccountCompletedEvent event)
if (paidNetwork)
{
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
- prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).commit();
+ prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).apply();
if (mdmManager.hasConfig())
{
@@ -968,11 +975,15 @@ public void onAccountLoaded(LoadAccountCompletedEvent event)
startActivityForResult(new Intent(this, InfoActivity.class), SyncMigrationFragment.REQUEST_CODE);
}
+ // Analytics
+ AnalyticHelper.analyzeSession(this, event.account, getCurrentSession());
+
// Activate Automatic Sync for Sync Content & Favorite
SyncContentManager.getInstance(this).setActivateSync(getCurrentAccount(), true);
FavoritesManager.getInstance(this).setActivateSync(getCurrentAccount(), true);
invalidateOptionsMenu();
+
}
@Subscribe
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/capture/DeviceCaptureHelper.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/capture/DeviceCaptureHelper.java
index cc88ca74..1d48709f 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/capture/DeviceCaptureHelper.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/capture/DeviceCaptureHelper.java
@@ -1,20 +1,20 @@
-/*******************************************************************************
- * Copyright (C) 2005-2014 Alfresco Software Limited.
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
*
- * This file is part of Alfresco Mobile for Android.
+ * This file is part of Alfresco Mobile for Android.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *******************************************************************************/
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.alfresco.mobile.android.application.capture;
import java.io.File;
@@ -24,6 +24,8 @@
import org.alfresco.mobile.android.application.activity.BaseActivity;
import org.alfresco.mobile.android.application.fragments.fileexplorer.FileExplorerFragment;
import org.alfresco.mobile.android.application.fragments.node.browser.DocumentFolderBrowserFragment;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
public final class DeviceCaptureHelper
{
@@ -50,23 +52,31 @@ public static DeviceCapture createDeviceCapture(BaseActivity c, int id)
parentFolder = ((FileExplorerFragment) c.getFragment(FileExplorerFragment.TAG)).getParent();
}
+ String analyzeId = null;
+
switch (id)
{
case R.id.menu_device_capture_camera_photo:
capture = new PhotoCapture(c, parentRepositoryFolder, parentFolder);
+ analyzeId = AnalyticsManager.ACTION_TAKE_PHOTO;
break;
case R.id.menu_device_capture_camera_video:
capture = new VideoCapture(c, parentRepositoryFolder, parentFolder);
+ analyzeId = AnalyticsManager.ACTION_RECORD_VIDEO;
break;
case R.id.menu_device_capture_mic_audio:
capture = new AudioCapture(c, parentRepositoryFolder, parentFolder);
+ analyzeId = AnalyticsManager.ACTION_RECORD_AUDIO;
break;
default:
break;
}
if (capture != null)
{
+ AnalyticsHelper.reportOperationEvent(c, AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
+ AnalyticsManager.ACTION_QUICK_ACTIONS, analyzeId, 1, false);
+
capture.captureData();
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/configuration/ConfigurationConstant.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/configuration/ConfigurationConstant.java
index b5d4d51e..cbdef0b1 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/configuration/ConfigurationConstant.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/configuration/ConfigurationConstant.java
@@ -1,20 +1,20 @@
-/*******************************************************************************
- * Copyright (C) 2005-2014 Alfresco Software Limited.
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
*
- * This file is part of Alfresco Mobile for Android.
+ * This file is part of Alfresco Mobile for Android.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *******************************************************************************/
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.alfresco.mobile.android.application.configuration;
import java.util.ArrayList;
@@ -89,5 +89,4 @@ public interface ConfigurationConstant
add(KEY_LOCAL_FILES);
}
};
-
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/configuration/model/ViewConfigModel.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/configuration/model/ViewConfigModel.java
index 0d0c74c2..f1c38989 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/configuration/model/ViewConfigModel.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/configuration/model/ViewConfigModel.java
@@ -1,3 +1,21 @@
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.alfresco.mobile.android.application.configuration.model;
import java.util.ArrayList;
@@ -6,6 +24,7 @@
import org.alfresco.mobile.android.api.model.config.ViewConfig;
import org.alfresco.mobile.android.api.model.config.impl.ViewConfigImpl;
+import org.alfresco.mobile.android.application.configuration.ConfigurationConstant;
import android.content.Context;
@@ -45,6 +64,11 @@ public String getType()
return type;
}
+ public String getSimpleType()
+ {
+ return type.substring(ConfigurationConstant.PREFIX.length() + 1, type.length());
+ }
+
public int getIconResId()
{
return iconResId;
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/about/AboutFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/about/AboutFragment.java
index cb4d0279..63aa38fb 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/about/AboutFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/about/AboutFragment.java
@@ -22,6 +22,7 @@
import org.alfresco.mobile.android.api.Version;
import org.alfresco.mobile.android.application.R;
import org.alfresco.mobile.android.application.fragments.builder.LeafFragmentBuilder;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
import android.app.Dialog;
@@ -50,6 +51,7 @@ public AboutFragment()
{
requiredSession = false;
checkSession = false;
+ screenName = AnalyticsManager.SCREEN_SETTINGS_ABOUT;
}
protected static AboutFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/account/AccountEditFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/account/AccountEditFragment.java
index bae42b75..2c3348e2 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/account/AccountEditFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/account/AccountEditFragment.java
@@ -35,6 +35,8 @@
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccountManager;
import org.alfresco.mobile.android.platform.exception.AlfrescoExceptionHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.utils.AccessibilityUtils;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
import org.alfresco.mobile.android.ui.utils.UIUtils;
@@ -89,6 +91,7 @@ public AccountEditFragment()
super();
eventBusRequired = true;
requiredSession = false;
+ screenName = AnalyticsManager.SCREEN_ACCOUNT_EDIT;
}
public static AccountEditFragment newInstanceByTemplate(Bundle b)
@@ -322,6 +325,9 @@ public void onCheckSessionEvent(CheckSessionEvent event)
SessionManager.getInstance(getActivity()).saveAccount(acc);
SessionManager.getInstance(getActivity()).saveSession(acc, event.data);
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_ACCOUNT,
+ AnalyticsManager.ACTION_EDIT, AnalyticsManager.LABEL_CREDENTIALS, 1, false);
+
EventBusManager.getInstance().post(
new LoadSessionCallBack.LoadAccountCompletedEvent(updatedAccount.getTitle(), updatedAccount));
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/account/NetworksFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/account/NetworksFragment.java
index 1ec15a02..3253d7a4 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/account/NetworksFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/account/NetworksFragment.java
@@ -27,6 +27,8 @@
import org.alfresco.mobile.android.async.session.network.NetworksEvent;
import org.alfresco.mobile.android.platform.EventBusManager;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.utils.SessionUtils;
import org.alfresco.mobile.android.ui.network.CloudNetworkAdapter;
import org.alfresco.mobile.android.ui.network.CloudNetworksFragment;
@@ -87,6 +89,10 @@ public void onListItemClick(GridView l, View v, int position, long id)
{
EventBusManager.getInstance().post(new RequestSessionEvent(currentAccount, network.getIdentifier(), true));
getActivity().getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
+
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_SESSION,
+ AnalyticsManager.ACTION_SWITCH, AnalyticsManager.LABEL_NETWORK, 1, false);
}
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/actions/NodeActions.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/actions/NodeActions.java
index a41baab6..c90d0d3f 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/actions/NodeActions.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/actions/NodeActions.java
@@ -51,6 +51,8 @@
import org.alfresco.mobile.android.async.node.sync.SyncNodeRequest;
import org.alfresco.mobile.android.async.utils.NodePlaceHolder;
import org.alfresco.mobile.android.platform.AlfrescoNotificationManager;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.intent.PrivateIntent;
import org.alfresco.mobile.android.platform.io.AlfrescoStorageManager;
import org.alfresco.mobile.android.platform.utils.SessionUtils;
@@ -236,6 +238,7 @@ protected void getMenu(FragmentActivity activity, Menu menu)
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item)
{
+ String label = null;
Boolean b = false;
switch (item.getItemId())
{
@@ -243,48 +246,59 @@ public boolean onActionItemClicked(ActionMode mode, MenuItem item)
NodeDetailsFragment.with(getActivity()).node(selectedItems.get(0)).display();
break;
case R.id.menu_action_update:
+ label = AnalyticsManager.ACTION_UPDATE;
update(getActivity().getSupportFragmentManager().findFragmentByTag(PagerNodeDetailsFragment.TAG));
b = true;
break;
case R.id.menu_action_sync_group_sync:
+ label = AnalyticsManager.ACTION_SYNC;
sync(true);
b = true;
break;
case R.id.menu_action_sync_group_unsync:
+ label = AnalyticsManager.ACTION_UNSYNC;
sync(false);
b = true;
break;
case R.id.menu_action_favorite_group_favorite:
+ label = AnalyticsManager.ACTION_FAVORITE;
favorite(true);
b = true;
break;
case R.id.menu_action_favorite_group_unfavorite:
+ label = AnalyticsManager.ACTION_UNFAVORITE;
favorite(false);
b = true;
break;
case R.id.menu_action_like_group_like:
+ label = AnalyticsManager.ACTION_LIKE;
like(true);
b = true;
break;
case R.id.menu_action_like_group_unlike:
+ label = AnalyticsManager.ACTION_UNLIKE;
like(false);
b = true;
break;
case R.id.menu_action_download_all:
case R.id.menu_action_download:
+ label = AnalyticsManager.ACTION_DOWNLOAD;
download();
b = true;
break;
case R.id.menu_action_edit:
+ label = AnalyticsManager.ACTION_EDIT;
edit(getActivity(), parentFolder, selectedItems.get(0));
b = true;
break;
case R.id.menu_action_delete:
case R.id.menu_action_delete_folder:
+ label = AnalyticsManager.ACTION_DELETE;
delete(getActivity(), getFragment(), new ArrayList(selectedItems));
b = true;
break;
case R.id.menu_workflow_review_attachments:
+ label = AnalyticsManager.ACTION_START_REVIEW;
startReview();
b = true;
break;
@@ -293,6 +307,10 @@ public boolean onActionItemClicked(ActionMode mode, MenuItem item)
}
if (b)
{
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
+ AnalyticsManager.ACTION_MULTI_SELECT, label, selectedItems.size(), false);
+
selectedItems.clear();
selectedDocument.clear();
selectedFolder.clear();
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/activitystream/ActivityFeedFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/activitystream/ActivityFeedFragment.java
index c75959ec..9498992c 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/activitystream/ActivityFeedFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/activitystream/ActivityFeedFragment.java
@@ -32,6 +32,7 @@
import org.alfresco.mobile.android.application.fragments.node.details.NodeDetailsFragment;
import org.alfresco.mobile.android.application.fragments.user.UserProfileFragment;
import org.alfresco.mobile.android.async.activitystream.ActivityStreamEvent;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.ui.activitystream.ActivityStreamFragment;
import android.os.Bundle;
@@ -61,7 +62,7 @@ public ActivityFeedFragment()
super();
displayAsList = true;
setHasOptionsMenu(true);
-
+ screenName = AnalyticsManager.SCREEN_ACTIVITIES;
}
public static ActivityFeedFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/builder/AlfrescoFragmentBuilder.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/builder/AlfrescoFragmentBuilder.java
index d638a331..3b472cdb 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/builder/AlfrescoFragmentBuilder.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/builder/AlfrescoFragmentBuilder.java
@@ -28,6 +28,8 @@
import org.alfresco.mobile.android.application.configuration.model.ViewConfigModel;
import org.alfresco.mobile.android.application.fragments.DisplayUtils;
import org.alfresco.mobile.android.application.fragments.FragmentDisplayer;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.utils.BundleUtils;
import org.alfresco.mobile.android.platform.utils.SessionUtils;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
@@ -168,6 +170,12 @@ public void onClick(View v)
// Retrieve configuration
AlfrescoFragmentBuilder builder = (AlfrescoFragmentBuilder) v.getTag();
+ // Generally it's used when creating a menu item.
+ if (AnalyticsManager.getInstance(getActivity()) != null)
+ {
+ // AnalyticsManager.getInstance(getActivity()).reportScreen(builder.viewConfigModel.getSimpleType());
+ }
+
// Views can requires a session.
// We check against the activity to display the right info.
if (builder.sessionRequired && getActivity() instanceof MainActivity)
@@ -231,6 +239,30 @@ public Fragment createFragment()
{
Fragment frag = createFragment(createArguments());
if (frag == null) { return null; }
+
+ // Analytics
+ // Report only fragment & report at creation enable (cf. pager case)
+ if (AnalyticsManager.getInstance(getActivity()) != null
+ || AnalyticsManager.getInstance(getActivity()).isEnable())
+ {
+ if (frag instanceof AnalyticsManager.FragmentAnalyzed
+ && ((AnalyticsManager.FragmentAnalyzed) frag).reportAtCreationEnable())
+ {
+ if (viewConfigModel != null)
+ {
+ // Track only Main Menu Selection
+ AnalyticsHelper.reportScreen(getActivity(), AnalyticsManager.PREFIX_MENU
+ .concat(((AnalyticsManager.FragmentAnalyzed) frag).getScreenName()));
+ }
+ else
+ {
+ // Track all fragment created
+ AnalyticsHelper.reportScreen(getActivity(),
+ ((AnalyticsManager.FragmentAnalyzed) frag).getScreenName());
+ }
+ }
+ }
+
// Retrieve session if fragment need it.
if (sessionRequired && frag instanceof AlfrescoFragment)
{
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/config/MenuConfigFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/config/MenuConfigFragment.java
index efa97415..1f3a31cb 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/config/MenuConfigFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/config/MenuConfigFragment.java
@@ -47,6 +47,8 @@
import org.alfresco.mobile.android.platform.EventBusManager;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccountManager;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.io.AlfrescoStorageManager;
import org.alfresco.mobile.android.platform.utils.BundleUtils;
import org.alfresco.mobile.android.sync.SyncContentManager;
@@ -108,6 +110,7 @@ public MenuConfigFragment()
requiredSession = false;
checkSession = false;
setHasOptionsMenu(true);
+ screenName = AnalyticsManager.SCREEN_SETTINGS_CUSTOM_MENU;
}
protected static MenuConfigFragment newInstanceByTemplate(Bundle b)
@@ -179,6 +182,13 @@ public void onClick(View v)
saveConfiguration();
getActivity().onBackPressed();
}
+
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_ACCOUNT,
+ AnalyticsManager.ACTION_UPDATE_MENU,
+ getAccount().getTypeId() == AlfrescoAccount.TYPE_ALFRESCO_CLOUD
+ ? AnalyticsManager.SERVER_TYPE_CLOUD : AnalyticsManager.SERVER_TYPE_ONPREMISE,
+ 1, false);
+
}
});
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/DocumentTypesDialogFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/DocumentTypesDialogFragment.java
index e3b37642..8377e5bc 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/DocumentTypesDialogFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/DocumentTypesDialogFragment.java
@@ -22,6 +22,8 @@
import org.alfresco.mobile.android.application.R;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
import org.alfresco.mobile.android.platform.data.DocumentTypeRecord;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.ui.fragments.BaseListAdapter;
import org.alfresco.mobile.android.ui.holder.SingleLineViewHolder;
@@ -96,6 +98,9 @@ public Dialog onCreateDialog(Bundle savedInstanceState)
@Override
public void onSelection(MaterialDialog materialDialog, View view, int position,
CharSequence charSequence) {
+ AnalyticsHelper.reportOperationEvent(getActivity(),
+ AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT, AnalyticsManager.ACTION_QUICK_ACTIONS,
+ AnalyticsManager.ACTION_CREATE.concat(" " + fileTypes.get(position)), 1, false);
Bundle b = getArguments();
b.putSerializable(ARGUMENT_DOCUMENT_TYPE, fileTypes.get(position));
EditorsDialogFragment dialogft = EditorsDialogFragment.newInstance(b);
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/fileexplorer/FileExplorerFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/fileexplorer/FileExplorerFragment.java
index 6d7a1650..0514c522 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/fileexplorer/FileExplorerFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/fileexplorer/FileExplorerFragment.java
@@ -38,6 +38,7 @@
import org.alfresco.mobile.android.async.file.update.RenameFileEvent;
import org.alfresco.mobile.android.platform.AlfrescoNotificationManager;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.extensions.ScanSnapManager;
import org.alfresco.mobile.android.platform.intent.BaseActionUtils.ActionManagerListener;
import org.alfresco.mobile.android.platform.io.AlfrescoStorageManager;
@@ -91,6 +92,7 @@ public FileExplorerFragment()
{
emptyListMessageId = R.string.empty_download;
setHasOptionsMenu(true);
+ screenName = AnalyticsManager.SCREEN_LOCAL_FILES_BROWSER;
}
public static FileExplorerFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/fileexplorer/FileExplorerHelper.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/fileexplorer/FileExplorerHelper.java
index 50957bf0..db64d3c5 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/fileexplorer/FileExplorerHelper.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/fileexplorer/FileExplorerHelper.java
@@ -120,7 +120,7 @@ else if (mediatype >= 0)
LibraryFragment.with(activity).mediaType(mediatype).mode(mode).isShortCut(true)
.menuId(itemPosition).display();
}
- prefs.edit().putInt(FILEEXPLORER_DEFAULT, itemPosition).commit();
+ prefs.edit().putInt(FILEEXPLORER_DEFAULT, itemPosition).apply();
return true;
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/fileexplorer/FileExplorerMenuFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/fileexplorer/FileExplorerMenuFragment.java
index 90148d46..87488d11 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/fileexplorer/FileExplorerMenuFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/fileexplorer/FileExplorerMenuFragment.java
@@ -27,6 +27,7 @@
import org.alfresco.mobile.android.application.configuration.model.view.LocalConfigModel;
import org.alfresco.mobile.android.application.fragments.MenuFragmentHelper;
import org.alfresco.mobile.android.application.fragments.builder.AlfrescoFragmentBuilder;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.io.AlfrescoStorageManager;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
import org.alfresco.mobile.android.ui.utils.UIUtils;
@@ -56,6 +57,7 @@ public FileExplorerMenuFragment()
{
requiredSession = false;
checkSession = false;
+ screenName = AnalyticsManager.SCREEN_LOCAL_FILES_MENU;
}
public static FileExplorerMenuFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/help/HelpDialogFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/help/HelpDialogFragment.java
index a840baed..b2f7e444 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/help/HelpDialogFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/help/HelpDialogFragment.java
@@ -22,6 +22,8 @@
import org.alfresco.mobile.android.application.R;
import org.alfresco.mobile.android.application.fragments.MenuFragmentHelper;
import org.alfresco.mobile.android.application.fragments.builder.LeafFragmentBuilder;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.utils.ConnectivityUtils;
import org.alfresco.mobile.android.ui.RefreshFragment;
import org.alfresco.mobile.android.ui.activity.AlfrescoActivity;
@@ -295,6 +297,7 @@ public Builder(FragmentActivity appActivity, Map configuration)
// ///////////////////////////////////////////////////////////////////////////
protected Fragment createFragment(Bundle b)
{
+ AnalyticsHelper.reportScreen(getActivity(), AnalyticsManager.SCREEN_HELP);
return newInstanceByTemplate(b);
}
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/menu/MainMenuFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/menu/MainMenuFragment.java
index 6142873d..c1bda583 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/menu/MainMenuFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/menu/MainMenuFragment.java
@@ -123,6 +123,7 @@ public MainMenuFragment()
checkSession = false;
requiredSession = false;
setHasOptionsMenu(true);
+ reportAtCreation = false;
}
protected static MainMenuFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/browser/DocumentFolderBrowserFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/browser/DocumentFolderBrowserFragment.java
index f3f9aa08..5e030e86 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/browser/DocumentFolderBrowserFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/browser/DocumentFolderBrowserFragment.java
@@ -79,6 +79,8 @@
import org.alfresco.mobile.android.async.utils.ContentFileProgressImpl;
import org.alfresco.mobile.android.async.utils.NodePlaceHolder;
import org.alfresco.mobile.android.platform.exception.AlfrescoAppException;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.extensions.ScanSnapManager;
import org.alfresco.mobile.android.platform.intent.PrivateIntent;
import org.alfresco.mobile.android.platform.io.AlfrescoStorageManager;
@@ -179,6 +181,32 @@ public static DocumentFolderBrowserFragment newInstanceByTemplate(Bundle b)
DocumentFolderBrowserFragment cbf = new DocumentFolderBrowserFragment();
cbf.setArguments(b);
b.putBoolean(ARGUMENT_BASED_ON_TEMPLATE, true);
+
+ if (b != null)
+ {
+ if (b.containsKey(ARGUMENT_FOLDER_TYPE_ID))
+ {
+ int index = b.getInt(ARGUMENT_FOLDER_TYPE_ID);
+ if (index == NodeChildrenRequest.FOLDER_SHARED)
+ {
+ cbf.screenName = AnalyticsManager.SCREEN_REPOSITORY_SHARED;
+ }
+ else if (index == NodeChildrenRequest.FOLDER_USER_HOMES)
+ {
+ cbf.screenName = AnalyticsManager.SCREEN_REPOSITORY_USERHOME;
+ }
+ }
+ else if (!b.containsKey(ARGUMENT_FOLDER) && !b.containsKey(ARGUMENT_SITE) && !b.containsKey(ARGUMENT_PATH)
+ && !b.containsKey(ARGUMENT_FOLDER_NODEREF) && !b.containsKey(ARGUMENT_SITE_SHORTNAME))
+ {
+ cbf.screenName = AnalyticsManager.SCREEN_REPOSITORY;
+ }
+ else
+ {
+ cbf.screenName = AnalyticsManager.SCREEN_NODE_LISTING;
+ }
+ }
+
return cbf;
}
@@ -1014,10 +1042,15 @@ private boolean onOptionMenuItemSelected(int itemId)
switch (itemId)
{
case R.id.menu_search_from_folder:
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
+ AnalyticsManager.ACTION_QUICK_ACTIONS, AnalyticsManager.ACTION_SEARCH, 1, false);
search();
return true;
case R.id.menu_create_folder:
createFolder();
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
+ AnalyticsManager.ACTION_QUICK_ACTIONS,
+ AnalyticsManager.ACTION_CREATE.concat(" " + AnalyticsManager.TYPE_FOLDER), 1, false);
return true;
case R.id.menu_upload:
Intent i = new Intent(PrivateIntent.ACTION_PICK_FILE, null, getActivity(),
@@ -1048,6 +1081,8 @@ private boolean onOptionMenuItemSelected(int itemId)
if (ScanSnapManager.getInstance(getActivity()) != null)
{
ScanSnapManager.getInstance(getActivity()).startPresetChooser(getActivity());
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
+ AnalyticsManager.ACTION_QUICK_ACTIONS, AnalyticsManager.ACTION_SCAN, 1, false);
}
return true;
default:
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/comment/CommentsFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/comment/CommentsFragment.java
index db4142b2..e2ac0d05 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/comment/CommentsFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/comment/CommentsFragment.java
@@ -71,6 +71,7 @@ public CommentsFragment()
{
emptyListMessageId = R.string.empty_comment;
loadState = LOAD_VISIBLE;
+ reportAtCreation = false;
}
protected static CommentsFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/create/CreateDocumentDialogFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/create/CreateDocumentDialogFragment.java
index 7938ea16..e6e5ba1d 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/create/CreateDocumentDialogFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/create/CreateDocumentDialogFragment.java
@@ -42,6 +42,7 @@
import org.alfresco.mobile.android.async.node.create.CreateDocumentRequest;
import org.alfresco.mobile.android.async.node.create.RetrieveDocumentNameEvent;
import org.alfresco.mobile.android.async.node.create.RetrieveDocumentNameRequest;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.io.AlfrescoStorageManager;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
import org.alfresco.mobile.android.ui.fragments.BaseListAdapter;
@@ -111,6 +112,7 @@ public abstract class CreateDocumentDialogFragment extends AlfrescoFragment
// //////////////////////////////////////////////////////////////////////
public CreateDocumentDialogFragment()
{
+ screenName = AnalyticsManager.SCREEN_NODE_CREATE_FORM;
}
public static Bundle createBundle(Folder folder)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/create/CreateFolderDialogFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/create/CreateFolderDialogFragment.java
index 1f816924..c2254163 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/create/CreateFolderDialogFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/create/CreateFolderDialogFragment.java
@@ -21,6 +21,7 @@
import org.alfresco.mobile.android.application.R;
import org.alfresco.mobile.android.async.Operator;
import org.alfresco.mobile.android.async.node.create.CreateFolderRequest;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.utils.SessionUtils;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
import org.alfresco.mobile.android.ui.operation.OperationWaitingDialogFragment;
@@ -54,6 +55,7 @@ public abstract class CreateFolderDialogFragment extends AlfrescoFragment
// ///////////////////////////////////////////////////////////////////////////
public CreateFolderDialogFragment()
{
+ screenName = AnalyticsManager.SCREEN_NODE_CREATE_FOLDER_FORM;
}
public static Bundle createBundle(Folder folder)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/NodeDetailsFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/NodeDetailsFragment.java
index 31a7d905..8ca41456 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/NodeDetailsFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/NodeDetailsFragment.java
@@ -77,6 +77,8 @@
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
import org.alfresco.mobile.android.platform.exception.AlfrescoAppException;
import org.alfresco.mobile.android.platform.exception.AlfrescoExceptionHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.intent.BaseActionUtils.ActionManagerListener;
import org.alfresco.mobile.android.platform.intent.PrivateIntent;
import org.alfresco.mobile.android.platform.io.AlfrescoStorageManager;
@@ -168,6 +170,7 @@ public NodeDetailsFragment()
requiredSession = false;
checkSession = false;
layoutId = R.layout.app_details;
+ reportAtCreation = false;
}
// //////////////////////////////////////////////////////////////////////
@@ -636,6 +639,14 @@ public void onClick(View v)
isSynced = (node.isFolder())
? SyncContentManager.getInstance(getActivity()).isRootSynced(getAccount(), node)
: SyncContentManager.getInstance(getActivity()).isSynced(getAccount(), node);
+
+ AnalyticsHelper.reportOperationEvent(getActivity(),
+ AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
+ isSynced ? AnalyticsManager.ACTION_SYNC : AnalyticsManager.ACTION_UNSYNC,
+ node.isDocument() ? ((Document) node).getContentStreamMimeType()
+ : AnalyticsManager.TYPE_FOLDER,
+ 1, false);
+
sync(v);
}
});
@@ -834,6 +845,12 @@ public void onActivityNotFoundException(ActivityNotFoundException e)
DialogFragment frag = new DownloadDialogFragment();
frag.setArguments(b);
frag.show(getActivity().getSupportFragmentManager(), DownloadDialogFragment.TAG);
+
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
+ AnalyticsManager.ACTION_SHARE,
+ node.isDocument() ? ((Document) node).getContentStreamMimeType() : AnalyticsManager.TYPE_FOLDER, 1,
+ false);
}
else
{
@@ -851,6 +868,13 @@ public void onPositive(MaterialDialog dialog)
frag.setArguments(b);
frag.show(getActivity().getSupportFragmentManager(), DownloadDialogFragment.TAG);
dialog.dismiss();
+
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(getActivity(),
+ AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT, AnalyticsManager.ACTION_SHARE,
+ node.isDocument() ? ((Document) node).getContentStreamMimeType()
+ : AnalyticsManager.TYPE_FOLDER,
+ 1, false);
}
@Override
@@ -892,6 +916,14 @@ else if (path.startsWith("/Sites/"))
{
Log.i(getString(R.string.app_name), "Site path not as expected: no /sites/");
}
+
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(getActivity(),
+ AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
+ AnalyticsManager.ACTION_SHARE_AS_LINK,
+ node.isDocument() ? ((Document) node).getContentStreamMimeType()
+ : AnalyticsManager.TYPE_FOLDER,
+ 1, false);
}
else
{
@@ -961,6 +993,12 @@ public void onActivityNotFoundException(ActivityNotFoundException e)
frag.setArguments(b);
frag.show(getActivity().getSupportFragmentManager(), DownloadDialogFragment.TAG);
}
+
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
+ AnalyticsManager.ACTION_OPEN,
+ node.isDocument() ? ((Document) node).getContentStreamMimeType() : AnalyticsManager.TYPE_FOLDER, 1,
+ false, AnalyticsManager.INDEX_FILE_SIZE, ((Document) node).getContentStreamLength());
}
public void setDownloadDateTime(Date downloadDateTime)
@@ -975,6 +1013,11 @@ public void download()
if (node instanceof Document)
{
NodeActions.download(getActivity(), parentNode, (Document) node);
+
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
+ AnalyticsManager.ACTION_DOWNLOAD, ((Document) node).getContentStreamMimeType(), 1, false,
+ AnalyticsManager.INDEX_FILE_SIZE, ((Document) node).getContentStreamLength());
}
}
@@ -1172,6 +1215,11 @@ public boolean onOptionsItemSelected(MenuItem item)
in.putExtra(PrivateIntent.EXTRA_DOCUMENT, (Serializable) doc);
in.putExtra(PrivateIntent.EXTRA_ACCOUNT_ID, getAccount().getId());
startActivity(in);
+
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
+ AnalyticsManager.ACTION_START_REVIEW, doc.getContentStreamMimeType(), 1, false);
+
return true;
}
return super.onOptionsItemSelected(item);
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/NodePropertiesFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/NodePropertiesFragment.java
index 2c452e92..2e963271 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/NodePropertiesFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/NodePropertiesFragment.java
@@ -55,6 +55,7 @@ public class NodePropertiesFragment extends NodeDetailsFragment
public NodePropertiesFragment()
{
layoutId = R.layout.fr_node_properties;
+ reportAtCreation = false;
}
protected static NodePropertiesFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/NodeSummaryFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/NodeSummaryFragment.java
index ec113cbb..20eceffb 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/NodeSummaryFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/NodeSummaryFragment.java
@@ -55,6 +55,7 @@ public class NodeSummaryFragment extends NodePropertiesFragment
public NodeSummaryFragment()
{
layoutId = R.layout.fr_node_summary;
+ reportAtCreation = false;
}
protected static NodeSummaryFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/PagerNodeDetailsFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/PagerNodeDetailsFragment.java
index 9d4ae889..68f40536 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/PagerNodeDetailsFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/PagerNodeDetailsFragment.java
@@ -39,6 +39,8 @@
import org.alfresco.mobile.android.async.node.sync.SyncNodeEvent;
import org.alfresco.mobile.android.async.node.update.UpdateContentEvent;
import org.alfresco.mobile.android.async.node.update.UpdateNodeEvent;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.sync.utils.NodeSyncPlaceHolder;
import android.annotation.TargetApi;
@@ -57,7 +59,7 @@
/**
* Responsible to display details of a specific Node.
- *
+ *
* @author Jean Marie Pascal
*/
public class PagerNodeDetailsFragment extends NodeDetailsFragment
@@ -70,6 +72,8 @@ public class PagerNodeDetailsFragment extends NodeDetailsFragment
public PagerNodeDetailsFragment()
{
setHasOptionsMenu(true);
+ screenName = AnalyticsManager.SCREEN_NODE_SUMMARY;
+ reportAtCreation = false;
}
protected static PagerNodeDetailsFragment newInstanceByTemplate(Bundle b)
@@ -111,6 +115,8 @@ protected void displayTabs()
NodeDetailsPagerAdapter adapter = new NodeDetailsPagerAdapter(getChildFragmentManager(), getActivity(), node,
parentNode);
viewPager.setAdapter(adapter);
+ viewPager.addOnPageChangeListener(pageChangeListener);
+ pageChangeListener.onPageSelected(0);
viewPager.setCurrentItem(0);
tabs.setViewPager(viewPager);
tabs.setTextColor(getResources().getColor(android.R.color.black));
@@ -140,6 +146,77 @@ public void onActivityResult(int requestCode, int resultCode, Intent data)
}
}
+ ViewPager.OnPageChangeListener pageChangeListener = new ViewPager.OnPageChangeListener()
+ {
+ @Override
+ public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels)
+ {
+
+ }
+
+ @Override
+ public void onPageSelected(int position)
+ {
+ if (AnalyticsManager.getInstance(getActivity()) != null)
+ {
+ boolean isTablet = !getActivity().getResources().getBoolean(R.bool.fr_details_summary);
+ if (node instanceof NodeSyncPlaceHolder)
+ {
+ screenName = (isTablet) ? AnalyticsManager.SCREEN_NODE_PROPERTIES
+ : AnalyticsManager.SCREEN_NODE_SUMMARY;
+ }
+ else if (node instanceof Folder)
+ {
+ switch (position + 1)
+ {
+ case NodeDetailsPagerAdapter.TAB_METADATA:
+ screenName = (isTablet) ? AnalyticsManager.SCREEN_NODE_PROPERTIES
+ : AnalyticsManager.SCREEN_NODE_SUMMARY;
+ break;
+ case NodeDetailsPagerAdapter.TAB_COMMENTS:
+ screenName = AnalyticsManager.SCREEN_NODE_COMMENTS;
+ break;
+ default:
+ break;
+ }
+ }
+ else
+ {
+ int relativePosition = position;
+ if (!isTablet)
+ {
+ relativePosition++;
+ }
+ switch (relativePosition)
+ {
+ case NodeDetailsPagerAdapter.TAB_PREVIEW:
+ screenName = AnalyticsManager.SCREEN_NODE_PREVIEW;
+ break;
+ case NodeDetailsPagerAdapter.TAB_METADATA:
+ screenName = (isTablet) ? AnalyticsManager.SCREEN_NODE_PROPERTIES
+ : AnalyticsManager.SCREEN_NODE_SUMMARY;
+ break;
+ case NodeDetailsPagerAdapter.TAB_COMMENTS:
+ screenName = AnalyticsManager.SCREEN_NODE_COMMENTS;
+ break;
+ case NodeDetailsPagerAdapter.TAB_HISTORY:
+ screenName = AnalyticsManager.SCREEN_NODE_VERSIONS;
+ break;
+ default:
+ break;
+ }
+ }
+ AnalyticsHelper.reportScreen(getActivity(), screenName);
+ }
+ }
+
+ @Override
+ public void onPageScrollStateChanged(int state)
+ {
+
+ }
+ };
+
// ///////////////////////////////////////////////////////////////////////////
// EVENTS RECEIVER
// ///////////////////////////////////////////////////////////////////////////
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/favorite/FavoritesFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/favorite/FavoritesFragment.java
index b7955c42..db612373 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/favorite/FavoritesFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/favorite/FavoritesFragment.java
@@ -38,6 +38,7 @@
import org.alfresco.mobile.android.application.fragments.node.details.NodeDetailsFragment;
import org.alfresco.mobile.android.async.node.favorite.FavoriteNodeEvent;
import org.alfresco.mobile.android.async.node.favorite.FavoriteNodesEvent;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.favorite.FavoritesManager;
import org.alfresco.mobile.android.ui.ListingModeFragment;
import org.alfresco.mobile.android.ui.SelectableFragment;
@@ -69,6 +70,7 @@ public class FavoritesFragment extends FavoritesNodeFragment implements Selectab
public FavoritesFragment()
{
emptyListMessageId = R.string.empty_favorites;
+ screenName = AnalyticsManager.SCREEN_FAVORITES;
}
public static FavoritesFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/rendition/CarouselPreviewFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/rendition/CarouselPreviewFragment.java
index 871f06ed..e70ee00c 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/rendition/CarouselPreviewFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/rendition/CarouselPreviewFragment.java
@@ -30,6 +30,7 @@
import org.alfresco.mobile.android.async.Operator;
import org.alfresco.mobile.android.async.node.browse.NodeChildrenEvent;
import org.alfresco.mobile.android.async.node.browse.NodeChildrenRequest;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
import org.alfresco.mobile.android.ui.node.browse.NodeBrowserTemplate;
@@ -68,6 +69,7 @@ public class CarouselPreviewFragment extends AlfrescoFragment implements Details
// //////////////////////////////////////////////////////////////////////
public CarouselPreviewFragment()
{
+ screenName = AnalyticsManager.SCREEN_NODE_GALLERY;
}
protected static CarouselPreviewFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/rendition/PreviewFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/rendition/PreviewFragment.java
index ebee0b1b..0228f0fa 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/rendition/PreviewFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/rendition/PreviewFragment.java
@@ -86,6 +86,7 @@ public PreviewFragment()
{
requiredSession = true;
checkSession = true;
+ reportAtCreation = false;
}
protected static PreviewFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/search/DocumentFolderSearchFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/search/DocumentFolderSearchFragment.java
index 455af174..e4560e03 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/search/DocumentFolderSearchFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/search/DocumentFolderSearchFragment.java
@@ -42,6 +42,7 @@
import org.alfresco.mobile.android.async.OperationRequest.OperationBuilder;
import org.alfresco.mobile.android.async.node.search.SearchEvent;
import org.alfresco.mobile.android.async.node.search.SearchRequest;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.ui.ListingModeFragment;
import org.alfresco.mobile.android.ui.SelectableFragment;
import org.alfresco.mobile.android.ui.node.search.SearchNodesFragment;
@@ -86,6 +87,7 @@ public DocumentFolderSearchFragment()
super();
loadState = LOAD_VISIBLE;
displayAsList = false;
+ screenName = AnalyticsManager.SCREEN_SEARCH_RESULT_FILES;
}
protected static DocumentFolderSearchFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/update/EditPropertiesFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/update/EditPropertiesFragment.java
index e684a286..5912982d 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/update/EditPropertiesFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/update/EditPropertiesFragment.java
@@ -36,6 +36,7 @@
import org.alfresco.mobile.android.async.Operator;
import org.alfresco.mobile.android.async.definition.TypeDefinitionEvent;
import org.alfresco.mobile.android.async.node.update.UpdateNodeRequest;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.utils.BundleUtils;
import android.content.res.Configuration;
@@ -68,6 +69,7 @@ public class EditPropertiesFragment extends EditNodePropertiesFragment implement
public EditPropertiesFragment()
{
setRetainInstance(true);
+ screenName = AnalyticsManager.SCREEN_NODE_EDIT_PROPERTIES;
}
public static EditPropertiesFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/versions/VersionFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/versions/VersionFragment.java
index 518fdca3..5ec87c11 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/versions/VersionFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/versions/VersionFragment.java
@@ -51,6 +51,7 @@ public class VersionFragment extends VersionsNodeFragment
// ///////////////////////////////////////////////////////////////////////////
public VersionFragment()
{
+ reportAtCreation = false;
}
protected static VersionFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/AccountSettingsFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/AccountSettingsFragment.java
index 8daf4924..ec17979a 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/AccountSettingsFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/AccountSettingsFragment.java
@@ -36,6 +36,7 @@
import org.alfresco.mobile.android.application.fragments.user.UserProfileFragment;
import org.alfresco.mobile.android.application.fragments.utils.EditTextDialogFragment;
import org.alfresco.mobile.android.application.managers.ConfigManager;
+import org.alfresco.mobile.android.application.managers.extensions.AnalyticHelper;
import org.alfresco.mobile.android.async.Operator;
import org.alfresco.mobile.android.async.account.DeleteAccountEvent;
import org.alfresco.mobile.android.async.clean.CleanSyncFavoriteRequest;
@@ -44,6 +45,8 @@
import org.alfresco.mobile.android.platform.accounts.AccountsPreferences;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccountManager;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.io.AlfrescoStorageManager;
import org.alfresco.mobile.android.platform.security.DataProtectionManager;
import org.alfresco.mobile.android.platform.utils.BundleUtils;
@@ -105,6 +108,7 @@ public AccountSettingsFragment()
{
setHasOptionsMenu(true);
requiredSession = false;
+ screenName = AnalyticsManager.SCREEN_SETTINGS_ACCOUNT;
}
protected static AccountSettingsFragment newInstanceByTemplate(Bundle b)
@@ -346,7 +350,7 @@ public void onPositive(MaterialDialog dialog)
edit.putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, false);
// Turn off data protection
DataProtectionManager.getInstance(getActivity()).setDataProtectionEnable(false);
- edit.commit();
+ edit.apply();
deleteAccount();
}
@@ -384,12 +388,19 @@ private void deleteAccount()
AccountManager.get(getActivity()).removeAccount(
AlfrescoAccountManager.getInstance(getActivity()).getAndroidAccount(account.getId()), null, null);
- // Send the event
- EventBusManager.getInstance().post(new DeleteAccountEvent(account));
+ // Analytics
+ AnalyticsHelper
+ .reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_ACCOUNT,
+ AnalyticsManager.ACTION_DELETE, account.getTypeId() == AlfrescoAccount.TYPE_ALFRESCO_CLOUD
+ ? AnalyticsManager.SERVER_TYPE_CLOUD : AnalyticsManager.SERVER_TYPE_ONPREMISE,
+ 1, false);
// In case where currentAccount is the one deleted.
SessionManager.getInstance(getActivity()).removeAccount(account.getId());
+ // Send the event
+ EventBusManager.getInstance().post(new DeleteAccountEvent(account));
+
AlfrescoAccount newAccount = AlfrescoAccountManager.getInstance(getActivity()).getDefaultAccount();
if (newAccount != null && newAccount.getId() == account.getId())
@@ -398,7 +409,7 @@ private void deleteAccount()
long id = settings.getLong(AccountsPreferences.ACCOUNT_DEFAULT, -1);
if (id == account.getId())
{
- settings.edit().putLong(AccountsPreferences.ACCOUNT_DEFAULT, -1).commit();
+ settings.edit().putLong(AccountsPreferences.ACCOUNT_DEFAULT, -1).apply();
}
}
@@ -417,7 +428,7 @@ private void deleteAccount()
newAccount = accounts.get(0);
SessionManager.getInstance(getActivity()).saveAccount(newAccount);
SharedPreferences settings = getActivity().getSharedPreferences(AccountsPreferences.ACCOUNT_PREFS, 0);
- settings.edit().putLong(AccountsPreferences.ACCOUNT_DEFAULT, newAccount.getId()).commit();
+ settings.edit().putLong(AccountsPreferences.ACCOUNT_DEFAULT, newAccount.getId()).apply();
setCurrentAccount(newAccount);
if (SessionManager.getInstance(getActivity()).hasSession(newAccount.getId()))
@@ -446,14 +457,15 @@ private void deleteAccount()
// If no AlfrescoAccount left, we remove all preferences
// Remove preferences
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getActivity());
- SharedPreferences.Editor editor = sharedPref.edit();
- editor.clear();
- editor.commit();
+ sharedPref.edit().clear().apply();
// Redirect to HomeScreenActivity
getActivity().startActivity(new Intent(getActivity(), WelcomeActivity.class));
getActivity().finish();
}
+
+ // Clear Analytics Info for deleted account
+ AnalyticHelper.cleanOpt(getActivity(), account);
}
// //////////////////////////////////////////////////////////////////////////////////////
@@ -471,6 +483,9 @@ public void onTextEdited(int id, String newValue)
SessionManager.getInstance(getActivity()).saveAccount(account);
setCurrentAccount(account);
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_ACCOUNT,
+ AnalyticsManager.ACTION_EDIT, AnalyticsManager.LABEL_NAME, 1, false);
+
recreate();
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/GeneralPreferences.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/GeneralPreferences.java
index 4ab24462..970a7a30 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/GeneralPreferences.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/GeneralPreferences.java
@@ -30,6 +30,7 @@
import org.alfresco.mobile.android.application.fragments.builder.LeafFragmentBuilder;
import org.alfresco.mobile.android.application.fragments.signin.AccountSignInFragment;
import org.alfresco.mobile.android.application.managers.ActionUtils;
+import org.alfresco.mobile.android.application.managers.extensions.AnalyticHelper;
import org.alfresco.mobile.android.application.security.DataProtectionUserDialogFragment;
import org.alfresco.mobile.android.async.session.RequestSessionEvent;
import org.alfresco.mobile.android.platform.AlfrescoNotificationManager;
@@ -37,6 +38,7 @@
import org.alfresco.mobile.android.platform.SessionManager;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccountManager;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.extensions.DevToolsManager;
import org.alfresco.mobile.android.platform.intent.PrivateRequestCode;
import org.alfresco.mobile.android.platform.io.AlfrescoStorageManager;
@@ -44,6 +46,7 @@
import org.alfresco.mobile.android.platform.security.DataProtectionManager;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
import org.alfresco.mobile.android.ui.holder.HolderUtils;
+import org.alfresco.mobile.android.ui.holder.TwoLinesCheckboxViewHolder;
import org.alfresco.mobile.android.ui.holder.TwoLinesViewHolder;
import android.content.Intent;
@@ -78,6 +81,8 @@ public class GeneralPreferences extends AlfrescoFragment
private TwoLinesViewHolder dataProtectionVH, passcodeVH;
+ private TwoLinesCheckboxViewHolder diagnosticVH;
+
// ///////////////////////////////////////////////////////////////////////////
// CONSTRUCTORS
// ///////////////////////////////////////////////////////////////////////////
@@ -85,6 +90,7 @@ public GeneralPreferences()
{
requiredSession = false;
setHasOptionsMenu(true);
+ screenName = AnalyticsManager.SCREEN_SETTINGS_DETAILS;
}
protected static GeneralPreferences newInstanceByTemplate(Bundle b)
@@ -109,41 +115,41 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
setRootView(inflater.inflate(R.layout.fr_settings, container, false));
TwoLinesViewHolder vh;
- // Links
- // Alfresco Website
- vh = HolderUtils.configure(viewById(R.id.settings_links_website), getString(R.string.settings_links_website),
- getString(R.string.settings_links_website_summary), -1);
- viewById(R.id.settings_links_website_container).setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- ActionUtils.startWebBrowser(getActivity(), getString(R.string.settings_links_website_url));
- }
- });
-
- // Play Store
- vh = HolderUtils.configure(viewById(R.id.settings_rating), getString(R.string.settings_rating),
- getString(R.string.settings_rating_summary), -1);
- viewById(R.id.settings_rating_container).setOnClickListener(new View.OnClickListener()
+ // Feedback - Analytics
+ if (AnalyticsManager.getInstance(getActivity()) == null
+ || AnalyticsManager.getInstance(getActivity()).isBlocked())
{
- @Override
- public void onClick(View v)
- {
- startPlayStore();
- }
- });
+ boolean isEnable = AnalyticsManager.getInstance(getActivity()).isEnable();
- // Facebook
- vh = HolderUtils.configure(viewById(R.id.settings_links_facebook), getString(R.string.settings_links_facebook),
- getString(R.string.settings_links_facebook_summary), -1);
- viewById(R.id.settings_links_facebook_container).setOnClickListener(new View.OnClickListener()
+ diagnosticVH = HolderUtils.configure(viewById(R.id.settings_diagnostic),
+ getString(R.string.settings_feedback_diagnostic), getString(R.string.mdm_managed), isEnable);
+ diagnosticVH.choose.setVisibility(View.GONE);
+ diagnosticVH.choose.setEnabled(false);
+ }
+ else
{
- @Override
- public void onClick(View v)
+ boolean isEnable = AnalyticsManager.getInstance(getActivity()).isEnable();
+
+ diagnosticVH = HolderUtils.configure(viewById(R.id.settings_diagnostic),
+ getString(R.string.settings_feedback_diagnostic),
+ getString(R.string.settings_feedback_diagnostic_summary), isEnable);
+ HolderUtils.makeMultiLine(diagnosticVH.bottomText, 3);
+ diagnosticVH.choose.setOnClickListener(new View.OnClickListener()
{
- ActionUtils.startWebBrowser(getActivity(), getString(R.string.settings_links_facebook_url));
- }
- });
- HolderUtils.makeMultiLine(vh.topText, 2);
+ @Override
+ public void onClick(View v)
+ {
+ if (diagnosticVH.choose.isChecked())
+ {
+ AnalyticHelper.optIn(getActivity(), getAccount());
+ }
+ else
+ {
+ AnalyticHelper.optOut(getActivity(), getAccount());
+ }
+ }
+ });
+ }
// About
vh = HolderUtils.configure(viewById(R.id.settings_about), getString(R.string.version_number),
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/PasscodePreferences.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/PasscodePreferences.java
index c806c32b..7c9ce02e 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/PasscodePreferences.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/PasscodePreferences.java
@@ -29,6 +29,7 @@
import org.alfresco.mobile.android.application.fragments.builder.LeafFragmentBuilder;
import org.alfresco.mobile.android.application.security.PassCodeActivity;
import org.alfresco.mobile.android.application.security.PassCodeDialogFragment;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
import org.alfresco.mobile.android.ui.holder.HolderUtils;
import org.alfresco.mobile.android.ui.holder.SingleLineSwitchViewHolder;
@@ -103,6 +104,7 @@ public class PasscodePreferences extends AlfrescoFragment
public PasscodePreferences()
{
requiredSession = false;
+ screenName = AnalyticsManager.SCREEN_SETTINGS_PASSCODE;
}
protected static PasscodePreferences newInstanceByTemplate(Bundle b)
@@ -193,7 +195,7 @@ public boolean onSelection(MaterialDialog dialog, View view, int which,
{
String newValue = getResources().getStringArray(R.array.passcode_timeout_values)[which];
index = which;
- sharedPref.edit().putString(KEY_PASSCODE_TIMEOUT, (String) newValue).commit();
+ sharedPref.edit().putString(KEY_PASSCODE_TIMEOUT, (String) newValue).apply();
int minutes = Math.round(Long.parseLong((String) newValue) / ONE_MINUTE);
passcodeTimeoutVH.bottomText.setText(String.format(
MessageFormat.format(getString(R.string.passcode_timeout_summary), minutes),
@@ -222,11 +224,11 @@ public void onClick(View v)
passcodeDataVH.choose.setChecked(maxAttemptActivated);
if (maxAttemptActivated)
{
- sharedPref.edit().putInt(KEY_PASSCODE_MAX_ATTEMPT, 10).commit();
+ sharedPref.edit().putInt(KEY_PASSCODE_MAX_ATTEMPT, 10).apply();
}
else
{
- sharedPref.edit().remove(KEY_PASSCODE_MAX_ATTEMPT).commit();
+ sharedPref.edit().remove(KEY_PASSCODE_MAX_ATTEMPT).apply();
}
}
});
@@ -240,11 +242,11 @@ public void onClick(View v)
passcodeDataVH.choose.setChecked(maxAttemptActivated);
if (maxAttemptActivated)
{
- sharedPref.edit().putInt(KEY_PASSCODE_MAX_ATTEMPT, 10).commit();
+ sharedPref.edit().putInt(KEY_PASSCODE_MAX_ATTEMPT, 10).apply();
}
else
{
- sharedPref.edit().remove(KEY_PASSCODE_MAX_ATTEMPT).commit();
+ sharedPref.edit().remove(KEY_PASSCODE_MAX_ATTEMPT).apply();
}
}
});
@@ -318,7 +320,7 @@ public static void updateLastActivity(Context context)
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putLong(KEY_PASSCODE_ACTIVATED_AT, new Date().getTime());
- editor.commit();
+ editor.apply();
}
/**
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/profile/ProfilesConfigFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/profile/ProfilesConfigFragment.java
index 25ffb3c7..6e58f41b 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/profile/ProfilesConfigFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/profile/ProfilesConfigFragment.java
@@ -26,6 +26,8 @@
import org.alfresco.mobile.android.application.managers.ConfigManager;
import org.alfresco.mobile.android.async.OperationRequest.OperationBuilder;
import org.alfresco.mobile.android.foundation.R;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.ui.fragments.BaseGridFragment;
import org.alfresco.mobile.android.ui.utils.UIUtils;
@@ -120,6 +122,10 @@ public void onListItemClick(GridView l, View v, int position, long id)
ProfileConfig profile = (ProfileConfig) l.getItemAtPosition(position);
ConfigManager.getInstance(getActivity()).swapProfile(getAccount(), profile.getIdentifier());
getActivity().getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
+
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_SESSION,
+ AnalyticsManager.ACTION_SWITCH, AnalyticsManager.LABEL_PROFILE, 1, false);
}
// ///////////////////////////////////////////////////////////////////////////
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/AdvancedSearchFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/AdvancedSearchFragment.java
index 69520876..96e3b123 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/AdvancedSearchFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/AdvancedSearchFragment.java
@@ -44,6 +44,8 @@
import org.alfresco.mobile.android.application.ui.form.picker.DatePickerFragment;
import org.alfresco.mobile.android.application.ui.form.picker.DatePickerFragment.onPickDateFragment;
import org.alfresco.mobile.android.platform.AlfrescoNotificationManager;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.utils.AccessibilityUtils;
import org.alfresco.mobile.android.platform.utils.SessionUtils;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
@@ -123,6 +125,12 @@ public class AdvancedSearchFragment extends AlfrescoFragment
// ///////////////////////////////////////////////////////////////////////////
// CONSTRUCTORS
// ///////////////////////////////////////////////////////////////////////////
+ public AdvancedSearchFragment()
+ {
+ screenName = AnalyticsManager.SCREEN_SEARCH_ADVANCED;
+ reportAtCreation = false;
+ }
+
protected static AdvancedSearchFragment newInstanceByTemplate(Bundle b)
{
AdvancedSearchFragment cbf = new AdvancedSearchFragment();
@@ -146,15 +154,22 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
{
case HistorySearch.TYPE_PERSON:
layoutId = R.layout.app_search_user;
+ screenName = AnalyticsManager.SCREEN_SEARCH_ADVANCED_USERS;
break;
case HistorySearch.TYPE_FOLDER:
+ layoutId = R.layout.app_search_document;
+ screenName = AnalyticsManager.SCREEN_SEARCH_ADVANCED_FOLDERS;
+ break;
case HistorySearch.TYPE_DOCUMENT:
layoutId = R.layout.app_search_document;
+ screenName = AnalyticsManager.SCREEN_SEARCH_ADVANCED_FILES;
break;
default:
break;
}
+ AnalyticsHelper.reportScreen(getActivity(), screenName);
+
// Search inside a folder
tmpParentFolder = (Folder) getArguments().getSerializable(ARGUMENT_FOLDER);
if (getArguments().containsKey(ViewTemplate.ARGUMENT_LABEL))
@@ -266,8 +281,8 @@ public void onClick(View v)
modificationDateTo = (Button) rootView.findViewById(R.id.metadata_modification_date_to);
if (modificationDateToValue != null)
{
- modificationDateTo.setText(DateFormat.getDateFormat(getActivity())
- .format(modificationDateToValue.getTime()));
+ modificationDateTo
+ .setText(DateFormat.getDateFormat(getActivity()).format(modificationDateToValue.getTime()));
}
modificationDateTo.setOnClickListener(new OnClickListener()
{
@@ -291,8 +306,8 @@ public void onClick(View v)
modificationDateFrom = (Button) rootView.findViewById(R.id.metadata_modification_date_from);
if (modificationDateFromValue != null)
{
- modificationDateFrom.setText(DateFormat.getDateFormat(getActivity()).format(
- modificationDateFromValue.getTime()));
+ modificationDateFrom
+ .setText(DateFormat.getDateFormat(getActivity()).format(modificationDateFromValue.getTime()));
}
modificationDateFrom.setOnClickListener(new OnClickListener()
{
@@ -384,17 +399,24 @@ private void search()
String description = createDescriptionQuery();
if (statement == null)
{
- AlfrescoNotificationManager.getInstance(getActivity()).showLongToast(
- getActivity().getString(R.string.error_search_fields_empty));
+ AlfrescoNotificationManager.getInstance(getActivity())
+ .showLongToast(getActivity().getString(R.string.error_search_fields_empty));
return;
}
+
+ String label = null;
switch (searchKey)
{
case HistorySearch.TYPE_PERSON:
+ label = AnalyticsManager.LABEL_DOCUMENTS;
UsersFragment.with(getActivity()).keywords(statement).title(description).display();
break;
case HistorySearch.TYPE_FOLDER:
+ label = AnalyticsManager.LABEL_FOLDERS;
+ DocumentFolderSearchFragment.with(getActivity()).query(statement).title(description).display();
+ break;
case HistorySearch.TYPE_DOCUMENT:
+ label = AnalyticsManager.LABEL_DOCUMENTS;
DocumentFolderSearchFragment.with(getActivity()).query(statement).title(description).display();
break;
default:
@@ -403,6 +425,10 @@ private void search()
// Save history or update
HistorySearchManager.createHistorySearch(getActivity(), SessionUtils.getAccount(getActivity()).getId(),
searchKey, 1, description, statement, new Date().getTime());
+
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_SEARCH,
+ AnalyticsManager.ACTION_RUN_ADVANCED, label, 1, false);
+
}
private String createQuery()
@@ -608,15 +634,15 @@ public void onDatePicked(String dateId, GregorianCalendar gregorianCalendar)
{
modificationDateFromValue = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
modificationDateFromValue.setTime(gregorianCalendar.getTime());
- modificationDateFrom.setText(DateFormat.getDateFormat(getActivity()).format(
- modificationDateFromValue.getTime()));
+ modificationDateFrom
+ .setText(DateFormat.getDateFormat(getActivity()).format(modificationDateFromValue.getTime()));
}
else if (DATE_TO.equalsIgnoreCase(dateId))
{
modificationDateToValue = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
modificationDateToValue.setTime(gregorianCalendar.getTime());
- modificationDateTo.setText(DateFormat.getDateFormat(getActivity())
- .format(modificationDateToValue.getTime()));
+ modificationDateTo
+ .setText(DateFormat.getDateFormat(getActivity()).format(modificationDateToValue.getTime()));
}
}
@@ -646,8 +672,8 @@ public MimetypeAdapter(FragmentActivity context)
{
super(context, R.layout.app_header_row, MIMETYPE_GROUPS);
this.vhClassName = SimpleViewHolder.class.getCanonicalName();
- px = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 48, getContext().getResources()
- .getDisplayMetrics());
+ px = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 48,
+ getContext().getResources().getDisplayMetrics());
}
@Override
@@ -679,6 +705,7 @@ public View getDropDownView(int position, View convertView, ViewGroup parent)
private static final List MIMETYPE_GROUPS = new ArrayList(10)
{
private static final long serialVersionUID = 1L;
+
{
add(R.string.mimetype_unknown);
add(R.string.mimetype_documents);
@@ -704,6 +731,7 @@ public static class Builder extends AlfrescoFragmentBuilder
public static final int ICON_ID = R.drawable.ic_search_dark;
public static final int LABEL_ID = R.string.search_advanced;
+
// ///////////////////////////////////////////////////////////////////////////
// CONSTRUCTORS
// ///////////////////////////////////////////////////////////////////////////
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java
index 89fc98c6..31dc2ad7 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java
@@ -42,6 +42,8 @@
import org.alfresco.mobile.android.application.providers.search.HistorySearchManager;
import org.alfresco.mobile.android.application.providers.search.HistorySearchSchema;
import org.alfresco.mobile.android.platform.AlfrescoNotificationManager;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.ui.fragments.BaseCursorGridFragment;
import org.alfresco.mobile.android.ui.utils.UIUtils;
import org.apache.chemistry.opencmis.commons.PropertyIds;
@@ -115,6 +117,8 @@ public SearchFragment()
requiredSession = true;
checkSession = true;
setHasOptionsMenu(true);
+ reportAtCreation = false;
+ screenName = AnalyticsManager.SCREEN_SEARCH_FILES;
}
protected static SearchFragment newInstanceByTemplate(Bundle b)
@@ -395,10 +399,26 @@ private void search(String keywords)
public void search(String keywords, HistorySearch search)
{
+ String label = null;
+ switch (searchKey)
+ {
+ case HistorySearch.TYPE_DOCUMENT:
+ label = AnalyticsManager.LABEL_DOCUMENTS;
+ break;
+ case HistorySearch.TYPE_PERSON:
+ label = AnalyticsManager.LABEL_PEOPLE;
+ break;
+ case HistorySearch.TYPE_SITE:
+ label = AnalyticsManager.LABEL_SITES;
+ break;
+ default:
+ label = AnalyticsManager.LABEL_FOLDERS;
+ break;
+ }
+
// History search so we use the query
if (search != null && search.getAdvanced() == 1)
{
-
switch (searchKey)
{
case HistorySearch.TYPE_PERSON:
@@ -414,6 +434,10 @@ public void search(String keywords, HistorySearch search)
// Update
HistorySearchManager.update(getActivity(), search.getId(), search.getAccountId(), search.getType(),
search.getAdvanced(), search.getDescription(), search.getQuery(), new Date().getTime());
+
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_SEARCH,
+ AnalyticsManager.ACTION_RUN_HISTORY, label, 1, false);
+
return;
}
@@ -452,6 +476,9 @@ public void search(String keywords, HistorySearch search)
HistorySearchManager.update(getActivity(), search.getId(), search.getAccountId(), search.getType(),
search.getAdvanced(), search.getDescription(), search.getQuery(), new Date().getTime());
}
+
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_SEARCH,
+ AnalyticsManager.ACTION_RUN, label, 1, false);
}
// //////////////////////////////////////////////////////////////////////
@@ -505,14 +532,17 @@ private void updateForm(int id)
{
case HistorySearch.TYPE_PERSON:
hintId = R.string.search_person_hint;
+ screenName = AnalyticsManager.SCREEN_SEARCH_USERS;
// iconResId = R.drawable.ic_person_light;
break;
case HistorySearch.TYPE_DOCUMENT:
hintId = R.string.search_form_hint;
+ screenName = AnalyticsManager.SCREEN_SEARCH_FILES;
// iconResId = R.drawable.ic_office;
break;
case HistorySearch.TYPE_FOLDER:
hintId = R.string.search_form_hint;
+ screenName = AnalyticsManager.SCREEN_SEARCH_FOLDERS;
// iconResId = R.drawable.ic_repository_light;
break;
default:
@@ -525,6 +555,8 @@ private void updateForm(int id)
searchForm.setHint(hintId);
searchKey = id;
+ AnalyticsHelper.reportScreen(getActivity(), screenName);
+
// Refresh History
refreshSilently();
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountCredentialsFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountCredentialsFragment.java
index bc2f9876..fb96213c 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountCredentialsFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountCredentialsFragment.java
@@ -32,6 +32,7 @@
import org.alfresco.mobile.android.async.account.CreateAccountRequest;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
import org.alfresco.mobile.android.platform.exception.AlfrescoExceptionHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.utils.AccessibilityUtils;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
import org.alfresco.mobile.android.ui.utils.UIUtils;
@@ -90,6 +91,7 @@ public AccountCredentialsFragment()
super();
eventBusRequired = true;
requiredSession = false;
+ screenName = AnalyticsManager.SCREEN_ACCOUNT_USER;
}
public static AccountCredentialsFragment newInstanceByTemplate(Bundle b)
@@ -314,7 +316,7 @@ public void onAccountCreated(CreateAccountEvent event)
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
if (acc.getIsPaidAccount() && !prefs.getBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, false))
{
- prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).commit();
+ prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).apply();
}
AccountNameFragment.with(getActivity()).accountId(acc.getId()).back(false).display();
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountNameFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountNameFragment.java
index 6c9aca93..03934824 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountNameFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountNameFragment.java
@@ -33,6 +33,7 @@
import org.alfresco.mobile.android.platform.SessionManager;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccountManager;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.utils.BundleUtils;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
import org.alfresco.mobile.android.ui.utils.UIUtils;
@@ -65,6 +66,7 @@ public class AccountNameFragment extends AlfrescoFragment
public AccountNameFragment()
{
super();
+ screenName = AnalyticsManager.SCREEN_ACCOUNT_NAME;
}
public static AccountNameFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountOAuthFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountOAuthFragment.java
index ba04fac8..54d7fa79 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountOAuthFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountOAuthFragment.java
@@ -37,6 +37,7 @@
import org.alfresco.mobile.android.platform.SessionManager;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
import org.alfresco.mobile.android.platform.exception.AlfrescoExceptionHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.ui.oauth.OAuthFragment;
import org.alfresco.mobile.android.ui.oauth.OnOAuthAccessTokenListener;
@@ -55,7 +56,7 @@
import com.squareup.otto.Subscribe;
-public class AccountOAuthFragment extends OAuthFragment
+public class AccountOAuthFragment extends OAuthFragment implements AnalyticsManager.FragmentAnalyzed
{
public static final String TAG = "AccountOAuthFragment";
@@ -241,9 +242,8 @@ public void load(OAuthData oauthData)
if (getArguments() != null && getArguments().containsKey(ARGUMENT_ACCOUNT))
{
// TODO Replace by SessionMAnager
- EventBusManager.getInstance().post(
- new RequestSessionEvent((AlfrescoAccount) getArguments().getSerializable(ARGUMENT_ACCOUNT),
- oauthData));
+ EventBusManager.getInstance().post(new RequestSessionEvent(
+ (AlfrescoAccount) getArguments().getSerializable(ARGUMENT_ACCOUNT), oauthData));
}
else
{
@@ -260,15 +260,15 @@ public void load(OAuthData oauthData)
private void retryOAuthAuthentication()
{
reload();
- AlfrescoNotificationManager.getInstance(getActivity()).showLongToast(
- getActivity().getString(R.string.error_general));
+ AlfrescoNotificationManager.getInstance(getActivity())
+ .showLongToast(getActivity().getString(R.string.error_general));
}
private void retryOAuthAuthentication(Exception e)
{
reload();
- AlfrescoNotificationManager.getInstance(getActivity()).showLongToast(
- getString(AlfrescoExceptionHelper.getMessageId(getActivity(), e)));
+ AlfrescoNotificationManager.getInstance(getActivity())
+ .showLongToast(getString(AlfrescoExceptionHelper.getMessageId(getActivity(), e)));
}
// ///////////////////////////////////////////////////////////////////////////
@@ -292,13 +292,25 @@ public void onAccountCreated(CreateAccountEvent event)
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
if (acc.getIsPaidAccount() && !prefs.getBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, false))
{
- prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).commit();
+ prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).apply();
}
AccountNameFragment.with(getActivity()).accountId(acc.getId()).back(false).display();
return;
}
}
+ @Override
+ public String getScreenName()
+ {
+ return AnalyticsManager.SCREEN_ACCOUNT_OAUTH;
+ }
+
+ @Override
+ public boolean reportAtCreationEnable()
+ {
+ return true;
+ }
+
// ///////////////////////////////////////////////////////////////////////////
// BUILDER
// ///////////////////////////////////////////////////////////////////////////
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountOptionalFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountOptionalFragment.java
index b5e86abb..52285aa2 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountOptionalFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountOptionalFragment.java
@@ -99,7 +99,7 @@ public void onClick(View v)
DataProtectionManager.getInstance(getActivity()).encrypt(SessionUtils.getAccount(getActivity()));
}
- prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).commit();
+ prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).apply();
AccountNameFragment.with(getActivity()).accountId(accountId).back(false).display();
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountServerFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountServerFragment.java
index 19407b0d..03d7aad0 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountServerFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountServerFragment.java
@@ -32,6 +32,7 @@
import org.alfresco.mobile.android.async.account.CheckServerEvent;
import org.alfresco.mobile.android.async.account.CheckServerRequest;
import org.alfresco.mobile.android.platform.exception.AlfrescoExceptionHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
import org.alfresco.mobile.android.ui.utils.UIUtils;
@@ -72,6 +73,7 @@ public AccountServerFragment()
super();
requiredSession = false;
eventBusRequired = true;
+ screenName = AnalyticsManager.SCREEN_ACCOUNT_SERVER;
}
public static AccountServerFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountSignInFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountSignInFragment.java
index f80745d8..c34c80b6 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountSignInFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountSignInFragment.java
@@ -32,6 +32,7 @@
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccountManager;
import org.alfresco.mobile.android.platform.exception.AlfrescoExceptionHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.mdm.MDMManager;
import org.alfresco.mobile.android.platform.utils.AccessibilityUtils;
import org.alfresco.mobile.android.platform.utils.SessionUtils;
@@ -93,6 +94,7 @@ public AccountSignInFragment()
{
requiredSession = false;
checkSession = false;
+ screenName = AnalyticsManager.SCREEN_ACCOUNT_SIGNIN;
}
protected static AccountSignInFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/WelcomeFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/WelcomeFragment.java
index 8ff25c9f..34493db3 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/WelcomeFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/WelcomeFragment.java
@@ -27,6 +27,7 @@
import org.alfresco.mobile.android.application.activity.WelcomeActivity;
import org.alfresco.mobile.android.application.fragments.FragmentDisplayer;
import org.alfresco.mobile.android.application.fragments.builder.AlfrescoFragmentBuilder;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.intent.AlfrescoIntentAPI;
import org.alfresco.mobile.android.platform.mdm.MDMEvent;
import org.alfresco.mobile.android.platform.mdm.MDMManager;
@@ -66,6 +67,7 @@ public WelcomeFragment()
{
super();
requiredSession = false;
+ screenName = AnalyticsManager.SCREEN_ACCOUNT_TYPE;
}
public static WelcomeFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/site/browser/BrowserSitesPagerFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/site/browser/BrowserSitesPagerFragment.java
index 725c3685..21a0cfd8 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/site/browser/BrowserSitesPagerFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/site/browser/BrowserSitesPagerFragment.java
@@ -26,6 +26,8 @@
import org.alfresco.mobile.android.application.configuration.model.view.SiteBrowserConfigModel;
import org.alfresco.mobile.android.application.fragments.builder.ListingFragmentBuilder;
import org.alfresco.mobile.android.application.fragments.site.search.SearchSitesFragment;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.utils.SessionUtils;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
import org.alfresco.mobile.android.ui.site.SitesTemplate;
@@ -51,6 +53,7 @@ public class BrowserSitesPagerFragment extends AlfrescoFragment
// //////////////////////////////////////////////////////////////////////
public BrowserSitesPagerFragment()
{
+ reportAtCreation = false;
}
protected static BrowserSitesPagerFragment newInstanceByTemplate(Bundle b)
@@ -74,6 +77,8 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
SitesPagerAdapter adapter = new SitesPagerAdapter(getChildFragmentManager(), getActivity(),
getSession() instanceof CloudSession);
viewPager.setAdapter(adapter);
+ viewPager.addOnPageChangeListener(pageChangeListener);
+ pageChangeListener.onPageSelected(SitesPagerAdapter.TAB_MY_SITES);
viewPager.setCurrentItem(SitesPagerAdapter.TAB_MY_SITES);
PagerSlidingTabStrip tabs = (PagerSlidingTabStrip) v.findViewById(R.id.tabs);
@@ -94,6 +99,43 @@ public String onPrepareTitle()
return title;
}
+ ViewPager.OnPageChangeListener pageChangeListener = new ViewPager.OnPageChangeListener()
+ {
+ @Override
+ public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels)
+ {
+
+ }
+
+ @Override
+ public void onPageSelected(int position)
+ {
+ if (AnalyticsManager.getInstance(getActivity()) != null)
+ {
+ switch (position)
+ {
+ case SitesPagerAdapter.TAB_FAV_SITES:
+ screenName = AnalyticsManager.SCREEN_SITES_FAVORITES;
+ break;
+ case SitesPagerAdapter.TAB_MY_SITES:
+ screenName = AnalyticsManager.SCREEN_SITES_MY;
+ break;
+ default:
+ screenName = (getSession() instanceof CloudSession) ? AnalyticsManager.SCREEN_SITES_ALL
+ : AnalyticsManager.SCREEN_SITES_SEARCH;
+ break;
+ }
+ AnalyticsHelper.reportScreen(getActivity(), screenName);
+ }
+ }
+
+ @Override
+ public void onPageScrollStateChanged(int state)
+ {
+
+ }
+ };
+
// ///////////////////////////////////////////////////////////////////////////
// BUILDER
// ///////////////////////////////////////////////////////////////////////////
@@ -159,18 +201,20 @@ public SitesPagerAdapter(FragmentManager fm, FragmentActivity activity, boolean
public Fragment getItem(int position)
{
SitesFragment.Builder builder = SitesFragment.with(activity.get());
+ Fragment fr;
switch (position)
{
case TAB_FAV_SITES:
- builder.favorite(true);
+ fr = builder.favorite(true).createFragment();
break;
case TAB_MY_SITES:
- builder.favorite(false);
+ fr = builder.favorite(false).createFragment();
break;
default:
- return (isCloud) ? builder.createFragment() : SearchSitesFragment.with(activity.get()).createFragment();
+ fr = (isCloud) ? builder.createFragment() : SearchSitesFragment.with(activity.get()).createFragment();
+ break;
}
- return builder.createFragment();
+ return fr;
}
@Override
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/site/browser/SitesFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/site/browser/SitesFragment.java
index 0cf816c9..4c63f13e 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/site/browser/SitesFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/site/browser/SitesFragment.java
@@ -66,6 +66,7 @@ public SitesFragment()
super();
retrieveDataOnCreation = true;
loadState = LOAD_VISIBLE;
+ reportAtCreation = false;
}
public static SitesFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/site/request/JoinSiteRequestsFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/site/request/JoinSiteRequestsFragment.java
index 2e692ef7..fde7ee46 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/site/request/JoinSiteRequestsFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/site/request/JoinSiteRequestsFragment.java
@@ -26,6 +26,7 @@
import org.alfresco.mobile.android.async.site.member.CancelPendingMembershipEvent;
import org.alfresco.mobile.android.async.site.member.SitesPendingMembershipEvent;
import org.alfresco.mobile.android.platform.AlfrescoNotificationManager;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.utils.SessionUtils;
import org.alfresco.mobile.android.ui.site.SitesPendingMembershipFoundationFragment;
@@ -54,6 +55,7 @@ public class JoinSiteRequestsFragment extends SitesPendingMembershipFoundationFr
public JoinSiteRequestsFragment()
{
emptyListMessageId = R.string.empty_joinsiterequest;
+ screenName = AnalyticsManager.SCREEN_SITES_PENDING_REQUEST;
}
public static JoinSiteRequestsFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/site/search/SearchSitesFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/site/search/SearchSitesFragment.java
index e163ed7c..11ef41ca 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/site/search/SearchSitesFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/site/search/SearchSitesFragment.java
@@ -89,6 +89,7 @@ public SearchSitesFragment()
super();
retrieveDataOnCreation = false;
loadState = LOAD_VISIBLE;
+ reportAtCreation = false;
}
public static SearchSitesFragment newInstanceByTemplate(Bundle b)
@@ -322,6 +323,7 @@ public void setSearchValue(String searchValue)
}
}
+
// ///////////////////////////////////////////////////////////////////////////
// EVENTS
// ///////////////////////////////////////////////////////////////////////////
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/sync/SyncFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/sync/SyncFragment.java
index 99382665..2d99388e 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/sync/SyncFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/sync/SyncFragment.java
@@ -45,6 +45,7 @@
import org.alfresco.mobile.android.async.node.update.UpdateNodeEvent;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccountManager;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.provider.CursorUtils;
import org.alfresco.mobile.android.platform.provider.MapUtil;
import org.alfresco.mobile.android.platform.security.DataProtectionManager;
@@ -134,6 +135,7 @@ public SyncFragment()
checkSession = false;
setHasOptionsMenu(true);
displayAsList = true;
+ screenName = AnalyticsManager.SCREEN_SYNCED_CONTENT;
}
protected static SyncFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/user/UserProfileFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/user/UserProfileFragment.java
index 66077ec8..ab7504b9 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/user/UserProfileFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/user/UserProfileFragment.java
@@ -32,6 +32,8 @@
import org.alfresco.mobile.android.platform.SessionManager;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccountManager;
import org.alfresco.mobile.android.platform.exception.CloudExceptionUtils;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.utils.AccessibilityUtils;
import org.alfresco.mobile.android.platform.utils.SessionUtils;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
@@ -91,6 +93,7 @@ public class UserProfileFragment extends AlfrescoFragment implements OnMenuItemC
// //////////////////////////////////////////////////////////////////////
public UserProfileFragment()
{
+ screenName = AnalyticsManager.PREFIX_USER.concat(AnalyticsManager.SCREEN_USER_DETAILS);
}
protected static UserProfileFragment newInstanceByTemplate(Bundle b)
@@ -114,7 +117,10 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
if (getArguments() != null)
{
userName = getArguments().getString(ARGUMENT_USERNAME);
- accountId = getArguments().getLong(ARGUMENT_ACCOUNTID);
+ if (getArguments().containsKey(ARGUMENT_ACCOUNTID))
+ {
+ accountId = getArguments().getLong(ARGUMENT_ACCOUNTID);
+ }
}
session = SessionUtils.getSession(getActivity());
@@ -151,8 +157,17 @@ public void onActivityCreated(Bundle savedInstanceState)
hide(R.id.profile_details);
show(R.id.progressbar);
- Operator.with(getActivity(), AlfrescoAccountManager.getInstance(getActivity()).retrieveAccount(accountId))
- .load(new PersonRequest.Builder(userName).setAccountId(accountId));
+ if (accountId == null)
+ {
+ Operator.with(getActivity(), getAccount())
+ .load(new PersonRequest.Builder(userName).setAccountId(getAccount().getId()));
+ }
+ else
+ {
+ Operator.with(getActivity(), AlfrescoAccountManager.getInstance(getActivity()).retrieveAccount(accountId))
+ .load(new PersonRequest.Builder(userName).setAccountId(accountId));
+ }
+
}
@Override
@@ -232,8 +247,8 @@ private void getMenu(Menu menu, int mode)
if (person.getCompany() != null && person.getCompany().getTelephoneNumber() != null
&& !person.getCompany().getTelephoneNumber().isEmpty())
{
- mi = menu.add(Menu.NONE, R.id.menu_user_company_phone, Menu.FIRST + 5, person.getCompany()
- .getTelephoneNumber());
+ mi = menu.add(Menu.NONE, R.id.menu_user_company_phone, Menu.FIRST + 5,
+ person.getCompany().getTelephoneNumber());
mi.setIcon(R.drawable.ic_call);
mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
}
@@ -262,8 +277,8 @@ private void getMenu(Menu menu, int mode)
if (person.getCompany() != null && person.getCompany().getEmail() != null
&& !person.getCompany().getEmail().isEmpty())
{
- mi = menu.add(Menu.NONE, R.id.menu_user_company_email, Menu.FIRST + 4, person.getCompany()
- .getEmail());
+ mi = menu.add(Menu.NONE, R.id.menu_user_company_email, Menu.FIRST + 4,
+ person.getCompany().getEmail());
mi.setIcon(R.drawable.ic_send_mail);
mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
}
@@ -279,44 +294,68 @@ private void getMenu(Menu menu, int mode)
public boolean onMenuItemClick(MenuItem item)
{
boolean onMenuItemClick = true;
+ String actionName = null, actionLabel = null;
switch (item.getItemId())
{
case R.id.menu_user_chat:
onMenuItemClick = true;
actionSkype(getActivity(), ACTION_CHAT, person.getSkypeId());
+ actionName = AnalyticsManager.ACTION_SKYPE;
+ actionLabel = AnalyticsManager.LABEL_CHAT;
break;
case R.id.menu_user_call:
actionSkype(getActivity(), ACTION_CALL, person.getSkypeId());
onMenuItemClick = true;
+ actionName = AnalyticsManager.ACTION_SKYPE;
+ actionLabel = AnalyticsManager.LABEL_CALL;
break;
case R.id.menu_user_videocall:
actionSkype(getActivity(), ACTION_VIDEO_CALL, person.getSkypeId());
onMenuItemClick = true;
+ actionName = AnalyticsManager.ACTION_SKYPE;
+ actionLabel = AnalyticsManager.LABEL_VIDEOCALL;
break;
case R.id.menu_user_email:
actionEmail(getActivity(), person.getEmail(), null, null);
onMenuItemClick = true;
+ actionName = AnalyticsManager.ACTION_EMAIL;
+ actionLabel = AnalyticsManager.LABEL_USER;
break;
case R.id.menu_user_company_email:
actionEmail(getActivity(), person.getCompany().getEmail(), null, null);
onMenuItemClick = true;
+ actionName = AnalyticsManager.ACTION_EMAIL;
+ actionLabel = AnalyticsManager.LABEL_COMPANY;
break;
case R.id.menu_user_company_phone:
actionCall(getActivity(), person.getCompany().getTelephoneNumber());
onMenuItemClick = true;
+ actionName = AnalyticsManager.ACTION_CALL;
+ actionLabel = AnalyticsManager.LABEL_COMPANY;
break;
case R.id.menu_user_phone:
actionCall(getActivity(), person.getTelephoneNumber());
onMenuItemClick = true;
+ actionName = AnalyticsManager.ACTION_CALL;
+ actionLabel = AnalyticsManager.LABEL_PHONE;
break;
case R.id.menu_user_mobile:
actionCall(getActivity(), person.getMobileNumber());
onMenuItemClick = true;
+ actionName = AnalyticsManager.ACTION_CALL;
+ actionLabel = AnalyticsManager.LABEL_MOBILE;
break;
default:
onMenuItemClick = false;
break;
}
+
+ if (onMenuItemClick)
+ {
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_USER, actionName, actionLabel,
+ 1, false);
+ }
+
return onMenuItemClick;
}
@@ -515,8 +554,8 @@ public void onClick(View v)
@Override
public void onClick(View v)
{
- actionGeolocalisation(getActivity(), person.getCompany().getFullAddress(), person.getCompany()
- .getName());
+ actionGeolocalisation(getActivity(), person.getCompany().getFullAddress(),
+ person.getCompany().getName());
}
});
}
@@ -664,6 +703,9 @@ else if (member.getInstantMessageId() != null && member.getInstantMessageId().le
}
activity.startActivity(Intent.createChooser(intent, activity.getString(R.string.contact_add)));
+
+ AnalyticsHelper.reportOperationEvent(activity, AnalyticsManager.CATEGORY_USER,
+ AnalyticsManager.ACTION_ADD_CONTACT, AnalyticsManager.LABEL_CONTACT, 1, false);
}
catch (ActivityNotFoundException e)
{
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/user/UsersFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/user/UsersFragment.java
index 3c9511c3..b5f9a7b1 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/user/UsersFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/user/UsersFragment.java
@@ -29,6 +29,8 @@
import org.alfresco.mobile.android.application.fragments.builder.ListingFragmentBuilder;
import org.alfresco.mobile.android.application.managers.ConfigManager;
import org.alfresco.mobile.android.async.person.PersonsEvent;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.ui.person.PeopleFragment;
import android.os.Bundle;
@@ -56,6 +58,7 @@ public class UsersFragment extends PeopleFragment
public UsersFragment()
{
emptyListMessageId = R.string.person_not_found;
+ reportAtCreation = false;
}
public static UsersFragment newInstanceByTemplate(Bundle b)
@@ -66,6 +69,21 @@ public static UsersFragment newInstanceByTemplate(Bundle b)
return cbf;
}
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ if (keywords != null)
+ {
+ screenName = AnalyticsManager.SCREEN_SEARCH_RESULT_USERS;
+ }
+ else if (siteShortName != null)
+ {
+ screenName = AnalyticsManager.SCREEN_SITES_MEMBERS;
+ }
+ AnalyticsHelper.reportScreen(getActivity(), screenName);
+ }
+
// ///////////////////////////////////////////////////////////////////////////
// LIST ACTIONS
// ///////////////////////////////////////////////////////////////////////////
@@ -136,7 +154,8 @@ public void onListItemClick(GridView l, View v, int position, long id)
else
{
// Show properties
- UserProfileFragment.with(getActivity()).personId(item.getIdentifier()).display();
+ UserProfileFragment.with(getActivity()).accountId(getAccount().getId()).personId(item.getIdentifier())
+ .display();
}
}
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/CreateTaskFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/CreateTaskFragment.java
index c27aaac7..18a6e43b 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/CreateTaskFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/CreateTaskFragment.java
@@ -46,6 +46,7 @@
import org.alfresco.mobile.android.async.Operator;
import org.alfresco.mobile.android.async.workflow.process.start.StartProcessEvent;
import org.alfresco.mobile.android.async.workflow.process.start.StartProcessRequest;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.intent.PrivateIntent;
import org.alfresco.mobile.android.platform.mimetype.MimeTypeManager;
import org.alfresco.mobile.android.ui.ListingModeFragment;
@@ -122,6 +123,7 @@ public class CreateTaskFragment extends AlfrescoFragment
// ///////////////////////////////////////////////////////////////////////////
public CreateTaskFragment()
{
+ screenName = AnalyticsManager.SCREEN_TASK_CREATE_FORM;
}
public static CreateTaskFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/CreateTaskTypePickerFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/CreateTaskTypePickerFragment.java
index da9ee1a1..2b6df117 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/CreateTaskTypePickerFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/CreateTaskTypePickerFragment.java
@@ -1,20 +1,20 @@
-/*******************************************************************************
- * Copyright (C) 2005-2014 Alfresco Software Limited.
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
*
- * This file is part of Alfresco Mobile for Android.
+ * This file is part of Alfresco Mobile for Android.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *******************************************************************************/
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.alfresco.mobile.android.application.fragments.workflow;
import java.util.ArrayList;
@@ -29,6 +29,7 @@
import org.alfresco.mobile.android.async.workflow.process.ProcessDefinitionsEvent;
import org.alfresco.mobile.android.async.workflow.process.ProcessDefinitionsRequest;
import org.alfresco.mobile.android.platform.exception.CloudExceptionUtils;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.intent.PrivateIntent;
import org.alfresco.mobile.android.platform.utils.SessionUtils;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
@@ -67,6 +68,7 @@ public class CreateTaskTypePickerFragment extends AlfrescoFragment
// ///////////////////////////////////////////////////////////////////////////
public CreateTaskTypePickerFragment()
{
+ screenName = AnalyticsManager.SCREEN_TASK_CREATE_TYPE;
}
public static CreateTaskTypePickerFragment newInstance(List docs)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/process/ProcessTasksFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/process/ProcessTasksFragment.java
index f7d1a210..18c53544 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/process/ProcessTasksFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/process/ProcessTasksFragment.java
@@ -28,6 +28,7 @@
import org.alfresco.mobile.android.async.OperationRequest.OperationBuilder;
import org.alfresco.mobile.android.async.workflow.task.TasksEvent;
import org.alfresco.mobile.android.async.workflow.task.TasksRequest;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.ui.fragments.BaseGridFragment;
import android.os.Bundle;
@@ -59,6 +60,7 @@ public ProcessTasksFragment()
emptyListMessageId = R.string.empty_tasks;
retrieveDataOnCreation = true;
checkSession = true;
+ screenName = AnalyticsManager.SCREEN_TASKS_HISTORY;
}
protected static ProcessTasksFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TaskDetailsFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TaskDetailsFragment.java
index 677653ea..c2ebcba2 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TaskDetailsFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TaskDetailsFragment.java
@@ -56,6 +56,7 @@
import org.alfresco.mobile.android.async.workflow.task.delegate.ReassignTaskEvent;
import org.alfresco.mobile.android.async.workflow.task.delegate.ReassignTaskRequest;
import org.alfresco.mobile.android.platform.exception.CloudExceptionUtils;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.mimetype.MimeTypeManager;
import org.alfresco.mobile.android.platform.utils.SessionUtils;
import org.alfresco.mobile.android.ui.ListingModeFragment;
@@ -125,6 +126,7 @@ public class TaskDetailsFragment extends AlfrescoFragment implements UserPickerC
public TaskDetailsFragment()
{
setHasOptionsMenu(true);
+ screenName = AnalyticsManager.SCREEN_TASK_DETAILS;
}
protected static TaskDetailsFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TaskFilterFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TaskFilterFragment.java
index 962d4fcb..d6603826 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TaskFilterFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TaskFilterFragment.java
@@ -24,6 +24,7 @@
import org.alfresco.mobile.android.api.model.ListingFilter;
import org.alfresco.mobile.android.application.R;
import org.alfresco.mobile.android.application.fragments.builder.AlfrescoFragmentBuilder;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.utils.SessionUtils;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
import org.alfresco.mobile.android.ui.utils.UIUtils;
@@ -50,6 +51,11 @@ public class TaskFilterFragment extends AlfrescoFragment
// ///////////////////////////////////////////////////////////////////////////
// CONSTRUCTORS
// ///////////////////////////////////////////////////////////////////////////
+ public TaskFilterFragment()
+ {
+ screenName = AnalyticsManager.SCREEN_TASKS_FILTER;
+ }
+
protected static TaskFilterFragment newInstanceByTemplate(Bundle b)
{
TaskFilterFragment cbf = new TaskFilterFragment();
@@ -78,7 +84,8 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
expandableList.setOnChildClickListener(new OnChildClickListener()
{
@Override
- public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id)
+ public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition,
+ long id)
{
expListAdapter.select(v, groupPosition, childPosition);
return false;
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TasksFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TasksFragment.java
index 169a9838..a7823617 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TasksFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TasksFragment.java
@@ -32,6 +32,7 @@
import org.alfresco.mobile.android.async.workflow.task.TasksEvent;
import org.alfresco.mobile.android.async.workflow.task.complete.CompleteTaskEvent;
import org.alfresco.mobile.android.async.workflow.task.delegate.ReassignTaskEvent;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.intent.PrivateIntent;
import org.alfresco.mobile.android.platform.utils.BundleUtils;
import org.alfresco.mobile.android.ui.activity.AlfrescoActivity;
@@ -72,6 +73,7 @@ public TasksFragment()
emptyListMessageId = R.string.empty_tasks;
loadState = LOAD_VISIBLE;
setHasOptionsMenu(true);
+ screenName = AnalyticsManager.SCREEN_TASKS_LISTING;
}
public static TasksFragment newInstanceByTemplate(Bundle b)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TasksHelper.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TasksHelper.java
index e124287e..b35b383c 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TasksHelper.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TasksHelper.java
@@ -104,7 +104,7 @@ public boolean onNavigationItemSelected(int itemPosition, long itemId)
if (isProcessFragment)
{
- prefs.edit().putInt(TASK_FILTER_DEFAULT, itemPosition).commit();
+ prefs.edit().putInt(TASK_FILTER_DEFAULT, itemPosition).apply();
f.addFilter(PublicAPIWorkflowServiceImpl.INCLUDE_VARIABLES, "true");
ListingContext lc = new ListingContext();
@@ -116,7 +116,7 @@ public boolean onNavigationItemSelected(int itemPosition, long itemId)
ListingContext lc = new ListingContext();
lc.setFilter(f);
TasksFragment.with(activity).menuId(itemPosition).setListingContext(lc).display();
- prefs.edit().putInt(TASK_FILTER_DEFAULT, itemPosition).commit();
+ prefs.edit().putInt(TASK_FILTER_DEFAULT, itemPosition).apply();
}
return true;
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ConfigManager.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ConfigManager.java
index f712defa..2c3f4044 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ConfigManager.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ConfigManager.java
@@ -1,20 +1,20 @@
-/*******************************************************************************
- * Copyright (C) 2005-2014 Alfresco Software Limited.
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
*
- * This file is part of Alfresco Mobile for Android.
+ * This file is part of Alfresco Mobile for Android.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *******************************************************************************/
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.alfresco.mobile.android.application.managers;
import java.io.File;
@@ -274,6 +274,9 @@ public ConfigService getConfig(long accountId, ConfigTypeIds id)
case REPOSITORY:
service = (service.getRepositoryConfig() != null) ? service : null;
break;
+ case FEATURES:
+ service = (service.getFeatureConfig() != null) ? service : null;
+ break;
default:
break;
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/extensions/AnalyticHelper.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/extensions/AnalyticHelper.java
new file mode 100644
index 00000000..7dae079b
--- /dev/null
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/extensions/AnalyticHelper.java
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.alfresco.mobile.android.application.managers.extensions;
+
+import java.util.List;
+
+import org.alfresco.mobile.android.api.model.config.ProfileConfig;
+import org.alfresco.mobile.android.api.session.AlfrescoSession;
+import org.alfresco.mobile.android.application.fragments.preferences.PasscodePreferences;
+import org.alfresco.mobile.android.application.managers.ConfigManager;
+import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
+import org.alfresco.mobile.android.platform.accounts.AlfrescoAccountManager;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
+import org.alfresco.mobile.android.platform.security.DataProtectionManager;
+import org.alfresco.mobile.android.sync.SyncContentManager;
+import org.alfresco.mobile.android.ui.activity.AlfrescoActivity;
+
+import android.app.Activity;
+import android.content.Context;
+import android.util.Log;
+import android.util.SparseArray;
+
+/**
+ * Created by jpascal on 29/01/2016.
+ */
+public class AnalyticHelper extends AnalyticsHelper
+{
+
+ public static void optIn(Activity activity, AlfrescoAccount account)
+ {
+ AnalyticsManager.getInstance(activity).optIn(activity, account);
+ AnalyticsManager.getInstance(activity).startReport(activity);
+ try
+ {
+ analyzeSession(activity, ((AlfrescoActivity) activity).getCurrentAccount(),
+ ((AlfrescoActivity) activity).getCurrentSession());
+ }
+ catch (Exception e)
+ {
+
+ }
+ AnalyticsManager.getInstance(activity).reportEvent(AnalyticsManager.CATEGORY_SETTINGS,
+ AnalyticsManager.ACTION_ANALYTICS, AnalyticsManager.LABEL_ENABLE, 1);
+ }
+
+ public static void optOut(Activity activity, AlfrescoAccount account)
+ {
+ AnalyticsManager.getInstance(activity).reportEvent(AnalyticsManager.CATEGORY_SETTINGS,
+ AnalyticsManager.ACTION_ANALYTICS, AnalyticsManager.LABEL_DISABLE, 1);
+ AnalyticsManager.getInstance(activity).optOut(activity, account);
+ }
+
+ public static void cleanOpt(Activity activity, AlfrescoAccount account)
+ {
+ if (AnalyticsManager.getInstance(activity) == null) { return; }
+ AnalyticsManager.getInstance(activity).cleanOptInfo(activity, account);
+ }
+
+ public static void analyzeSession(Context context, AlfrescoAccount account, AlfrescoSession repoSession)
+ {
+ if (repoSession == null || account == null) { return; }
+ if (AnalyticsManager.getInstance(context) == null
+ || !AnalyticsManager.getInstance(context).isEnable()) { return; }
+ try
+ {
+ SparseArray customDimensions = new SparseArray<>();
+ SparseArray customMetrics = new SparseArray<>();
+
+ // Accounts Info
+ List accounts = AlfrescoAccountManager.retrieveAccounts(context);
+ customMetrics.append(AnalyticsManager.INDEX_ACCOUNT_NUMBER, (long) accounts.size());
+ customDimensions.append(AnalyticsManager.INDEX_ACCOUNT_COUNT, getAccountLabel(accounts.size()));
+
+ // Settings Info
+ boolean dataProtectionEnable = DataProtectionManager.getInstance(context).hasDataProtectionEnable();
+ boolean passcodeEnable = PasscodePreferences.hasPasscodeEnable(context);
+ Boolean syncWifiEnable = SyncContentManager.getInstance(context).hasWifiOnlySync(account);
+ customMetrics.append(AnalyticsManager.INDEX_PASSCODE, passcodeEnable ? 1L : 0L);
+ customMetrics.append(AnalyticsManager.INDEX_DATA_PROTECTION, dataProtectionEnable ? 1L : 0L);
+ customMetrics.append(AnalyticsManager.INDEX_SYNC_CELLULAR, syncWifiEnable ? 0L : 1L);
+
+ // Server Info
+ customMetrics.append(AnalyticsManager.INDEX_SESSION_CREATION, 1L);
+ SparseArray customInfo = retrieveSessionInfo(repoSession);
+ for (int i = 0; i < customInfo.size(); i++)
+ {
+ int key = customInfo.keyAt(i);
+ customDimensions.append(key, customInfo.get(key));
+ }
+
+ // Sync Info
+ SparseArray syncInfo = retrieveSyncInfo(context, account);
+ for (int i = 0; i < syncInfo.size(); i++)
+ {
+ int key = syncInfo.keyAt(i);
+ if (key == AnalyticsManager.INDEX_SYNCED_FILES)
+ {
+ customDimensions.append(AnalyticsManager.INDEX_SYNC_FILE_COUNT,
+ getSyncFileLabel(syncInfo.get(key)));
+ }
+ customMetrics.append(key, syncInfo.get(key));
+ }
+
+ // Download Info
+ customMetrics.append(AnalyticsManager.INDEX_LOCAL_FILES, getDownloadedFilesCount(context, account));
+
+ // Profiles
+ customMetrics.append(AnalyticsManager.INDEX_PROFILES, getProfilesCount(context, account));
+
+ AnalyticsManager.getInstance(context).reportInfo(AnalyticsManager.ACTION_INFO, customDimensions,
+ customMetrics);
+ }
+ catch (Exception e)
+ {
+ // Do Nothing
+ }
+ }
+
+ protected static Long getProfilesCount(Context context, AlfrescoAccount account)
+ {
+ int size = 0;
+ try
+ {
+ if (ConfigManager.getInstance(context) != null
+ && ConfigManager.getInstance(context).hasConfig(account.getId()))
+ {
+ List profileListing = ConfigManager.getInstance(context).getConfig(account.getId())
+ .getProfiles();
+ size = profileListing.size();
+ }
+
+ }
+ catch (Exception e)
+ {
+ Log.d("Analytics Profiles", Log.getStackTraceString(e));
+ }
+ return (long) size;
+ }
+
+ protected static String getAccountLabel(int value)
+ {
+ String label = AnalyticsManager.INDEX_ACCOUNT_COUNT_1;
+ switch (value)
+ {
+ case 1:
+ return AnalyticsManager.INDEX_ACCOUNT_COUNT_1;
+ case 2:
+ return AnalyticsManager.INDEX_ACCOUNT_COUNT_2;
+ case 3:
+ return AnalyticsManager.INDEX_ACCOUNT_COUNT_3;
+ case 4:
+ return AnalyticsManager.INDEX_ACCOUNT_COUNT_4;
+ case 5:
+ return AnalyticsManager.INDEX_ACCOUNT_COUNT_5;
+ }
+ return label;
+ }
+
+ protected static String getSyncFileLabel(long value)
+ {
+ if (value <= 0)
+ {
+ return AnalyticsManager.INDEX_SYNC_FILE_COUNT_0;
+ }
+ else if (value <= 1)
+ {
+ return AnalyticsManager.INDEX_SYNC_FILE_COUNT_1;
+ }
+ else if (value <= 5)
+ {
+ return AnalyticsManager.INDEX_SYNC_FILE_COUNT_5;
+ }
+ else if (value <= 10)
+ {
+ return AnalyticsManager.INDEX_SYNC_FILE_COUNT_10;
+ }
+ else if (value <= 20)
+ {
+ return AnalyticsManager.INDEX_SYNC_FILE_COUNT_20;
+ }
+ else if (value <= 50)
+ {
+ return AnalyticsManager.INDEX_SYNC_FILE_COUNT_50;
+ }
+ else if (value <= 100)
+ {
+ return AnalyticsManager.INDEX_SYNC_FILE_COUNT_100;
+ }
+ else if (value <= 250)
+ {
+ return AnalyticsManager.INDEX_SYNC_FILE_COUNT_250;
+ }
+ else if (value <= 500)
+ {
+ return AnalyticsManager.INDEX_SYNC_FILE_COUNT_500;
+ }
+ else if (value <= 1000)
+ {
+ return AnalyticsManager.INDEX_SYNC_FILE_COUNT_1000;
+ }
+ else
+ {
+ return AnalyticsManager.INDEX_SYNC_FILE_COUNT_1001;
+ }
+ }
+
+}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/upgrade/UpgradeManager.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/upgrade/UpgradeManager.java
index 61ef5e04..21a505a7 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/upgrade/UpgradeManager.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/upgrade/UpgradeManager.java
@@ -1,20 +1,20 @@
-/*******************************************************************************
- * Copyright (C) 2005-2014 Alfresco Software Limited.
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
*
- * This file is part of Alfresco Mobile for Android.
+ * This file is part of Alfresco Mobile for Android.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *******************************************************************************/
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.alfresco.mobile.android.application.managers.upgrade;
import java.io.File;
@@ -98,7 +98,7 @@ private void checkVersionCode()
else
{
// Save status
- prefs.edit().putInt(VERSION_NUMBER, currentVersionNumber).commit();
+ prefs.edit().putInt(VERSION_NUMBER, currentVersionNumber).apply();
}
}
catch (NameNotFoundException e)
@@ -117,7 +117,7 @@ private void upgrade()
upgradeVersion110();
// Upgrade done. Save current state.
- prefs.edit().putInt(VERSION_NUMBER, currentVersionNumber).commit();
+ prefs.edit().putInt(VERSION_NUMBER, currentVersionNumber).apply();
versionNumber = currentVersionNumber;
canUpgrade = false;
}
@@ -155,12 +155,12 @@ private void upgradeVersion110()
{
UpgradeVersion110.transferFilesBackground(oldDownloads.getPath(), newDownloads.getPath(),
AlfrescoStorageManager.DIRECTORY_DOWNLOAD, true, true);
- prefs.edit().putBoolean(UPGRADE_MIGRATION_FILES, true).commit();
+ prefs.edit().putBoolean(UPGRADE_MIGRATION_FILES, true).apply();
}
}
else
{
- prefs.edit().putBoolean(UPGRADE_MIGRATION_FILES, true).commit();
+ prefs.edit().putBoolean(UPGRADE_MIGRATION_FILES, true).apply();
}
}
Log.i(TAG, "[upgradeVersion110] : Completed");
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/providers/storage/StorageAccessDocumentsProvider.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/providers/storage/StorageAccessDocumentsProvider.java
index 5fdcc702..6e7cf750 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/providers/storage/StorageAccessDocumentsProvider.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/providers/storage/StorageAccessDocumentsProvider.java
@@ -58,6 +58,8 @@
import org.alfresco.mobile.android.platform.SessionManager;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccountManager;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.io.AlfrescoStorageManager;
import org.alfresco.mobile.android.platform.mimetype.MimeTypeManager;
import org.alfresco.mobile.android.platform.provider.AlfrescoContentProvider;
@@ -446,6 +448,13 @@ public ParcelFileDescriptor openDocument(String documentId, String mode, Cancell
}
Log.d(TAG, "Create Sync File Descriptor : " + downloadedFile.getPath());
+
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(getContext(), AnalyticsManager.CATEGORY_DOC_PROVIDER,
+ AnalyticsManager.ACTION_OPEN,
+ MimeTypeManager.getInstance(getContext()).getMIMEType(downloadedFile.getName()), 1,
+ false);
+
// Document available locally
return createSyncFileDescriptor(nodeRefId, isWrite, downloadedFile, accessMode);
}
@@ -520,6 +529,14 @@ public ParcelFileDescriptor openDocument(String documentId, String mode, Cancell
if (cUri.type == PREFIX_SYNC && downloadedFile != null && downloadedFile.exists())
{
Log.d(TAG, "Doc synced : " + downloadedFile.getPath() + " - Mode " + mode);
+
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(getContext(), AnalyticsManager.CATEGORY_DOC_PROVIDER,
+ AnalyticsManager.ACTION_OPEN,
+ currentNode.isDocument() ? ((org.alfresco.mobile.android.api.model.Document) currentNode)
+ .getContentStreamMimeType() : AnalyticsManager.TYPE_FOLDER,
+ 1, false);
+
// Document available locally
return createFileDescriptor((org.alfresco.mobile.android.api.model.Document) currentNode, isWrite,
downloadedFile, accessMode);
@@ -529,6 +546,14 @@ public ParcelFileDescriptor openDocument(String documentId, String mode, Cancell
if (downloadedFile != null && downloadedFile.exists())
{
Log.d(TAG, "Doc in cache : " + downloadedFile.getPath() + " - Mode " + mode);
+
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(getContext(), AnalyticsManager.CATEGORY_DOC_PROVIDER,
+ AnalyticsManager.ACTION_OPEN,
+ currentNode.isDocument() ? ((org.alfresco.mobile.android.api.model.Document) currentNode)
+ .getContentStreamMimeType() : AnalyticsManager.TYPE_FOLDER,
+ 1, false);
+
// Document available locally
return createFileDescriptor((org.alfresco.mobile.android.api.model.Document) currentNode, isWrite,
downloadedFile, accessMode);
@@ -564,6 +589,13 @@ public ParcelFileDescriptor openDocument(String documentId, String mode, Cancell
if (downloadedFile.exists())
{
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(getContext(), AnalyticsManager.CATEGORY_DOC_PROVIDER,
+ AnalyticsManager.ACTION_OPEN,
+ currentNode.isDocument() ? ((org.alfresco.mobile.android.api.model.Document) currentNode)
+ .getContentStreamMimeType() : AnalyticsManager.TYPE_FOLDER,
+ 1, false);
+
// Document available locally
return createFileDescriptor((org.alfresco.mobile.android.api.model.Document) currentNode, isWrite,
downloadedFile, accessMode);
@@ -785,6 +817,10 @@ else if (pathIndex.containsKey(cUri.id))
try
{
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(getContext(), AnalyticsManager.CATEGORY_DOC_PROVIDER,
+ AnalyticsManager.ACTION_CREATE, mimeType, 1, false);
+
// Flag to detect loading in progress
Boolean active = mLoadingUris.get(cUri);
@@ -861,6 +897,14 @@ protected Void doInBackground(Void... params)
checkSession(cUri);
Node currentNode = retrieveNode(cUri.id);
session.getServiceRegistry().getDocumentFolderService().deleteNode(currentNode);
+
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(getContext(), AnalyticsManager.CATEGORY_DOC_PROVIDER,
+ AnalyticsManager.ACTION_DELETE,
+ currentNode.isDocument() ? ((org.alfresco.mobile.android.api.model.Document) currentNode)
+ .getContentStreamMimeType() : AnalyticsManager.TYPE_FOLDER,
+ 1, false);
+
return null;
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/security/DataCleaner.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/security/DataCleaner.java
index 1091e68f..95681118 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/security/DataCleaner.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/security/DataCleaner.java
@@ -61,15 +61,15 @@ protected Boolean doInBackground(String... params)
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(activityRef.get());
Editor editor = sharedPref.edit();
editor.clear();
- editor.commit();
+ editor.apply();
SharedPreferences settings = activityRef.get().getSharedPreferences(AccountsPreferences.ACCOUNT_PREFS, 0);
editor = settings.edit();
editor.clear();
- editor.commit();
+ editor.apply();
SharedPreferences prefs = activityRef.get().getSharedPreferences(FileExplorerHelper.FILEEXPLORER_PREFS, 0);
editor = prefs.edit();
editor.clear();
- editor.commit();
+ editor.apply();
// Remove All Accounts
List accounts = AlfrescoAccountManager.getInstance(activityRef.get()).getAndroidAccounts();
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/security/DataProtectionUserDialogFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/security/DataProtectionUserDialogFragment.java
index 3446a5a4..fa41b3ab 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/security/DataProtectionUserDialogFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/security/DataProtectionUserDialogFragment.java
@@ -150,7 +150,7 @@ public void onPositive()
if (firstTime)
{
DataProtectionManager.getInstance(getActivity()).setDataProtectionUserRequested(true);
- prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).commit();
+ prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).apply();
localMessageId = R.string.encryption_title;
}
else
@@ -197,7 +197,7 @@ public void onNegative()
if (firstTime)
{
DataProtectionManager.getInstance(getActivity()).setDataProtectionUserRequested(true);
- prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).commit();
+ prefs.edit().putBoolean(GeneralPreferences.HAS_ACCESSED_PAID_SERVICES, true).apply();
}
}
};
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/security/PassCodeDialogFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/security/PassCodeDialogFragment.java
index 001e3ef5..01e94c86 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/security/PassCodeDialogFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/security/PassCodeDialogFragment.java
@@ -299,7 +299,7 @@ private void validate()
Editor editor = sharedPref.edit();
editor.putLong(KEY_PASSCODE_ACTIVATED_AT, -1);
editor.remove(KEY_PASSCODE_ATTEMPT);
- editor.commit();
+ editor.apply();
getActivity().setResult(FragmentActivity.RESULT_OK);
getActivity().finish();
}
@@ -340,7 +340,7 @@ else if (needConfirmation && getUserPassCode(true) != null)
editor.putBoolean(KEY_PASSCODE_ENABLE, true);
editor.remove(KEY_PASSCODE_ATTEMPT);
editor.putString(KEY_PASSCODE_VALUE, getUserPassCode(true));
- editor.commit();
+ editor.apply();
dismiss();
errorMessage.setVisibility(View.INVISIBLE);
if (getActivity().getSupportFragmentManager().findFragmentByTag(PasscodePreferences.TAG) != null)
@@ -369,7 +369,7 @@ private void delete()
editor.putBoolean(KEY_PASSCODE_ENABLE, false);
editor.remove(KEY_PASSCODE_ATTEMPT);
editor.remove(KEY_PASSCODE_VALUE);
- editor.commit();
+ editor.apply();
dismiss();
errorMessage.setVisibility(View.INVISIBLE);
if (getActivity().getSupportFragmentManager().findFragmentByTag(PasscodePreferences.TAG) != null)
@@ -441,7 +441,7 @@ private void checkAttempts()
Editor editor = sharedPref.edit();
editor.putInt(KEY_PASSCODE_ATTEMPT, attempts + 1);
- editor.commit();
+ editor.apply();
}
private String getUserPassCode(boolean needConfirmation)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/widgets/ActionShortcutActivity.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/widgets/ActionShortcutActivity.java
index eb178533..d37ca06f 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/widgets/ActionShortcutActivity.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/widgets/ActionShortcutActivity.java
@@ -1,20 +1,20 @@
-/*******************************************************************************
- * Copyright (C) 2005-2014 Alfresco Software Limited.
- *
- * This file is part of Alfresco Mobile for Android.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.alfresco.mobile.android.application.widgets;
import org.alfresco.mobile.android.api.model.Folder;
@@ -25,6 +25,8 @@
import org.alfresco.mobile.android.async.session.LoadSessionCallBack.LoadAccountCompletedEvent;
import org.alfresco.mobile.android.async.session.RequestSessionEvent;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.intent.AlfrescoIntentAPI;
import android.content.Intent;
@@ -61,20 +63,24 @@ private void createShortcut(AlfrescoAccount uploadAccount, Folder folder, Site s
{
// Intent associated to the shortcut
Intent actionIntent = null;
+ String label = null;
int iconId = R.drawable.widget_doc;
switch (actionId)
{
case R.string.action_text:
actionIntent = PublicIntentAPIUtils.createTextIntent();
iconId = R.drawable.widget_doc;
+ label = AnalyticsManager.LABEL_CREATE_TEXT;
break;
case R.string.action_speech2text:
actionIntent = PublicIntentAPIUtils.speechToTextIntent();
iconId = R.drawable.widget_mic;
+ label = AnalyticsManager.LABEL_SPEECH_2_TEXT;
break;
case R.string.action_photo:
actionIntent = PublicIntentAPIUtils.captureImageIntent();
iconId = R.drawable.widget_photo;
+ label = AnalyticsManager.LABEL_TAKE_PHOTO;
break;
default:
break;
@@ -89,6 +95,11 @@ private void createShortcut(AlfrescoAccount uploadAccount, Folder folder, Site s
shortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,
Intent.ShortcutIconResource.fromContext(this, iconId));
setResult(RESULT_OK, shortcutIntent);
+
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(this, AnalyticsManager.CATEGORY_WIDGET, AnalyticsManager.ACTION_CREATE,
+ label, 1, false);
+
finish();
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/widgets/FolderShortcutActivity.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/widgets/FolderShortcutActivity.java
index 0946b7c8..921a83e5 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/widgets/FolderShortcutActivity.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/widgets/FolderShortcutActivity.java
@@ -1,20 +1,20 @@
-/*******************************************************************************
- * Copyright (C) 2005-2014 Alfresco Software Limited.
- *
- * This file is part of Alfresco Mobile for Android.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.alfresco.mobile.android.application.widgets;
import java.io.File;
@@ -26,6 +26,8 @@
import org.alfresco.mobile.android.async.session.LoadSessionCallBack.LoadAccountCompletedEvent;
import org.alfresco.mobile.android.async.session.RequestSessionEvent;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import android.content.Intent;
import android.view.View;
@@ -65,6 +67,11 @@ private void createShortcut(String shortcutName, Intent shortcutIntent)
addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,
Intent.ShortcutIconResource.fromContext(this, R.drawable.widget_folder));
setResult(RESULT_OK, addIntent);
+
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(this, AnalyticsManager.CATEGORY_WIDGET, AnalyticsManager.ACTION_SHORTCUT,
+ AnalyticsManager.LABEL_FOLDERS, 1, false);
+
finish();
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/widgets/ToolbarWidgetProvider.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/widgets/ToolbarWidgetProvider.java
index 015ceb93..3333145c 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/widgets/ToolbarWidgetProvider.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/widgets/ToolbarWidgetProvider.java
@@ -1,26 +1,28 @@
-/*******************************************************************************
- * Copyright (C) 2005-2014 Alfresco Software Limited.
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
*
- * This file is part of Alfresco Mobile for Android.
+ * This file is part of Alfresco Mobile for Android.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *******************************************************************************/
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.alfresco.mobile.android.application.widgets;
import org.alfresco.mobile.android.application.R;
import org.alfresco.mobile.android.application.activity.MainActivity;
import org.alfresco.mobile.android.application.intent.PublicIntentAPIUtils;
import org.alfresco.mobile.android.application.managers.ActionUtils;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
@@ -96,18 +98,30 @@ private PendingIntent createAlfrescoIntent(Context context)
private PendingIntent createSpeechTextEditorIntent(Context context)
{
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(context, AnalyticsManager.CATEGORY_WIDGET, AnalyticsManager.ACTION_TOOLBAR,
+ AnalyticsManager.LABEL_SPEECH_2_TEXT, 1, false);
+
return PendingIntent.getActivity(context, 1, PublicIntentAPIUtils.speechToTextIntent(),
PendingIntent.FLAG_UPDATE_CURRENT);
}
private PendingIntent createTextEditorIntent(Context context)
{
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(context, AnalyticsManager.CATEGORY_WIDGET, AnalyticsManager.ACTION_TOOLBAR,
+ AnalyticsManager.LABEL_CREATE_TEXT, 1, false);
+
return PendingIntent.getActivity(context, 0, PublicIntentAPIUtils.createTextIntent(),
PendingIntent.FLAG_UPDATE_CURRENT);
}
private PendingIntent createPhotoCaptureIntent(Context context)
{
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(context, AnalyticsManager.CATEGORY_WIDGET, AnalyticsManager.ACTION_TOOLBAR,
+ AnalyticsManager.LABEL_TAKE_PHOTO, 1, false);
+
return PendingIntent.getActivity(context, 2, PublicIntentAPIUtils.captureImageIntent(),
PendingIntent.FLAG_UPDATE_CURRENT);
}
diff --git a/alfresco-mobile-android/src/main/res/layout/fr_settings.xml b/alfresco-mobile-android/src/main/res/layout/fr_settings.xml
index a480c1fb..4f6b40ac 100644
--- a/alfresco-mobile-android/src/main/res/layout/fr_settings.xml
+++ b/alfresco-mobile-android/src/main/res/layout/fr_settings.xml
@@ -144,37 +144,39 @@
android:layout_height="1dip"
android:background="?android:attr/dividerVertical" />
-
+
@@ -185,40 +187,6 @@
android:layout_marginLeft="@dimen/d_8"
android:layout_marginRight="@dimen/d_8"
android:background="?android:attr/dividerVertical" />
-
-
-
-
-
-
-
-
-
-
-
-
- Select which tabs are available on your menu.MenuYour Alfresco Administrator has disabled this feature.
+ Feedback
+ Send Diagnostics
+ To help us improve Alfresco Mobile, we collect anonymous technical diagnostic data. Switch off if preferred.
diff --git a/build.gradle b/build.gradle
index 683d0652..14295a9a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,3 +1,21 @@
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
buildscript {
repositories {
jcenter()
@@ -5,6 +23,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
+ classpath 'com.google.gms:google-services:1.5.0'
}
}
diff --git a/extensions/analytics/.gitignore b/extensions/analytics/.gitignore
new file mode 100644
index 00000000..796b96d1
--- /dev/null
+++ b/extensions/analytics/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/extensions/analytics/build.gradle b/extensions/analytics/build.gradle
new file mode 100644
index 00000000..1d93ca83
--- /dev/null
+++ b/extensions/analytics/build.gradle
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+apply plugin: 'com.android.library'
+apply plugin: 'com.google.gms.google-services'
+
+android {
+ compileSdkVersion 23
+ buildToolsVersion "23.0.2"
+
+ defaultConfig {
+ minSdkVersion 15
+ targetSdkVersion 23
+ versionCode 1
+ versionName "1.0"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile 'com.google.android.gms:play-services-analytics:8.3.0'
+ compile project(':platform:foundation')
+}
diff --git a/extensions/analytics/google-services.json b/extensions/analytics/google-services.json
new file mode 100644
index 00000000..2a78c3c1
--- /dev/null
+++ b/extensions/analytics/google-services.json
@@ -0,0 +1,45 @@
+{
+ "project_info": {
+ "project_id": "alfresco-mobile",
+ "project_number": "1053450300169",
+ "name": "Alfresco Mobile"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:1053450300169:android:4c82694870595779",
+ "client_id": "android:org.alfresco.mobile.android.application",
+ "client_type": 1,
+ "android_client_info": {
+ "package_name": "org.alfresco.mobile.android.application"
+ }
+ },
+ "oauth_client": [],
+ "api_key": [],
+ "services": {
+ "analytics_service": {
+ "status": 2,
+ "analytics_property": {
+ "tracking_id": "UA-70658012-1"
+ }
+ },
+ "cloud_messaging_service": {
+ "status": 1,
+ "apns_config": []
+ },
+ "appinvite_service": {
+ "status": 1,
+ "other_platform_oauth_client": []
+ },
+ "google_signin_service": {
+ "status": 1
+ },
+ "ads_service": {
+ "status": 1
+ }
+ }
+ }
+ ],
+ "client_info": [],
+ "ARTIFACT_VERSION": "1"
+}
\ No newline at end of file
diff --git a/extensions/analytics/proguard-rules.pro b/extensions/analytics/proguard-rules.pro
new file mode 100644
index 00000000..1977d222
--- /dev/null
+++ b/extensions/analytics/proguard-rules.pro
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in W:/Tools/AndroidSDK/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/extensions/analytics/src/main/AndroidManifest.xml b/extensions/analytics/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..0850ba81
--- /dev/null
+++ b/extensions/analytics/src/main/AndroidManifest.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/extensions/analytics/src/main/java/org/alfresco/mobile/android/application/extension/analytics/GAnalyticsManagerImpl.java b/extensions/analytics/src/main/java/org/alfresco/mobile/android/application/extension/analytics/GAnalyticsManagerImpl.java
new file mode 100644
index 00000000..66fbcd43
--- /dev/null
+++ b/extensions/analytics/src/main/java/org/alfresco/mobile/android/application/extension/analytics/GAnalyticsManagerImpl.java
@@ -0,0 +1,265 @@
+/*
+ * Copyright (C) 2005-2015 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.alfresco.mobile.android.application.extension.analytics;
+
+import java.util.List;
+
+import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
+import org.alfresco.mobile.android.platform.accounts.AlfrescoAccountManager;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.preference.PreferenceManager;
+import android.util.SparseArray;
+
+import com.google.android.gms.analytics.GoogleAnalytics;
+import com.google.android.gms.analytics.HitBuilders;
+import com.google.android.gms.analytics.Tracker;
+
+public class GAnalyticsManagerImpl extends AnalyticsManager
+{
+ private Tracker mTracker;
+
+ private GoogleAnalytics analytics;
+
+ private boolean hasOptOut = false;
+
+ private static final boolean DISPATCH_MANUALLY = true;
+
+ protected SharedPreferences.Editor editor;
+
+ protected Integer status = null;
+
+ // ///////////////////////////////////////////////////////////////////////////
+ // CONSTRUCTOR
+ // ///////////////////////////////////////////////////////////////////////////
+ public static GAnalyticsManagerImpl getInstance(Context context)
+ {
+ synchronized (LOCK)
+ {
+ if (mInstance == null)
+ {
+ mInstance = new GAnalyticsManagerImpl(context);
+ }
+
+ return (GAnalyticsManagerImpl) mInstance;
+ }
+ }
+
+ protected GAnalyticsManagerImpl(Context context)
+ {
+ super(context);
+ analytics = GoogleAnalytics.getInstance(context);
+ mTracker = analytics.newTracker(context.getString(R.string.ga_trackId));
+ }
+
+ // ///////////////////////////////////////////////////////////////////////////
+ // O
+ // ///////////////////////////////////////////////////////////////////////////
+ public void optOut(Activity activity, AlfrescoAccount account)
+ {
+ opt(activity, STATUS_DISABLE, account);
+ status = getStatus();
+ }
+
+ public void optOutByConfig(Context context, AlfrescoAccount account)
+ {
+ editor = PreferenceManager.getDefaultSharedPreferences(context).edit();
+ editor.putInt(ANALYTICS_PREFIX + account.getId(), STATUS_BLOCKED).apply();
+ status = getStatus();
+ }
+
+ public void optInByConfig(Context context, AlfrescoAccount account)
+ {
+ editor = PreferenceManager.getDefaultSharedPreferences(context).edit();
+ editor.putInt(ANALYTICS_PREFIX + account.getId(), STATUS_ENABLE).apply();
+ status = getStatus();
+ }
+
+ public void optIn(Activity activity, AlfrescoAccount account)
+ {
+ opt(activity, STATUS_ENABLE, account);
+ status = getStatus();
+ }
+
+ public void cleanOptInfo(Context context, AlfrescoAccount account)
+ {
+ if (editor == null)
+ {
+ editor = PreferenceManager.getDefaultSharedPreferences(context).edit();
+ }
+ if (account != null)
+ {
+ editor.remove(ANALYTICS_PREFIX + account.getId());
+ editor.apply();
+ }
+ status = getStatus();
+ }
+
+ private void opt(Context context, int value, AlfrescoAccount account)
+ {
+ if (editor == null)
+ {
+ editor = PreferenceManager.getDefaultSharedPreferences(context).edit();
+ }
+ if (account != null)
+ {
+ editor.putInt(ANALYTICS_PREFIX + account.getId(), value);
+ editor.apply();
+ }
+ }
+
+ public boolean isEnable()
+ {
+ if (status == null)
+ {
+ getStatus();
+ }
+ return status == STATUS_ENABLE;
+ }
+
+ public boolean isEnable(AlfrescoAccount account)
+ {
+ SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(appContext);
+ int tempStatus = sharedPref.getInt(ANALYTICS_PREFIX + account.getId(), STATUS_ENABLE);
+ return tempStatus == STATUS_ENABLE;
+ }
+
+ public boolean isBlocked()
+ {
+ if (status == null)
+ {
+ getStatus();
+ }
+ return status == STATUS_BLOCKED;
+ }
+
+ public int getStatus()
+ {
+ SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(appContext);
+ List accounts = AlfrescoAccountManager.retrieveAccounts(appContext);
+ int tempStatus = STATUS_ENABLE;
+ Integer resultStatus = null;
+ for (AlfrescoAccount account : accounts)
+ {
+ tempStatus = sharedPref.getInt(ANALYTICS_PREFIX + account.getId(), STATUS_ENABLE);
+ switch (tempStatus)
+ {
+ case STATUS_BLOCKED:
+ resultStatus = STATUS_BLOCKED;
+ break;
+ case STATUS_DISABLE:
+ resultStatus = STATUS_DISABLE;
+ break;
+ default:
+ continue;
+ }
+ }
+ status = resultStatus != null ? resultStatus : STATUS_ENABLE;
+ return status;
+ }
+
+ // ///////////////////////////////////////////////////////////////////////////
+ // REPORT
+ // ///////////////////////////////////////////////////////////////////////////
+ public void startReport(Activity activity)
+ {
+ analytics.enableAutoActivityReports(activity.getApplication());
+ mTracker.send(new HitBuilders.ScreenViewBuilder().setNewSession().build());
+ }
+
+ public void reportScreen(String name)
+ {
+ mTracker.setScreenName(name);
+ mTracker.send(new HitBuilders.ScreenViewBuilder().build());
+ if (DISPATCH_MANUALLY)
+ {
+ analytics.dispatchLocalHits();
+ }
+ }
+
+ public void reportEvent(String category, String action, String label, int value)
+ {
+ mTracker.send(new HitBuilders.EventBuilder().setCategory(category).setAction(action).setLabel(label)
+ .setValue(value).build());
+ if (DISPATCH_MANUALLY)
+ {
+ analytics.dispatchLocalHits();
+ }
+ }
+
+ public void reportEvent(String category, String action, String label, int value, int customMetricId,
+ Long customMetricValue)
+ {
+ mTracker.send(new HitBuilders.EventBuilder().setCategory(category).setAction(action).setLabel(label)
+ .setValue(value).setCustomMetric(customMetricId, customMetricValue).build());
+ if (DISPATCH_MANUALLY)
+ {
+ analytics.dispatchLocalHits();
+ }
+ }
+
+ public void reportInfo(String label, SparseArray dimensions, SparseArray metrics)
+ {
+ reportEvent(CATEGORY_SESSION, ACTION_INFO, label, 1, dimensions, metrics);
+ }
+
+ public void reportEvent(String category, String action, String label, int eventValue,
+ SparseArray dimensions, SparseArray metrics)
+ {
+ HitBuilders.EventBuilder builder = new HitBuilders.EventBuilder().setCategory(category).setAction(action)
+ .setLabel(label).setValue(eventValue);
+
+ if (dimensions != null)
+ {
+ for (int i = 0; i < dimensions.size(); i++)
+ {
+ int dimensionId = dimensions.keyAt(i);
+ String value = dimensions.get(dimensionId);
+ builder.setCustomDimension(dimensionId, value);
+ }
+ }
+
+ if (metrics != null)
+ {
+ for (int i = 0; i < metrics.size(); i++)
+ {
+ int dimensionId = metrics.keyAt(i);
+ Long value = metrics.get(dimensionId);
+ builder.setCustomMetric(dimensionId, value);
+ }
+ }
+
+ mTracker.send(builder.build());
+ if (DISPATCH_MANUALLY)
+ {
+ analytics.dispatchLocalHits();
+ }
+ }
+
+ public void reportError(boolean isFatal, String description)
+ {
+ mTracker.send(new HitBuilders.ExceptionBuilder().setFatal(isFatal).setDescription(description).build());
+ if (DISPATCH_MANUALLY)
+ {
+ analytics.dispatchLocalHits();
+ }
+ }
+}
diff --git a/extensions/analytics/src/main/res/values/config_extension.xml b/extensions/analytics/src/main/res/values/config_extension.xml
new file mode 100644
index 00000000..fd32af93
--- /dev/null
+++ b/extensions/analytics/src/main/res/values/config_extension.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ true
+ org.alfresco.mobile.android.application.extension.analytics.GAnalyticsManagerImpl
+
+
\ No newline at end of file
diff --git a/extensions/analytics/src/main/res/values/keys.xml b/extensions/analytics/src/main/res/values/keys.xml
new file mode 100644
index 00000000..2b5bac37
--- /dev/null
+++ b/extensions/analytics/src/main/res/values/keys.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+ TODO
+
+
\ No newline at end of file
diff --git a/extensions/analytics/src/main/res/xml/global_tracker.xml b/extensions/analytics/src/main/res/xml/global_tracker.xml
new file mode 100644
index 00000000..6e493deb
--- /dev/null
+++ b/extensions/analytics/src/main/res/xml/global_tracker.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+ TO REPLACE BY RIGHT ID
+
+
+ 100.0
+ 5
+
+
+ true
+
+
+ true
+
+
+ 1
+
+
+ Main
+
+
\ No newline at end of file
diff --git a/extensions/hockeyapp/build.gradle b/extensions/hockeyapp/build.gradle
index 92c0f5e7..eb66687d 100644
--- a/extensions/hockeyapp/build.gradle
+++ b/extensions/hockeyapp/build.gradle
@@ -1,8 +1,26 @@
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
- buildToolsVersion "23.0.1"
+ buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 15
diff --git a/extensions/samsung/build.gradle b/extensions/samsung/build.gradle
index 3cc75712..bf31067b 100644
--- a/extensions/samsung/build.gradle
+++ b/extensions/samsung/build.gradle
@@ -1,8 +1,26 @@
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
- buildToolsVersion "23.0.1"
+ buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 15
diff --git a/extensions/samsung/src/main/java/org/alfresco/mobile/android/application/extension/samsung/pen/SNoteEditorActivity.java b/extensions/samsung/src/main/java/org/alfresco/mobile/android/application/extension/samsung/pen/SNoteEditorActivity.java
index 761e4a89..390e258b 100644
--- a/extensions/samsung/src/main/java/org/alfresco/mobile/android/application/extension/samsung/pen/SNoteEditorActivity.java
+++ b/extensions/samsung/src/main/java/org/alfresco/mobile/android/application/extension/samsung/pen/SNoteEditorActivity.java
@@ -25,6 +25,8 @@
import org.alfresco.mobile.android.application.extension.samsung.R;
import org.alfresco.mobile.android.application.extension.samsung.utils.SNoteUtils;
import org.alfresco.mobile.android.platform.AlfrescoNotificationManager;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.intent.BaseActionUtils;
import org.alfresco.mobile.android.ui.activity.AlfrescoActivity;
@@ -132,6 +134,8 @@ public class SNoteEditorActivity extends AlfrescoActivity
@Override
public void onCreate(Bundle savedInstanceState)
{
+ AnalyticsHelper.reportScreen(this, AnalyticsManager.SCREEN_SAMSUNG_SNOTE_EDITOR);
+
super.onCreate(savedInstanceState);
setContentView(R.layout.snote_editor);
context = this;
diff --git a/extensions/scansnap/build.gradle b/extensions/scansnap/build.gradle
index 0dca89f8..8262b69a 100644
--- a/extensions/scansnap/build.gradle
+++ b/extensions/scansnap/build.gradle
@@ -1,8 +1,26 @@
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
- buildToolsVersion "23.0.1"
+ buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 15
diff --git a/gradle.properties b/gradle.properties
index e49e6311..67239bc6 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,3 +1,21 @@
+#
+# Copyright (C) 2005-2016 Alfresco Software Limited.
+#
+# This file is part of Alfresco Mobile for Android.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
@@ -21,7 +39,7 @@
## DEFAULT BUILD VARIANT
####################################################################
# Current Version number of the application
-VERSION_NAME=1.6
+VERSION_NAME=1.6.1
# Build Number of the application
# Overrides by Continuous Integration System during build
@@ -53,6 +71,9 @@ ACCOUNT_ID_DEBUG=com.alfresco.account.debug
SYNC_ADAPTER_DEBUG=org.alfresco.mobile.android.provider.debug.sync
FAVORITES_ADAPTER_DEBUG=org.alfresco.mobile.android.provider.debug.favorites
+## Google Analytics Tracker key for Debug version
+TRACKER_ID_DEBUG=TRACK_ID_DEBUG
+
####################################################################
## MAVEN CONSTANTS
####################################################################
@@ -85,4 +106,10 @@ OAUTH_SCOPE=public_api
####################################################################
## HockeyAPP key
## For more information : http://hockeyapp.net/features/
-HOCKEYAPP_KEY=HOCKEYAPP_KEY
\ No newline at end of file
+HOCKEYAPP_KEY=HOCKEYAPP_KEY
+
+####################################################################
+## GOOGLE ANALYTICS
+####################################################################
+## Google Analytics Tracker key
+TRACKER_ID=TRACKER_ID
\ No newline at end of file
diff --git a/mdm/mobileiron/build.gradle b/mdm/mobileiron/build.gradle
index afef3292..6ae6141f 100644
--- a/mdm/mobileiron/build.gradle
+++ b/mdm/mobileiron/build.gradle
@@ -1,8 +1,26 @@
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
- buildToolsVersion "23.0.1"
+ buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 15
diff --git a/platform/foundation/build.gradle b/platform/foundation/build.gradle
index b2be52fd..f87b72a0 100644
--- a/platform/foundation/build.gradle
+++ b/platform/foundation/build.gradle
@@ -20,7 +20,7 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion 23
- buildToolsVersion "23.0.1"
+ buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 15
diff --git a/platform/foundation/src/main/AndroidManifest.xml b/platform/foundation/src/main/AndroidManifest.xml
index e0ff68c6..c3691525 100644
--- a/platform/foundation/src/main/AndroidManifest.xml
+++ b/platform/foundation/src/main/AndroidManifest.xml
@@ -1,3 +1,21 @@
+
+
@@ -10,4 +28,9 @@
+
+
+
+
+
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/accounts/AccountSchema.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/accounts/AccountSchema.java
index c83e6c0c..0cc9d198 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/accounts/AccountSchema.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/accounts/AccountSchema.java
@@ -1,20 +1,20 @@
-/*******************************************************************************
- * Copyright (C) 2005-2014 Alfresco Software Limited.
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
*
- * This file is part of Alfresco Mobile for Android.
+ * This file is part of Alfresco Mobile for Android.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *******************************************************************************/
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.alfresco.mobile.android.accounts;
import java.util.List;
@@ -194,7 +194,7 @@ public static void onUpgrade(Context context, SQLiteDatabase db, int oldVersion,
// settings
syncManager.setActivateSync(account.getId(),
sharedPref.getBoolean(SYNCHRO_PREFIX + account.getId(), false));
- sharedPref.edit().remove(SYNCHRO_PREFIX + account.getId()).commit();
+ sharedPref.edit().remove(SYNCHRO_PREFIX + account.getId()).apply();
}
Log.i("Migration", "Account " + account.getDescription() + "[" + account.getId()
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/ConfigConstants.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/ConfigConstants.java
index 3cbd4f1c..6523567c 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/ConfigConstants.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/ConfigConstants.java
@@ -1,3 +1,21 @@
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.alfresco.mobile.android.api.model.config;
import java.util.ArrayList;
@@ -259,6 +277,9 @@ public interface ConfigConstants
String OUTPUT_VALUE = "outputValue";
+ // FEATURE
+ String ENABLE_VALUE = "enable";
+
// /////////////////////////////////////////////////
// VIEW ENUM
// /////////////////////////////////////////////////
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/ConfigTypeIds.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/ConfigTypeIds.java
index ac97b549..a3541db2 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/ConfigTypeIds.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/ConfigTypeIds.java
@@ -1,20 +1,20 @@
-/*******************************************************************************
- * Copyright (C) 2005-2014 Alfresco Software Limited.
- *
- * This file is part of the Alfresco Mobile SDK.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- ******************************************************************************/
+ */
package org.alfresco.mobile.android.api.model.config;
/**
@@ -29,6 +29,8 @@ public enum ConfigTypeIds
VIEWS("views"),
FORMS("forms"),
CREATION("creation"),
+ FEATURES(
+ "features"),
VIEW_GROUPS("view-groups"),
FIELDS("fields"),
FIELD_GROUPS("field-groups"),
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/FeatureConfig.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/FeatureConfig.java
new file mode 100644
index 00000000..2429fd8a
--- /dev/null
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/FeatureConfig.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.alfresco.mobile.android.api.model.config;
+
+/**
+ * Base type for View Configuration.
+ *
+ * @author Jean Marie Pascal
+ */
+public interface FeatureConfig extends ItemConfig
+{
+ // ///////////////////////////////////////////////////////////////////////////
+ // DEFAULT FEATURE
+ // ///////////////////////////////////////////////////////////////////////////
+ String PREFIX_FEATURE = "org.alfresco.client.feature";
+
+ String FEATURE_ANALYTICS = PREFIX_FEATURE.concat(".analytics");
+
+ boolean isEnable();
+}
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/impl/ConfigurationImpl.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/impl/ConfigurationImpl.java
index 0871dd20..ad3b9107 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/impl/ConfigurationImpl.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/impl/ConfigurationImpl.java
@@ -1,20 +1,20 @@
-/*******************************************************************************
- * Copyright (C) 2005-2014 Alfresco Software Limited.
- *
- * This file is part of the Alfresco Mobile SDK.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- ******************************************************************************/
+ */
package org.alfresco.mobile.android.api.model.config.impl;
import java.io.File;
@@ -33,6 +33,7 @@
import org.alfresco.mobile.android.api.model.config.ConfigScope;
import org.alfresco.mobile.android.api.model.config.ConfigTypeIds;
import org.alfresco.mobile.android.api.model.config.CreationConfig;
+import org.alfresco.mobile.android.api.model.config.FeatureConfig;
import org.alfresco.mobile.android.api.model.config.FormConfig;
import org.alfresco.mobile.android.api.model.config.ProfileConfig;
import org.alfresco.mobile.android.api.model.config.RepositoryConfig;
@@ -55,6 +56,8 @@ public class ConfigurationImpl
private CreationHelper creationHelper;
+ private FeatureHelper featureHelper;
+
private ViewHelper viewHelper;
private FormHelper formHelper;
@@ -97,8 +100,8 @@ public static ConfigurationImpl load(File sourceFile, String sourceAsString, Fil
String filename = ConfigConstants.CONFIG_LOCALIZATION_FILENAME;
if (!Locale.ENGLISH.getLanguage().equals(Locale.getDefault().getLanguage()))
{
- filename = String.format(ConfigConstants.CONFIG_LOCALIZATION_FILENAME_PATTERN, Locale.getDefault()
- .getLanguage());
+ filename = String.format(ConfigConstants.CONFIG_LOCALIZATION_FILENAME_PATTERN,
+ Locale.getDefault().getLanguage());
}
File localizedFile = new File(configFolder, filename);
StringHelper stringConfig = StringHelper.load(localizedFile);
@@ -149,8 +152,8 @@ public static ConfigurationImpl parseJson(AlfrescoSession session, Map getFeatureConfig()
+ {
+ if (featureHelper == null) { return null; }
+ return featureHelper.getFeatures();
+ }
// ///////////////////////////////////////////////////////////////////////////
// INTERNALS
// ///////////////////////////////////////////////////////////////////////////
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/impl/FeatureConfigImpl.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/impl/FeatureConfigImpl.java
new file mode 100644
index 00000000..1fd6e9d3
--- /dev/null
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/impl/FeatureConfigImpl.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.alfresco.mobile.android.api.model.config.impl;
+
+import java.util.Map;
+
+import org.alfresco.mobile.android.api.model.config.ConfigConstants;
+import org.alfresco.mobile.android.api.model.config.FeatureConfig;
+import org.apache.chemistry.opencmis.commons.impl.JSONConverter;
+
+/**
+ * @author Jean Marie Pascal
+ */
+public class FeatureConfigImpl extends ItemConfigImpl implements FeatureConfig
+{
+ private boolean isEnable = false;
+
+ // ///////////////////////////////////////////////////////////////////////////
+ // CONSTRUCTORS
+ // ///////////////////////////////////////////////////////////////////////////
+ FeatureConfigImpl()
+ {
+ super();
+ }
+
+ FeatureConfigImpl(String identifier, String iconIdentifier, String label, String description, String type,
+ Map properties)
+ {
+ super(identifier, iconIdentifier, label, description, type, null, properties);
+ }
+
+ static FeatureConfigImpl parse(Map json, ConfigurationImpl configuration)
+ {
+ ItemConfigData data = new ItemConfigData(JSONConverter.getString(json, ConfigConstants.ID_VALUE), json,
+ configuration);
+ FeatureConfigImpl featureConfig = new FeatureConfigImpl(data.identifier, data.iconIdentifier, data.label,
+ data.description, data.type, data.properties);
+ if (json.containsKey(ConfigConstants.ENABLE_VALUE))
+ {
+ featureConfig.isEnable = JSONConverter.getBoolean(json, ConfigConstants.ENABLE_VALUE);
+ }
+ return featureConfig;
+ }
+
+ // ///////////////////////////////////////////////////////////////////////////
+ // METHODS
+ // ///////////////////////////////////////////////////////////////////////////
+ @Override
+ public boolean isEnable()
+ {
+ return isEnable;
+ }
+}
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/impl/FeatureHelper.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/impl/FeatureHelper.java
new file mode 100644
index 00000000..b60dc4ca
--- /dev/null
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/api/model/config/impl/FeatureHelper.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.alfresco.mobile.android.api.model.config.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.alfresco.mobile.android.api.model.config.FeatureConfig;
+import org.apache.chemistry.opencmis.commons.impl.JSONConverter;
+
+/**
+ * @author Jean Marie Pascal
+ */
+public class FeatureHelper extends HelperConfig
+{
+ private ArrayList featureConfigs;
+
+ // ///////////////////////////////////////////////////////////////////////////
+ // CONSTRUCTORS
+ // ///////////////////////////////////////////////////////////////////////////
+ FeatureHelper(ConfigurationImpl context, StringHelper localHelper)
+ {
+ super(context, localHelper);
+ }
+
+ boolean addFeatureConfig(List
+
Alfresco Mobile stellt eine Verbindung zu Alfresco in the Cloud und zu den lokalen Alfresco Servern (3.4 und höher) her, um unterwegs einen sicheren Zugriff auf Unternehmensinhalte zu ermöglichen.
Alfresco Mobile stellt mithilfe Ihrer Alfresco Anmeldeinformationen eine Verbindung zu Ihrem Alfresco Repository (über HTTP oder HTTPS) her und verwaltet den Benutzerzugriff basierend auf deren Berechtigungen.
]]>
@@ -733,7 +733,7 @@
Synchronisierter InhaltOrdner "Favoriten"Alfresco
- Alfresco Cloud
+ Alfresco in the CloudAlfresco vor Ort
diff --git a/alfresco-mobile-android/src/main/res/values-es/strings.xml b/alfresco-mobile-android/src/main/res/values-es/strings.xml
index 7d641405..7046b066 100644
--- a/alfresco-mobile-android/src/main/res/values-es/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values-es/strings.xml
@@ -52,7 +52,7 @@
Alfresco OneO
- Alfresco Cloud
+ Alfresco in the CloudCuentaAñadir una cuenta
@@ -74,7 +74,7 @@
Verificando información de cuenta de Alfresco…
- Alfresco Cloud
+ Alfresco in the CloudServidor de Alfresco
@@ -173,7 +173,7 @@
SDK:
Alfresco Mobile se conecta a Alfresco en la nube y servidores en instalaciones de Alfresco (3.4 y superior) para proporcionar acceso seguro a su contenido corporativo cuando no esté en la oficina.
+
Alfresco Mobile se conecta a Alfresco in the Cloud y servidores en instalaciones de Alfresco (3.4 y superior) para proporcionar acceso seguro a su contenido corporativo cuando no esté en la oficina.
Alfresco Mobile se conecta a su repositorio de Alfresco usando las credenciales de inicio de sesión de Alfresco (en HTTP o HTTPS) y gestiona el acceso del usuario basado en sus permisos.
]]>
@@ -733,7 +733,7 @@
Contenido sincronizadoCarpeta de favoritosAlfresco
- Alfresco Cloud
+ Alfresco in the CloudAlfresco On Premise
diff --git a/alfresco-mobile-android/src/main/res/values-fr/strings.xml b/alfresco-mobile-android/src/main/res/values-fr/strings.xml
index 32afb9a5..5552c0c9 100644
--- a/alfresco-mobile-android/src/main/res/values-fr/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values-fr/strings.xml
@@ -52,7 +52,7 @@
Alfresco OneOu
- Alfresco Cloud
+ Alfresco in the CloudCompteAjouter un compte
@@ -74,7 +74,7 @@
Vérification des informations du compte Alfresco…
- Alfresco Cloud
+ Alfresco in the CloudServeur Alfresco
@@ -173,7 +173,7 @@
SDK :
Alfresco Mobile se connecte aux serveurs Alfresco dans le Cloud et Alfresco sur site (3.4 et supérieur) pour fournir un accès sécurisé à vos contenus en mode mobile.
+
Alfresco Mobile se connecte aux serveurs Alfresco in the Cloud et Alfresco sur site (3.4 et supérieur) pour fournir un accès sécurisé à vos contenus en mode mobile.
Alfresco Mobile se connecte à votre entrepôt Alfresco au moyen de vos identifiants Alfresco (par HTTP ou HTTPS), et gère les accès des utilisateurs en fonction de leurs autorisations.
]]>
@@ -733,7 +733,7 @@
Contenu synchroniséDossier FavorisAlfresco
- Alfresco Cloud
+ Alfresco in the CloudAlfresco sur site
diff --git a/alfresco-mobile-android/src/main/res/values-it/strings.xml b/alfresco-mobile-android/src/main/res/values-it/strings.xml
index 8fd81d47..790f895d 100644
--- a/alfresco-mobile-android/src/main/res/values-it/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values-it/strings.xml
@@ -52,7 +52,7 @@
Alfresco Oneo
- Alfresco Cloud
+ Alfresco in the CloudAccountAggiungi un account
@@ -74,7 +74,7 @@
Verifica informazioni account Alfresco in corso…
- Alfresco Cloud
+ Alfresco in the CloudServer Alfresco
@@ -173,7 +173,7 @@
SDK:
Alfresco Mobile si connette ad Alfresco Cloud e on premise (v3.4 e successive) per garantire un accesso sicuro ai contenuti aziendali sempre e ovunque.
+
Alfresco Mobile si connette ad Alfresco in the Cloud e on premise (v3.4 e successive) per garantire un accesso sicuro ai contenuti aziendali sempre e ovunque.
Alfresco Mobile si connette al repository Alfresco con le credenziali di accesso ad Alfresco (su HTTP o HTTPS) e gestisce l\'accesso degli utenti in base ai permessi utente.
]]>
@@ -733,7 +733,7 @@
Contenuti sincronizzatiCartella dei preferitiAlfresco
- Alfresco Cloud
+ Alfresco in the CloudAlfresco on premise
diff --git a/alfresco-mobile-android/src/main/res/values-ja/strings.xml b/alfresco-mobile-android/src/main/res/values-ja/strings.xml
index 9647bc81..64bed60b 100644
--- a/alfresco-mobile-android/src/main/res/values-ja/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values-ja/strings.xml
@@ -52,7 +52,7 @@
Alfresco Oneまたは
- Alfresco Cloud
+ Alfresco in the Cloudアカウントアカウントを追加してください
@@ -74,7 +74,7 @@
Alfresco アカウント情報を確認しています…
- Alfresco Cloud
+ Alfresco in the CloudAlfresco Server
@@ -173,7 +173,7 @@
SDK:
Alfresco Mobile は Alfresco Cloud とオンプレミスの Alfresco Server (3.4 以上) に接続して、社内のコンテンツに外出先から安全にアクセスできるようにします。
+
Alfresco Mobile は Alfresco in the Cloud とオンプレミスの Alfresco Server (3.4 以上) に接続して、社内のコンテンツに外出先から安全にアクセスできるようにします。
Alfresco Mobile は、Alfresco のログイン資格情報を使用して (HTTP または HTTPS 経由で) Alfresco のリポジトリに接続し、権限に基づいてユーザーのアクセスを管理します。
]]>
@@ -733,7 +733,7 @@
同期されているコンテンツ[お気に入り] フォルダAlfresco
- Alfresco Cloud
+ Alfresco in the CloudAlfresco On Premise
diff --git a/alfresco-mobile-android/src/main/res/values-zh-rCN/strings.xml b/alfresco-mobile-android/src/main/res/values-zh-rCN/strings.xml
index b73ed1c7..53c3c008 100644
--- a/alfresco-mobile-android/src/main/res/values-zh-rCN/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values-zh-rCN/strings.xml
@@ -52,7 +52,7 @@
Alfresco One或者
- Alfresco Cloud
+ Alfresco in the Cloud帐户添加一个帐户
@@ -74,7 +74,7 @@
正在验证 Alfresco 帐户信息…
- Alfresco Cloud
+ Alfresco in the CloudAlfresco 服务器
@@ -173,7 +173,7 @@
SDK:
Alfresco Mobile 连接至 Alfresco Cloud 和 Alfresco 内部部署服务器(3.4 及以上版本)以便安全访问当前您的企业内容。
+
Alfresco Mobile 连接至 Alfresco in the Cloud 和 Alfresco 内部部署服务器(3.4 及以上版本)以便安全访问当前您的企业内容。
Alfresco Mobile 使用 Alfresco 登录凭证(通过 HTTP 或 HTTPS)与您的 Alfresco 存储库连接,并且根据用户的权限管理用户访问。
]]>
@@ -733,7 +733,7 @@
已同步内容收藏夹文件夹Alfresco
- Alfresco Cloud
+ Alfresco in the CloudAlfresco 内部部署
diff --git a/alfresco-mobile-android/src/main/res/values/strings.xml b/alfresco-mobile-android/src/main/res/values/strings.xml
index 5acb4ab8..9e93e356 100644
--- a/alfresco-mobile-android/src/main/res/values/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values/strings.xml
@@ -52,7 +52,7 @@
Alfresco OneOr
- Alfresco Cloud
+ Alfresco in the CloudAccountAdd an account
@@ -74,7 +74,7 @@
Verifying Alfresco Account Information…
- Alfresco Cloud
+ Alfresco in the CloudAlfresco Server
@@ -173,7 +173,7 @@
SDK:
Alfresco Mobile connects to Alfresco in the cloud and Alfresco on premise servers (3.4 and above) to provide safe access to your corporate content on the go.
+
Alfresco Mobile connects to Alfresco in the Cloud and Alfresco on premise servers (3.4 and above) to provide safe access to your corporate content on the go.
Alfresco Mobile connects to your Alfresco repository using your Alfresco log-in credentials (over HTTP or HTTPS), and manages user access based on their permissions.
]]>
@@ -737,7 +737,7 @@
Synced ContentFavorites FolderAlfresco
- Alfresco Cloud
+ Alfresco in the CloudAlfresco On Premise
diff --git a/platform/foundation/src/main/res/values-de/alfresco_strings.xml b/platform/foundation/src/main/res/values-de/alfresco_strings.xml
index 0ff6e29d..0391e3cb 100644
--- a/platform/foundation/src/main/res/values-de/alfresco_strings.xml
+++ b/platform/foundation/src/main/res/values-de/alfresco_strings.xml
@@ -278,7 +278,7 @@
Überprüfen Sie Ihre Alfresco Account-Einstellungen und versuchen Sie es erneut. Kontaktieren Sie Ihren Administrator, falls das Problem weiterhin besteht.]]>
-Alfresco in der Cloud ist derzeit überlastet!
+Alfresco in the Cloud ist derzeit überlastet!
Bitte versuchen Sie es in einigen Minuten erneut. ]]>
Ihre Sitzung ist abgelaufen. Melden Sie sich erneut an.
@@ -304,7 +304,7 @@
Account-Informationen werden verifiziert…Sie können Ihren Account jetzt verwenden.Alfresco Server
- Alfresco Cloud
+ Alfresco in the CloudBitte warten
diff --git a/platform/foundation/src/main/res/values-es/alfresco_strings.xml b/platform/foundation/src/main/res/values-es/alfresco_strings.xml
index 045ef850..50a04d68 100644
--- a/platform/foundation/src/main/res/values-es/alfresco_strings.xml
+++ b/platform/foundation/src/main/res/values-es/alfresco_strings.xml
@@ -304,7 +304,7 @@
Verificando información de cuenta…Su cuenta está lista para usarse.Servidor de Alfresco
- Alfresco Cloud
+ Alfresco in the CloudEspere
diff --git a/platform/foundation/src/main/res/values-fr/alfresco_strings.xml b/platform/foundation/src/main/res/values-fr/alfresco_strings.xml
index 0aab65b6..f0654235 100644
--- a/platform/foundation/src/main/res/values-fr/alfresco_strings.xml
+++ b/platform/foundation/src/main/res/values-fr/alfresco_strings.xml
@@ -278,7 +278,7 @@
Vérifiez vos paramètres de compte Alfresco et réessayez. Si le problème persiste, contactez votre administrateur.]]>
-Alfresco Cloud est actuellement surchargé !
+Alfresco in the Cloud est actuellement surchargé !
Réessayez dans quelques minutes. ]]>
Votre session a expiré. Veuillez vous reconnecter.
@@ -304,7 +304,7 @@
Vérification des informations du compte…Vous pouvez maintenant utiliser votre compte.Serveur Alfresco
- Alfresco Cloud
+ Alfresco in the CloudVeuillez patienter
diff --git a/platform/foundation/src/main/res/values-it/alfresco_strings.xml b/platform/foundation/src/main/res/values-it/alfresco_strings.xml
index 827a49d9..c6f590e2 100644
--- a/platform/foundation/src/main/res/values-it/alfresco_strings.xml
+++ b/platform/foundation/src/main/res/values-it/alfresco_strings.xml
@@ -278,7 +278,7 @@
Verificare le impostazioni dell\'account Alfresco e riprovare. Se il problema persiste, contattare l\'amministratore.]]>
-Il carico di lavoro di Alfresco Cloud è al momento eccessivo.
+Il carico di lavoro di Alfresco in the Cloud è al momento eccessivo.
Riprovare tra qualche minuto. ]]>
La sessione è scaduta. Ripetere l\'accesso.
@@ -304,7 +304,7 @@
Verifica delle informazioni account in corso…Account pronto per l\'utilizzo.Server Alfresco
- Alfresco Cloud
+ Alfresco in the CloudAttendere
diff --git a/platform/foundation/src/main/res/values-ja/alfresco_strings.xml b/platform/foundation/src/main/res/values-ja/alfresco_strings.xml
index d7959e76..5459db1d 100644
--- a/platform/foundation/src/main/res/values-ja/alfresco_strings.xml
+++ b/platform/foundation/src/main/res/values-ja/alfresco_strings.xml
@@ -278,7 +278,7 @@
Alfresco アカウントの設定を確認してから、もう一度やり直してください。 問題が解決しない場合は、管理者に問い合わせてください。]]>
-Alfresco Cloud は現在大量の処理を行っています。
+Alfresco in the Cloud は現在大量の処理を行っています。
しばらくしてから、操作をやり直してください。 ]]>
セッションの期限が切れています。 もう一度サインインしてください。
@@ -304,7 +304,7 @@
アカウント情報を確認しています…アカウントを使用する準備ができました。Alfresco Server
- Alfresco Cloud
+ Alfresco in the Cloudお待ちください
diff --git a/platform/foundation/src/main/res/values-zh-rCN/alfresco_strings.xml b/platform/foundation/src/main/res/values-zh-rCN/alfresco_strings.xml
index 863bcc26..64888fd3 100644
--- a/platform/foundation/src/main/res/values-zh-rCN/alfresco_strings.xml
+++ b/platform/foundation/src/main/res/values-zh-rCN/alfresco_strings.xml
@@ -278,7 +278,7 @@
请检查您的 Alfresco 帐户设置并重试。 如果问题仍然存在,请联系您的管理员。]]>
-Alfresco Cloud 现在非常繁忙!
+Alfresco in the Cloud 现在非常繁忙!
请过几分钟再试。 ]]>
您的会话已过期。请重新登录。
@@ -304,7 +304,7 @@
正在验证帐户信息…您的帐户已可使用。Alfresco 服务器
- Alfresco Cloud
+ Alfresco in the Cloud请稍候
diff --git a/platform/foundation/src/main/res/values/alfresco_strings.xml b/platform/foundation/src/main/res/values/alfresco_strings.xml
index fb5a2f37..513dcf32 100644
--- a/platform/foundation/src/main/res/values/alfresco_strings.xml
+++ b/platform/foundation/src/main/res/values/alfresco_strings.xml
@@ -305,7 +305,7 @@
Verifying Account Information…Your account is ready for you to use.Alfresco Server
- Alfresco Cloud
+ Alfresco in the CloudPlease wait
From 1e2c1b7aecfcf33e26edb0b761b18e06194ccae2 Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Mon, 15 Feb 2016 10:00:30 +0100
Subject: [PATCH 13/35] ANDROID-207
---
.../src/main/res/layout/app_pick_person.xml | 33 ++++++++++---------
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/alfresco-mobile-android/src/main/res/layout/app_pick_person.xml b/alfresco-mobile-android/src/main/res/layout/app_pick_person.xml
index fd85d4f2..46c8e95e 100644
--- a/alfresco-mobile-android/src/main/res/layout/app_pick_person.xml
+++ b/alfresco-mobile-android/src/main/res/layout/app_pick_person.xml
@@ -1,19 +1,20 @@
+ ~ Copyright (C) 2005-2016 Alfresco Software Limited.
+ ~
+ ~ This file is part of Alfresco Mobile for Android.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
Date: Mon, 15 Feb 2016 10:03:24 +0100
Subject: [PATCH 14/35] ANDROID-238 ANDROID-239
---
.../fragments/preferences/GeneralPreferences.java | 6 +++---
.../mobile/android/application/managers/ActionUtils.java | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/GeneralPreferences.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/GeneralPreferences.java
index ca086f81..2d26e818 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/GeneralPreferences.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/GeneralPreferences.java
@@ -118,8 +118,8 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
// Feedback - Email
vh = HolderUtils.configure(viewById(R.id.settings_feedback_email_container),
- getString(R.string.settings_feedback_email), getString(R.string.settings_feedback_email_summary), -1);
- HolderUtils.makeMultiLine(vh.bottomText, 3);
+ getString(R.string.settings_feedback_email), null, -1);
+ // HolderUtils.makeMultiLine(vh.bottomText, 3);
viewById(R.id.settings_feedback_email_container).setOnClickListener(new View.OnClickListener()
{
@Override
@@ -149,7 +149,7 @@ public void onClick(View v)
diagnosticVH = HolderUtils.configure(viewById(R.id.settings_diagnostic),
getString(R.string.settings_feedback_diagnostic),
getString(R.string.settings_feedback_diagnostic_summary), isEnable);
- HolderUtils.makeMultiLine(diagnosticVH.bottomText, 3);
+ HolderUtils.makeMultiLine(diagnosticVH.bottomText, 4);
diagnosticVH.choose.setOnClickListener(new View.OnClickListener()
{
@Override
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ActionUtils.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ActionUtils.java
index 1701223d..b0c79292 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ActionUtils.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ActionUtils.java
@@ -561,7 +561,7 @@ public static boolean actionSendFeedbackEmail(Fragment fr)
StringBuilder builder = new StringBuilder();
builder.append("\n\n\n\n");
- builder.append("Technical informations\n");
+ builder.append("Alfresco Mobile and device details\n");
builder.append("-------------------\n").toString();
for (Map.Entry entry : info.entrySet())
{
From ac0fed2e64e1c82bd53058df8213024d1148fc14 Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Mon, 15 Feb 2016 11:01:23 +0100
Subject: [PATCH 15/35] ANDROID-238 ANDROID-239
---
.../application/managers/ActionUtils.java | 24 +++++++------------
.../src/main/res/values/strings.xml | 1 -
2 files changed, 8 insertions(+), 17 deletions(-)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ActionUtils.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ActionUtils.java
index b0c79292..0c69df9e 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ActionUtils.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ActionUtils.java
@@ -45,6 +45,7 @@
import android.speech.RecognizerIntent;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
+import android.support.v4.app.ShareCompat;
import android.text.Html;
import android.text.TextUtils;
import android.util.DisplayMetrics;
@@ -528,21 +529,18 @@ public static boolean actionSendFeedbackEmail(Fragment fr)
{
try
{
+ ShareCompat.IntentBuilder iBuilder = ShareCompat.IntentBuilder.from(fr.getActivity());
Context context = fr.getContext();
-
- Intent i = new Intent(Intent.ACTION_SEND);
- i.setType("message/rfc822");
-
// Email
- i.putExtra(Intent.EXTRA_EMAIL, context.getResources()
+ iBuilder.addEmailTo(context.getResources()
.getStringArray(org.alfresco.mobile.android.foundation.R.array.bugreport_email));
// Prepare Subject
String versionName = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
int versionCode = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode;
- String subject = "Android APP %s Feedback";
- i.putExtra(Intent.EXTRA_SUBJECT, String.format(subject, versionName));
+ String subject = "Alfresco Mobile Feedback";
+ iBuilder.setSubject(subject);
// Content
DisplayMetrics dm = context.getResources().getDisplayMetrics();
@@ -569,16 +567,10 @@ public static boolean actionSendFeedbackEmail(Fragment fr)
}
builder.append("-------------------\n\n").toString();
- i.putExtra(Intent.EXTRA_TEXT, builder.toString());
-
- if (i.resolveActivity(fr.getActivity().getPackageManager()) == null)
- {
- AlfrescoNotificationManager.getInstance(fr.getActivity()).showAlertCrouton(fr.getActivity(),
- fr.getString(R.string.error_general));
- return false;
- }
+ iBuilder.setType("message/rfc822");
+ iBuilder.setText(builder.toString());
+ iBuilder.setChooserTitle(fr.getString(R.string.settings_feedback_email)).startChooser();
- fr.startActivity(Intent.createChooser(i, fr.getString(R.string.send_email)));
return true;
}
diff --git a/alfresco-mobile-android/src/main/res/values/strings.xml b/alfresco-mobile-android/src/main/res/values/strings.xml
index 9e93e356..e37b0436 100644
--- a/alfresco-mobile-android/src/main/res/values/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values/strings.xml
@@ -346,7 +346,6 @@
Send DiagnosticsTo help us improve Alfresco Mobile, we collect anonymous technical diagnostic data. Switch off if preferred.Send Feedback
- Send comments and suggestions anytime
From f9f1cdb9b3185d4a7b80cbfe94b4464849058a75 Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Mon, 15 Feb 2016 14:43:43 +0100
Subject: [PATCH 16/35] ANDROID-205
---
.../node/create/CreateDocumentOperation.java | 28 +++++++++++++++----
1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/create/CreateDocumentOperation.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/create/CreateDocumentOperation.java
index 60d64a23..a487a18a 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/create/CreateDocumentOperation.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/create/CreateDocumentOperation.java
@@ -26,14 +26,17 @@
import org.alfresco.mobile.android.async.OperationSchema;
import org.alfresco.mobile.android.async.OperationsDispatcher;
import org.alfresco.mobile.android.async.Operator;
+import org.alfresco.mobile.android.async.UploadRetryService;
import org.alfresco.mobile.android.async.node.UpNodeOperation;
import org.alfresco.mobile.android.platform.EventBusManager;
import org.alfresco.mobile.android.platform.exception.AlfrescoAppException;
+import org.alfresco.mobile.android.platform.exception.AlfrescoOfflineException;
import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.io.IOUtils;
import org.alfresco.mobile.android.platform.security.DataProtectionManager;
import org.alfresco.mobile.android.platform.security.EncryptionUtils;
+import org.alfresco.mobile.android.platform.utils.ConnectivityUtils;
import org.alfresco.mobile.android.sync.SyncContentManager;
import android.content.ContentValues;
@@ -111,7 +114,14 @@ protected LoaderResult doInBackground()
}
else
{
- result.setException(new AlfrescoAppException("ParentFolder is empty"));
+ if (!ConnectivityUtils.hasInternetAvailable(context))
+ {
+ result.setException(new AlfrescoOfflineException("Offline"));
+ }
+ else
+ {
+ result.setException(new AlfrescoAppException("ParentFolder is empty"));
+ }
}
// Encrypt if necessary
@@ -186,15 +196,21 @@ protected void onPostExecute(LoaderResult result)
{
super.onPostExecute(result);
- // Analytics
- AnalyticsHelper.reportOperationEvent(context, AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
- AnalyticsManager.ACTION_CREATE, doc != null ? doc.getContentStreamMimeType() : null, 1,
- result.hasException(), AnalyticsManager.INDEX_SYNCED_SIZE, doc.getContentStreamLength());
-
EventBusManager.getInstance().post(new CreateDocumentEvent(getRequestId(), result, parentFolder));
+ if (result.hasException() && result.getException() instanceof AlfrescoOfflineException)
+ {
+ UploadRetryService.retryDelay(context, getRequestId(), UploadRetryService.DEFAULT_DELAY);
+ }
+
if (((CreateDocumentRequest) request).isCreation)
{
contentFile.getFile().delete();
}
+
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(context, AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
+ AnalyticsManager.ACTION_CREATE, doc != null ? doc.getContentStreamMimeType() : null, 1,
+ result.hasException(), AnalyticsManager.INDEX_SYNCED_SIZE,
+ doc != null ? doc.getContentStreamLength() : -1L);
}
}
From 916b70ae1a2b4399965102f14799b01bea2815d5 Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Mon, 15 Feb 2016 16:58:13 +0100
Subject: [PATCH 17/35] ANDROID-263
---
.../fragments/create/DocumentPropertiesDialogFragment.java | 4 ++++
.../fragments/create/DocumentTypesDialogFragment.java | 2 ++
.../application/fragments/create/EditorsDialogFragment.java | 4 ++++
.../fragments/node/create/CreateDocumentDialogFragment.java | 3 +++
.../fragments/node/create/CreateFolderDialogFragment.java | 3 +++
5 files changed, 16 insertions(+)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/DocumentPropertiesDialogFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/DocumentPropertiesDialogFragment.java
index b6e691ef..62e486fa 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/DocumentPropertiesDialogFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/DocumentPropertiesDialogFragment.java
@@ -32,6 +32,8 @@
import org.alfresco.mobile.android.platform.AlfrescoNotificationManager;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
import org.alfresco.mobile.android.platform.data.DocumentTypeRecord;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.io.AlfrescoStorageManager;
import org.alfresco.mobile.android.ui.utils.UIUtils;
@@ -86,6 +88,8 @@ public static DocumentPropertiesDialogFragment newInstance(Bundle bundle)
// ///////////////////////////////////////////////////////////////////////////
public Dialog onCreateDialog(Bundle savedInstanceState)
{
+ AnalyticsHelper.reportScreen(getActivity(), AnalyticsManager.SCREEN_NODE_CREATE_FORM);
+
final String fragmentTag = (String) getArguments().get(ARGUMENT_FRAGMENT_TAG);
final AlfrescoAccount currentAccount = (AlfrescoAccount) getArguments().get(ARGUMENT_ACCOUNT);
final DocumentTypeRecord documentType = (DocumentTypeRecord) getArguments().get(ARGUMENT_DOCUMENT_TYPE);
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/DocumentTypesDialogFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/DocumentTypesDialogFragment.java
index 8377e5bc..68f5d0dc 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/DocumentTypesDialogFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/DocumentTypesDialogFragment.java
@@ -89,6 +89,8 @@ public static DocumentTypesDialogFragment newInstance(AlfrescoAccount currentAcc
// ///////////////////////////////////////////////////////////////////////////
public Dialog onCreateDialog(Bundle savedInstanceState)
{
+ AnalyticsHelper.reportScreen(getActivity(), AnalyticsManager.SCREEN_NODE_CREATE_TYPE);
+
fileTypes = DocumentTypeRecordHelper.getCreationDocumentTypeList(getActivity());
FileTypeAdapter adapter = new FileTypeAdapter(getActivity(), R.layout.row_single_line, fileTypes);
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/EditorsDialogFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/EditorsDialogFragment.java
index 5b51664b..8db9fe7c 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/EditorsDialogFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/EditorsDialogFragment.java
@@ -29,6 +29,8 @@
import org.alfresco.mobile.android.application.R;
import org.alfresco.mobile.android.application.managers.ActionUtils;
import org.alfresco.mobile.android.platform.data.DocumentTypeRecord;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.ui.fragments.BaseListAdapter;
import org.alfresco.mobile.android.ui.holder.SingleLineViewHolder;
@@ -87,6 +89,8 @@ public static EditorsDialogFragment newInstance(Bundle b)
// ///////////////////////////////////////////////////////////////////////////
public Dialog onCreateDialog(Bundle savedInstanceState)
{
+ AnalyticsHelper.reportScreen(getActivity(), AnalyticsManager.SCREEN_NODE_CREATE_EDITOR);
+
int title = R.string.create_document_editor_title;
LayoutInflater inflater = LayoutInflater.from(getActivity());
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/create/CreateDocumentDialogFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/create/CreateDocumentDialogFragment.java
index e6e5ba1d..d4d35c04 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/create/CreateDocumentDialogFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/create/CreateDocumentDialogFragment.java
@@ -42,6 +42,7 @@
import org.alfresco.mobile.android.async.node.create.CreateDocumentRequest;
import org.alfresco.mobile.android.async.node.create.RetrieveDocumentNameEvent;
import org.alfresco.mobile.android.async.node.create.RetrieveDocumentNameRequest;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.io.AlfrescoStorageManager;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
@@ -135,6 +136,8 @@ public static Bundle createBundle(Folder folder, ContentFile f, Boolean isCreati
@Override
public Dialog onCreateDialog(Bundle savedInstanceState)
{
+ AnalyticsHelper.reportScreen(getActivity(), AnalyticsManager.SCREEN_NODE_CREATE_FORM);
+
return new MaterialDialog.Builder(getActivity()).iconRes(R.drawable.ic_application_logo)
.title(R.string.content_upload).customView(createView(LayoutInflater.from(getActivity()), null), true)
.positiveText(R.string.create).negativeText(R.string.cancel)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/create/CreateFolderDialogFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/create/CreateFolderDialogFragment.java
index c2254163..94f3b92b 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/create/CreateFolderDialogFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/create/CreateFolderDialogFragment.java
@@ -21,6 +21,7 @@
import org.alfresco.mobile.android.application.R;
import org.alfresco.mobile.android.async.Operator;
import org.alfresco.mobile.android.async.node.create.CreateFolderRequest;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.utils.SessionUtils;
import org.alfresco.mobile.android.ui.fragments.AlfrescoFragment;
@@ -72,6 +73,8 @@ public static Bundle createBundle(Folder folder)
@Override
public Dialog onCreateDialog(Bundle savedInstanceState)
{
+ AnalyticsHelper.reportScreen(getActivity(), AnalyticsManager.SCREEN_NODE_CREATE_NAME);
+
MaterialDialog dialog = new MaterialDialog.Builder(getActivity()).iconRes(R.drawable.ic_application_logo)
.title(R.string.folder_create).customView(createView(LayoutInflater.from(getActivity()), null), true)
.positiveText(R.string.create).negativeText(R.string.cancel)
From ec9156b04beaa1263a80b9dc4dcc99920fa77b4d Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Tue, 16 Feb 2016 09:29:00 +0100
Subject: [PATCH 18/35] ANDROID-264
---
.../create/DocumentTypesDialogFragment.java | 3 ++-
.../node/details/NodeDetailsFragment.java | 7 -------
.../fragments/search/SearchFragment.java | 2 +-
.../fragments/user/UsersFragment.java | 5 +++--
.../fragments/workflow/task/TasksFragment.java | 3 +++
.../fragments/workflow/task/TasksHelper.java | 13 +++++++++++++
.../async/node/like/LikeNodeOperation.java | 11 +++++++----
.../async/node/sync/SyncNodeOperation.java | 2 +-
.../node/update/UpdateContentOperation.java | 10 +++++++---
.../platform/extensions/AnalyticsManager.java | 16 ++++++++++++++++
10 files changed, 53 insertions(+), 19 deletions(-)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/DocumentTypesDialogFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/DocumentTypesDialogFragment.java
index 68f5d0dc..ce64d448 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/DocumentTypesDialogFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/create/DocumentTypesDialogFragment.java
@@ -102,7 +102,8 @@ public void onSelection(MaterialDialog materialDialog, View view, int position,
CharSequence charSequence) {
AnalyticsHelper.reportOperationEvent(getActivity(),
AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT, AnalyticsManager.ACTION_QUICK_ACTIONS,
- AnalyticsManager.ACTION_CREATE.concat(" " + fileTypes.get(position)), 1, false);
+ AnalyticsManager.ACTION_CREATE.concat(" " + fileTypes.get(position).mimetype), 1,
+ false);
Bundle b = getArguments();
b.putSerializable(ARGUMENT_DOCUMENT_TYPE, fileTypes.get(position));
EditorsDialogFragment dialogft = EditorsDialogFragment.newInstance(b);
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/NodeDetailsFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/NodeDetailsFragment.java
index 0cebc794..9c7f0049 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/NodeDetailsFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/details/NodeDetailsFragment.java
@@ -649,13 +649,6 @@ public void onClick(View v)
? SyncContentManager.getInstance(getActivity()).isRootSynced(getAccount(), node)
: SyncContentManager.getInstance(getActivity()).isSynced(getAccount(), node);
- AnalyticsHelper.reportOperationEvent(getActivity(),
- AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
- isSynced ? AnalyticsManager.ACTION_SYNC : AnalyticsManager.ACTION_UNSYNC,
- node.isDocument() ? ((Document) node).getContentStreamMimeType()
- : AnalyticsManager.TYPE_FOLDER,
- 1, false);
-
sync(v);
}
});
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java
index 31dc2ad7..ac3ec5c7 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java
@@ -117,7 +117,7 @@ public SearchFragment()
requiredSession = true;
checkSession = true;
setHasOptionsMenu(true);
- reportAtCreation = false;
+ reportAtCreation = true;
screenName = AnalyticsManager.SCREEN_SEARCH_FILES;
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/user/UsersFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/user/UsersFragment.java
index b5f9a7b1..e011bc2e 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/user/UsersFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/user/UsersFragment.java
@@ -69,10 +69,11 @@ public static UsersFragment newInstanceByTemplate(Bundle b)
return cbf;
}
+
@Override
- public void onCreate(Bundle savedInstanceState)
+ public void onActivityCreated(Bundle savedInstanceState)
{
- super.onCreate(savedInstanceState);
+ super.onActivityCreated(savedInstanceState);
if (keywords != null)
{
screenName = AnalyticsManager.SCREEN_SEARCH_RESULT_USERS;
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TasksFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TasksFragment.java
index a7823617..8a6d3165 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TasksFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TasksFragment.java
@@ -32,6 +32,7 @@
import org.alfresco.mobile.android.async.workflow.task.TasksEvent;
import org.alfresco.mobile.android.async.workflow.task.complete.CompleteTaskEvent;
import org.alfresco.mobile.android.async.workflow.task.delegate.ReassignTaskEvent;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.intent.PrivateIntent;
import org.alfresco.mobile.android.platform.utils.BundleUtils;
@@ -73,6 +74,7 @@ public TasksFragment()
emptyListMessageId = R.string.empty_tasks;
loadState = LOAD_VISIBLE;
setHasOptionsMenu(true);
+ reportAtCreation = false;
screenName = AnalyticsManager.SCREEN_TASKS_LISTING;
}
@@ -299,6 +301,7 @@ protected Fragment createFragment(Bundle b)
if (b.containsKey(ListingTemplate.ARGUMENT_HAS_FILTER)
|| (extraConfiguration != null && extraConfiguration.containsKey(ListingTemplate.ARGUMENT_LISTING)))
{
+ AnalyticsHelper.reportScreen(getActivity(), AnalyticsManager.SCREEN_TASKS_FILTER_LISTING);
return newInstanceByTemplate(b);
}
else
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TasksHelper.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TasksHelper.java
index b35b383c..198de7cd 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TasksHelper.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/task/TasksHelper.java
@@ -25,6 +25,8 @@
import org.alfresco.mobile.android.api.services.impl.publicapi.PublicAPIWorkflowServiceImpl;
import org.alfresco.mobile.android.application.R;
import org.alfresco.mobile.android.application.fragments.workflow.process.ProcessesFragment;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.ui.activity.AlfrescoActivity;
import android.content.SharedPreferences;
@@ -67,27 +69,36 @@ public boolean onNavigationItemSelected(int itemPosition, long itemId)
if (!backStack && itemPosition == currentSelection) { return true; }
+ String screenName = AnalyticsManager.SCREEN_TASKS_LISTING_ACTIVE;
ListingFilter f = new ListingFilter();
switch (itemPosition)
{
case TasksShortCutAdapter.FILTER_ACTIVE:
+ screenName = AnalyticsManager.SCREEN_TASKS_LISTING_ACTIVE;
f.addFilter(WorkflowService.FILTER_KEY_STATUS, WorkflowService.FILTER_STATUS_ACTIVE);
break;
case TasksShortCutAdapter.FILTER_INITIATOR:
+ screenName = AnalyticsManager.SCREEN_TASKS_LISTING_STARTED;
isProcessFragment = true;
break;
case TasksShortCutAdapter.FILTER_COMPLETED:
+ screenName = AnalyticsManager.SCREEN_TASKS_LISTING_COMPLETED;
f.addFilter(WorkflowService.FILTER_KEY_STATUS, WorkflowService.FILTER_STATUS_COMPLETE);
break;
case TasksShortCutAdapter.FILTER_HIGH_PRIORITY:
+ screenName = AnalyticsManager.SCREEN_TASKS_LISTING_HIGH;
f.addFilter(WorkflowService.FILTER_KEY_PRIORITY, WorkflowService.FILTER_PRIORITY_HIGH);
break;
case TasksShortCutAdapter.FILTER_DUE_TODAY:
+ screenName = AnalyticsManager.SCREEN_TASKS_LISTING_DUE;
f.addFilter(WorkflowService.FILTER_KEY_DUE, WorkflowService.FILTER_DUE_TODAY);
break;
case TasksShortCutAdapter.FILTER_OVERDUE:
+ screenName = AnalyticsManager.SCREEN_TASKS_LISTING_OVERDUE;
f.addFilter(WorkflowService.FILTER_KEY_DUE, WorkflowService.FILTER_DUE_OVERDUE);
+ break;
case TasksShortCutAdapter.FILTER_ASSIGNED:
+ screenName = AnalyticsManager.SCREEN_TASKS_LISTING_ASSIGNED;
f.addFilter(WorkflowService.FILTER_KEY_ASSIGNEE, WorkflowService.FILTER_ASSIGNEE_ME);
break;
case TasksShortCutAdapter.FILTER_CUSTOM:
@@ -97,6 +108,8 @@ public boolean onNavigationItemSelected(int itemPosition, long itemId)
break;
}
+ AnalyticsHelper.reportScreen(activity, screenName);
+
if (!backStack)
{
activity.getSupportFragmentManager().popBackStack();
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/like/LikeNodeOperation.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/like/LikeNodeOperation.java
index 8cd86fc6..96553154 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/like/LikeNodeOperation.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/like/LikeNodeOperation.java
@@ -119,10 +119,13 @@ protected void onPostExecute(LoaderResult result)
super.onPostExecute(result);
// Analytics
- AnalyticsHelper.reportOperationEvent(context, AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
- isLiked ? AnalyticsManager.ACTION_LIKE : AnalyticsManager.ACTION_UNLIKE,
- node.isDocument() ? ((Document) node).getContentStreamMimeType() : AnalyticsManager.TYPE_FOLDER, 1,
- result.hasException());
+ if (!readOnly)
+ {
+ AnalyticsHelper.reportOperationEvent(context, AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
+ isLiked ? AnalyticsManager.ACTION_LIKE : AnalyticsManager.ACTION_UNLIKE,
+ node.isDocument() ? ((Document) node).getContentStreamMimeType() : AnalyticsManager.TYPE_FOLDER, 1,
+ result.hasException());
+ }
EventBusManager.getInstance().post(new LikeNodeEvent(getRequestId(), readOnly, result));
}
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/sync/SyncNodeOperation.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/sync/SyncNodeOperation.java
index 4c15f2d8..5bda90b0 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/sync/SyncNodeOperation.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/sync/SyncNodeOperation.java
@@ -336,7 +336,7 @@ protected void onPostExecute(LoaderResult result)
// Analytics
AnalyticsHelper.reportOperationEvent(context, AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
- isSynced ? AnalyticsManager.ACTION_SYNC : AnalyticsManager.ACTION_UNSYNC,
+ !isSynced ? AnalyticsManager.ACTION_SYNC : AnalyticsManager.ACTION_UNSYNC,
node.isDocument() ? ((Document) node).getContentStreamMimeType() : AnalyticsManager.TYPE_FOLDER, 1,
result.hasException());
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/update/UpdateContentOperation.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/update/UpdateContentOperation.java
index 0db332d5..1a63fad2 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/update/UpdateContentOperation.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/update/UpdateContentOperation.java
@@ -164,9 +164,13 @@ protected void onPostExecute(LoaderResult result)
super.onPostExecute(result);
// Analytics
- AnalyticsHelper.reportOperationEvent(context, AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
- AnalyticsManager.ACTION_UPDATE, ((Document) node).getContentStreamMimeType(), 1, result.hasException(),
- AnalyticsManager.INDEX_FILE_SIZE, ((Document) node).getContentStreamLength());
+ if (node != null)
+ {
+ AnalyticsHelper.reportOperationEvent(context, AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
+ AnalyticsManager.ACTION_UPDATE, ((Document) node).getContentStreamMimeType(), 1,
+ result.hasException(), AnalyticsManager.INDEX_FILE_SIZE,
+ ((Document) node).getContentStreamLength());
+ }
EventBusManager.getInstance().post(new UpdateContentEvent(getRequestId(), result, node, parentFolder));
}
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/extensions/AnalyticsManager.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/extensions/AnalyticsManager.java
index 7053cbc9..29469069 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/extensions/AnalyticsManager.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/extensions/AnalyticsManager.java
@@ -409,10 +409,26 @@ public abstract class AnalyticsManager extends Manager
public static final String SCREEN_TASKS_LISTING = PREFIX_TASKS + "Listing";
+ public static final String SCREEN_TASKS_LISTING_ASSIGNED = SCREEN_TASKS_LISTING + " - Tasks Assigned to Me";
+
+ public static final String SCREEN_TASKS_LISTING_STARTED = SCREEN_TASKS_LISTING + " - Tasks I've started";
+
+ public static final String SCREEN_TASKS_LISTING_COMPLETED = SCREEN_TASKS_LISTING + " - Completed Tasks";
+
+ public static final String SCREEN_TASKS_LISTING_HIGH = SCREEN_TASKS_LISTING + " - High Priority Tasks";
+
+ public static final String SCREEN_TASKS_LISTING_DUE = SCREEN_TASKS_LISTING + " - Tasks Due Today";
+
+ public static final String SCREEN_TASKS_LISTING_OVERDUE = SCREEN_TASKS_LISTING + " - Overdue Tasks";
+
+ public static final String SCREEN_TASKS_LISTING_ACTIVE = SCREEN_TASKS_LISTING + " - Active Tasks";
+
public static final String SCREEN_TASKS_HISTORY = PREFIX_TASKS + "History";
public static final String SCREEN_TASKS_FILTER = PREFIX_TASKS + "Filter";
+ public static final String SCREEN_TASKS_FILTER_LISTING = PREFIX_TASKS + "Filter - Listing";
+
public static final String SCREEN_TASK_DETAILS = PREFIX_TASKS + "Details";
public static final String SCREEN_TASK_CREATE_TYPE = PREFIX_TASKS + "Create - Type";
From 94ed3868745f63a537c0a99e10500701a5fb7ad7 Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Tue, 16 Feb 2016 16:06:59 +0100
Subject: [PATCH 19/35] ANDROID-264
---
.../editors/text/EncodingDialogFragment.java | 4 +++
.../editors/text/TextEditorActivity.java | 5 +++
.../editors/text/TextSizeDialogFragment.java | 4 +++
.../search/DocumentFolderSearchFragment.java | 1 +
.../platform/extensions/AnalyticsManager.java | 14 +++++++--
.../ui/node/search/SearchNodesFragment.java | 31 +++++++++++--------
6 files changed, 43 insertions(+), 16 deletions(-)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/editors/text/EncodingDialogFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/editors/text/EncodingDialogFragment.java
index 1134ea18..2934719e 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/editors/text/EncodingDialogFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/editors/text/EncodingDialogFragment.java
@@ -23,6 +23,8 @@
import java.util.SortedMap;
import org.alfresco.mobile.android.application.R;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.ui.fragments.BaseListAdapter;
import org.alfresco.mobile.android.ui.holder.SingleLineViewHolder;
import org.alfresco.mobile.android.ui.utils.UIUtils;
@@ -71,6 +73,8 @@ public static EncodingDialogFragment newInstance(String defaultCharset)
// ///////////////////////////////////////////////////////////////////////////
public Dialog onCreateDialog(Bundle savedInstanceState)
{
+ AnalyticsHelper.reportScreen(getActivity(), AnalyticsManager.SCREEN_TEXT_EDITOR_ENCODING);
+
if (getArguments() != null && getArguments().containsKey(ARGUMENT_DEFAULT_CHARSET))
{
defaultCharset = getArguments().getString(ARGUMENT_DEFAULT_CHARSET, "UTF-8");
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/editors/text/TextEditorActivity.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/editors/text/TextEditorActivity.java
index 8fab7d39..5bd4a827 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/editors/text/TextEditorActivity.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/editors/text/TextEditorActivity.java
@@ -36,6 +36,8 @@
import org.alfresco.mobile.android.async.file.open.OpenFileEvent;
import org.alfresco.mobile.android.async.file.open.OpenFileRequest;
import org.alfresco.mobile.android.platform.AlfrescoNotificationManager;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.intent.AlfrescoIntentAPI;
import org.alfresco.mobile.android.platform.intent.PrivateIntent;
import org.alfresco.mobile.android.ui.utils.UIUtils;
@@ -101,6 +103,9 @@ public class TextEditorActivity extends BaseActivity
@Override
public void onCreate(Bundle savedInstanceState)
{
+
+ AnalyticsHelper.reportScreen(this, AnalyticsManager.SCREEN_TEXT_EDITOR);
+
supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
super.onCreate(savedInstanceState);
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/editors/text/TextSizeDialogFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/editors/text/TextSizeDialogFragment.java
index d6cd91e9..728ae49e 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/editors/text/TextSizeDialogFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/editors/text/TextSizeDialogFragment.java
@@ -22,6 +22,8 @@
import java.util.List;
import org.alfresco.mobile.android.application.R;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.ui.fragments.BaseListAdapter;
import org.alfresco.mobile.android.ui.holder.SingleLineViewHolder;
import org.alfresco.mobile.android.ui.utils.UIUtils;
@@ -110,6 +112,8 @@ public static TextSizeDialogFragment newInstance(int textSize)
// ///////////////////////////////////////////////////////////////////////////
public Dialog onCreateDialog(Bundle savedInstanceState)
{
+ AnalyticsHelper.reportScreen(getActivity(), AnalyticsManager.SCREEN_TEXT_EDITOR_TEXT_SIZE);
+
int title = R.string.file_editor_text_size;
if (getArguments() != null && getArguments().containsKey(ARGUMENT_DEFAULT_SIZE))
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/search/DocumentFolderSearchFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/search/DocumentFolderSearchFragment.java
index e4560e03..a34291be 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/search/DocumentFolderSearchFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/node/search/DocumentFolderSearchFragment.java
@@ -87,6 +87,7 @@ public DocumentFolderSearchFragment()
super();
loadState = LOAD_VISIBLE;
displayAsList = false;
+ reportAtCreation = false;
screenName = AnalyticsManager.SCREEN_SEARCH_RESULT_FILES;
}
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/extensions/AnalyticsManager.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/extensions/AnalyticsManager.java
index 29469069..2e2662fc 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/extensions/AnalyticsManager.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/extensions/AnalyticsManager.java
@@ -395,15 +395,17 @@ public abstract class AnalyticsManager extends Manager
public static final String SCREEN_SEARCH_RESULT_FILES = PREFIX_SEARCH_RESULT + "Files";
+ public static final String SCREEN_SEARCH_RESULT_FOLDERS = PREFIX_SEARCH_RESULT + "Folders";
+
public static final String SCREEN_SEARCH_RESULT_USERS = PREFIX_SEARCH_RESULT + "People";
public static final String SCREEN_SEARCH_ADVANCED = PREFIX_SEARCH + "Advanced - ";
- public static final String SCREEN_SEARCH_ADVANCED_FILES = PREFIX_SEARCH_RESULT + "Files";
+ public static final String SCREEN_SEARCH_ADVANCED_FILES = SCREEN_SEARCH_ADVANCED + "Files";
- public static final String SCREEN_SEARCH_ADVANCED_FOLDERS = PREFIX_SEARCH_RESULT + "Folders";
+ public static final String SCREEN_SEARCH_ADVANCED_FOLDERS = SCREEN_SEARCH_ADVANCED + "Folders";
- public static final String SCREEN_SEARCH_ADVANCED_USERS = PREFIX_SEARCH_RESULT + "People";
+ public static final String SCREEN_SEARCH_ADVANCED_USERS = SCREEN_SEARCH_ADVANCED + "People";
public static final String PREFIX_TASKS = "Tasks - ";
@@ -461,6 +463,12 @@ public abstract class AnalyticsManager extends Manager
public static final String SCREEN_SAMSUNG_SNOTE_EDITOR = "Samsung - SNote Editor";
+ public static final String SCREEN_TEXT_EDITOR = "Text Editor";
+
+ public static final String SCREEN_TEXT_EDITOR_ENCODING = "Text Editor - Encoding";
+
+ public static final String SCREEN_TEXT_EDITOR_TEXT_SIZE = "Text Editor - Text Size";
+
// ////////////////////////////////////////////////////
// SETTINGS
// ////////////////////////////////////////////////////
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/ui/node/search/SearchNodesFragment.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/ui/node/search/SearchNodesFragment.java
index bc014669..9e3691b9 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/ui/node/search/SearchNodesFragment.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/ui/node/search/SearchNodesFragment.java
@@ -1,20 +1,20 @@
-/*******************************************************************************
- * Copyright (C) 2005-2014 Alfresco Software Limited.
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
*
- * This file is part of Alfresco Mobile for Android.
+ * This file is part of Alfresco Mobile for Android.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *******************************************************************************/
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.alfresco.mobile.android.ui.node.search;
import org.alfresco.mobile.android.api.model.Folder;
@@ -25,6 +25,8 @@
import org.alfresco.mobile.android.async.node.search.SearchEvent;
import org.alfresco.mobile.android.async.node.search.SearchRequest;
import org.alfresco.mobile.android.foundation.R;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.ui.fragments.BaseGridFragment;
import org.alfresco.mobile.android.ui.utils.UIUtils;
@@ -101,6 +103,9 @@ protected void onRetrieveParameters(Bundle bundle)
ARGUMENT_INCLUDE_DESCENDANTS) : includeDescendants;
searchFolderOnly = (getArguments().containsKey(ARGUMENT_SEARCH_FOLDER)) ? getArguments().getBoolean(
ARGUMENT_SEARCH_FOLDER) : searchFolderOnly;
+
+ AnalyticsHelper.reportScreen(getActivity(), searchFolderOnly ? AnalyticsManager.SCREEN_SEARCH_RESULT_FOLDERS
+ : AnalyticsManager.SCREEN_SEARCH_RESULT_FILES);
}
protected OperationBuilder onCreateOperationRequest(ListingContext listingContext)
From 1b25df826e43e5c1075be33e93be4f0828dd29d6 Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Wed, 17 Feb 2016 21:35:04 +0100
Subject: [PATCH 20/35] ANDROID-266
---
.../preferences/GeneralPreferences.java | 76 +++++++++----------
1 file changed, 38 insertions(+), 38 deletions(-)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/GeneralPreferences.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/GeneralPreferences.java
index 2d26e818..6474413e 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/GeneralPreferences.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/GeneralPreferences.java
@@ -129,44 +129,6 @@ public void onClick(View v)
}
});
- // Feedback - Analytics
- if (AnalyticsManager.getInstance(getActivity()) == null
- || AnalyticsManager.getInstance(getActivity()).isBlocked())
- {
- boolean isEnable = AnalyticsManager.getInstance(getActivity()).isEnable();
-
- diagnosticVH = HolderUtils.configure(viewById(R.id.settings_diagnostic),
- getString(R.string.settings_feedback_diagnostic), getString(R.string.settings_custom_menu_disable),
- isEnable);
- HolderUtils.makeMultiLine(diagnosticVH.bottomText, 3);
- diagnosticVH.choose.setVisibility(View.GONE);
- diagnosticVH.choose.setEnabled(false);
- }
- else
- {
- boolean isEnable = AnalyticsManager.getInstance(getActivity()).isEnable();
-
- diagnosticVH = HolderUtils.configure(viewById(R.id.settings_diagnostic),
- getString(R.string.settings_feedback_diagnostic),
- getString(R.string.settings_feedback_diagnostic_summary), isEnable);
- HolderUtils.makeMultiLine(diagnosticVH.bottomText, 4);
- diagnosticVH.choose.setOnClickListener(new View.OnClickListener()
- {
- @Override
- public void onClick(View v)
- {
- if (diagnosticVH.choose.isChecked())
- {
- AnalyticHelper.optIn(getActivity(), getAccount());
- }
- else
- {
- AnalyticHelper.optOut(getActivity(), getAccount());
- }
- }
- });
- }
-
// About
vh = HolderUtils.configure(viewById(R.id.settings_about), getString(R.string.version_number),
AboutFragment.getVersionNumber(getActivity()), -1);
@@ -375,6 +337,44 @@ public void onClick(View v)
viewById(R.id.passcode_preference_container).setEnabled(false);
passcodeVH.bottomText.setText(R.string.mdm_managed);
}
+
+ // Feedback - Analytics
+ if (AnalyticsManager.getInstance(getActivity()) == null
+ || AnalyticsManager.getInstance(getActivity()).isBlocked())
+ {
+ boolean isEnable = AnalyticsManager.getInstance(getActivity()).isEnable();
+
+ diagnosticVH = HolderUtils.configure(viewById(R.id.settings_diagnostic),
+ getString(R.string.settings_feedback_diagnostic), getString(R.string.settings_custom_menu_disable),
+ isEnable);
+ HolderUtils.makeMultiLine(diagnosticVH.bottomText, 3);
+ diagnosticVH.choose.setVisibility(View.GONE);
+ diagnosticVH.choose.setEnabled(false);
+ }
+ else
+ {
+ boolean isEnable = AnalyticsManager.getInstance(getActivity()).isEnable();
+
+ diagnosticVH = HolderUtils.configure(viewById(R.id.settings_diagnostic),
+ getString(R.string.settings_feedback_diagnostic),
+ getString(R.string.settings_feedback_diagnostic_summary), isEnable);
+ HolderUtils.makeMultiLine(diagnosticVH.bottomText, 4);
+ diagnosticVH.choose.setOnClickListener(new View.OnClickListener()
+ {
+ @Override
+ public void onClick(View v)
+ {
+ if (diagnosticVH.choose.isChecked())
+ {
+ AnalyticHelper.optIn(getActivity(), getAccount());
+ }
+ else
+ {
+ AnalyticHelper.optOut(getActivity(), getAccount());
+ }
+ }
+ });
+ }
}
private void startPlayStore()
From 6ba47bf02bfaefcc79431720484d3e6855277ada Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Mon, 22 Feb 2016 09:21:14 +0100
Subject: [PATCH 21/35] ANDROID-246 Revert to build 22
---
alfresco-mobile-android/build.gradle | 2 +-
.../preferences/PasscodePreferences.java | 6 ++++++
.../managers/extensions/AnalyticHelper.java | 2 +-
.../src/main/res/values/strings.xml | 2 +-
extensions/analytics/build.gradle | 2 +-
extensions/hockeyapp/build.gradle | 2 +-
extensions/samsung/build.gradle | 2 +-
extensions/scansnap/build.gradle | 2 +-
extensions/tools/build.gradle | 20 ++++++++++++++++++-
mdm/mobileiron/build.gradle | 2 +-
platform/foundation/build.gradle | 2 +-
platform/thirdparty/build.gradle | 2 +-
12 files changed, 35 insertions(+), 11 deletions(-)
diff --git a/alfresco-mobile-android/build.gradle b/alfresco-mobile-android/build.gradle
index 15f71727..2e2d7020 100644
--- a/alfresco-mobile-android/build.gradle
+++ b/alfresco-mobile-android/build.gradle
@@ -26,7 +26,7 @@ android {
applicationId APPLICATION_ID
minSdkVersion 15
- targetSdkVersion 23
+ targetSdkVersion 22
versionCode 60
versionName VERSION_NAME
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/PasscodePreferences.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/PasscodePreferences.java
index 7c9ce02e..09405dcf 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/PasscodePreferences.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/preferences/PasscodePreferences.java
@@ -350,6 +350,12 @@ public static boolean hasPasscodeEnable(Context context)
return isTimeOut;
}
+ public static boolean hasPasscode(Context context)
+ {
+ SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context);
+ return sharedPref.getBoolean(KEY_PASSCODE_ENABLE, false);
+ }
+
private void disableEnableControls(boolean enable, ViewGroup vg)
{
for (int i = 0; i < vg.getChildCount(); i++)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/extensions/AnalyticHelper.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/extensions/AnalyticHelper.java
index 1fc6358d..fdebabfe 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/extensions/AnalyticHelper.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/extensions/AnalyticHelper.java
@@ -90,7 +90,7 @@ public static void analyzeSession(Context context, AlfrescoAccount account, Alfr
// Settings Info
boolean dataProtectionEnable = DataProtectionManager.getInstance(context).hasDataProtectionEnable();
- boolean passcodeEnable = PasscodePreferences.hasPasscodeEnable(context);
+ boolean passcodeEnable = PasscodePreferences.hasPasscode(context);
Boolean syncWifiEnable = SyncContentManager.getInstance(context).hasWifiOnlySync(account);
customMetrics.append(AnalyticsManager.INDEX_PASSCODE, passcodeEnable ? 1L : 0L);
customMetrics.append(AnalyticsManager.INDEX_DATA_PROTECTION, dataProtectionEnable ? 1L : 0L);
diff --git a/alfresco-mobile-android/src/main/res/values/strings.xml b/alfresco-mobile-android/src/main/res/values/strings.xml
index e37b0436..37a9f0dc 100644
--- a/alfresco-mobile-android/src/main/res/values/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values/strings.xml
@@ -50,7 +50,7 @@
I already have an accountIf you want to learn more about Alfresco Mobile take a look at our guide in the Help area
- Alfresco One
+ Alfresco ServerOrAlfresco in the Cloud
diff --git a/extensions/analytics/build.gradle b/extensions/analytics/build.gradle
index 03583ab7..1960678b 100644
--- a/extensions/analytics/build.gradle
+++ b/extensions/analytics/build.gradle
@@ -24,7 +24,7 @@ android {
defaultConfig {
minSdkVersion 15
- targetSdkVersion 23
+ targetSdkVersion 22
versionCode 1
versionName "1.0"
}
diff --git a/extensions/hockeyapp/build.gradle b/extensions/hockeyapp/build.gradle
index eb66687d..f0880e27 100644
--- a/extensions/hockeyapp/build.gradle
+++ b/extensions/hockeyapp/build.gradle
@@ -24,7 +24,7 @@ android {
defaultConfig {
minSdkVersion 15
- targetSdkVersion 23
+ targetSdkVersion 22
versionCode 1
versionName "1.0"
}
diff --git a/extensions/samsung/build.gradle b/extensions/samsung/build.gradle
index bf31067b..c36de8de 100644
--- a/extensions/samsung/build.gradle
+++ b/extensions/samsung/build.gradle
@@ -24,7 +24,7 @@ android {
defaultConfig {
minSdkVersion 15
- targetSdkVersion 23
+ targetSdkVersion 22
versionCode 1
versionName "1.0"
}
diff --git a/extensions/scansnap/build.gradle b/extensions/scansnap/build.gradle
index 8262b69a..1144b4b3 100644
--- a/extensions/scansnap/build.gradle
+++ b/extensions/scansnap/build.gradle
@@ -24,7 +24,7 @@ android {
defaultConfig {
minSdkVersion 15
- targetSdkVersion 23
+ targetSdkVersion 22
versionCode 1
versionName "1.0"
}
diff --git a/extensions/tools/build.gradle b/extensions/tools/build.gradle
index 0dca89f8..67b52eb8 100644
--- a/extensions/tools/build.gradle
+++ b/extensions/tools/build.gradle
@@ -1,3 +1,21 @@
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco Mobile for Android.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
apply plugin: 'com.android.library'
android {
@@ -6,7 +24,7 @@ android {
defaultConfig {
minSdkVersion 15
- targetSdkVersion 23
+ targetSdkVersion 22
versionCode 1
versionName "1.0"
}
diff --git a/mdm/mobileiron/build.gradle b/mdm/mobileiron/build.gradle
index 6ae6141f..95b079fb 100644
--- a/mdm/mobileiron/build.gradle
+++ b/mdm/mobileiron/build.gradle
@@ -24,7 +24,7 @@ android {
defaultConfig {
minSdkVersion 15
- targetSdkVersion 23
+ targetSdkVersion 22
versionCode 1
versionName "1.0"
}
diff --git a/platform/foundation/build.gradle b/platform/foundation/build.gradle
index f87b72a0..0c01d916 100644
--- a/platform/foundation/build.gradle
+++ b/platform/foundation/build.gradle
@@ -24,7 +24,7 @@ android {
defaultConfig {
minSdkVersion 15
- targetSdkVersion 23
+ targetSdkVersion 22
versionCode 1
versionName "1.0"
diff --git a/platform/thirdparty/build.gradle b/platform/thirdparty/build.gradle
index 86f2e695..af189654 100644
--- a/platform/thirdparty/build.gradle
+++ b/platform/thirdparty/build.gradle
@@ -24,7 +24,7 @@ android {
defaultConfig {
minSdkVersion 15
- targetSdkVersion 23
+ targetSdkVersion 22
versionCode 1
versionName "1.0"
}
From eead727316b3a1602ae8882fc62784452771e94e Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Mon, 22 Feb 2016 09:57:22 +0100
Subject: [PATCH 22/35] ANDROID-265
---
.../fragments/search/AdvancedSearchFragment.java | 2 +-
.../application/fragments/search/SearchFragment.java | 9 ++++++---
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/AdvancedSearchFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/AdvancedSearchFragment.java
index 96e3b123..09539a20 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/AdvancedSearchFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/AdvancedSearchFragment.java
@@ -408,7 +408,7 @@ private void search()
switch (searchKey)
{
case HistorySearch.TYPE_PERSON:
- label = AnalyticsManager.LABEL_DOCUMENTS;
+ label = AnalyticsManager.LABEL_PEOPLE;
UsersFragment.with(getActivity()).keywords(statement).title(description).display();
break;
case HistorySearch.TYPE_FOLDER:
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java
index ac3ec5c7..eafdef96 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java
@@ -470,15 +470,18 @@ public void search(String keywords, HistorySearch search)
{
HistorySearchManager.createHistorySearch(getActivity(), getAccount().getId(), searchKey, 0,
getQueryDescription(keywords, tmpParentFolder, site), keywords, new Date().getTime());
+
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_SEARCH,
+ AnalyticsManager.ACTION_RUN, label, 1, false);
}
else
{
HistorySearchManager.update(getActivity(), search.getId(), search.getAccountId(), search.getType(),
search.getAdvanced(), search.getDescription(), search.getQuery(), new Date().getTime());
- }
- AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_SEARCH,
- AnalyticsManager.ACTION_RUN, label, 1, false);
+ AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_SEARCH,
+ AnalyticsManager.ACTION_RUN_HISTORY, label, 1, false);
+ }
}
// //////////////////////////////////////////////////////////////////////
From 894eaa68716408dd620293edf7eea0ea41eb134d Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Mon, 22 Feb 2016 10:42:02 +0100
Subject: [PATCH 23/35] ANDROID-264
---
.../application/activity/PrivateDialogActivity.java | 4 ++++
.../fragments/workflow/CreateTaskTypePickerFragment.java | 7 +++++++
2 files changed, 11 insertions(+)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/activity/PrivateDialogActivity.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/activity/PrivateDialogActivity.java
index d52c7f5e..6fca7aa2 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/activity/PrivateDialogActivity.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/activity/PrivateDialogActivity.java
@@ -34,6 +34,8 @@
import org.alfresco.mobile.android.application.fragments.workflow.CreateTaskTypePickerFragment;
import org.alfresco.mobile.android.application.ui.form.picker.DocumentPickerFragment.onPickDocumentFragment;
import org.alfresco.mobile.android.async.file.encryption.AccountProtectionEvent;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsHelper;
+import org.alfresco.mobile.android.platform.extensions.AnalyticsManager;
import org.alfresco.mobile.android.platform.intent.PrivateIntent;
import android.content.Intent;
@@ -140,6 +142,8 @@ && getIntent().getExtras().containsKey(PrivateIntent.EXTRA_DOCUMENTS))
Fragment f = docs.isEmpty() ? new CreateTaskTypePickerFragment()
: CreateTaskTypePickerFragment.newInstance(docs);
FragmentDisplayer.with(this).load(f).back(false).animate(null).into(FragmentDisplayer.PANEL_LEFT);
+
+ AnalyticsHelper.reportScreen(this, AnalyticsManager.SCREEN_TASK_CREATE_TYPE);
}
if (PrivateIntent.ACTION_DISPLAY_HELP.equals(action))
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/CreateTaskTypePickerFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/CreateTaskTypePickerFragment.java
index 2b6df117..17e5258b 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/CreateTaskTypePickerFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/workflow/CreateTaskTypePickerFragment.java
@@ -71,6 +71,13 @@ public CreateTaskTypePickerFragment()
screenName = AnalyticsManager.SCREEN_TASK_CREATE_TYPE;
}
+ public static CreateTaskTypePickerFragment newInstanceByTemplate(Bundle b)
+ {
+ CreateTaskTypePickerFragment cbf = new CreateTaskTypePickerFragment();
+ cbf.setArguments(b);
+ return cbf;
+ }
+
public static CreateTaskTypePickerFragment newInstance(List docs)
{
CreateTaskTypePickerFragment bf = new CreateTaskTypePickerFragment();
From afb6d12d582426e15985f7e7d70909da12eb1588 Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Mon, 22 Feb 2016 11:02:37 +0100
Subject: [PATCH 24/35] ANDROID-239
---
.../application/managers/ActionUtils.java | 2 +-
.../async/node/sync/SyncNodeOperation.java | 16 +++++++++-------
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ActionUtils.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ActionUtils.java
index 0c69df9e..590442a3 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ActionUtils.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ActionUtils.java
@@ -539,7 +539,7 @@ public static boolean actionSendFeedbackEmail(Fragment fr)
String versionName = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
int versionCode = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode;
- String subject = "Alfresco Mobile Feedback";
+ String subject = "Alfresco Android Mobile Feedback";
iBuilder.setSubject(subject);
// Content
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/sync/SyncNodeOperation.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/sync/SyncNodeOperation.java
index 5bda90b0..c06c5c75 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/sync/SyncNodeOperation.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/sync/SyncNodeOperation.java
@@ -333,13 +333,15 @@ private void prepareChildrenFolderDelete(String nodeId)
protected void onPostExecute(LoaderResult result)
{
super.onPostExecute(result);
-
- // Analytics
- AnalyticsHelper.reportOperationEvent(context, AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
- !isSynced ? AnalyticsManager.ACTION_SYNC : AnalyticsManager.ACTION_UNSYNC,
- node.isDocument() ? ((Document) node).getContentStreamMimeType() : AnalyticsManager.TYPE_FOLDER, 1,
- result.hasException());
-
EventBusManager.getInstance().post(new SyncNodeEvent(getRequestId(), result, node));
+
+ if (markSync != null)
+ {
+ // Analytics
+ AnalyticsHelper.reportOperationEvent(context, AnalyticsManager.CATEGORY_DOCUMENT_MANAGEMENT,
+ !markSync ? AnalyticsManager.ACTION_SYNC : AnalyticsManager.ACTION_UNSYNC,
+ node.isDocument() ? ((Document) node).getContentStreamMimeType() : AnalyticsManager.TYPE_FOLDER, 1,
+ result.hasException());
+ }
}
}
From d3250d26a5da0d577061e1658788d79794b4f142 Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Mon, 22 Feb 2016 13:04:43 +0100
Subject: [PATCH 25/35] ANDROID-267
---
.../android/application/activity/MainActivity.java | 2 +-
.../fragments/menu/MainMenuFragment.java | 14 +++++++++-----
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/activity/MainActivity.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/activity/MainActivity.java
index 6dc60ee8..24c2883f 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/activity/MainActivity.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/activity/MainActivity.java
@@ -362,7 +362,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data)
((MainMenuFragment) getFragment(MainMenuFragment.SLIDING_TAG)).refreshAccount();
// Send Event
- ConfigManager.getInstance(this).loadAndUseCustom(getCurrentAccount());
+ // ConfigManager.getInstance(this).loadAndUseCustom(getCurrentAccount());
EventBusManager.getInstance()
.post(new ConfigManager.ConfigurationMenuEvent(getCurrentAccount().getId()));
}
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/menu/MainMenuFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/menu/MainMenuFragment.java
index c1bda583..d54fb2f9 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/menu/MainMenuFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/menu/MainMenuFragment.java
@@ -269,6 +269,10 @@ public void refreshAccount()
{
configManager = ConfigManager.getInstance(getActivity());
refresh();
+ if (configManager.getConfig(currentAccount.getId()) == null)
+ {
+ configManager.init(currentAccount);
+ }
MainMenuConfigManager config = new MainMenuConfigManager(getActivity(),
configManager.getConfig(currentAccount.getId()), (ViewGroup) getRootView());
config.createMenu();
@@ -350,10 +354,7 @@ public void swapAccount()
// ///////////////////////////////////////////////////////////////////////////
private void configure(ConfigService configService)
{
- if (configService == null || !configService.hasViewConfig())
- {
- return;
- }
+ if (configService == null || !configService.hasViewConfig()) { return; }
// Default only available since configuration 0.1
if (configService.getConfigInfo() == null || (configService.getConfigInfo() != null
@@ -694,7 +695,10 @@ public void onAvatarLoaded(AvatarEvent event)
@Subscribe
public void onConfigureMenuEvent(ConfigurationMenuEvent event)
{
- refreshConfiguration(event.accountId);
+ if (event.accountId >= 0)
+ {
+ refreshConfiguration(event.accountId);
+ }
}
@Subscribe
From 1a2436be4c3cc9d66a6833766b25705f20f16178 Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Mon, 22 Feb 2016 13:06:24 +0100
Subject: [PATCH 26/35] ANDROID-207
---
.../android/application/fragments/search/SearchFragment.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java
index eafdef96..dd5caef3 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java
@@ -534,7 +534,7 @@ private void updateForm(int id)
switch (id)
{
case HistorySearch.TYPE_PERSON:
- hintId = R.string.search_person_hint;
+ hintId = R.string.search;
screenName = AnalyticsManager.SCREEN_SEARCH_USERS;
// iconResId = R.drawable.ic_person_light;
break;
From 14aacc8e0420fde87554bc0ab90bd59f94e6af18 Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Mon, 22 Feb 2016 17:13:23 +0100
Subject: [PATCH 27/35] ANDROID-205
---
.../android/async/UploadRetryService.java | 26 ++++++++++++++-----
.../node/create/CreateDocumentOperation.java | 3 ++-
.../android/sync/SyncContentManager.java | 19 +++++++++++---
3 files changed, 36 insertions(+), 12 deletions(-)
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/async/UploadRetryService.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/async/UploadRetryService.java
index ef02a57a..1d403618 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/async/UploadRetryService.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/async/UploadRetryService.java
@@ -22,6 +22,7 @@
import org.alfresco.mobile.android.platform.intent.PrivateIntent;
import org.alfresco.mobile.android.platform.utils.ConnectivityUtils;
+import org.alfresco.mobile.android.sync.SyncContentManager;
import android.app.AlarmManager;
import android.app.PendingIntent;
@@ -88,18 +89,25 @@ private void startService()
private void retryOperations(Intent pIntent)
{
Uri uri = null;
+ Long accountId = -1L;
if (pIntent.getExtras() != null && pIntent.hasExtra(PrivateIntent.EXTRA_OPERATION_ID))
{
uri = Uri.parse(pIntent.getStringExtra(PrivateIntent.EXTRA_OPERATION_ID));
}
- if (uri == null)
+ if (pIntent.getExtras() != null && pIntent.hasExtra(PrivateIntent.EXTRA_ACCOUNT_ID))
+ {
+ accountId = pIntent.getLongExtra(PrivateIntent.EXTRA_ACCOUNT_ID, -1);
+ }
+
+ if (uri == null || accountId == -1L)
{
stopSelf();
}
// Postpone if still offline (double time for each attempt)
- if (!ConnectivityUtils.hasInternetAvailable(getApplicationContext()))
+ if (!ConnectivityUtils.hasInternetAvailable(getApplicationContext())
+ || !SyncContentManager.getInstance(getApplicationContext()).hasConnectivityToSync(accountId))
{
if (OperationsFactory.canRetry(getApplicationContext(), uri))
{
@@ -107,11 +115,11 @@ private void retryOperations(Intent pIntent)
pIntent.getExtras().clear();
if (delay * 2 < DEFAULT_DELAY_MAX)
{
- postpone(uri.toString(), delay * 2);
+ postpone(uri.toString(), accountId, delay * 2);
}
}
}
- else
+ else if (SyncContentManager.getInstance(getApplicationContext()).hasConnectivityToSync(accountId))
{
// Check if still present ?
if (OperationsFactory.canRetry(getApplicationContext(), uri))
@@ -127,18 +135,22 @@ private void retryOperations(Intent pIntent)
stopSelf();
}
- private void postpone(String operationId, int delay)
+ private void postpone(String operationId, Long accountId, int delay)
{
- retryDelay(getApplicationContext(), operationId, delay);
+ retryDelay(getApplicationContext(), accountId, operationId, delay);
}
- public static void retryDelay(Context context, String operationId, int min)
+ public static void retryDelay(Context context, Long accountId, String operationId, int min)
{
// Start alarm to retry upload
Intent postPoneIntent = new Intent(context, UploadRetryService.class);
postPoneIntent.setAction(PrivateIntent.ACTION_RETRY_OPERATIONS);
postPoneIntent.putExtra(PrivateIntent.EXTRA_OPERATION_ID, operationId);
postPoneIntent.putExtra(PrivateIntent.EXTRA_OPERATION_DELAY, min);
+ if (accountId != null)
+ {
+ postPoneIntent.putExtra(PrivateIntent.EXTRA_ACCOUNT_ID, accountId);
+ }
int uniqueInt = (int) (System.currentTimeMillis() & 0xfffffff);
PendingIntent pIntent = PendingIntent.getService(context, uniqueInt, postPoneIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/create/CreateDocumentOperation.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/create/CreateDocumentOperation.java
index a487a18a..536b7630 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/create/CreateDocumentOperation.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/async/node/create/CreateDocumentOperation.java
@@ -199,7 +199,8 @@ protected void onPostExecute(LoaderResult result)
EventBusManager.getInstance().post(new CreateDocumentEvent(getRequestId(), result, parentFolder));
if (result.hasException() && result.getException() instanceof AlfrescoOfflineException)
{
- UploadRetryService.retryDelay(context, getRequestId(), UploadRetryService.DEFAULT_DELAY);
+ UploadRetryService.retryDelay(context, acc != null ? acc.getId() : null, getRequestId(),
+ UploadRetryService.DEFAULT_DELAY);
}
if (((CreateDocumentRequest) request).isCreation)
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/sync/SyncContentManager.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/sync/SyncContentManager.java
index 557f612d..5eb40b7f 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/sync/SyncContentManager.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/sync/SyncContentManager.java
@@ -431,8 +431,14 @@ public boolean canSync(AlfrescoAccount account)
public boolean hasConnectivityToSync(AlfrescoAccount account)
{
- return ((hasWifiOnlySync(account) && ConnectivityUtils.isWifiAvailable(appContext))
- || (!hasWifiOnlySync(account) && ConnectivityUtils.hasInternetAvailable(appContext)));
+ return ((hasWifiOnlySync(account.getId()) && ConnectivityUtils.isWifiAvailable(appContext))
+ || (!hasWifiOnlySync(account.getId()) && ConnectivityUtils.hasInternetAvailable(appContext)));
+ }
+
+ public boolean hasConnectivityToSync(Long accountId)
+ {
+ return ((hasWifiOnlySync(accountId) && ConnectivityUtils.isWifiAvailable(appContext))
+ || (!hasWifiOnlySync(accountId) && ConnectivityUtils.hasInternetAvailable(appContext)));
}
/**
@@ -788,10 +794,15 @@ public void setWifiOnlySync(AlfrescoAccount account, boolean isWifiOnly)
public boolean hasWifiOnlySync(AlfrescoAccount account)
{
- if (account != null)
+ return account != null && hasWifiOnlySync(account.getId());
+ }
+
+ public boolean hasWifiOnlySync(Long accountId)
+ {
+ if (accountId != null)
{
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(appContext);
- return sharedPref.getBoolean(SYNCHRO_WIFI_PREFIX + account.getId(), false);
+ return sharedPref.getBoolean(SYNCHRO_WIFI_PREFIX + accountId, false);
}
return false;
}
From 6217b57f1c7f353d2cc9c27f954068af0c22d834 Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Thu, 25 Feb 2016 17:29:01 +0100
Subject: [PATCH 28/35] ANDROID-231
---
.../signin/AccountOAuthFragment.java | 6 +--
.../application/managers/ConfigManager.java | 1 +
.../tools/DeveloperSessionManager.java | 50 +++++++++++++++++--
.../async/session/LoadSessionHelper.java | 4 --
.../android/ui/oauth/OAuthFragment.java | 17 ++++---
5 files changed, 60 insertions(+), 18 deletions(-)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountOAuthFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountOAuthFragment.java
index 54d7fa79..a5be4efa 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountOAuthFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/signin/AccountOAuthFragment.java
@@ -77,7 +77,7 @@ public AccountOAuthFragment()
public static AccountOAuthFragment newInstance(Context context)
{
- AccountOAuthFragment bf = new AccountOAuthFragment();
+ AccountOAuthFragment bf = getOAuthFragment(context, null);
Bundle b = createBundleArgs(R.layout.fr_oauth_cloud);
bf.setArguments(b);
return bf;
@@ -101,7 +101,7 @@ public static AccountOAuthFragment getOAuthFragment(Context context, AlfrescoAcc
{
String oauthUrl = null, apikey = null, apisecret = null;
Bundle b = SessionManager.getInstance(context).getOAuthSettings();
- if (b != null)
+ if (b != null && !b.isEmpty())
{
oauthUrl = b.getString(OAUTH_URL);
apikey = b.getString(OAUTH_API_KEY);
@@ -122,7 +122,7 @@ public static AccountOAuthFragment getOAuthFragment(Context context, AlfrescoAcc
AccountOAuthFragment oauthFragment;
if (oauthUrl == null || oauthUrl.isEmpty())
{
- oauthFragment = AccountOAuthFragment.newInstance(context);
+ oauthFragment = new AccountOAuthFragment();
}
else
{
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ConfigManager.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ConfigManager.java
index 348a2f7e..218441ea 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ConfigManager.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/managers/ConfigManager.java
@@ -373,6 +373,7 @@ public void onConfigContextEvent(ConfigurationEvent event)
@Subscribe
public void onSessionRequested(RequestSessionEvent event)
{
+ if (event.accountToLoad == null){return;}
if (hasConfig(event.accountToLoad.getId()))
{
currentService.remove(event.accountToLoad.getId());
diff --git a/extensions/tools/src/main/java/org/alfresco/mobile/android/application/extension/tools/DeveloperSessionManager.java b/extensions/tools/src/main/java/org/alfresco/mobile/android/application/extension/tools/DeveloperSessionManager.java
index c65e6493..a75135c4 100644
--- a/extensions/tools/src/main/java/org/alfresco/mobile/android/application/extension/tools/DeveloperSessionManager.java
+++ b/extensions/tools/src/main/java/org/alfresco/mobile/android/application/extension/tools/DeveloperSessionManager.java
@@ -61,7 +61,7 @@ public class DeveloperSessionManager extends SessionManager
private static final String CLOUD_BASIC_AUTH = "org.alfresco.mobile.binding.internal.cloud.basic";
- private static final String ALFRESCO_CLOUD_URL = "http://my.alfresco.com";
+ private static final String ALFRESCO_CLOUD_URL = "https://my.alfresco.com";
// ///////////////////////////////////////////////////////////////////////////
// CONSTRUCTORS
@@ -136,6 +136,10 @@ public Bundle getOAuthSettings()
IOUtils.closeStream(is);
}
}
+ else
+ {
+ return null;
+ }
return b;
}
@@ -165,6 +169,7 @@ public SettingsBuilder prepare(OAuthData oauthData)
{
this.isCloud = true;
this.oAuthData = oauthData;
+ prepareOauthURL();
return this;
}
@@ -194,8 +199,7 @@ protected void prepareData(AlfrescoAccount acc)
{
case AlfrescoAccount.TYPE_ALFRESCO_TEST_OAUTH:
isCloud = true;
- String apikey = null,
- apisecret = null;
+ String apikey = null, apisecret = null;
File f = new File(APP_CONFIG_PATH);
if (f.exists())
{
@@ -220,6 +224,7 @@ protected void prepareData(AlfrescoAccount acc)
}
baseUrl = acc.getUrl();
+ extraSettings.put(BASE_URL, baseUrl);
oAuthData = new OAuth2DataImpl(apikey, apisecret, acc.getAccessToken(), acc.getRefreshToken());
break;
default:
@@ -276,8 +281,8 @@ protected void prepareSSLSettings()
try
{
URI url = new URI(baseUrl);
- File f = AlfrescoStorageManager.getInstance(getContext()).getFileInPrivateFolder(
- url.getHost() + ".properties");
+ File f = AlfrescoStorageManager.getInstance(getContext())
+ .getFileInPrivateFolder(url.getHost() + ".properties");
if (f.exists() && f.isFile())
{
AlfrescoNotificationManager.getInstance(getContext()).showToast(R.string.security_ssl_disable);
@@ -290,6 +295,41 @@ protected void prepareSSLSettings()
}
}
+ protected void prepareOauthURL()
+ {
+ String tmpurl = null;
+ // Check Properties available inside the device
+ File f = new File(APP_CONFIG_PATH);
+ if (f.exists())
+ {
+ Properties prop = new Properties();
+ InputStream is = null;
+ try
+ {
+ is = new FileInputStream(f);
+ // load a properties file
+ prop.load(is);
+ tmpurl = prop.getProperty(OAUTH_URL);
+ }
+ catch (IOException ex)
+ {
+ throw new AlfrescoServiceException(ErrorCodeRegistry.PARSING_GENERIC, ex);
+ }
+ finally
+ {
+ IOUtils.closeStream(is);
+ }
+ }
+ if (tmpurl != null)
+ {
+ extraSettings.put(BASE_URL, tmpurl);
+ }
+ else
+ {
+ // extraSettings.put(BASE_URL, ALFRESCO_CLOUD_URL);
+ }
+ }
+
private Context getContext()
{
return contextRef.get();
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/async/session/LoadSessionHelper.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/async/session/LoadSessionHelper.java
index 7e8bd94d..d06822ab 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/async/session/LoadSessionHelper.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/async/session/LoadSessionHelper.java
@@ -33,7 +33,6 @@
import org.alfresco.mobile.android.platform.accounts.AlfrescoSessionSettings;
import android.content.Context;
-import android.util.Log;
public class LoadSessionHelper
{
@@ -85,8 +84,6 @@ public AlfrescoSession requestSession()
if (sessionSettings.isCloud)
{
- Log.d("[CLOUD]", "REQUEST CLOUD SESSION");
-
// CLOUD
oauthData = sessionSettings.oAuthData;
originalOauthData = oauthData;
@@ -101,7 +98,6 @@ public AlfrescoSession requestSession()
{
helper = new OAuthHelper();
}
- Log.d("[CLOUD]", "REFRESH TOKEN");
oauthData = helper.refreshToken(oauthData);
account = AccountOAuthHelper.saveNewOauthData(context, getAccount(), oauthData);
}
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/ui/oauth/OAuthFragment.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/ui/oauth/OAuthFragment.java
index 7a7c9827..abe29d68 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/ui/oauth/OAuthFragment.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/ui/oauth/OAuthFragment.java
@@ -28,6 +28,7 @@
import org.alfresco.mobile.android.foundation.R;
import org.alfresco.mobile.android.platform.AlfrescoNotificationManager;
import org.alfresco.mobile.android.platform.EventBusManager;
+import org.alfresco.mobile.android.platform.utils.AndroidVersion;
import android.graphics.Bitmap;
import android.os.Bundle;
@@ -38,6 +39,7 @@
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebChromeClient;
+import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
@@ -121,6 +123,10 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
webview = (WebView) v.findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
+ if (AndroidVersion.isLollipopOrAbove())
+ {
+ webview.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
+ }
final FragmentActivity activity = getActivity();
webview.setWebChromeClient(new WebChromeClient()
@@ -212,9 +218,9 @@ private void onCodeUrl(String url)
{
if (onOAuthAccessTokenListener != null)
{
- onOAuthAccessTokenListener.failedRequestAccessToken(new AlfrescoSessionException(
- ErrorCodeRegistry.SESSION_AUTH_CODE_INVALID, Messagesl18n
- .getString("ErrorCodeRegistry.SESSION_AUTH_CODE_INVALID")));
+ onOAuthAccessTokenListener.failedRequestAccessToken(
+ new AlfrescoSessionException(ErrorCodeRegistry.SESSION_AUTH_CODE_INVALID,
+ Messagesl18n.getString("ErrorCodeRegistry.SESSION_AUTH_CODE_INVALID")));
}
}
}
@@ -241,9 +247,8 @@ public void retrieveAccessToken(String code)
onOAuthAccessTokenListener.beforeRequestAccessToken(new Bundle());
}
- Operator.with(getActivity()).load(
- new RetrieveOAuthDataRequest.Builder(RetrieveOAuthDataRequest.OPERATION_ACCESS_TOKEN, baseOAuthUrl,
- code, apiKey, apiSecret, callback));
+ Operator.with(getActivity()).load(new RetrieveOAuthDataRequest.Builder(
+ RetrieveOAuthDataRequest.OPERATION_ACCESS_TOKEN, baseOAuthUrl, code, apiKey, apiSecret, callback));
}
@Subscribe
From 24e7600bdfec2873bde890450a361db0385987cd Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Thu, 25 Feb 2016 17:38:16 +0100
Subject: [PATCH 29/35] ANDROID-207
---
.../android/application/fragments/search/SearchFragment.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java
index dd5caef3..3c8aedf2 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/SearchFragment.java
@@ -539,12 +539,12 @@ private void updateForm(int id)
// iconResId = R.drawable.ic_person_light;
break;
case HistorySearch.TYPE_DOCUMENT:
- hintId = R.string.search_form_hint;
+ hintId = R.string.search;
screenName = AnalyticsManager.SCREEN_SEARCH_FILES;
// iconResId = R.drawable.ic_office;
break;
case HistorySearch.TYPE_FOLDER:
- hintId = R.string.search_form_hint;
+ hintId = R.string.search;
screenName = AnalyticsManager.SCREEN_SEARCH_FOLDERS;
// iconResId = R.drawable.ic_repository_light;
break;
From f03183922d13d76a35b9e4c909a744fabd669e37 Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Wed, 2 Mar 2016 18:55:26 +0100
Subject: [PATCH 30/35] ANDROID-275
---
.../fragments/search/QueryHelper.java | 103 ++++++++++++------
1 file changed, 71 insertions(+), 32 deletions(-)
diff --git a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/QueryHelper.java b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/QueryHelper.java
index de132e7c..8f14750a 100644
--- a/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/QueryHelper.java
+++ b/alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/fragments/search/QueryHelper.java
@@ -1,20 +1,20 @@
-/*******************************************************************************
- * Copyright (C) 2005-2014 Alfresco Software Limited.
+/*
+ * Copyright (C) 2005-2016 Alfresco Software Limited.
*
- * This file is part of Alfresco Mobile for Android.
+ * This file is part of Alfresco Mobile for Android.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *******************************************************************************/
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.alfresco.mobile.android.application.fragments.search;
import java.text.SimpleDateFormat;
@@ -88,14 +88,16 @@ public static String createQuery(boolean isSearchDocument, String name, String t
}
}
+ boolean isSimpleStatement = TextUtils.isEmpty(title) && TextUtils.isEmpty(description);
+
// Create the query based on properties
StringBuilder whereClause = new StringBuilder();
// Name
- addParenFolderParameter(whereClause, parentFolder);
+ addParenFolderParameter(whereClause, parentFolder, isSimpleStatement);
// Name
- addContainsParameter(whereClause, PropertyIds.NAME, name);
+ addContainsParameter(whereClause, PropertyIds.NAME, name, isSimpleStatement);
// Title
addAspectContainsParameter(whereClause, CMIS_PROP_TITLE, title);
@@ -104,10 +106,10 @@ public static String createQuery(boolean isSearchDocument, String name, String t
addAspectContainsParameter(whereClause, CMIS_PROP_DESCRIPTION, description);
// Mimetype
- addMimeTypeParameter(whereClause, mimetype);
+ addMimeTypeParameter(whereClause, mimetype, isSimpleStatement);
// ModifiedBy
- addParameter(whereClause, PropertyIds.LAST_MODIFIED_BY, OPERATOR_EQUAL, modifiedById);
+ addParameter(whereClause, PropertyIds.LAST_MODIFIED_BY, OPERATOR_EQUAL, modifiedById, isSimpleStatement);
// Modified FROM
if (modificationFrom != null)
@@ -115,7 +117,7 @@ public static String createQuery(boolean isSearchDocument, String name, String t
GregorianCalendar localModificationFrom = (GregorianCalendar) modificationFrom.clone();
localModificationFrom.add(Calendar.DAY_OF_MONTH, -1);
addDateParameter(whereClause, PropertyIds.LAST_MODIFICATION_DATE, OPERATOR_SUPERIOR,
- formatLast(localModificationFrom));
+ formatLast(localModificationFrom), isSimpleStatement);
}
// Modified TO
@@ -124,7 +126,7 @@ public static String createQuery(boolean isSearchDocument, String name, String t
GregorianCalendar localModificationTo = (GregorianCalendar) modificationTo.clone();
localModificationTo.add(Calendar.DAY_OF_MONTH, 1);
addDateParameter(whereClause, PropertyIds.LAST_MODIFICATION_DATE, OPERATOR_INFERIOR,
- formatFirst(localModificationTo));
+ formatFirst(localModificationTo), isSimpleStatement);
}
queryBuilder.append(whereClause);
@@ -137,9 +139,9 @@ public static String createQuery(boolean isSearchDocument, String name, String t
public static String createPersonSearchQuery(String name, String jobTitle, String company, String location)
{
StringBuilder queryBuilder = new StringBuilder(name);
- addPersonParameter(queryBuilder, "jobtitle", jobTitle);
- addPersonParameter(queryBuilder, "organization", company);
- addPersonParameter(queryBuilder, "location", location);
+ addPersonParameter(queryBuilder, "jobtitle", jobTitle, true);
+ addPersonParameter(queryBuilder, "organization", company, true);
+ addPersonParameter(queryBuilder, "location", location, true);
return queryBuilder.toString();
}
@@ -158,45 +160,71 @@ public static String formatLast(GregorianCalendar calendar)
return dateFormat.format(calendar.getTime()).concat("T23:59:59.999Z");
}
- private static void addParenFolderParameter(StringBuilder builder, Folder value)
+ private static void addParenFolderParameter(StringBuilder builder, Folder value, Boolean isSimpleStatement)
{
if (value == null) { return; }
if (builder.length() != 0)
{
builder.append(" AND ");
}
- builder.append(" IN_TREE('").append(value.getIdentifier()).append("')");
+ if (isSimpleStatement)
+ {
+ builder.append(" IN_TREE('");
+ }
+ else
+ {
+ builder.append(" IN_TREE(d,'");
+ }
+ builder.append(value.getIdentifier()).append("')");
}
- private static void addParameter(StringBuilder builder, String key, String operator, String value)
+ private static void addParameter(StringBuilder builder, String key, String operator, String value,
+ Boolean isSimpleStatement)
{
if (TextUtils.isEmpty(value)) { return; }
if (builder.length() != 0)
{
builder.append(" AND ");
}
+ if (!isSimpleStatement)
+ {
+ builder.append("d.");
+ }
builder.append(key);
builder.append(operator);
builder.append("'").append(value).append("'");
}
- private static void addContainsParameter(StringBuilder builder, String key, String value)
+ private static void addContainsParameter(StringBuilder builder, String key, String value, Boolean isSimpleStatement)
{
if (TextUtils.isEmpty(value)) { return; }
if (builder.length() != 0)
{
builder.append(" AND ");
}
- builder.append("CONTAINS('~").append(key).append(":\\\'").append(value).append("\\\'')");
+ if (isSimpleStatement)
+ {
+ builder.append("CONTAINS('~");
+ }
+ else
+ {
+ builder.append("CONTAINS(d, '~");
+ }
+ builder.append(key).append(":\\\'").append(value).append("\\\'')");
}
- private static void addDateParameter(StringBuilder builder, String key, String operator, String value)
+ private static void addDateParameter(StringBuilder builder, String key, String operator, String value,
+ Boolean isSimpleStatement)
{
if (TextUtils.isEmpty(value)) { return; }
if (builder.length() != 0)
{
builder.append(" AND ");
}
+ if (!isSimpleStatement)
+ {
+ builder.append("d.");
+ }
builder.append(key);
builder.append(" ");
builder.append(operator);
@@ -214,7 +242,7 @@ private static void addAspectContainsParameter(StringBuilder builder, String key
builder.append("CONTAINS(t, '~").append(key).append(":\\\'").append(value).append("\\\'')");
}
- private static void addPersonParameter(StringBuilder builder, String key, String value)
+ private static void addPersonParameter(StringBuilder builder, String key, String value, Boolean isSimpleStatement)
{
if (TextUtils.isEmpty(value)) { return; }
if (builder.length() != 0)
@@ -224,6 +252,10 @@ private static void addPersonParameter(StringBuilder builder, String key, String
String[] values = value.split(" ");
for (int i = 0; i < values.length; i++)
{
+ if (!isSimpleStatement)
+ {
+ builder.append("d.");
+ }
builder.append(key);
builder.append(":");
builder.append(values[i]);
@@ -231,7 +263,7 @@ private static void addPersonParameter(StringBuilder builder, String key, String
}
}
- private static void addMimeTypeParameter(StringBuilder builder, int mimetypeKey)
+ private static void addMimeTypeParameter(StringBuilder builder, int mimetypeKey, Boolean isSimpleStatement)
{
List types = null;
switch (mimetypeKey)
@@ -285,6 +317,10 @@ private static void addMimeTypeParameter(StringBuilder builder, int mimetypeKey)
{
builder.append(" AND ");
}
+ if (!isSimpleStatement)
+ {
+ builder.append("d.");
+ }
builder.append(PropertyIds.CONTENT_STREAM_MIME_TYPE);
builder.append(" IN (");
builder.append(sb);
@@ -327,6 +363,7 @@ private static List createAudioList()
return new ArrayList()
{
private static final long serialVersionUID = 1L;
+
{
add(new MimeType(MimeType.TYPE_AUDIO, "x-aiff"));
add(new MimeType(MimeType.TYPE_AUDIO, "vnd.adobe.soundbooth"));
@@ -410,7 +447,8 @@ private static List createPresentationsList()
add(new MimeType(MimeType.TYPE_APPLICATION, "vnd.oasis.opendocument.presentation"));
add(new MimeType(MimeType.TYPE_APPLICATION, "vnd.oasis.opendocument.presentation-template"));
add(new MimeType(MimeType.TYPE_APPLICATION, "vnd.ms-powerpoint.template.macroenabled.12"));
- add(new MimeType(MimeType.TYPE_APPLICATION, "vnd.openxmlformats-officedocument.presentationml.template"));
+ add(new MimeType(MimeType.TYPE_APPLICATION,
+ "vnd.openxmlformats-officedocument.presentationml.template"));
add(new MimeType(MimeType.TYPE_APPLICATION, "vnd.ms-powerpoint.slideshow.macroenabled.12"));
add(new MimeType(MimeType.TYPE_APPLICATION, "vnd.ms-powerpoint"));
add(new MimeType(MimeType.TYPE_APPLICATION, "vnd.ms-powerpoint.presentation.macroenabled.12"));
@@ -444,7 +482,8 @@ private static List createSpreadsheetsList()
add(new MimeType(MimeType.TYPE_APPLICATION, "vnd.ms-excel.sheet.macroenabled.12"));
add(new MimeType(MimeType.TYPE_APPLICATION, "vnd.openxmlformats-officedocument.spreadsheetml.sheet"));
add(new MimeType(MimeType.TYPE_APPLICATION, "vnd.ms-excel.template.macroenabled.12"));
- add(new MimeType(MimeType.TYPE_APPLICATION, "vnd.openxmlformats-officedocument.spreadsheetml.template"));
+ add(new MimeType(MimeType.TYPE_APPLICATION,
+ "vnd.openxmlformats-officedocument.spreadsheetml.template"));
}
};
}
From a86ef4c164f10c296e0a2b8f4aaee086769857ce Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Thu, 3 Mar 2016 16:01:12 +0100
Subject: [PATCH 31/35] ANDROID-274
---
.../src/main/res/values-de/strings.xml | 23 +++++++------
.../src/main/res/values-es/strings.xml | 23 +++++++------
.../src/main/res/values-fr/strings.xml | 23 +++++++------
.../src/main/res/values-it/strings.xml | 23 +++++++------
.../src/main/res/values-ja/strings.xml | 33 ++++++++++---------
.../src/main/res/values-zh-rCN/strings.xml | 23 +++++++------
6 files changed, 83 insertions(+), 65 deletions(-)
diff --git a/alfresco-mobile-android/src/main/res/values-de/strings.xml b/alfresco-mobile-android/src/main/res/values-de/strings.xml
index e8f6d5b5..6ce671aa 100644
--- a/alfresco-mobile-android/src/main/res/values-de/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values-de/strings.xml
@@ -1,14 +1,14 @@
de
-
+ Version
@@ -342,7 +342,10 @@
Wählen Sie aus, welche Registerkarten in Ihrem Menü verfügbar sind.MenüIhr Alfresco Administrator hat diese Funktion deaktiviert.
-
+ Feedback
+ Diagnose einsenden
+ Um Alfresco Mobile weiter zu verbessern, sammeln wir anonym technische Diagnosedaten. Wenn Sie möchten, können Sie dies hier abstellen.
+ Feedback einsenden
@@ -734,7 +737,7 @@
Ordner "Favoriten"AlfrescoAlfresco in the Cloud
- Alfresco vor Ort
+ Alfresco Server
@@ -904,4 +907,4 @@
Dieser Inhalt stammt nicht aus einer unterstützten Quelle. Bitte wählen Sie etwas anderes.]]>
-
\ No newline at end of file
+
diff --git a/alfresco-mobile-android/src/main/res/values-es/strings.xml b/alfresco-mobile-android/src/main/res/values-es/strings.xml
index 7046b066..ddd0e816 100644
--- a/alfresco-mobile-android/src/main/res/values-es/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values-es/strings.xml
@@ -1,14 +1,14 @@
es
-
+ Versión
@@ -342,7 +342,10 @@
Seleccione las pestañas disponibles en su menú.MenúSu administrador de Alfresco ha deshabilitado esta función.
-
+ Comentarios
+ Enviar diagnósticos
+ Para ayudarnos a mejorar Alfresco Mobile, recopilamos datos de diagnósticos técnicos anónimos. Puede desactivar esta opción si lo prefiere.
+ Enviar comentarios
@@ -734,7 +737,7 @@
Carpeta de favoritosAlfrescoAlfresco in the Cloud
- Alfresco On Premise
+ Servidor de Alfresco
@@ -904,4 +907,4 @@
Este contenido no proviene de una fuente de contenido compatible. Seleccione otro.]]>
-
\ No newline at end of file
+
diff --git a/alfresco-mobile-android/src/main/res/values-fr/strings.xml b/alfresco-mobile-android/src/main/res/values-fr/strings.xml
index 5552c0c9..1dc917ec 100644
--- a/alfresco-mobile-android/src/main/res/values-fr/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values-fr/strings.xml
@@ -1,14 +1,14 @@
fr
-
+ Version
@@ -342,7 +342,10 @@
Sélectionnez les onglets disponibles dans votre menu.MenuVotre administrateur Alfresco a désactivé cette fonctionnalité.
-
+ Vos données
+ Envoyer le diagnostic
+ Aidez-nous à améliorer Alfresco Mobile en nous envoyant vos données de diagnostic technique qui resteront anonymes. Désactivez l'option, le cas échéant.
+ Envoyer les données
@@ -734,7 +737,7 @@
Dossier FavorisAlfrescoAlfresco in the Cloud
- Alfresco sur site
+ Serveur Alfresco
@@ -904,4 +907,4 @@
Ce contenu ne provient pas d\'une source de contenu prise en charge. Veuillez en sélectionner un autre.]]>
-
\ No newline at end of file
+
diff --git a/alfresco-mobile-android/src/main/res/values-it/strings.xml b/alfresco-mobile-android/src/main/res/values-it/strings.xml
index 790f895d..d20cdadb 100644
--- a/alfresco-mobile-android/src/main/res/values-it/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values-it/strings.xml
@@ -1,14 +1,14 @@
it
-
+ Versione
@@ -342,7 +342,10 @@
Seleziona le schede disponibili sul menu personale.MenuFunzione disabilitata dall\'amministratore Alfresco.
-
+ Commenti
+ Invia diagnostica
+ Al fine di migliorare Alfresco Mobile, raccogliamo dati tecnici anonimi relativi alla diagnostica. Disattivare, se lo si preferisce.
+ Invia commenti
@@ -734,7 +737,7 @@
Cartella dei preferitiAlfrescoAlfresco in the Cloud
- Alfresco on premise
+ Server Alfresco
@@ -904,4 +907,4 @@
Questi contenuti non provengono da una fonte supportata. Selezionare altri contenuti.]]>
-
\ No newline at end of file
+
diff --git a/alfresco-mobile-android/src/main/res/values-ja/strings.xml b/alfresco-mobile-android/src/main/res/values-ja/strings.xml
index 64bed60b..72c606c7 100644
--- a/alfresco-mobile-android/src/main/res/values-ja/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values-ja/strings.xml
@@ -1,14 +1,14 @@
Alfresco in the Cloud
- Alfresco Server
+ Alfresco サーバーお待ちください
@@ -165,17 +165,17 @@
ja
-
+ バージョンバージョン:
- SDK:
+ SDK:
Alfresco Mobile は Alfresco in the Cloud とオンプレミスの Alfresco Server (3.4 以上) に接続して、社内のコンテンツに外出先から安全にアクセスできるようにします。
+
Alfresco Mobile は Alfresco in the Cloud とオンプレミスの Alfresco サーバー (3.4 以上) に接続して、外出先からでも社内のコンテンツに安全にアクセスできるようにします。
-
Alfresco Mobile は、Alfresco のログイン資格情報を使用して (HTTP または HTTPS 経由で) Alfresco のリポジトリに接続し、権限に基づいてユーザーのアクセスを管理します。
+
Alfresco Mobile は、Alfresco のログイン資格情報を使用して (HTTP または HTTPS 経由で) Alfresco のリポジトリに接続し、権限に基づいてユーザーのアクセスを管理します。
]]>
@@ -342,7 +342,10 @@
メニューに表示するタブを選択してください。メニューAlfresco 管理者がこの機能を無効に設定しています。
-
+ フィードバック
+ 診断データの送信
+ 弊社は、Alfresco Mobile の改善に役立てるために技術的な診断データを匿名で収集しています。データの提供を希望されない場合は、チェックマークを外してください。
+ フィードバックの送信
@@ -734,7 +737,7 @@
[お気に入り] フォルダAlfrescoAlfresco in the Cloud
- Alfresco On Premise
+ Alfresco サーバー
@@ -798,7 +801,7 @@
アカウントの表示名リポジトリに接続しているサーバーの名前。
- Alfresco Server
+ Alfresco サーバー
@@ -904,4 +907,4 @@
このコンテンツは、リンクできないソースに属しています。 別のコンテンツを選択してください。]]>
-
\ No newline at end of file
+
diff --git a/alfresco-mobile-android/src/main/res/values-zh-rCN/strings.xml b/alfresco-mobile-android/src/main/res/values-zh-rCN/strings.xml
index 53c3c008..07aa836a 100644
--- a/alfresco-mobile-android/src/main/res/values-zh-rCN/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values-zh-rCN/strings.xml
@@ -1,14 +1,14 @@
zh_cn
-
+ 版本
@@ -342,7 +342,10 @@
选择菜单上可用的选项卡。菜单您的 Alfresco 管理员已禁用此功能。
-
+ 反馈
+ 发送诊断数据
+ 为了帮助我们改进 Alfresco Mobile,我们收集匿名技术诊断数据。如果愿意,请关闭。
+ 发送反馈
@@ -734,7 +737,7 @@
收藏夹文件夹AlfrescoAlfresco in the Cloud
- Alfresco 内部部署
+ Alfresco 服务器
@@ -904,4 +907,4 @@
此内容不是来自受支持的内容源。请选择其他内容源。]]>
-
\ No newline at end of file
+
From 71987de285e361fbfb77a2574e401c32b7e4dfa5 Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Thu, 3 Mar 2016 16:13:58 +0100
Subject: [PATCH 32/35] ANDROID-274
---
alfresco-mobile-android/src/main/res/values-fr/strings.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/alfresco-mobile-android/src/main/res/values-fr/strings.xml b/alfresco-mobile-android/src/main/res/values-fr/strings.xml
index 1dc917ec..7d213159 100644
--- a/alfresco-mobile-android/src/main/res/values-fr/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values-fr/strings.xml
@@ -344,7 +344,7 @@
Votre administrateur Alfresco a désactivé cette fonctionnalité.Vos donnéesEnvoyer le diagnostic
- Aidez-nous à améliorer Alfresco Mobile en nous envoyant vos données de diagnostic technique qui resteront anonymes. Désactivez l'option, le cas échéant.
+ Aidez-nous à améliorer Alfresco Mobile en nous envoyant vos données de diagnostic technique qui resteront anonymes. Désactivez l\'option, le cas échéant.Envoyer les données
From 01de9f92d26315cc213e60a682d10da313a3a03d Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Mon, 7 Mar 2016 16:35:04 +0100
Subject: [PATCH 33/35] ANDROID-274
---
.../src/main/res/values-ja/strings.xml | 12 ++++++------
.../src/main/res/values/strings.xml | 2 +-
.../android/platform/extensions/AnalyticsHelper.java | 3 ---
.../src/main/res/values-ja/alfresco_strings.xml | 2 +-
4 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/alfresco-mobile-android/src/main/res/values-ja/strings.xml b/alfresco-mobile-android/src/main/res/values-ja/strings.xml
index 72c606c7..3da8c961 100644
--- a/alfresco-mobile-android/src/main/res/values-ja/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values-ja/strings.xml
@@ -21,7 +21,7 @@
使用できる Alfresco アカウントがありません
- Alfresco Server のホスト名を入力してください
+ Alfresco サーバーのホスト名を入力してくださいホスト名続行完了
@@ -64,8 +64,8 @@
ホスト名は、www.example.com のような形式で入力してください (必須です)。www.example.com (必須)説明
- 説明を入力します (任意です)。 デフォルトは Alfresco Server です
- Alfresco Server (任意)
+ 説明を入力します (任意です)。 デフォルトは Alfresco サーバーです
+ Alfresco サーバー (任意)詳細設定アカウントの認証方法HTTPS
@@ -791,13 +791,13 @@
ユーザー名
- Alfresco Server に接続するときに使用するユーザー名
+ Alfresco サーバーに接続するときに使用するユーザー名Alfresco リポジトリの URL
- Alfresco Server の接続先
+ Alfresco サーバーの接続先Alfresco Share の URL
- Alfresco Share Server の接続先
+ Alfresco Share サーバーの接続先アカウントの表示名リポジトリに接続しているサーバーの名前。
diff --git a/alfresco-mobile-android/src/main/res/values/strings.xml b/alfresco-mobile-android/src/main/res/values/strings.xml
index 37a9f0dc..0988ed54 100644
--- a/alfresco-mobile-android/src/main/res/values/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values/strings.xml
@@ -398,7 +398,7 @@
Keep your files in syncYou can view and edit your synced files when you\'re offline
- Sync has changed !
+ Sync has changed!You can now sync different files on different devices. Just find a file and sync it!View and edit your synced files when you\'re offline. When you\'re back online they\'ll automatically sync with Alfresco.What about the files I already favorited?
diff --git a/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/extensions/AnalyticsHelper.java b/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/extensions/AnalyticsHelper.java
index f590b6a6..e31f6df2 100644
--- a/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/extensions/AnalyticsHelper.java
+++ b/platform/foundation/src/main/java/org/alfresco/mobile/android/platform/extensions/AnalyticsHelper.java
@@ -135,7 +135,6 @@ protected static Integer getNumberOfSyncedFolder(Context context, AlfrescoAccoun
null, null);
syncedFolders = syncedCursor != null ? syncedCursor.getCount() : 0;
CursorUtils.closeCursor(syncedCursor);
- Log.d("Analytics Folders", syncedFolders + "");
}
catch (Exception e)
{
@@ -159,7 +158,6 @@ protected static Integer getNumberOfSyncedFiles(Context context, AlfrescoAccount
null, null);
syncedFiles = syncedCursor != null ? syncedCursor.getCount() : 0;
CursorUtils.closeCursor(syncedCursor);
- Log.d("Analytics Files", syncedFiles + "");
}
catch (Exception e)
{
@@ -189,7 +187,6 @@ protected static Long getSizeOfSyncedFiles(Context context, AlfrescoAccount acco
}
}
CursorUtils.closeCursor(syncedCursor);
- Log.d("Analytics Size", syncedSize + "");
}
catch (Exception e)
{
diff --git a/platform/foundation/src/main/res/values-ja/alfresco_strings.xml b/platform/foundation/src/main/res/values-ja/alfresco_strings.xml
index 5459db1d..e5fc2c81 100644
--- a/platform/foundation/src/main/res/values-ja/alfresco_strings.xml
+++ b/platform/foundation/src/main/res/values-ja/alfresco_strings.xml
@@ -303,7 +303,7 @@
アカウント情報を確認しています…アカウントを使用する準備ができました。
- Alfresco Server
+ Alfresco サーバーAlfresco in the Cloud
From e3c9dda924fd6a5d448781c35718afd9b2bdb416 Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Tue, 8 Mar 2016 09:50:30 +0100
Subject: [PATCH 34/35] ANDROID-278
---
.../extension/tools/DeveloperSessionManager.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/extensions/tools/src/main/java/org/alfresco/mobile/android/application/extension/tools/DeveloperSessionManager.java b/extensions/tools/src/main/java/org/alfresco/mobile/android/application/extension/tools/DeveloperSessionManager.java
index a75135c4..04980687 100644
--- a/extensions/tools/src/main/java/org/alfresco/mobile/android/application/extension/tools/DeveloperSessionManager.java
+++ b/extensions/tools/src/main/java/org/alfresco/mobile/android/application/extension/tools/DeveloperSessionManager.java
@@ -31,6 +31,7 @@
import org.alfresco.mobile.android.api.session.authentication.OAuthData;
import org.alfresco.mobile.android.api.session.authentication.impl.OAuth2DataImpl;
import org.alfresco.mobile.android.api.utils.IOUtils;
+import org.alfresco.mobile.android.async.session.RequestSessionEvent;
import org.alfresco.mobile.android.platform.AlfrescoNotificationManager;
import org.alfresco.mobile.android.platform.SessionManager;
import org.alfresco.mobile.android.platform.accounts.AlfrescoAccount;
@@ -42,6 +43,8 @@
import android.os.Bundle;
import android.os.Environment;
+import com.squareup.otto.Subscribe;
+
public class DeveloperSessionManager extends SessionManager
{
public static final String OAUTH_URL = "oauth_url";
@@ -84,6 +87,15 @@ protected DeveloperSessionManager(Context context)
super(context);
}
+ // ///////////////////////////////////////////////////////////////////////////
+ // EVENTS RECEIVER
+ // ///////////////////////////////////////////////////////////////////////////
+ @Subscribe
+ public void onSessionRequested(RequestSessionEvent event)
+ {
+ super.onSessionRequested(event);
+ }
+
// ///////////////////////////////////////////////////////////////////////////
// SETTINGS
// ///////////////////////////////////////////////////////////////////////////
From cc42380d029b602ea8e1d846a88f682d0b85ff94 Mon Sep 17 00:00:00 2001
From: jmpascal
Date: Tue, 8 Mar 2016 10:03:31 +0100
Subject: [PATCH 35/35] ANDROID-274
---
alfresco-mobile-android/src/main/res/values-it/strings.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/alfresco-mobile-android/src/main/res/values-it/strings.xml b/alfresco-mobile-android/src/main/res/values-it/strings.xml
index d20cdadb..864e8f80 100644
--- a/alfresco-mobile-android/src/main/res/values-it/strings.xml
+++ b/alfresco-mobile-android/src/main/res/values-it/strings.xml
@@ -344,7 +344,7 @@
Funzione disabilitata dall\'amministratore Alfresco.CommentiInvia diagnostica
- Al fine di migliorare Alfresco Mobile, raccogliamo dati tecnici anonimi relativi alla diagnostica. Disattivare, se lo si preferisce.
+ Al fine di migliorare Alfresco Mobile, vengono raccolti dati tecnici anonimi relativi alla diagnostica. Disattiva l\'opzione, se lo preferisci.Invia commenti