git clone of logicmail with some fixes/features added
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Upgraded to the 0.93 beta version of the analytics SDK, and added screen tracking (refs #343)

git-svn-id: https://logicmail.svn.sourceforge.net/svnroot/logicmail/trunk@962 5c734088-3d25-0410-9155-b3c3832efda5

octorian 9664ceea c1abe135

+166 -28
+1 -1
LogicMail/project.properties
··· 41 41 # If these parameters are omitted, the application will be built without 42 42 # analytics support. 43 43 # 44 - #webtrends.library=../lib/AnalyticsServicev0.9Beta.jar 44 + #webtrends.library=../lib/AnalyticsServicev0.93Beta.jar 45 45 #webtrends.dcsid=
+6 -6
LogicMail/src/org/logicprobe/LogicMail/AnalyticsDataCollector.java
··· 141 141 String eventType); 142 142 143 143 /** 144 - * Tracks instances that a user views content in an application. 144 + * Tracks instances that a user views a screen in an application. 145 145 * 146 - * @param eventPath The hierarchical location of where an object or content 146 + * @param eventPath The hierarchical location of where an object or screen 147 147 * is located in an application. 148 148 * @param eventDesc The name of the screen where the event occurs. 149 149 * @param eventType The event type. 150 - * @param contentGroup A category name for the content. 150 + * @param contentGroup A category name for the screen. 151 151 */ 152 - public abstract void onContentView( 152 + public abstract void onScreenView( 153 153 String eventPath, 154 154 String eventDesc, 155 155 String eventType, 156 - String contentGroup); 157 - 156 + String contentGroup); 157 + 158 158 /** 159 159 * Tracks instances that media events occur in an application. 160 160 *
+1 -1
LogicMail/src/org/logicprobe/LogicMail/StubDataCollector.java
··· 50 50 String eventDesc, 51 51 String eventType) { } 52 52 53 - public void onContentView( 53 + public void onScreenView( 54 54 String eventPath, 55 55 String eventDesc, 56 56 String eventType,
+38 -1
LogicMail/src/org/logicprobe/LogicMail/ui/AbstractConfigScreen.java
··· 34 34 import org.logicprobe.LogicMail.PlatformInfo; 35 35 36 36 import net.rim.device.api.i18n.ResourceBundle; 37 + import net.rim.device.api.ui.Screen; 37 38 import net.rim.device.api.ui.container.MainScreen; 38 39 import net.rim.device.api.ui.component.LabelField; 39 40 ··· 45 46 public abstract class AbstractConfigScreen extends MainScreen { 46 47 protected static ResourceBundle resources = ResourceBundle.getBundle(LogicMailResource.BUNDLE_ID, LogicMailResource.BUNDLE_NAME); 47 48 protected static final boolean hasIndicators = PlatformInfo.getInstance().hasApplicationIndicators(); 48 - 49 + private final String screenName; 50 + private String screenPath = ""; 51 + 49 52 /** 50 53 * Instantiates a new abstract configuration screen. 51 54 * ··· 55 58 LabelField titleField = 56 59 new LabelField(title, LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH); 57 60 setTitle(titleField); 61 + screenName = getSimpleClassName(getClass().getName()); 62 + } 63 + 64 + private static String getSimpleClassName(String className) { 65 + int p = className.lastIndexOf('.'); 66 + if(p != -1 && p < className.length() - 1) { 67 + return className.substring(p + 1); 68 + } 69 + else { 70 + return className; 71 + } 72 + } 73 + 74 + protected String getScreenName() { 75 + return screenName; 76 + } 77 + 78 + protected String getScreenPath() { 79 + return screenPath; 80 + } 81 + 82 + protected void onUiEngineAttached(boolean attached) { 83 + if(attached) { 84 + Screen screen = getScreenBelow(); 85 + if(screen instanceof StandardScreen) { 86 + screenPath = ((StandardScreen)screen).getScreenPath() + '/' + screenName; 87 + } 88 + else { 89 + screenPath = '/' + screenName; 90 + } 91 + } 92 + else { 93 + screenPath = ""; 94 + } 58 95 } 59 96 }
+18
LogicMail/src/org/logicprobe/LogicMail/ui/AccountConfigScreen.java
··· 51 51 import net.rim.device.api.ui.component.TextField; 52 52 import net.rim.device.api.ui.text.TextFilter; 53 53 54 + import org.logicprobe.LogicMail.AnalyticsDataCollector; 54 55 import org.logicprobe.LogicMail.LogicMailResource; 55 56 import org.logicprobe.LogicMail.conf.AccountConfig; 56 57 import org.logicprobe.LogicMail.conf.ConnectionConfig; ··· 554 555 manager.add(new LabelField()); 555 556 556 557 return manager; 558 + } 559 + 560 + protected void onUiEngineAttached(boolean attached) { 561 + super.onUiEngineAttached(attached); 562 + if(attached) { 563 + String eventType; 564 + if(accountConfig instanceof ImapConfig) { 565 + eventType = "Account_IMAP"; 566 + } 567 + else if(accountConfig instanceof PopConfig) { 568 + eventType = "Account_POP"; 569 + } 570 + else { 571 + eventType = "Account"; 572 + } 573 + AnalyticsDataCollector.getInstance().onScreenView(getScreenPath(), getScreenName(), eventType, "Configuration"); 574 + } 557 575 } 558 576 559 577 public void screenFieldChanged(Field field, int context) {
+23
LogicMail/src/org/logicprobe/LogicMail/ui/CompositionScreen.java
··· 225 225 this.sourceMessageNode = messageNode; 226 226 } 227 227 228 + public void onDisplay() { 229 + super.onDisplay(); 230 + 231 + String eventType; 232 + switch(composeType) { 233 + case COMPOSE_REPLY: 234 + eventType = "ReplyMessage"; 235 + break; 236 + case COMPOSE_REPLY_ALL: 237 + eventType = "ReplyAllMessage"; 238 + break; 239 + case COMPOSE_FORWARD: 240 + eventType = "ForwardMessage"; 241 + break; 242 + case COMPOSE_NORMAL: 243 + default: 244 + eventType = "NormalMessage"; 245 + break; 246 + } 247 + String contentGroup = accountNode.getProtocolName(); 248 + AnalyticsDataCollector.getInstance().onScreenView(getScreenPath(), getScreenName(), eventType, contentGroup); 249 + } 250 + 228 251 private void messageNodeListener_MessageStatusChanged(MessageNodeEvent e) { 229 252 int type = e.getType(); 230 253 if(type == MessageNodeEvent.TYPE_STRUCTURE_LOADED
+2 -1
LogicMail/src/org/logicprobe/LogicMail/ui/ConfigScreen.java
··· 161 161 }; 162 162 163 163 protected void onUiEngineAttached(boolean attached) { 164 + super.onUiEngineAttached(attached); 164 165 if(attached) { 165 166 MailSettings.getInstance().addMailSettingsListener(mailSettingsListener); 167 + AnalyticsDataCollector.getInstance().onScreenView(getScreenPath(), getScreenName(), "Global", "Configuration"); 166 168 } 167 169 else { 168 170 MailSettings.getInstance().removeMailSettingsListener(mailSettingsListener); 169 171 } 170 - super.onUiEngineAttached(attached); 171 172 }; 172 173 173 174 private void initFileSystemChoices() {
+8
LogicMail/src/org/logicprobe/LogicMail/ui/IdentityConfigScreen.java
··· 39 39 import net.rim.device.api.ui.component.EmailAddressEditField; 40 40 import net.rim.device.api.ui.component.LabelField; 41 41 42 + import org.logicprobe.LogicMail.AnalyticsDataCollector; 42 43 import org.logicprobe.LogicMail.LogicMailResource; 43 44 import org.logicprobe.LogicMail.conf.IdentityConfig; 44 45 ··· 108 109 add(contentFieldManager); 109 110 } 110 111 112 + protected void onUiEngineAttached(boolean attached) { 113 + super.onUiEngineAttached(attached); 114 + if(attached) { 115 + AnalyticsDataCollector.getInstance().onScreenView(getScreenPath(), getScreenName(), "Identity", "Configuration"); 116 + } 117 + } 118 + 111 119 protected boolean onSavePrompt() { 112 120 if(identityNameField.getText().length() > 0 && 113 121 emailAddressField.getText().length() > 0) {
+5
LogicMail/src/org/logicprobe/LogicMail/ui/MailHomeScreen.java
··· 239 239 }; 240 240 } 241 241 242 + public void onDisplay() { 243 + super.onDisplay(); 244 + AnalyticsDataCollector.getInstance().onScreenView(getScreenPath(), getScreenName(), "MailHome", "Home"); 245 + } 246 + 242 247 private abstract class TreeNodeMenuItem extends MenuItem { 243 248 public TreeNodeMenuItem(ResourceBundle bundle, int id, int ordinal, int priority) { 244 249 super(bundle, id, ordinal, priority);
+1 -1
LogicMail/src/org/logicprobe/LogicMail/ui/MailboxScreen.java
··· 200 200 break; 201 201 } 202 202 String contentGroup = mailboxNode.getParentAccount().getProtocolName(); 203 - AnalyticsDataCollector.getInstance().onContentView(getScreenPath(), getScreenName(), eventType, contentGroup); 203 + AnalyticsDataCollector.getInstance().onScreenView(getScreenPath(), getScreenName(), eventType, contentGroup); 204 204 205 205 if(this.hideDeleted != globalConfig.getHideDeletedMsg()) { 206 206 this.hideDeleted = !this.hideDeleted;
+23
LogicMail/src/org/logicprobe/LogicMail/ui/MessagePropertiesScreen.java
··· 30 30 */ 31 31 package org.logicprobe.LogicMail.ui; 32 32 33 + import org.logicprobe.LogicMail.AnalyticsDataCollector; 33 34 import org.logicprobe.LogicMail.LogicMailResource; 34 35 import org.logicprobe.LogicMail.conf.MailSettings; 35 36 import org.logicprobe.LogicMail.mail.MessageToken; ··· 246 247 buf.append(messageToken.getMessageUid()); 247 248 } 248 249 return buf.toString(); 250 + } 251 + 252 + protected void onDisplay() { 253 + super.onDisplay(); 254 + if(getScreenBelow() instanceof StandardScreen) { 255 + StandardScreen below = (StandardScreen)getScreenBelow(); 256 + 257 + String eventType; 258 + if(messageNode instanceof OutgoingMessageNode) { 259 + eventType = "OutgoingMessage"; 260 + } 261 + else { 262 + eventType = "Message"; 263 + } 264 + String contentGroup = messageNode.getParent().getParentAccount().getProtocolName(); 265 + 266 + AnalyticsDataCollector.getInstance().onScreenView( 267 + below.getScreenPath() + "/MessageProperties", 268 + "MessageProperties", 269 + eventType, 270 + contentGroup); 271 + } 249 272 } 250 273 251 274 private MenuItem closeItem = new MenuItem(resources, LogicMailResource.MENUITEM_CLOSE, 200000, 10) {
+11
LogicMail/src/org/logicprobe/LogicMail/ui/MessageScreen.java
··· 296 296 */ 297 297 public void onDisplay() { 298 298 super.onDisplay(); 299 + 300 + String eventType; 301 + if(messageNode instanceof OutgoingMessageNode) { 302 + eventType = "OutgoingMessage"; 303 + } 304 + else { 305 + eventType = "Message"; 306 + } 307 + String contentGroup = messageNode.getParent().getParentAccount().getProtocolName(); 308 + AnalyticsDataCollector.getInstance().onScreenView(getScreenPath(), getScreenName(), eventType, contentGroup); 309 + 299 310 padAndFocusScreen(); 300 311 301 312 messageNode.addMessageNodeListener(messageNodeListener);
+8
LogicMail/src/org/logicprobe/LogicMail/ui/OutgoingConfigScreen.java
··· 44 44 import net.rim.device.api.ui.component.SeparatorField; 45 45 import net.rim.device.api.ui.text.TextFilter; 46 46 47 + import org.logicprobe.LogicMail.AnalyticsDataCollector; 47 48 import org.logicprobe.LogicMail.LogicMailResource; 48 49 import org.logicprobe.LogicMail.conf.ConnectionConfig; 49 50 import org.logicprobe.LogicMail.conf.OutgoingConfig; ··· 222 223 add(contentFieldManager); 223 224 } 224 225 226 + protected void onUiEngineAttached(boolean attached) { 227 + super.onUiEngineAttached(attached); 228 + if(attached) { 229 + AnalyticsDataCollector.getInstance().onScreenView(getScreenPath(), getScreenName(), "Outgoing", "Configuration"); 230 + } 231 + } 232 + 225 233 private void serverSecurityField_FieldChanged(Field field, int context) { 226 234 if(serverSecurityField.getSelectedIndex() == ConnectionConfig.SECURITY_SSL) { 227 235 serverPortField.setText("465");
+2 -2
LogicMailStartup/.classpath
··· 4 4 <classpathentry kind="src" path="res"/> 5 5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/net.rim.ejde.BlackBerryVMInstallType/BlackBerry JRE 4.5.0"/> 6 6 <classpathentry combineaccessrules="false" kind="src" path="/LogicMail"/> 7 - <classpathentry exported="true" kind="lib" path="/lib/AnalyticsServicev0.9Beta.jar"> 7 + <classpathentry exported="true" kind="lib" path="/lib/AnalyticsServicev0.93Beta.jar"> 8 8 <attributes> 9 - <attribute name="javadoc_location" value="jar:platform:/resource/lib/AnalyticsServicev0.9Beta-doc.zip!/"/> 9 + <attribute name="javadoc_location" value="jar:platform:/resource/lib/AnalyticsServicev0.93Beta-doc.zip!/"/> 10 10 </attributes> 11 11 </classpathentry> 12 12 <classpathentry kind="output" path="bin"/>
+3 -3
LogicMailStartup/src/org/logicprobe/LogicMail/LogicMailWebtrendsDataCollector.java
··· 119 119 } 120 120 } 121 121 122 - public void onContentView( 122 + public void onScreenView( 123 123 String eventPath, 124 124 String eventDesc, 125 125 String eventType, 126 126 String contentGroup) { 127 127 try { 128 - dataCollector.onContentView(eventPath, eventDesc, eventType, null, contentGroup); 128 + dataCollector.onScreenView(eventPath, eventDesc, eventType, null, contentGroup); 129 129 } 130 130 catch (IllegalWebtrendsParameterValueException err) { 131 131 collectorLogger.e(err.getMessage()); 132 132 } 133 133 } 134 - 134 + 135 135 public void onMediaEvent( 136 136 String eventPath, 137 137 String eventDesc,
+4
LogicMail_BB47/src/org/logicprobe/LogicMail/ui/TouchMailHomeScreen.java
··· 41 41 super(mailRootNode); 42 42 } 43 43 44 + public String getScreenName() { 45 + return "MailHomeScreen"; 46 + } 47 + 44 48 protected Bitmap getNodeIcon(Node node) { 45 49 return TouchNodeIcons.getBigIcon(node); 46 50 }
+5 -5
lib/README.txt
··· 14 14 bb-ant-tools.patch | Patch to BlackBerry Ant Tools 15 15 ant-contrib-1.0b3.jar | Ant-Contrib Tasks 16 16 hammockmaker-2.1.0.jar | HammockMaker tool (from the Hammock distribution) 17 - AnalyticsServicev0.9Beta.jar | BlackBerry Analytics Service SDK 18 - AnalyticsServicev0.9Beta-doc.zip | JavaDocs for above 19 - webtrends-template.xml | Analtics configuration template 17 + AnalyticsServicev0.93Beta.jar | BlackBerry Analytics Service SDK 18 + AnalyticsServicev0.93Beta-doc.zip | JavaDocs for above 19 + webtrends-template.xml | Analtics configuration template 20 20 21 21 22 22 Sources: ··· 35 35 http://hammingweight.com/modules/hammock/ 36 36 BlackBerry Analytics Service SDK 37 37 http://us.blackberry.com/developers/platform/analyticsservice/ 38 - Not included due possible legal issues with redistribution. 39 - LogicMail can be successfully built and run without these libraries. 38 + Not included due to possible legal issues with redistribution. 39 + LogicMail can be successfully built and run without this library.
+7 -7
lib/webtrends-template.xml
··· 6 6 <!-- Entertainment --> 7 7 <!-- Finance --> 8 8 <!-- Games --> 9 - <!-- Health & Wellness --> 10 - <!-- IM & Social Networking --> 11 - <!-- Maps & Navigation --> 12 - <!-- Music & Audio --> 9 + <!-- Health and Wellness --> 10 + <!-- IM and Social Networking --> 11 + <!-- Maps and Navigation --> 12 + <!-- Music and Audio --> 13 13 <!-- News --> 14 - <!-- Photo & Video --> 14 + <!-- Photo and Video --> 15 15 <!-- Productivity --> 16 - <!-- Reference & eBooks --> 16 + <!-- Reference and eBooks --> 17 17 <!-- Shopping --> 18 - <!-- Sports & Recreation --> 18 + <!-- Sports and Recreation --> 19 19 <!-- Test Center --> 20 20 <!-- Themes --> 21 21 <!-- Travel -->