本文整理汇总了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;
}