Skip to content

Commit

Permalink
3.0 beta 3
Browse files Browse the repository at this point in the history
Phone home system: shows startup response from server if mq3rsshow in
message
Phone home system: hideFromDialog true inhibits message showing up in
dialog.
  • Loading branch information
wmaddisn committed Aug 27, 2014
1 parent 2b97579 commit 8e3d4f3
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Source/mesquite/Mesquite.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public class Mesquite extends MesquiteTrunk
{
/*.................................................................................................................*/
public String getCitation() {
return "Maddison, W.P. & D.R. Maddison. 2014. Mesquite: A modular system for evolutionary analysis. Version 3.0beta. http://mesquiteproject.org";
return "Maddison, W.P. & D.R. Maddison. 2014. Mesquite: A modular system for evolutionary analysis. Version 3.0beta3. http://mesquiteproject.org";
}
/*.................................................................................................................*/
public String getVersion() {
return "3.0 beta 2";
return "3.0 beta 3";
}

/*.................................................................................................................*/
Expand Down
4 changes: 2 additions & 2 deletions Source/mesquite/lib/MesquiteModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public abstract class MesquiteModule extends EmployerEmployee implements Command
/*.................................................................................................................*/
/** returns build date of the Mesquite system (e.g., "22 September 2003") */
public final static String getBuildDate() {
return "26 August 2014";
return "27 August 2014";
}
/*.................................................................................................................*/
/** returns version of the Mesquite system */
Expand All @@ -90,7 +90,7 @@ public final static String getBuildLetter() {
public final static int getBuildNumber() {
//as of 26 Dec 08, build naming changed from letter + number to just number. Accordingly j105 became 473, based on
// highest build numbers of d51+e81+g97+h66+i69+j105 + 3 for a, b, c
return 638;
return 639;
}
//0.95.80 14 Mar 01 - first beta release
//0.96 2 April 01 beta - second beta release
Expand Down
16 changes: 11 additions & 5 deletions Source/mesquite/lib/PhoneHomeUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public static int getVersion(MesquiteModuleInfo mmi) {
return mmi.getVersionInt();
}
/*.................................................................................................................*/
public static void processSingleNotice(MesquiteModuleInfo mmi, StringBuffer notices, MesquiteInteger countNotices, int forMesquiteVersionLessOrEqual,
public static void processSingleNotice(MesquiteModuleInfo mmi, StringBuffer notices, boolean hideFromDialog, MesquiteInteger countNotices, int forMesquiteVersionLessOrEqual,
int noticeNumber, String noticeType, String message, int lastVersionNoticed, int lastNoticeForMyVersion, int lastNotice,
PhoneHomeRecord phoneHomeRecord, Vector osVector,
int forBuildNumberEqualOrGreater, int forBuildNumberEqualOrLess, int forBuildNumberExactly,
Expand Down Expand Up @@ -302,12 +302,14 @@ else if (updateOnly != null && !"false".equalsIgnoreCase(updateOnly.getValue())
boolean skip = false;
if (noticeType != null && noticeType.equalsIgnoreCase("alert")){
//notices.append( countNotices.toString() + ". " + message + "<hr>\n");
notices.append(message + "<hr>\n");
countNotices.increment();
if (!hideFromDialog){
notices.append(message + "<hr>\n");
countNotices.increment();
}
}
//vvvvvvvvvvvvvvvvvvvv====INSTALL/UPDATE SYSTEM ====vvvvvvvvvvvvvvvvvvvv
else if (noticeType != null && noticeType.equalsIgnoreCase("update")){
if (v != null){
if (v != null && !hideFromDialog){
MesquiteString java = (MesquiteString)v.getElement("java");
MesquiteString requiredName = (MesquiteString)v.getElement("requires");
MesquiteString requiredPath = (MesquiteString)v.getElement("requiredPath");
Expand Down Expand Up @@ -525,6 +527,10 @@ private static String handleMessages(boolean adHoc, String noticesFromHome, Mesq
int forBuildNumberEqualOrGreater = MesquiteInteger.fromString(messageElement.elementText("forBuildNumberEqualOrGreater"));
int forBuildNumberEqualOrLess = MesquiteInteger.fromString(messageElement.elementText("forBuildNumberEqualOrLess"));
int noticeNumber = MesquiteInteger.fromString(messageElement.elementText("noticeNumber"));
String hideFromDialogString = messageElement.elementText("hideFromDialog");
boolean hideFromDialog = false;
if (hideFromDialogString != null && hideFromDialogString.equalsIgnoreCase("true"))
hideFromDialog = true;
String messageType = messageElement.elementText("messageType");
String message = messageElement.elementText("message");
Vector osVector = null;
Expand Down Expand Up @@ -593,7 +599,7 @@ private static String handleMessages(boolean adHoc, String noticesFromHome, Mesq
//^^^^^^^^^^^^^^^^====install/update system ====^^^^^^^^^^^^^^^^

// process other notice tags here if they are present
processSingleNotice(mmi, notices, countNotices, forMesquiteVersionLessOrEqual, noticeNumber, messageType, message, lastVersionNoticed, lastNoticeForMyVersion, lastNotice,phoneHomeRecord, osVector, forBuildNumberEqualOrGreater, forBuildNumberEqualOrLess, forBuildNumberExactly, forPackageVersionEqualOrGreater, forPackageVersionEqualOrLess, forPackageVersionExactly, v, adHoc);
processSingleNotice(mmi, notices, hideFromDialog, countNotices, forMesquiteVersionLessOrEqual, noticeNumber, messageType, message, lastVersionNoticed, lastNoticeForMyVersion, lastNotice,phoneHomeRecord, osVector, forBuildNumberEqualOrGreater, forBuildNumberEqualOrLess, forBuildNumberExactly, forPackageVersionEqualOrGreater, forPackageVersionEqualOrLess, forPackageVersionExactly, v, adHoc);

}
//INSTALLER: here go through updateRecords to figure out which are already installed, which not; which have newer versions already installed, etc.
Expand Down
11 changes: 10 additions & 1 deletion Source/mesquite/trunk/PhoneHomeThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.net.*;
import java.util.*;
import java.io.*;

import mesquite.lib.*;
import mesquite.*;
import mesquite.lib.duties.*;
Expand All @@ -43,8 +44,16 @@ public void checkForMessagesFromAllHomes(){
if (!MesquiteTrunk.suppressVersionReporting){
StringBuffer response = new StringBuffer();
BaseHttpRequestMaker.contactServer(Integer.toString(MesquiteTrunk.getBuildNumber()), "http://mesquiteproject.org/pyMesquiteStartup", response);
}
String r = response.toString();
//if mq3rs is included in response, then this is real response
if (!StringUtil.blank(r) && r.indexOf("mq3rs")>=0){
if (r.indexOf("mq3rsshow")>=0){ //show dialog at startup!!!!
AlertDialog.noticeHTML(MesquiteTrunk.mesquiteTrunk.containerOfModule(),"Note", r, 600, 400, null);
}
}
else if (MesquiteTrunk.debugMode)
MesquiteMessage.warnProgrammer("no response or incorrect response from server on startup");
}
}
catch (Throwable t){
}
Expand Down

0 comments on commit 8e3d4f3

Please sign in to comment.