本文整理匯總了Java中org.opengts.Version類的典型用法代碼示例。如果您正苦於以下問題:Java Version類的具體用法?Java Version怎麽用?Java Version使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Version類屬於org.opengts包,在下文中一共展示了Version類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: _dbPreInit
import org.opengts.Version; //導入依賴的package包/類
/**
*** Initializes runtime keys and 'version' RTConfig constant property
*** @return True if this is the first time this method was called, false otherwise
**/
private static boolean _dbPreInit()
{
/* skip if already initialized */
if (DBConfig._didPreInit) {
return false; // already initialized
}
DBConfig._didPreInit = true;
/* add our custom default properties */
RTKey.addRuntimeEntries(DBConfig.runtimeKeys);
/* init version RTConfig constant property */
Version.initVersionProperty();
/* continue with init */
return true;
}
示例2: getPageNavigationHTML
import org.opengts.Version; //導入依賴的package包/類
public String getPageNavigationHTML(RequestProperties reqState, boolean reInit)
{
if ((reInit || (this.pageNavHTML == null)) && this.hasPageNavigation()) {
String pageNavNames[] = this.getPageNavigation();
PrivateLabel privLbl = this.getPrivateLabel();
if (privLbl == null) {
Print.logWarn("Page Navigation PrivateLabel undefined: " + this.getPageName());
this.pageNavHTML = "";
} else {
// <a href="/track/Track?page=menu.top">Main Menu</a> |
// <a href="/track/Track?page=login">Logout</a>
StringBuffer sb = new StringBuffer();
for (int i = pageNavNames.length - 1; i >= 0; i--) {
String pageName = pageNavNames[i];
WebPage page = privLbl.getWebPage(pageName);
if (page != null) {
if (sb.length() > 0) { sb.append(" | "); }
String uri = WebPageAdaptor.EncodeURL(reqState, page.getPageURI());
String desc = page.getNavigationDescription(reqState);
sb.append("<a href='"+uri+"'>").append(desc).append("</a>");
} else {
String vers = Version.getVersion();
String plName = privLbl.getName();
Print.logWarn("Page not found: " + pageName + " [v="+vers+", pl="+plName+"]");
//Print.logStackTrace("Page not found: " + pageName + " [v="+vers+", pl="+plName+"]");
}
}
this.pageNavHTML = sb.toString();
}
//Print.logStackTrace("Setting Navigation HTML: " + this.pageNavHTML);
} else {
//Print.logStackTrace("Returning Previous Navigation HTML: " + this.pageNavHTML);
}
return this.pageNavHTML;
}
示例3: updateVersions
import org.opengts.Version; //導入依賴的package包/類
public static void updateVersions()
{
/* OpenGTS version */
String gtsCurrVersion = Version.getVersion();
String gtsPropVersion = SystemProps.getGTSVersion();
if (!gtsCurrVersion.equals(gtsPropVersion)) {
Print.logInfo("Updating GTS Version: " + gtsCurrVersion);
SystemProps.setStringValue(SystemProps.GTS_VERSION, gtsCurrVersion);
}
/* OpenDMTP version */
try {
// lazily bind to OpenDMTP Version, in case it is not included in this installation
MethodAction dmtpVersMeth = new MethodAction("org.opendmtp.server.Version", "getVersion");
String dmtpCurrVersion = (String)dmtpVersMeth.invoke();
String dmtpPropVersion = SystemProps.getDMTPVersion();
if (!dmtpCurrVersion.equals(dmtpPropVersion)) {
Print.logInfo("Updating DMTP Version: " + dmtpCurrVersion);
SystemProps.setStringValue(SystemProps.DMTP_VERSION, dmtpCurrVersion);
}
} catch (Throwable th) {
// ignore
}
}
示例4: getVersion
import org.opengts.Version; //導入依賴的package包/類
/**
*** Return the GTS build version
*** @return The GTS build version
**/
public static String getVersion()
{
return org.opengts.Version.getVersion();
}
示例5: writeEvents_GPX
import org.opengts.Version; //導入依賴的package包/類
private boolean writeEvents_GPX(PrintWriter pwout,
Account account, Collection<Device> devList,
BasicPrivateLabel privLabel)
throws IOException
{
String dateFmt = "yyyy-MM-dd'T'HH:mm:ss'Z'";
/* account required */
if (account == null) {
return false;
}
String accountID = account.getAccountID();
TimeZone tz = DateTime.getGMTTimeZone();
/* header */
this.write(pwout, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
this.write(pwout, "<gpx version=\"1.0\"\n");
this.write(pwout, " creator=\"OpenGTS "+Version.getVersion()+" - http://www.opengts.org\"\n");
this.write(pwout, " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n");
this.write(pwout, " xsi:schemaLocation=\"http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd\">\n");
this.write(pwout, " <time>" + (new DateTime(tz)).format(dateFmt) + "</time>\n");
/* track body */
if (!ListTools.isEmpty(devList)) {
for (Device dev : devList) {
String deviceID = dev.getDeviceID();
/* check account ID */
if (!dev.getAccountID().equals(accountID)) {
// mismatched AccountID
continue;
}
/* Device start tag */
this.write(pwout, " <trk>\n");
this.write(pwout, " <name><![CDATA["+deviceID+"]]></name>\n");
this.write(pwout, " <desc><![CDATA["+dev.getDescription()+"]]></desc>\n");
this.write(pwout, " <trkseg>\n");
/* events */
EventData evList[] = dev.getSavedRangeEvents();
if (!ListTools.isEmpty(evList)) {
for (EventData ev : evList) {
this.write(pwout, " <trkpt lat=\"" + ev.getLatitude() + "\" lon=\"" + ev.getLongitude() + "\">\n");
this.write(pwout, " <time>" + (new DateTime(ev.getTimestamp(),tz)).format(dateFmt) + "</time>\n");
this.write(pwout, " <ele>"+ev.getAltitude()+"</ele>\n"); // meters
this.write(pwout, " </trkpt>\n");
}
}
/* Device end tag */
this.write(pwout, " </trkseg>\n");
this.write(pwout, " </trk>\n");
}
}
/* footer */
this.write(pwout, "</gpx>\n");
return true;
}